/**
 * OpusDesk IELTS — styles.
 *
 * A LIGHT theme on purpose, unlike the games block's dark cabinet: this site is
 * read in long stretches (passages, explanations, model answers), and long-form
 * reading on a near-white page is easier on the eyes. The brand tokens are the
 * same nine; only their roles change.
 *
 *   --primary #6C4DFF   --coral #FF7A73   --mint #5ED6B3   --lilac #D9D0FF
 *   --paper   #FCFBFF   --white #FFFFFF   --ink  #18151F   --muted #6F6878
 *   --line    #EAE5F0
 */

:root {
  --primary: #6C4DFF;
  --coral: #FF7A73;
  --mint: #5ED6B3;
  --lilac: #D9D0FF;
  --paper: #FCFBFF;
  --white: #FFFFFF;
  --ink: #18151F;
  --muted: #6F6878;
  --line: #EAE5F0;

  --measure: 68ch;          /* readable line length for passages */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(24, 21, 31, .06), 0 8px 24px rgba(24, 21, 31, .06);

  --serif: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}

.wrap { width: min(100% - 2rem, 64rem); margin: 0 auto; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--white); padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; z-index: 10; }

/* ── header ─────────────────────────────────────────────────────────── */

.top { background: var(--ink); color: var(--white); position: sticky; top: 0; z-index: 5; }

.top-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 3.5rem; flex-wrap: wrap;
}

.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--white); text-decoration: none; font-weight: 700; letter-spacing: .01em;
  margin-right: auto;
}
.brand b { color: var(--lilac); font-weight: 700; }
.brand-mark {
  display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem; border-radius: 8px;
  background: var(--primary); color: var(--white);
  font-size: .75rem; letter-spacing: .02em;
}

.nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.nav a {
  color: var(--lilac); text-decoration: none; padding: .4rem .6rem; border-radius: 8px; font-size: .9rem;
}
.nav a:hover, .nav a:focus-visible { background: rgba(217, 208, 255, .14); color: var(--white); }
.nav a.is-current { color: var(--white); background: rgba(217, 208, 255, .18); }
.nav-cta { background: var(--primary); color: var(--white) !important; }
.nav-cta:hover { background: #5b3fe0; }

/* No language switcher: the site is English only, because the exam material is.
   See the note in shell.js and DIRECTION.md §11. */

/* ── typography ─────────────────────────────────────────────────────── */

h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); }

.lede { font-size: 1.08rem; color: var(--muted); max-width: var(--measure); }

/* ── cards & grids ──────────────────────────────────────────────────── */

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem;
}

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

