/* Shared styles for every page. Colors are tokens on :root; dark mode follows the
   system setting unless the visitor picks a theme (data-theme on <html>). */
/* Brand fonts (SIL Open Font License), self-hosted. */
@font-face { font-family: "Big Shoulders Display"; font-weight: 900; font-display: swap; src: url("/fonts/BigShouldersDisplay-Black.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("/fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("/fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2"); }
/* Local fallbacks sized to match the brand fonts, so text doesn't jump when
   they finish loading (measured against Arial in the browser). */
@font-face { font-family: "Atkinson Fallback"; src: local("Arial"); size-adjust: 99.4%; ascent-override: 95.6%; descent-override: 29.2%; line-gap-override: 0%; }
@font-face { font-family: "Display Fallback"; src: local("Arial Bold"), local("Arial"); font-weight: 900; size-adjust: 70%; ascent-override: 140%; descent-override: 30.4%; line-gap-override: 0%; }
:root {
  --bg: #F4F1E8; --surface: #FFFFFF; --surface-2: #EBE7DC; --text: #111411; --muted: #5F5B52;
  --line: #DDD8CB; --accent: #0B5D3F; --accent-ink: #FFFFFF; --accent-soft: #E3EFE8;
  --good: #0B5D3F; --good-soft: #E6F3D0; --bad: #B8420C; --bad-soft: #F8E4D9; --code: #FAF8F2; --lime: #D4F25A;
}
@media (prefers-color-scheme: dark) {
  :root {
      --bg: #111411; --surface: #1A1E1A; --surface-2: #232823; --text: #F4F1E8; --muted: #A9A596;
      --line: #2F352F; --accent: #D4F25A; --accent-ink: #111411; --accent-soft: #263016;
      --good: #7BD3A0; --good-soft: #17301F; --bad: #F08A5D; --bad-soft: #3A1F14; --code: #161A16; --lime: #D4F25A;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 "Atkinson Hyperlegible", "Atkinson Fallback", system-ui, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
section { padding: 72px 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 750; }
h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border: 0; border-radius: 10px; padding: 13px 20px; font: 600 1rem "Atkinson Hyperlegible", "Atkinson Fallback", sans-serif; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn:disabled { opacity: .6; cursor: wait; }

nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
nav .links { display: flex; gap: 22px; align-items: center; }
nav .links a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; }
section, .result { scroll-margin-top: 72px; }
@media (max-width: 640px) { nav .links a:not(.btn) { display: none; } }

.hero { padding: 80px 0 40px; text-align: center; }
.hero p.lead { font-size: 1.2rem; max-width: 640px; margin: 0 auto 28px; color: var(--muted); }
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 28px; }
.works-with { margin-top: 40px; }
.works-with p { margin: 0 0 14px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.works-with ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; }
.works-with li { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 1.02rem; color: var(--text); opacity: .85; }
.ai-logo { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.ai-mono { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--text); color: var(--bg); font-size: .78rem; font-weight: 800; }
.chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .88rem; color: var(--muted); }

