[hidden] { display: none !important; }
:root {
  /* the Draw and Learn look: cream paper, purple, deep indigo titles, orange and green accents */
  --bg: #FBF7EF; --card: #FFFFFF; --ink: #2B1F57; --muted: #5D5470; --line: #ECE3D2;
  --navy: #3E2A78; --teal: #6A3DE8; --orange: #FF7043; --green: #2E9E5B; --red: #B3261E; --purple: #6A3DE8;
  --tint-navy: #EDE6FF; --tint-teal: #EDE6FF; --tint-orange: #FFE9E1; --tint-green: #E3F4EA; --tint-red: #FBE3E1;
  --accent: var(--teal); --shadow: 0 1px 3px rgba(62, 42, 120, .12), 0 8px 24px rgba(62, 42, 120, .08);
  --radius: 20px; --font: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --display: Fredoka, Roboto, sans-serif; --read: Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17122B; --card: #211A3B; --ink: #EEEAF8; --muted: #B5AECB; --line: #352C57;
    --navy: #CDBDFF; --teal: #A88BFF; --orange: #FF9A76; --green: #6FD39A; --red: #F28B82; --purple: #A88BFF;
    --tint-navy: #2B2250; --tint-teal: #2B2250; --tint-orange: #3A2620; --tint-green: #1D3326; --tint-red: #3A1F1E;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
    --bg: #17122B; --card: #211A3B; --ink: #EEEAF8; --muted: #B5AECB; --line: #352C57;
    --navy: #CDBDFF; --teal: #A88BFF; --orange: #FF9A76; --green: #6FD39A; --red: #F28B82; --purple: #A88BFF;
    --tint-navy: #2B2250; --tint-teal: #2B2250; --tint-orange: #3A2620; --tint-green: #1D3326; --tint-red: #3A1F1E;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--teal); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px max(16px, calc((100% - 1100px) / 2)); background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 18px; white-space: nowrap; }
.brand b { color: var(--teal); }
.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.topbar nav a:hover { background: var(--bg); color: var(--ink); }
.icon-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 36px; height: 36px;
  border-radius: 10px; cursor: pointer; font-size: 18px; }
@media (max-width: 560px) { .brand span { display: none; } .topbar nav a { padding: 6px 7px; font-size: 14px; } }