.pill {
  display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--lilac); color: var(--ink); margin-right: .35rem;
}
.pill-mint { background: var(--mint); }
.pill-coral { background: var(--coral); }
.pill-outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.btn {
  font: inherit; cursor: pointer; border-radius: 999px; padding: .55rem 1.1rem;
  border: 1px solid transparent; background: var(--primary); color: var(--white); font-weight: 600;
}
.btn:hover { background: #5b3fe0; }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: rgba(108, 77, 255, .08); }
.btn-small { padding: .35rem .8rem; font-size: .875rem; }

.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ── reading ────────────────────────────────────────────────────────── */

.passage {
  font-family: var(--serif); font-size: 1.06rem; line-height: 1.75;
  max-width: var(--measure); white-space: pre-wrap;
}

.q { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.q-prompt { font-weight: 600; margin-bottom: .5rem; }
.q-options { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .5rem; }
.q-options label {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; cursor: pointer;
}
.q-options label:hover { border-color: var(--primary); }
.q-options input { margin: 0; }

/* Typed answers (gap-fill and short answer). The box is deliberately narrow: a
   gap normally takes one or two words, and a wide box invites a sentence. */
.q-answer-row { margin-bottom: .5rem; }
.q-input {
  font: inherit; width: min(100%, 18rem); padding: .45rem .6rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--ink);
}
.q-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.q-feedback { border-radius: var(--radius); padding: .75rem .9rem; margin-top: .5rem; font-size: .95rem; }
.q-ok { background: rgba(94, 214, 179, .16); border-left: 4px solid var(--mint); }
.q-no { background: rgba(255, 122, 115, .14); border-left: 4px solid var(--coral); }
.q-verdict { font-weight: 700; }
.q-evidence {
  font-family: var(--serif); font-style: italic; border-left: 3px solid var(--line);
  padding-left: .6rem; margin: .5rem 0; color: var(--muted);
}
.q-syn { font-size: .9rem; margin: .35rem 0 0; }
.q-syn code { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0 .25rem; }

/* ── unlock & pricing ───────────────────────────────────────────────── */

.field { display: block; margin: .75rem 0; }
.field span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .25rem; }
.field input[type="password"] {
  font: inherit; width: min(100%, 24rem); padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink);
}
.field input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.notice { border-radius: var(--radius); padding: .75rem .9rem; font-size: .95rem; margin: .75rem 0; }
.notice-warn { background: rgba(255, 122, 115, .14); border-left: 4px solid var(--coral); }
.notice-info { background: rgba(108, 77, 255, .08); border-left: 4px solid var(--primary); }
.notice-ok { background: rgba(94, 214, 179, .16); border-left: 4px solid var(--mint); }

.price { font-size: 1.5rem; font-weight: 700; }
.plan ul { margin: .75rem 0 1rem; padding-left: 1.1rem; }
.plan li { margin-bottom: .3rem; }

table.plans { width: 100%; border-collapse: collapse; }
table.plans th, table.plans td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.plans th { font-size: .85rem; color: var(--muted); font-weight: 600; }

/* ── grammar lessons ─────────────────────────────────────────────────── */

.lesson-body { max-width: var(--measure); }
.lesson-examples { list-style: none; padding: 0; margin: 0; }
.lesson-examples li {
  border-left: 3px solid var(--line); padding: .35rem 0 .35rem .7rem; margin-bottom: .5rem;
}
.ex-text { display: block; font-family: var(--serif); font-size: 1.02rem; }
.ex-note { display: block; font-size: .9rem; color: var(--muted); }

.trap {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem .9rem; margin-top: .75rem; background: var(--paper);
}
.trap-title { font-weight: 700; margin: 0 0 .35rem; font-size: .9rem; letter-spacing: .02em; }
.trap-wrong { margin: 0 0 .25rem; color: #8a2f2a; }
.trap-right { margin: 0 0 .35rem; color: #17614a; }
.trap-wrong::before, .trap-right::before { font-weight: 700; }

/* ── listening player ────────────────────────────────────────────────── */

.player { gap: .5rem; margin: .75rem 0 .35rem; }
.player .btn[aria-pressed="true"] {
  background: var(--primary); color: var(--white); border-color: var(--primary);
}
.transcript { margin: .5rem 0 0; }
.transcript-text {
  font-family: var(--serif); font-size: .98rem; line-height: 1.65;
  white-space: pre-wrap; margin: 0; padding: .9rem 1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}

/* ── writing: figure, self-check report, annotated model ─────────────── */

.section-head { margin-top: 2rem; }

.prompt { font-family: var(--serif); font-size: 1.04rem; max-width: var(--measure); }

.visual {
  margin: 1rem 0; padding: .9rem 1rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper);
}
.visual-title { font-weight: 600; font-size: .95rem; margin-bottom: .75rem; }
.bars { display: grid; gap: .4rem; }
.bar-row { display: grid; grid-template-columns: minmax(7rem, 12rem) 1fr auto; gap: .6rem; align-items: center; }
.bar-label { font-size: .9rem; }
.bar-track { background: var(--lilac); border-radius: 3px; height: .85rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--primary); }
.bar-value { font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--muted); min-width: 2.5rem; text-align: right; }
.steps { margin: 0; padding-left: 1.3rem; }
.steps li { margin-bottom: .35rem; }
.visual-table td:not(:first-child), .visual-table th:not(:first-child) { font-variant-numeric: tabular-nums; }
.criteria-table td { vertical-align: top; }
.criteria-table td:first-child { white-space: nowrap; }
.criteria-table .ex-note { margin-top: .15rem; }

