:root {
    --bg: #f7faf8;
    --ink: #12211b;
    --muted: #5c6b64;
    --panel: #ffffff;
    --line: #dce7e1;
    --brand: #126c57;
    --brand-dark: #0a483a;
    --accent: #d96c3f;
    --focus: #1f6feb;
    font-size: 16px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
a { color: var(--brand-dark); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
    background: rgba(247, 250, 248, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.brand { font-size: 1.35rem; font-weight: 800; text-decoration: none; color: var(--ink); }
.topbar nav { display: flex; align-items: center; gap: .8rem; }
.topbar nav a { text-decoration: none; font-weight: 700; }
.hero {
    min-height: calc(100svh - 88px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, .7fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
    padding: clamp(2rem, 7vw, 6rem);
    background: linear-gradient(135deg, #edf8f1 0%, #fdf5ef 100%);
}
.eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
h1 { font-size: clamp(2.4rem, 7vw, 5.8rem); line-height: 1; margin: .3rem 0 1rem; letter-spacing: 0; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 0 0 1rem; }
.lede { font-size: clamp(1.25rem, 3vw, 2rem); color: var(--muted); max-width: 680px; }
.actions, .med-card form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: .85rem 1.15rem;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.button.secondary { background: #e7efe9; color: var(--brand-dark); }
.button.google { width: 100%; background: #1f1f1f; }
.button.small { min-height: 40px; padding: .55rem .8rem; }
.button.large { min-height: 64px; font-size: 1.2rem; padding: 1rem 1.4rem; }
.phone-shot {
    width: min(100%, 360px);
    min-height: 560px;
    justify-self: center;
    border: 10px solid #15231d;
    border-radius: 34px;
    padding: 1.2rem;
    background: #fbfffd;
    box-shadow: 0 24px 80px rgba(18, 33, 27, .18);
}
.phone-header { font-size: 1.8rem; font-weight: 900; margin-bottom: 1rem; }
.dose-card, .feature-grid article, .summary-grid article, .med-card, .settings-grid article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.dose-card { margin: 1rem 0; padding: 1.2rem; font-size: 1.5rem; font-weight: 900; }
.dose-card span { color: var(--muted); font-size: 1rem; font-weight: 700; }
.dose-card.strong { border-color: var(--brand); }
.dose-card.muted { background: #eef4f0; }
.section, .download-band, .dashboard, .form-page, .account-page, .auth-panel, .download-page {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4rem) 0;
}
.feature-grid, .screen-grid, .summary-grid, .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.feature-grid article, .summary-grid article, .settings-grid article { padding: 1.2rem; }
.screen { min-height: 260px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #10251e; color: white; font-weight: 900; }
.download-band { text-align: center; }
.footer { display: flex; justify-content: center; gap: 1rem; padding: 2rem 1rem 6rem; border-top: 1px solid var(--line); }
.auth-panel { max-width: 460px; }
form { display: grid; gap: 1rem; }
label { display: grid; gap: .4rem; font-weight: 800; }
input, textarea, select {
    width: 100%;
    min-height: 48px;
    padding: .75rem;
    border: 1px solid #bac9c1;
    border-radius: 8px;
    font: inherit;
    background: white;
}
textarea { min-height: 120px; resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.day-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.day-picker label { display: block; }
.day-picker input { inline-size: 1px; block-size: 1px; opacity: 0; position: absolute; }
.day-picker span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-weight: 900; }
.day-picker input:checked + span { background: var(--brand); color: white; }
.page-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.summary-grid { margin-bottom: 1.5rem; }
.summary-grid span { display: block; color: var(--muted); font-weight: 800; }
.summary-grid strong { display: block; font-size: 1.8rem; margin-top: .4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.med-card { padding: 1.2rem; }
.med-card h2 { font-size: 1.4rem; }
.strength { color: var(--brand-dark); font-weight: 900; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; }
dt { font-weight: 900; }
dd { margin: 0; color: var(--muted); }
.alert { border: 1px solid #f0b4a2; background: #fff2ec; padding: .8rem; border-radius: 8px; }
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    background: white;
    border-top: 1px solid var(--line);
}
.bottom-nav a { text-align: center; padding: .9rem .4rem; font-weight: 900; text-decoration: none; }
.error-page { display: grid; place-items: center; min-height: 80svh; text-align: center; padding: 2rem; }
body.large-text { font-size: 18px; }
body.extra-large-text { font-size: 21px; }
body.high-contrast-mode, body.high-visibility-mode { --bg: #000; --ink: #fff; --muted: #f2f2f2; --panel: #090909; --line: #fff; --brand: #ffdf4d; --brand-dark: #ffdf4d; }
body.large-buttons .button, body.large-buttons input, body.large-buttons select { min-height: 60px; }
body.simple-mode .feature-grid, body.simple-mode .summary-grid, body.simple-mode .settings-grid, body.simple-mode .cards { grid-template-columns: 1fr; }
body.reduced-motion * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .phone-shot { min-height: 420px; }
    .two-col, .page-heading { grid-template-columns: 1fr; display: grid; }
    .topbar nav a:not(.button) { display: none; }
    .bottom-nav { display: grid; }
    .footer { padding-bottom: 6rem; flex-wrap: wrap; }
}
