/* ============================================================
   IB Maths Help — practice app
   Design system: editorial serif headings + clean sans body,
   warm paper palette, navy ink, terracotta accent.
   Shared by the landing page (index.html) and the app (app.html).
   ============================================================ */

:root {
  --ink:        #1b2a4a;   /* deep navy text */
  --ink-soft:   #54607a;   /* muted text */
  --paper:      #f8f5ef;   /* warm off-white page bg */
  --surface:    #ffffff;   /* cards */
  --surface-2:  #f1ece2;   /* subtle fills */
  --line:       #e4ddd0;   /* warm borders */
  --brand:      #c2540b;   /* terracotta accent */
  --brand-dark: #a3450a;
  --emerald:    #2f6f5e;   /* secondary accent */
  --navy:       #25406e;
  --easy:       #2f8f6b;
  --medium:     #c07a12;
  --hard:       #c0413f;
  --shadow-sm:  0 1px 2px rgba(27,42,74,.05), 0 2px 8px rgba(27,42,74,.05);
  --shadow-md:  0 6px 18px rgba(27,42,74,.08), 0 14px 40px rgba(27,42,74,.07);
  --radius:     16px;
  --maxw:       1080px;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-sans); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .serif { font-family: var(--font-serif); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 0; border-radius: 999px; padding: 12px 22px; font-size: .98rem; font-weight: 600;
  font-family: var(--font-sans); transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); color:#fff; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: #e7e0d3; }
.btn-sm { padding: 8px 16px; font-size: .9rem; }

/* ---------- Top navigation (shared) ---------- */
.nav {
  position: sticky; top: 0; z-index: 30; background: rgba(248,245,239,.85);
  backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; opacity: .88; }
.brand-icon { height: 36px; width: 36px; display: block; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.25rem;
  color: var(--ink); letter-spacing: -0.01em; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #fff; }
@media (max-width: 720px) { .nav-links a:not(.btn) { display: none; } }

/* ---------- Landing: hero ---------- */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand); background: #f6e7da; padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); line-height: 1.08; margin: 18px 0 16px; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero p.sub { font-size: 1.15rem; color: var(--ink-soft); max-width: 30em; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { margin-top: 26px; display: flex; gap: 28px; flex-wrap: wrap; color: var(--ink-soft); font-size: .9rem; }
.hero-meta b { font-family: var(--font-serif); font-size: 1.5rem; color: var(--ink); display: block; }

