/* TextbookLive student app. Phone first: one column, 16px gutters. Colours follow the
   agreed Section A v2 design, plus the textbook's green for the book itself. */
:root{
  --bg:#F8F7FF; --card:#FFFFFF; --ink:#1A1A2E; --muted:#5E5E72; --rule:#E4E1F2;
  --accent:#6A3DE8; --accent-deep:#512DA8; --accent-bg:#F3F0FF; --on-accent:#FFFFFF;
  --paper:#FFFDF7; --paper-rule:#E8E1CC;
  --book:#1F6B4A; --book-deep:#134733; --book-ink:#FFF8E1; --gold:#E0B23C;
  --parrot:#3DAE5B; --parrot-wing:#2A8A45; --parrot-tail:#1F6B4A; --beak:#E8792B;
  --good:#1F6E2A; --good-bg:#E8F5E9; --warn:#8A4B00; --warn-bg:#FFF4E5; --bad:#B3261E; --bad-bg:#FDECEA;
  --skin:#B7773F; --hair:#2B2118; --fish:#E8792B; --water:#CFE6F5; --water-deep:#7FB5DA; --rod:#7A5230;
  --leaf:#3E9B5A; --trunk:#7A5230; --soil:#C9A67A; --bulb:#F2C14E;
  --display:'Literata',Georgia,serif; --body:'IBM Plex Sans',system-ui,sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#17151F; --card:#221E30; --ink:#EDEAF7; --muted:#A79FC2; --rule:#393152;
    --accent:#B39DFF; --accent-deep:#CDBDFF; --accent-bg:#2A2140; --on-accent:#1A1A2E;
    --paper:#26222F; --paper-rule:#3D3650;
    --book:#1F6B4A; --book-deep:#0F3627; --book-ink:#FFF8E1; --gold:#E0B23C;
    --good:#8FD6A0; --good-bg:#17301F; --warn:#F5C27A; --warn-bg:#3A2A10; --bad:#FF9A90; --bad-bg:#3A1618;
    --skin:#C98A52; --hair:#0F0B08; --fish:#F59A52; --water:#1E3A4F; --water-deep:#3F7FAA; --rod:#B08050;
    --leaf:#6FCF97; --trunk:#B08050; --soil:#6B5638;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#17151F; --card:#221E30; --ink:#EDEAF7; --muted:#A79FC2; --rule:#393152;
  --accent:#B39DFF; --accent-deep:#CDBDFF; --accent-bg:#2A2140; --on-accent:#1A1A2E;
  --paper:#26222F; --paper-rule:#3D3650;
  --book:#1F6B4A; --book-deep:#0F3627; --book-ink:#FFF8E1; --gold:#E0B23C;
  --good:#8FD6A0; --good-bg:#17301F; --warn:#F5C27A; --warn-bg:#3A2A10; --bad:#FF9A90; --bad-bg:#3A1618;
  --skin:#C98A52; --hair:#0F0B08; --fish:#F59A52; --water:#1E3A4F; --water-deep:#3F7FAA; --rod:#B08050;
  --leaf:#6FCF97; --trunk:#B08050; --soil:#6B5638;
  color-scheme:dark;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{ margin:0; background:var(--bg); color:var(--ink); font-family:var(--body); font-size:16px; line-height:1.55; }
a{ color:var(--accent-deep); }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
#app{ outline:none; }
.wrap{ max-width:560px; margin:0 auto; padding:20px 16px 64px; display:flex; flex-direction:column; gap:16px; }

/* ---------- top bar ---------- */
.topbar{ position:sticky; top:0; z-index:5; display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:10px 16px; background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:blur(8px); border-bottom:1px solid var(--rule); }
.brand{ display:flex; align-items:center; gap:8px; font-family:var(--display); font-weight:700; font-size:18px; color:var(--ink); text-decoration:none; }
.brand svg{ width:28px; height:28px; }
.toplink{ font-size:14px; font-weight:700; text-decoration:none; padding:6px 12px; border-radius:999px; background:var(--accent-bg); }

/* ---------- the book (cover used on intro and home) ---------- */
.cover{ position:relative; border-radius:6px 14px 14px 6px; background:linear-gradient(135deg, var(--book), var(--book-deep));
  color:var(--book-ink); box-shadow:inset 10px 0 0 rgba(0,0,0,.18), 0 18px 36px rgba(19,71,51,.35); overflow:hidden; }
.cover::after{ content:""; position:absolute; inset:12px 12px 12px 22px; border:1.5px solid color-mix(in srgb, var(--gold) 70%, transparent); border-radius:4px 10px 10px 4px; pointer-events:none; }
.cover-small{ display:block; font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--gold); }
.cover-title{ display:block; font-family:var(--display); font-weight:700; line-height:1.1; }

/* ---------- intro ---------- */
.intro{ position:fixed; inset:0; z-index:20; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:28px;
  background:radial-gradient(circle at 50% 40%, #24533F, #0E2A1F); cursor:pointer; animation:introOut .45s ease-in 2.15s forwards; }
.intro-book{ position:relative; width:150px; height:200px; perspective:900px; animation:bookIn .5s ease-out both; }
.intro-pages, .intro-cover{ position:absolute; inset:0; border-radius:4px 12px 12px 4px; }
.intro-pages{ background:#FFFDF7; box-shadow:0 18px 40px rgba(0,0,0,.4); padding:26px 18px; display:flex; flex-direction:column; gap:10px; }
.intro-pages span{ height:6px; border-radius:3px; background:#E8E1CC; }
.intro-pages span:nth-child(2){ width:80%; } .intro-pages span:nth-child(3){ width:60%; }
.intro-cover{ background:linear-gradient(135deg, var(--book), var(--book-deep)); color:var(--book-ink); padding:28px 18px; display:flex; flex-direction:column; justify-content:flex-end; gap:6px;
  transform-origin:left center; transform-style:preserve-3d; backface-visibility:hidden; box-shadow:inset 8px 0 0 rgba(0,0,0,.2);
  animation:coverOpen .7s cubic-bezier(.5,0,.2,1) .55s forwards; }
.intro-cover .cover-title{ font-size:24px; }
.intro-logo{ position:absolute; left:43px; top:70px; width:64px; height:64px; opacity:0; animation:rise 1.1s ease-out 1s forwards; }
.intro-logo .talkwave, .check-logo .talkwave{ animation:talk .5s ease-in-out infinite alternate; }
.intro-logo .w2, .check-logo .w2{ animation-delay:.25s; }
.intro-line{ margin:0; font-family:var(--display); font-size:22px; color:#FFF8E1; opacity:0; animation:fadeUp .5s ease-out 1.15s forwards; }
.intro-line em{ color:var(--gold); }
@keyframes bookIn{ from{ transform:scale(.7) translateY(20px); opacity:0 } to{ transform:none; opacity:1 } }
@keyframes coverOpen{ to{ transform:rotateY(-165deg); } }
@keyframes rise{ 0%{ opacity:0; transform:translate(0,10px) scale(.6) } 20%{ opacity:1 } 100%{ opacity:1; transform:translate(0,-140px) scale(1.4) } }
@keyframes talk{ from{ opacity:.25 } to{ opacity:1 } }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(8px) } to{ opacity:1; transform:none } }
@keyframes introOut{ to{ opacity:0; visibility:hidden } }

/* ---------- home (landing) ---------- */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; font:inherit; font-size:16px; font-weight:700; text-decoration:none; border-radius:14px; padding:14px 18px; min-height:48px; cursor:pointer; border:none; }
.btn-primary{ background:var(--accent-deep); color:var(--on-accent); }
.btn-ghost{ background:transparent; color:var(--accent-deep); border:1.5px solid var(--accent); }
.btn-gold{ background:var(--gold); color:#1A1A2E; }
.btn-block{ width:100%; }

/* hero: flipping book + floating feature chips */
.hero2{ position:relative; overflow:hidden; display:grid; gap:28px; align-items:center; padding:36px 16px 48px;
  background:radial-gradient(120% 80% at 85% 20%, color-mix(in srgb, var(--parrot) 22%, transparent), transparent 60%),
             radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%); }
.hero2-text{ display:flex; flex-direction:column; gap:14px; max-width:520px; }
.eyebrow{ margin:0; font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--book); }
.hero2 h1{ margin:0; font-family:var(--display); font-size:clamp(34px, 7vw, 56px); line-height:1.08; text-wrap:balance; }
.hero2 h1 em{ color:var(--book); }
.hero2-text > p{ margin:0; font-size:17px; color:var(--muted); }
.hero2-cta{ display:flex; flex-wrap:wrap; gap:10px; }
.flipbook{ position:relative; justify-self:center; width:180px; height:240px; margin:20px 60px; perspective:1200px; display:block; text-decoration:none; }
.fb-back, .fb-page, .fb-cover{ position:absolute; inset:0; border-radius:4px 14px 14px 4px; transform-origin:left center; }
.fb-back{ background:var(--book-deep); box-shadow:0 24px 50px rgba(19,71,51,.35); }
.fb-page{ inset:6px 6px 6px 0; background:var(--paper); border:1px solid var(--paper-rule); padding:28px 18px; display:flex; flex-direction:column; gap:10px;
  animation:pageFlip 7s ease-in-out infinite; }
.fb-page i{ height:6px; border-radius:3px; background:var(--paper-rule); }
.fb-page i:nth-child(2){ width:80%; } .fb-page i:nth-child(3){ width:62%; }
.fb-page b{ margin-top:auto; font-family:var(--display); font-size:26px; color:var(--book); }
.fb-page.p3{ animation-delay:1.6s; } .fb-page.p2{ animation-delay:2.1s; } .fb-page.p1{ animation-delay:2.6s; }
.fb-cover{ background:linear-gradient(135deg, var(--book), var(--book-deep)); color:var(--book-ink); padding:28px 18px 28px 26px; display:flex; flex-direction:column; justify-content:flex-end; gap:6px;
  box-shadow:inset 10px 0 0 rgba(0,0,0,.18); backface-visibility:hidden; animation:coverOpen .9s cubic-bezier(.5,0,.2,1) .5s forwards; }
.fb-cover .cover-title{ font-size:26px; }
@keyframes pageFlip{ 0%,12%{ transform:rotateY(0) } 32%,62%{ transform:rotateY(-172deg) } 82%,100%{ transform:rotateY(0) } }
.float{ position:absolute; z-index:2; font-size:13px; font-weight:700; color:var(--ink); background:var(--card); border:1px solid var(--rule); border-radius:999px; padding:6px 12px; white-space:nowrap;
  box-shadow:0 8px 20px rgba(26,26,46,.12); animation:floaty 4s ease-in-out infinite; }
.float.f1{ left:-64px; top:18px; } .float.f2{ right:-70px; top:56px; animation-delay:-1s; }
.float.f3{ left:-70px; bottom:-14px; animation-delay:-2s; } .float.f4{ right:-56px; bottom:40px; animation-delay:-3s; }
@keyframes floaty{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-8px) } }