/* Exercise */
#try { padding-top: 32px; }
.exercise { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 40px rgb(0 0 0 / .06); overflow: hidden; }
.ex-head { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.ex-head .crumb { font-size: .85rem; color: var(--muted); }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.ex-body { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .ex-body { grid-template-columns: 1fr; } }
.pane { padding: 22px 24px; min-width: 0; }
.pane + .pane { border-left: 1px solid var(--line); }
@media (max-width: 860px) { .pane + .pane { border-left: 0; border-top: 1px solid var(--line); } }
.label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.material { background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: .86rem; max-height: 300px; overflow: auto; }
textarea { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 15px/1.5 "Atkinson Hyperlegible", "Atkinson Fallback", sans-serif; background: var(--surface); color: var(--text); }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.hint { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .92rem; }
.err { color: var(--bad); font-size: .92rem; }

.result { border-top: 1px solid var(--line); padding: 22px 24px; display: none; }
.result.show { display: block; }
.score { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.score .num { font-size: 2.2rem; font-weight: 800; }
.output { background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: .92rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: .92rem; }
.checks li.pass { background: var(--good-soft); }
.checks li.fail { background: var(--bad-soft); }
.checks .icon { font-weight: 800; }
.checks .pass .icon { color: var(--good); }
.checks .fail .icon { color: var(--bad); }
.checks .note { display: block; color: var(--muted); }
.tip { margin-top: 16px; padding: 14px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.auth { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; }
.auth .who { color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .auth .who { display: none; } }
.btn-sm { padding: 8px 12px; font-size: .9rem; }
.ex-tab .best { font-weight: 500; opacity: .8; margin-left: 6px; }
.ex-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.ex-tab { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 16px; font: 600 .95rem "Atkinson Hyperlegible", "Atkinson Fallback", sans-serif; cursor: pointer; }
.ex-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ex-tab:disabled { opacity: .6; cursor: wait; }
.output.streaming::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.checks li.pending { background: var(--surface-2); }
.checks li.pending .icon { color: var(--muted); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.checks .tag-live { font-size: .7rem; font-weight: 700; color: var(--muted); margin-left: 6px; }
.skeleton { display: inline-block; height: .9em; width: 70%; border-radius: 6px; background: var(--line); animation: pulse 1.2s ease-in-out infinite; vertical-align: middle; }
.prompt-hints { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: .9rem; }
.prompt-hints li { color: var(--muted); }
.prompt-hints li.pass { color: var(--good); }
.prompt-hints li::before { content: "○ "; }
.prompt-hints li.pass::before { content: "● "; }
.mistakes { margin-top: 22px; }
.mistakes h3 { margin-bottom: 4px; }
.mistake-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 860px) { .mistake-list { grid-template-columns: 1fr; } }
.mistake { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.mistake.made { border-color: var(--bad); background: var(--bad-soft); }
.mistake .made-tag { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--bad); margin-bottom: 4px; }
.mistake.avoided .made-tag { color: var(--good); }
.mistake strong { display: block; margin-bottom: 4px; }
.mistake p { margin: 0 0 6px; font-size: .9rem; color: var(--muted); }
.mistake .fix { color: var(--text); }
details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 600; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .result-grid { grid-template-columns: 1fr; } }

/* Sections */
.center { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.step-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 12px; }
.compare { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.compare th { background: var(--surface-2); font-size: .9rem; }
.compare td:not(:first-child) { text-align: center; }
.table-scroll { overflow-x: auto; }
.lessons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .lessons { grid-template-columns: 1fr; } }
.lesson { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-weight: 500; }
.lesson .tag { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.tag.free { background: var(--good-soft); color: var(--good); }
.tag.pro { background: var(--surface-2); color: var(--muted); }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--accent); }
.plan .ribbon { position: absolute; top: -12px; left: 26px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.price { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; }
.price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.plan ul { padding-left: 18px; margin: 16px 0 22px; flex: 1; }
.plan form { display: grid; gap: 8px; }
.plan input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: 15px "Atkinson Hyperlegible", "Atkinson Fallback", sans-serif; background: var(--bg); color: var(--text); }
.plan .btn { justify-content: center; }
.ok { color: var(--good); font-weight: 600; }
.guarantee { text-align: center; margin-top: 22px; color: var(--muted); }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 0 0 10px; }
.faq p { margin: 10px 0 0; color: var(--muted); }
.final { text-align: center; background: var(--surface-2); }
footer { padding: 30px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* --- Theme override: a visitor's manual choice beats the system setting. */
:root[data-theme="light"] {
  --bg: #F4F1E8; --surface: #FFFFFF; --surface-2: #EBE7DC; --text: #111411; --muted: #5F5B52;
  --line: #DDD8CB; --accent: #0B5D3F; --accent-ink: #FFFFFF; --accent-soft: #E3EFE8;
  --good: #0B5D3F; --good-soft: #E6F3D0; --bad: #B8420C; --bad-soft: #F8E4D9; --code: #FAF8F2; --lime: #D4F25A;
}
:root[data-theme="dark"] {
  --bg: #111411; --surface: #1A1E1A; --surface-2: #232823; --text: #F4F1E8; --muted: #A9A596;
  --line: #2F352F; --accent: #D4F25A; --accent-ink: #111411; --accent-soft: #263016;
  --good: #7BD3A0; --good-soft: #17301F; --bad: #F08A5D; --bad-soft: #3A1F14; --code: #161A16; --lime: #D4F25A;
}

/* --- Accessibility (WCAG 2.2 AA) */
body { font-size: 17px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
textarea:focus, input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- Nav: keep it on one line at medium widths. */
.logo { white-space: nowrap; }
@media (max-width: 960px) { nav .links a.nav-extra { display: none; } }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 10px; min-width: 40px; min-height: 40px; cursor: pointer; font-size: 1.05rem; }

/* --- Search */
.search { position: relative; max-width: 620px; margin: 28px auto 0; text-align: left; }
.search input { width: 100%; padding: 16px 18px 16px 48px; font: 500 1.05rem "Atkinson Hyperlegible", "Atkinson Fallback", sans-serif; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 6px 24px rgb(0 0 0 / .06); }
.search::before { content: "⌕"; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--muted); pointer-events: none; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgb(0 0 0 / .14); list-style: none; margin: 0; padding: 6px; z-index: 10; max-height: 380px; overflow: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a:focus, .search-results [aria-selected="true"] a { background: var(--surface-2); }
.search-results small { display: block; color: var(--muted); }
.stats { margin-top: 14px; color: var(--muted); font-size: .95rem; }
.stats strong { color: var(--text); }

/* --- Library and tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tile strong { display: block; }
.tile small { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.filters select, .filters input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: 500 .95rem "Atkinson Hyperlegible", "Atkinson Fallback", sans-serif; min-height: 44px; }
.filters input { flex: 1 1 260px; }
.ex-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ex-list a { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--text); text-decoration: none; }
.ex-list a:hover { border-color: var(--accent); }
.ex-list small { grid-column: 1; color: var(--muted); }
.ex-list .tag { grid-row: 1 / span 2; grid-column: 2; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.page-head { padding: 56px 0 8px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

/* --- Privacy note and trust lines */
.privacy-note { margin: 10px 0 0; font-size: .86rem; color: var(--muted); }
.privacy-note a { color: var(--muted); }
.next-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* --- Account dialog */
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 24px; max-width: 440px; width: calc(100% - 32px); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog .row { justify-content: flex-start; }
.btn-danger { background: var(--bad); color: #fff; }

/* --- Legal pages */
.prose { max-width: 720px; }
.prose h2 { font-size: 1.4rem; margin-top: 32px; }
.prose li { margin-bottom: 6px; }

/* --- Simple landing page */
.hero h1 { margin-bottom: 18px; }
.signup { display: flex; justify-content: center; min-height: 48px; margin-top: 8px; }
.signup-note { margin: 12px 0 0; font-size: .95rem; }
.narrow { max-width: 720px; }
section.simple { padding: 48px 0; }
section.simple h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: 36px; }
section.simple h2:first-child { margin-top: 0; }
section.simple p { font-size: 1.08rem; line-height: 1.7; }
.faq-simple { padding-top: 8px !important; }
.final .signup { margin-top: 18px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* --- Upgrade dialog */
#upgrade-dialog { max-width: 560px; }
.upgrade-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
@media (max-width: 560px) { .upgrade-plans { grid-template-columns: 1fr; } }
.upgrade-plan { display: grid; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; min-height: 44px; }
.upgrade-plan:hover { border-color: var(--accent); }
.upgrade-plan.featured { border: 2px solid var(--accent); }
.upgrade-plan small { color: var(--muted); }
.price-sm { font-size: 1.5rem; font-weight: 800; }
.price-sm small { font-size: .9rem; font-weight: 500; }
.secured { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); margin: 12px 0 0; }
.stripe-logo { width: 42px; height: 18px; flex: none; background: #635bff; -webkit-mask: url(/logos/stripe.svg) center / contain no-repeat; mask: url(/logos/stripe.svg) center / contain no-repeat; }

/* --- App: dashboard and lesson view (modeled on Excel Exercises) */
.wrap.wide { max-width: 1320px; }
.app-main { padding-top: 28px; padding-bottom: 48px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.panel-title { font-size: .85rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--good); margin: 0 0 10px; }
.big-num { font-size: 2rem; font-weight: 800; margin: 0; }
.small { font-size: .9rem; }
.bar { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--good); border-radius: 999px; }
.progress-row { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.legend { font-size: .85rem; color: var(--muted); margin: 6px 0 0; display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: middle; }
.dot.practice { background: #c98a00; }
.dot.mastered { background: var(--good); }
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin: 0; }
.track-pick { display: grid; gap: 4px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.track-pick select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: 600 1rem "Atkinson Hyperlegible", "Atkinson Fallback", sans-serif; }
.dash-row { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }
.dash-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-content: start; }
.dash-side .panel { margin: 0; }
@media (max-width: 900px) { .dash-row, .dash-side { grid-template-columns: 1fr; } }
.next-btn { white-space: normal; text-align: left; line-height: 1.35; width: 100%; justify-content: flex-start; }
.section-label { font-size: 1rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 30px 0 12px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lesson-card { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; color: var(--text); text-decoration: none; box-shadow: 0 2px 8px rgb(0 0 0 / .04); }
.lesson-card:hover { border-color: var(--accent); }
.lesson-card strong { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .02em; color: var(--accent); }
.lesson-card small { color: var(--muted); }
.lesson-card .bar { margin-top: 8px; flex: none; height: 6px; }

.lesson-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 260px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-side { order: 3; } }
.lesson-nav { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 12px; }
@media (max-width: 1100px) { .lesson-nav { position: static; max-height: none; } }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .95rem; }
.lesson-list a:hover { background: var(--surface-2); }
.lesson-list a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.lesson-list small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.lesson-title { font-size: clamp(1.5rem, 3vw, 2rem); color: var(--accent); margin-bottom: 8px; }
.lesson-main .exercise { margin-top: 12px; }
.tag.now { background: var(--muted); color: var(--bg); }
.tag.practice { background: #fff2cc; color: #7a5300; }
.tag.mastered { background: var(--good-soft); color: var(--good); }
:root[data-theme="dark"] .tag.practice { background: #3a2e10; color: #ffd36b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.practice { background: #3a2e10; color: #ffd36b; } }
.lesson-side .panel { margin-bottom: 14px; }

/* The hidden attribute must win over component display rules (.btn, .row...). */
[hidden] { display: none !important; }
/* In the lesson view the task sits above the prompt, like Excel Exercises. */
.lesson-main .ex-body { grid-template-columns: 1fr; }
.lesson-main .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
.lesson-main .material { max-height: 240px; }

/* --- Logo share buttons (lesson page) */
.share-icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share-icon { display: grid; place-items: center; min-height: 48px; border-radius: 10px; color: #fff; }
.share-icon .ai-logo { width: 22px; height: 22px; }
.share-linkedin { background: #0a66c2; }
.share-x { background: #000; }
.share-facebook { background: #1877f2; }
.share-email { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.share-icon:hover { filter: brightness(1.1); }
:root[data-theme="dark"] .share-x { outline: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .share-x { outline: 1px solid var(--line); } }

/* --- Guided exercise flow */
.steps { list-style: none; margin: 0; padding: 12px 24px; display: flex; gap: 6px 18px; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .9rem; color: var(--muted); }
.steps li { display: inline-flex; align-items: center; gap: 8px; }
.steps span { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .8rem; }
.steps li[aria-current="step"] { color: var(--text); font-weight: 700; }
.steps li[aria-current="step"] span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li.done span { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.steps li.done span::before { content: "✓"; }
.steps li.done span { font-size: 0; }
.steps li.done span::before { font-size: .8rem; }
.goals { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; }
.goals ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .95rem; }
.verdict { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.verdict .num { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.verdict strong { font-size: 1.1rem; }
.next-step { border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 14px; padding: 16px 18px; margin-bottom: 20px; }
.next-step .label { color: var(--accent); margin-bottom: 4px; }
.next-step #tip { margin: 0 0 12px; font-size: 1.05rem; font-weight: 500; }
.next-step.perfect { border-color: var(--good); background: var(--good-soft); }
.next-step.perfect .label { color: var(--good); }
.next-step .next-row { margin-top: 0; }
.group-title { font-size: .85rem; font-weight: 800; margin: 0 0 6px; }
.group-title.bad { color: var(--bad); }
.group-title.good { color: var(--good); margin-top: 12px; }
.mistake .fix b { color: var(--text); }
.mistakes #other-mistakes { margin-top: 12px; }
.expert { margin-top: 18px; }
.compare-prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 760px) { .compare-prompts { grid-template-columns: 1fr; } }

/* --- Track cards on the dashboard */
.track-card .blurb { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.track-card strong { font-size: 1.15rem; }

/* Dashboard row: all three cards share one height. */
.dash-row { align-items: stretch; margin-bottom: 18px; }
.dash-row > .panel { margin: 0; }
.dash-side { align-content: stretch; }
.dash-side .panel { height: 100%; }
.dash-side .panel:only-child { grid-column: 1 / -1; }
.legal-note { font-size: .82rem; color: var(--muted); margin: 6px 0 0; } .legal-note a { color: var(--muted); }

/* --- Library: track tiles and exercise cards. Each track sets --c (its color). */
.lib-hero { padding: 48px 0 64px; }
.lib-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 8px; }
.lib-hero .lead { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 0 28px; }
.track-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 26px; }
.track-tile { --c: var(--accent); display: grid; gap: 6px; align-content: start; text-align: left; padding: 20px; min-height: 150px; border-radius: 16px; border: 2px solid color-mix(in srgb, var(--c) 22%, var(--line)); background: color-mix(in srgb, var(--c) 7%, var(--surface)); color: var(--text); font: inherit; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.track-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 28px color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); }
.track-tile[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); box-shadow: inset 0 0 0 1px var(--c); }
.track-tile strong { font-size: 1.2rem; color: color-mix(in srgb, var(--c) 75%, var(--text)); }
.track-tile .tile-icon { font-size: 1.6rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.track-tile .tile-blurb { font-size: .9rem; color: var(--muted); line-height: 1.4; }
.track-tile small { font-weight: 700; color: color-mix(in srgb, var(--c) 70%, var(--text)); }
.track-tile.all { --c: #6b675f; }
.lib-tools { display: grid; grid-template-columns: minmax(260px, 1.3fr) 2fr; gap: 12px; align-items: center; }
@media (max-width: 860px) { .lib-tools { grid-template-columns: 1fr; } }
.lib-tools .filters { margin: 0; }
.lib-tools .filters select { flex: 1; }
.lib-search { margin: 0; max-width: none; }
.lib-count { color: var(--muted); font-weight: 600; margin: 22px 0 12px; }
.ex-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ex-card { --c: var(--accent); height: 100%; display: grid; gap: 8px; align-content: start; padding: 18px 18px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); color: var(--text); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.ex-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(0 0 0 / .08); }
.ex-card strong { font-size: 1.05rem; line-height: 1.35; }
.ex-card small { color: var(--muted); }
.ex-card-track { font-size: .8rem; font-weight: 700; color: color-mix(in srgb, var(--c) 75%, var(--text)); }
.ex-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: .85rem; }
.ex-grid .empty { color: var(--muted); padding: 24px 0; }

/* Dashboard track cards use their track color too. */
.track-card { --c: var(--accent); border-top: 4px solid var(--c); background: color-mix(in srgb, var(--c) 5%, var(--surface)); }
.track-card strong { color: color-mix(in srgb, var(--c) 75%, var(--text)); }
.track-card .tile-icon { font-size: 1.4rem; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.track-card .bar span { background: var(--c); }
.lib-count-row { display: flex; align-items: baseline; gap: 16px; } .track-tiles { grid-template-columns: repeat(3, 1fr); } @media (max-width: 860px) { .track-tiles { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 520px) { .track-tiles { grid-template-columns: 1fr; } }
.learn-more { padding-top: 24px; } .learn-more h2 { font-size: 1.3rem; margin-top: 28px; } .learn-list { padding-left: 20px; display: grid; gap: 8px; } .learn-list li { line-height: 1.55; }

/* --- Admin dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { display: grid; gap: 4px; margin: 0; }
.kpi strong { font-size: 1.9rem; line-height: 1.1; }
.funnel-row { display: grid; grid-template-columns: 160px 1fr 70px 170px; gap: 12px; align-items: center; padding: 6px 0; }
@media (max-width: 760px) { .funnel-row { grid-template-columns: 1fr 60px; } .funnel-row .bar, .funnel-row small { grid-column: 1 / -1; } }
.funnel-row .bar { height: 14px; }
.charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
.chart { margin: 0; }
.chart figcaption { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chart figcaption .panel-title { margin: 0 auto 0 0; }
.chart svg { width: 100%; height: 150px; display: block; }
.admin-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1000px) { .admin-cols { grid-template-columns: 1fr; } }
.admin-cols .panel { margin: 0 0 18px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--muted); font-weight: 700; font-size: .8rem; }
.admin-table td:not(:first-child), .admin-table th:not(:first-child) { text-align: right; }

/* --- Brand: Workout. Headlines in Big Shoulders Display, uppercase. */
h1, h2, .display, .section-label, .verdict .num, .big-num, .price, .kpi strong, .track-tile strong, .track-card strong, .lesson-title {
  font-family: "Big Shoulders Display", "Atkinson Hyperlegible", "Atkinson Fallback", sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: .01em;
}
h1 { line-height: .95; }
h2 { line-height: 1; }
h3 { font-weight: 700; letter-spacing: 0; }
.section-label, .panel-title, .label, .eyebrow { letter-spacing: .08em; }
.btn-primary { box-shadow: 3px 3px 0 var(--lime); }
.btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--lime); }
.btn-primary:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--lime); }
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-primary:hover { box-shadow: 3px 3px 0 #0B5D3F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { box-shadow: 3px 3px 0 #0B5D3F; } }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 30px; width: auto; display: block; }
.logo .logo-dark { display: none; }
:root[data-theme="dark"] .logo .logo-light { display: none; }
:root[data-theme="dark"] .logo .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .logo-light { display: none; } :root:not([data-theme="light"]) .logo .logo-dark { display: block; } }
/* Track icons (SVG masks take the track color). */
.ti { display: inline-block; width: 26px; height: 26px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.tile-icon { color: var(--c); }
.ex-card-track .ti { width: 16px; height: 16px; vertical-align: -3px; }
.accent-word { color: var(--accent); }
.hero .eyebrow { color: var(--accent); }
.accent-word { color: var(--accent); }
.hero .eyebrow { color: var(--accent); }
.hero h1 { font-size: clamp(3.2rem, 9vw, 6rem); } .lib-hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); } .dash-head h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); } .lesson-title { font-size: clamp(2rem, 4vw, 2.8rem); } h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }

