/* পাঠশালা: a light, calm reading surface (dark when the student picks it); the board itself stays a dark slate. */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface2: #f0f2f5; --line: #e3e7ec; --line2: #d3d9e1;
  --ink: #172133; --soft: #3a475b; --muted: #5f6c7f; --dim: #8a95a5;
  --brand: #0d7c66; --brand-2: #0a6654; --brand-soft: #e3f3ee; --brand-ink: #ffffff;
  --accent: #f4b400; --accent-soft: #fff4d6; --accent-ink: #3d2c00;
  --done: #12a37f; --warn: #d6453d; --blue: #2f6fd6;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 22px rgba(16,24,40,.06);
  --shadow-lg: 0 18px 50px rgba(16,24,40,.14);
  --r: 16px; --ui: "Hind Siliguri", "Kohinoor Bangla", "Noto Sans Bengali", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --tabs: 62px;
  /* the player stays dark in both themes, like the board */
  --p-bg: #121a24; --p-bar: #18212d; --p-ink: #eef2f6; --p-muted: #9aa8b8; --p-line: rgba(255,255,255,.12); --chalk: #ffd166; --chalk-ink: #2a1f00;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c1117; --surface: #141b24; --surface2: #1a2330; --line: #222c39; --line2: #2d3949;
  --ink: #e8edf3; --soft: #c8d1dc; --muted: #95a2b3; --dim: #6c798b;
  --brand: #35c3a0; --brand-2: #4fd3b2; --brand-soft: rgba(53,195,160,.13); --brand-ink: #04211a;
  --accent: #ffcc4d; --accent-soft: rgba(255,204,77,.13); --accent-ink: #2a1f00;
  --done: #35c3a0; --warn: #ff7a72; --blue: #78aaff;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 26px rgba(0,0,0,.25); --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font: 400 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--tabs) + var(--safe-b)); }