/* feature rows: each one plays when scrolled into view */
.wrap.wide{ max-width:960px; gap:28px; }
.feat{ display:grid; gap:16px; align-items:center; opacity:0; transform:translateY(28px); transition:opacity .6s ease, transform .6s ease; }
.feat.in{ opacity:1; transform:none; }
.feat-text h2{ margin:6px 0 6px; font-family:var(--display); font-size:26px; line-height:1.2; }
.feat-text p{ margin:0; color:var(--muted); }
.num{ display:inline-flex; width:30px; height:30px; border-radius:50%; align-items:center; justify-content:center; font-weight:700; background:var(--book); color:var(--book-ink); }
.try{ margin-top:8px !important; font-weight:700; color:var(--accent-deep) !important; }
.feat-art{ background:var(--card); border:1px solid var(--rule); border-radius:20px; padding:18px; box-shadow:0 10px 30px rgba(26,26,46,.06); }

.page-card{ background:var(--paper); border:1px solid var(--paper-rule); border-radius:12px; padding:14px 16px; font-family:var(--display); font-size:18px; }
.page-card small{ font-family:var(--body); font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.page-card p{ margin:8px 0 0; }
.sweep{ color:inherit; background:linear-gradient(var(--bulb), var(--bulb)) no-repeat 0 85% / 0% 45%; transition:background-size 1s ease .5s; }
.feat.in .sweep{ background-size:100% 45%; }
.page-card .fade{ color:var(--muted); opacity:0; transition:opacity .8s ease 1.4s; }
.feat.in .fade{ opacity:1; }

.type-box{ min-height:120px; background:var(--bg); border:1.5px solid var(--rule); border-radius:12px; padding:12px; font-size:16px; line-height:1.6; }
.caret{ display:inline-block; width:2px; height:1.1em; vertical-align:-3px; background:var(--accent); animation:blink 1s steps(1) infinite; }
@keyframes blink{ 50%{ opacity:0 } }
.meter{ display:flex; align-items:center; gap:10px; margin-top:12px; font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; }
.meter-bar{ position:relative; flex:1; height:8px; border-radius:999px; background:var(--rule); overflow:hidden; }
.meter-bar i{ position:absolute; inset:0 auto 0 0; width:0; background:var(--accent); border-radius:999px; }
.meter-bar .target{ position:absolute; left:75%; right:0; top:0; bottom:0; background:color-mix(in srgb, var(--good) 30%, transparent); }

.fix-card{ display:flex; flex-direction:column; gap:12px; }
.fix-line{ margin:0; font-family:var(--display); font-size:20px; line-height:1.6; }
.err{ font:inherit; color:var(--bad); background:none; border:none; padding:0 2px; cursor:pointer; text-decoration:underline wavy var(--bad); text-underline-offset:5px; border-radius:4px; animation:pulse 1.6s ease-in-out infinite; }
.err.ok{ color:var(--good); text-decoration:underline solid var(--good); animation:none; }
@keyframes pulse{ 0%,100%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--bad) 35%, transparent) } 50%{ box-shadow:0 0 0 6px transparent } }
.pop{ display:flex; flex-direction:column; gap:4px; padding:12px 14px; border-radius:12px; background:var(--bg); border-left:4px solid var(--accent); font-size:15px; animation:fadeUp .35s ease-out; }
.pop[hidden]{ display:none; }
.pop .wrong{ color:var(--bad); } .pop .fix{ color:var(--good); } .pop .why{ color:var(--muted); font-size:14px; }

.score-demo{ display:grid; grid-template-columns:96px minmax(0,1fr); gap:16px; align-items:center; }
.ring{ position:relative; width:96px; height:96px; }
.ring svg{ width:100%; height:100%; transform:rotate(-90deg); }
.ring circle{ fill:none; stroke:var(--rule); stroke-width:8; }
.ring .ring-fill{ stroke:var(--accent); stroke-linecap:round; stroke-dasharray:201; stroke-dashoffset:201; transition:stroke-dashoffset 1.4s ease; }
.feat.in .ring-fill{ stroke-dashoffset:60; }
.ring-n{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-family:var(--display); font-size:24px; font-variant-numeric:tabular-nums; }
.mini-bars{ display:flex; flex-direction:column; gap:8px; font-size:13px; }
.mb{ display:grid; grid-template-columns:82px minmax(0,1fr); gap:8px; align-items:center; }
.mini-bars .bar i{ width:0; transition:width 1.2s ease .2s; }
.feat.in .mini-bars .bar i{ width:var(--w); }
.eg{ color:var(--muted); font-size:12px; }

.inside h2{ margin:0; font-family:var(--display); font-size:26px; }
.tiles{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; perspective:800px; }
.tile{ display:flex; align-items:center; gap:10px; padding:12px; border-radius:14px; background:var(--card); border:1px solid var(--rule); color:var(--ink); text-decoration:none; font-size:14px; font-weight:600;
  opacity:0; transform:rotateX(-70deg); transform-origin:top; transition:opacity .4s ease calc(var(--i) * 90ms), transform .5s ease calc(var(--i) * 90ms); }
.inside.in .tile{ opacity:1; transform:none; }
.tile:hover{ border-color:var(--accent); }

.cta-band{ margin-top:12px; padding:40px 16px 48px; text-align:center; background:linear-gradient(135deg, var(--book), var(--book-deep)); color:var(--book-ink); display:flex; flex-direction:column; align-items:center; gap:16px; }
.cta-band h2{ margin:0; font-family:var(--display); font-size:28px; }

@media (min-width:760px){
  .hero2{ grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr); padding:64px max(32px, calc((100vw - 960px) / 2)) 72px; min-height:78vh; }
  .flipbook{ width:220px; height:290px; }
  .feat{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:40px; }
  .feat:nth-of-type(even) .feat-text{ order:2; }
  .tiles{ grid-template-columns:repeat(4,minmax(0,1fr)); }
}
.continue{ display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:16px; background:var(--accent-bg); color:var(--ink); text-decoration:none; }
.continue b{ display:block; }
.continue small{ color:var(--muted); font-size:14px; }
.continue .arrow{ margin-left:auto; font-size:22px; color:var(--accent-deep); }
.h2{ margin:8px 0 0; font-size:13px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }

