/* =========================================================
   Precursor — design system
   ========================================================= */
:root {
    --bg: #F7F5F0;
    --surface: #FFFFFF;
    --surface-2: #FBFAF6;
    --border: #E8E3D8;
    --border-strong: #D8D2C2;

    --ink: #15202B;
    --ink-2: #2B3744;
    --muted: #6B7480;
    --muted-2: #8A93A0;

    --brand: #15202B;
    --accent: #1F5F4A;
    --accent-2: #2A8068;
    --accent-soft: #E5EFEA;

    --gold: #B8924A;
    --gold-soft: #F2EAD6;

    --optimal: #2A8068;
    --optimal-soft: #DBEEE6;
    --inrange: #4A7BA1;
    --inrange-soft: #DEE9F2;
    --watch: #B8762D;
    --watch-soft: #F4E6CD;
    --alert: #B5483A;
    --alert-soft: #F4DDD8;

    --shadow-sm: 0 1px 2px rgba(20, 30, 40, 0.04), 0 1px 1px rgba(20, 30, 40, 0.03);
    --shadow-md: 0 4px 12px rgba(20, 30, 40, 0.06), 0 1px 3px rgba(20, 30, 40, 0.04);
    --shadow-lg: 0 10px 30px rgba(20, 30, 40, 0.08), 0 2px 6px rgba(20, 30, 40, 0.04);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;

    --sidebar-w: 260px;
    --topbar-h: 64px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-family: var(--font-display); font-weight: 500; font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

p { margin: 0 0 1rem; color: var(--ink-2); }

/* App shell */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .35rem .75rem 1.5rem;
    text-decoration: none;
    color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-mark {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #15202B 0%, #1F5F4A 100%);
    display: grid; place-items: center;
    color: white; font-weight: 700; font-size: 0.95rem;
    letter-spacing: -0.04em;
    box-shadow: var(--shadow-sm);
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.brand-logo {
    height: 32px;
    width: auto;
    display: block;
}

.nav-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: .85rem .85rem .4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem;
    margin: .15rem 0;
    border-radius: 10px;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.93rem;
    transition: background 120ms ease, color 120ms ease;
}
.nav-item:hover {
    background: var(--surface-2);
    color: var(--ink);
    text-decoration: none;
}
.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}
.nav-item .nav-icon {
    width: 18px; height: 18px;
    color: currentColor;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding: .75rem .25rem .25rem;
    border-top: 1px solid var(--border);
}

.user-chip {
    display: flex; align-items: center; gap: .65rem;
    padding: .5rem .65rem;
    border-radius: 10px;
    color: var(--ink-2);
    text-decoration: none;
}
.user-chip:hover { background: var(--surface-2); text-decoration: none; }

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1F5F4A, #2A8068);
    color: white;
    display: grid; place-items: center;
    font-weight: 600; font-size: 0.85rem;
    flex-shrink: 0;
}
.avatar.lg { width: 72px; height: 72px; font-size: 1.4rem; }

.user-meta { line-height: 1.15; min-width: 0; }
.user-meta .name { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.user-meta .sub { font-size: 0.78rem; color: var(--muted); }

/* Main */
.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(247, 245, 240, 0.85);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    position: sticky; top: 0; z-index: 20;
    border-bottom: 1px solid transparent;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }
.menu-btn {
    display: none;
    background: none; border: none;
    color: var(--ink); padding: 6px; border-radius: 8px;
    cursor: pointer;
}
.menu-btn:hover { background: var(--surface-2); }

.topbar-search {
    display: flex; align-items: center; gap: .5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: .45rem .75rem;
    border-radius: 999px;
    width: 280px;
    color: var(--muted);
    font-size: 0.88rem;
}
.topbar-search input {
    background: transparent; border: 0; outline: 0;
    color: var(--ink); font-size: 0.9rem; width: 100%;
    font-family: inherit;
}

.topbar-right { display: flex; align-items: center; gap: .5rem; }

/* "Complete onboarding" pill in the topbar */
.topbar-onboard-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .85rem .35rem .65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1.5px solid color-mix(in srgb, var(--accent) 25%, transparent);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.topbar-onboard-btn:hover {
    background: color-mix(in srgb, var(--accent-soft) 60%, var(--accent) 10%);
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.topbar-onboard-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: ob-pulse 2s ease-in-out infinite;
}
@keyframes ob-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.75); }
}
.icon-btn {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--ink-2);
    cursor: pointer;
    transition: background 120ms ease;
    position: relative;
    text-decoration: none;
    padding: 0;
    font-family: inherit;
    line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .icon-badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--alert);
    color: white;
    font-size: 0.62rem;
    font-weight: 700;
    display: grid; place-items: center;
    border: 2px solid var(--bg);
    line-height: 1;
}

/* Hover dropdowns */
.dropdown-wrap {
    position: relative;
}
.dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .5rem;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
    z-index: 60;
}
/* Bridge so cursor can move from button into dropdown without losing hover */
.dropdown::before {
    content: "";
    position: absolute;
    top: -10px; left: 0; right: 0;
    height: 10px;
}
.dropdown-wrap:hover .dropdown,
.dropdown-wrap:focus-within .dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.dropdown-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem .65rem .65rem;
}
.dropdown-head strong { font-size: 0.95rem; color: var(--ink); }
.dropdown-head a { color: var(--accent); font-weight: 600; }

