/* Layout: paper page with a faint spreadsheet grid behind the hero; content in a 1040px column. */
:root {
  --bg: #f7f6f1;
  --paper: #ffffff;
  --fg: #1d2b23;
  --muted: #5b6b62;
  --line: #d9ddd3;
  --accent: #1f6b45;
  --accent-ink: #ffffff;
  --accent-soft: #e4f0e8;
  --warn: #b4521a;
  --warn-soft: #fbeadf;
  --grid: #e3e6de;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131a16; --paper: #1b2420; --fg: #e8ede9; --muted: #9fb0a6; --line: #2d3a33;
    --accent: #5fc38f; --accent-ink: #0f1a14; --accent-soft: #1f3328; --warn: #f0a070; --warn-soft: #3a2619; --grid: #233029;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131a16; --paper: #1b2420; --fg: #e8ede9; --muted: #9fb0a6; --line: #2d3a33;
  --accent: #5fc38f; --accent-ink: #0f1a14; --accent-soft: #1f3328; --warn: #f0a070; --warn-soft: #3a2619; --grid: #233029;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; max-width: 62ch; }
code, .mono { font-family: var(--font-mono); }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.nav { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.nav .wrap { display: flex; align-items: center; gap: 24px; padding-block: 12px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.brand .mark { width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.8rem; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.nav a:not(.brand) { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a[aria-current="page"] { color: var(--fg); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.section { padding-block: 56px; }
.section + .section { border-top: 1px solid var(--line); }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.stack { display: grid; gap: 16px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-family: var(--font-body); font-size: 1rem; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 10px; min-width: 0; align-content: start; }
.card p { max-width: none; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: 0.9rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.sample-note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 14px; font-size: 0.9rem; }
table.sheet { border-collapse: collapse; font-family: var(--font-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; background: var(--paper); }
table.sheet th, table.sheet td { border: 1px solid var(--grid); padding: 6px 10px; min-width: 72px; text-align: left; white-space: nowrap; }
table.sheet th { background: var(--bg); color: var(--muted); font-weight: 500; text-align: center; }
table.sheet td.num { text-align: right; }
table.sheet td.target { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.scroll-x { overflow-x: auto; }
@media (prefers-reduced-motion: no-preference) { .btn { transition: transform 120ms ease; } .btn:active { transform: translateY(1px); } }
/* Added: Sheets look, segmented toggle, results tables, progress bars */
:root { --sheets-head: #dff0e3; --sheets-line: #b7d7c0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sheets-head: #1e3b2a; --sheets-line: #2f5a40; } }
:root[data-theme="dark"] { --sheets-head: #1e3b2a; --sheets-line: #2f5a40; }
table.sheet.sheets th { background: var(--sheets-head); color: var(--fg); }
table.sheet.sheets th, table.sheet.sheets td { border-color: var(--sheets-line); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; padding: 8px 14px; background: var(--paper); color: var(--muted); border: 0; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field input, .field select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--fg); min-width: 0; }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--paper); }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.score { font-family: var(--font-display); font-weight: 700; }
.good { color: var(--accent); } .bad { color: var(--warn); }
.linkbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkbox code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; }
.tag { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.btn.small { padding: 7px 12px; font-size: 0.9rem; }
/* Added: identity bar, toasts, progress page */
.identity { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.identity .avatar { border-radius: 50%; flex: none; }
.identity .id-text { display: grid; line-height: 1.3; min-width: 0; }
.identity .pill { margin-left: auto; }
#cr-toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; z-index: 50; max-width: min(320px, calc(100vw - 32px)); }
.cr-toast { background: var(--fg); color: var(--bg); border-radius: 10px; padding: 10px 14px; display: grid; gap: 2px; box-shadow: 0 6px 20px rgba(0,0,0,0.18); font-size: 0.95rem; }
.cr-toast b { font-family: var(--font-display); }
.cr-toast span { font-size: 0.85rem; opacity: 0.85; }
.cr-toast.out { opacity: 0; transition: opacity 300ms; }
@media (prefers-reduced-motion: no-preference) { .cr-toast { animation: cr-in 220ms ease-out; } @keyframes cr-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } } }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring b { font-family: var(--font-display); font-size: 1.5rem; }
.badges { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.badge { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 6px; justify-items: center; text-align: center; font-size: 0.85rem; }
.badge .icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; background: var(--accent); color: var(--accent-ink); }
.badge.locked { opacity: 0.45; } .badge.locked .icon { background: var(--line); color: var(--muted); }
.badge b { font-size: 0.9rem; }
.goal { display: flex; gap: 6px; } .goal i { width: 28px; height: 10px; border-radius: 999px; background: var(--line); } .goal i.on { background: var(--accent); }
.statgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stat { background: var(--bg); border-radius: 8px; padding: 12px; display: grid; gap: 2px; }
.stat b { font-family: var(--font-display); font-size: 1.4rem; }
.stat span { font-size: 0.8rem; color: var(--muted); }
.lb-row { display: grid; grid-template-columns: 28px 32px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lb-row img { border-radius: 50%; } .lb-row.me { background: var(--accent-soft); border-radius: 8px; padding-inline: 8px; }
.lb-row .rank { font-family: var(--font-mono); color: var(--muted); }
/* Added: account controls, locked exercises, upsell */
.acct { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.acct .acct-name { font-weight: 600; }
.acct .linkbtn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.acct .signin { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acct .signin input { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--fg); min-width: 200px; }
.nav .acct { margin-left: auto; }
.nav ul { margin-left: 0; }
.identity .acct { margin-left: auto; }
.identity .pill { margin-left: 0; }
.list button.locked { color: var(--muted); }
.list button.locked .done { background: var(--bg); }
.upsell { background: var(--accent-soft); border-radius: 10px; padding: 18px; display: grid; gap: 10px; }
.upsell h3 { font-size: 1.1rem; }
.upsell .row { display: flex; gap: 10px; flex-wrap: wrap; }
.legal h2 { margin-top: 24px; } .legal p, .legal li { max-width: 70ch; color: var(--muted); } .legal ul { padding-left: 20px; }