/* ---------- contents (looks like a textbook's contents page) ---------- */
.paper{ background:var(--paper); border:1px solid var(--paper-rule); border-radius:4px 16px 16px 4px; padding:22px 18px 24px 26px; box-shadow:inset 6px 0 0 var(--paper-rule), 0 8px 24px rgba(26,26,46,.06); }
.paper h1{ margin:0 0 4px; font-family:var(--display); font-size:28px; }
.paper .sub{ margin:0 0 18px; color:var(--muted); font-size:14px; }
.unit-head{ margin:0; font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--book); }
.unit-title{ margin:2px 0 12px; font-family:var(--display); font-size:21px; }
.toc-row{ display:flex; align-items:baseline; gap:8px; padding:12px 0; text-decoration:none; color:var(--ink); border-top:1px solid var(--paper-rule); }
.toc-row .num{ font-family:var(--display); font-weight:700; color:var(--book); min-width:1.6em; }
.toc-row .ttl{ font-family:var(--display); font-size:18px; font-weight:600; }
.toc-row .by{ display:block; font-size:13px; color:var(--muted); font-family:var(--body); font-weight:400; }
.toc-row .dots{ flex:1; border-bottom:2px dotted var(--paper-rule); transform:translateY(-4px); }
.toc-row .go{ font-size:13px; font-weight:700; color:var(--on-accent); background:var(--accent-deep); padding:4px 12px; border-radius:999px; }
.toc-note{ margin:14px 0 0; font-size:14px; color:var(--muted); }