.dropdown-item {
    display: flex; align-items: center; gap: .65rem;
    width: 100%;
    padding: .65rem .75rem;
    border-radius: 10px;
    background: transparent;
    border: 0;
    color: var(--ink-2);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.dropdown-item-danger { color: var(--alert); }
.dropdown-item-danger:hover { background: var(--alert-soft); color: var(--alert); }

.dropdown-foot {
    border-top: 1px solid var(--border);
    padding: .5rem .65rem .25rem;
    text-align: center;
}
.dropdown-foot a { color: var(--accent); font-weight: 600; }

.user-dropdown { min-width: 280px; }
.user-dropdown-head {
    display: flex; align-items: center; gap: .65rem;
    padding: .65rem .75rem;
    margin-bottom: .35rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .85rem;
}
.user-dropdown-head .user-meta .name { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.user-dropdown-head .user-meta .sub { font-size: 0.78rem; color: var(--muted); }

.notif-list {
    list-style: none; margin: 0; padding: 0;
    max-height: 360px;
    overflow-y: auto;
}
.notif-item {
    display: flex; gap: .6rem; align-items: flex-start;
    padding: .65rem .75rem;
    border-radius: 10px;
    cursor: pointer;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread .notif-title { color: var(--ink); font-weight: 600; }
.notif-dot {
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-top: 7px;
    flex-shrink: 0;
}
.notif-item:not(.unread) .notif-body { padding-left: 16px; }
.notif-body { min-width: 0; flex: 1; }
.notif-title { font-size: 0.9rem; color: var(--ink-2); line-height: 1.3; }
.notif-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* Mobile-only brand inside topbar */
.brand-mobile { display: none; padding: 0; }

.content {
    padding: 1.5rem 2rem 6rem;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

/* Cards & primitives */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card-pad-lg { padding: 1.75rem; }
.card-tight { padding: 1rem; }

.card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1rem;
}
.card-title { font-size: 1.05rem; font-weight: 600; margin: 0; color: var(--ink); }
.card-sub { font-size: 0.85rem; color: var(--muted); margin: .15rem 0 0; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: .75rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }

.divider { height: 1px; background: var(--border); margin: 1rem 0; border: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.xsmall { font-size: 0.78rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .65rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: transform 80ms ease, background 120ms ease, color 120ms ease;
    line-height: 1;
    font-family: inherit;
}
.btn:hover { background: #0B141C; color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.btn-accent { background: var(--accent); }
.btn.btn-accent:hover { background: var(--accent-2); }
.btn.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--border-strong);
}
.btn.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.btn-soft {
    background: var(--accent-soft);
    color: var(--accent);
}
.btn.btn-soft:hover { background: #D6E7DF; color: var(--accent); }
.btn.btn-sm { padding: .45rem .85rem; font-size: 0.82rem; }
.btn.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Status pills */
.pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--ink-2);
    border: 1px solid var(--border);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.pill.optimal { background: var(--optimal-soft); color: var(--optimal); border-color: transparent; }
.pill.optimal .dot { background: var(--optimal); }
.pill.inrange { background: var(--inrange-soft); color: var(--inrange); border-color: transparent; }
.pill.inrange .dot { background: var(--inrange); }
.pill.watch { background: var(--watch-soft); color: var(--watch); border-color: transparent; }
.pill.watch .dot { background: var(--watch); }
.pill.alert { background: var(--alert-soft); color: var(--alert); border-color: transparent; }
.pill.alert .dot { background: var(--alert); }
.pill.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.pill.gold .dot { background: var(--gold); }

.priority-tag {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.priority-high { background: var(--alert-soft); color: var(--alert); }
.priority-medium { background: var(--watch-soft); color: var(--watch); }
.priority-low { background: var(--inrange-soft); color: var(--inrange); }

/* Inputs */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field[hidden] { display: none; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.field:has(> :is(input, select, textarea)[required]) > label::after {
    content: " *";
    color: var(--alert);
    font-weight: 700;
}
.input, .select, .textarea {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: .65rem .85rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    width: 100%;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus, .select:focus, .textarea:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled, .select:disabled, .textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.textarea { min-height: 100px; resize: vertical; }

/* Address autocomplete suggestion dropdown */
.address-autocomplete { position: relative; }
.address-suggestions {
    list-style: none;
    margin: 4px 0 0;
    padding: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 260px;
    overflow-y: auto;
}
.address-suggestion {
    padding: .55rem .65rem;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--ink-1);
}
.address-suggestion:hover,
.address-suggestion.is-active {
    background: var(--accent-soft);
}

/* Input group (e.g. phone with country prefix) */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-group-prefix {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 0 .75rem;
    border-right: 1px solid var(--border-strong);
    color: var(--ink-2);
    font-size: 0.95rem;
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
}
.input-group-prefix .flag-au {
    display: inline-flex;
    line-height: 0;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.input-group-prefix .dial-code { color: var(--ink); }
.input-group .input-with-prefix {
    border: 0;
    border-radius: 0 10px 10px 0;
    box-shadow: none;
    background: transparent;
    flex: 1;
    min-width: 0;
}
.input-group .input-with-prefix:focus {
    outline: 0;
    box-shadow: none;
    border-color: transparent;
}

/* One-time code input */
.otp-input {
    letter-spacing: 0.6em;
    font-variant-numeric: tabular-nums;
    font-size: 1.15rem;
    text-align: center;
}

/* Inline "link" styled submit button (used for resend) */
.link-button {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.link-button:hover { opacity: 0.85; }

.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border-strong); border-radius: 999px;
    transition: background 160ms ease;
}
.toggle .track::before {
    content: ""; position: absolute; height: 18px; width: 18px;
    left: 3px; top: 3px; background: white; border-radius: 50%;
    transition: transform 160ms ease;
    box-shadow: var(--shadow-sm);
}
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::before { transform: translateX(18px); }

.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; margin-bottom: 1rem;
}
.section-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: .35rem;
}

/* Mobile bottom nav */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    border-top: 1px solid var(--border);
    padding: 8px 4px max(8px, env(safe-area-inset-bottom));
    z-index: 30;
    justify-content: space-around;
}
.bottom-nav .b-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 4px 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    flex: 1;
    border-radius: 8px;
    text-align: center;
    background: transparent;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.1;
}
.bottom-nav .b-item.active { color: var(--accent); }
.bottom-nav .b-item svg { width: 22px; height: 22px; }

/* More sheet */
.more-sheet {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    padding: .5rem 1rem max(1.25rem, env(safe-area-inset-bottom)) 1rem;
    z-index: 55;
    box-shadow: 0 -16px 40px rgba(20, 30, 40, 0.18);
    transform: translateY(100%);
    transition: transform 220ms ease;
}
.more-sheet.open { display: block; transform: translateY(0); }
.more-sheet-grabber {
    width: 38px; height: 4px;
    background: var(--border-strong);
    border-radius: 999px;
    margin: 8px auto 12px;
}
.more-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .25rem 0 .85rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .35rem;
}
.more-sheet .user-meta .name { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.more-sheet .user-meta .sub { font-size: 0.78rem; color: var(--muted); }

.more-item {
    display: flex; align-items: center; gap: .85rem;
    padding: .85rem .5rem;
    border-radius: 10px;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.more-item:hover, .more-item:active { background: var(--surface-2); text-decoration: none; }
.more-item.active { color: var(--accent); background: var(--accent-soft); }
.more-item-danger { color: var(--alert); }
.more-item-danger:hover { background: var(--alert-soft); }
#bt-more-scrim.show { display: block; }

/* Mobile sidebar overlay */
.scrim {
    display: none;
    position: fixed; inset: 0;
    background: rgba(20, 30, 40, 0.4);
    z-index: 40;
}
.scrim.show { display: block; }

/* Overview */
.greeting-card {
    background:
        linear-gradient(135deg, rgba(21,32,43,0.72) 0%, rgba(27,45,61,0.55) 100%),
        url('/images/webapp/herobanners/blue-astro-wide.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.06);
    position: relative;
    overflow: hidden;
}
.greeting-card h1 { color: white; margin-bottom: .35rem; }
.greeting-card .lede { color: #ced8e4; max-width: 60ch; margin: 0; }
.greeting-card .meta-row {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
    margin-top: 1.5rem;
}
.greeting-card .meta { display: flex; flex-direction: column; gap: 2px; }
.greeting-card .meta .label {
    font-size: 0.72rem; font-weight: 600;
    color: #8A99AC; text-transform: uppercase; letter-spacing: 0.08em;
}
.greeting-card .meta .value {
    font-family: var(--font-display); font-weight: 500; font-size: 1.5rem;
    color: white;
    letter-spacing: -0.01em;
}

.score-ring-wrap { display: flex; align-items: center; gap: 1.5rem; background: transparent; }
.score-ring {
    --p: 78;
    --size: 132px;
    width: var(--size); height: var(--size);
    display: grid; place-items: center;
    position: relative;
    flex-shrink: 0;
    background: transparent;
}
.score-ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}
.score-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}
.score-ring-progress {
    fill: none;
    stroke: url(#scoreRingGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}
.score-ring .score-text {
    position: relative; text-align: center;
}
.score-ring .score-text .num {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 2.4rem;
    color: white;
    line-height: 1;
}
.score-ring .score-text .label {
    font-size: 0.62rem;
    color: #8A99AC;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.kpi { display: flex; flex-direction: column; gap: .35rem; }
.kpi .kpi-label {
    font-size: 0.78rem; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.kpi .kpi-value {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.8rem;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.kpi .kpi-value .unit {
    font-size: 1rem;
    color: var(--muted);
    font-family: var(--font-sans);
    font-weight: 500;
    margin-left: 4px;
}
.kpi .kpi-trend {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.82rem; font-weight: 600;
}
.kpi .kpi-trend.up { color: var(--optimal); }
.kpi .kpi-trend.down { color: var(--alert); }
.kpi .kpi-trend.flat { color: var(--muted); }

/* Biomarker row */
.bm-row {
    display: grid;
    grid-template-columns: 1.6fr 1.4fr 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: .9rem 0;
    border-bottom: 1px solid var(--border);
}
.bm-row:last-child { border-bottom: 0; }
.bm-row a.bm-name { color: var(--ink); }
.bm-row a.bm-name:hover { color: var(--accent); text-decoration: none; }
.bm-name { font-weight: 600; }
.bm-cat { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.bm-row.selected {
    background: var(--accent-soft);
    border-radius: 10px;
    border-bottom-color: transparent;
    box-shadow: inset 3px 0 0 var(--accent);
    padding-left: .9rem;
    padding-right: .9rem;
    margin-left: -.9rem;
    margin-right: -.9rem;
}
.bm-row.selected + .bm-row { border-top: 1px solid var(--border); }
.bm-row.selected a.bm-name,
.bm-row.selected .bm-name { color: var(--accent); }

/* Floating detail card that follows scroll, sized to its content */
.bm-detail {
    position: sticky;
    top: calc(var(--topbar-h) + 1rem);
    align-self: start;
}
@media (max-width: 768px) {
    .bm-detail { position: static; }
}

.range-bar {
    position: relative; height: 8px;
    background: linear-gradient(to right,
        var(--alert-soft) 0%, var(--alert-soft) 12%,
        var(--watch-soft) 12%, var(--watch-soft) 28%,
        var(--optimal-soft) 28%, var(--optimal-soft) 72%,
        var(--watch-soft) 72%, var(--watch-soft) 88%,
        var(--alert-soft) 88%, var(--alert-soft) 100%);
    border-radius: 999px;
}
.range-bar .marker {
    position: absolute; top: -4px;
    width: 16px; height: 16px;
    background: var(--ink);
    border: 3px solid var(--surface);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transform: translateX(-50%);
}
.range-labels {
    display: flex; justify-content: space-between;
    font-size: 0.7rem; color: var(--muted);
    margin-top: 4px;
}

.bm-value-cell { text-align: right; }
.bm-value { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; color: var(--ink); }
.bm-unit { font-size: 0.78rem; color: var(--muted); }

.trend-arrow {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.8rem; font-weight: 600;
}
.trend-arrow.improving { color: var(--optimal); }
.trend-arrow.declining { color: var(--alert); }
.trend-arrow.stable { color: var(--muted); }

/* Recommendations */
.rec-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 1rem;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.rec-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.rec-card.accepted {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 30%);
}
.rec-card .rec-cat {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: 0.72rem; font-weight: 600;
    color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em;
}
.rec-card .rec-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.01em;
}
.rec-card .rec-summary { color: var(--ink-2); margin: 0; }

.steps-list {
    margin: 0; padding: 0;
    list-style: none;
    display: flex; flex-direction: column; gap: .5rem;
}
.steps-list li {
    display: flex; gap: .65rem; align-items: flex-start;
    font-size: 0.92rem; color: var(--ink-2);
}
.steps-list li::before {
    content: ""; flex-shrink: 0;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 8px;
}

.rec-dismiss {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.rec-dismiss:hover {
    background: var(--alert-soft);
    color: var(--alert);
    border-color: transparent;
}

.rec-card.dismissed {
    opacity: 0.65;
    background: var(--surface-2);
}
.rec-card.dismissed .rec-title { color: var(--muted); }

.expected-outcome {
    background: var(--accent-soft);
    border-radius: 10px;
    padding: .65rem .85rem;
    color: var(--ink);
}

.dismissed-bar {
    margin-top: 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1rem;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
}

/* Timeline — 3-column grid: date | rail | cards */
.timeline {
    --tl-date-w: 96px;
    --tl-rail-w: 28px;
    position: relative;
}
.timeline-now,
.timeline-row {
    display: grid;
    grid-template-columns: var(--tl-date-w) var(--tl-rail-w) 1fr;
    gap: 0;
    align-items: flex-start;
    position: relative;
}
.timeline-now { margin-bottom: 1rem; align-items: center; }
.timeline-row { margin-bottom: 1.5rem; }

.timeline-date {
    text-align: right;
    padding-right: .75rem;
    padding-top: 4px;
}
.timeline-date-main {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.timeline-date-sub {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.3;
}

.timeline-rail {
    position: relative;
    align-self: stretch;
    display: flex;
    justify-content: center;
}
.timeline-rail::before {
    content: "";
    position: absolute;
    top: 0; bottom: -1.5rem;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: var(--border);
}
.timeline-now .timeline-rail::before {
    background: linear-gradient(to bottom, var(--accent) 0%, var(--accent) 50%, var(--border) 50%);
}
.timeline-row:last-child .timeline-rail::before { bottom: 0; }
.timeline-dot {
    position: relative;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px var(--bg);
    margin-top: 8px;
    z-index: 2;
}
.timeline-now .timeline-dot {
    background: var(--accent);
    margin-top: 0;
    width: 16px; height: 16px;
}

.timeline-cards {
    display: flex; flex-direction: column;
    gap: .75rem;
    padding-left: .85rem;
    min-width: 0;
}
.timeline-now-text { padding-left: .85rem; }

.milestone-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow-sm);
}
.milestone-card.pending { opacity: 0.78; }
.milestone-card.ms-signal { border-left-color: var(--accent-2); }
.milestone-card.ms-benefit { border-left-color: var(--accent); }
.milestone-card.ms-retest { border-left-color: var(--gold); }

.ms-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 .35rem;
}
.ms-desc {
    font-size: 0.88rem;
    color: var(--ink-2);
    margin: 0 0 .65rem;
}
.ms-tag {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ms-tag.ms-signal { background: var(--accent-soft); color: var(--accent); }
.ms-tag.ms-benefit { background: var(--optimal-soft); color: var(--optimal); }
.ms-tag.ms-retest { background: var(--gold-soft); color: var(--gold); }

.ms-bio-row {
    margin-top: .25rem;
    padding-top: .65rem;
    border-top: 1px dashed var(--border);
}
.bio-chip {
    display: inline-flex;
    padding: 3px 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}
.bio-chip:hover { background: var(--ink); color: white; text-decoration: none; }

@media (max-width: 768px) {
    .timeline { --tl-date-w: 70px; --tl-rail-w: 22px; }
    .timeline-date { padding-right: .5rem; }
    .timeline-date-main { font-size: 0.92rem; }
    .timeline-date-sub { font-size: 0.65rem; }
    .timeline-cards { padding-left: .65rem; }
    .timeline-now-text { padding-left: .65rem; }
    .milestone-card { padding: .85rem 1rem; }
    .ms-title { font-size: 0.95rem; }
    .ms-desc { font-size: 0.85rem; }
}

/* Services */
.svc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
    transition: transform 160ms ease, box-shadow 160ms ease;
}
.svc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.svc-cover {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1B2D3D, #1F5F4A);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    color: white;
    display: flex; align-items: flex-end;
    padding: 1rem;
    overflow: hidden;
}
.svc-cover::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(800px 200px at 100% 0%, rgba(255,255,255,0.18), transparent 60%);
    pointer-events: none;
}
.svc-cover .cover-icon {
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    display: grid; place-items: center;
    backdrop-filter: blur(6px);
    color: white;
}
.svc-body {
    padding: 1.25rem;
    display: flex; flex-direction: column; gap: .75rem;
    flex: 1;
}
.svc-cat {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--accent);
}
.svc-name {
    font-family: var(--font-display);
    font-size: 1.25rem; font-weight: 500;
    color: var(--ink); margin: 0;
    letter-spacing: -0.01em;
}
.svc-tagline { color: var(--ink-2); margin: 0; font-size: 0.92rem; }
.svc-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.svc-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.svc-price { display: flex; flex-direction: column; line-height: 1.1; gap: 0; }
.svc-price .price {
    font-family: var(--font-display);
    font-weight: 500; font-size: 1.4rem; color: var(--ink);
    line-height: 1.1;
    margin: 0;
}
.svc-price .strike {
    text-decoration: line-through;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.1;
    margin: 0;
}
.svc-price .member { font-size: 0.75rem; color: var(--accent); font-weight: 600; line-height: 1.1; margin-top: 1px; }

/* Plans */
.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex; flex-direction: column; gap: 1rem;
    position: relative;
    box-shadow: var(--shadow-sm);
}
.plan-card.popular {
    border: 2px solid var(--accent);
    box-shadow: 0 14px 40px rgba(31,95,74,0.14);
}
.plan-card.current {
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 30%);
}
.plan-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 999px;
}
.plan-name {
    font-family: var(--font-display);
    font-weight: 500; font-size: 1.5rem;
    margin: 0;
}
.plan-price { display: flex; align-items: baseline; gap: .35rem; }
.plan-price .num {
    font-family: var(--font-display);
    font-size: 2.6rem; font-weight: 500;
    color: var(--ink); line-height: 1;
    letter-spacing: -0.02em;
}
.plan-price .per { color: var(--muted); font-size: 0.9rem; }

