/* public/style.css — "ink and ochre": warm white paper, ink text, one ochre accent for the typical range, wins and the
   selected answer. Source Serif 4 for headlines and long reads, Atkinson Hyperlegible Next for the interface, tabular
   numerals everywhere. Text never below 16px, controls 48px tall, hairlines instead of heavy borders. */
:root {
  --bg: #FBFAF6; --surface: #FFFFFF; --fg: #151412; --muted: #5E5950;
  --accent: #E0A526; --accent-deep: #8A5F00; --on-accent: #151412;
  --primary: #151412; --primary-hover: #2E2B27; --on-primary: #FBFAF6;
  --line: #E8E4DB; --field: #8F897E; --bad: #A3361F; --ok: #8A5F00;
  --band: rgba(224, 165, 38, 0.26); --tint: rgba(224, 165, 38, 0.14); --hover: rgba(21, 20, 18, 0.04);
  --mark-bg: #151412;
  color-scheme: light;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110; --surface: #1C1B18; --fg: #F2EFE7; --muted: #B3AC9F;
    --accent: #E0A526; --accent-deep: #EBBB4E; --on-accent: #151412;
    --primary: #F2EFE7; --primary-hover: #FFFFFF; --on-primary: #151412;
    --line: #2E2C27; --field: #7C766B; --bad: #F0907C; --ok: #EBBB4E;
    --band: rgba(224, 165, 38, 0.24); --tint: rgba(224, 165, 38, 0.16); --hover: rgba(242, 239, 231, 0.06);
    --mark-bg: #2A2824;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.55 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
main { max-width: 680px; margin: 0 auto; padding: 40px 16px 72px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--fg); }
h1 { font-size: 2.3rem; line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 14px; }
h2 { font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.01em; margin: 44px 0 10px; }
h3 { line-height: 1.25; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.nowrap { white-space: nowrap; }
p, li { color: var(--fg); }
.small, .muted { color: var(--muted); font-size: 1rem; }
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 700; }

.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; background: var(--primary); color: var(--on-primary); border: 1px solid transparent; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.button:hover, button:hover { background: var(--primary-hover); text-decoration: none; }
button.secondary, .button.secondary { background: transparent; color: var(--fg); border-color: var(--field); }
button.secondary:hover, .button.secondary:hover { background: var(--hover); border-color: var(--fg); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: color-mix(in srgb, var(--bad) 8%, transparent); }
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }

