:root {
    color-scheme: light;
    --primary: #1463a5;
    --primary-strong: #0e4b80;
    --navy: #0b2742;
    --health: #159a72;
    --bg: #f5f8fb;
    --surface: #ffffff;
    --surface-soft: #edf4f8;
    --text: #163047;
    --muted: #617488;
    --border: #dce7ef;
    --danger: #c83e4d;
    --warning: #a66710;
    --shadow: 0 22px 55px rgba(15, 54, 84, .10);
}

.payment-checkout {
    background: var(--surface, #fff);
    border: 1px solid var(--line, #dce7ef);
    border-radius: 18px;
    margin-top: 24px;
    padding: clamp(18px, 3vw, 30px);
    text-align: left;
}

.payment-checkout h2 {
    margin-top: 0;
}

.payment-test-card {
    background: color-mix(in srgb, var(--health, #159a72) 8%, var(--surface, #fff));
    border: 1px solid color-mix(in srgb, var(--health, #159a72) 35%, var(--line, #dce7ef));
    border-radius: 14px;
    color: var(--text, #163047);
    display: grid;
    gap: 6px;
    margin: 16px 0 20px;
    padding: 14px 16px;
}

.payment-test-card strong {
    color: var(--health, #159a72);
}

.payment-test-card span {
    font-size: 14px;
}

.payment-yape-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.payment-yape-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.payment-yape-form input {
    border: 1px solid var(--border, #dce7ef);
    border-radius: 12px;
    color: var(--text, #163047);
    font: inherit;
    min-height: 48px;
    padding: 10px 14px;
}

.payment-yape-form input:focus {
    border-color: var(--primary, #1463a5);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #1463a5) 16%, transparent);
    outline: none;
}

.payment-yape-form .button {
    justify-self: flex-start;
}

.payment-challenge {
    border: 1px solid var(--line, #dce7ef);
    border-radius: 16px;
    min-height: 560px;
    overflow: hidden;
}

.payment-challenge iframe {
    border: 0;
    height: 620px;
    width: 100%;
}

.payment-challenge-actions {
    background: var(--surface, #fff);
    border: 1px solid var(--line, #dce7ef);
    border-radius: 16px;
    margin-top: 16px;
    padding: 18px;
    text-align: left;
}

.payment-challenge-actions p {
    color: var(--muted);
    margin: 0 0 14px;
}

.payment-challenge-actions .actions {
    justify-content: flex-start;
}

.receipt-canvas-shell {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 18px;
    margin: 24px auto;
    max-width: 620px;
    overflow: hidden;
    padding: 12px;
}

.receipt-canvas-shell canvas {
    display: block;
    height: auto;
    width: 100%;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --primary: #4ea3e3;
    --primary-strong: #75b9ea;
    --navy: #d8ecff;
    --health: #36d1a0;
    --bg: #071521;
    --surface: #0e2233;
    --surface-soft: #122c40;
    --text: #e8f3fb;
    --muted: #9db1c2;
    --border: #203d52;
    --danger: #ff7885;
    --warning: #f6c453;
    --shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 3px;
}

.site-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: auto;
    max-width: 1240px;
    min-height: 82px;
    padding: 0 24px;
    position: relative;
}
.brand { align-items: center; display: flex; flex: 0 1 260px; }
.brand-logo-crop {
    background: #fff;
    border-radius: 10px;
    display: block;
    overflow: hidden;
    max-width: 250px;
    position: relative;
    width: 100%;
    aspect-ratio: 1300 / 440;
}
.brand-logo-source {
    display: block;
    height: auto;
    left: -11.54%;
    max-width: none;
    position: absolute;
    top: -131.82%;
    width: 123.08%;
}
.nav { align-items: center; display: flex; gap: 24px; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 650; }
.nav a:hover { color: var(--primary); }
.nav-toggle {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    display: none;
    gap: 7px;
    min-height: 42px;
    padding: 0 13px;
}
.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    height: 40px;
    width: 40px;
}

.hero, .section, .page-hero, .form-shell, .narrow-shell, .result-shell,
.auth-shell, .dashboard-heading, .portal-grid, .site-footer, .alert {
    margin-left: auto;
    margin-right: auto;
    max-width: 1180px;
}
.hero {
    align-items: center;
    display: grid;
    gap: 72px;
    grid-template-columns: 1.15fr .85fr;
    min-height: 690px;
    padding: 80px 24px 110px;
}
.hero h1, .page-hero h1, .auth-copy h1, .result-shell h1, .dashboard-heading h1 {
    color: var(--navy);
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    letter-spacing: -.055em;
    line-height: 1.03;
    margin: 18px 0 24px;
}
.hero p, .page-hero p, .auth-copy p, .result-shell > p {
    color: var(--muted);
    font-size: 1.12rem;
    max-width: 640px;
}
.eyebrow {
    color: var(--health);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0; }
.actions.centered { justify-content: center; }
.button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 750;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    transition: transform .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: white; box-shadow: 0 12px 30px rgba(20, 99, 165, .22); }
.button-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.trust-row { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 13px; gap: 22px; }
.trust-row span::first-letter { color: var(--health); }

.hero-panel {
    background: linear-gradient(150deg, var(--surface), var(--surface-soft));
    border: 1px solid var(--border);
    border-radius: 30px;
    box-shadow: var(--shadow);
    padding: 30px;
    position: relative;
}
.hero-panel::before {
    background: linear-gradient(135deg, var(--primary), var(--health));
    border-radius: 999px;
    content: "";
    filter: blur(60px);
    height: 180px;
    opacity: .17;
    position: absolute;
    right: -20px;
    top: -30px;
    width: 180px;
}
.pulse-card, .availability-card, .branch-card, .payment-mini {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    display: flex;
    gap: 14px;
    padding: 18px;
    position: relative;
}
.pulse-icon { color: var(--health); font-size: 28px; }
.pulse-card strong, .pulse-card small, .availability-card strong, .availability-card small { display: block; }
.pulse-card small, .availability-card small { color: var(--muted); }
.metric-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin: 14px 0; }
.metric-grid div { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.metric-grid strong { color: var(--navy); display: block; font-size: 34px; }
.metric-grid span { color: var(--muted); font-size: 13px; }
.status-dot { background: var(--health); border-radius: 999px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--health) 14%, transparent); flex: 0 0 auto; height: 9px; width: 9px; }

.section { padding: 90px 24px; }
.section-heading { margin-bottom: 34px; max-width: 680px; }
.section-heading.inline { align-items: center; display: flex; justify-content: space-between; max-width: none; }
.section-heading h2, .split-section h2 { color: var(--navy); font-size: clamp(1.9rem, 3vw, 3rem); letter-spacing: -.04em; line-height: 1.1; margin: 12px 0; }
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 12px 35px rgba(20, 60, 90, .05); padding: 28px; }
.service-card h3 { color: var(--navy); margin: 16px 0 8px; }
.service-card p, .service-card > span:last-child { color: var(--muted); }
.service-icon { align-items: center; background: var(--surface-soft); border-radius: 13px; color: var(--primary); display: flex; height: 44px; justify-content: center; width: 44px; }
.split-section { align-items: start; display: grid; gap: 80px; grid-template-columns: 1fr 1fr; }
.branch-list { display: grid; gap: 12px; }
.branch-card strong, .branch-card span { display: block; }
.branch-card span { color: var(--muted); }

.page-hero { padding: 90px 24px 45px; text-align: center; }
.page-hero.compact h1 { font-size: clamp(2.2rem, 4vw, 4rem); }
.page-hero p { margin: auto; }
.form-shell { padding: 25px 24px 100px; }
.medical-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 26px;
    padding: clamp(22px, 4vw, 44px);
}
.form-step { align-items: flex-start; display: flex; gap: 16px; margin-top: 8px; }
.form-step h2, .medical-form h2 { color: var(--navy); margin: 0; }
.form-step p { color: var(--muted); margin: 3px 0 0; }
.step-number { align-items: center; background: var(--primary); border-radius: 12px; color: white; display: flex; flex: 0 0 auto; font-weight: 800; height: 38px; justify-content: center; width: 38px; }
.field-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.field-full { grid-column: 1 / -1; }
.field-action { align-items: end; display: flex; }
label { display: grid; gap: 7px; }
label > span { color: var(--text); font-size: 13px; font-weight: 750; }
input, select, textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    min-height: 48px;
    outline: none;
    padding: 11px 14px;
    width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
input[data-identity-locked] {
    background: color-mix(in srgb, var(--primary) 5%, var(--bg));
    color: var(--text);
    cursor: not-allowed;
}
.field-help {
    color: var(--muted);
    font-size: 12px;
    min-height: 1.4em;
}
.form-footer { align-items: center; border-top: 1px solid var(--border); display: flex; gap: 20px; justify-content: space-between; padding-top: 24px; }
.form-footer p { color: var(--muted); font-size: 13px; margin: 0; max-width: 560px; }

.narrow-shell { max-width: 720px; padding: 20px 24px 100px; }
.narrow-shell .medical-form { box-shadow: none; }
.query-result { margin-top: 20px; }
.result-shell { max-width: 820px; padding: 90px 24px 120px; text-align: center; }
.result-shell h1 { font-size: clamp(2.2rem, 4vw, 3.8rem); }
.result-shell > p { margin-left: auto; margin-right: auto; }
.result-icon { align-items: center; background: var(--health); border-radius: 999px; color: white; display: flex; font-size: 34px; height: 72px; justify-content: center; margin: 0 auto 24px; width: 72px; }
.result-icon.pending { background: var(--primary); }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; display: grid; gap: 1px; grid-template-columns: 1fr 1fr; margin: 34px 0; overflow: hidden; text-align: left; }
.summary-card div { background: var(--surface); border-bottom: 1px solid var(--border); display: grid; padding: 18px 20px; }
.summary-card span { color: var(--muted); font-size: 12px; }
.summary-card strong { overflow-wrap: anywhere; }
.status-badge { background: var(--surface-soft); border-radius: 999px; color: var(--primary); display: inline-block; font-size: 11px; font-weight: 800; padding: 4px 9px; width: fit-content; }
.status-badge.warning { color: var(--warning); }
.status-badge.confirmed, .status-badge.attended { background: color-mix(in srgb, var(--health) 12%, var(--surface)); color: var(--health); }
.status-badge.cancelled, .status-badge.no_show { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.status-badge.rescheduled { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); color: var(--warning); }
.access-code-card { background: color-mix(in srgb, var(--health) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--health) 40%, var(--border)); border-radius: 20px; margin: 30px auto; max-width: 430px; padding: 24px; }
.access-code-card span, .access-code-card strong { display: block; }
.access-code-card strong { color: var(--navy); font-size: 36px; letter-spacing: .18em; }
.access-code-card p { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.payment-total { margin: 34px auto; }
.payment-total span, .payment-total small { color: var(--muted); display: block; }
.payment-total strong { color: var(--navy); font-size: 54px; }

.auth-shell { align-items: center; display: grid; gap: 80px; grid-template-columns: 1fr 430px; min-height: 690px; padding: 70px 24px 110px; }
.auth-copy h1 { font-size: clamp(2.2rem, 4vw, 4rem); }
.auth-card { gap: 20px; }
.auth-card small { color: var(--muted); }
.auth-form-section { display: grid; gap: 18px; }
.auth-divider { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 12px; text-align: center; }
.auth-divider::before, .auth-divider::after { background: var(--border); content: ""; flex: 1; height: 1px; }
.narrow-shell .auth-card h1 { color: var(--navy); font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.04em; line-height: 1.1; margin: 0; }
.checkbox-field { align-items: center; display: flex; gap: 10px; }
.checkbox-field input { flex: 0 0 auto; min-height: 18px; width: 18px; }
.checkbox-field span { color: var(--muted); font-weight: 600; }
.auth-link { color: var(--primary); font-size: 14px; font-weight: 700; text-align: center; }
.auth-link:hover { color: var(--primary-strong); text-decoration: underline; }

.staff-auth-body {
    background: #f7f8fa;
    color: #111827;
    min-height: 100vh;
}
.staff-login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 20px;
}
.staff-login-card {
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
    max-width: 640px;
    padding: clamp(32px, 5vw, 58px);
    width: 100%;
}
.staff-login-brand {
    display: block;
    margin: 0 auto 28px;
    max-width: 250px;
}
.staff-login-portal {
    color: #111827;
    font-size: 1.15rem;
    font-weight: 750;
    margin: 0;
    text-align: center;
}
.staff-login-card h1 {
    color: #050505;
    font-size: clamp(1.7rem, 4vw, 2rem);
    letter-spacing: -.025em;
    line-height: 1.2;
    margin: 12px 0 36px;
    text-align: center;
}
.staff-login-form {
    display: grid;
    gap: 25px;
}
.staff-login-form label > span {
    color: #111827;
    font-size: 1rem;
    font-weight: 650;
}
.staff-login-form label > span b {
    color: #dc2626;
}
.staff-login-form input {
    background: #fff;
    border: 1px solid #cfd5dd;
    border-radius: 10px;
    color: #111827;
    min-height: 50px;
}
.staff-login-form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
.staff-password-control {
    display: flex;
    position: relative;
}
.staff-password-control input {
    padding-right: 58px;
}
.staff-password-control button {
    align-items: center;
    background: #fff;
    border: 0;
    border-left: 1px solid #d8dde4;
    border-radius: 0 10px 10px 0;
    color: #687386;
    cursor: pointer;
    display: flex;
    height: calc(100% - 2px);
    justify-content: center;
    position: absolute;
    right: 1px;
    top: 1px;
    width: 55px;
}
.staff-password-control button:hover {
    color: #2563eb;
}
.staff-password-control svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}
.staff-login-form .checkbox-field {
    width: fit-content;
}
.staff-login-form .checkbox-field input {
    accent-color: #2563eb;
    min-height: 19px;
}
.staff-login-form .checkbox-field span {
    font-weight: 600;
}
.staff-login-submit {
    background: #2563eb;
    border: 0;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 750;
    min-height: 48px;
    width: 100%;
}
.staff-login-submit:hover {
    background: #1d4ed8;
}
.staff-login-submit:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .3);
    outline-offset: 3px;
}
.staff-login-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    color: #b42335;
    margin: -14px 0 26px;
    padding: 12px 14px;
}
.dashboard-heading { align-items: end; display: flex; justify-content: space-between; padding: 70px 24px 35px; }
.dashboard-heading h1 { font-size: clamp(2.2rem, 4vw, 3.7rem); margin-bottom: 8px; }
.dashboard-heading p { color: var(--muted); margin: 0; }
.portal-grid { display: grid; gap: 26px; grid-template-columns: 1fr 360px; padding: 20px 24px 110px; }
.portal-main, .portal-aside { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 28px; }
.profile-shell { display: grid; gap: 22px; margin: 0 auto; max-width: 980px; padding: 0 24px 110px; }
.contact-change-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.contact-change-card { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 18px; display: grid; gap: 14px; padding: 20px; }
.contact-change-card h3, .contact-change-card p { margin: 0; }
.contact-change-card small { color: var(--muted); }
.clinical-summary { background: var(--surface-soft); border-radius: 14px; margin-top: 14px; padding: 14px; }
.clinical-summary summary { color: var(--primary); cursor: pointer; font-weight: 800; }
.clinical-summary dl { display: grid; gap: 8px; margin-bottom: 0; }
.clinical-summary dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.clinical-summary dd { margin: 0; white-space: pre-wrap; }
.timeline { display: grid; gap: 12px; }
.timeline-card { align-items: center; border: 1px solid var(--border); border-radius: 18px; display: flex; gap: 18px; padding: 17px; }
.timeline-card h3, .timeline-card p { margin: 4px 0; }
.timeline-card p, .timeline-card small { color: var(--muted); }
.date-tile { background: var(--surface-soft); border-radius: 13px; display: grid; flex: 0 0 auto; padding: 10px; text-align: center; width: 58px; }
.date-tile strong { color: var(--navy); font-size: 22px; }
.date-tile span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.payment-mini { justify-content: space-between; margin-bottom: 10px; padding: 13px; }
.payment-mini span { color: var(--muted); display: block; font-size: 12px; }
.empty-state { color: var(--muted); padding: 40px; text-align: center; }

.alert { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 18px; margin-top: 18px; max-width: 760px; padding: 15px 18px; }
.alert ul { margin: 5px 0 0; }
.alert-error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }
.alert-success { border-color: color-mix(in srgb, var(--health) 45%, var(--border)); color: var(--health); }
.site-footer { align-items: center; border-top: 1px solid var(--border); color: var(--muted); display: flex; font-size: 13px; justify-content: space-between; padding: 34px 24px; }
.site-footer strong, .site-footer div span { display: block; }

