/* Heart Children CHD support card: design system.
   Mobile first: base styles are for phones; min-width breakpoints at 600, 900 and 1200px add space. */

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("fonts/nunito-latin-wght.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("fonts/nunito-latin-ext-wght.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Brand */
    --red: #E4354A;
    --red-strong: #C62C3F;      /* filled buttons: 5.5:1 on white */
    --red-deep: #8E1F2D;
    --red-soft: #FDECEE;
    --blue: #2B9FD6;            /* focus rings and accents only (3.0:1) */
    --link: #1A6A99;
    --navy: #1E3A5F;
    --muted: #4E5F70;
    --bg: #F3F7FB;
    --surface: #FFFFFF;
    --border: #D7E2EC;
    --border-strong: #B9C9D8;
    --sky-soft: #EAF4FB;
    --track: #E3ECF4;

    /* Status */
    --ok-bg: #E5F6EE;
    --ok-fg: #1F5C38;
    --warn-bg: #FFF6E5;
    --warn-border: #E7C77A;
    --warn-fg: #5E4508;
    --info-bg: #E3F2FA;
    --info-fg: #165A7A;
    --danger-bg: #FDE8E8;
    --danger-fg: #7A1F1F;
    --neutral-bg: #EEF2F6;
    --neutral-fg: #3D4B59;

    /* Shape and rhythm */
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 16px;
    --touch: 48px;
    --gutter: 16px;
    --shadow: 0 1px 2px rgba(30, 58, 95, .06), 0 4px 16px rgba(30, 58, 95, .06);
    --shadow-lg: 0 12px 40px rgba(30, 58, 95, .22);
    --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--navy);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0; }
img { max-width: 100%; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--red-strong); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

button, input, select, textarea { font: inherit; color: inherit; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 100;
    background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm);
    font-weight: 800; text-decoration: none;
}
.skip-link:focus { top: 8px; color: #fff; }

.muted { color: var(--muted); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-auto { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--touch); padding: 0 20px;
    border: 2px solid transparent; border-radius: var(--radius);
    font-size: 17px; font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none;
    cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--red-strong); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-deep); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover:not(:disabled) { background: var(--sky-soft); color: var(--navy); }
.btn-quiet { background: var(--surface); color: var(--navy); border-color: var(--border-strong); }
.btn-quiet:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: var(--surface); color: var(--red-deep); border-color: var(--red-strong); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); color: var(--red-deep); }
.btn-lg { min-height: 56px; font-size: 18px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: var(--radius-sm); }
.btn-block { display: flex; width: 100%; }
.btn-link {
    border: 0; background: none; padding: 0; min-height: 44px;
    color: var(--link); font-weight: 800; text-decoration: underline; cursor: pointer;
}
.btn-link:hover { color: var(--red-strong); }
.btn .icon { width: 22px; height: 22px; flex: none; }

/* ---------- Form fields ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label, legend.label { font-weight: 800; font-size: 15px; }
.hint { font-size: 14px; color: var(--muted); }

.input, .select, .textarea {
    width: 100%; min-height: var(--touch);
    border: 1.5px solid var(--border-strong); border-radius: 12px;
    padding: 0 14px; font-size: 17px; background: var(--surface); color: var(--navy);
}
.textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231E3A5F' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--link); outline: 3px solid var(--blue); outline-offset: 1px; }
.input[aria-invalid="true"], .field.has-error .input { border-color: var(--red-strong); }
.field-error { color: var(--red-deep); font-size: 15px; font-weight: 700; }
input[type="date"].input { appearance: none; min-width: 0; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Large choice cards: radios and checkboxes styled as tappable tiles */
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body {
    display: flex; flex-direction: column; gap: 4px; justify-content: center;
    min-height: 56px; padding: 14px 16px;
    border: 1.5px solid var(--border-strong); border-radius: var(--radius-lg);
    background: var(--surface); cursor: pointer; font-weight: 800;
}
.choice-body .choice-sub { font-weight: 600; font-size: 15px; color: var(--muted); }
.choice-body.center { align-items: center; text-align: center; }
.choice input:checked + .choice-body { border: 2.5px solid var(--red-strong); background: var(--red-soft); color: var(--red-deep); padding: 13px 15px; }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--blue); outline-offset: 2px; }
.choice-big .choice-body { padding: 18px 16px; font-size: 18px; }
.choice-big input:checked + .choice-body { padding: 17px 15px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--red-strong); }