/* Dark mode: track-colored text is mixed toward the text color for 4.5:1 contrast. */
:root[data-theme="dark"] .track-tile strong, :root[data-theme="dark"] .track-tile small, :root[data-theme="dark"] .track-card strong, :root[data-theme="dark"] .ex-card-track { color: color-mix(in srgb, var(--c) 40%, var(--text)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .track-tile strong, :root:not([data-theme="light"]) .track-tile small, :root:not([data-theme="light"]) .track-card strong, :root:not([data-theme="light"]) .ex-card-track { color: color-mix(in srgb, var(--c) 40%, var(--text)); }
}
.ai-mono::before { content: attr(data-letter); }
.how { list-style: none; counter-reset: how; padding: 0; margin: 0 0 2rem; display: grid; gap: .75rem; }
.how li { counter-increment: how; display: flex; gap: .75rem; align-items: baseline; }
.how li::before { content: counter(how); font-family: "Big Shoulders Display", "Display Fallback", sans-serif; font-size: 1.5rem; font-weight: 900; color: var(--accent); min-width: 1.25rem; }

/* Landing demo: a fixed before/after example. Nothing is sent to an AI. */
.demo { max-width: 960px; margin: 40px auto 0; text-align: left; }
.demo-cap { text-align: center; color: var(--muted); margin-bottom: 14px; }
.demo-cap strong { color: var(--text); }
.demo-pair { display: grid; gap: 16px; }
@media (min-width: 760px) { .demo-pair { grid-template-columns: 1fr 1fr; } }
.demo-card { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--bad); border-radius: 16px; padding: 16px 18px; box-shadow: 0 12px 32px rgb(0 0 0 / .10); display: flex; flex-direction: column; }
.demo-card.after { border-top-color: var(--good); }
.demo-tag { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; font-family: "Big Shoulders Display", "Display Fallback", sans-serif; font-weight: 900; text-transform: uppercase; font-size: 1.5rem; line-height: 1; }
.demo-score { font-size: 1.1rem; padding: 4px 10px; border-radius: 999px; }
.demo-score.bad { background: var(--bad-soft); color: var(--bad); }
.demo-score.good { background: var(--good-soft); color: var(--good); }
.demo-label { margin: 0 0 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.demo-prompt { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--code); border: 1px solid var(--line); font-size: .93rem; }
.demo-out { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--code); border: 1px solid var(--line); font: .82rem/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow: hidden; max-height: 9.5em; flex: 1; }
.demo-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .93rem; }
.demo-checks li { color: var(--text); font-weight: 400; }
.demo-checks li::before { display: inline-block; width: 1.3em; font-weight: 700; }
.demo-checks li.ok::before { content: "✓"; color: var(--good); }
.demo-checks li.no::before { content: "✗"; color: var(--bad); }
.gets-better { margin: 32px 0 10px; color: var(--muted); font-weight: 700; }
.areas { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; }
.areas li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: .95rem; }
.areas .ti { width: 18px; height: 18px; color: var(--accent); }
/* The Google button loads late and briefly resizes its wrapper: fix the slot's
   height so the content below never moves. */
.hero .signup, .final .signup { height: 48px; align-items: center; }
/* Browse links: footer and library (plain HTML, so every page is reachable). */
.site-links { display: grid; gap: 6px; font-size: .88rem; padding-bottom: 12px; }
.site-links a { margin-right: 10px; color: var(--muted); }
.site-links strong { margin-right: 8px; }
.link-cloud { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.link-cloud a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; }
.link-cloud small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.lib-static { margin-top: 40px; }
.areas a { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