label, legend { display: block; margin: 22px 0 6px; font-weight: 600; padding: 0; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); color: var(--fg); transition: border-color 0.15s; }
input:hover, select:hover, textarea:hover { border-color: var(--fg); }
select { appearance: none; -webkit-appearance: none; padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="number"] { font-size: 1.15rem; font-weight: 600; }
textarea { min-height: 96px; }
fieldset { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
fieldset > legend { margin: 0 0 8px; }
.row { display: flex; gap: 12px; align-items: flex-end; } .row > * { flex: 1; }
.msg { margin: 16px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); white-space: pre-line; }
.msg.bad { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 5%, var(--surface)); }
.msg.ok { border-color: transparent; background: var(--tint); }
.choice { display: flex; gap: 8px; }
.choice label { flex: 1; margin: 0; min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); font-weight: 600; position: relative; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.choice label:hover { border-color: var(--fg); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: -1px; overflow: hidden; }
.choice label:has(input:checked) { background: var(--accent); border-color: var(--on-accent); color: var(--on-accent); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.inline { width: auto; min-height: 0; margin-right: 8px; vertical-align: middle; accent-color: var(--accent-deep); }
input[type="checkbox"].inline { width: 22px; height: 22px; margin: 0; }
label:has(> input[type="checkbox"]) { position: relative; padding-left: 34px; font-weight: 400; }
label:has(> input[type="checkbox"]) > input { position: absolute; left: 0; top: 1px; }
[hidden] { display: none !important; }
footer { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 20px; }
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { font-weight: 600; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 16px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; margin-left: auto; color: var(--muted); font-size: 1.4rem; font-weight: 400; line-height: 1; }
details[open] > summary::after { content: '\2212'; }
pre.plan { white-space: pre-wrap; font: 1.06rem/1.65 var(--serif); margin: 8px 0 16px; }

/* The mark: the first letter of the name in ochre on ink. The wordmark is set in the text serif. */
.mark { display: inline-block; width: 30px; height: 30px; vertical-align: middle; flex-shrink: 0; }
.mark rect { fill: var(--mark-bg); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 1.4rem; letter-spacing: -0.01em; color: var(--fg); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-row { margin: 0 0 28px; }
body.with-sidebar .brand-row { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
label.question { font-weight: 400; margin: 0 0 12px; }
/* The one hand-drawn line: an ochre underline under the landing headline. */
.underline { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 14' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 4, 80 12, 120 7 S 190 10, 218 6' fill='none' stroke='%23E0A526' stroke-width='5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat left bottom / 100% 0.3em; padding-bottom: 0.14em; }

/* Weight chart */
svg.chart { display: block; width: 100%; height: 260px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-family: var(--sans); font-size: 13px; }
.chart .band { fill: var(--band); }
.chart .band-edge { fill: none; stroke: var(--accent-deep); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .goal { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .weight { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--fg); }
.chart .pt.above { fill: var(--accent); stroke: var(--fg); stroke-width: 2; }
.chart .missed { stroke: var(--muted); stroke-width: 2; }
.chart .alert-mark { fill: var(--fg); }
.chart .win-mark { fill: var(--accent); stroke: var(--fg); stroke-width: 1.5; }
.chart .note { fill: var(--fg); font-family: var(--serif); font-style: italic; font-size: 17px; }
.chart .note-arrow { fill: none; stroke: var(--muted); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.legend .key { display: inline-block; width: 16px; height: 10px; margin-right: 6px; vertical-align: middle; }
.key-weight { height: 0; border-top: 2px solid var(--fg); }
.key-band { background: var(--band); border-radius: 2px; box-shadow: inset 0 0 0 1px var(--accent-deep); }
.key-goal { height: 0; border-top: 2px dashed var(--muted); }
.key-above { width: 10px !important; height: 10px !important; border-radius: 50%; background: var(--accent); border: 2px solid var(--fg); }
.key-missed { width: 2px !important; height: 10px; background: var(--muted); }
.key-alert { width: 0 !important; height: 0 !important; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid var(--fg); }
.legend svg.key-win { width: 12px; height: 10px; }
.key-win path { fill: var(--accent); stroke: var(--fg); stroke-width: 1.25; stroke-linejoin: round; }
ul.alerts { list-style: none; padding: 0; margin: 8px 0 0; }
ul.alerts li { padding: 10px 0 10px 16px; border-bottom: 1px solid var(--line); position: relative; display: grid; grid-template-columns: 11.5em 1fr; gap: 12px; align-items: baseline; }
ul.alerts li::before { content: ''; position: absolute; left: 0; top: 50%; margin-top: -4px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
ul.alerts li.alert::before { border-top: 7px solid var(--fg); }
ul.alerts li.win::before { border-bottom: 7px solid var(--accent); }
ul.alerts li.win { color: var(--accent-deep); font-weight: 600; }
ul.alerts li span { color: var(--muted); font-weight: 400; }
@media (max-width: 560px) { ul.alerts li { grid-template-columns: 1fr; gap: 2px; } }
.today-wins p { margin: 8px 0 0; color: var(--accent-deep); font-weight: 600; }
.today-wins p::before { content: ''; display: inline-block; width: 0; height: 0; margin-right: 8px; vertical-align: 1px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--accent); }

/* Day picker on the check-in */
.day-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.day-pick .day { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 48px; padding: 8px 12px; background: var(--surface); color: var(--fg); border: 1px solid var(--field); border-radius: 12px; font-weight: 600; line-height: 1.2; }
.day-pick .day:hover { background: var(--surface); border-color: var(--fg); }
.day-pick .day[aria-pressed="true"] { border-color: var(--accent-deep); background: var(--tint); box-shadow: inset 0 0 0 1px var(--accent-deep); }
.day-pick .status { font-size: 1rem; font-weight: 400; color: var(--muted); }
.day-pick .status.done { color: var(--accent-deep); }
.day-pick .status.missing { color: var(--bad); }

/* Sidebar on the signed-in pages; a top bar under 720px. */
body.with-sidebar { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 28px 16px; border-right: 1px solid var(--line); background: var(--bg); }
.sidebar .brand { padding: 0 12px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar ul a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--fg); text-decoration: none; font-weight: 600; }
.sidebar ul a:hover { background: var(--hover); }
.sidebar ul a[aria-current="page"] { background: var(--tint); box-shadow: inset 3px 0 0 var(--accent-deep); }
.sidebar .who { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 0 12px; color: var(--muted); overflow-wrap: anywhere; }
.sidebar .who a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 720px) {
  body.with-sidebar { display: block; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 8px 0 0; }
  .sidebar ul { flex-direction: row; }
  .sidebar .who { margin: 0 0 0 auto; padding: 0; }
  .sidebar .who .email { display: none; }
  .sidebar ul a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent-deep); }
}

/* Staging-only test-user box */
.test-users { border: 1px dashed var(--accent-deep); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; background: var(--tint); }
.test-users label { color: var(--accent-deep); font-weight: 600; margin-top: 0; }

/* Site header (homepage) */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 24px; }
.site-header nav { margin-left: auto; }
.site-header .anchors { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 24px; font-weight: 600; }
.site-header .anchors a, .site-header .signin { color: var(--fg); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-header .anchors a:hover, .site-header .signin:hover { color: var(--accent-deep); }
.site-header .header-actions { display: flex; align-items: center; gap: 20px; }
.site-header .signin { color: var(--muted); font-weight: 600; }
.site-header .button { min-height: 44px; padding: 0 20px; }
@media (max-width: 900px) { .site-header nav { display: none; } .site-header .header-actions { margin-left: auto; gap: 16px; } }

/* Homepage */
main.landing { max-width: 1120px; padding: 0 16px 0; }
.landing section { padding: 72px 0 8px; scroll-margin-top: 72px; }
.landing h1 { font-size: clamp(2.5rem, 4.6vw, 3.6rem); line-height: 1.06; letter-spacing: -0.02em; margin: 0 0 22px; }
.landing h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 10px; max-width: 820px; }
.landing .sub { color: var(--muted); font-size: 1.1rem; margin: 0 0 28px; max-width: 720px; }
.landing .eyebrow { color: var(--accent-deep); font-weight: 600; margin: 0 0 8px; }
.landing .lead { font-size: 1.2rem; line-height: 1.55; margin: 0 0 28px; max-width: 560px; }
.landing .cta { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-bottom: 18px; }
.landing .cta .button { min-height: 54px; padding: 0 30px; font-size: 1.05rem; }
.landing .cta a:not(.button) { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.landing .hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px 64px; align-items: center; padding: 64px 0 56px; }
@media (max-width: 900px) { .landing .hero { grid-template-columns: 1fr; padding-top: 40px; } }

/* The hero's sample check-in: a picture of the product, not a form. */
.hero-visual { position: relative; padding-bottom: 28px; }
.sample-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px 24px 52px; box-shadow: 0 1px 2px rgba(21, 20, 18, 0.05); display: flex; flex-direction: column; gap: 14px; }
.sample-tag { position: absolute; top: 14px; right: 16px; font-size: 1rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; line-height: 1.6; }
.sample-top { margin: 0; color: var(--muted); }
.sample-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sample-label { font-weight: 600; }
.sample-input { border: 1px solid var(--field); border-radius: 10px; padding: 8px 14px; font-size: 1.15rem; font-weight: 600; }
.sample-input.note { font-size: 1rem; font-weight: 400; color: var(--muted); }
.sample-chips { display: flex; gap: 6px; }
.sample-chips span { flex: 1; text-align: center; border: 1px solid var(--field); border-radius: 10px; padding: 7px 0; font-weight: 600; }
.sample-chips span.on { background: var(--accent); border-color: var(--on-accent); color: var(--on-accent); }
.sample-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sample-button { align-self: flex-start; background: var(--primary); color: var(--on-primary); border-radius: 999px; padding: 10px 22px; font-weight: 600; }
.sample-confirm { position: absolute; left: 24px; right: 24px; bottom: 0; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 16px; box-shadow: 0 6px 20px rgba(21, 20, 18, 0.08); }
.sample-confirm::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: 2px; }