/* ---------- Surfaces ---------- */

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 16px;
}
.card-tight { padding: 12px 14px; }
.card h2 + *, .card h3 + * { margin-top: 8px; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }

.alert { border-radius: var(--radius); padding: 12px 14px; font-weight: 700; font-size: 15px; }
.alert strong { font-weight: 800; }
.alert-ok { background: var(--ok-bg); color: var(--ok-fg); }
.alert-warn { background: var(--warn-bg); color: var(--warn-fg); border: 1.5px solid var(--warn-border); }
.alert-info { background: var(--info-bg); color: var(--info-fg); }
.alert-danger { background: var(--danger-bg); color: var(--danger-fg); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.badge {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    min-height: 26px; padding: 2px 10px; border-radius: 13px; font-size: 13px; font-weight: 800;
}
.badge-new { background: var(--info-bg); color: var(--info-fg); }
.badge-replied { background: #EDE7FB; color: #4A2F86; }
.badge-waiting { background: var(--warn-bg); color: var(--warn-fg); }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-run { background: #E1F0F7; color: #0F4E6B; }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge-danger { background: var(--danger-bg); color: var(--danger-fg); }

.chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
    border: 0; border-radius: 20px; background: var(--navy); color: #fff; font-size: 15px; font-weight: 800; cursor: pointer;
}
.chip-filter {
    background: var(--surface); color: var(--navy); border: 1.5px solid var(--border-strong);
    text-decoration: none;
}
.chip-filter[aria-pressed="true"], .chip-filter[aria-current="page"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.steps-num {
    flex: none; width: 28px; height: 28px; border-radius: 14px; background: var(--sky-soft); color: var(--link);
    font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}

dl.details { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 16px; }
dl.details dt { font-size: 14px; font-weight: 700; color: var(--muted); margin-top: 8px; }
dl.details dd { margin: 0; overflow-wrap: anywhere; }

details.disclosure > summary {
    cursor: pointer; font-weight: 800; min-height: var(--touch); display: flex; align-items: center; list-style: none;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "▸"; margin-right: 8px; transition: transform .15s; }
details.disclosure[open] > summary::before { transform: rotate(90deg); }

/* ---------- Public shell ---------- */

.public-header {
    position: sticky; top: 0; z-index: 20;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.public-header-inner {
    max-width: 1080px; margin: 0 auto; height: 60px; padding: 0 var(--gutter);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand img { height: 34px; width: auto; display: block; }
.brand-tag { font-size: 14px; font-weight: 800; color: var(--muted); }
.public-nav { display: flex; gap: 2px; align-items: center; }
.public-nav a { font-weight: 800; font-size: 15px; text-decoration: none; padding: 10px 6px; color: var(--navy); white-space: nowrap; }
.public-nav a:hover { color: var(--red-strong); }

.public-main { max-width: 640px; margin: 0 auto; padding: 20px var(--gutter) 40px; }
.public-main-wide { max-width: 860px; }
.public-main-home { max-width: 1080px; }

.public-footer { border-top: 1px solid var(--border); background: var(--surface); }
.public-footer-inner {
    max-width: 1080px; margin: 0 auto; padding: 20px var(--gutter) 28px;
    display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--muted);
}
.public-footer a { font-weight: 700; }

/* ---------- Home ---------- */

.hero h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; }
.hero p { color: var(--muted); }
.how li { display: flex; gap: 12px; align-items: flex-start; }
.how ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.home-pill { align-self: flex-start; }
.home-hero { display: grid; gap: 28px; }
.home-hero .hero { max-width: 560px; }
/* Two example cards fanned so both designs show; the back one peeks out above and to the right. */
.card-fan { position: relative; margin: 0 auto; width: 100%; max-width: 440px; padding-top: 14%; display: flex; flex-direction: column; gap: 12px; }
.card-fan .card-preview { max-width: none; }
.card-fan-back { position: absolute; top: 0; right: 0; width: 84%; transform: rotate(5deg); }
.card-fan-front { position: relative; width: 84%; transform: rotate(-3deg); }
.card-fan figcaption { text-align: center; }
.home-trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.home-trust li { display: flex; flex-direction: column; padding-left: 30px; position: relative; }
.home-trust li::before { content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' stroke='%231F5C38' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }
.home-trust span { color: var(--muted); }
.home-grid { display: grid; gap: 20px; align-items: start; }
.sponsors { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 8px 0; }
.sponsors h2 { font-size: 18px; }
.sponsor-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.sponsor-list a { display: flex; align-items: center; justify-content: center; min-height: 64px; min-width: 180px; padding: 12px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; }
.sponsor-list img { height: 60px; width: auto; display: block; }
.checklist { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.disclosure > p { margin: 8px 0 0; color: var(--muted); }

/* ---------- Order form (stepper) ---------- */

.progress { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 10px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 14px; font-weight: 800; color: var(--muted); }
.progress-track { margin-top: 8px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.progress-bar { height: 100%; width: 16.66%; background: var(--red-strong); border-radius: 3px; transition: width .25s; }

.form-step { display: flex; flex-direction: column; gap: 16px; }
.form-step + .form-step { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.js .form-step + .form-step { margin-top: 0; padding-top: 0; border-top: 0; }
.js .form-step:not(.is-current) { display: none; }
.form-step > h2 { font-size: 24px; }
.step-actions {
    position: sticky; bottom: 0; z-index: 10;
    display: flex; gap: 10px; margin: 24px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) calc(16px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
}
.step-actions .btn-back { flex: 0 0 96px; }
.step-actions .btn-next, .step-actions .btn-submit { flex: 1 1 auto; }
.no-js-only { display: block; }
.js .no-js-only { display: none; }
.js-only { display: none; }
.js .js-only { display: revert; }
.js .js-only.btn { display: inline-flex; }

.condition-search { position: sticky; top: 60px; z-index: 5; background: var(--bg); padding: 4px 0 8px; }
.condition-groups { display: flex; flex-direction: column; gap: 10px; }
.condition-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.condition-group > summary { padding: 0 14px; font-size: 16px; }
.condition-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--border); cursor: pointer; }
.condition-option input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--red-strong); }
.condition-option .aka { display: block; font-size: 14px; color: var(--muted); }
.condition-option:has(input:checked) { background: var(--red-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.no-matches { padding: 14px; color: var(--muted); }

.photo-stage { position: relative; border-radius: var(--radius-lg); background: #26303B; overflow: hidden; height: 380px; }
.photo-stage img { display: block; max-width: 100%; }
.photo-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.photo-help { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-size: 14px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: none; }
.photo-preview { display: flex; gap: 14px; align-items: center; }
.photo-preview img { width: 84px; height: 108px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #C9D6E2; flex: none; }

.review-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.review-item h3 { font-size: 16px; margin-bottom: 2px; }
.review-item .review-body { color: var(--muted); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }

.reference-box { text-align: center; }
.reference-box .reference { font-size: 36px; font-weight: 800; letter-spacing: .12em; }
.success-mark { align-self: center; width: 64px; height: 64px; border-radius: 32px; background: var(--ok-bg); display: flex; align-items: center; justify-content: center; }

/* Status timeline */
.timeline { list-style: none; margin: 0; padding: 18px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.timeline li { display: flex; gap: 14px; min-height: 58px; }
.timeline .rail { flex: none; display: flex; flex-direction: column; align-items: center; width: 24px; }
.timeline .dot { width: 18px; height: 18px; border-radius: 9px; border: 3px solid var(--border-strong); background: var(--surface); flex: none; }
.timeline .line { flex: 1; width: 3px; background: var(--border); margin: 2px 0; }
.timeline li:last-child .line { display: none; }
.timeline .is-done .dot { background: var(--ok-fg); border-color: var(--ok-fg); }
.timeline .is-done .line { background: var(--ok-fg); }
.timeline .is-current .dot { border-color: var(--red-strong); background: var(--red-soft); }
.timeline .is-cancelled .dot { background: var(--muted); border-color: var(--muted); }
.timeline .label { font-weight: 800; }
.timeline .is-todo .label { color: var(--muted); font-weight: 700; }
.timeline .sub { font-size: 14px; color: var(--muted); padding-bottom: 12px; }

.ask-panel { background: var(--warn-bg); border: 1.5px solid var(--warn-border); border-radius: var(--radius-lg); padding: 16px; color: var(--warn-fg); }
.ask-panel h2 { font-size: 18px; }
.ask-panel .input { color: var(--navy); }

/* ---------- Staff shell ---------- */

.staff-shell { min-height: 100vh; display: flex; flex-direction: column; }
.staff-topbar {
    position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.staff-topbar img { height: 30px; }
.staff-menu-toggle { min-height: 44px; min-width: 44px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 800; padding: 0 12px; cursor: pointer; }
.staff-nav {
    display: none; flex-direction: column; gap: 2px; padding: 12px;
    background: var(--navy); color: #fff;
}
.staff-nav.is-open { display: flex; }
.staff-nav .nav-logo { display: none; }
.staff-nav a, .staff-nav .nav-button {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: var(--touch); padding: 0 14px; border-radius: 12px;
    color: #DCE6F0; text-decoration: none; font-weight: 800; font-size: 16px;
    background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
}
.staff-nav a:hover, .staff-nav .nav-button:hover { background: rgba(255,255,255,.08); color: #fff; }
.staff-nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.staff-nav .nav-count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--red); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.staff-nav .nav-heading { margin: 14px 14px 4px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #9FB3C8; }
.staff-nav .nav-user { margin-top: 12px; padding: 12px 14px 0; border-top: 1px solid rgba(255,255,255,.14); font-size: 14px; color: #B8C7D6; }
.staff-main { flex: 1; min-width: 0; padding: 20px var(--gutter) 40px; }
.staff-page { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head p { color: var(--muted); }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
    display: flex; flex-direction: column; gap: 6px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--navy); text-decoration: none;
}
a.list-item:hover { border-color: var(--navy); color: var(--navy); }
.list-item .ref { font-weight: 800; letter-spacing: .05em; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty h2 { color: var(--navy); margin-bottom: 6px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #F8FAFC; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-cards .table { display: none; }

/* Review screen */
.review-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.review-actions {
    position: sticky; bottom: 0; z-index: 15;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
}
.review-actions .spacer { flex: 1; }

/* The real card artwork with the applicant's details drawn on (CardPreview.razor). Text sizes are in artwork pixels. */
.card-preview { display: grid; gap: 12px; width: 100%; max-width: 420px; }
.card-preview[hidden] { display: none; }
.card-preview-both.cp-wide { max-width: 860px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card-preview .cp-side { display: block; width: 100%; height: auto; border-radius: 3.7% / 5.9%; box-shadow: 0 1px 2px rgba(30, 58, 95, .10), 0 8px 24px rgba(30, 58, 95, .16); background: #fff; }
.card-preview .cp-photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.card-preview .cp-photo[hidden] { display: none; }
.card-preview .cp-field { height: 100%; display: flex; align-items: center; padding-left: 20px; background: #fff; color: #1E3A5F; font: 700 32px/1 Arial, Helvetica, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-preview .cp-id { font-size: 28px; letter-spacing: .06em; }
.card-preview .cp-placeholder { color: #7D8C9B; font-size: 20px; font-weight: 400; font-style: italic; letter-spacing: 0; }
.card-preview .cp-back { height: 100%; background: #fff; color: #111; font-family: Arial, Helvetica, sans-serif; padding: 10px 18px 0; display: flex; flex-direction: column; gap: 8px; }
.card-preview .cp-back-title { margin: 0; font-size: 27px; font-weight: 700; line-height: 1.15; }
.card-preview .cp-medical { display: grid; grid-template-columns: 1fr 230px; gap: 16px; border: 2px solid #111; border-radius: 12px; padding: 8px 16px; }
.card-preview .cp-medical-main, .card-preview .cp-medical-side { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.card-preview .cp-medical-side { border-left: 2px solid #111; padding-left: 16px; }
.card-preview .cp-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #444; }
.card-preview .cp-cond { font-size: 26px; margin-top: 2px; font-weight: 700; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-preview .cp-cond-long { font-size: 20px; }
.card-preview .cp-answer { font-size: 24px; font-weight: 700; line-height: 1.1; margin-bottom: 4px; }
.card-preview .cp-notes { margin: 0; padding-left: 26px; font-size: 18px; line-height: 1.28; }

.section-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.section-row:first-child { border-top: 0; padding-top: 0; }
.section-row h3 { font-size: 15px; color: var(--muted); }
.section-row p { white-space: pre-line; overflow-wrap: anywhere; }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.history li { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 3px solid var(--border); }
.history .when { font-size: 13px; color: var(--muted); }

/* Sheets and dialogs */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 30, 50, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
    width: 100%; max-height: 92vh; overflow-y: auto; background: var(--surface);
    border-radius: 20px 20px 0 0; padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg);
}
.sheet h2 { font-size: 21px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.sheet-actions .btn { flex: 1 1 auto; }

/* Production stepper */
.run-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.run-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; gap: 14px; }
.run-step .num { flex: none; width: 34px; height: 34px; border-radius: 17px; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--track); color: var(--muted); }
.run-step.is-done .num { background: var(--ok-fg); color: #fff; }
.run-step.is-current { border: 2px solid var(--red-strong); padding: 15px; }
.run-step.is-current .num { background: var(--red-strong); color: #fff; }
.run-step .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.run-step .done-note { font-size: 14px; color: var(--ok-fg); font-weight: 700; }

.toast-region { position: fixed; left: 0; right: 0; bottom: 84px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 var(--gutter); }
.toast { pointer-events: auto; max-width: 520px; width: 100%; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 12px 16px; font-weight: 700; box-shadow: var(--shadow-lg); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.toast-error { background: var(--danger-fg); }
.toast button { background: none; border: 0; color: #fff; font-weight: 800; cursor: pointer; min-height: 36px; }

/* Account (sign-in) */
.auth-card { max-width: 420px; margin: 24px auto; }

/* Privacy notice */
.prose { display: flex; flex-direction: column; gap: 14px; }
.prose h2 { margin-top: 12px; font-size: 20px; }
.prose ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; }
.prose dt { font-weight: 800; }
.prose dd { margin: 0; }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: var(--warn-bg); color: var(--warn-fg); padding: 12px 16px; font-weight: 700; box-shadow: var(--shadow-lg);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 12px; }

/* ---------- Breakpoints ---------- */

@media (min-width: 600px) {
    h1 { font-size: 30px; }
    .hero h1 { font-size: 38px; }
    .public-main { padding-top: 32px; }
    dl.details { grid-template-columns: max-content minmax(0, 1fr); }
    dl.details dt { margin-top: 0; }
    .sheet-backdrop { align-items: center; padding: 24px; }
    .sheet { max-width: 560px; border-radius: 20px; padding: 24px; }
    .sheet-actions .btn { flex: 0 0 auto; }
    .step-actions { position: static; margin: 32px 0 0; padding: 0; border: 0; background: none; }
    .step-actions .btn-next, .step-actions .btn-submit { flex: 0 0 auto; min-width: 200px; margin-left: auto; }
}

@media (min-width: 900px) {
    .home-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
    .home-trust { grid-template-columns: repeat(3, 1fr); gap: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; }
    .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .staff-shell { flex-direction: row; }
    .staff-topbar { display: none; }
    .staff-nav {
        display: flex; position: sticky; top: 0; height: 100vh; width: 240px; flex: none; overflow-y: auto; padding: 16px 12px;
    }
    .staff-nav .nav-logo { display: block; background: #fff; border-radius: 12px; padding: 8px 10px; margin-bottom: 16px; }
    .staff-nav .nav-logo img { height: 32px; display: block; }
    .staff-nav .nav-user { margin-top: auto; }
    .staff-main { padding: 28px 32px 48px; }
    .table-cards .table { display: table; }
    .table-cards .list { display: none; }
    .review-layout { grid-template-columns: 400px minmax(0, 1fr); align-items: start; }
    .review-actions { margin: 0 -32px; padding: 14px 32px; }
    .toast-region { bottom: auto; top: 20px; }
}

@media (min-width: 1200px) {
    .staff-nav { width: 260px; }
    .review-layout { grid-template-columns: 440px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
    .public-header, .public-footer, .staff-nav, .staff-topbar, .review-actions, .step-actions { display: none !important; }
}

/* Order form: sections that depend on who is ordering. Without JavaScript both show. */
.js [data-ordered-by="AdultCardholder"] .when-guardian,
.js [data-ordered-by="ParentGuardian"] .when-self { display: none !important; }
.no-js-label { display: inline; }
.js .no-js-label { display: none; }
.js .card-type-choice[data-mode="fixed"] .card-type-options { display: none; }
.card-type-note { display: none; }
.js .card-type-choice[data-mode="fixed"] .card-type-note { display: block; }

/* Privacy notice */
.privacy-page { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 16px; }
.privacy-notice-kicker { font-weight: 800; color: var(--muted); font-size: 15px; }
.privacy-notice-header { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.prose dl.privacy-notice-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--muted); }
.privacy-notice-meta div { display: flex; gap: 6px; }
.prose h2 span { color: var(--red-strong); margin-right: 4px; }
.privacy-callout { background: var(--sky-soft); border-radius: var(--radius); padding: 12px 14px; }
.privacy-contact-list { list-style: none; padding-left: 0 !important; }
.privacy-table-wrap { overflow-x: auto; }
.privacy-retention-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.privacy-retention-table th, .privacy-retention-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
@media (min-width: 600px) { .privacy-page { padding: 32px; } }