.essay-input {
  width: 100%; box-sizing: border-box; padding: .75rem .85rem; font: inherit;
  line-height: 1.6; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); resize: vertical;
}
.essay-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.report { margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.report-head { font-weight: 700; margin: 0 0 .5rem; }
.report-stats { margin: 0 0 .75rem; padding-left: 1.1rem; font-size: .95rem; }
.report-findings { list-style: none; margin: 0; padding: 0; }
.finding { padding: .5rem .7rem; border-left: 4px solid var(--line); border-radius: 3px; margin-bottom: .4rem; font-size: .95rem; }
.finding-warn { background: rgba(255, 122, 115, .12); border-left-color: var(--coral); }
.finding-info { background: rgba(108, 77, 255, .07); border-left-color: var(--primary); }

.model-wrap { margin-top: 1rem; }
.model { margin-top: .6rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.model-essay { font-family: var(--serif); font-size: 1rem; line-height: 1.7; white-space: pre-wrap; max-width: var(--measure); }
mark.anno { background: var(--lilac); color: inherit; border-bottom: 2px solid var(--primary); padding: 0 .1rem; }
.anno-notes { margin: .9rem 0 0; padding-left: 1.2rem; }
.anno-notes li { margin-bottom: .6rem; max-width: var(--measure); }
.anno-notes code { font-size: .85rem; }

/* ── speaking: practice panel, clocks, cue cards ─────────────────────── */

.speak-prompt { font-family: var(--serif); font-size: 1.08rem; }
.cue {
  border-left: 3px solid var(--lilac); padding: .5rem 0 .5rem .8rem; margin: .6rem 0;
  background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0;
}
.cue ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.cue li { margin-bottom: .2rem; }

.practice { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.clock {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.05rem;
  min-width: 3.5rem; display: inline-block; text-align: right;
}
.field { display: block; margin: .75rem 0; }
.field-label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
.speak-seconds { width: 6rem; padding: .4rem .5rem; font: inherit; border: 1px solid var(--line); border-radius: var(--radius); }
.speak-transcript {
  width: 100%; box-sizing: border-box; padding: .65rem .8rem; font: inherit; line-height: 1.55;
  border: 1px solid var(--line); border-radius: var(--radius); resize: vertical;
}
.speak-seconds:focus-visible, .speak-transcript:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.practice audio { width: 100%; margin-top: .35rem; }

.follow-ups { margin-top: 1rem; }
.follow-list { margin: .6rem 0 0; padding-left: 1.2rem; }
.follow-list li { margin-bottom: .7rem; max-width: var(--measure); }
.follow-prompt { font-weight: 600; font-family: var(--serif); margin: 0 0 .2rem; }

.vocab-table td { vertical-align: top; }
.vocab-table td:first-child, .vocab-table td:nth-child(2) { max-width: 14rem; }
.vocab-said { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--coral); }

/* ── vocabulary: cards, deck list, library ───────────────────────────── */

.daily { border-left: 4px solid var(--mint); }
.card-front {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin: .3rem 0;
}
.card-gloss { font-size: 1.05rem; margin: .3rem 0; }
.card-example { font-family: var(--serif); margin: .3rem 0; color: var(--ink); }
.study-card { margin: .6rem 0; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }

.vocab-search, .library-search {
  width: 100%; box-sizing: border-box; padding: .5rem .7rem; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.vocab-search:focus-visible, .library-search:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.deck-list { margin-top: .75rem; max-height: 34rem; overflow-y: auto; }
.word-card { padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.word-card:last-child { border-bottom: 0; }
.word-head { margin: 0 0 .15rem; }
.library-table td { vertical-align: top; }
.library-table tbody { display: table-row-group; }

/* ── test layout: sidebar plus body ──────────────────────────────────── */

.split { display: grid; grid-template-columns: 13rem 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 46rem) {
  .split { grid-template-columns: 1fr; }
}
.test-menu {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  padding: .6rem; position: sticky; top: 1rem;
}
.test-menu-head {
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .4rem; font-weight: 600;
}
.test-link {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .45rem .55rem; border-radius: 6px; text-decoration: none; color: var(--ink);
  font-size: .95rem;
}
.test-link:hover { background: var(--paper); }
.test-link.is-current { background: var(--lilac); font-weight: 600; }
.test-lock {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: .05rem .4rem; color: var(--muted);
}
.test-body { min-width: 0; }
.task-head { margin: 1.5rem 0 .5rem; }

/* ── footer & status ────────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--line); margin-top: 3rem; background: var(--white); }
.foot-inner { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; padding: 1.25rem 0; }
.foot p { margin: 0; font-size: .875rem; color: var(--muted); max-width: var(--measure); }
.foot-links { display: flex; gap: 1rem; }
.foot-brand { color: var(--ink); font-weight: 600; }

.status-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none; }
.status-bar:empty { display: none; }
.status-bar .notice { margin: 0; border-radius: 0; }

/* ── small screens ──────────────────────────────────────────────────── */

@media (max-width: 40rem) {
  .top-inner { min-height: 0; padding: .5rem 0; }
  .nav { order: 3; width: 100%; }
  .nav a { padding: .35rem .5rem; font-size: .85rem; }
  .card { padding: 1rem; }
}

/* ── long-form guide pages (learn-ielts) ────────────────────────────────
   The guide pages are static HTML, not part of the app: they exist to be read
   and to be crawled, so they share the brand tokens and nothing else. Everything
   below is additive — no selector here is used by shell.js, and the app's own
   rules are untouched.                             */

.crumb { font-size: .8125rem; color: var(--muted); padding: .75rem 0 0; }
.crumb a { color: var(--muted); }
.crumb li { display: inline; }
.crumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.crumb li + li::before { content: "›"; margin-right: .35rem; color: var(--line); }

.guide { max-width: 46rem; }
.guide h1 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); line-height: 1.2; margin: 1rem 0 .5rem; }
.guide h2 { font-size: 1.4rem; margin: 2.5rem 0 .6rem; padding-top: .35rem; }
.guide h3 { font-size: 1.1rem; margin: 1.6rem 0 .4rem; }
.guide p, .guide li { max-width: 44rem; }
.guide p { margin: .6rem 0; }
.guide ul, .guide ol { padding-left: 1.25rem; }
.guide li { margin: .3rem 0; }
.guide a { color: var(--primary); }
.guide table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .9375rem; }
.guide th, .guide td { border: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
.guide th { background: var(--paper); font-weight: 600; }
.guide caption { text-align: left; font-size: .8125rem; color: var(--muted); padding-bottom: .35rem; }
.guide code { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0 .25rem; font-size: .9em; }

.answer {
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--mint);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1.25rem 0; box-shadow: var(--shadow);
}
.answer h2, .answer h3 { margin-top: 0; }
.answer p:last-child { margin-bottom: 0; }

.toc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.toc h2 { margin: 0 0 .35rem; font-size: 1rem; }
.toc ol { columns: 2; column-gap: 2rem; margin: 0; }
@media (max-width: 40rem) { .toc ol { columns: 1; } }

.faq details { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary::marker { color: var(--primary); }
.faq p { margin: .5rem 0 0; }

.lang-switch { font-size: .875rem; }
.lang-switch a { color: var(--lilac); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