.plan-features {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: .5rem;
    flex: 1;
}
.plan-features li {
    display: flex; gap: .55rem; align-items: flex-start;
    color: var(--ink-2); font-size: 0.92rem;
}
.plan-features li svg {
    color: var(--accent); flex-shrink: 0; margin-top: 2px;
}

/* Tabs */
.tabs {
    display: inline-flex; padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    gap: 2px;
}
.tab-btn {
    padding: .5rem 1rem;
    border-radius: 999px;
    background: transparent; border: 0;
    font-size: 0.85rem; font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: .4rem;
}
.tab-btn:hover { color: var(--ink); text-decoration: none; }
.tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Filter chips */
.chip-group { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 768px) {
    .chip-group { display: none; }
}
.chip {
    padding: .35rem .8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.active { background: var(--ink); color: white; border-color: transparent; }

/* Records — report strip */
.report-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.report-card {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    color: white;
    transition: transform 160ms ease, box-shadow 160ms ease;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.report-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.report-card::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,16,22,0.15) 0%, rgba(10,16,22,0.78) 100%);
}
.report-card.cover-scan { background-image: linear-gradient(135deg, #1B2D3D 0%, #34506A 100%); }
.report-card.cover-video { background-image: linear-gradient(135deg, #1F5F4A 0%, #2A8068 100%); }
.report-card.cover-brand { background-image: linear-gradient(135deg, #15202B 0%, #2B3744 100%); }
.report-date {
    position: absolute; top: 12px; left: 12px;
    z-index: 1;
    font-size: 0.72rem; font-weight: 600;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(4px);
    padding: 3px 9px; border-radius: 999px;
}
.report-play {
    position: absolute; inset: 0; margin: auto;
    width: 52px; height: 52px;
    display: grid; place-items: center;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    z-index: 1;
}
.report-foot {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: .65rem;
}
.report-foot .avatar { background: rgba(255,255,255,0.2); }
.report-title { font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
.report-clinician { font-size: 0.78rem; opacity: 0.85; }

.record-group-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0 .65rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.record-group-head:not(:first-child) { margin-top: 1rem; }
.record-link {
    background: none; border: 0; cursor: pointer;
    color: var(--accent-2); font-weight: 600; font-size: 0.82rem;
    display: inline-flex; align-items: center; gap: .35rem;
    font-family: inherit;
}
.record-link:hover { color: var(--accent); }
.record-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
}
.record-row:last-child { border-bottom: 0; }
.record-main { min-width: 0; }
.record-name { font-weight: 600; color: var(--ink); }
.record-meta { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

@media (max-width: 768px) {
    .report-strip { grid-template-columns: 1fr; }
}

/* Bookings */
.booking-card { display: flex; flex-direction: column; }
.booking-card.needs { border-left: 3px solid var(--watch); }
.booking-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--ink);
    margin: .15rem 0 .65rem;
    letter-spacing: -0.01em;
}
.booking-meta {
    display: flex; flex-direction: column; gap: .35rem;
    font-size: 0.88rem; color: var(--ink-2);
}
.booking-meta svg { color: var(--muted); flex-shrink: 0; }

.booking-row {
    display: flex; align-items: center; gap: 1rem;
    padding: .9rem 0;
    border-bottom: 1px solid var(--border);
}
.booking-row:last-child { border-bottom: 0; }
.booking-date {
    width: 52px; flex-shrink: 0;
    text-align: center;
    background: var(--accent-soft);
    border-radius: 10px;
    padding: .45rem 0;
    line-height: 1.1;
}
.booking-date.muted-date { background: var(--surface-2); }
.booking-date .bd-day {
    font-family: var(--font-display);
    font-weight: 600; font-size: 1.25rem; color: var(--accent);
}
.booking-date.muted-date .bd-day { color: var(--muted); }
.booking-date .bd-mon {
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--accent-2);
}
.booking-date.muted-date .bd-mon { color: var(--muted); }
.booking-main { flex: 1; min-width: 0; }
.booking-name { font-weight: 600; color: var(--ink); }

@media (max-width: 768px) {
    .booking-row { flex-wrap: wrap; }
    .booking-row > .row { width: 100%; justify-content: space-between; }
}

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    text-align: left; padding: .75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.table th {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--muted); font-weight: 600;
}
.table tr:last-child td { border-bottom: 0; }

/* Profile detail layout */
.detail-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
}
@media (max-width: 960px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* Settings list */
.setting-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .info { min-width: 0; }
.setting-row .info .title { font-weight: 600; color: var(--ink); }
.setting-row .info .desc { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

/* Responsive */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar-search { display: none; }
}

@media (max-width: 768px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .menu-btn { display: none; }
    .brand-mobile { display: flex; }
    .brand-mobile .brand-name { font-size: 1.05rem; }

    .topbar {
        padding: 0 .85rem;
        height: 56px;
        border-bottom: 1px solid var(--border);
    }
    .topbar-left { gap: .5rem; }
    .topbar-right { display: none; }

    .content { padding: .85rem .85rem 6rem; }
    .bottom-nav { display: flex; }

    /* Stack overview's two-column grid on mobile */
    .content > section.grid[style*="grid-template-columns: 2fr 1fr"] { grid-template-columns: 1fr !important; }
    .content > div.grid[style*="grid-template-columns: 1.4fr 1fr"] { grid-template-columns: 1fr !important; }
    .content > section.grid[style*="grid-template-columns: 1.4fr 1fr"] { grid-template-columns: 1fr !important; }

    /* Full-width spanners must not create wide implicit columns once the
       grid collapses to a single column (caused horizontal overflow on
       Overview, which in turn broke the fixed bottom nav). */
    .grid > [style*="grid-column: span 3"],
    .grid > [style*="grid-column: span 2"] { grid-column: 1 / -1 !important; }

    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }

    /* Tighter cards */
    .card { padding: 1rem; border-radius: 12px; }
    .card-pad-lg { padding: 1.15rem; }

    /* Condensed section headers */
    .section-head { gap: .5rem; flex-wrap: wrap; margin-bottom: .85rem; }
    .section-head h1 { font-size: 1.5rem; }
    .section-eyebrow { font-size: 0.68rem; margin-bottom: .15rem; }

    /* Greeting card: ring inline, lede hidden, fewer metas */
    .greeting-card {
        padding: 1.15rem;
        border-radius: 18px;
    }
    .greeting-card h1 { font-size: 1.5rem; }
    .greeting-card .lede { display: none; }
    .greeting-card .meta-row { margin-top: 1rem; gap: 1rem; }
    .greeting-card .meta:nth-child(3) { display: none; }
    .greeting-card .meta .value { font-size: 1.05rem; }
    .greeting-card > div[style*="grid-template-columns: 1fr auto"] {
        grid-template-columns: 1fr auto !important;
        gap: 1rem !important;
        align-items: flex-start !important;
    }
    .score-ring { --size: 100px; }
    .score-ring .score-text .num { font-size: 1.7rem; }
    .score-ring .score-text .label { font-size: 0.52rem; max-width: 4.5em; text-align: center; margin-inline: auto; }
    .score-ring-wrap { gap: .75rem; }

    /* KPI tiles: tighter */
    .kpi .kpi-value { font-size: 1.3rem; }
    .kpi .kpi-value .unit { font-size: 0.78rem; }
    .kpi .kpi-label { font-size: 0.65rem; }
    .kpi .kpi-trend { font-size: 0.72rem; }

    /* Hide secondary text on biomarker rows + tighter layout */
    .bm-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name value"
            "bar bar";
        gap: .35rem;
        padding: .75rem 0;
    }
    .bm-row > .name-cell { grid-area: name; min-width: 0; }
    .bm-row > .bar-cell { grid-area: bar; }
    .bm-row > .bm-value-cell { grid-area: value; text-align: right; }
    .bm-row > .trend-cell { display: none; }
    .bm-name { font-size: 0.92rem; }
    .bm-cat { display: none; }
    .bm-value { font-size: 1rem; }
    .range-labels { display: none; }

    /* Recommendation cards: trim less-essential bits */
    .rec-card { padding: 1.15rem; gap: .75rem; }
    .rec-card .rec-title { font-size: 1.1rem; }
    .rec-card .rec-summary { font-size: .9rem; }

    /* Service cards: compact */
    .svc-cover { aspect-ratio: 21 / 9; padding: .65rem; }
    .svc-cover .cover-icon { width: 44px; height: 44px; border-radius: 10px; }
    .svc-cover .cover-icon svg { width: 22px; height: 22px; }
    .svc-body { padding: 1rem; gap: .55rem; }
    .svc-name { font-size: 1.1rem; }
    .svc-tagline { font-size: 0.88rem; }
    .svc-price .price { font-size: 1.2rem; }

    /* Plans: tighter */
    .plan-card { padding: 1.25rem; }
    .plan-price .num { font-size: 2rem; }

    /* Profile detail: stack and tighten */
    .detail-grid { gap: 1rem; }
    .avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }

    /* Settings rows */
    .setting-row { padding: .85rem 0; gap: .75rem; }
    .setting-row .info .desc { font-size: 0.78rem; }

    /* Tabs: shrink */
    .tabs .tab-btn { padding: .4rem .8rem; font-size: 0.8rem; }

    /* Tables: compact and let small content scroll if needed */
    .table th, .table td { padding: .55rem 0; font-size: 0.85rem; }

    /* Hide chart Y-axis labels squeezing on tiny screens — bands still draw */
    [data-chart] { height: 180px !important; }
}