/* ---------- lesson ---------- */
.lesson-head{ display:grid; grid-template-columns:96px minmax(0,1fr); gap:14px; align-items:center; }
.lesson-head svg{ width:96px; height:110px; }
.crumb{ margin:0; font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.crumb a{ color:inherit; text-decoration:none; }
.lesson-head h1, .sec-title h1{ margin:2px 0 2px; font-family:var(--display); font-size:26px; line-height:1.2; text-wrap:balance; }
.lesson-head .by{ margin:0; color:var(--muted); font-size:14px; }
.sec-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.sec-row{ display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:14px; background:var(--card); border:1px solid var(--rule); text-decoration:none; color:var(--ink); min-height:64px; }
.sec-row:hover{ border-color:var(--accent); }
.sec-row.later{ opacity:.7; }
.letter{ width:40px; height:40px; flex:0 0 auto; border-radius:10px; background:var(--accent-bg); color:var(--accent-deep); font-family:var(--display); font-size:21px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.sec-row b{ display:block; font-size:16px; }
.sec-row small{ display:block; color:var(--muted); font-size:13px; }
.tag{ margin-left:auto; flex:0 0 auto; font-size:12px; font-weight:700; border-radius:999px; padding:3px 10px; }
.tag.write{ background:var(--accent-bg); color:var(--accent-deep); }
.tag.read{ background:var(--good-bg); color:var(--good); }
.tag.later{ background:var(--rule); color:var(--muted); }
.tag.done{ background:var(--good-bg); color:var(--good); }
.cage-bars{ stroke:var(--gold); stroke-width:2.5; fill:none; }

/* ---------- section pages ---------- */
.sec-title{ display:flex; gap:12px; align-items:center; }
.sec-title .letter{ width:48px; height:48px; font-size:26px; border-radius:12px; }
.sec-strip{ display:flex; gap:6px; }
.sec-strip a{ flex:1; text-align:center; font-size:12px; font-weight:700; padding:6px 0; border-radius:6px; background:var(--card); color:var(--muted); border:1px solid var(--rule); text-decoration:none; }
.sec-strip a[aria-current="page"]{ background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
.book{ margin:0; background:var(--paper); border:1px solid var(--paper-rule); border-radius:12px; padding:12px 14px; font-family:var(--display); font-size:16px; line-height:1.5; }
.book small{ display:block; font-family:var(--body); font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-bottom:4px; }
.part{ background:var(--card); border:1px solid var(--rule); border-radius:16px; padding:16px; display:flex; flex-direction:column; gap:14px; scroll-margin-top:64px; }
.part-head{ display:flex; gap:10px; align-items:center; }
.part-tag{ font-size:13px; font-weight:700; color:var(--on-accent); background:var(--accent-deep); border-radius:8px; padding:2px 8px; flex:0 0 auto; }
.part-name{ margin:0; font-size:17px; font-weight:700; }
.small{ margin:0; font-size:14px; color:var(--muted); }
.q{ margin:0; font-size:17px; font-weight:700; }
.pager{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.pager a{ font-size:15px; }
.pager .next{ grid-column:2; }

.art{ margin:0; display:flex; flex-direction:column; gap:6px; }
.art svg{ display:block; width:100%; height:auto; background:var(--bg); border-radius:12px; }
.art figcaption{ text-align:center; font-family:var(--display); font-size:15px; font-style:italic; color:var(--muted); }
.panels{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.panels figcaption{ display:flex; flex-direction:column; font-style:normal; }
.panels .do{ font-family:var(--body); font-size:14px; font-weight:700; color:var(--ink); }
.panels .result{ font-style:italic; }
.choices{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.choice{ font:inherit; font-size:15px; font-weight:600; color:var(--ink); background:var(--bg); border:1.5px solid var(--rule); border-radius:12px; padding:10px 8px; cursor:pointer; min-height:48px; }
.choice:hover{ border-color:var(--accent); }
.choice[aria-pressed="true"].right{ background:var(--good-bg); border-color:var(--good); color:var(--good); }
.choice[aria-pressed="true"].wrong{ background:var(--warn-bg); border-color:var(--warn); color:var(--warn); }
.feedback{ margin:0; font-size:15px; padding:10px 12px; border-radius:10px; }
.feedback.right{ background:var(--good-bg); color:var(--good); }
.feedback.wrong{ background:var(--warn-bg); color:var(--warn); }
.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{ font:inherit; font-size:14px; font-weight:600; color:var(--ink); background:var(--bg); border:1.5px solid var(--rule); border-radius:999px; padding:8px 14px; min-height:40px; }
button.chip{ cursor:pointer; min-height:44px; }
.chip[aria-pressed="true"]{ background:var(--accent-bg); border-color:var(--accent); color:var(--accent-deep); }
.chip:disabled{ opacity:.45; cursor:not-allowed; }
.genre{ margin:0; padding:12px 14px; border-radius:12px; background:var(--bg); font-size:15px; }
.qlist{ margin:0; padding-left:22px; display:flex; flex-direction:column; gap:6px; }
.qlist li.soon{ color:var(--muted); }

/* story */
.story p{ margin:0 0 14px; font-family:var(--display); font-size:18px; line-height:1.7; }
.story .scene-no{ margin:0 0 10px; text-align:center; font-family:var(--display); font-size:18px; color:var(--good); }
.story .scene + .scene{ margin-top:26px; }
.story .scene:first-child > div > p:first-child::first-letter{ float:left; font-size:56px; line-height:.9; padding:6px 8px 0 0; font-weight:700; color:var(--book); }
.story .end{ text-align:center; color:var(--muted); font-family:var(--body); font-size:14px; }

/* writing + feedback */
textarea{ width:100%; font:inherit; font-size:16px; line-height:1.6; color:var(--ink); background:var(--bg); border:1.5px solid var(--rule); border-radius:12px; padding:12px; resize:vertical; }
.count{ margin:0; text-align:right; font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; }
.count.ok{ color:var(--good); font-weight:700; }
.error{ margin:0; font-size:15px; padding:10px 12px; border-radius:10px; background:var(--bad-bg); color:var(--bad); }
.loading{ display:flex; align-items:center; gap:10px; color:var(--muted); font-size:15px; }
.spinner{ width:20px; height:20px; border:3px solid var(--rule); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg) } }
/* checking (while Gemini grades) */
.checking{ display:flex; flex-direction:column; gap:12px; border-top:1px dashed var(--rule); padding-top:14px; }
.check-head{ margin:0; font-family:var(--display); font-size:17px; font-weight:700; }
.check-paper{ position:relative; overflow:hidden; max-height:118px; background:var(--paper); border:1px solid var(--paper-rule); border-radius:10px; padding:12px 46px 12px 12px; }
.check-text{ margin:0; font-size:14px; line-height:1.6; color:var(--muted); -webkit-mask-image:linear-gradient(#000 60%, transparent); mask-image:linear-gradient(#000 60%, transparent); }
.scan{ position:absolute; left:0; right:0; top:-30px; height:30px; background:linear-gradient(transparent, color-mix(in srgb, var(--accent) 28%, transparent), transparent); animation:scan 1.6s ease-in-out infinite; }
@keyframes scan{ to{ top:100%; } }
.check-logo{ position:absolute; right:6px; top:6px; width:36px; height:36px; }
.steps{ margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:7px; font-size:15px; }
.steps li{ display:flex; align-items:center; gap:10px; color:var(--muted); opacity:.4; transition:opacity .3s, transform .3s; }
.steps li.active{ opacity:1; color:var(--ink); font-weight:700; transform:translateX(4px); }
.steps li.done{ opacity:1; }
.st-ico{ width:22px; text-align:center; }
.st-mark{ margin-left:auto; flex:0 0 auto; width:20px; height:20px; box-sizing:border-box; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }
.steps li.active .st-mark{ border:3px solid var(--rule); border-top-color:var(--accent); animation:spin .8s linear infinite; }
.steps li.done .st-mark{ background:var(--good-bg); color:var(--good); animation:pop .3s ease-out; }
.steps li.done .st-mark::after{ content:"✓"; }
@keyframes pop{ from{ transform:scale(.3) } 70%{ transform:scale(1.2) } to{ transform:scale(1) } }

.report{ scroll-margin-top:64px; display:flex; flex-direction:column; gap:14px; border-top:1px dashed var(--rule); padding-top:14px; }
.block{ display:flex; flex-direction:column; gap:8px; }
.block h3{ margin:0; font-size:15px; font-weight:700; }
.student-text{ margin:0; font-size:15px; line-height:1.65; background:var(--bg); border-radius:10px; padding:12px; white-space:pre-wrap; }
.fix-caption{ margin:0; min-height:1.5em; font-size:14px; font-weight:700; color:var(--accent-deep); }
.fix-caption:empty{ display:none; }
.fix-caption del{ color:var(--bad); } .fix-caption ins{ color:var(--good); text-decoration:none; }
.fixit del{ background:var(--bad-bg); color:var(--bad); border-radius:3px; padding:0 2px; text-decoration:none; }
.fixit ins{ display:none; margin-left:4px; background:var(--good-bg); color:var(--good); border-radius:3px; padding:0 2px; text-decoration:none; font-weight:700; }
.fixit.on del{ text-decoration:line-through; text-decoration-thickness:2px; }
.fixit.on ins{ display:inline; }
.reveal .fixit.on del{ animation:flash .5s ease-out; }
.reveal .fixit.on ins{ display:inline-block; animation:pop .4s ease-out; }
@keyframes flash{ 0%{ box-shadow:0 0 0 0 var(--bad) } 100%{ box-shadow:0 0 0 6px transparent } }
.kind{ align-self:flex-start; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--accent-deep); background:var(--accent-bg); border-radius:999px; padding:2px 8px; }
.score-top{ display:flex; align-items:center; gap:16px; }
.score-top .ring{ flex:0 0 auto; }
.score-top .scores{ flex:1; grid-template-columns:1fr; gap:6px; }
.report .ring-fill{ stroke-dashoffset:var(--off); }
.report.reveal .ring-fill{ stroke-dashoffset:201; }
.report.reveal.go .ring-fill{ stroke-dashoffset:var(--off); }
.report .bar i{ width:var(--w); transition:width 1s ease .2s; }
.report.reveal .rv:not(.shown) .bar i{ width:0; }
.report .rv{ transition:opacity .45s ease, transform .45s ease; }
.report.reveal .rv:not(.shown){ opacity:0; transform:translateY(12px); }
.scores{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; }
.score{ display:flex; flex-direction:column; gap:3px; }
.score .row{ display:flex; justify-content:space-between; font-size:13px; }
.score .row b{ font-variant-numeric:tabular-nums; }
.bar{ height:6px; border-radius:999px; background:var(--rule); overflow:hidden; }
.bar i{ display:block; height:100%; background:var(--accent); border-radius:999px; }
.mistake{ display:flex; flex-direction:column; gap:4px; background:var(--bg); border-radius:10px; padding:10px 12px; font-size:15px; }
.mistake .wrong{ color:var(--bad); } .mistake .fix{ color:var(--good); } .mistake .why{ color:var(--muted); font-size:14px; }
.lbl{ font-weight:700; }
.checklist{ margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:6px; font-size:15px; }
.checklist li{ display:flex; gap:8px; align-items:flex-start; }
.mark{ flex:0 0 auto; width:22px; height:22px; border-radius:50%; font-size:13px; font-weight:700; display:flex; align-items:center; justify-content:center; margin-top:1px; }
.mark.done{ background:var(--good-bg); color:var(--good); }
.mark.missing{ background:var(--bad-bg); color:var(--bad); }
.mark.weak{ background:var(--warn-bg); color:var(--warn); }
.next-step{ margin:0; background:var(--accent-bg); border-radius:10px; padding:12px; font-size:15px; }
details{ background:var(--bg); border-radius:10px; padding:10px 12px; }
summary{ cursor:pointer; font-weight:700; font-size:15px; }
details p{ margin:10px 0 0; font-size:15px; line-height:1.65; white-space:pre-wrap; }
.who{ display:block; margin-top:2px; font-size:12px; font-weight:600; color:var(--muted); }

/* pictures in Section A */
.skin{ fill:var(--skin); } .hair{ fill:var(--hair); } .shirt{ fill:var(--accent); } .shirt2{ fill:var(--water-deep); } .shirt3{ fill:var(--leaf); }
.fish{ fill:var(--fish); } .eye{ fill:var(--card); }
.water{ fill:var(--water); } .wave{ fill:none; stroke:var(--water-deep); stroke-width:2.5; stroke-linecap:round; }
.rod{ stroke:var(--rod); stroke-width:3.5; stroke-linecap:round; fill:none; } .line{ stroke:var(--muted); stroke-width:1.2; fill:none; }
.plate{ fill:none; stroke:var(--muted); stroke-width:2.5; stroke-linecap:round; }
.sun{ fill:var(--fish); opacity:.35; }
.soil{ fill:var(--soil); } .ground{ stroke:var(--soil); stroke-width:3; stroke-linecap:round; }
.leaf{ fill:var(--leaf); } .trunk{ fill:var(--trunk); } .stem{ stroke:var(--leaf); stroke-width:3; stroke-linecap:round; fill:none; }
.seed{ fill:var(--trunk); } .arrow{ fill:none; stroke:var(--muted); stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.t-label{ font-family:var(--body); font-size:13px; font-weight:700; fill:var(--muted); }
.bubble{ fill:var(--card); stroke:var(--rule); stroke-width:2; }
.qmark{ font-family:var(--display); font-size:26px; font-weight:700; fill:var(--accent); }
.bulb{ fill:var(--bulb); } .bulb-base{ fill:var(--muted); }
@media (prefers-reduced-motion: no-preference){
  .give{ animation:give 5s ease-in-out infinite; }
  @keyframes give{ 0%,15%{ transform:translate(0,0); opacity:1 } 35%,55%{ transform:translate(-38px,10px); opacity:1 } 70%,100%{ transform:translate(-38px,10px); opacity:0 } }
  .jump{ animation:jump 2.6s ease-in-out infinite; }
  @keyframes jump{ 0%,30%{ transform:translate(0,22px); opacity:0 } 40%{ opacity:1 } 60%{ transform:translate(-10px,-18px); opacity:1 } 80%{ transform:translate(-20px,22px); opacity:0 } 100%{ opacity:0; transform:translate(0,22px) } }
  .bob{ animation:bob 2.6s ease-in-out infinite; }
  @keyframes bob{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(3px) } }
  .grow2{ animation:grow2 7s ease-out infinite; } .grow3{ animation:grow3 7s ease-out infinite; } .fruit{ animation:fruit 7s ease-out infinite; }
  @keyframes grow2{ 0%,18%{ opacity:0 } 28%,92%{ opacity:1 } 100%{ opacity:0 } }
  @keyframes grow3{ 0%,40%{ opacity:0 } 52%,92%{ opacity:1 } 100%{ opacity:0 } }
  @keyframes fruit{ 0%,62%{ opacity:0 } 70%,92%{ opacity:1 } 100%{ opacity:0 } }
  .say1{ animation:say1 4.4s ease-in-out infinite; } .say2{ animation:say2 4.4s ease-in-out infinite; }
  @keyframes say1{ 0%,5%{ opacity:0 } 12%,45%{ opacity:1 } 52%,100%{ opacity:0 } }
  @keyframes say2{ 0%,50%{ opacity:0 } 57%,92%{ opacity:1 } 100%{ opacity:0 } }
}
@media (prefers-reduced-motion: reduce){
  .flipbook *, .float, .caret, .err{ animation:none !important; }
  .feat, .feat *, .tile{ transition:none !important; }
  .scan, .check-logo, .talkwave, .steps *, .report *{ animation:none !important; transition:none !important; }
}

/* ---------- sections D and G: write, then check yourself ---------- */
.in-story{ margin:0; font-family:var(--display); font-size:17px; line-height:1.6; }
.in-story mark{ background:var(--accent-bg); color:var(--accent-deep); font-weight:700; border-radius:4px; padding:0 3px; }
.line{ font:inherit; font-size:16px; width:100%; min-height:48px; padding:10px 12px; color:var(--ink); background:var(--bg); border:1.5px solid var(--rule); border-radius:12px; }
.answer{ display:flex; flex-direction:column; gap:10px; padding:12px; border-radius:12px; background:var(--good-bg); } .answer[hidden]{ display:none; }
.answer p{ margin:0; } .answer [lang="bn"]{ font-size:18px; }
.tick{ display:flex; gap:10px; align-items:flex-start; min-height:44px; padding:6px 0; cursor:pointer; } .tick input{ width:22px; height:22px; flex:0 0 auto; margin:2px 0 0; accent-color:var(--good); }
.btn[hidden]{ display:none; }

/* ---- lessons made of blocks (blocks.js) ---- */
.toc-row.soon{ color:var(--muted); } .toc-row.soon .ttl{ font-weight:400; } .paper .unit-head{ margin-top:26px; }
.tile .letter{ font-size:17px; }
.sec-strip{ flex-wrap:wrap; } .sec-strip a{ min-width:30px; min-height:32px; }
.q2{ margin:0; font-size:16px; font-weight:600; }
.row-item{ display:flex; flex-direction:column; gap:10px; padding-top:12px; border-top:1px solid var(--rule); } .row-item:first-of-type{ border-top:0; padding-top:0; }
.feedback[hidden]{ display:none; }
.part textarea{ width:100%; }
.poem p{ line-height:1.8; }
.match{ display:flex; flex-direction:column; gap:8px; } .match h3{ margin:6px 0 0; font-size:15px; } .m-a{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .m-b{ display:flex; flex-direction:column; gap:8px; } .m-b .choice{ text-align:left; font-weight:400; }
.match .choice[aria-pressed="true"]{ border-color:var(--accent); background:var(--accent-bg); } .match .choice:disabled{ cursor:default; background:var(--good-bg); border-color:var(--good); color:var(--good); }
.gaps{ line-height:2.3; } .gap{ font:inherit; min-width:56px; min-height:34px; padding:0 8px; border:0; border-bottom:2px solid var(--accent); border-radius:6px 6px 0 0; background:var(--accent-bg); color:var(--muted); font-size:14px; cursor:pointer; } .gap.full{ color:var(--ink); font-weight:700; font-size:16px; } .gap.cur{ outline:2px solid var(--accent); } .gap.right{ background:var(--good-bg); color:var(--good); border-color:var(--good); } .gap.wrong{ background:var(--warn-bg); color:var(--warn); border-color:var(--warn); }
.order{ margin:0; padding:0; list-style:none; counter-reset:o; display:flex; flex-direction:column; gap:8px; } .order li{ counter-increment:o; display:flex; gap:10px; align-items:center; padding:10px 12px; border:1.5px solid var(--rule); border-radius:12px; background:var(--bg); } .order li::before{ content:counter(o); font-weight:700; color:var(--accent-deep); } .order li > span:first-child{ flex:1; } .order li.right{ border-color:var(--good); background:var(--good-bg); } .order li.wrong{ border-color:var(--warn); background:var(--warn-bg); }
.mv{ display:flex; flex-direction:column; gap:4px; } .mv button{ font:inherit; font-weight:700; width:44px; height:36px; border:1.5px solid var(--rule); border-radius:8px; background:var(--card); color:var(--accent-deep); cursor:pointer; } .mv button:disabled{ opacity:.3; }
.findpoem p{ margin:0 0 12px; font-family:var(--display); line-height:2.1; } .fw{ font:inherit; color:inherit; background:none; border:0; border-radius:5px; padding:2px 2px; margin:0; cursor:pointer; } .fw:hover{ background:var(--accent-bg); } .fw.hit{ background:var(--good-bg); color:var(--good); font-weight:700; } .found{ margin:0; font-size:15px; }
.bnpoem{ font-size:17px; line-height:2; background:var(--paper); border:1px solid var(--paper-rule); border-radius:12px; padding:12px 14px; } .bnpoem h2{ margin:0; font-size:20px; } .bnpoem p{ margin:8px 0; } .bnw{ font:inherit; color:inherit; background:var(--accent-bg); border:0; border-bottom:2px dotted var(--accent); border-radius:4px; padding:0 2px; cursor:pointer; } .bnw.cur{ outline:2px solid var(--accent); } .bnw.hit{ background:var(--good-bg); border-color:var(--good); } .cmp{ display:flex; flex-direction:column; gap:10px; } .cmp[hidden]{ display:none; }
.hunt{ position:relative; width:100%; overflow:hidden; border-radius:12px; } .hunt img{ width:100%; height:100%; display:block; } .spot{ position:absolute; aspect-ratio:1; transform:translate(-50%,-50%); border-radius:50%; border:0; background:none; padding:0; pointer-events:none; } .hunt{ cursor:pointer; } .spot.hit{ border:3px solid #FFC531; box-shadow:0 0 0 2px #1A1A2E; } .hunt-list{ margin:0; padding-left:20px; font-size:15px; }
.flybox{ width:100%; height:auto; border-radius:12px; display:block; } .fy-sky{ fill:#CFE6F5; } .fy-sun{ fill:#F7C948; } .fy-sea{ fill:#7FB5DA; } .fy-wing{ fill:#FFFDF5; stroke:#B9AE8E; } .fy-body{ fill:#D9412F; } .fy-head{ fill:#B7773F; } .flybox[data-z="high"] .fy-wing{ opacity:.35; } .flybox[data-z="low"] .fy-wing{ fill:#7FA8C4; } .flyr{ width:100%; min-height:44px; accent-color:var(--accent); }
.cards{ margin:0; display:flex; flex-direction:column; gap:10px; } .cards dt{ font-weight:700; } .cards dd{ margin:0; color:var(--muted); }
.opp{ margin:0; padding:10px 12px; border-radius:12px 12px 12px 2px; background:var(--accent-bg); } .deb{ display:flex; flex-direction:column; gap:14px; }
.toc-row .num{ background:none; width:auto; height:auto; border-radius:0; color:var(--book); } @media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .toc-row .num{ color:var(--gold); } } :root[data-theme="dark"] .toc-row .num{ color:var(--gold); }
.sec-strip{ gap:4px; } .sec-strip a{ min-width:26px; }
/* ---- zoom into a painting, and conversations (blocks.js) ---- */
.zoom{ width:100%; aspect-ratio:1/1.02; border-radius:12px; overflow:hidden; background:#7C9CA3; touch-action:none; scroll-margin-top:64px; }
.talk{ display:flex; flex-direction:column; gap:10px; } .t-say{ display:flex; gap:10px; align-items:flex-start; padding:10px 12px; border-radius:14px; background:var(--bg); border:1.5px solid var(--rule); } .t-say p{ margin:2px 0 0; } .t-say > div{ flex:1; } .t-face{ font-size:24px; line-height:1.2; } .t-nar{ background:none; border:0; color:var(--muted); padding:4px 2px; } .t-me{ align-self:flex-end; max-width:88%; background:var(--accent-bg); border-color:var(--accent); } .t-say.speaking{ border-color:var(--gold); box-shadow:0 0 0 2px var(--gold); } .t-hear{ min-width:44px; min-height:44px; border:0; background:none; font-size:17px; cursor:pointer; }
.talk-ch{ display:flex; flex-direction:column; gap:8px; } .talk-ch .choice{ text-align:left; padding:12px; } .talk-bar{ display:flex; gap:8px; flex-wrap:wrap; } .talk-notes ul{ margin:8px 0 0; padding-left:18px; display:flex; flex-direction:column; gap:6px; } .talk-label{ padding:14px; border-radius:6px; background:var(--paper); border:2px solid var(--gold); } .talk-label h3{ margin:0 0 6px; font-family:var(--display); } .talk-label p{ margin:0; font-family:var(--display); line-height:1.6; }
[class^="pen-"]{ display:inline-block; padding:1px 9px; margin-right:4px; border-radius:999px; font-size:13px; color:#FFF; } .pen-belief{ background:#B4550E; } .pen-fact{ background:#1F7A42; } .pen-link,.pen-think{ background:#512DA8; }

/* ---------- account (account.js) ---------- */
.toplinks{ display:flex; gap:8px; }
#account-link{ max-width:9em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account .acc-title{ font-family:var(--display); font-size:26px; line-height:1.2; margin:0; }
.acc-lead{ margin:0; }
.acc-note{ margin:0; font-size:14px; color:var(--muted); }
.acc-who{ display:flex; gap:14px; align-items:center; }
.acc-photo{ width:56px; height:56px; border-radius:50%; flex:0 0 auto; }
.acc-google{ min-height:44px; display:flex; justify-content:center; }
.acc-form{ display:flex; flex-direction:column; gap:12px; background:var(--card); border:1px solid var(--rule); border-radius:16px; padding:16px; }
.acc-h2{ font-size:18px; margin:0; }
.acc-opt{ font-weight:400; font-size:14px; color:var(--muted); }
.acc-label{ font-weight:600; font-size:15px; padding:0; }
.acc-input{ width:100%; font:inherit; font-size:18px; letter-spacing:.03em; color:var(--ink); background:var(--bg); border:1.5px solid var(--rule); border-radius:12px; padding:12px; min-height:48px; }
.acc-owner{ border:0; margin:0; padding:0; }
.acc-owner .tick input{ accent-color:var(--accent); }
.acc-status{ margin:0; font-size:15px; min-height:1.5em; }
.acc-status.good{ color:var(--good); } .acc-status.bad{ color:var(--bad); }
.acc-danger summary{ cursor:pointer; color:var(--muted); font-size:14px; padding:10px 0; }
.acc-danger[open]{ display:flex; flex-direction:column; gap:10px; }
.acc-delete{ color:var(--bad); border-color:var(--bad); }

/* ---- phone sign-in (Decision 017) ---- */
.acc-or{ display:flex; align-items:center; gap:12px; margin:0; color:var(--muted); font-size:14px; }
.acc-or::before, .acc-or::after{ content:""; flex:1; height:1px; background:var(--rule); }
.acc-code{ display:flex; flex-direction:column; gap:8px; } .acc-code[hidden]{ display:none; }
.acc-code-input{ letter-spacing:.4em; font-size:22px; text-align:center; }
.btn-sm{ min-height:44px; padding:8px 14px; font-size:15px; align-self:flex-start; }
.btn:disabled{ opacity:.6; cursor:wait; }

/* ---- the student's page #/me and admin #/admin (Decision 019) ---- */
.me section{ display:flex; flex-direction:column; gap:10px; }
.me .card{ background:var(--card); border:1px solid var(--rule); border-radius:16px; padding:16px; display:flex; flex-direction:column; gap:8px; }
.me .card h2{ font-size:19px; margin:0; } .me .card p{ margin:0; }
.me-badge{ align-self:flex-start; font-size:13px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:4px 10px; border-radius:999px; background:var(--accent-bg); color:var(--accent-deep); }
.me-badge.free{ background:var(--bg); border:1px solid var(--rule); color:var(--muted); }
.me-plan.premium{ border-color:var(--good); } .me-plan.premium .me-badge{ background:var(--good-bg); color:var(--good); }
.me-plan.waiting .me-badge{ background:var(--gold); color:#1A1A2E; }
.me-lessons{ display:flex; flex-direction:column; gap:8px; }
.me-lesson{ display:flex; gap:12px; align-items:center; padding:12px; border:1px solid var(--rule); border-radius:14px; background:var(--card); color:var(--ink); text-decoration:none; min-height:56px; }
.me-lesson-text{ display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
.me-lesson-text small{ color:var(--muted); font-size:14px; }
.me-bar{ display:block; height:6px; border-radius:3px; background:var(--rule); overflow:hidden; }
.me-bar i{ display:block; height:100%; background:var(--good); border-radius:3px; }
.me-list, .me-steps{ margin:0; padding-left:22px; display:flex; flex-direction:column; gap:6px; }
.me-num{ font-size:18px; letter-spacing:.04em; white-space:nowrap; }
.me-trx{ text-transform:uppercase; letter-spacing:.12em; }
.me-links{ display:flex; flex-wrap:wrap; gap:10px; margin:0; }
.me-pay{ overflow-wrap:anywhere; }
.me-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.me-find{ display:flex; gap:8px; } .me-find .acc-input{ flex:1; min-width:0; }
.me-offer .acc-form{ border:0; padding:0; background:none; }

/* ---- My page tabs: Overview · Progress · Plan · Profile ---- */
.me-tabs{ display:flex; gap:4px; padding:4px; border-radius:14px; background:var(--accent-bg); overflow-x:auto; scrollbar-width:none; }
.me-tabs a{ flex:1 0 auto; text-align:center; min-height:44px; display:flex; align-items:center; justify-content:center; padding:0 12px; border-radius:10px; color:var(--muted); font-weight:600; font-size:15px; text-decoration:none; }
.me-tabs a[aria-current="page"]{ background:var(--card); color:var(--accent-deep); box-shadow:0 1px 2px rgba(0,0,0,.08); }
.me-badge.wait{ background:var(--gold); color:#1A1A2E; }
.acc-note .me-badge{ display:inline-block; vertical-align:1px; font-size:11px; padding:2px 8px; }
.me-stats{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
.me-stat{ background:var(--card); border:1px solid var(--rule); border-radius:14px; padding:14px; display:flex; flex-direction:column; gap:2px; }
.me-stat b{ font-family:var(--display); font-size:28px; line-height:1.1; font-variant-numeric:tabular-nums; }
.me-stat b span{ font-size:16px; color:var(--muted); font-weight:600; }
.me-stat small{ color:var(--muted); font-size:14px; }
.me-rows{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }
.me-row{ display:flex; align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--rule); }
.me-row:first-child{ border-top:0; }
.me-row-main{ display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; color:var(--ink); text-decoration:none; }
.me-row-main b{ font-weight:600; font-size:15px; line-height:1.35; }
.me-row-main small{ color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.me-status{ flex:0 0 auto; font-size:13px; font-weight:600; padding:4px 10px; border-radius:999px; background:var(--bg); border:1px solid var(--rule); color:var(--muted); }
.me-status.approved{ background:var(--good-bg); border-color:transparent; color:var(--good); }
.me-status.pending{ background:var(--warn-bg); border-color:transparent; color:var(--warn); }
.me-status.rejected{ background:var(--bad-bg); border-color:transparent; color:var(--bad); }
.me-score{ flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; }
.me-score b{ font-family:var(--display); font-size:22px; font-variant-numeric:tabular-nums; }
.me-score small{ color:var(--muted); font-size:12px; }
.me-lesson-head{ display:flex; gap:12px; align-items:center; color:var(--ink); text-decoration:none; }
.me-h3{ margin:6px 0 0; font-size:13px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.me-dl{ margin:0; display:flex; flex-direction:column; }
.me-kv{ display:flex; justify-content:space-between; gap:16px; padding:10px 0; border-top:1px solid var(--rule); }
.me-kv:first-child{ border-top:0; }
.me-kv dt{ color:var(--muted); font-size:14px; } .me-kv dd{ margin:0; text-align:right; font-weight:600; overflow-wrap:anywhere; min-width:0; }

/* ---- account menu at the top right (account.js) and the plan banner on My page ---- */
.toplinks{ align-items:center; }
.acc-menu-wrap{ position:relative; }
.av{ display:block; flex:0 0 auto; border-radius:50%; object-fit:cover; }
.av-letter{ display:flex; align-items:center; justify-content:center; background:var(--accent); color:var(--on-accent); font-weight:700; font-size:14px; }
.acc-menu-who .av-letter{ font-size:19px; }
.acc-btn{ display:flex; align-items:center; gap:6px; min-height:44px; padding:4px 8px 4px 4px; border:1px solid var(--rule); border-radius:999px; background:var(--card); color:var(--ink); font:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.acc-btn[aria-expanded="true"]{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-bg); }
.acc-btn-name{ max-width:7em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acc-caret{ width:12px; height:12px; color:var(--muted); }
.plan-pill{ display:inline-block; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:3px 8px; border-radius:999px; line-height:1.2; white-space:nowrap; }
.plan-pill.free{ background:var(--bg); border:1px solid var(--rule); color:var(--muted); }
.plan-pill.premium{ background:var(--good-bg); color:var(--good); }
.plan-pill.wait{ background:var(--gold); color:#1A1A2E; }
.acc-menu{ position:absolute; right:0; top:calc(100% + 8px); width:min(300px, calc(100vw - 32px)); z-index:20; background:var(--card); border:1px solid var(--rule); border-radius:16px; box-shadow:0 12px 32px rgba(26,26,46,.18); padding:8px; display:flex; flex-direction:column; }
.acc-menu[hidden]{ display:none; }
.acc-menu-who{ display:flex; gap:12px; align-items:center; padding:10px 8px 12px; }
.acc-menu-who div{ display:flex; flex-direction:column; min-width:0; }
.acc-menu-who b{ font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acc-menu-who small{ color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acc-menu-plan{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 6px; padding:12px; border-radius:12px; background:var(--accent-bg); color:var(--ink); text-decoration:none; }
.acc-menu-plan.premium{ background:var(--good-bg); }
.acc-menu-plan span:first-child{ display:flex; flex-direction:column; }
.acc-menu-plan b{ font-size:15px; } .acc-menu-plan small{ color:var(--muted); font-size:13px; }
.acc-menu-up{ font-size:13px; font-weight:700; color:var(--on-accent); background:var(--accent); padding:6px 10px; border-radius:999px; white-space:nowrap; }
.acc-menu-links{ display:flex; flex-direction:column; padding:4px 0; border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); }
.acc-menu-links a, .acc-menu-out{ display:flex; align-items:center; min-height:44px; padding:0 10px; border-radius:10px; color:var(--ink); text-decoration:none; font-size:15px; font-weight:500; }
.acc-menu-links a:hover, .acc-menu-links a:focus-visible, .acc-menu-out:hover, .acc-menu-out:focus-visible{ background:var(--accent-bg); outline:none; }
.acc-menu-out{ margin-top:4px; border:0; background:none; font:inherit; font-size:15px; font-weight:600; color:var(--bad); cursor:pointer; text-align:left; width:100%; }
@media (max-width:440px){ .acc-btn-name{ display:none; } }

.me section.me-banner{ display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:16px; border-radius:16px; background:var(--accent-bg); border:1px solid var(--rule); }
.me section.me-banner.premium{ background:var(--good-bg); border-color:color-mix(in srgb, var(--good) 35%, transparent); }
.me section.me-banner.waiting{ background:var(--warn-bg); border-color:color-mix(in srgb, var(--warn) 35%, transparent); }
.me-banner-text{ display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; flex:1 1 200px; }
.me-banner-text b{ font-size:17px; } .me-banner-text small{ color:var(--muted); font-size:14px; }
.me-banner-btn{ min-height:44px; flex:0 0 auto; }
details.me-lesson-card > summary{ list-style:none; cursor:pointer; }
details.me-lesson-card > summary::-webkit-details-marker{ display:none; }
.me-chev{ width:16px; height:16px; flex:0 0 auto; color:var(--muted); transition:transform .2s; }
details[open] > summary .me-chev{ transform:rotate(180deg); }
@media (prefers-reduced-motion: reduce){ .me-chev{ transition:none; } }
.me-open{ align-self:flex-start; min-height:44px; }
.me-signout{ color:var(--bad); }

/* ---- admin dashboard (#/admin) ---- */
.ad-count{ display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; margin-left:6px; border-radius:999px; background:var(--bad); color:#FFF; font-size:12px; font-weight:700; }
.ad-count[hidden], .ad-dot[hidden]{ display:none; }
.acc-btn{ position:relative; }
.ad-dot{ position:absolute; left:24px; top:4px; width:10px; height:10px; border-radius:50%; background:var(--bad); border:2px solid var(--card); }
.me-stat.ad-hot{ border-color:var(--bad); background:var(--bad-bg); } .me-stat.ad-hot b{ color:var(--bad); }
.ad-list{ background:var(--card); border:1px solid var(--rule); border-radius:16px; padding:0 14px; }
.ad-student{ display:flex; flex-direction:column; gap:10px; padding:12px 0; border-top:1px solid var(--rule); }
.ad-student:first-child{ border-top:0; }
.ad-student-top{ display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.ad-student .me-row-main{ gap:4px; }
.ad-student .me-row-main > span:first-child{ font-size:15px; overflow-wrap:anywhere; }
.ad-grant .acc-label{ display:flex; flex-direction:column; gap:6px; }
.ad-filter{ display:flex; gap:8px; flex-wrap:wrap; }
.ad .me-pay p{ margin:0; }
#ad-msg:empty{ display:none; }

/* ---- admin look (Decision 029): teal + dark top bar, so it never looks like the student app ---- */
:root.is-admin{
  --bg:#F3F6F8; --card:#FFFFFF; --ink:#0F172A; --muted:#526072; --rule:#DCE3EA;
  --accent:#0F766E; --accent-deep:#115E59; --accent-bg:#E3F2EF; --on-accent:#FFFFFF;
}
@media (prefers-color-scheme: dark){
  :root.is-admin:not([data-theme="light"]){
    --bg:#0B1220; --card:#131C2E; --ink:#E5EDF5; --muted:#93A3B8; --rule:#24314A;
    --accent:#2DD4BF; --accent-deep:#5EEAD4; --accent-bg:#0F2A2C; --on-accent:#0B1220;
  }
}
:root.is-admin[data-theme="dark"]{
  --bg:#0B1220; --card:#131C2E; --ink:#E5EDF5; --muted:#93A3B8; --rule:#24314A;
  --accent:#2DD4BF; --accent-deep:#5EEAD4; --accent-bg:#0F2A2C; --on-accent:#0B1220;
}
.is-admin body{ background:var(--bg); }
.is-admin .topbar{ background:#0F172A; border-bottom:3px solid #14B8A6; backdrop-filter:none; }
.is-admin .brand{ color:#F8FAFC; }
.brand-admin{ font-family:var(--body); font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:#0F172A; background:#5EEAD4; padding:3px 8px; border-radius:6px; margin-left:2px; }
.is-admin .toplink{ background:#1E293B; color:#E2E8F0; }
.is-admin .acc-btn{ background:#1E293B; border-color:#334155; color:#F8FAFC; }
.is-admin .acc-btn[aria-expanded="true"]{ border-color:#5EEAD4; box-shadow:0 0 0 3px rgba(94,234,212,.25); }
.is-admin .acc-caret{ color:#94A3B8; }
.is-admin .ad-dot{ border-color:#1E293B; }
.plan-pill.admin{ background:#5EEAD4; color:#0F172A; }
.acc-menu-plan.admin{ background:#0F172A; color:#F8FAFC; }
.acc-menu-plan.admin small{ color:#94A3B8; }
.is-admin .me-tabs a[aria-current="page"]{ color:var(--accent-deep); }
.is-admin .acc-btn .plan-pill.admin{ display:none; } /* the brand already says ADMIN; keeps the top bar on one phone line */
@media (max-width:380px){ .is-admin .brand svg{ display:none; } }

/* ---- admin Numbers tab (#/admin/numbers): one colour (the accent), numbers in text colour ---- */
.nb-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.nb-row{ display:grid; grid-template-columns:minmax(0, 9.5rem) minmax(0, 1fr) auto; gap:10px; align-items:center; font-size:14px; }
.nb-label{ overflow-wrap:anywhere; }
.nb-track{ height:12px; background:var(--accent-bg); border-radius:4px; overflow:hidden; }
.nb-bar{ display:block; height:100%; background:var(--accent); border-radius:0 4px 4px 0; }
.nb-num{ display:flex; flex-direction:column; align-items:flex-end; text-align:right; font-variant-numeric:tabular-nums; }
.nb-num small{ color:var(--muted); font-size:12px; max-width:11rem; }
.nb-days{ display:flex; align-items:flex-end; gap:2px; height:120px; padding:8px 0; border-bottom:1px solid var(--rule); }
.nb-day{ flex:1 1 0; height:100%; display:flex; align-items:flex-end; min-width:0; }
.nb-day:hover .nb-col{ background:var(--accent-deep); }
.nb-col{ display:block; width:100%; background:var(--accent); border-radius:4px 4px 0 0; }
.nb-axis{ display:flex; justify-content:space-between; color:var(--muted); font-size:12px; margin:4px 0 0; }
.nb-table summary{ cursor:pointer; color:var(--accent-deep); font-size:14px; margin-top:8px; }
.nb-table table{ width:100%; border-collapse:collapse; font-size:14px; font-variant-numeric:tabular-nums; margin-top:8px; }
.nb-table th, .nb-table td{ text-align:right; padding:6px 4px; border-bottom:1px solid var(--rule); }
.nb-table th:first-child, .nb-table td:first-child{ text-align:left; }
.nb-lesson{ display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.nb-lesson h3{ margin:0; font-size:16px; }
.nb-lesson .acc-note{ margin:0; }
@media (max-width:420px){
  .nb-row{ grid-template-columns:minmax(0, 1fr) auto; }
  .nb-track{ grid-column:1 / -1; grid-row:2; }
}
/* Bangla → English builder */
.br{ display:flex; flex-direction:column; gap:8px; padding:12px 0; border-top:1px solid var(--rule); }
.br-bn{ margin:0; font-size:17px; line-height:1.6; font-weight:600; }
.br-line{ display:flex; flex-wrap:wrap; gap:6px; min-height:52px; padding:6px; border:2px dashed var(--rule); border-radius:12px; align-items:center; }
.br-line .chip{ background:var(--accent-bg); border-color:var(--accent); }
.br-do{ display:flex; gap:8px; flex-wrap:wrap; }
.br .feedback{ white-space:pre-line; }
/* Left navigation on lesson pages: always open on wide screens, a drawer on phones */
.side{ position:fixed; z-index:20; top:0; bottom:0; left:0; width:min(300px,86vw); overflow-y:auto; background:var(--card); border-right:1px solid var(--rule);
  padding:12px 12px 32px; transform:translateX(-102%); transition:transform .22s ease; box-shadow:0 0 24px rgba(0,0,0,.18); }
.side.open{ transform:none; }
.side-dim{ position:fixed; inset:0; z-index:19; background:rgba(10,8,20,.45); }
.side-top{ display:flex; justify-content:space-between; align-items:center; padding:4px 4px 10px; border-bottom:1px solid var(--rule); margin-bottom:6px; }
.side-top a{ font-family:var(--display); font-weight:700; font-size:17px; color:var(--ink); text-decoration:none; }
.side-x{ font:inherit; font-size:18px; min-width:44px; min-height:44px; border:0; background:none; color:var(--muted); cursor:pointer; }
.side-unit summary{ cursor:pointer; padding:10px 6px; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.side ol{ list-style:none; margin:0; padding:0; }
.side-unit > ol > li > a, .side-soon{ display:block; padding:9px 10px; border-radius:8px; color:var(--ink); text-decoration:none; font-size:15px; }
.side-soon{ color:var(--muted); } .side-soon small{ font-size:11px; }
.side a:hover{ background:var(--accent-bg); }
.side a[aria-current="page"]{ background:var(--accent); color:var(--on-accent); }
.side-secs{ margin:2px 0 8px 10px !important; border-left:2px solid var(--rule); padding-left:6px !important; }
.side-secs a{ display:flex; gap:8px; align-items:center; padding:7px 8px; border-radius:8px; color:var(--ink); text-decoration:none; font-size:14px; min-height:40px; }
.side-secs .letter{ flex:0 0 auto; width:24px; height:24px; display:grid; place-items:center; font-size:12px; font-weight:700; border-radius:6px; background:var(--accent-bg); color:var(--accent-deep); }
.side-secs a[aria-current="page"] .letter{ background:var(--on-accent); color:var(--accent-deep); }
.side-open{ align-self:flex-start; font:inherit; font-size:14px; font-weight:700; color:var(--accent-deep); background:var(--card); border:1.5px solid var(--rule); border-radius:999px; padding:8px 14px; min-height:40px; cursor:pointer; }
@media (min-width:1000px){
  .with-side{ display:grid; grid-template-columns:280px minmax(0,1fr); align-items:start; }
  .side{ position:sticky; top:56px; height:calc(100vh - 56px); width:auto; transform:none; box-shadow:none; transition:none; z-index:1; }
  .side-x, .side-open, .side-dim{ display:none !important; }
}
@media (prefers-reduced-motion: reduce){ .side{ transition:none; } }
/* Lesson guide: what the lesson is about, and the path through its sections */
.ov{ background:var(--paper); border:1px solid var(--paper-rule); border-radius:16px; padding:16px; display:flex; flex-direction:column; gap:10px; }
.ov-kicker{ margin:0; font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.ov-hook{ margin:0; font-family:var(--display); font-size:22px; line-height:1.3; font-style:italic; color:var(--accent-deep); text-wrap:balance; }
.ov-about{ margin:0; font-family:var(--display); font-size:16px; line-height:1.6; }
.ov-bn{ margin:0; font-size:15px; line-height:1.6; padding:8px 10px; border-radius:10px; background:var(--card); border:1px dashed var(--paper-rule); }
.ov-goals ul{ margin:6px 0 0; padding:0; list-style:none; display:flex; flex-direction:column; gap:6px; }
.ov-goals li{ position:relative; padding-left:26px; font-size:15px; }
.ov-goals li::before{ content:"✓"; position:absolute; left:0; top:0; width:19px; height:19px; border-radius:50%; background:var(--good-bg); color:var(--good); font-size:12px; font-weight:700; display:grid; place-items:center; }
.path-head h2{ margin:0 0 2px; font-size:17px; }
.path-head .small{ margin:0; }
.path-bar{ height:8px; border-radius:99px; background:var(--rule); overflow:hidden; margin-top:8px; }
.path-bar span{ display:block; height:100%; background:var(--good); border-radius:99px; }
.ov-go{ text-align:center; }
.path{ position:relative; }
.path::before{ content:""; position:absolute; left:34px; top:24px; bottom:24px; border-left:2px dashed var(--rule); }
.path li{ position:relative; }
.path .sec-row{ align-items:flex-start; }
.path .letter{ position:relative; z-index:1; }
.path .you{ display:block; font-size:14px; line-height:1.45; margin:2px 0 3px; }
.path .been .letter{ background:var(--good-bg); color:var(--good); }
.path .next .sec-row{ border:2px solid var(--accent); }
/* Bar chart from the book (blocks.js, bars) */
.bars{ width:100%; height:auto; max-width:520px; }
.bars .bc-bar{ fill:var(--accent-deep); }
.bars .bc-grid{ stroke:var(--rule); stroke-width:1; }
.bars .bc-ax{ fill:var(--muted); font-size:11px; font-family:var(--body); }
.bars .bc-1{ fill:var(--accent); opacity:.55; }
.bars .bc-val{ fill:var(--ink, currentColor); font-size:10px; font-family:var(--body); }
.bc-key .bc-sw{ display:inline-block; width:12px; height:12px; border-radius:3px; background:var(--accent-deep); vertical-align:-1px; margin:0 4px 0 8px; }
.bc-key .bc-sw.bc-1{ background:var(--accent); opacity:.55; }
.bars .bc-ax{ font-size:10px; }
.choices.col{ grid-template-columns:1fr; } .choices.col .choice{ text-align:left; }

/* ---------- library (home page): all ten English for Today books ---------- */
.library{ max-width:1000px; margin:0 auto; }
.lib-hero{ display:flex; flex-direction:column; gap:14px; padding:32px 16px 8px; max-width:620px; }
.lib-hero h1{ margin:0; font-family:var(--display); font-size:clamp(32px, 8.5vw, 48px); line-height:1.08; }
.lib-hero h1 em{ color:var(--book); }
.lib-hero p{ margin:0; color:var(--muted); font-size:17px; line-height:1.55; }
.shelf{ list-style:none; margin:0; padding:20px 16px 64px; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:22px 16px; }
@media (min-width:640px){ .shelf{ grid-template-columns:repeat(3, minmax(0, 1fr)); } }
@media (min-width:900px){ .shelf{ grid-template-columns:repeat(5, minmax(0, 1fr)); } }
.book-card{ display:flex; flex-direction:column; gap:8px; color:var(--ink); text-decoration:none; }
.book-card img{ width:100%; height:auto; aspect-ratio:3/4; object-fit:cover; display:block; border-radius:4px 10px 10px 4px; background:var(--card);
  box-shadow:inset 6px 0 0 rgba(0,0,0,.12), 0 10px 24px rgba(26,26,46,.18); }
a.book-card img{ transition:transform .2s ease, box-shadow .2s ease; }
a.book-card:hover img, a.book-card:focus-visible img{ transform:translateY(-4px); box-shadow:0 16px 30px rgba(26,26,46,.26); }
.book-card.soon img{ filter:grayscale(.55) opacity(.7); }
.book-name{ font-weight:700; font-size:15px; }
.badge{ align-self:flex-start; font-size:12px; font-weight:700; padding:3px 10px; border-radius:999px; }
.badge-live{ background:#1F6B4A; color:#FFFFFF; }
.badge-soon{ background:var(--accent-bg); color:var(--muted); }
@media (prefers-reduced-motion: reduce){ a.book-card img{ transition:none; } }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .lib-hero h1 em{ color:#6FD08F; } }
:root[data-theme="dark"] .lib-hero h1 em{ color:#6FD08F; }