/* sample question card in hero */
.sample-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 24px; transform: rotate(-1.2deg); }
.sample-card .tagrow { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sample-card .q { font-size: 1.05rem; }
.sample-card .ans { margin-top: 14px; padding: 14px 16px; background: #f4f8f6; border: 1px solid #d8e8e1;
  border-radius: 10px; font-size: .95rem; color: var(--ink); }

/* ---------- Sections ---------- */
.section { padding: 60px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 36em; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0 0 12px; }
.section-head p { color: var(--ink-soft); margin: 0; font-size: 1.05rem; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 800px){ .feature-grid { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.feature .ic { width: 42px; height: 42px; border-radius: 11px; background: #f6e7da; color: var(--brand);
  display: grid; place-items: center; margin-bottom: 14px; }
.feature h3 { font-size: 1.2rem; margin: 0 0 8px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
@media (max-width: 800px){ .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 24px; }
.step .n { font-family: var(--font-serif); font-size: 2rem; color: var(--brand); }
.step h3 { font-size: 1.15rem; margin: 6px 0 6px; }
.step p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* pricing */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
@media (max-width: 800px){ .price-grid { grid-template-columns: 1fr; } }
.price-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 720px; margin: 0 auto; }
@media (max-width: 800px){ .price-grid-2 { grid-template-columns: 1fr; } }
.price .amt-note { font-size: .85rem; color: var(--ink-soft); margin-top: 4px; }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; }
.price.featured { border-color: var(--brand); box-shadow: var(--shadow-md); position: relative; }
.price.featured::before { content: "Most popular"; position: absolute; top: -12px; left: 30px;
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: .03em; }
.price h3 { font-size: 1.3rem; margin: 0 0 4px; }
.price .amt { font-family: var(--font-serif); font-size: 2.4rem; color: var(--ink); }
.price .amt span { font-family: var(--font-sans); font-size: .95rem; color: var(--ink-soft); }
.price ul { list-style: none; padding: 0; margin: 18px 0 24px; }
.price li { padding: 7px 0 7px 26px; position: relative; color: var(--ink-soft); font-size: .95rem; }
.price li::before { content: "✓"; position: absolute; left: 0; color: var(--emerald); font-weight: 700; }
.price .btn { margin-top: auto; justify-content: center; }

/* legal pages */
.legal { max-width: 760px; }
.legal h2 { font-family: var(--font-serif); font-size: 1.35rem; color: var(--ink); margin: 34px 0 10px; }
.legal h3 { font-size: 1.05rem; color: var(--ink); margin: 22px 0 6px; }
.legal p, .legal li { color: var(--ink-soft); line-height: 1.7; }
.legal ul { margin: 8px 0 8px 0; padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal .updated { font-size: .85rem; color: var(--ink-soft); margin-top: 4px; }
.legal .note { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; font-size: .9rem; margin: 18px 0; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--brand); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 16px; color: var(--ink-soft); }

/* cta band */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 48px; text-align: center; }
.cta-band h2 { color: #fff; font-size: 2rem; margin: 0 0 10px; }
.cta-band p { color: #c7cee0; margin: 0 0 24px; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--ink-soft); font-size: .9rem; }
.footer .wrap { display: flex; justify-content: center; text-align: center; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   APP (app.html)
   ============================================================ */
.app-main { padding: 32px 0 60px; min-height: 60vh; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-soft);
  margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb button { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.breadcrumb button:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--line); }
.breadcrumb .here { color: var(--ink); font-weight: 600; }

.page-title { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin: 4px 0 6px; }
.page-title .level-chip { font-family: var(--font-sans); font-size: .8rem; font-weight: 700; color: #fff;
  background: var(--navy); padding: 3px 11px; border-radius: 999px; vertical-align: middle; }
.lead { color: var(--ink-soft); margin: 0 0 26px; }
.lead.loading { color: var(--brand); }
.lead.error { color: var(--hard); }

/* course grid */
.course-grid { display: grid; gap: 20px; margin: 8px 0 20px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px){ .course-grid { grid-template-columns: 1fr; } }
.course-card { text-align: left; cursor: pointer; background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.course-card h3 { font-size: 1.35rem; margin: 6px 0 6px; }
.course-card .course-blurb { color: var(--ink-soft); font-size: .95rem; line-height: 1.5; margin: 0 0 14px; max-width: 42ch; }
.course-card .meta { color: var(--ink-soft); font-size: .85rem; font-weight: 500; padding-top: 12px; border-top: 1px solid var(--line); }
.course-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: #fff;
  background: var(--navy); padding: 3px 11px; border-radius: 999px; }
.course-aa-sl { border-color: #3a6cc4; } .course-aa-sl .course-tag { background:#3a6cc4; }
.course-aa-hl { border-color: #25406e; } .course-aa-hl .course-tag { background:#25406e; }
.course-ai-sl { border-color: #2f8f6b; } .course-ai-sl .course-tag { background:#2f8f6b; }
.course-ai-hl { border-color: #1f5a47; } .course-ai-hl .course-tag { background:#1f5a47; }

/* group heading + topic grid */
.group-heading { font-family: var(--font-serif); font-size: 1.3rem; margin: 30px 0 14px; color: var(--ink);
  padding-bottom: 8px; border-bottom: 2px solid var(--surface-2); }
.topic-grid { display: grid; gap: 16px; margin: 0 0 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.topic-card { text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; padding: 20px; box-shadow: var(--shadow-sm); transition: transform .12s ease, border-color .12s ease; }
.topic-card:hover { transform: translateY(-2px); border-color: #cdbfa6; }
.topic-card h3 { font-size: 1.08rem; margin: 0 0 6px; }
.topic-card .meta { color: var(--ink-soft); font-size: .85rem; }
.topic-card.empty { opacity: .62; }

/* question cards */
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.q-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.1rem; margin-right: auto; }
.badge { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #fff; white-space: nowrap; }
.badge.Easy { background: var(--easy); } .badge.Medium { background: var(--medium); } .badge.Hard { background: var(--hard); }
.badge.paper { background: var(--surface-2); color: var(--ink-soft); }
.badge.marks { background: #f6ece0; color: var(--brand-dark); }
.badge.calc { background: #e7f0fb; color: #2c5896; }
.badge.noncalc { background: #efe9f6; color: #5b4a8a; }
.q-body { font-size: 1.04rem; }

.q-figure { margin: 16px 0 4px; display: flex; justify-content: center; }
.q-figure svg { width: 100%; max-width: 320px; height: auto; background: #fcfbf8; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.fig-line { stroke: var(--ink); stroke-width: 2; fill: none; }
.fig-fill { fill: #e9eef7; stroke: var(--navy); stroke-width: 2; }
.fig-dash { stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.fig-label { fill: var(--ink); font: 600 14px var(--font-sans); }
.fig-side { fill: var(--navy); font: 600 13px var(--font-sans); }
.fig-angle { fill: var(--hard); font: 600 13px var(--font-sans); }

.q-actions { margin-top: 16px; }
.solution { margin-top: 16px; padding: 18px 20px; border-radius: 12px; background: #f4f8f6;
  border: 1px solid #d8e8e1; display: none; }
.solution.open { display: block; }
.solution h4 { font-family: var(--font-sans); margin: 0 0 8px; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--emerald); }
.solution .mk { display: inline-block; font: 600 .72rem var(--font-sans); background: #f6ece0; color: #a3450a;
  border-radius: 5px; padding: 0 6px; margin: 0 2px; vertical-align: baseline; letter-spacing: .02em; }
.solution .mk-tally { margin-top: 10px; font-size: .9rem; color: var(--ink-soft); }
.solution .mk-tally b { color: var(--navy); }
.solution .gdc-head { display: block; margin-top: 16px; }
.solution .gdc-keys { color: var(--ink-soft); margin-top: 8px; font-size: .95rem; line-height: 1.7; }
.solution .gdc-keys b { color: var(--navy); }
.solution .gdc-table { border-collapse: collapse; margin: 10px 0; font-size: .95rem; }
.solution .gdc-table td { border: 1px solid var(--line); padding: 4px 14px; }
.solution .gdc-table td:first-child { font-weight: 600; color: var(--navy); background: var(--surface-2); white-space: nowrap; }

.empty-state { margin: 24px 0 40px; padding: 44px 24px; text-align: center; background: var(--surface);
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); }

/* Resource pages: formula companion + GDC guides */
.res-search { width: 100%; max-width: 480px; font: inherit; font-size: 1rem; padding: 11px 16px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); margin: 4px 0 24px; }
.res-search:focus { outline: none; border-color: var(--brand); }
.res-section { font-family: var(--font-serif); font-size: 1.35rem; margin: 30px 0 14px;
  padding-bottom: 8px; border-bottom: 2px solid var(--surface-2); }
.formula-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 14px; }
.formula-name { font-weight: 600; font-size: 1.02rem; }
.formula-tex { overflow-x: auto; margin: 2px 0; }
.formula-plain { margin: 6px 0 6px; }
.formula-when { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.formula-when span { font-weight: 600; color: var(--brand); }
.formula-courses { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.fc-badge { font-size: .7rem; font-weight: 600; color: var(--navy); background: var(--surface-2);
  padding: 2px 9px; border-radius: 999px; }
.booklet-box { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; background: #f4f8f6;
  border: 1px solid #d8e8e1; border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; font-size: .92rem; }
.booklet-box a { font-weight: 600; white-space: nowrap; }
.booklet-box span { color: var(--ink-soft); }
.gdc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 22px; margin-bottom: 16px; }
.gdc-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.12rem; }
.gdc-why { margin: 6px 0 10px; color: var(--ink-soft); font-size: .95rem; }
.gdc-steps { margin: 0; padding-left: 22px; }
.gdc-steps li { margin: 5px 0; }
.gdc-tip { margin: 12px 0 0; padding: 10px 14px; background: #f4f8f6; border: 1px solid #d8e8e1;
  border-radius: 10px; font-size: .92rem; }
.gdc-tip span { font-weight: 600; color: var(--emerald); }
.gdc-video { margin: 10px 0 0; font-size: .92rem; }
.gdc-modelbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.gdc-modellabel { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.gdc-modelbar #modelchips { display: flex; gap: 6px; flex-wrap: wrap; }
.gdc-chip { font: inherit; font-size: .85rem; cursor: pointer; padding: 5px 13px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); transition: all .12s; }
.gdc-chip:hover { border-color: var(--ink-soft); }
.gdc-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.gdc-steptag { display: inline-block; margin-left: 8px; font-size: .7rem; font-weight: 600;
  color: var(--navy); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; vertical-align: middle; }

/* Two-pane workspace (editorial) */
.ws { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.ws-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ws-topic { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; }
.ws-filters { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.ws-group { display: flex; gap: 5px; }
.ws-chip { font: inherit; font-size: .8rem; cursor: pointer; padding: 4px 11px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); transition: all .12s; }
.ws-chip:hover { border-color: var(--ink-soft); }
.ws-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.ws-body { display: flex; align-items: stretch; }
.ws-list { width: 250px; flex: none; border-right: 1px solid var(--line); max-height: 70vh; overflow-y: auto; }
.ws-row { width: 100%; display: flex; gap: 12px; align-items: baseline; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; font: inherit; transition: background .1s; }
.ws-row:hover { background: var(--surface-2); }
.ws-row.active { background: #f1ece2; }
.ws-num { font-family: var(--font-serif); font-size: 1.05rem; color: var(--ink-soft); width: 24px; flex: none; text-align: right; }
.ws-row.active .ws-num { color: var(--brand); }
.ws-rowtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-rowtitle { font-weight: 500; font-size: .92rem; }
.ws-rowmeta { font-size: .76rem; color: var(--ink-soft); }

.ws-reader { flex: 1; min-width: 0; }
.ws-reader-inner { display: flex; gap: 22px; padding: 24px; }
.ws-gutter { width: 86px; flex: none; text-align: right; border-right: 1px solid var(--line); padding-right: 16px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ws-qnum { font-family: var(--font-serif); font-size: 2rem; line-height: 1; }
.ws-tag { font-size: .68rem; white-space: normal; max-width: 100%; }
.ws-gmeta { font-size: .72rem; color: var(--ink-soft); }
.ws-qmain { flex: 1; min-width: 0; }
.ws-qmain .q-body { font-size: 1.05rem; }
.ws-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px;
  margin-top: 22px; flex-wrap: wrap; }
.ws-nav { display: flex; align-items: center; gap: 10px; }
.ws-counter { font-size: .82rem; color: var(--ink-soft); }
.btn[disabled] { opacity: .4; cursor: default; }
.ws-empty { padding: 30px; color: var(--ink-soft); }

@media (max-width: 760px) {
  .ws-filters { margin-left: 0; }
  .ws-body { flex-direction: column; }
  .ws-list { width: auto; max-height: 200px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ws-reader-inner { flex-direction: column; gap: 14px; padding: 18px; }
  .ws-gutter { flex-direction: row; width: auto; text-align: left; border-right: 0; border-bottom: 1px solid var(--line);
    padding-right: 0; padding-bottom: 10px; align-items: center; gap: 10px; }
  .ws-qnum { font-size: 1.5rem; }
  .ws-counter { margin-left: 0; }
}

/* ---------- Topic card access badges ---------- */
.topic-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.topic-card-header h3 { flex: 1; }
.topic-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.topic-free  { background: #e3f2eb; color: #1d6e46; }
.topic-lock  { background: var(--surface-2); color: var(--ink-soft); font-size: .8rem; }
.topic-locked { opacity: .7; }
.topic-locked h3 { color: var(--ink-soft); }

/* ---------- Paywall screen ---------- */
.paywall { max-width: 480px; margin: 64px auto; text-align: center; padding: 0 16px; }
.paywall-lock { font-size: 3rem; margin-bottom: 16px; }
.paywall h2 { font-size: 1.8rem; margin: 0 0 12px; }
.paywall-desc { font-size: 1.05rem; color: var(--ink); margin: 0 0 8px; }
.paywall-sub { color: var(--ink-soft); margin: 0 0 24px; line-height: 1.6; }
.paywall-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.paywall-note { margin-top: 20px; font-size: .85rem; color: var(--ink-soft); }
.paywall-note a { color: var(--brand); }

/* ---------- Nav user state ---------- */
.nav-user { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-soft); }
#nav-user-name { font-weight: 600; color: var(--ink); }

/* ---------- Auth page (login.html) ---------- */
.auth-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px 32px; box-shadow: var(--shadow-md); }
.auth-title { font-size: 1.8rem; margin: 0 0 6px; }
.auth-sub { color: var(--ink-soft); margin: 0 0 24px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 24px; gap: 0; }
.auth-tab { flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px; font-size: .95rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  transition: color .15s, border-color .15s; margin-bottom: -1px; }
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.form-group input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .95rem; font-family: var(--font-sans); outline: none; transition: border-color .15s; }
.form-group input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #f6e7da; }
.auth-error { padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-bottom: 14px;
  background: #fdecea; color: #c0413f; border: 1px solid #f5c6cb; }
.auth-note { margin-top: 16px; font-size: .84rem; color: var(--ink-soft); text-align: center; line-height: 1.5; }

/* ---------- Mobile nav + hamburger ---------- */
.nav-hamburger {
  display: none; margin-left: auto; background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--ink); flex-direction: column; gap: 5px;
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-mobile-menu {
  display: none; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 12px 24px 16px;
}
.nav-mobile-menu a { display: block; padding: 10px 0; font-size: .95rem; font-weight: 500; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.nav-mobile-menu a:last-child { border-bottom: none; }
.nav-mobile-menu a:hover { color: var(--ink); text-decoration: none; }
.nav-mobile-menu.open { display: block; }

@media (max-width: 720px) {
  .nav-hamburger { display: flex; }
  /* hide the whole nav-links bar; the CTA "Start practising" moves into hamburger menu */
  .nav-links { display: none; }
  .auth-box { padding: 28px 20px; }
}

/* Very narrow: prevent brand name from pushing nav off screen */
@media (max-width: 380px) {
  .brand-name { display: none; }
}

/* Concurrent-session kicked banner */
.session-kicked-banner { background: #b71c1c; color: #fff; text-align: center; padding: 14px 20px; font-size: .9rem; line-height: 1.5; position: relative; z-index: 9999; }
.session-kicked-banner strong { color: #fff; }
.session-kicked-banner a { color: #ffcdd2; text-decoration: underline; }

/* Account-sharing warnings */
.paywall-sharing-note { font-size: .78rem; color: var(--ink-soft); margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.paywall-sharing-note a { color: var(--ink-soft); text-decoration: underline; }
.auth-sharing-note { font-size: .78rem; color: var(--ink-soft); text-align: center; margin-top: 14px; }