/* Facts strip in place of a logo bar */
.facts { list-style: none; margin: 0; padding: 20px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 600; }
.facts li { position: relative; padding-left: 18px; }
.facts li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (max-width: 900px) { .facts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }

.landing .steps { display: flex; flex-wrap: wrap; gap: 20px 32px; margin-bottom: 8px; }
.landing .step { flex: 1 1 280px; border-top: 1px solid var(--line); padding-top: 18px; }
.landing .step .n { color: var(--accent-deep); font-weight: 600; }
.landing .step h3 { font-size: 1.5rem; margin: 6px 0 8px; letter-spacing: -0.01em; }
.landing .step p { margin: 0; }

.range-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 48px; align-items: end; margin: 8px 0 24px; }
.range-intro > p { margin: 0; max-width: 560px; }
.stat-inline::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--accent); margin-bottom: 16px; }
.stat-inline .big { font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 3.6rem); font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.stat-inline p { margin: 10px 0 0; font-weight: 600; max-width: 460px; }
@media (max-width: 760px) { .range-intro { grid-template-columns: 1fr; } }
.landing .chartbox { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.landing .chartbox .caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; align-items: baseline; margin-bottom: 14px; }
.landing .chartbox svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
.landing .chartbox svg.chart-narrow { display: none; }
.landing .chartbox .sources { margin: 14px 0 0; }