@media (max-width: 480px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    h1 { font-size: 1.4rem; }
    .greeting-card h1 { font-size: 1.3rem; }
    .greeting-card .meta .value { font-size: 0.95rem; }
    .greeting-card .meta .label { font-size: 0.62rem; }
    .score-ring { --size: 86px; }
    .score-ring .score-text .num { font-size: 1.55rem; }
    .score-ring .score-text .label { max-width: 4.5em; text-align: center; margin-inline: auto; margin-top: 0px; }
    .greeting-card > div[style*="grid-template-columns: 1fr auto"] { gap: .75rem !important; }
}

/* =========================================================
   Auth (Signup) — standalone split layout
   ========================================================= */
.auth-body {
    background: var(--bg);
    min-height: 100vh;
}
.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}
.auth-aside {
    background:
        linear-gradient(140deg, rgba(21,32,43,0.85) 0%, rgba(31,95,74,0.78) 100%),
        url('/images/webapp/herobanners/blue-astro-wide.webp');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 2.5rem 3rem;
    display: flex; flex-direction: column;
    justify-content: space-between;
}
.auth-aside .brand .brand-mark { background: rgba(255,255,255,0.16); }
.auth-aside-inner { max-width: 460px; margin: auto 0; }
.auth-aside h1 {
    color: white;
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: .85rem;
}
.auth-bullets {
    list-style: none; margin: 1.75rem 0 0; padding: 0;
    display: flex; flex-direction: column; gap: .6rem;
    color: #d8e3ec;
    font-size: 0.95rem;
}
.auth-bullets li { display: flex; align-items: center; gap: .65rem; }
.auth-bullet-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent-2); flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(42,128,104,0.18);
}
.auth-main {
    padding: 3rem 2.5rem;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center;
    gap: 1.25rem;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.25rem;
    width: 100%;
    max-width: 480px;
    position: relative;
}
.auth-method-tabs-float {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1;
}
.auth-card h2 { margin: .35rem 0 0; }
.auth-alert {
    background: var(--alert-soft);
    color: var(--alert);
    border-radius: 10px;
    padding: .65rem .85rem;
    font-size: 0.88rem;
    font-weight: 500;
}
.auth-consent {
    display: flex; align-items: flex-start; gap: .55rem;
    font-size: 0.85rem; color: var(--ink-2);
}
.auth-consent input { margin-top: 3px; }
.auth-divider {
    display: flex; align-items: center; gap: .65rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 0.1em;
}
.auth-divider::before, .auth-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}
.auth-fineprint { max-width: 480px; text-align: center; }
.auth-brand-mobile { display: none; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main {
        padding: 1.25rem 1rem 2.5rem;
        gap: 1rem;
        justify-content: flex-start;
    }
    .auth-card { padding: 1.5rem; border-radius: 18px; }
    /* Make room for the floated Email/Mobile pill on the sign-in card. */
    .auth-card .section-eyebrow { margin-top: 0.5rem; }
    .auth-card h2 { margin-top: 1rem; }
    .auth-brand-mobile {
        display: inline-flex;
        align-self: center;
        padding: .25rem 0 .5rem;
        text-decoration: none;
    }
    .auth-brand-mobile .brand-mark { background: linear-gradient(135deg, #15202B 0%, #1F5F4A 100%); color: white; }
    .auth-brand-mobile .brand-name { color: var(--ink); }
}

/* =========================================================
   Onboarding wizard
   ========================================================= */
.onboard-body { background: var(--bg); min-height: 100vh; }
.onboard-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(247, 245, 240, 0.9);
    backdrop-filter: saturate(140%) blur(8px);
    position: sticky; top: 0; z-index: 10;
}
.onboard-shell {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2rem;
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.25rem 2rem 4rem;
}
.onboard-stepper {
    position: sticky;
    top: calc(64px + 1.5rem);
    align-self: start;
}
.onboard-stepper p { margin-bottom: 1.5rem; }
.ob-steps-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: .35rem;
    counter-reset: ob;
}
.ob-step {
    display: flex; gap: .85rem; align-items: flex-start;
    padding: .85rem .85rem;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 120ms ease, border-color 120ms ease;
}
.ob-step:hover { background: var(--surface-2); }
.ob-step.active {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.ob-step-num {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    display: grid; place-items: center;
    font-size: 0.82rem; font-weight: 700;
    color: var(--muted);
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.ob-step.active .ob-step-num {
    background: var(--accent);
    border-color: transparent;
    color: white;
}
.ob-step.done .ob-step-num {
    background: var(--accent-soft);
    border-color: transparent;
    color: var(--accent);
}
.ob-step.done .ob-step-num::after { content: "✓"; }
.ob-step.done .ob-step-num { font-size: 0; }
.ob-step.done .ob-step-num::after { font-size: 0.85rem; }
.ob-step-text { min-width: 0; }
.ob-step-title { font-weight: 600; color: var(--ink); font-size: 0.92rem; }
.ob-step-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }

.onboard-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2.25rem;
    min-height: 540px;
    display: flex; flex-direction: column;
}
.ob-pane[hidden] { display: none; }
.ob-pane h2 { margin: .25rem 0 .35rem; font-size: 1.65rem; }