body.in-lesson { padding-bottom: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
svg { display: block; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- frame ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 0 16px 8px; overflow-x: clip; }
.appbar { position: sticky; top: 0; z-index: 25; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; }
.appbar.scrolled { border-bottom-color: var(--line); }
.appbar-in { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand b { font-size: 19px; line-height: 1.1; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.topnav { display: none; gap: 2px; }
.topnav a { padding: 7px 13px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px; }
.topnav a:hover { color: var(--ink); background: var(--surface2); }
.topnav a.on { color: var(--brand); background: var(--brand-soft); }
.streak { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: #b06a00; font-weight: 700; font-size: 14px; }
:root[data-theme="dark"] .streak { color: var(--accent); }
.streak.cold { background: var(--surface2); color: var(--dim); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 12px; font-weight: 700; font-size: 16px; white-space: nowrap; transition: transform .12s, background .15s, box-shadow .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn.primary:hover { background: var(--brand-2); }
.btn.quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--line2); }
.btn.quiet:hover { background: var(--surface2); }
.btn.small { height: 38px; padding: 0 14px; font-size: 14.5px; border-radius: 10px; }

/* ---------- home ---------- */
.hero { position: relative; margin: 8px 0 0; padding: 26px 20px 22px; border-radius: 22px; overflow: hidden; color: #fff;
  background: radial-gradient(500px 260px at 100% 0%, rgba(255,209,102,.28), transparent 60%), linear-gradient(135deg, #0b6b58 0%, #0d7c66 45%, #145c8a 100%); box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; right: -10px; bottom: -14px; width: 230px; height: 150px; opacity: .16;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 230 150'><path d='M10 140h50v-40h50V60h50V20h60' fill='none' stroke='white' stroke-width='12' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right bottom / contain; }
.hero .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 13.5px; font-weight: 600; }
.hero h1 { margin: 12px 0 6px; font-size: clamp(27px, 6.4vw, 44px); line-height: 1.22; font-weight: 700; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: #ffd166; }
.hero p { margin: 0; max-width: 560px; color: rgba(255,255,255,.88); font-size: clamp(15.5px, 2vw, 18px); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.hero .btn.primary { background: #ffd166; color: #2a1f00; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.hero .btn.quiet { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.promises { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; color: rgba(255,255,255,.92); font-size: 14px; font-weight: 600; position: relative; z-index: 1; }
.promises span { display: inline-flex; align-items: center; gap: 6px; }
.promises .ic { width: 17px; height: 17px; stroke: #ffd166; stroke-width: 2.6; }
.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.numbers div { padding: 12px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; box-shadow: var(--shadow); }
.numbers b { display: block; font-size: 22px; line-height: 1.2; color: var(--brand); }
.numbers span { color: var(--muted); font-size: 13px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 30px 2px 12px; }
.section-head h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.section-head a, .section-head > span { color: var(--brand); font-size: 14.5px; font-weight: 600; white-space: nowrap; }

.resume { display: grid; grid-template-columns: 124px 1fr; gap: 14px; align-items: center; margin-top: 16px; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.resume .thumb { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #121a24; }
.resume .thumb img { width: 100%; height: 100%; object-fit: cover; }
.resume .thumb .pd { position: absolute; inset: 0; margin: auto; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.resume .thumb .pd svg { width: 16px; fill: var(--brand); margin-left: 3px; }
.resume small { color: var(--brand); font-weight: 700; font-size: 13px; }
.resume strong { display: block; font-size: 16.5px; line-height: 1.35; margin: 1px 0 2px; }
.resume .sub { color: var(--muted); font-size: 13.5px; }
.meter { height: 6px; border-radius: 6px; background: var(--surface2); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--done); }

.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 14px; background: var(--surface2); }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-width: 64px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 15px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button .soon { display: block; font-size: 10.5px; font-weight: 600; color: var(--dim); line-height: 1; }

.subjects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.subj { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.subj:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.subj .si { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--ink)); margin-bottom: 6px; }
.subj .si .ic { width: 24px; height: 24px; }
.subj b { font-size: 18px; }
.subj span { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.subj .go { position: absolute; right: 14px; top: 16px; color: var(--dim); }
.subj.soon { box-shadow: none; background: transparent; border-style: dashed; pointer-events: none; }
.subj.soon .si { filter: grayscale(1); opacity: .6; }
.empty { padding: 24px 18px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line2); border-radius: var(--r); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 2px; }

.lessons { display: grid; grid-template-columns: 1fr; gap: 14px; }
.lcard { display: flex; flex-direction: column; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.lcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.lcard .pic { position: relative; aspect-ratio: 16/9; background: #121a24; }
.lcard .pic img { width: 100%; height: 100%; object-fit: cover; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.lcard .len { position: absolute; right: 10px; bottom: 10px; background: rgba(10,14,20,.82); color: #fff; }
.lcard .off { position: absolute; right: 10px; top: 10px; background: var(--done); color: #fff; }
.lcard .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.lcard .prog i { display: block; height: 100%; background: var(--done); }
.lcard .txt { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lcard .txt b { font-size: 17px; line-height: 1.35; }
.lcard .txt p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcard .tag { align-self: flex-start; max-width: 100%; padding: 1px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 700; line-height: 1.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c, var(--brand)) 16%, var(--surface)); color: color-mix(in srgb, var(--c, var(--brand)) 55%, var(--ink)); }
/* a lesson as a row: the thumbnail beside the words (subject pages, "more" under a lesson) */
.row-card { flex-direction: row; align-items: stretch; }
.row-card .pic { flex: none; width: 136px; aspect-ratio: auto; min-height: 92px; }
.row-card .pic .len { right: 6px; bottom: 6px; font-size: 11.5px; padding: 1px 7px; }
.row-card .pic .off { right: 6px; top: 6px; font-size: 11.5px; padding: 1px 7px; }
.row-card .txt { padding: 10px 12px; gap: 3px; min-width: 0; }
.row-card .txt b { font-size: 15.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-card .meta { padding-top: 2px; font-size: 12.5px; gap: 2px 12px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--dim); font-size: 13px; margin-top: auto; padding-top: 6px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .ic { width: 15px; height: 15px; }
.meta .ok { color: var(--done); font-weight: 700; }

.steps { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stepc { display: flex; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.stepc .n { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.stepc b { display: block; font-size: 16px; }
.stepc span { color: var(--muted); font-size: 14.5px; }

/* subject page */
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14.5px; font-weight: 600; padding: 10px 0 2px; }
.subhead { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 20px; color: var(--ink); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 26%, var(--surface)), color-mix(in srgb, var(--c) 8%, var(--surface))); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); }
.subhead .si { flex: none; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); color: color-mix(in srgb, var(--c) 65%, var(--ink)); box-shadow: var(--shadow); }
.subhead .si .ic { width: 30px; height: 30px; }
.subhead p { color: var(--soft); font-size: 14.5px; }
.subhead small { color: var(--muted); font-weight: 600; }
.subhead h1 { margin: 0; font-size: 30px; line-height: 1.25; }
.subhead p { margin: 2px 0 0; }
.chap { margin-top: 26px; }
.chap-head { display: flex; align-items: center; gap: 12px; margin: 0 2px 12px; }
/* a chapter's badge: "অধ্যায়" small over its number */
.cbadge { flex: none; width: 54px; height: 54px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-weight: 700; font-size: 24px; line-height: 1;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: color-mix(in srgb, var(--c) 60%, var(--ink)); border: 1px solid color-mix(in srgb, var(--c) 32%, var(--line)); overflow: hidden; }
.cbadge small { font-size: 10.5px; font-weight: 700; opacity: .8; margin-bottom: 3px; max-width: 50px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbadge.icon .ic { width: 26px; height: 26px; }
.chrows { display: grid; grid-template-columns: 1fr; gap: 10px; }
.chrow { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.chrow:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.chrow .grow { flex: 1; min-width: 0; }
.chrow b { display: block; font-size: 16.5px; line-height: 1.35; }
.chrow small { color: var(--muted); font-size: 13.5px; }
.chrow > .ic { color: var(--dim); }
.chrow .meter { max-width: 220px; margin-top: 6px; }
.jump { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 14px -16px 0; padding: 0 16px; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line2); color: var(--soft); font-size: 14px; font-weight: 700; }
.sec { margin: 14px 2px 8px; font-size: 14.5px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chap-head b { display: block; font-size: 18px; line-height: 1.3; }
.chap-head small { color: var(--muted); font-size: 13.5px; }

/* search */
.searchbox { position: sticky; top: 56px; z-index: 5; padding: 12px 0 8px; background: linear-gradient(180deg, var(--bg) 75%, transparent); }
.searchbox label { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 52px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line2); box-shadow: var(--shadow); }
.searchbox label:focus-within { border-color: var(--brand); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 500 17px var(--ui); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.suggest button { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line2); color: var(--soft); font-size: 14px; font-weight: 600; }
.hits { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.hit { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.hit .hk { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: #a86400; }
.hit.les .hk { background: var(--brand-soft); color: var(--brand); }
.hit b { display: block; font-size: 15.5px; line-height: 1.35; }
.hit small { color: var(--muted); font-size: 13px; }
.hit mark { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0 2px; }

/* my learning */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 24px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.fire b { color: #e08600; } .stat.done b { color: var(--done); } .stat.time b { color: var(--blue); }
.week { display: flex; justify-content: space-between; gap: 6px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.week div { flex: 1; text-align: center; font-size: 12px; color: var(--dim); }
.week i { display: block; width: 28px; height: 28px; margin: 0 auto 4px; border-radius: 8px; background: var(--surface2); }
.week .on i { background: linear-gradient(135deg, #ffb347, #ffd166); }
.week .today { color: var(--ink); font-weight: 700; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row b { display: block; font-size: 15.5px; line-height: 1.35; }
.row small { color: var(--muted); font-size: 13px; }
.row .act { flex: none; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line2); color: var(--soft); font-size: 13.5px; font-weight: 700; }
.row .act.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.switch { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line2); transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.themes { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface2); }
.themes button { padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.themes button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.install { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px; border-radius: var(--r); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.install .ic { color: var(--brand); width: 28px; height: 28px; }
.install b { display: block; } .install small { color: var(--muted); }
.install .btn { margin-left: auto; }

/* about */
.prose { max-width: 720px; }
.prose h1 { font-size: 30px; line-height: 1.25; margin: 14px 0 6px; }
.prose h2 { font-size: 20px; margin: 26px 0 6px; }
.prose p, .prose li { color: var(--soft); font-size: 16.5px; }
.prose ul { padding-left: 20px; }

.foot { margin-top: 36px; border-top: 1px solid var(--line); }
.foot-in { max-width: 1160px; margin: 0 auto; padding: 22px 16px 18px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; }
.foot-in b { color: var(--ink); }
.foot-in nav { display: flex; gap: 16px; }
.foot-in a { color: var(--brand); font-weight: 600; }

/* bottom tabs (phones) */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--tabs) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dim); font-size: 12.5px; font-weight: 700; }
.tabs .ic { width: 23px; height: 23px; }
.tabs a.on { color: var(--brand); }
body.in-lesson .tabs { display: none; }

/* the sheet (a question before something big, like saving 30 MB) */
.sheet { position: fixed; inset: 0; z-index: 80; display: grid; align-items: end; justify-items: center; background: rgba(10,14,20,.45); animation: fade .15s ease; }
.sheet-in { width: min(520px, 100%); padding: 20px 20px calc(20px + var(--safe-b)); border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: var(--shadow-lg); animation: up .2s ease; }
.sheet-in h3 { margin: 0 0 6px; font-size: 19px; }
.sheet-in p { margin: 0 0 6px; color: var(--soft); }
.sheet-in ul { margin: 6px 0 14px; padding-left: 20px; color: var(--soft); }
.sheet-acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 640px) { .sheet { align-items: center; } .sheet-in { border-radius: 22px; } }

/* ---------- the lesson ---------- */
.lesson { max-width: 1440px; margin: 0 auto; }
.lesson-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.back { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); }
.back:hover { background: var(--surface2); }
.back .ic { width: 24px; height: 24px; stroke-width: 2.4; }
.lesson-name { flex: 1; min-width: 0; }
.lesson-name small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-name strong { display: block; font-size: 16px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); color: var(--soft); font-size: 13.5px; font-weight: 700; white-space: nowrap; background: var(--surface); }
.save .ic { width: 18px; height: 18px; }
.tool { flex: none; width: 38px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--soft); }
.tool:hover { background: var(--surface2); }
.save.saved { color: var(--done); border-color: color-mix(in srgb, var(--done) 40%, transparent); background: color-mix(in srgb, var(--done) 8%, var(--surface)); }
.save.busy { color: var(--brand); }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; padding: 18px 22px 28px; align-items: start; }
.player { background: var(--p-bg); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-lg); color: var(--p-ink); }
.screen { position: relative; aspect-ratio: 16 / 9; background: #111; overflow: hidden; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,12,18,.55); cursor: pointer; }
.veil.start { background: rgba(8,12,18,.3); }
.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.42) saturate(.9) blur(1px); transform: scale(1.02); }
.poster:not([src]), .poster[src=""], .veil:not(.start) .poster { display: none; }
.veil-body { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 16px; color: #fff; }
.big-play { width: clamp(62px, 9vw, 86px); height: clamp(62px, 9vw, 86px); border-radius: 50%; background: var(--chalk); display: grid; place-items: center; box-shadow: 0 10px 40px rgba(255,209,102,.45), 0 0 0 8px rgba(255,209,102,.15); transition: transform .15s; }
.big-play:hover { transform: scale(1.06); }
.big-play svg { width: 46%; height: 46%; fill: var(--chalk-ink); margin-left: 6%; }
.veil-text { font-weight: 700; font-size: clamp(15px, 2vw, 19px); padding: 3px 16px; border-radius: 999px; background: rgba(5,8,12,.6); }
.ghost, .solid { padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.ghost { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24); color: #fff; backdrop-filter: blur(6px); }
.solid { background: var(--chalk); color: var(--chalk-ink); }
.veil:not([hidden]) ~ .spinner { display: none; }
.spinner { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,12,18,.2); pointer-events: none; }
.spinner span { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--chalk); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, 90%); padding: 16px 18px; border-radius: 18px; text-align: center; color: #fff; background: rgba(18,26,37,.96); border: 1px solid var(--p-line); box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .22s ease; }
@keyframes pop { from { transform: translate(-50%, -46%) scale(.96); opacity: 0; } }
.card-tick { width: 40px; height: 40px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: rgba(53,195,160,.18); color: #4fd3b2; font-size: 21px; font-weight: 700; }
.card-title { font-weight: 700; font-size: 17px; line-height: 1.35; }
.card p { margin: 4px 0 12px; color: var(--p-muted); font-size: 14.5px; }
.card-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.toast { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 5px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: #fff; background: rgba(5,8,12,.85); border: 1px solid var(--p-line); white-space: nowrap; pointer-events: none; animation: drop .2s ease; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -6px); } }

.bar { padding: 6px 12px 8px; background: var(--p-bar); }
.seek { position: relative; padding: 10px 0; cursor: pointer; touch-action: none; }
.track { position: relative; height: 6px; border-radius: 6px; background: rgba(255,255,255,.14); transition: height .15s; }
.seek:hover .track, .seek.drag .track { height: 9px; }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ffbf3c, var(--chalk)); }
.ticks i { position: absolute; top: 50%; width: 2px; height: 12px; margin-left: -1px; transform: translateY(-50%); border-radius: 2px; background: rgba(255,255,255,.5); }
.ticks i.done { background: #4fd3b2; }
.knob { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin-left: -8px; transform: translateY(-50%) scale(.85); border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); transition: transform .15s; }
.seek:hover .knob, .seek.drag .knob { transform: translateY(-50%) scale(1); }
.tip { position: absolute; bottom: 30px; transform: translateX(-50%); max-width: 80vw; overflow: hidden; text-overflow: ellipsis; padding: 5px 10px; border-radius: 8px; white-space: nowrap; font-size: 13px; font-weight: 700; color: #fff; background: #05080c; border: 1px solid var(--p-line); pointer-events: none; }
.tip b { color: var(--chalk); margin-left: 6px; }
.controls { display: flex; align-items: center; gap: 2px; min-width: 0; }
.grow { flex: 1; }
.icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--p-ink); }
.icon:hover { background: rgba(255,255,255,.08); }
.icon svg { width: 26px; height: 26px; fill: currentColor; }
.icon text { font: 700 7px var(--ui); fill: currentColor; }
.icon.play { width: 48px; height: 48px; border-radius: 50%; background: var(--chalk); color: var(--chalk-ink); margin: 0 2px; }
.icon.play svg { width: 24px; height: 24px; }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.time { margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--p-muted); font-size: 14.5px; white-space: nowrap; }
.pill { flex: none; height: 34px; padding: 0 12px; margin-left: 4px; border-radius: 999px; border: 1px solid var(--p-line); font-size: 14px; font-weight: 700; color: var(--p-muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; }
.pill[aria-pressed="true"] { color: #4fd3b2; border-color: rgba(79,211,178,.5); background: rgba(79,211,178,.1); }
.pill[aria-pressed="true"] .dot { background: #4fd3b2; border-color: #4fd3b2; }
.pill.speed { min-width: 50px; justify-content: center; }

.now { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.now-label { flex: 1; min-width: 0; text-align: center; }
.now-label small { display: block; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-label strong { display: block; font-size: clamp(16px, 2vw, 19px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 14px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); font-weight: 700; color: var(--soft); }
.step .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.step.next { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.step:disabled { opacity: .4; cursor: default; }
.step em { font-style: normal; }

.outline { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.outline-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.outline-head h2 { margin: 0; font-size: 17px; }
.outline-head span { color: var(--muted); font-size: 13px; }
.mini-ring { position: relative; width: 46px; height: 46px; flex: none; }
.mini-ring svg { width: 46px; height: 46px; transform: rotate(-90deg); }
.mini-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; }
.ring-bg, .ring-fg { fill: none; stroke-width: 4; }
.ring-bg { stroke: var(--surface2); }
.ring-fg { stroke: var(--done); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 97.4; transition: stroke-dashoffset .6s ease; }
.groups { list-style: none; margin: 0; padding: 8px 8px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.groups > li + li { margin-top: 4px; }
.orow, .ghead { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; text-align: left; position: relative; }
.orow:hover, .ghead:hover { background: var(--surface2); }
.obadge { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface2); color: var(--muted); }
.obadge .ic { width: 18px; height: 18px; }
.otext { flex: 1; min-width: 0; }
.otext b { display: block; font-size: 15.5px; line-height: 1.35; font-weight: 700; }
.otext small { display: block; color: var(--muted); font-size: 12.5px; }
.otm { flex: none; color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.gbar { height: 4px; border-radius: 4px; background: var(--surface2); margin-top: 5px; overflow: hidden; max-width: 160px; }
.gbar i { display: block; height: 100%; background: var(--done); }
.chev { flex: none; color: var(--dim); transition: transform .2s; }
.og.open .chev { transform: rotate(180deg); }
.og.current > .ghead .obadge, .og.current > .orow .obadge { background: var(--brand); color: var(--brand-ink); }
.og.alldone > .ghead .obadge, .og.alldone > .orow .obadge { background: color-mix(in srgb, var(--done) 15%, var(--surface)); color: var(--done); }
.items { list-style: none; margin: 2px 0 6px 26px; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: none; }
.og.open .items { display: block; }
.prob { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: left; font-size: 15px; color: var(--soft); position: relative; }
.prob:hover { background: var(--surface2); color: var(--ink); }
.prob .st { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; font-size: 11px; color: transparent; }
.prob.done .st { background: var(--done); border-color: var(--done); color: #fff; font-weight: 700; }
.prob .lb { flex: 1; min-width: 0; font-weight: 600; }
.prob .tm { flex: none; color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.prob.current { background: var(--brand-soft); color: var(--ink); }
.prob.current::before { content: ""; position: absolute; left: -17px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand); }
.prob.current .st { border-color: var(--brand); background: transparent; font-size: 0; }
.prob.current .st::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
.orow.current { background: var(--brand-soft); }
@keyframes pulse { 50% { transform: scale(.55); opacity: .5; } }

.player.full, .player:fullscreen { position: fixed; inset: 0; z-index: 60; border-radius: 0; display: flex; flex-direction: column; justify-content: center; background: #000; }
.player.full .screen, .player:fullscreen .screen { width: min(100vw, calc((100vh - 92px) * 16 / 9)); margin: 0 auto; }
.player.full .bar, .player:fullscreen .bar { width: min(100vw, 1200px); margin: 0 auto; background: transparent; }
body.lock { overflow: hidden; }

/* the teacher's words, written out, following the lesson */
.said { margin-top: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.said summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.said summary::-webkit-details-marker { display: none; }
.said summary > .ic:first-child { color: var(--brand); width: 22px; height: 22px; }
.said summary span { flex: 1; } .said summary b { display: block; font-size: 15.5px; } .said summary small { color: var(--muted); font-size: 13px; }
.said[open] .chev { transform: rotate(180deg); }
.said-body { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.said-body p { margin: 0; padding: 8px 10px; border-radius: 10px; color: var(--soft); font-size: 16px; line-height: 1.7; cursor: pointer; transition: background .2s; }
.said-body p:hover { background: var(--surface2); }
.said-body p.on { background: var(--brand-soft); color: var(--ink); }
.said-body .tm { display: block; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.said-body .said-none { color: var(--muted); cursor: default; }
.more { grid-column: 1; }
.more:empty { display: none; }
.more h2 { font-size: 17px; margin: 6px 2px 10px; }

/* about: what we promise, the questions people ask */
.promise-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0 4px; }
.promise-grid div { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.promise-grid .ic { color: var(--brand); width: 24px; height: 24px; margin-bottom: 6px; }
.promise-grid b { display: block; font-size: 15.5px; } .promise-grid span { color: var(--muted); font-size: 13.5px; }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; font-weight: 700; font-size: 16px; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] .chev { transform: rotate(180deg); }
.faq details p { margin: 0; padding: 0 16px 14px; }

/* the page as the build writes it (for search engines), seen only until the app draws the page */
.seo { max-width: 760px; padding: 18px 0; color: var(--soft); }
.seo h1 { font-size: 26px; line-height: 1.3; color: var(--ink); }
.seo a { color: var(--brand); font-weight: 600; }
.seo small, .seo .crumbs, .seo .eyebrow { color: var(--muted); font-size: 14px; }

/* ---------- sizes ---------- */
@media (max-width: 719px) {
  /* every lesson of the class, sideways */
  .lessons.rail { grid-auto-flow: column; grid-auto-columns: 82%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 10px; }
  .lessons.rail::-webkit-scrollbar { display: none; }
  .lessons.rail > * { scroll-snap-align: start; }
}
@media (min-width: 720px) {
  .subjects { grid-template-columns: repeat(4, 1fr); }
  .lessons { grid-template-columns: repeat(2, 1fr); }
  .chrows { grid-template-columns: repeat(2, 1fr); }
  .promise-grid { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .resume { grid-template-columns: 210px 1fr; padding: 14px; }
  .resume strong { font-size: 19px; }
  .hero { padding: 40px 36px 32px; }
  .numbers { max-width: 560px; }
}
@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .tabs { display: none; }
  .topnav { display: flex; }
  .lessons { grid-template-columns: repeat(3, 1fr); }
  .lessons.rows2 { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 0 24px 8px; }
  .appbar-in { padding: 12px 24px; }
}
@media (max-width: 999px) {
  .lesson { overflow-x: clip; }
  .lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 0 24px; }
  .lesson-grid > *, .now, .player, .outline { min-width: 0; }
  .lesson-main { display: contents; }
  .player { position: sticky; top: 0; z-index: 20; border-radius: 0; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
  .now { margin: 0 12px; }
  .outline { position: static; max-height: none; margin: 0 12px; }
  .said { margin: 0 12px; }
  .more { margin: 6px 12px 0; }
  .lesson .lessons.rows2 { grid-template-columns: minmax(0, 1fr); }
  .groups { overflow: visible; }
}
@media (max-width: 560px) {
  .bar { padding: 2px 6px 4px; }
  .seek { padding: 9px 0; }
  .icon { width: 38px; height: 38px; }
  .icon svg { width: 23px; height: 23px; }
  .icon.play { width: 42px; height: 42px; }
  .time { font-size: 13px; margin-left: 2px; }
  .pill { height: 30px; padding: 0 9px; font-size: 13px; }
  .pill .long { display: none; }
  .step em.prev-t { display: none; }
  .save .long { display: none; }
  .lesson-top { padding: 6px 8px; }
  .brand small { display: none; }
}
@media (max-width: 400px) { #fwd10 { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