main:focus, main:focus-visible { outline: none; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
.loading { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* home */
.hero { padding: 36px 28px; background: linear-gradient(135deg, #1F3A5F, #12243D); color: #fff; border-radius: var(--radius);
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; margin: 0 0 6px; }
.hero .sub { color: #7FD0D5; font-size: 20px; margin: 0 0 12px; }
.hero p { color: #D5DEE9; margin: 0 0 20px; }
.hero img { background: #fff; border-radius: 12px; padding: 8px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; padding: 26px 18px; } }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font: 16px/1.4 var(--font);
  font-weight: 600; background: var(--orange); color: #fff; padding: 11px 18px; border-radius: 10px; }
.btn.secondary { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn.ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 8px; }
.stats div { padding: 14px; text-align: center; }
.stats b { display: block; font-size: 26px; color: var(--teal); }
.stats span { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

h2.section { margin: 30px 0 12px; font-size: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.chapter-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; color: inherit; text-decoration: none; transition: transform .15s; }
.chapter-card:hover { transform: translateY(-2px); border-color: var(--teal); }
.chapter-card .num { font-size: 13px; font-weight: 700; color: var(--teal); letter-spacing: .06em; }
.chapter-card h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.chapter-card p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.progress { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: auto; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.badges span { background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 20px; }
.badges .done { color: var(--green); border-color: var(--green); }

/* chapter */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.chapter-head h1 { margin: 2px 0 6px; font-size: clamp(26px, 4vw, 36px); line-height: 1.15; }
.chapter-head .kicker { color: var(--teal); font-weight: 700; font-size: 14px; letter-spacing: .08em; }
.chapter-head .intro { color: var(--muted); font-family: var(--read); font-style: italic; font-size: 18px; max-width: 760px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs a.on { color: var(--ink); border-color: var(--orange); }

.reading { max-width: 760px; font-family: var(--read); font-size: 18px; line-height: 1.7; }
.reading h3 { font-family: var(--font); color: var(--navy); font-size: 21px; margin: 28px 0 8px; }
.reading li { margin: 4px 0; }
.reading figure { margin: 22px 0; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; }
.reading figure img { display: block; width: 100%; }
.reading figcaption { font: italic 14px/1.4 var(--font); color: #56606C; margin: 8px 0 10px; }
.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font: 14px/1.4 var(--font); }
th { background: #1F3A5F; color: #fff; text-align: left; padding: 9px 10px; }
td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) td { background: var(--bg); }
pre { background: #F3F5F8; color: #1D2733; border-left: 4px solid var(--teal); padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13.5px; line-height: 1.5; }
.note { border-left: 5px solid var(--navy); background: var(--tint-navy); padding: 12px 16px; border-radius: 8px; margin: 16px 0; font-size: 16.5px; }
.note strong { font: 700 13px var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--navy); }
.note p { margin: 4px 0 0; }
.note.tip { border-color: var(--teal); background: var(--tint-teal); } .note.tip strong { color: var(--teal); }
.note.warn { border-color: var(--orange); background: var(--tint-orange); } .note.warn strong { color: var(--orange); }
.note.try { border-color: var(--green); background: var(--tint-green); } .note.try strong { color: var(--green); }
.summary { padding: 16px 20px; margin: 26px 0; border-left: 5px solid var(--teal); }
.summary h3 { margin: 0 0 6px; font: 700 15px var(--font); color: var(--teal); text-transform: uppercase; letter-spacing: .05em; }
.next-step { margin-top: 26px; }

/* lesson list */
.lesson-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lesson-tile { padding: 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.lesson-tile .thumb { display: block; background: #fff; border-radius: 8px; border: 1px solid var(--line); aspect-ratio: 16 / 10; overflow: hidden; }
.lesson-tile .thumb img { width: 100%; height: auto; display: block; }   /* topic cards: show the top of the card, full width */
.lesson-tile.diagram .thumb { display: flex; align-items: center; }
.lesson-tile.diagram .thumb img { height: 100%; object-fit: contain; padding: 6px; }
.lesson-tile .thumb.broken { background: linear-gradient(135deg, #1F3A5F, #1E8C93); }
.lesson-tile .thumb.broken img { display: none; }
.lesson-tile em { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--teal); }
.lesson-tile.diagram em { color: var(--orange); }
.muted { color: var(--muted); font-size: 14px; }
.reading h3 .watch { font: 600 13px var(--font); text-decoration: none; background: var(--orange); color: #fff; padding: 3px 10px;
  border-radius: 20px; vertical-align: middle; margin-left: 8px; white-space: nowrap; }
.reading h3 .watch:hover { filter: brightness(1.1); }
.stage { max-height: 78vh; overflow-y: auto; }
.lesson-tile b { font-size: 15px; line-height: 1.3; }
.lesson-tile span { font-size: 13px; color: var(--muted); }

/* lesson player */
.player { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .player { grid-template-columns: 1fr; } }
.stage { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.stage svg { width: 100%; height: auto; display: block; }
.stage svg > * { transition: opacity .35s, filter .35s; }
.stage.focusing svg > *:not(.on):not(title) { opacity: .18; }
.stage svg > g.on { filter: drop-shadow(0 0 7px rgba(229, 138, 52, .95)); }
.stage svg > g.part { cursor: pointer; }
.stage svg > g.part:hover { filter: drop-shadow(0 0 4px rgba(30, 127, 134, .8)); }
.speech { margin-top: 12px; padding: 16px 18px; min-height: 92px; font-size: 19px; line-height: 1.5; font-family: var(--read); }
.speech small { display: block; font: 700 12px var(--font); color: var(--orange); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.controls { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.controls .play { width: 56px; height: 56px; border-radius: 50%; justify-content: center; font-size: 22px; padding: 0; }
.controls .count { color: var(--muted); font-size: 14px; min-width: 60px; text-align: center; }
.side { padding: 14px; }
.side h2 { font-size: 17px; margin: 0 0 8px; }
.transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 470px; overflow-y: auto; }
.transcript button { width: 100%; text-align: left; background: none; border: 1px solid transparent; color: var(--ink); font: 14.5px/1.4 var(--font);
  padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.transcript button:hover { background: var(--bg); }
.transcript button.on { background: var(--tint-orange); border-color: var(--orange); }
.transcript button.seen { color: var(--muted); }
.voice-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: 10px 0 0; flex-wrap: wrap; }
.voice-row select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); max-width: 100%; }
.tip-line { font-size: 13px; color: var(--muted); margin: 8px 0 0; text-align: center; }

/* quiz */
.quiz { max-width: 700px; padding: 22px; }
.quiz .qn { color: var(--muted); font-size: 14px; }
.quiz h2 { font-size: 21px; margin: 6px 0 14px; line-height: 1.35; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { text-align: left; font: 16px/1.4 var(--font); padding: 13px 14px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; display: flex; gap: 10px; }
.choice b { color: var(--teal); }
.choice:hover:not(:disabled) { border-color: var(--teal); }
.choice.right { border-color: var(--green); background: var(--tint-green); }
.choice.wrong { border-color: var(--red); background: var(--tint-red); }
.choice:disabled { cursor: default; }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.score { text-align: center; padding: 30px 20px; }
.score .big { font-size: 54px; font-weight: 800; color: var(--teal); }

/* glossary / about */
.glossary { columns: 2 320px; column-gap: 28px; }
.glossary div { break-inside: avoid; padding: 10px 0; border-bottom: 1px solid var(--line); }
.glossary b { color: var(--navy); }
.search { width: 100%; max-width: 420px; padding: 11px 14px; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); margin-bottom: 14px; }
.prose { max-width: 760px; }

.footer { border-top: 1px solid var(--line); padding: 22px max(16px, calc((100% - 1100px) / 2)); color: var(--muted); font-size: 14px; background: var(--card); }
.footer p { margin: 4px 0; }
.footer .fine { font-size: 12.5px; }

/* ---- Lessons: the same screen as Draw and Learn (picture, sentences, voice, quiz) ---- */
.lesson-screen { padding-bottom: 76px; }
.title-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; }
.title-card .arrow { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; font-size: 26px;
  color: var(--teal); text-decoration: none; flex: none; }
.title-card .arrow:hover { background: var(--bg); }
.title-middle { flex: 1; text-align: center; min-width: 0; }
.title-middle .kicker { color: var(--teal); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.title-middle .name { margin: 2px 0; font-size: clamp(20px, 3vw, 28px); line-height: 1.2; color: var(--navy); }
.title-middle .count { color: var(--muted); font-size: 14px; }
.round.play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--orange); color: #fff; font-size: 20px;
  cursor: pointer; flex: none; box-shadow: 0 3px 10px rgba(200, 112, 31, .35); }
.round.play[hidden] { display: none; }

.lesson { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .lesson { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.lesson-side { position: sticky; top: 64px; z-index: 2; background: var(--bg); padding-bottom: 6px; }
.lesson-art { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--shadow);
  max-height: 72vh; overflow-y: auto; }
@media (max-width: 899px) { .lesson-art { max-height: 42vh; } }
.lesson-art svg, .lesson-art img { display: block; width: 100%; height: auto; }
.lesson-art .part { transition: opacity .35s, filter .35s; cursor: pointer; }
.lesson-art .part.dim { opacity: .25; }
.lesson-art .part.focus { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 10px rgba(255, 193, 7, .95)); }
.lesson-detail { margin: 10px 0 0; padding: 12px 14px; background: #FFF6D8; color: #3B2F0B; border-radius: 12px; font-size: 16px; line-height: 1.5; }
.lesson-detail b { display: block; color: #8A5A00; }

.lesson-audio { display: flex; align-items: center; gap: 10px; }
.lesson-audio > span { color: var(--muted); font-weight: 600; font-size: 14px; }
.toggles { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.toggles button { border: 0; background: var(--card); color: var(--ink); font: 600 15px var(--font); padding: 8px 16px; cursor: pointer; min-height: 40px; }
.toggles button.on { background: var(--tint-teal); color: var(--teal); }
.lesson-help { color: var(--muted); font-size: 14px; margin: 10px 2px 6px; }
.lesson-text { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: line; }
.lesson-text li { overflow-wrap: anywhere; padding: 11px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); cursor: pointer;
  font: 17px/1.55 var(--read); transition: background .25s; }
.lesson-text li:hover { border-color: var(--teal); }
.lesson-text li.now { background: #FFE08A; color: #2A2205; border-color: #F2C744; }

.lesson-quiz { margin-top: 16px; padding: 18px; }
.lesson-quiz[hidden] { display: none; }
.quiz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.quiz-head h2 { margin: 0; font-size: 21px; color: var(--navy); }
.quiz-head span { color: var(--muted); font-size: 14px; }
.quiz-question { font-size: 18px; font-weight: 600; margin: 12px 0; }
.choice.faded { opacity: .5; }
.quiz-result { min-height: 1.4em; font-size: 16px; }
.quiz-stars { font-size: 34px; color: #F2B705; margin: 8px 0; letter-spacing: 4px; }
.quiz-stars span { color: var(--line); }

.lesson-buttons { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(20, 30, 50, .06); }
.lesson-buttons .btn { flex: 1; max-width: 220px; justify-content: center; }
.btn.outlined { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }


/* ---- Draw and Learn format: display font, pill buttons, eyebrow, ticks, hero collage ---- */
h1, h2, h3, .brand, .chapter-card h3, .title-middle .name, .quiz-head h2, .stats b, .score .big { font-family: var(--display); font-weight: 600; }
.brand b { color: var(--orange); }
.btn { border-radius: 999px; background: var(--teal); padding: 12px 22px; box-shadow: 0 6px 18px rgba(106, 61, 232, .28);
  transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(106, 61, 232, .34); }
.btn.small { padding: 8px 14px; box-shadow: none; }
.btn.ghost, .btn.outlined { box-shadow: none; }
.btn.secondary { background: #fff; color: var(--teal); border: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
.round.play { background: var(--teal); box-shadow: 0 6px 18px rgba(106, 61, 232, .35); }
.reading h3 .watch { background: var(--orange); }
.topbar { background: rgba(251, 247, 239, .92); backdrop-filter: blur(10px); }
:root[data-theme="dark"] .topbar { background: rgba(23, 18, 43, .92); }
.card { border-color: var(--line); }
th { background: var(--navy); }
:root[data-theme="dark"] th { background: #3E2A78; }
.eyebrow { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--tint-teal); color: var(--teal);
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.hero2 { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px 44px; align-items: center; padding: 26px 0 18px; }
.hero2::before { content: ''; position: absolute; inset: -40px -120px auto; height: 560px; z-index: 0; pointer-events: none;
  background: radial-gradient(420px 300px at 12% 20%, rgba(255, 112, 67, .16), transparent 70%),
              radial-gradient(460px 320px at 85% 10%, rgba(106, 61, 232, .16), transparent 70%),
              radial-gradient(380px 260px at 60% 90%, rgba(46, 158, 91, .12), transparent 70%); }
.hero2 > * { position: relative; z-index: 1; }
.hero2 h1 { font-size: clamp(38px, 6vw, 62px); line-height: 1.04; margin: 16px 0 14px; color: var(--ink); }
.hero2 h1 span { color: var(--orange); }
.hero2 .lead { font-size: 19px; line-height: 1.55; color: var(--muted); margin: 0 0 16px; max-width: 600px; }
.ticks { list-style: none; padding: 0; margin: 0 0 22px; }
.ticks li { position: relative; padding-left: 30px; margin: 9px 0; line-height: 1.45; font-size: 17px; color: var(--ink); }
.ticks li::before { content: '\2713'; position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.collage { position: relative; height: 380px; }
.collage img { position: absolute; height: auto; border-radius: 16px; box-shadow: 0 18px 44px rgba(43, 31, 87, .22);
  border: 4px solid #fff; background: #fff; }
.collage .c1 { left: 0; top: 10px; width: 66%; transform: rotate(-3deg); }
.collage .c2 { left: 28%; top: 150px; width: 62%; transform: rotate(2.5deg); }
.collage .c3 { right: 0; top: 0; width: 34%; transform: rotate(5deg); }
@media (max-width: 860px) { .hero2 { grid-template-columns: 1fr; } .collage { height: 300px; } }

/* ---- Sign in with Google ---- */
.account { position: relative; display: inline-flex; align-items: center; }
.google-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid #DADCE0; background: #fff; color: #3C4043; font: 500 14px var(--font); cursor: pointer; }
.google-btn:hover { background: #F8F9FA; border-color: #C6C9CE; }
.account .who { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--tint-teal);
  cursor: pointer; overflow: hidden; display: grid; place-items: center; }
.account .who img { width: 100%; height: 100%; object-fit: cover; }
.account .initial { font: 700 15px var(--font); color: var(--teal); }
.account-menu { position: absolute; right: 0; top: 46px; z-index: 30; min-width: 220px; max-width: 280px; padding: 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.account-menu[hidden] { display: none; }
.account-menu b { color: var(--ink); overflow-wrap: anywhere; }
.account-menu small { color: var(--muted); overflow-wrap: anywhere; margin-bottom: 8px; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #1E1B4B; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; z-index: 50; transition: .25s; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.brand b { color: #4338CA; }
:root[data-theme="dark"] .brand b { color: #A5B4FC; }
@media (max-width: 560px) { .google-btn { padding: 0 10px; } }

/* ---- Admin ---- */
.admin { max-width: 1100px; }
.admin-gate { max-width: 460px; margin: 40px auto; padding: 28px; text-align: center; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-head .search { margin: 0; }
.avatar { border-radius: 50%; display: block; }

/* ---- SEO pages (/learn, /ai-glossary) and the home page before the app starts ---- */
.static-list { max-width: 820px; line-height: 1.6; }
.static-list li { margin: 6px 0; color: var(--muted); }
.static-list a { font-weight: 600; }
.chapter-card .h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.summary .summary-title { margin: 0 0 6px; font: 700 15px var(--font); color: var(--teal); text-transform: uppercase; letter-spacing: .05em; }
dl.glossary dt { font-weight: 700; color: var(--navy); }
dl.glossary dd { margin: 2px 0 0; color: var(--ink); }
.topbar nav .btn.small { color: #fff; padding: 7px 14px; }

/* ---- Ad spaces (only shown when AdSense is set up in js/ads-config.js) ---- */
.ad-slot.on { margin: 26px auto; max-width: 970px; min-height: 120px; padding: 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.ad-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
