:root {
    color-scheme: light;
    --ink: #17202c;
    --muted: #657386;
    --line: #d7dfe8;
    --blue: #2458d3;
    --blue-dark: #193f9c;
    --blue-soft: #edf3ff;
    --navy: #101b2d;
    --navy-soft: #1c2a40;
    --paper: #ffffff;
    --wash: #f5f7fa;
    --danger: #a12626;
    --success: #17663a;
    --warning: #7a5410;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--wash); }
body { margin: 0; color: var(--ink); background: var(--wash); line-height: 1.5; }
a { color: var(--blue); }
button, input { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.test-banner { position: relative; z-index: 20; padding: .45rem 1rem; color: white; background: #8b2c14; text-align: center; font-size: .78rem; font-weight: 750; letter-spacing: .04em; }
.muted, .field-help { color: var(--muted); }
.field-help { margin: -.25rem 0 .3rem; font-size: .86rem; }
.inline-form { display: inline; }

/* Public/authentication shell */
.auth-body { min-height: 100vh; }
.auth-header { min-height: 66px; padding: 0 max(1rem, calc((100vw - 1120px) / 2)); display: flex; align-items: center; background: var(--navy); }
.brand { color: white; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 700; text-decoration: none; }
.page-shell { width: min(1120px, calc(100% - 2rem)); margin: 2.5rem auto; min-height: calc(100vh - 180px); }
.site-footer { padding: 1rem; color: var(--muted); font-size: .85rem; text-align: center; }
.auth-card { width: min(480px, 100%); margin: 4rem auto; padding: clamp(1.5rem, 5vw, 2.5rem); border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 10px; background: var(--paper); box-shadow: 0 16px 45px rgba(24, 43, 59, .08); }
.auth-card h1, .hero-panel h1, .page-heading h1 { margin: .2rem 0 .6rem; line-height: 1.15; }
.eyebrow { margin: 0; color: var(--blue); font-size: .77rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.stacked-form { display: grid; gap: 1rem; margin-top: 1.6rem; }
.stacked-form label { display: grid; gap: .4rem; font-weight: 650; }
input { width: 100%; padding: .72rem .8rem; border: 1px solid #abb5c0; border-radius: 6px; color: var(--ink); background: white; }
input:focus { outline: 3px solid rgba(36, 88, 211, .2); border-color: var(--blue); }
.check-row { grid-template-columns: auto 1fr; align-items: start; font-weight: 500 !important; }
.check-row input { width: 1.1rem; height: 1.1rem; margin-top: .18rem; }
.code-input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
.primary-button, .secondary-button { padding: .72rem 1rem; border-radius: 6px; font-weight: 700; }
.primary-button { border: 1px solid var(--blue); color: white; background: var(--blue); }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { border: 1px solid var(--blue); color: var(--blue); background: white; }
.link-button { padding: 0; border: 0; color: var(--blue); background: transparent; text-decoration: underline; }
.link-button.danger { color: var(--danger); }
.secondary-action { margin-top: 1rem; text-align: center; }

/* Staff Workspace shell: selected UI direction B */
.workspace-body { min-height: 100vh; background: var(--wash); }
.workspace-header { position: relative; z-index: 10; display: grid; grid-template-columns: 190px auto minmax(220px, 1fr) auto; gap: 1rem; align-items: center; min-height: 64px; padding: 0 max(1rem, calc((100vw - 1440px) / 2)); color: white; background: var(--navy); box-shadow: 0 1px 0 rgba(255, 255, 255, .08); }
.workspace-brand { display: flex; align-items: center; gap: .65rem; color: white; font-size: 1.05rem; font-weight: 700; text-decoration: none; }
.workspace-brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: white; background: var(--blue); font-family: Georgia, serif; }
.workspace-nav { display: flex; align-items: stretch; min-height: 64px; }
.workspace-nav a { display: flex; align-items: center; padding: 0 1rem; color: #bfc9d8; text-decoration: none; }
.workspace-nav a.is-current { color: white; background: var(--navy-soft); }
.workspace-quickfind { justify-self: end; display: grid; grid-template-columns: auto minmax(120px, 300px) auto; align-items: center; max-width: 420px; border: 1px solid #3a485c; border-radius: 6px; color: #bfc9d8; background: #18263a; overflow: hidden; }
.workspace-quickfind > span { padding-left: .75rem; }
.workspace-quickfind input { height: 38px; padding: 0 .6rem; border: 0; outline: 0; color: white; background: transparent; }
.workspace-quickfind input::placeholder { color: #bfc9d8; }
.workspace-quickfind button { height: 38px; padding: 0 .8rem; border: 0; color: white; background: var(--blue); }
.workspace-account { position: relative; }
.workspace-account summary { display: flex; align-items: center; gap: .55rem; list-style: none; cursor: pointer; }
.workspace-account summary::-webkit-details-marker { display: none; }
.workspace-account summary > span:first-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: var(--blue); font-weight: 700; }
.workspace-account-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-account-menu { position: absolute; top: calc(100% + .75rem); right: 0; display: grid; width: 210px; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; box-shadow: 0 16px 36px rgba(16, 27, 45, .2); }
.workspace-account-menu small { padding: .4rem .6rem .6rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.workspace-account-menu a, .workspace-account-menu button { display: block; width: 100%; padding: .65rem; border: 0; color: var(--ink); background: transparent; text-align: left; text-decoration: none; }
.workspace-account-menu a:hover, .workspace-account-menu button:hover { background: var(--blue-soft); }
.workspace-main { width: min(1440px, 100%); margin: 0 auto; }
.mobile-workspace-nav { display: none; }

/* Table-first People and Gifts workspaces */
.list-workspace { min-height: calc(100vh - 64px); padding: 1.5rem 1.4rem 2.25rem; background: #f4f7fb; }
.list-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; max-width: 1440px; margin: 0 auto 1.15rem; }
.list-page-heading h1 { margin: .15rem 0 .3rem; font-size: 1.8rem; line-height: 1.15; }
.list-page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .88rem; }
.list-page-heading .read-only-chip { margin-bottom: .35rem; }
.list-toolbar, .gifts-filter-panel, .list-table-wrap, .list-meta { width: min(100%, 1360px); margin-inline: auto; }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .65rem; }
.list-search { display: flex; align-items: center; gap: .45rem; min-width: min(450px, 100%); flex: 1 1 320px; height: 42px; padding: 0 .7rem; border: 1px solid #abb5c0; border-radius: 6px; color: var(--muted); background: white; }
.list-search input { height: 40px; padding: 0; border: 0; outline: 0; background: transparent; }
.list-search input:focus { outline: 0; }
.list-select select, .filter-field input { min-height: 42px; padding: .58rem .7rem; border: 1px solid #abb5c0; border-radius: 6px; color: var(--ink); background: white; }
.list-select select { min-width: 145px; }
.list-toolbar .primary-button { min-height: 42px; }
.list-meta { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .15rem .55rem; color: var(--muted); font-size: .78rem; }
.list-table-wrap { margin-inline: auto; box-shadow: 0 5px 18px rgba(27, 49, 82, .055); }
.workspace-table { min-width: 940px; }
.workspace-table th { padding: .75rem .9rem; color: #5d6d82; background: #edf2f8; }
.workspace-table td { padding: .75rem .9rem; }
.workspace-table tbody tr:hover { background: #f7faff; }
.workspace-table a { color: var(--blue); font-weight: 700; text-decoration: none; }
.workspace-table a:hover { text-decoration: underline; }
.table-person { display: flex; align-items: center; gap: .65rem; min-width: 190px; }
.table-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; color: var(--blue); background: #e5edff; font-size: .72rem; font-weight: 800; }
.table-person > div { min-width: 0; }
.workspace-table small { display: block; margin-top: .12rem; color: var(--muted); font-size: .72rem; font-weight: 500; }
.contact-flags { display: flex; flex-wrap: wrap; gap: .25rem; min-width: 150px; }
.contact-flag { display: inline-block; padding: .2rem .45rem; border-radius: 999px; color: #2d5a98; background: #eaf1ff; font-size: .7rem; white-space: nowrap; }
.contact-flag-empty { color: var(--muted); background: #eef2f7; }
.text-nowrap { white-space: nowrap; }
.text-end { text-align: right !important; }
.text-destructive { color: var(--danger) !important; }
.list-empty { padding: 2.5rem 1rem; color: var(--muted); text-align: center; }
.list-empty strong { color: var(--ink); }
.list-empty p { margin: .25rem 0 0; }
.list-pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: .8rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; text-align: center; }
.list-pagination a:first-child { text-align: left; }
.list-pagination a:last-child { text-align: right; }
.list-pagination a { color: var(--blue); text-decoration: none; }
.gifts-filter-panel { display: grid; gap: .7rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 4px 14px rgba(27, 49, 82, .04); }
.gifts-filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.gifts-filter-primary .list-search { flex-basis: 380px; }
.filter-field { display: grid; gap: .25rem; min-width: 130px; flex: 1 1 145px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.filter-field input { width: 100%; }
.gifts-filter-primary .filter-field { max-width: 230px; }
.gifts-filter-secondary .filter-field { max-width: 185px; }
.filter-reset { align-self: center; margin-left: auto; color: var(--blue); font-size: .8rem; text-decoration: none; }
.filter-reset:hover { text-decoration: underline; }
.gift-detail-line { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .3rem; }
.gift-detail-chip { display: inline-block; margin: .1rem .25rem .1rem 0; padding: .18rem .45rem; border-radius: 999px; color: #536176; background: #eef2f7; font-size: .7rem; white-space: nowrap; }
.gift-designated { color: var(--blue) !important; font-weight: 700 !important; }
.gift-memo { max-width: 250px; min-width: 150px; color: #39475a; }
.gift-amount { color: #12633b; font-size: 1rem; font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }

/* Contact finder and detail */
.people-workspace { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: calc(100vh - 64px); background: var(--paper); }
.contact-finder { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--line); background: var(--wash); }
.finder-heading { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.1rem .8rem; }
.finder-heading > div { display: grid; }
.finder-heading span:first-child { color: var(--muted); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.finder-heading h1 { margin: .1rem 0 0; font-size: 1.4rem; line-height: 1.2; }
.read-only-chip { display: inline-flex; align-items: center; width: max-content; padding: .25rem .55rem; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: .72rem; font-weight: 700; }
.finder-search { padding: 0 1.1rem; }
.finder-search > label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .72rem; }
.finder-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.finder-search-row input { height: 42px; border-radius: 6px 0 0 6px; }
.finder-search-row button { padding: 0 .8rem; border: 1px solid var(--blue); border-radius: 0 6px 6px 0; color: white; background: var(--blue); }
.finder-filters { display: flex; gap: .4rem; padding: .8rem 1.1rem; }
.finder-filters a { padding: .4rem .65rem; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: white; font-size: .82rem; text-decoration: none; }
.finder-filters a.is-selected { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.finder-result-summary { display: flex; justify-content: space-between; padding: .35rem 1.1rem; color: var(--muted); font-size: .76rem; }
.contact-results { display: grid; align-content: start; gap: .22rem; padding: .35rem .7rem; }
.contact-result { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: .65rem; align-items: center; padding: .7rem; border: 1px solid transparent; border-radius: 7px; color: var(--ink); text-decoration: none; }
.contact-result:hover { background: white; }
.contact-result.is-selected { border-color: #bbcdf7; background: var(--blue-soft); }
.contact-initials, .detail-initials { display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: #e5edff; font-weight: 700; }
.contact-initials { width: 38px; height: 38px; font-size: .8rem; }
.contact-result-copy { display: grid; min-width: 0; }
.contact-result-copy strong, .contact-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-result-copy strong { font-size: .9rem; }
.contact-result-copy small { color: var(--muted); font-size: .75rem; }
.contact-chevron { color: var(--muted); font-size: 1.35rem; }
.finder-empty { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.finder-empty strong { color: var(--ink); }
.finder-empty p { margin: .25rem 0; }
.finder-pagination { display: flex; justify-content: space-between; gap: .75rem; padding: .8rem 1.1rem 1.2rem; margin-top: auto; }
.finder-pagination a { color: var(--blue); font-size: .82rem; text-decoration: none; }
.contact-detail { min-width: 0; background: #f4f7fb; }
.contact-welcome { width: min(600px, calc(100% - 3rem)); margin: 5rem auto; text-align: center; }
.contact-welcome-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 14px; color: var(--blue); background: var(--blue-soft); font-size: 2rem; }
.contact-welcome h2 { margin: 0; font-size: 1.6rem; }
.contact-welcome > p { color: var(--muted); }
.contact-welcome dl { margin: 2rem 0 0; border-top: 1px solid var(--line); text-align: left; }
.contact-welcome dl div { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.contact-welcome dt { color: var(--muted); }
.contact-welcome dd { margin: 0; }
.mobile-back-results { display: none; }
.contact-detail-heading { display: flex; align-items: center; gap: 1rem; min-height: 138px; padding: 1.6rem 1.8rem; color: white; background: linear-gradient(120deg, #14243b 0%, #1b3152 60%, #254b87 100%); }
.detail-identity { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.detail-initials { width: 72px; height: 72px; flex: 0 0 auto; border: 3px solid rgba(255, 255, 255, .2); color: white; background: linear-gradient(145deg, #4778e2, #2458d3); box-shadow: 0 10px 24px rgba(7, 18, 37, .25); font-size: 1.2rem; }
.detail-identity-copy { min-width: 0; }
.detail-record-id { color: #b7c8e2; font-size: .7rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.detail-identity h1 { margin: .08rem 0; color: white; font-size: 2rem; line-height: 1.15; }
.detail-identity p { margin: 0; color: #d4dfef; }
.identity-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.identity-badges span { padding: .18rem .5rem; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; color: #edf4ff; background: rgba(255, 255, 255, .08); font-size: .7rem; font-weight: 700; }
.identity-badges span.status-deceased { color: #ffe4e4; background: rgba(144, 34, 34, .45); }
.contact-hero-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.contact-hero-actions > a { display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: .5rem .75rem; border: 1px solid rgba(255, 255, 255, .3); border-radius: 7px; color: white; background: rgba(255, 255, 255, .08); text-decoration: none; }
.contact-hero-actions > a:hover { background: rgba(255, 255, 255, .16); }
.contact-hero-actions .read-only-chip { border: 1px solid rgba(255, 255, 255, .18); color: #e4ecf8; background: rgba(10, 23, 43, .35); }
.status-flag { display: inline-block; margin-left: .5rem; padding: .15rem .45rem; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.status-deceased { color: #7a3030; background: #fbe8e8; }
.contact-fact-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: white; }
.contact-fact-strip > div { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 .65rem; min-width: 0; padding: 1rem 1.15rem; border-right: 1px solid var(--line); }
.contact-fact-strip > div:last-child { border-right: 0; }
.contact-fact-strip .fact-icon { grid-row: 1 / span 3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.contact-fact-strip small { color: var(--muted); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.contact-fact-strip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .93rem; }
.contact-fact-strip em { color: var(--muted); font-size: .72rem; font-style: normal; }
.detail-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; padding: .85rem 1.4rem; border-bottom: 1px solid var(--line); background: #edf2f8; }
.detail-tabs > span, .detail-tabs > a { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: .7rem; align-items: center; min-height: 60px; padding: .55rem .7rem; border: 1px solid #d6deea; border-radius: 9px; color: #4e5d71; background: rgba(255, 255, 255, .72); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.detail-tabs > a:hover { border-color: #9eb5e7; box-shadow: 0 4px 12px rgba(29, 55, 96, .08); transform: translateY(-1px); }
.detail-tabs > span.is-selected, .detail-tabs > a.is-selected { border-color: #8eacee; color: var(--blue-dark); background: white; box-shadow: 0 4px 14px rgba(36, 88, 211, .12); }
.detail-tabs .tab-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-weight: 850; }
.detail-tabs a.is-selected .tab-icon { color: white; background: var(--blue); }
.detail-tabs a > span:nth-child(2) { display: grid; min-width: 0; }
.detail-tabs strong { line-height: 1.15; }
.detail-tabs small { color: #7d899a; font-size: .7rem; }
.detail-tabs b { color: #9ca8b8; font-size: 1.35rem; font-weight: 400; }
.contact-detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .85fr); gap: 1rem; padding: 1.25rem 1.4rem 2rem; }
.contact-detail-primary, .contact-detail-secondary { display: grid; align-content: start; gap: 1rem; min-width: 0; }
.detail-section { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 5px 18px rgba(27, 49, 82, .055); }
.detail-section-heading { display: flex; align-items: center; justify-content: flex-start; gap: .7rem; padding-bottom: .85rem; }
.detail-section-heading > div { min-width: 0; }
.detail-section-heading h2 { margin: 0; font-size: 1rem; }
.detail-section-heading p { margin: .12rem 0 0; color: var(--muted); font-size: .75rem; }
.section-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.detail-list, .detail-stack { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 1rem; padding: .72rem 0; border-top: 1px solid var(--line); }
.detail-list dt, .detail-stack dt { color: var(--muted); font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .035em; }
.detail-list dd, .detail-stack dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.detail-stack > div { padding: .65rem 0; border-top: 1px solid var(--line); }
.detail-stack dd { margin-top: .2rem; font-weight: 650; }
.record-audit-section { background: #f9fbfd; }

/* Release 0.3 read-only giving and communication workspaces */
.record-workspace { padding: 1.25rem 1.4rem 2rem; }
.record-section-intro { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.record-section-intro > div { display: flex; align-items: center; gap: .75rem; }
.record-section-intro .section-icon { width: 44px; height: 44px; border-radius: 11px; font-size: 1.1rem; }
.record-section-intro h2 { margin: 0; font-size: 1.2rem; }
.record-section-intro p { margin: .15rem 0 0; color: var(--muted); font-size: .84rem; }
.record-columns { display: grid; grid-template-columns: minmax(0, 1fr) 275px; gap: 1rem; align-items: start; }
.record-history { min-width: 0; padding: 0; overflow: hidden; }
.record-empty { padding: 2.5rem 1rem; border-top: 1px solid var(--line); text-align: center; }
.record-empty p { margin-bottom: 0; color: var(--muted); }
.donation-list { display: grid; gap: .75rem; padding: 1rem; background: #f9fbfe; }
.donation-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: .85rem; padding: 1rem; border: 1px solid #dce4ee; border-radius: 10px; background: white; box-shadow: 0 3px 10px rgba(27, 49, 82, .045); }
.gift-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #167044; background: #e8f7ef; font-size: 1.1rem; font-weight: 850; }
.donation-fund header { display: flex; justify-content: space-between; gap: 1rem; }
.donation-fund header > div { display: grid; }
.donation-fund header span { color: var(--muted); font-size: .78rem; }
.donation-fund header b { color: #12633b; font-size: 1.15rem; white-space: nowrap; }
.gift-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.gift-tags span, .donation-fund footer span { padding: .18rem .46rem; border-radius: 999px; color: #536176; background: #eef2f7; font-size: .7rem; }
.donation-fund p { margin: .7rem 0; padding: .65rem .75rem; border-left: 3px solid #b9c9ec; color: #39475a; background: #f6f8fc; white-space: pre-wrap; }
.donation-fund footer { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.donation-fund footer span.is-designated { color: var(--blue-dark); background: var(--blue-soft); font-weight: 700; }
.annual-totals { padding: 1rem; }
.annual-bars { display: grid; gap: 1rem; }
.annual-bars > div { padding-top: .8rem; border-top: 1px solid var(--line); }
.annual-bars header { display: flex; justify-content: space-between; gap: .75rem; align-items: end; margin-bottom: .45rem; }
.annual-bars header > span { display: grid; }
.annual-bars small { color: var(--muted); font-size: .72rem; }
.annual-bars b { font-size: .85rem; }
.annual-bars progress { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: #e7ecf3; }
.annual-bars progress::-webkit-progress-bar { background: #e7ecf3; }
.annual-bars progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, #2458d3, #6e98f2); }
.annual-bars progress::-moz-progress-bar { border-radius: 99px; background: #2458d3; }
.data-note { margin: 1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.history-pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: .85rem 1.1rem; border-top: 1px solid var(--line); font-size: .9rem; }
.history-pagination a:last-child { text-align: right; }
.history-pagination > span { color: var(--muted); }
.activity-history { max-width: 980px; margin: 0 auto; border: 0; background: transparent; box-shadow: none; }
.activity-timeline { position: relative; display: grid; gap: .8rem; }
.activity-timeline::before { position: absolute; top: 25px; bottom: 25px; left: 27px; width: 2px; content: ''; background: #cfd9e8; }
.activity-entry { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: .8rem; }
.activity-marker { z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; border: 5px solid #f4f7fb; border-radius: 50%; color: var(--blue); background: white; box-shadow: 0 0 0 1px #c9d5e7; font-size: 1rem; }
.activity-copy { padding: 1rem 1.1rem; border: 1px solid #d7e0ec; border-radius: 11px; background: white; box-shadow: 0 5px 16px rgba(27, 49, 82, .055); }
.activity-copy header { display: flex; justify-content: space-between; gap: 1rem; }
.activity-copy header strong { font-size: 1rem; }
.activity-copy time { color: var(--muted); white-space: nowrap; }
.activity-note { margin: .8rem 0; padding: .75rem .85rem; border-radius: 7px; color: #39475a; background: #f5f7fa; overflow-wrap: anywhere; }
.activity-note.is-empty { color: var(--muted); font-style: italic; }
.activity-copy footer { display: flex; flex-wrap: wrap; gap: .7rem 1.25rem; color: var(--muted); font-size: .75rem; }
.activity-copy footer span { display: grid; }
.activity-copy footer b { color: #7a8798; font-size: .65rem; letter-spacing: .035em; text-transform: uppercase; }

/* Shared status/account pages */
.notice { width: min(1120px, calc(100% - 2rem)); padding: .8rem 1rem; margin: 1rem auto; border: 1px solid; border-radius: 7px; }
.notice-warning { border-color: #e0bb66; color: #684b0e; background: #fff8e8; }
.user-testing-banner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.user-testing-banner form { margin: 0; }
.notice-error { border-color: #d89999; color: #7c1e1e; background: #fff0f0; }
.notice-success { border-color: #87c49f; color: var(--success); background: #edf9f1; }
.hero-panel, .status-card, .table-wrap, .page-heading { margin-inline: 1rem; }
.hero-panel { padding: clamp(1.5rem, 4vw, 2.6rem); margin-top: 1.5rem; border-left: 6px solid var(--blue); border-radius: 8px; background: var(--paper); }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem; }
.status-card { padding: 1.25rem; margin: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.status-card h2 { margin-top: 0; font-size: 1.08rem; }
.status-card dl { margin: 0; }
.status-card dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid #edf0f2; }
.status-card dt { color: var(--muted); }
.status-card dd { margin: 0; font-weight: 700; text-align: right; }
.full-span { grid-column: 1 / -1; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding-top: 1.5rem; margin-bottom: 1.2rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef2f5; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
td small { display: block; color: var(--muted); }
.pill { display: inline-block; margin-left: .35rem; padding: .08rem .45rem; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: .72rem; font-weight: 750; }
.check-list { margin: 0; padding: 0; list-style: none; }
.check-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }

@media (max-width: 1000px) {
    .workspace-header { grid-template-columns: 175px auto minmax(180px, 1fr) auto; }
    .workspace-account-name { display: none; }
    .people-workspace { grid-template-columns: 300px minmax(0, 1fr); }
    .contact-detail-grid { grid-template-columns: 1fr; }
    .contact-detail-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .record-audit-section { grid-column: 1 / -1; }
    .contact-fact-strip > div { grid-template-columns: 28px minmax(0, 1fr); padding-inline: .8rem; }
    .contact-fact-strip .fact-icon { width: 28px; height: 28px; }
    .contact-hero-actions > a { padding-inline: .6rem; }
}

@media (max-width: 820px) {
    .workspace-header { grid-template-columns: 1fr auto; min-height: 58px; padding: 0 1rem; }
    .workspace-nav, .workspace-quickfind { display: none; }
    .workspace-main { padding-bottom: 64px; }
    .mobile-workspace-nav { position: fixed; z-index: 9; right: 0; bottom: 0; left: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-height: 62px; border-top: 1px solid var(--line); background: white; box-shadow: 0 -5px 20px rgba(16, 27, 45, .08); }
    .mobile-workspace-nav a { display: grid; place-items: center; align-content: center; gap: .1rem; color: var(--muted); font-size: .72rem; text-decoration: none; }
    .mobile-workspace-nav a span { font-size: 1.05rem; }
    .mobile-workspace-nav a.is-current { color: var(--blue); }
    .people-workspace { display: block; min-height: calc(100vh - 120px); }
    .contact-finder { min-height: calc(100vh - 120px); border-right: 0; }
    .people-workspace.has-selection .contact-finder { display: none; }
    .people-workspace.has-no-selection .contact-detail { display: none; }
    .mobile-back-results { display: inline-block; margin: 1rem 1rem 0; color: var(--blue); text-decoration: none; }
    .contact-detail-heading { min-height: auto; padding: 1.2rem 1rem; }
    .contact-fact-strip { grid-template-columns: repeat(2, 1fr); }
    .contact-fact-strip > div:nth-child(2) { border-right: 0; }
    .contact-fact-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .contact-detail-grid { padding: 1rem; }
    .detail-tabs { gap: .45rem; padding: .7rem; }
    .detail-tabs > span, .detail-tabs > a { grid-template-columns: 34px minmax(0, 1fr); min-height: 54px; padding: .45rem; }
    .detail-tabs .tab-icon { width: 34px; height: 34px; }
    .detail-tabs b { display: none; }
    .record-columns { grid-template-columns: 1fr; }
    .status-grid { grid-template-columns: 1fr; }
    .full-span { grid-column: auto; }
    .page-heading { align-items: start; flex-direction: column; }
    .list-workspace { min-height: calc(100vh - 120px); padding: 1.1rem .85rem 1.5rem; }
    .list-page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 1rem; }
    .list-page-heading .read-only-chip { margin-bottom: 0; }
    .gifts-filter-panel { padding: .75rem; }
    .gifts-filter-primary, .gifts-filter-secondary { align-items: stretch; }
    .gifts-filter-primary .list-search, .gifts-filter-primary .filter-field, .gifts-filter-primary .primary-button, .gifts-filter-secondary .filter-field { max-width: none; flex-basis: 100%; }
    .filter-reset { margin-left: 0; }
}

.admin-workspace { max-width: 1280px; margin: 0 auto; padding: 1.75rem; }
.admin-actions, .admin-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.admin-workspace a.primary-button, .admin-workspace a.secondary-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.admin-workspace button:disabled, .admin-workspace input:disabled { opacity: .55; cursor: not-allowed; }
.admin-workspace > .field-help { margin-top: 1rem; }
.admin-search { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.admin-search input { flex: 1 1 240px; max-width: 500px; min-width: 0; }
.admin-search select { font: inherit; padding: .72rem .8rem; border: 1px solid #abb5c0; border-radius: 6px; color: var(--ink); background: white; max-width: 100%; }
.admin-form-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1.5rem; align-items: start; }
.admin-form-layout > .stacked-form { margin-top: 0; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; min-width: 0; }
.admin-card select { font: inherit; padding: .72rem .8rem; border: 1px solid #abb5c0; border-radius: 6px; color: var(--ink); background: white; }
.admin-card h2 { margin-top: 0; }
.admin-card input, .admin-card select { width: 100%; }
.admin-card .check-row input { width: auto; flex-shrink: 0; }
.admin-card .field-help { margin-top: -.25rem; }
.admin-form-layout aside .field-help { margin-top: .85rem; }
.admin-confirm { max-width: 230px; font-size: .85rem; }
.admin-confirm summary { cursor: pointer; color: var(--muted); }
.admin-pagination { margin-top: 1rem; }
.desktop-mapping-form { margin-top: 1.5rem; max-width: 760px; }
.comment-card { max-width: 980px; margin: 0 auto 1.5rem; }
.comment-card > summary { display: flex; align-items: center; gap: .75rem; cursor: pointer; list-style: none; font-weight: 700; color: var(--ink); }
.comment-card > summary::-webkit-details-marker { display: none; }
.comment-card > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 6px; }
.comment-card-chevron { margin-left: auto; font-size: 1.6rem; }
.comment-card[open] .comment-card-chevron { transform: rotate(90deg); }
.comment-form { margin: 1rem 0 0; }
.comment-form > p { margin: 0; }
.comment-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.comment-dates input { width: 100%; min-width: 0; font: inherit; padding: .7rem .8rem; color: var(--ink); border: 1px solid #abb5c0; border-radius: 6px; background: white; }
.comment-form textarea { width: 100%; resize: vertical; font: inherit; padding: .8rem; border: 1px solid #abb5c0; border-radius: 6px; }
@media (max-width: 800px) {
    .admin-workspace { padding: 1rem; }
    .admin-form-layout { grid-template-columns: 1fr; }
    .admin-search { align-items: stretch; }
    .admin-search label { flex-basis: 100%; }
    .admin-search input { max-width: none; }
}

@media (max-width: 560px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    .auth-card { margin-top: 2rem; }
    .finder-heading { padding-top: 1rem; }
    .contact-detail-heading { align-items: flex-start; flex-wrap: wrap; }
    .detail-initials { width: 58px; height: 58px; }
    .detail-identity h1 { font-size: 1.45rem; }
    .contact-hero-actions { width: 100%; min-width: 0; margin-left: 0; padding-left: 68px; }
    .contact-hero-actions > a { flex: 1 1 0; min-width: 0; justify-content: center; }
    .contact-hero-actions .read-only-chip { display: none; }
    .contact-fact-strip > div { padding: .75rem 1rem; }
    .contact-detail-secondary { grid-template-columns: 1fr; }
    .record-audit-section { grid-column: auto; }
    .detail-list > div { grid-template-columns: 1fr; gap: .2rem; }
    .contact-welcome dl div { grid-template-columns: 1fr; gap: .2rem; }
    .workspace-account-menu { position: fixed; top: 58px; right: .75rem; }
    .record-workspace { padding: 1rem; }
    .record-section-intro, .record-section-intro > div { min-width: 0; }
    .record-section-intro { align-items: flex-start; }
    .record-section-intro p { overflow-wrap: anywhere; }
    .record-section-intro .read-only-chip { display: none; }
    .detail-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; min-width: 0; }
    .detail-tabs > span, .detail-tabs > a { display: grid; grid-template-columns: 1fr; min-width: 0; place-items: center; gap: .25rem; text-align: center; }
    .detail-tabs a > span:nth-child(2) { display: block; }
    .detail-tabs small { display: none; }
    .donation-list { padding: .65rem; }
    .donation-row { grid-template-columns: 34px minmax(0, 1fr); gap: .65rem; padding: .8rem; }
    .gift-mark { width: 34px; height: 34px; }
    .donation-fund header b { font-size: 1rem; }
    .activity-entry { grid-template-columns: 42px minmax(0, 1fr); }
    .activity-marker { width: 42px; height: 42px; border-width: 4px; }
    .activity-timeline::before { left: 20px; }
    .activity-copy { padding: .85rem; }
    .activity-copy header { display: grid; gap: .25rem; }
}