.ob-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.ob-actions .ob-progress { flex: 1 1 0; min-width: 120px; }
.ob-actions .btn[hidden] { display: none; }
.ob-progress { width: 100%; }
.ob-progress-bar {
    height: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.ob-progress-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    width: 0%;
    transition: width 220ms ease;
}
.ob-finish-note {
    margin-top: 1.25rem;
    padding: .85rem 1rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Required-field marker */
.req { color: var(--alert); font-weight: 600; }

/* Grouped checkbox sets for onboarding intake */
.ob-fieldset {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem 1.1rem;
    margin: 0;
}
.ob-fieldset > legend {
    padding: 0 .5rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-2, var(--text));
    letter-spacing: .01em;
}

/* Collapsible grouped checkbox sets */
.ob-collapse {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.ob-collapse > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1.1rem;
    font-size: .92rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ob-collapse > summary::-webkit-details-marker { display: none; }
.ob-collapse > summary:hover { background: var(--surface-2); }
.ob-collapse-chevron {
    width: .55rem;
    height: .55rem;
    border-right: 2px solid var(--text-2, var(--ink-2));
    border-bottom: 2px solid var(--text-2, var(--ink-2));
    transform: rotate(45deg);
    transition: transform 180ms ease;
    flex: 0 0 auto;
    margin-top: -.2rem;
}
.ob-collapse[open] > summary {
    border-bottom: 1px solid var(--border);
}
.ob-collapse[open] .ob-collapse-chevron {
    transform: rotate(-135deg);
    margin-top: .2rem;
}
.ob-collapse > .ob-check-grid {
    padding: 1rem 1.1rem 1.1rem;
    margin-top: 0;
}
.ob-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .55rem .9rem;
    margin-top: .4rem;
}
.ob-check-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ob-check {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .92rem;
    line-height: 1.3;
    cursor: pointer;
    user-select: none;
}
.ob-check input[type="checkbox"] {
    margin-top: .15rem;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

/* Collapsible Profile sections */
.profile-section {
    overflow: hidden;
}
.profile-section > summary.profile-section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.profile-section > summary.profile-section-summary::-webkit-details-marker { display: none; }
.profile-section > summary.profile-section-summary > .card-title {
    margin: 0;
}
.profile-section > summary.profile-section-summary > .ob-collapse-chevron {
    margin-top: 0;
    border-right: 2px solid var(--ink-2);
    border-bottom: 2px solid var(--ink-2);
    transition: transform 180ms ease;
}
.profile-section[open] > summary.profile-section-summary > .ob-collapse-chevron {
    transform: rotate(-135deg);
}

/* Top-right toast notifications */
.bt-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    pointer-events: none;
}
.bt-toast {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 220px;
    max-width: 360px;
    padding: .8rem 1rem;
    border-radius: 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    color: var(--ink);
    font-size: .92rem;
    font-weight: 500;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 200ms ease, transform 200ms ease;
}
.bt-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.bt-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    flex: 0 0 auto;
}
.bt-toast-success .bt-toast-icon { background: var(--accent, #2e7d5b); }
.bt-toast-error .bt-toast-icon { background: var(--alert, #c0392b); }
.bt-toast-success { border-color: color-mix(in srgb, var(--accent, #2e7d5b) 40%, var(--border)); }
.bt-toast-error { border-color: color-mix(in srgb, var(--alert, #c0392b) 40%, var(--border)); }
.bt-toast-text { line-height: 1.3; }

/* Invalid input highlight + styled validation tooltip (project-wide) */
.input-invalid,
.input.input-invalid,
.select.input-invalid,
.textarea.input-invalid {
    border-color: var(--alert) !important;
    box-shadow: 0 0 0 3px var(--alert-soft) !important;
}
.bt-tooltip {
    position: absolute;
    z-index: 80;
    display: flex; align-items: center; gap: .5rem;
    max-width: 320px;
    padding: .55rem .75rem;
    background: var(--ink);
    color: white;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
}
.bt-tooltip.show { opacity: 1; transform: translateY(0); }
.bt-tooltip::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px; height: 10px;
    background: var(--ink);
    border-radius: 2px;
}
.bt-tooltip-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--alert);
    color: white;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: var(--font-display);
}
.bt-tooltip-text { min-width: 0; }

@media (max-width: 900px) {
    .onboard-shell { grid-template-columns: 1fr; padding: 1.25rem 1rem 3rem; gap: 1.25rem; }
    .onboard-stepper { position: static; }
    .ob-steps-list { display: none; }
    .onboard-card { padding: 1.5rem; border-radius: 18px; min-height: 0; }
    .ob-actions { flex-direction: column; gap: .75rem; }
    .ob-actions .btn { width: 100%; }
    .ob-actions .ob-progress { order: -1; width: 100%; flex: none; }
    .onboard-header { padding: .85rem 1rem; }
    .topbar-onboard-btn span { display: none; }
}

/* Service detail modal */

.svc-card .svc-actions { display: flex; gap: .5rem; align-items: center; }

.svc-modal[hidden] { display: none; }
.svc-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: grid; place-items: center;
    padding: 1.25rem;
}
.svc-modal-scrim {
    position: absolute; inset: 0;
    background: rgba(13, 25, 35, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: svcModalFade 140ms ease-out;
}
.svc-modal-card {
    position: relative;
    background: var(--surface);
    color: var(--ink);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    width: min(820px, 100%);
    max-height: calc(100vh - 2.5rem);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: svcModalPop 180ms ease-out;
}
@keyframes svcModalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes svcModalPop {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.svc-modal-close {
    position: absolute; top: .75rem; right: .75rem; z-index: 2;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 120ms ease, transform 120ms ease;
}
.svc-modal-close:hover { background: #fff; transform: scale(1.04); }
.svc-modal-head {
    padding: 1.75rem 1.5rem 1.25rem;
    background-image: linear-gradient(135deg, rgba(15, 28, 48, 0.55), rgba(15, 28, 48, 0.35)), url('/images/webapp/herobanners/blue-astro-wide.webp');
    background-size: cover;
    background-position: center;
    color: #fff;
}
.svc-modal-eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .72rem;
    opacity: .85;
    margin-bottom: .35rem;
}
.svc-modal-head h2 {
    margin: 0 0 .35rem;
    font-size: 1.6rem;
    line-height: 1.2;
    color: #fff;
}
.svc-modal-tagline {
    margin: 0;

    max-width: 56ch;
    color: #ced8e4;
}
.svc-modal-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.svc-modal-meta .pill {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: transparent;
}
.svc-modal-meta .pill .dot { background: #fff; }
.svc-modal-meta .pill.gold {
    background: var(--gold-soft);
    color: var(--gold);
}
.svc-modal-meta .pill.gold .dot { background: var(--gold); }
.svc-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.svc-modal-section h3 {
    margin: 0 0 .4rem;
    font-size: 1rem;
    color: var(--ink);
}
.svc-modal-section p { margin: 0; color: var(--ink); }
.svc-modal-list {
    margin: .25rem 0 0;
    padding-left: 1.15rem;
    color: var(--ink);
}
.svc-modal-list li { margin-bottom: .25rem; }
.svc-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.svc-modal-tile {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .85rem .95rem;
}
.svc-modal-tile-label {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .7rem;
    color: var(--muted);
    margin-bottom: .3rem;
}
.svc-modal-tile-value { font-weight: 600; color: var(--ink); }
.svc-modal-tile-sub { margin: .25rem 0 0; font-size: .85rem; }
.svc-modal-tile-list {
    margin: .15rem 0 0;
    padding-left: 1.1rem;
    color: var(--ink);
}
.svc-modal-tile-list li { margin-bottom: .2rem; }
.svc-modal-cities {
    display: flex; flex-wrap: wrap; gap: .3rem;
    margin-top: .45rem;
}
.chip-static {
    display: inline-flex; align-items: center;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: .78rem;
    color: var(--ink);
}
.svc-modal-safety {
    background: var(--watch-soft);
    border-radius: 14px;
    padding: .85rem 1rem;
}
.svc-modal-safety h3 { color: var(--watch); }
.svc-modal-safety p { color: var(--watch); }
.svc-modal-foot {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    background: var(--surface);
}
.svc-modal-price { display: flex; flex-direction: column; line-height: 1.1; }
.svc-modal-price .price { font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.svc-modal-price .member { font-size: .8rem; color: var(--muted); }
.svc-modal-actions { display: flex; gap: .5rem; }
body.svc-modal-open { overflow: hidden; }
@media (max-width: 640px) {
    .svc-modal { padding: 0; }
    .svc-modal-card { max-height: 100vh; border-radius: 0; width: 100%; }
    .svc-modal-grid { grid-template-columns: 1fr; }
    .svc-modal-head { padding: 1.5rem 1.25rem 1rem; }
    .svc-modal-body { padding: 1rem 1.25rem; }
    .svc-modal-foot { padding: .85rem 1rem; }
}

/* Service walkthrough video card (fslightbox trigger) */
.svc-video-card {
    position: relative;
    display: block;
    width: 100%;
    height: 160px;
    min-height: 160px;
    flex-shrink: 0;
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 140ms ease, box-shadow 140ms ease;
    isolation: isolate;
    background: var(--surface-2);
}
.svc-video-image {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transition: transform 280ms ease;
}
.svc-video-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(15,28,48,.25) 0%, rgba(15,28,48,.55) 100%);
    z-index: 1;
}
.svc-video-card:hover,
.svc-video-card:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: #fff;
    text-decoration: none;
}
.svc-video-card:hover .svc-video-image { transform: scale(1.03); }
.svc-video-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--accent);
    display: grid; place-items: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: transform 140ms ease, background 140ms ease;
}
.svc-video-card:hover .svc-video-play { transform: translate(-50%, -50%) scale(1.06); background: #fff; }
.svc-video-play svg { margin-left: 3px; }
.svc-video-text {
    position: absolute;
    left: 1rem; bottom: .75rem;
    z-index: 2;
}
.svc-video-eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .72rem;
    font-weight: 600;
    background: rgba(15, 28, 48, 0.55);
    padding: .3rem .6rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Welcome popup (first visit after signup) */
.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(20, 30, 40, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: welcomeFade 160ms ease;
}
.welcome-modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    animation: welcomeRise 200ms ease;
}
.welcome-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}
.welcome-close:hover { background: var(--border); color: var(--ink); }
.welcome-eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .72rem;
    font-weight: 600;
    color: var(--accent-2);
    margin-bottom: .35rem;
}
.welcome-heading {
    font-family: var(--font-display);
    font-weight: 500;
    margin: 0 0 .5rem;
}
.welcome-lede {
    color: var(--muted);
    margin: 0 0 1.25rem;
}
.welcome-steps {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: grid;
    gap: 1rem;
}
.welcome-steps li {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}
.welcome-step-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: .85rem;
}
.welcome-steps strong { display: block; color: var(--ink); margin-bottom: .15rem; }
.welcome-steps p { margin: 0; color: var(--muted); font-size: .9rem; }
.welcome-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
}
@keyframes welcomeFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes welcomeRise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Biological age card (Overview) */
.bioage-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.bioage-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.bioage-value {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 2.1rem;
    color: var(--ink);
    line-height: 1.1;
}
.bioage-value .unit {
    font-size: 0.95rem;
    color: var(--muted);
    font-family: var(--font-sans);
    margin-left: .25rem;
}
.bioage-delta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 600;
    padding: .4rem .7rem;
    border-radius: 999px;
}
.bioage-delta.younger { color: var(--optimal); background: var(--optimal-soft); }
.bioage-delta.older { color: var(--alert); background: var(--alert-soft); }