.operations-body { background: #f4f7fa; min-height: 100vh; }
.operations-header {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #dce7ef;
    display: flex;
    justify-content: space-between;
    min-height: 76px;
    padding: 12px clamp(18px, 4vw, 48px);
}
.operations-brand { display: block; max-width: 230px; width: 100%; }
.operations-header > div { align-items: flex-end; display: flex; flex-direction: column; font-size: 13px; }
.operations-header > div span { color: #163047; font-weight: 750; }
.operations-header > div a { color: #1463a5; }
.operations-main { margin: auto; max-width: 1100px; padding: 48px 20px 90px; }
.operations-heading { align-items: end; display: flex; gap: 24px; justify-content: space-between; margin-bottom: 28px; }
.operations-heading h1 { color: #0b2742; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.05; margin: 8px 0; }
.operations-heading p { color: #617488; margin: 0; }
.operations-grid { align-items: start; display: grid; gap: 22px; grid-template-columns: 320px 1fr; }
.operations-card { background: #fff; border: 1px solid #dce7ef; border-radius: 20px; box-shadow: 0 14px 35px rgba(15, 54, 84, .06); padding: 26px; }
.stock-card span, .stock-card small { color: #617488; display: block; }
.stock-card strong { color: #0b2742; display: block; font-size: 3.3rem; line-height: 1.1; margin: 10px 0; }
.operations-form { display: grid; gap: 18px; }
.operations-subform { background: #f4f7fa; border: 1px solid #dce7ef; border-radius: 14px; padding: 16px; }
.operations-form h2, .operations-history h2 { color: #0b2742; margin: 0; }
.operations-history { margin-top: 22px; }
.operations-table-wrap { overflow-x: auto; }
.operations-history table { border-collapse: collapse; margin-top: 16px; min-width: 720px; width: 100%; }
.operations-history th, .operations-history td { border-bottom: 1px solid #e5edf3; padding: 12px 10px; text-align: left; }
.operations-history th { color: #617488; font-size: 12px; text-transform: uppercase; }
.operations-history td { color: #163047; font-size: 14px; }

@media (max-width: 880px) {
    .nav-toggle { display: inline-flex; }
    .nav {
        align-items: stretch;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: var(--shadow);
        display: none;
        flex-direction: column;
        gap: 4px;
        left: 16px;
        padding: 12px;
        position: absolute;
        right: 16px;
        top: calc(100% - 2px);
        z-index: 20;
    }
    .nav[data-open] { display: flex; }
    .nav a { border-radius: 10px; padding: 11px 12px; }
    .nav a:hover { background: var(--surface-soft); }
    .theme-toggle { margin-top: 4px; width: 100%; }
    .hero, .split-section, .auth-shell, .portal-grid { grid-template-columns: 1fr; }
    .operations-grid { grid-template-columns: 1fr; }
    .hero { gap: 40px; min-height: auto; padding-top: 55px; }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .auth-shell { gap: 35px; }
    .portal-grid { padding-top: 0; }
}

@media (max-width: 600px) {
    .site-header {
        justify-content: center;
        min-height: 76px;
        padding-left: 72px;
        padding-right: 72px;
    }
    .brand {
        flex: 0 1 205px;
        justify-content: center;
        margin: 0 auto;
    }
    .brand-logo-crop { max-width: 205px; }
    .nav-toggle {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
    }
    .nav-toggle > span:last-child { display: none; }
    .hero { padding-bottom: 70px; }
    .hero h1 { font-size: 2.7rem; }
    .card-grid, .field-grid, .summary-card, .contact-change-grid { grid-template-columns: 1fr; }
    .section, .page-hero { padding-top: 65px; }
    .form-shell { padding-left: 14px; padding-right: 14px; }
    .medical-form { border-radius: 19px; padding: 20px; }
    .form-footer, .dashboard-heading, .site-footer { align-items: stretch; flex-direction: column; }
    .form-footer .button { width: 100%; }
    .trust-row { gap: 10px; }
    .result-shell { padding-top: 65px; }
    .operations-heading { align-items: stretch; flex-direction: column; }
    .operations-heading .button { width: 100%; }
    .operations-header {
        align-items: center;
        flex-direction: column;
        gap: 8px;
        justify-content: center;
        padding-bottom: 16px;
        padding-top: 16px;
        text-align: center;
    }
    .operations-brand { max-width: 205px; }
    .operations-header > div { align-items: center; }
    .staff-login-page { padding: 18px 12px; }
    .staff-login-card { border-radius: 13px; padding: 30px 20px; }
    .staff-login-brand { margin-bottom: 22px; max-width: 210px; }
    .staff-login-card h1 { margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