.landing .twocol { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; }
.landing .twocol > div:first-child { flex: 1 1 300px; min-width: 0; }
.landing .twocol > div:last-child { flex: 2 1 500px; min-width: 0; }
.landing .summary { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; font-family: var(--serif); font-size: 1.06rem; line-height: 1.65; }
.landing .summary .sample-tag { font-family: var(--sans); }
.landing .summary h4 { margin: 0 0 6px; font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.landing .summary p { margin: 0 0 18px; }
.landing .summary p:last-child { margin-bottom: 0; }

.landing .pair { display: flex; flex-wrap: wrap; gap: 20px; }
.landing .pair > div { flex: 1 1 400px; min-width: 0; border-radius: 20px; padding: 28px; background: var(--surface); border: 1px solid var(--line); }
.landing .pair h3 { margin: 0 0 16px; font-size: 1.5rem; }
.landing .pair .says div, .landing .pair .never div { position: relative; padding: 12px 0 12px 22px; border-top: 1px solid var(--line); }
.landing .pair .says div::before { content: ''; position: absolute; left: 2px; top: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.landing .pair .never div { color: var(--muted); }
.landing .pair .never div::before { content: ''; position: absolute; left: 1px; top: 25px; width: 10px; height: 2px; background: var(--muted); }
.landing .pair .links { margin: 16px 0 0; font-weight: 600; }

.plan { max-width: 560px; margin: 8px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; text-align: center; }
#pricing h2 { text-align: center; margin-left: auto; margin-right: auto; }
.plan-label { margin: 0; color: var(--accent-deep); font-weight: 600; }
.plan-price { font-family: var(--serif); font-size: 3.6rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.plan > .small { margin: 4px 0 0; }
.plan-list { list-style: none; margin: 22px 0 24px; padding: 0; text-align: left; }
.plan-list li { position: relative; padding: 10px 0 10px 26px; border-top: 1px solid var(--line); }
.plan-list li::before { content: ''; position: absolute; left: 4px; top: 19px; width: 10px; height: 6px; border-left: 2px solid var(--accent-deep); border-bottom: 2px solid var(--accent-deep); transform: rotate(-45deg); }
.plan .button { min-width: 220px; }
.plan .button + .small { margin-top: 16px; }

.landing .faq { border-top: 1px solid var(--line); }
.landing .faq details p { margin: 8px 0 0; color: var(--muted); }
.landing .final { background: var(--primary); color: var(--on-primary); border-radius: 24px; padding: 48px 40px; display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; justify-content: space-between; margin: 32px 0 0; }
.landing .final h2 { color: var(--on-primary); margin: 0 0 8px; }
.landing .final p { color: var(--on-primary); opacity: 0.82; margin: 0; }
.landing .final-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.landing .final .button { background: var(--accent); color: var(--on-accent); min-height: 56px; padding: 0 32px; font-size: 1.05rem; }
.landing .final .button:hover { background: color-mix(in srgb, var(--accent) 88%, #FFFFFF); }
.landing .final .button:focus-visible { outline-color: var(--accent); }
.landing .final-signin { color: var(--on-primary); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
@media (prefers-color-scheme: dark) {
  .landing .final { background: var(--surface); border: 1px solid var(--line); color: var(--fg); }
  .landing .final h2, .landing .final p, .landing .final-signin { color: var(--fg); }
}
.landing .highlight { background: var(--accent); color: var(--on-accent); padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* Site footer, on every page */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 40px 0 48px; }
main:not(.landing) .site-footer { margin-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 32px; }
.footer-grid h2 { font-family: var(--sans); font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; margin: 0 0 8px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li a { display: inline-flex; align-items: center; min-height: 40px; color: var(--fg); text-decoration: none; }
.footer-grid li a:hover { color: var(--accent-deep); text-decoration: underline; }
.footer-brand p { color: var(--muted); max-width: 360px; }
.footer-brand .operator a { overflow-wrap: anywhere; }
.footer-fine { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; color: var(--muted); max-width: 860px; }
.footer-fine p { margin: 0 0 10px; }
main:not(.landing) .footer-grid { grid-template-columns: 1fr 1fr; }
main:not(.landing) .footer-brand { grid-column: 1 / -1; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Compact footer on the signed-in pages */
.site-footer.compact { margin-top: 56px; padding: 16px 0 32px; color: var(--muted); }
.site-footer.compact nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer.compact nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.site-footer.compact nav a:hover { color: var(--accent-deep); text-decoration: underline; }
.site-footer.compact p { margin: 4px 0 0; max-width: 680px; }
/* On the signed-in pages the footer sits at the bottom of the window when the content is short. */
@media (min-width: 721px) {
  body.with-sidebar main { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 0; }
  body.with-sidebar .page-body { flex: 1 0 auto; }
}

/* Legal pages */
main.legal { max-width: 760px; }
.legal h2 { margin-top: 48px; scroll-margin-top: 16px; }
.legal h3 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal li { margin: 6px 0; }
.legal .toc { border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin: 24px 0 8px; background: var(--surface); }
.legal .toc ol { margin: 0; padding-left: 22px; columns: 2 220px; column-gap: 32px; }
.legal .toc li { margin: 4px 0; break-inside: avoid; }
.legal table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 1rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.legal th { font-weight: 700; border-bottom-color: var(--field); }
@media (max-width: 640px) {
  .legal table, .legal thead, .legal tbody, .legal tr, .legal th, .legal td { display: block; }
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .legal td { border: 0; padding: 2px 0; }
}
.legal .box, .legal aside { border: 1px solid var(--accent-deep); border-radius: 14px; padding: 16px 20px; margin: 24px 0; background: var(--tint); }

@media (max-width: 560px) {
  .landing .chartbox { padding: 20px 16px; }
  .landing .chartbox svg.chart-wide { display: none; }
  .landing .chartbox svg.chart-narrow { display: block; }
  .landing .pair > div { padding: 22px 20px; }
  .landing .summary { padding: 24px 20px; }
  .landing .final { padding: 36px 24px; }
  .plan { padding: 24px 20px; }
  .sample-card { padding: 22px 18px 20px; }
  .sample-row { grid-template-columns: 1fr; }
}
