:root {
    --ink: #173638;
    --ink-soft: #5b7376;
    --ink-faint: #8a9c9e;
    --petroleum: #123f42;
    --petroleum-deep: #0a3033;
    --teal: #47aeb0;
    --teal-dark: #267f82;
    --teal-soft: #e6f5f5;
    --pink: #eb9f9f;
    --pink-soft: #fbeeee;
    --pink-deep: #9b3d47;
    --sky: #bfe8fb;
    --sky-soft: #ebf7fd;
    --sun-soft: #fff4d6;
    --sun-deep: #7a5a10;
    --paper: #ffffff;
    --canvas: #f3f7f6;
    --line: #dfe9e7;
    --danger: #ad3e48;
    --success: #28775c;
    --success-soft: #e3f4ec;
    --shadow: 0 10px 30px rgba(12, 58, 61, .08);
    --radius: 14px;
    --radius-sm: 10px;
    --font: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
    --tabbar-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: var(--font); font-size: 100%; color: var(--ink); background: var(--canvas); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; line-height: 1.55; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(71, 174, 176, .45); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
h2 { margin-bottom: 6px; font-size: 1.08rem; font-weight: 750; line-height: 1.3; }
h3 { margin-bottom: 6px; font-size: .95rem; font-weight: 750; }
p { margin-bottom: 12px; color: var(--ink-soft); line-height: 1.6; }
p:last-child { margin-bottom: 0; }
.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; }
.eyebrow { margin-bottom: 4px; color: var(--teal-dark); font-size: .7rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.text-link { color: var(--teal-dark); font-weight: 700; text-underline-offset: 3px; }
.muted-empty { color: var(--ink-soft); font-size: .92rem; }
.link-button { padding: 0; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; background: transparent; }
.danger-text { color: var(--danger); }
.inline-form { display: inline; }

/* Buttons & forms */
.button { display: inline-flex; min-height: 48px; padding: 11px 18px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-size: .95rem; font-weight: 700; text-decoration: none; transition: background-color .18s, border-color .18s, color .18s, transform .1s; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button-primary { color: var(--paper); background: var(--petroleum); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { color: var(--petroleum); border-color: #c9d9d7; background: var(--paper); }
.button-secondary:hover { border-color: var(--teal); background: var(--teal-soft); }
.button-danger { color: var(--paper); background: var(--danger); }
.button-quiet { width: 100%; color: #d6e5e3; border-color: rgba(255,255,255,.18); background: transparent; }
.button-quiet:hover { background: rgba(255,255,255,.08); }
.button-instagram { width: 100%; color: #702451; border-color: #e3b9d2; background: #fff6fb; }
.button-small { min-height: 38px; padding: 7px 13px; border-radius: 10px; font-size: .85rem; font-weight: 650; }
.button-block { width: 100%; }
.icon-button { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; color: var(--petroleum); background: transparent; cursor: pointer; }
.icon-button:hover { background: var(--teal-soft); }
.icon-button svg { width: 24px; height: 24px; }
label { color: var(--ink); font-size: .95rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 50px; padding: 12px 14px; color: var(--ink); border: 1px solid #c3d3d1; border-radius: 12px; background: var(--paper); }
input[type="file"] { padding: 10px 12px; font-size: .92rem; }
textarea { resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: var(--teal); }
input:focus, select:focus, textarea:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgba(71, 174, 176, .15); outline: 0; }
input[type="checkbox"], input[type="radio"] { width: 22px; min-height: 22px; height: 22px; margin: 0; padding: 0; accent-color: var(--teal-dark); }
.field-hint { margin: 0; color: var(--ink-soft); font-size: .85rem; font-weight: 500; }
.notice { margin: 0 0 18px; padding: 14px 16px; border-radius: var(--radius-sm); border-left: 4px solid; line-height: 1.5; font-weight: 600; }
.notice.success { color: #1d5c46; border-color: var(--success); background: var(--success-soft); }
.notice.error { color: #812d37; border-color: var(--danger); background: #fff0f1; }
.divider { display: flex; margin: 24px 0; align-items: center; color: var(--ink-faint); gap: 14px; font-size: .8rem; }
.divider::before, .divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }

/* Auth */
.auth-page { background: var(--paper); }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); }
.auth-brand { position: relative; display: flex; min-height: 100vh; overflow: hidden; align-items: flex-end; padding: clamp(40px, 6vw, 92px); background: var(--petroleum); isolation: isolate; }
.auth-brand::before { position: absolute; inset: 0; z-index: -2; content: ""; background: linear-gradient(135deg, var(--petroleum-deep) 0 48%, var(--petroleum) 48% 100%); }
.auth-brand::after { position: absolute; inset: auto -8% -26% 30%; z-index: -1; width: 68%; aspect-ratio: 1; content: ""; border: 1px solid rgba(191, 232, 251, .28); border-radius: 50%; }
.auth-illustration { position: absolute; inset: 7% 5% auto auto; z-index: -1; width: min(58%, 650px); max-height: 57vh; object-fit: contain; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .18)); }
.auth-brand-copy { max-width: 570px; }
.auth-brand-copy h1 { color: var(--paper); font-size: clamp(1.8rem, 3vw, 2.6rem); }
.auth-brand-copy p:not(.eyebrow) { max-width: 520px; margin-bottom: 0; color: #d7e9e7; font-size: 1.05rem; }
.auth-brand-copy .eyebrow { color: var(--pink); }
.auth-panel { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: clamp(30px, 6vw, 80px); justify-content: center; background: var(--paper); }
.brand-link, .sidebar-brand { display: inline-flex; align-items: center; gap: 4px; width: fit-content; color: var(--petroleum); font-weight: 900; text-decoration: none; }
.brand-link { position: absolute; top: clamp(24px, 4vw, 48px); }
.brand-link img { width: 56px; height: 40px; object-fit: contain; }
.brand-link span, .sidebar-brand span { font-size: .92rem; }
.auth-form-wrap { width: min(100%, 440px); margin: auto; }
.auth-form-wrap h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.form-intro { margin-bottom: 24px; font-size: 1.02rem; }
.stack-form { display: grid; gap: 10px; }
.code-input { font-size: 1.8rem; font-weight: 800; letter-spacing: .35em; text-align: center; }
.turnstile-wrap { min-height: 65px; margin: 5px 0; overflow: hidden; }
.cf-turnstile { width: 100%; }
.field-help { margin-top: 10px; text-align: center; font-size: .85rem; }
.stack-form + .text-link { display: inline-block; margin-top: 24px; }
.auth-footer { margin: 32px 0 0; color: var(--ink-faint); text-align: center; font-size: .78rem; }

/* Shell */
.portal-shell { display: grid; min-height: 100vh; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; padding: 26px 16px; flex-direction: column; color: #d7e8e6; background: var(--petroleum-deep); }
.sidebar-brand { margin: 0 8px 40px; color: var(--paper); }
.sidebar-brand img { width: 50px; height: 40px; object-fit: contain; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link { display: flex; min-height: 48px; padding: 10px 12px; align-items: center; gap: 12px; border-radius: 10px; color: #c5d8d6; font-weight: 650; text-decoration: none; }
.nav-link svg { width: 22px; height: 22px; flex: 0 0 22px; opacity: .85; }
.nav-link:hover, .nav-link.active { color: var(--paper); background: rgba(71, 174, 176, .2); }
.nav-link.active { box-shadow: inset 3px 0 var(--pink); }
.sidebar-user { display: grid; margin-top: auto; padding-top: 18px; gap: 2px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user strong { color: var(--paper); font-size: .9rem; }
.sidebar-user span { overflow: hidden; color: #9fb8b5; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user form { margin-top: 12px; }
.portal-content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; min-height: 60px; padding: 8px clamp(16px, 4vw, 48px); align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.topbar-brand { display: none; align-items: center; gap: 6px; color: var(--petroleum); font-weight: 900; font-size: .95rem; text-decoration: none; }
.topbar-brand img { width: 44px; height: 34px; object-fit: contain; }
.topbar-user { display: flex; margin-left: auto; align-items: center; gap: 6px; }
.topbar-name { color: var(--ink-soft); font-size: .9rem; font-weight: 650; }
.topbar-logout { display: none; }
.content-area { width: min(100%, 1180px); margin: 0 auto; padding: clamp(22px, 4vw, 48px) clamp(16px, 4vw, 48px) calc(40px + var(--safe-bottom)); }
.impersonation-banner { display: flex; padding: 8px clamp(16px, 4vw, 48px); align-items: center; justify-content: space-between; gap: 12px; color: var(--sun-deep); border-bottom: 1px solid #e9c66a; background: var(--sun-soft); font-size: .88rem; }
.impersonation-banner strong { color: inherit; }
.impersonation-banner form { flex-shrink: 0; }
.tabbar { display: none; }

/* Page scaffolding */
.page-heading { margin-bottom: 22px; }
.page-heading h1 { margin-bottom: 4px; }
.page-heading > p, .page-heading > div > p:not(.eyebrow) { max-width: 60ch; font-size: 1rem; }
.page-heading.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-heading.compact { margin-bottom: 16px; align-items: flex-start; }
.page-heading.compact h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-heading.compact .status-chip { font-size: .7rem; }
.meta-line { display: flex; margin: 8px 0 0; padding: 0; flex-wrap: wrap; gap: 4px 18px; list-style: none; }
.meta-line li { display: flex; align-items: baseline; gap: 6px; font-size: .86rem; }
.meta-line span { color: var(--ink-soft); }
.meta-line strong { font-weight: 650; }
.count-badge { display: inline-grid; min-width: 22px; height: 22px; margin-left: 6px; padding: 0 6px; place-items: center; border-radius: 999px; color: var(--ink-soft); background: var(--canvas); font-size: .72rem; font-weight: 750; vertical-align: middle; }
.brief-list { display: grid; margin: 0; gap: 0; }
.brief-list div { display: grid; padding: 10px 0; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); }
.brief-list div:first-child { border-top: 0; padding-top: 0; }
.brief-list dt { color: var(--ink-soft); font-size: .82rem; font-weight: 650; }
.brief-list dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: .92rem; line-height: 1.55; }
.brief-text { color: var(--ink); font-size: .92rem; }
.material-forms { display: grid; margin-top: 14px; gap: 8px; }
.material-forms .test-inline-form { margin-top: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.material-forms label span { font-size: .85rem; }
.more-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.more-actions summary { color: var(--ink-soft); cursor: pointer; font-size: .86rem; font-weight: 650; }
.more-actions .test-workflow-actions { margin-top: 10px; }
.page-intro { margin-bottom: 20px; }
.page-intro p { max-width: 60ch; font-size: 1.02rem; }
.back-link { display: inline-flex; margin-bottom: 14px; min-height: 40px; align-items: center; gap: 6px; color: var(--ink-soft); font-size: .9rem; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--teal-dark); }
.card { padding: clamp(18px, 3vw, 24px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.card + .card, .card + .stack-section, .stack-section + .stack-section { margin-top: 16px; }
.stack-section { display: grid; gap: 10px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 10px 0 2px; }
.section-title h2 { margin: 0; font-size: 1.05rem; }
.section-title small, .section-title a { color: var(--ink-soft); font-size: .86rem; font-weight: 650; }
.section-heading { display: flex; margin-bottom: 14px; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; }
.helper-text { margin: -4px 0 12px; color: var(--ink-soft); font-size: .92rem; }
.status-pill, .status-chip { display: inline-flex; width: fit-content; padding: 5px 10px; align-items: center; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.status-pill { color: var(--petroleum); background: var(--sky-soft); }
.status-chip.active, .status-chip.ready, .status-chip.accepted { color: #196048; background: var(--success-soft); }
.status-chip.suspended, .status-chip.awaiting_supplier, .status-chip.invited { color: var(--sun-deep); background: var(--sun-soft); }
.status-chip.archived, .status-chip.draft { color: #6b7271; background: #edf0ef; }
.status-chip.declined { color: #812d37; background: #fff0f1; }
.status-chip.completed { color: var(--petroleum); background: var(--sky); }
.empty-state { padding: 40px 20px; text-align: center; border: 1px dashed #b9cbc8; border-radius: var(--radius); background: rgba(255,255,255,.6); }
.empty-icon { display: grid; width: 44px; height: 44px; margin: 0 auto 14px; place-items: center; border-radius: 50%; color: var(--paper); background: var(--teal-dark); font-weight: 900; }
.empty-state h2 { font-size: 1.1rem; }
.empty-state p { margin: 0; }

/* Staff dashboard widgets */
.metric-grid { display: grid; margin-bottom: 16px; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric-grid.test-metrics { grid-template-columns: repeat(3, 1fr); }
.metric-grid div { display: grid; min-height: 96px; padding: 16px 18px; align-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.metric-grid span { color: var(--ink-soft); font-size: .78rem; font-weight: 650; }
.metric-grid strong { font-size: 1.4rem; }
.welcome-band { display: flex; margin-bottom: 16px; padding: clamp(20px, 3vw, 28px); align-items: center; justify-content: space-between; gap: 20px; color: var(--paper); border-radius: var(--radius); background: var(--petroleum); }
.welcome-band h2 { color: var(--paper); }
.welcome-band p { max-width: 60ch; margin: 0; color: #cfe2e0; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.activity-section { margin-bottom: 16px; padding: clamp(18px, 3vw, 24px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.activity-section .section-heading { margin-bottom: 8px; }
.activity-section h2 { font-size: 1.05rem; }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-list li { display: grid; padding: 12px 0; grid-template-columns: minmax(120px, 1fr) 1fr auto; gap: 14px; border-top: 1px solid var(--line); font-size: .88rem; }
.activity-list time { color: var(--ink-soft); }

/* Tables & filters (staff) */
.filter-bar { display: grid; margin-bottom: 16px; padding: 14px; grid-template-columns: minmax(200px, 1fr) 170px 170px auto; align-items: end; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.filter-bar.supplier-filter { grid-template-columns: minmax(200px, 1fr) 170px auto; }
.filter-bar label, .edit-form label { display: grid; gap: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 12px 16px; color: var(--ink-soft); background: #eef4f3; font-size: .72rem; text-transform: uppercase; }
td { padding: 14px 16px; border-top: 1px solid var(--line); font-size: .9rem; }
td strong, .table-secondary { display: block; }
.table-secondary { margin-top: 2px; color: var(--ink-soft); font-size: .78rem; }
.table-action { text-align: right; white-space: nowrap; }
.table-action .inline-form { margin-right: 14px; }
.table-empty { padding: 40px; color: var(--ink-soft); text-align: center; }
.pagination { display: flex; margin-top: 16px; gap: 6px; }
.pagination a { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: var(--paper); }
.pagination a.active { color: var(--paper); border-color: var(--petroleum); background: var(--petroleum); }
.form-section { max-width: 780px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.edit-form .full-field { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { display: flex; max-width: 780px; margin-top: 20px; padding: 20px; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #e6bfc3; border-radius: var(--radius); background: #fffafa; }
.danger-zone h2 { font-size: 1rem; }
.danger-zone p { margin: 0; font-size: .86rem; }

/* ---------- Test family: dashboard ---------- */
.focus-card { position: relative; padding: clamp(20px, 4vw, 28px); border-radius: var(--radius); color: var(--paper); background: var(--petroleum); box-shadow: var(--shadow); }
.focus-card .focus-label { margin-bottom: 8px; color: var(--pink); font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.focus-card h2 { color: var(--paper); font-size: 1.2rem; }
.focus-card p { color: #d3e4e2; }
.focus-card .button-primary { margin-top: 14px; color: var(--petroleum); background: var(--paper); }
.focus-card .button-primary:hover { background: var(--sky); }
.focus-card.calm { color: var(--ink); background: var(--paper); border: 1px solid var(--line); box-shadow: none; }
.focus-card.calm .focus-label { color: var(--teal-dark); }
.focus-card.calm h2 { color: var(--ink); }
.focus-card.calm p { color: var(--ink-soft); }
.focus-card.calm .button-primary { color: var(--paper); background: var(--petroleum); }
.focus-card.warm { background: linear-gradient(135deg, #7d2f3a, var(--pink-deep)); }
.focus-card.warm .focus-label { color: #f6c9c9; }
.test-card { display: grid; padding: 16px 18px; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.test-card:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.test-card.highlight { border-color: #efc5c5; background: #fffafa; }
.test-card-mark { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; font-weight: 900; }
.test-card-mark.invited { color: var(--pink-deep); background: var(--pink-soft); }
.test-card-mark.accepted { color: var(--teal-dark); background: var(--teal-soft); }
.test-card-mark.completed { color: var(--petroleum); background: var(--sky-soft); }
.test-card-mark svg { width: 22px; height: 22px; }
.test-card-body { display: grid; min-width: 0; gap: 3px; }
.test-card-body strong { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.test-card-body small { color: var(--ink-soft); font-size: .84rem; }
.test-card-body .next { color: var(--teal-dark); font-size: .86rem; font-weight: 700; }
.test-card.highlight .next { color: var(--pink-deep); }
.test-card-chevron { color: var(--ink-faint); font-size: 1.3rem; }
.test-card progress { display: block; width: 100%; height: 6px; margin-top: 6px; border: 0; border-radius: 999px; overflow: hidden; background: #e5eeec; appearance: none; }
.test-card progress::-webkit-progress-bar { background: #e5eeec; }
.test-card progress::-webkit-progress-value { background: var(--teal-dark); border-radius: 999px; }
.test-card progress::-moz-progress-bar { background: var(--teal-dark); }
.quick-links { display: grid; margin-top: 18px; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-links a { display: grid; padding: 16px; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-decoration: none; }
.quick-links a:hover { border-color: var(--teal); }
.quick-links svg { width: 26px; height: 26px; color: var(--teal-dark); margin-bottom: 4px; }
.quick-links strong { font-size: .98rem; }
.quick-links span { color: var(--ink-soft); font-size: .84rem; line-height: 1.45; }
.how-it-works { margin-top: 20px; padding: clamp(18px, 3vw, 24px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.how-it-works h2 { font-size: 1.05rem; }
.how-it-works ol { display: grid; margin: 14px 0 0; padding: 0; gap: 12px; list-style: none; counter-reset: step; }
.how-it-works li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.how-it-works li::before { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--paper); background: var(--teal-dark); content: counter(step); counter-increment: step; font-size: .88rem; font-weight: 800; }
.how-it-works strong { display: block; margin-bottom: 2px; }
.how-it-works span { color: var(--ink-soft); font-size: .9rem; line-height: 1.5; }

/* ---------- Test family: mine tests / alle tests ---------- */
.test-group { display: grid; gap: 10px; }
.test-group + .test-group { margin-top: 22px; }
.test-group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.test-group-heading h2 { margin: 0; font-size: 1.05rem; }
.test-group-heading span { color: var(--ink-soft); font-size: .86rem; font-weight: 650; }
.test-group-heading + p { margin: -4px 0 2px; font-size: .92rem; }
.waiting-card { padding: clamp(24px, 5vw, 40px); text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.waiting-card h2 { font-size: 1.15rem; }
.waiting-card p { max-width: 46ch; margin: 0 auto 18px; }
.waiting-card .button { width: 100%; max-width: 360px; }
.waiting-mark { display: flex; width: 72px; height: 44px; margin: 0 auto 20px; align-items: flex-end; justify-content: center; gap: 7px; }
.waiting-mark span { display: block; width: 12px; border-radius: 4px; background: var(--petroleum); animation: waiting-bars 1.7s ease-in-out infinite; }
.waiting-mark span:nth-child(1) { height: 22px; background: var(--pink); animation-delay: -.35s; }
.waiting-mark span:nth-child(2) { height: 40px; animation-delay: -.15s; }
.waiting-mark span:nth-child(3) { height: 30px; background: var(--teal); }
@keyframes waiting-bars { 0%, 100% { transform: scaleY(.65); } 50% { transform: scaleY(1); } }
.all-tests-list { display: grid; gap: 10px; }
.all-tests-list article { display: grid; padding: 16px 18px; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.all-tests-list article > span:first-child { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; color: var(--petroleum); background: var(--sky-soft); font-size: 1.1rem; font-weight: 900; }
.all-tests-list h2 { margin: 0 0 2px; font-size: 1rem; }
.all-tests-list p { margin: 0; font-size: .86rem; }
.live-row { display: flex; margin-bottom: 12px; align-items: center; gap: 10px; color: var(--ink-soft); font-size: .92rem; }
.live-row strong { color: var(--ink); }
.live-indicator { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--success); animation: live-pulse 2s ease-out infinite; }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(40,119,92,.14); } 50% { box-shadow: 0 0 0 9px rgba(40,119,92,0); } }

/* ---------- Test family: test detail ---------- */
.participation-hero { display: grid; margin-bottom: 14px; padding: clamp(18px, 3vw, 24px); gap: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.participation-brand { display: flex; align-items: center; gap: 16px; }
.participation-logo { display: grid; width: 72px; height: 72px; flex: 0 0 72px; padding: 8px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; color: var(--petroleum); background: var(--paper); font-size: 1.8rem; font-weight: 900; }
.participation-logo img { width: 100%; height: 100%; object-fit: contain; }
.participation-brand h1 { margin: 0 0 2px; font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); overflow-wrap: anywhere; }
.participation-brand p { margin: 0; font-size: .92rem; }
.participation-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.participation-meta div { display: grid; gap: 1px; }
.participation-meta span { color: var(--ink-soft); font-size: .74rem; font-weight: 750; text-transform: uppercase; }
.participation-meta strong { font-size: .95rem; }
.participation-progress { display: grid; gap: 6px; }
.participation-progress progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: #e5eeec; appearance: none; }
.participation-progress progress::-webkit-progress-bar { background: #e5eeec; }
.participation-progress progress::-webkit-progress-value { background: var(--teal-dark); border-radius: 999px; }
.participation-progress progress::-moz-progress-bar { background: var(--teal-dark); }
.participation-progress span { color: var(--ink-soft); font-size: .86rem; }
.invite-card { margin-bottom: 14px; padding: clamp(18px, 3vw, 24px); border: 1px solid #efc5c5; border-radius: var(--radius); background: #fffafa; }
.invite-card .eyebrow { color: var(--pink-deep); }
.invite-card h2 { font-size: 1.15rem; }
.invite-card ul { margin: 0 0 14px; padding-left: 20px; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }
.invite-buttons { display: grid; gap: 8px; }
.invite-buttons form { display: contents; }
.steps { display: grid; gap: 12px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.step.done { border-color: #cfe7db; }
.step.locked { opacity: .72; }
.step-heading { display: grid; padding: 16px 18px; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.step-number { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--paper); background: var(--petroleum); font-size: .92rem; font-weight: 800; }
.step.done .step-number { background: var(--success); }
.step.locked .step-number { color: var(--ink-soft); background: #e6edec; }
.step-heading h2 { margin: 0; font-size: 1.05rem; }
.step-heading p { margin: 0; font-size: .86rem; }
.step-state { padding: 5px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.step-state.todo { color: var(--sun-deep); background: var(--sun-soft); }
.step-state.done { color: var(--success); background: var(--success-soft); }
.step-state.later { color: var(--ink-soft); background: #edf0ef; }
.step-body { padding: 0 18px 18px; }
.step-body > p { color: var(--ink); font-size: .98rem; }
.guidance-box { margin-top: 14px; padding: 14px 16px; border-left: 3px solid var(--teal); border-radius: 0 10px 10px 0; background: var(--canvas); }
.guidance-box h3 { margin-bottom: 4px; font-size: .92rem; }
.guidance-box p { margin: 0; color: var(--ink); font-size: .92rem; }
.resource-list { display: grid; gap: 8px; }
.resource-list a { display: grid; min-height: 56px; padding: 10px 12px; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); text-decoration: none; }
.resource-list a:hover { border-color: var(--teal); }
.resource-list a > span:first-child { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; color: var(--teal-dark); background: var(--teal-soft); font-size: .72rem; font-weight: 900; }
.resource-list strong { overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.resource-list small { display: block; color: var(--ink-soft); font-size: .78rem; }
.resource-list a > span:last-child { color: var(--ink-faint); }
.copy-grid { display: grid; margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.copy-field { display: grid; padding: 12px 14px; gap: 3px; border-radius: 12px; background: var(--canvas); }
.copy-field span { color: var(--ink-soft); font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.copy-field strong { overflow-wrap: anywhere; color: var(--ink); font-size: .95rem; line-height: 1.5; user-select: all; }
.copy-field.highlight { border: 1px dashed var(--pink); background: var(--pink-soft); }
.copy-field.highlight strong { font-size: 1.1rem; letter-spacing: .06em; }
.step-body .button-secondary { margin-top: 12px; width: 100%; }
.submission-list { display: grid; margin-bottom: 12px; gap: 6px; }
.submission-list article { display: flex; min-height: 48px; padding: 8px 12px; align-items: center; justify-content: space-between; gap: 12px; border-radius: 10px; background: var(--canvas); }
.submission-list a { overflow: hidden; color: var(--teal-dark); font-size: .92rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.submission-list form { flex-shrink: 0; }
.submission-list > p { margin: 0 0 8px; font-size: .92rem; }
.submission-form { display: grid; gap: 10px; padding: 14px; border: 1px dashed #c3d3d1; border-radius: 12px; background: var(--paper); }
.submission-form label { display: grid; gap: 6px; }
.submission-form .button { width: 100%; margin-top: 0; }
.completion-card { display: grid; gap: 6px; padding: 18px; border-radius: 12px; background: var(--canvas); }
.completion-card.ready { background: var(--success-soft); }
.completion-card strong { font-size: 1rem; }
.completion-card span { color: var(--ink-soft); font-size: .9rem; }
.completion-card .button { margin-top: 8px; width: 100%; }

/* ---------- Test family: profile ---------- */
.profile-status { display: flex; margin-bottom: 16px; padding: 14px 16px; align-items: center; gap: 12px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.profile-status.ready { border-color: #cfe7db; background: var(--success-soft); }
.profile-status.missing { border-color: #efd9a4; background: var(--sun-soft); }
.profile-status strong { display: block; font-size: .98rem; }
.profile-status span { color: var(--ink-soft); font-size: .88rem; }
.profile-photo-band { display: grid; margin-bottom: 14px; padding: clamp(18px, 3vw, 24px); grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.profile-photo-preview { display: grid; width: 96px; height: 96px; place-items: center; overflow: hidden; border-radius: 50%; color: var(--petroleum); background: var(--sky); font-size: 2.2rem; font-weight: 850; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-band h2 { font-size: 1.05rem; }
.profile-photo-band p { font-size: .88rem; }
.profile-photo-form { display: grid; margin: 10px 0 8px; gap: 8px; }
.profile-form { display: contents; }
.crm-section { margin-bottom: 14px; padding: clamp(18px, 3vw, 24px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.crm-section > p:first-of-type:not(.eyebrow) { margin: -6px 0 16px; font-size: .92rem; }
.consent-grid, .interest-grid { display: grid; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.consent-grid label, .interest-grid label, .partner-toggle { display: flex; min-height: 54px; padding: 12px 14px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); cursor: pointer; }
.consent-grid label:has(input:checked), .interest-grid label:has(input:checked), .partner-toggle:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.profile-bio { display: grid; margin-top: 18px; gap: 6px; }
.instagram-handle { color: var(--teal-dark); font-weight: 800; }
.partner-fields { margin-top: 16px; }
.profile-save-bar { position: sticky; z-index: 5; bottom: calc(12px + var(--safe-bottom)); display: flex; margin: 0 0 20px; padding: 12px 16px; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: rgba(255,255,255,.97); }
.profile-save-bar p { margin: 0; font-size: .86rem; }
.children-list { display: grid; margin: 14px 0; gap: 8px; }
.children-list article { display: flex; padding: 14px 16px; align-items: center; justify-content: space-between; gap: 12px; border-radius: 12px; background: var(--canvas); }
.children-list article > div { display: grid; gap: 2px; }
.children-list span, .children-list small { color: var(--ink-soft); font-size: .86rem; }
.child-create-form { padding-top: 16px; border-top: 1px solid var(--line); }
.tag-list { display: flex; margin-top: 14px; flex-wrap: wrap; gap: 6px; }
.tag-list span { padding: 6px 10px; border-radius: 999px; color: var(--petroleum); background: var(--sky-soft); font-size: .8rem; font-weight: 700; }
.household-partner { display: grid; width: fit-content; margin: 14px 0; padding: 12px 16px; gap: 2px; border-left: 3px solid var(--teal); border-radius: 0 10px 10px 0; background: var(--canvas); }
.household-partner span { color: var(--ink-soft); font-size: .86rem; }
.consent-summary { display: grid; margin: 16px 0 0; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.consent-summary div { padding: 12px 14px; border-radius: 10px; background: var(--canvas); }
.consent-summary dt { color: var(--ink-soft); font-size: .76rem; }
.consent-summary dd { margin: 3px 0 0; font-weight: 750; }

/* ---------- Staff: suppliers / CRM ---------- */
.supplier-cell, .supplier-title { display: flex; align-items: center; gap: 14px; }
.supplier-cell img, .supplier-monogram { width: 44px; height: 44px; flex: 0 0 44px; object-fit: contain; }
.supplier-monogram { display: grid; place-items: center; border-radius: 10px; color: var(--petroleum); font-weight: 850; background: var(--sky); }
.supplier-monogram.large { width: 88px; height: 88px; flex-basis: 88px; font-size: 1.8rem; }
.supplier-title > img { width: min(220px, 24vw); height: 80px; object-fit: contain; object-position: left center; }
.supplier-edit-form label small { color: var(--ink-soft); font-weight: 500; }
.logo-upload-field { display: grid; gap: 12px; }
.logo-upload-field p { max-width: 580px; margin: 0; font-size: .86rem; }
.current-logo { display: flex; width: fit-content; padding: 12px; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.current-logo img { width: min(220px, 45vw); height: 72px; object-fit: contain; }
.check-label { display: flex !important; min-height: 44px; align-items: center; gap: 10px; }
.supplier-summary { display: grid; margin-bottom: 16px; padding: clamp(18px, 3vw, 28px); grid-template-columns: minmax(0, 1.5fr) minmax(240px, .5fr); gap: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.supplier-summary p { margin-bottom: 0; }
.supplier-summary dl { margin: 0; }
.supplier-summary dl div { display: grid; padding: 10px 0; grid-template-columns: 110px 1fr; gap: 12px; border-bottom: 1px solid var(--line); }
.supplier-summary dl div:last-child { border: 0; }
.supplier-summary dt { color: var(--ink-soft); font-size: .78rem; font-weight: 750; }
.supplier-summary dd { margin: 0; font-size: .9rem; }
.contact-grid { display: grid; margin: 14px 0; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.contact-item { position: relative; min-height: 140px; padding: 16px; border-left: 3px solid var(--teal); border-radius: 0 12px 12px 0; background: var(--canvas); }
.contact-item p { margin: 4px 0 12px; font-size: .84rem; }
.contact-item address { display: grid; gap: 5px; font-size: .88rem; font-style: normal; }
.contact-item address a { color: var(--teal-dark); }
.contact-item form { position: absolute; right: 14px; bottom: 12px; }
.primary-label { margin-left: 7px; padding: 3px 6px; color: var(--petroleum); border-radius: 4px; background: var(--sky); font-size: .64rem; text-transform: uppercase; }
.inline-create { margin-top: 16px; border-top: 1px solid var(--line); }
.inline-create summary { width: fit-content; margin-top: 16px; color: var(--teal-dark); cursor: pointer; font-weight: 750; }
.compact-form { margin-top: 16px; }
.user-picker { display: grid; margin: 14px 0; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.user-picker label { display: flex; min-height: 60px; padding: 12px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.user-picker label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.user-picker span { display: grid; gap: 2px; }
.user-picker small { color: var(--ink-soft); font-weight: 500; }
.note-form { display: grid; margin: 14px 0 24px; gap: 10px; }
.note-form .button { width: fit-content; }
.notes-list { display: grid; gap: 8px; }
.notes-list article { padding: 14px 16px; border-left: 3px solid var(--pink); border-radius: 0 12px 12px 0; background: var(--canvas); }
.notes-list article > div { display: flex; justify-content: space-between; gap: 12px; }
.notes-list time { color: var(--ink-soft); font-size: .78rem; }
.notes-list p { margin: 10px 0; color: var(--ink); font-size: .9rem; }

/* ---------- Staff: tests ---------- */
.test-product-fields { padding: 16px; border-left: 3px solid var(--teal); border-radius: 0 12px 12px 0; background: var(--canvas); }
.onboarding-page { min-height: 100vh; background: var(--canvas); }
.onboarding-header { display: flex; min-height: 72px; padding: 14px clamp(16px, 5vw, 60px); align-items: center; border-bottom: 1px solid var(--line); background: var(--paper); }
.onboarding-header .brand-link { position: static; }
.onboarding-shell { width: min(100% - 32px, 960px); margin: 0 auto; padding: clamp(28px, 5vw, 60px) 0; }
.onboarding-footer { padding: 20px; color: var(--ink-soft); text-align: center; font-size: .8rem; }
.test-detail-heading { margin-bottom: 18px; }
.test-title-line { display: flex; align-items: center; gap: 14px; }
.test-title-line h1 { margin: 0; }
.test-guest-link { display: grid; margin-bottom: 14px; padding: 12px 16px; grid-template-columns: auto minmax(0, 1fr); gap: 6px 20px; border-left: 3px solid var(--teal); border-radius: 0 12px 12px 0; background: var(--teal-soft); }
.test-guest-link div { display: grid; }
.test-guest-link span { color: var(--ink-soft); font-size: .8rem; }
.test-guest-link a { overflow: hidden; color: var(--teal-dark); text-overflow: ellipsis; white-space: nowrap; }
.test-facts { display: grid; margin-bottom: 14px; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
.test-facts div { display: grid; min-height: 68px; padding: 12px 14px; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.test-facts span { color: var(--ink-soft); font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.test-facts strong { overflow-wrap: anywhere; font-size: .92rem; }
.test-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 14px; }
.test-detail-main { min-width: 0; }
.test-panel, .test-side-panel { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.test-panel-heading { display: flex; margin-bottom: 12px; align-items: center; justify-content: space-between; gap: 14px; }
.test-panel-heading h2, .test-side-panel h2 { margin: 0; font-size: 1rem; }
.test-side-panel h2 { margin-bottom: 6px; }
.test-side-panel > p { font-size: .88rem; }
.test-panel-heading .eyebrow, .test-side-panel .eyebrow { margin-bottom: 3px; }
.test-brief-preview { display: grid; gap: 12px; }
.test-brief-preview > div:not(.test-brief-primary) { padding-top: 12px; border-top: 1px solid var(--line); }
.test-brief-preview h3 { margin: 0 0 6px; font-size: .9rem; }
.test-brief-preview p { margin: 0; color: var(--ink); font-size: .9rem; line-height: 1.55; }
.test-brief-meta { display: grid; margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.test-brief-meta div { min-width: 0; }
.test-brief-meta dt { margin-bottom: 3px; color: var(--ink-soft); font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.test-brief-meta dd { margin: 0; overflow-wrap: anywhere; font-size: .86rem; }
.test-collapsible-form, .test-inline-form { margin-top: 16px; padding: 16px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--canvas); }
.test-count { display: grid; min-width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--paper); background: var(--petroleum); font-size: .76rem; font-weight: 800; }
.test-material-list { display: grid; }
.test-material-list article { display: grid; min-height: 42px; padding: 8px 0; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.test-material-list article:first-child { border-top: 0; }
.test-material-list article > a { overflow: hidden; color: var(--teal-dark); font-size: .88rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.test-material-type { color: var(--ink-soft); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.test-material-actions { display: flex; margin-top: 14px; padding-top: 12px; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }
.test-inline-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; }
.test-inline-form label { display: grid; gap: 6px; }
.test-link-form { grid-template-columns: minmax(220px, 1fr) minmax(160px, .6fr) auto; }
.test-side-panel > p:last-child { margin: 0; font-size: .88rem; line-height: 1.55; }
.test-workflow-actions { display: grid; margin-top: 14px; gap: 8px; }
.test-workflow-actions form, .test-workflow-actions .button { width: 100%; }
.test-workflow-actions .link-button { width: 100%; padding: 8px; }

/* ---------- Staff: matching / participations ---------- */
.participation-metrics { grid-template-columns: repeat(4, 1fr); }
.match-filter { display: grid; margin-bottom: 16px; padding: 16px; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.match-filter label, .membership-form label { display: grid; gap: 6px; }
.match-filter .form-actions { display: flex; align-items: end; gap: 8px; }
.selection-bar { display: flex; margin-bottom: 10px; padding: 12px; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.selection-bar .check-label { width: fit-content; }
.match-checkbox { width: 22px; min-width: 22px; height: 22px; min-height: 22px; margin: 0; padding: 0; }
.candidate-profile { display: flex; min-width: 190px; align-items: center; gap: 11px; }
.candidate-profile img, .candidate-avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; }
.candidate-profile img { object-fit: cover; }
.candidate-avatar { display: grid; place-items: center; color: var(--petroleum); background: var(--sky); font-weight: 850; }
.selection-controls, .selection-submit, .top-match-selector { display: flex; align-items: center; gap: 12px; }
.selection-submit { flex: 0 0 auto; }
.selection-submit > span { color: var(--ink-soft); font-size: .86rem; white-space: nowrap; }
.selection-submit strong { color: var(--ink); }
.top-match-selector { padding-left: 12px; border-left: 1px solid var(--line); }
.top-match-selector label { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .84rem; }
.top-match-selector input { width: 82px; min-height: 40px; }
.inline-resend { margin-top: 6px; }
.participation-section { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.participation-list, .headline-list { display: grid; }
.participation-list a, .headline-list div { display: flex; min-height: 62px; padding: 12px 4px; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); text-decoration: none; }
.participation-list a:hover { color: var(--teal-dark); }
.participation-list span, .headline-list span { color: var(--ink-soft); font-size: .86rem; text-align: right; }
.membership-form { display: grid; max-width: 560px; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; }
.participation-counts { margin: 12px 0 0; }
.participation-counts div { display: flex; padding: 6px 0; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: .88rem; }
.participation-counts div:last-child { border-bottom: 0; }
.participation-counts dd { margin: 0; font-weight: 750; }

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
    .match-filter { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
    .quick-links { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 900px) {
    .portal-shell { display: block; }
    .sidebar { display: none; }
    .topbar { min-height: 56px; padding: 6px 16px; }
    .topbar-brand { display: inline-flex; }
    .topbar-name { display: none; }
    .topbar-logout { display: block; }
    .content-area { padding: 20px 16px calc(var(--tabbar-height) + 28px + var(--safe-bottom)); }
    .tabbar { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: calc(var(--tabbar-height) + var(--safe-bottom)); padding: 0 6px var(--safe-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); }
    .tabbar a { display: grid; padding: 8px 2px 6px; justify-items: center; align-content: center; gap: 3px; color: var(--ink-soft); font-size: .68rem; font-weight: 700; text-decoration: none; }
    .tabbar svg { width: 24px; height: 24px; }
    .tabbar a.active { color: var(--petroleum); }
    .tabbar a.active svg { color: var(--teal-dark); }
    .tabbar a { position: relative; }
    .tabbar a.active::before { position: absolute; top: 0; left: 50%; width: 28px; height: 3px; content: ""; border-radius: 0 0 3px 3px; background: var(--pink); transform: translateX(-50%); }
    .profile-save-bar { bottom: calc(var(--tabbar-height) + 10px + var(--safe-bottom)); padding: 10px; }
    .profile-save-bar p { display: none; }
    .profile-save-bar .button { width: 100%; }
    .impersonation-banner { padding: 8px 16px; font-size: .82rem; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { min-height: 34vh; padding: 28px 24px; }
    .auth-illustration { inset: 5% 3% auto auto; max-height: 30vh; }
    .auth-brand-copy { max-width: 60%; }
    .auth-brand-copy h1 { font-size: 1.7rem; }
    .auth-panel { min-height: 66vh; padding-top: 96px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .filter-bar, .filter-bar.supplier-filter { grid-template-columns: 1fr 1fr; }
    .test-detail-grid { grid-template-columns: 1fr; }
    .test-detail-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .test-side-panel { margin-bottom: 0; }
}

@media (max-width: 700px) {
    .participation-metrics, .match-filter, .evidence-columns { grid-template-columns: 1fr 1fr; }
    .match-filter .form-actions { grid-column: 1 / -1; }
    .participation-list a, .headline-list div { align-items: flex-start; flex-direction: column; }
    .participation-list span, .headline-list span { text-align: left; }
    .membership-form { grid-template-columns: 1fr; }
    .selection-bar, .selection-controls, .selection-submit { align-items: stretch; flex-direction: column; }
    .selection-controls, .selection-submit { width: 100%; }
    .top-match-selector { width: 100%; padding: 12px 0 0; align-items: end; border-top: 1px solid var(--line); border-left: 0; }
    .top-match-selector label { flex: 1; align-items: stretch; flex-direction: column; }
    .top-match-selector input { width: 100%; }
    .selection-submit .button { width: 100%; }
    .quick-links { grid-template-columns: 1fr; }
    .quick-links a { grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 4px 12px; }
    .quick-links svg { grid-row: 1 / span 2; margin: 0; }
}

@media (max-width: 620px) {
    .auth-brand { min-height: 240px; padding: 22px 20px; }
    .auth-illustration { width: 58%; opacity: .7; }
    .auth-brand-copy { max-width: 85%; }
    .auth-brand-copy h1 { font-size: 1.5rem; }
    .auth-brand-copy p:not(.eyebrow) { display: none; }
    .auth-panel { min-height: calc(100vh - 240px); padding: 84px 20px 40px; }
    .brand-link { top: 22px; }
    .page-heading.split, .welcome-band, .danger-zone, .section-heading { align-items: stretch; flex-direction: column; }
    .page-heading.split .button, .section-heading .button { width: 100%; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .metric-grid div { min-height: 84px; padding: 14px; }
    .metric-grid strong { font-size: 1.4rem; }
    .activity-list li { grid-template-columns: 1fr auto; }
    .activity-list strong { grid-column: 1; }
    .activity-list time { grid-row: 1; grid-column: 2; }
    .filter-bar, .filter-bar.supplier-filter, .edit-form { grid-template-columns: 1fr; }
    .filter-bar .button, .form-actions .button { width: 100%; }
    th:nth-child(4), td:nth-child(4) { display: none; }
    .table-action { white-space: normal; }
    .supplier-heading, .supplier-title { align-items: flex-start; }
    .supplier-title > img { width: 88px; height: 64px; }
    .supplier-summary { grid-template-columns: 1fr; gap: 20px; }
    .contact-grid, .user-picker { grid-template-columns: 1fr; }
    .profile-photo-band { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .profile-photo-form .button { width: 100%; }
    .consent-summary { grid-template-columns: 1fr 1fr; }
    .consent-grid, .interest-grid { grid-template-columns: 1fr 1fr; }
    .test-title-line { align-items: flex-start; flex-direction: column; }
    .test-facts { grid-template-columns: 1fr 1fr; }
    .test-detail-sidebar { grid-template-columns: 1fr; }
    .test-panel, .test-side-panel { padding: 16px; }
    .test-panel-heading { align-items: center; flex-direction: row; }
    .test-panel-heading .button-small { width: auto; }
    .test-panel-heading .button:not(.button-small) { width: 100%; }
    .test-brief-meta { grid-template-columns: 1fr; }
    .brief-list div { grid-template-columns: 1fr; gap: 2px; }
    .page-heading.compact .button { width: auto; }
    .test-material-list article { grid-template-columns: 74px minmax(0, 1fr) auto; }
    .test-material-actions { display: grid; grid-template-columns: 1fr; }
    .test-inline-form, .test-link-form { grid-template-columns: 1fr; }
    .test-inline-form .button { width: 100%; }
    .test-card { grid-template-columns: 44px minmax(0, 1fr); }
    .test-card-chevron { display: none; }
    .participation-brand { align-items: flex-start; }
    .step-heading { grid-template-columns: 34px minmax(0, 1fr); }
    .step-number { width: 34px; height: 34px; font-size: .86rem; }
    .step-state { grid-column: 2; justify-self: start; }
    .copy-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
    .waiting-mark span, .live-indicator { animation: none !important; }
}