.bioage-track-wrap { margin-top: .25rem; }
.bioage-track {
    position: relative;
    height: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.bioage-fill {
    position: absolute;
    top: 0; left: 0; height: 100%;
    background: linear-gradient(to right, var(--accent-soft), var(--accent-2));
    border-radius: 999px;
}
.bioage-marker {
    position: absolute; top: -4px;
    width: 16px; height: 16px;
    background: var(--accent);
    border: 3px solid var(--surface);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transform: translateX(-50%);
    z-index: 2;
}
.bioage-tick {
    position: absolute; top: -3px;
    width: 2px; height: 14px;
    background: var(--ink);
    transform: translateX(-50%);
    z-index: 1;
}
.bioage-tick-label {
    position: absolute;
    bottom: 18px; left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: .7rem;
    font-weight: 600;
    color: var(--muted);
}
.bioage-note {
    margin: 0;
    font-size: .85rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Key recommendation card (sits beside biological age) */
.rec-key-card {
    gap: .55rem;
}
.rec-key-card .rec-key-title {
    margin: .15rem 0 0;
    font-size: 1.1rem;
    color: var(--ink);
}
.rec-key-card .rec-cat {
    align-self: flex-start;
}
.rec-key-summary {
    margin: 0;
    font-size: .9rem;
    color: var(--muted);
    line-height: 1.45;
}
.rec-key-outcome {
    margin-top: auto;
    padding: .6rem .75rem;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.rec-key-outcome-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
}
.rec-key-outcome-value {
    font-size: .85rem;
    color: var(--ink-2);
    line-height: 1.4;
}
.rec-key-cta {
    align-self: flex-start;
    margin-top: auto;
}

/* Upcoming tasks (Overview) */
.task-list {
    display: flex;
    flex-direction: column;
}
.task-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: 0; }
.task-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
}
.task-icon.warn { background: var(--watch-soft); color: var(--watch); }
.task-icon.ok { background: var(--optimal-soft); color: var(--optimal); }
.task-main { flex: 1 1 auto; min-width: 0; }
.task-title { font-weight: 600; color: var(--ink); }
.task-meta { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.task-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}
.task-empty {
    text-align: center;
    padding: 1.5rem 1rem .5rem;
}
@media (max-width: 640px) {
    .task-action .pill { display: none; }
}

/* Responsive button labels (full on desktop, short on mobile) */
.label-short { display: none; }
@media (max-width: 640px) {
    .bioage-row { grid-template-columns: 1fr !important; }
    .label-full { display: none; }
    .label-short { display: inline; }
}


