/* ===== Dhap design tokens (docs/design/DECISION.md, direction A "সিঁড়ি") =====
 * Every theme sets the same role tokens. Roles: blue = primary (buttons, done steps, progress),
 * gold = current step / one CTA per screen / streak number / today, green ONLY for "correct".
 * AMOLED Black (default) = DECISION.md values; Light, Violet Night (dark), Forest and Auto follow the same roles. */
:root {
  /* scales (same in every theme) */
  --fs-title: 21px; --fs-card-title: 18px; --fs-body: 15px; --fs-small: 13px; --fs-xs: 12px; --fs-tab: 11px; --fs-tile: 17px; --fs-wordmark: 44px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --r-card: 18px; --r-card-lg: 20px; --r-btn: 14px; --r-tile: 14px; --r-field: 12px; --r-chip: 999px; --r-badge: 6px; --r-cal: 7px; --r-sheet: 24px;
  --elevation: none; /* no drop shadows: separation by surface colour + 1px border */
  --font-bn: 'Noto Sans Bengali', system-ui, sans-serif;
  --font-en: 'Lexend', system-ui, sans-serif;

  /* Light (also Auto on a light phone) */
  color-scheme: light;
  --bg: #F4F5FA; --surface: #FFFFFF; --surface-2: #ECEEF4; --field: #F8F9FC; --border: #DDE0EA; --field-border: #CDD1DE; --divider: #E8EAF0;
  --pin-border: #C4C9D8; --sheet-border: #DDE0EA; --tab-border: #E3E5EC; --seg-bg: #ECEEF4; --seg-on: #FFFFFF;
  --ink: #12141C; --ink-strong: #0A0B10; --ink-soft: #50566B; --ink-faint: #6A7086;
  --primary: #3047D9; --primary-ink: #FFFFFF; --primary-text: #2B40C8; --primary-soft: #E6EAFE;
  --gold: #F5B83D; --gold-ink: #1b1400; --gold-text: #8A5A00; --gold-soft: #FDF1D8;
  --danger: #C62828; --danger-text: #B71C1C; --danger-soft: #FDE7E7; --banned-bg: #FDE2E4; --banned-ink: #A3121E;
  --correct: #0F7A4A; --correct-text: #0B6B40; --correct-bg: #E3F6EC;
  --cal-0: #ECEEF4; --cal-1: #D3DCFD; --cal-2: #8C9EF7; --cal-3: #3047D9; --cal-future: #F7F8FB;
  --cal-ink: #12141C; --cal-ink-3: #FFFFFF; --cal-future-ink: #B4B8C7; --today: #A87200;
  --focus: #3047D9; --scrim: rgba(10, 12, 20, .5);
  /* one hue per stage (1–9) */
  --s1: #7c3aed; --s2: #2563eb; --s3: #a21caf; --s4: #be123c; --s5: #c2410c; --s6: #15803d; --s7: #0e7490; --s8: #a16207; --s9: #4338ca;

  /* older names the stage screens use, mapped onto the roles above (resolved per theme) */
  --line: var(--border); --brand: var(--primary); --brand-ink: var(--primary-ink); --brand-soft: var(--primary-soft); --brand-text: var(--primary-text);
  --accent: var(--gold-text); --accent-fill: var(--gold); --good: var(--correct); --good-soft: var(--correct-bg);
  --bad: var(--danger); --bad-soft: var(--danger-soft); --warn-soft: var(--gold-soft); --lock: var(--ink-soft);
  --topbar-bg: var(--bg); --topbar-ink: var(--ink);
  --radius: var(--r-card); --shadow: var(--elevation);
}
/* Violet Night: Auto on a dark phone uses it too (same values as :root[data-theme="dark"] below) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #12131A; --surface: #1A1C26; --surface-2: #232634; --field: #161821; --border: #2F3245; --field-border: #363A4F; --divider: #252836;
    --pin-border: #3B4057; --sheet-border: #363A4F; --tab-border: #262938; --seg-bg: #161821; --seg-on: #2C3044;
    --ink: #ECEEF6; --ink-strong: #FFFFFF; --ink-soft: #A5AAC0; --ink-faint: #7A8099;
    --primary: #3D5BF5; --primary-ink: #FFFFFF; --primary-text: #A3B3FF; --primary-soft: #232C5A;
    --gold: #F5B83D; --gold-ink: #1b1400; --gold-text: #F5B83D; --gold-soft: #3A3020;
    --danger: #F06A6A; --danger-text: #ff8a8a; --danger-soft: #3B1F1C; --banned-bg: #3a1418; --banned-ink: #ff9aa2;
    --correct: #36C98B; --correct-text: #5fe3a8; --correct-bg: #10291F;
    --cal-0: #222533; --cal-1: #1F2C55; --cal-2: #2B42A3; --cal-3: #3D5BF5; --cal-future: #15161E;
    --cal-ink: #eef0f7; --cal-ink-3: #eef0f7; --cal-future-ink: #4A4E5E; --today: #F5B83D;
    --focus: #F5B83D; --scrim: rgba(0, 0, 0, .6);
    --s1: #a78bfa; --s2: #60a5fa; --s3: #e879f9; --s4: #fb7185; --s5: #fb923c; --s6: #4ade80; --s7: #22d3ee; --s8: #facc15; --s9: #818cf8;
  }
}
:root[data-theme="dark"] {
  --bg: #12131A; --surface: #1A1C26; --surface-2: #232634; --field: #161821; --border: #2F3245; --field-border: #363A4F; --divider: #252836;
  --pin-border: #3B4057; --sheet-border: #363A4F; --tab-border: #262938; --seg-bg: #161821; --seg-on: #2C3044;
  --ink: #ECEEF6; --ink-strong: #FFFFFF; --ink-soft: #A5AAC0; --ink-faint: #7A8099;
  --primary: #3D5BF5; --primary-ink: #FFFFFF; --primary-text: #A3B3FF; --primary-soft: #232C5A;
  --gold: #F5B83D; --gold-ink: #1b1400; --gold-text: #F5B83D; --gold-soft: #3A3020;
  --danger: #F06A6A; --danger-text: #ff8a8a; --danger-soft: #3B1F1C; --banned-bg: #3a1418; --banned-ink: #ff9aa2;
  --correct: #36C98B; --correct-text: #5fe3a8; --correct-bg: #10291F;
  --cal-0: #222533; --cal-1: #1F2C55; --cal-2: #2B42A3; --cal-3: #3D5BF5; --cal-future: #15161E;
  --cal-ink: #eef0f7; --cal-ink-3: #eef0f7; --cal-future-ink: #4A4E5E; --today: #F5B83D;
  --focus: #F5B83D; --scrim: rgba(0, 0, 0, .6);
  --s1: #a78bfa; --s2: #60a5fa; --s3: #e879f9; --s4: #fb7185; --s5: #fb923c; --s6: #4ade80; --s7: #22d3ee; --s8: #facc15; --s9: #818cf8;
}
/* AMOLED Black (default, Captain): DECISION.md values; true black saves battery */
:root[data-theme="amoled"] {
  --bg: #000000; --surface: #0E1018; --surface-2: #1A1D27; --field: #11131a; --border: #23262f; --field-border: #262a36; --divider: #191c25;
  --pin-border: #2b3040; --sheet-border: #2a2e3b; --tab-border: #1d2029; --seg-bg: #11131a; --seg-on: #1F2333;
  --ink: #EEF0F7; --ink-strong: #FFFFFF; --ink-soft: #9AA0B4; --ink-faint: #6b7188;
  --primary: #3D5BF5; --primary-ink: #FFFFFF; --primary-text: #9db0ff; --primary-soft: #16233f;
  --gold: #F5B83D; --gold-ink: #1b1400; --gold-text: #F5B83D; --gold-soft: #2a2212;
  --danger: #F06A6A; --danger-text: #ff8a8a; --danger-soft: #2a1214; --banned-bg: #3a1418; --banned-ink: #ff9aa2;
  --correct: #36C98B; --correct-text: #5fe3a8; --correct-bg: #0b2219;
  --cal-0: #12141c; --cal-1: #16233f; --cal-2: #22388f; --cal-3: #3D5BF5; --cal-future: #08090d;
  --cal-ink: #eef0f7; --cal-ink-3: #eef0f7; --cal-future-ink: #3a3e4c; --today: #F5B83D;
  --focus: #F5B83D; --scrim: rgba(0, 0, 0, .72);
  --s1: #a78bfa; --s2: #60a5fa; --s3: #e879f9; --s4: #fb7185; --s5: #fb923c; --s6: #4ade80; --s7: #22d3ee; --s8: #facc15; --s9: #818cf8;
}
/* Forest: deep green-black backdrop; primary stays blue (green is only for "correct") */
:root[data-theme="forest"] {
  --bg: #0E1915; --surface: #14231E; --surface-2: #1C2F28; --field: #11201B; --border: #29403A; --field-border: #2F4A42; --divider: #1F332C;
  --pin-border: #365449; --sheet-border: #2F4A42; --tab-border: #1F332C; --seg-bg: #11201B; --seg-on: #24392F;
  --ink: #E6F1EC; --ink-strong: #FFFFFF; --ink-soft: #9FB6AC; --ink-faint: #74897F;
  --primary: #3D5BF5; --primary-ink: #FFFFFF; --primary-text: #A9B8FF; --primary-soft: #1C2A4F;
  --gold: #F5B83D; --gold-ink: #1b1400; --gold-text: #F5B83D; --gold-soft: #33301C;
  --danger: #F06A6A; --danger-text: #ff8a8a; --danger-soft: #3A1C20; --banned-bg: #3a1418; --banned-ink: #ff9aa2;
  --correct: #36C98B; --correct-text: #6EE7B0; --correct-bg: #0B2A1D;
  --cal-0: #1A2C26; --cal-1: #1A2A45; --cal-2: #26409A; --cal-3: #3D5BF5; --cal-future: #0F1A16;
  --cal-ink: #eef0f7; --cal-ink-3: #eef0f7; --cal-future-ink: #3F5249; --today: #F5B83D;
  --focus: #F5B83D; --scrim: rgba(0, 0, 0, .65);
  --s1: #c4b5fd; --s2: #7dd3fc; --s3: #f0abfc; --s4: #fda4af; --s5: #fdba74; --s6: #86efac; --s7: #5eead4; --s8: #fde047; --s9: #a5b4fc;
}
:root[data-theme="dark"], :root[data-theme="amoled"], :root[data-theme="forest"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-bn); font-size: 17px; line-height: 1.6;
}
button, input, select { font: inherit; color: inherit; }
/* dropdowns (grammar reasons, matching B/C): one look on every phone — Android shows a bare native box otherwise */
select {
  -webkit-appearance: none; appearance: none;
  min-height: 44px; padding: 8px 34px 8px 12px; border-radius: var(--r-field);
  border: 1px solid var(--field-border); background-color: var(--field); color: var(--ink);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  cursor: pointer; font-size: 16px; line-height: 1.3;
}
select:hover:not(:disabled) { border-color: var(--brand); }
select:disabled { opacity: .7; cursor: default; }
select option { background-color: var(--surface); color: var(--ink); }
select.is-right { border-color: var(--good); background-color: var(--good-soft); }
select.is-wrong { border-color: var(--bad); background-color: var(--bad-soft); }
a { color: var(--brand-text); }


.wrap { max-width: 760px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px 64px; }

h1, h2, h3 { line-height: 1.3; margin: 0 0 8px; }
h1 { font-size: var(--fs-title); font-weight: 700; color: var(--ink-strong); }
h2 { font-size: var(--fs-card-title); font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
.en { font-family: var(--font-en); }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: none; padding: 16px;
}
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }

/* buttons */
.btn {
  appearance: none; border: 1px solid transparent; background: var(--surface-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-bn);
  padding: 10px 16px; border-radius: var(--r-btn); cursor: pointer; font-weight: 600; min-height: 48px;
  transition: transform .08s ease, background .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn[hidden] { display: none; } /* display:inline-flex above would show a hidden button */
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.07); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 700; } /* one per screen */
.btn-gold:hover { filter: brightness(1.05); }
.btn-warn { color: var(--gold-text); }
.btn-danger { color: var(--danger-text); }
.btn-block { display: flex; width: 100%; min-height: 50px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { filter: none; color: var(--ink); }
.btn-sm { padding: 6px 12px; min-height: 44px; min-width: 44px; font-size: 15px; }
.btn:focus-visible, .opt:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

/* home */
.hero { margin-bottom: 18px; }
.hero .kicker { color: var(--ink-soft); font-weight: 600; font-size: var(--fs-small); }
.hero > .page-title { margin-bottom: 2px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s ease; }
.stages { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
/* a stage / paragraph row: number square like a staircase step — done = blue ✓, current = gold, ahead = dark */
.stage {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: transform .12s ease, border-color .15s ease;
}
.stage:hover { border-color: var(--primary); }
.stage:active { transform: scale(.985); }
.stage-num {
  width: 44px; height: 44px; border-radius: var(--r-field); display: grid; place-items: center; font-family: var(--font-en); font-weight: 600; font-size: 17px;
  background: var(--surface-2); color: var(--ink-soft);
}
.stage.is-done .stage-num { background: var(--primary); color: var(--primary-ink); }
.stage.is-current { border-color: var(--gold); }
.stage.is-current .stage-num { background: var(--gold); color: var(--gold-ink); }
.stage.is-locked { opacity: .6; pointer-events: none; }
.stage.is-locked .stage-num { color: var(--lock); }
.stage-title { font-weight: 600; }
.stage-desc { color: var(--ink-soft); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-small); font-weight: 600; padding: 3px 10px; border-radius: var(--r-chip); background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; }
/* "done" is blue (green is only for a correct answer) */
.badge-good { background: var(--primary-soft); color: var(--primary-text); }
.badge-now { background: var(--surface-2); color: var(--ink); }
.badge-seen { background: var(--warn-soft); color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags-end { justify-content: flex-end; }
.install { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; margin-top: 14px; }
.install-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-field);
  background: var(--surface-2); color: var(--primary-text); }
/* auth screens (js/screens-auth.js): login, sign-up, reset-only, banned */
.auth { max-width: 420px; margin: 0 auto; padding: 28px 0 24px; }
.auth .stair { margin: 0 0 14px; }
.auth .page-title { margin-top: 4px; }
.auth-title { margin-top: 22px; }
.auth-form .btn-block { margin-top: 20px; gap: 8px; }
.auth-link { text-align: center; margin-top: 14px; font-size: var(--fs-small); color: var(--ink-soft); }
.auth-link a { color: var(--ink-strong); font-weight: 600; text-decoration: none; display: inline-block; padding: 12px 2px; }
.auth-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-bottom: 4px; font-size: var(--fs-small); color: var(--ink-soft); text-decoration: none; }
.auth-card { margin-top: 26px; padding: 22px 18px; text-align: center; }
.auth-badge { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--banned-bg); color: var(--banned-ink); }
.auth-msg { margin: 0 0 18px; font-size: var(--fs-body); line-height: 1.6; }
.wordmark-sm { font-size: 28px; }
.wordmark-sm > i { width: 7px; height: 7px; transform: translateY(-4px); }
.form-error { text-align: center; margin-top: 10px; }
.field-box { position: relative; }
.field-box > .field { padding-right: 48px; }
.field-eye { position: absolute; top: 1px; right: 1px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-field); background: none; color: var(--ink-soft); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.field-eye[aria-pressed="true"] { color: var(--primary-text); }
textarea.field { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; font-size: 14px; line-height: 1.4; word-break: break-all; }
.spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
.import-card { margin-top: 14px; }
.import-card .field-label { margin-top: 4px; }
.import-ok { font-size: var(--fs-small); color: var(--primary-text); font-weight: 600; }
.import-ok:empty { display: none; }
.main .import-card { width: 100%; text-align: left; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 520px) { .install { grid-template-columns: 40px 1fr; } .install .btn { grid-column: 1 / -1; } }
/* main page (dhap-direction.html option A): hello, streak chip, current paragraph card, total line */
.main { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 0 24px; }
.main-hello { margin: 0; }
.streak-line { margin-top: 8px; font-size: var(--fs-small); color: var(--ink); }
.main > .card { width: 100%; margin-top: 22px; }
.main > .link-card { margin-top: 18px; }
.main-current { padding: 16px; }
.main-title { display: block; color: var(--ink-strong); text-decoration: none; }
.main-current .stair { margin: 16px 0 10px; }
.main-step { margin-bottom: 12px; }
.main-all-done { text-align: center; }
.main-all-done .big { font-size: 44px; }
.main-total { margin-top: 18px; }
.new-dot { position: absolute; top: -2px; right: -6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
.tools { margin-top: 14px; }
.tool { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.tool.card { margin-top: 14px; }
.link-card { color: inherit; text-decoration: none; }
.link-card:hover { border-color: var(--primary); }
.link-card-go { color: var(--ink-soft); display: flex; }
/* আরও: account card (avatar · name/phone · role) + logout */
.account-row { display: flex; align-items: center; gap: 12px; }
.account-row .list-row-title { font-size: var(--fs-body); }
.account-row .list-row-sub { font-size: var(--fs-small); }
.account-msg { margin: 8px 0 0; font-size: var(--fs-small); }
.warn-text { color: var(--accent); font-weight: 600; }
.type-input.code-box { font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; resize: vertical; width: 100%; }
/* certificate */
.cert { position: relative; overflow: hidden; text-align: center; padding: 26px 18px 18px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); border: 3px double var(--accent-fill); outline: 6px solid var(--brand-soft); outline-offset: -12px; }
.cert > * + * { margin-top: 6px; }
.cert-kicker { color: var(--accent); font-weight: 700; letter-spacing: .04em; }
.cert-name { font-size: 28px; font-weight: 700; color: var(--brand-text); }
.cert-title { font-size: 22px; font-weight: 700; }
.cert-en { font-family: var(--font-en); color: var(--ink-soft); }
.cert-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px !important; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink-soft); }
.cert-brand { font-family: var(--font-en); font-weight: 700; color: var(--brand-text); font-size: 14px; }
/* new version toast */
.update-toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top)); z-index: 10;
  border: 0; border-radius: 99px; padding: 10px 18px; min-height: 44px; font-weight: 700; cursor: pointer;
  background: var(--gold); color: var(--gold-ink); max-width: calc(100% - 32px); }

/* stage header */
.stage-head { margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-right: 12px; margin-bottom: 2px; text-decoration: none; font-size: var(--fs-small); font-weight: 500; color: var(--ink-soft); }
/* stage chrome (dhap-a-screens.html screen 6): back link left, mini staircase right; then "ধাপ N · <stage>" */
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-top .back { min-width: 0; }
.stage-top .back > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-top .stair-mini { flex: none; }
.stage-kicker, .stage-head h1.stage-name { font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); margin: 2px 0 6px; }
.stage-head h1.stage-name { margin-bottom: 10px; }
.meter { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.meter .progress { flex: 1; border-radius: 4px; background: var(--surface-2); }
.meter .progress > span { background: var(--gold); border-radius: 4px; }

/* learn cards */
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.word-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-tile); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.word-card .en { font-size: 19px; font-weight: 700; }
.word-card .bn { color: var(--ink-soft); }
.speak { border: none; background: var(--surface-2); border-radius: 10px; min-width: 44px; min-height: 40px; padding: 4px 10px; cursor: pointer; font-size: 16px; align-self: flex-start; vertical-align: middle; }
.speak:active { background: var(--brand-soft); }

/* quiz */
.prompt { font-size: 26px; font-weight: 700; text-align: center; padding: 18px 8px; }
.prompt.en { font-size: 24px; }
.prompt-sentence { font-family: var(--font-en); font-size: 21px; font-weight: 500; text-align: center; padding: 10px 4px 16px; }
.options { display: grid; gap: 9px; }
/* MCQ option (dhap-a-screens.html screen 6): correct = green border + tint, ✓ after the text */
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; padding: 13px 14px; border-radius: var(--r-btn); border: 1px solid var(--field-border);
  background: var(--surface); cursor: pointer; font-size: 17px; min-height: 54px; line-height: 1.4;
  touch-action: manipulation;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.opt::after { flex: none; font-weight: 700; }
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt:active:not(:disabled) { transform: scale(.985); background: var(--primary-soft); }
.opt.is-right { border-color: var(--correct); background: var(--correct-bg); }
.opt.is-right::after { content: '✓'; color: var(--correct-text); }
.opt.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt.is-wrong::after { content: '✗'; color: var(--danger-text); }
.opt:disabled { cursor: default; color: inherit; opacity: 1; }
.opt:disabled:not(.is-right):not(.is-wrong) { opacity: .55; }
.mcq-next:not(:has(> :not([hidden]))) { display: none; }
.mcq-next > .btn { flex: 1 1 auto; min-height: 50px; font-size: 17px; }

.feedback { border-radius: 12px; padding: 12px 14px; font-weight: 500; }
.feedback.good { background: var(--correct-bg); color: var(--correct-text); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.feedback.info { background: var(--warn-soft); }
.feedback ul { margin: 6px 0 0; padding-left: 20px; }

/* structure builder */
.pattern { display: flex; flex-wrap: wrap; gap: 6px; }
.role { font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 8px; }
.role-Sub { background: #dbe9fb; color: #1d4f91; }
.role-Verb { background: #fbe0d6; color: #9a3a1c; }
.role-Obj { background: #e3f3dc; color: #2f6b1f; }
.role-Comp { background: #efe2fb; color: #6232a0; }
.role-Adv, .role-Time, .role-Place, .role-Extra { background: #f8edcf; color: #7b5a12; }
.role-Conn { background: #d8f1f0; color: #13615e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .role { filter: brightness(.85) saturate(1.1); }
}
.build-area {
  min-height: 64px; border: 2px dashed var(--line); border-radius: 12px; padding: 10px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--font-en); font-size: 19px;
}
.build-area:empty::before { content: 'নিচের শব্দে ক্লিক করে বাক্য বানান'; color: var(--ink-soft); font-family: var(--font-bn); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-en); font-size: 18px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--field-border); background: var(--surface); min-height: 44px;
}
.chip:hover:not(:disabled) { border-color: var(--brand); }
.chip:disabled { opacity: .3; cursor: default; }
.chip.placed { background: var(--brand-soft); border-color: var(--brand); }
.solved { display: flex; flex-wrap: wrap; gap: 8px; }
.solved .seg { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; padding: 0; border-radius: 0; }
.solved .seg .en { font-size: 18px; }
/* structure builder: "মুছুন" small on the structure line (box keeps full width); the student's wrong try shown above the answer */
.pattern-bn { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.btn-clear { flex: 0 0 auto; padding: 4px 10px; min-height: 36px; font-size: 14px; }
.your-try { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--bad-soft); }
.your-try .en { color: var(--bad); font-size: 18px; }
.build-card > .actions { margin-top: 22px !important; }

/* typing */
.type-input {
  width: 100%; padding: 12px 14px; border-radius: var(--r-field); border: 1px solid var(--field-border);
  background: var(--field); font-family: var(--font-en); font-size: 19px;
}
.type-area { display: block; resize: none; line-height: 1.4; overflow-y: auto; max-height: calc(3 * 1.4em + 26px); }
.kbd { display: grid; gap: 6px; user-select: none; -webkit-user-select: none; }
.kbd[hidden] { display: none; }
.stack > .kbd { margin-top: 22px; }
.kbd-row { display: flex; justify-content: center; gap: 5px; }
.key {
  flex: 1 1 0; max-width: 46px; min-width: 0; height: 46px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: inherit;
  font-family: var(--font-en); font-size: 19px; cursor: pointer; touch-action: manipulation;
}
.key:active { background: var(--brand-soft); border-color: var(--brand); }
.key-space { flex: 5 1 0; max-width: 240px; font-size: 15px; }
.key-wide { flex: 1.6 1 0; max-width: 72px; }
.diff { font-family: var(--font-en); }
.diff .w-spelling { color: var(--bad); text-decoration: underline wavy; }

/* rules */
.rule { border-left: 4px solid var(--brand); }
.rule .ex { font-family: var(--font-en); background: var(--surface-2); border-radius: 8px; padding: 2px 8px; display: inline-block; margin: 2px 4px 2px 0; }
.rule-id { font-size: 13px; font-weight: 700; color: var(--brand-text); }
.rule-meaning { margin: 0; font-weight: 600; font-size: 17px; }
.rule-block { display: grid; gap: 6px; }
.rule-label { font-size: 14px; font-weight: 700; color: var(--accent); }
.ex-line { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 17px; }
.mistake { display: grid; gap: 2px; border-radius: 8px; padding: 6px 10px; background: var(--surface-2); }
.mis-wrong { color: var(--bad); }
.mis-right { color: var(--correct-text); font-weight: 600; }
.rule { scroll-margin-top: 72px; }
.rule-list { margin: 0; padding-left: 22px; }
.rule-list li + li { margin-top: 6px; }
.table-wrap { overflow-x: auto; }
.rule-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rule-table th, .rule-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rule-table th { background: var(--surface-2); font-weight: 700; }

/* grammar */
.box-words { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border: 1.5px solid var(--ink-soft); border-radius: 10px; font-family: var(--font-en); }
.box-words span { padding: 2px 10px; background: var(--surface-2); border-radius: 6px; }
.passage { font-family: var(--font-en); font-size: 18px; line-height: 2.2; }
.gap { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.gap .gap-key { font-weight: 700; color: var(--accent); }
.gap input {
  width: 128px; padding: 2px 8px; border: none; border-bottom: 2px solid var(--ink-soft);
  background: var(--surface-2); border-radius: 6px 6px 0 0; font-family: var(--font-en); font-size: 17px;
}
.gap input.is-right { border-bottom-color: var(--good); background: var(--good-soft); }
.gap input.is-wrong { border-bottom-color: var(--bad); background: var(--bad-soft); }
.gap .root { color: var(--ink-soft); font-style: italic; }
.reason-table { width: 100%; border-collapse: collapse; }
.reason-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.reason-table td:first-child { width: 40px; font-weight: 700; color: var(--accent); font-family: var(--font-en); }
.reason-table select { width: 100%; }
.reason-table select.is-right { border-color: var(--good); }
.reason-table select.is-wrong { border-color: var(--bad); }
.explain { font-size: 14px; margin-top: 4px; }
.explain.good { color: var(--good); }
.explain.bad { color: var(--bad); }
.ex-list { display: grid; gap: 10px; }
.ex-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: inherit; }
.ex-item:hover { border-color: var(--brand); }

.done-card { text-align: center; padding: 28px 18px; }
.done-card .big { font-size: 48px; animation: pop .5s ease both; }
.done-card > .stair { width: min(240px, 100%); margin: 0 auto 6px; animation: pop .5s ease both; }

/* celebration + answer feedback motion */
.celebrate { position: relative; overflow: hidden; }
.confetti { position: absolute; left: 50%; top: 70px; width: 0; height: 0; pointer-events: none; }
.confetti i {
  position: absolute; width: 8px; height: 12px; border-radius: 2px; background: var(--c); opacity: 0;
  animation: burst 1.3s ease-out forwards;
}
@keyframes burst {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  55% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 1; }
  100% { transform: translate(calc(var(--x) * 1.25), calc(var(--y) + 150px)) rotate(calc(var(--r) * 2)); opacity: 0; }
}
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.opt.is-right, .feedback.good { animation: pop .3s ease; }
.opt.is-wrong, .feedback.bad { animation: shake .3s ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* action buttons: an empty row (only a hidden "next" button) takes no space */
.actions:not(:has(> :not([hidden]))) { display: none; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding: calc(10px + env(safe-area-inset-top)) 14px 32px; }
  .prompt { font-size: 22px; }
  .prompt-sentence { font-size: 19px; }
  .card { padding: 16px; }
  .stage { grid-template-columns: 44px 1fr; gap: 12px; padding: 12px 14px; }
  .stage .badge, .stage .tags { grid-column: 2; justify-self: start; }
  .gap input { width: 104px; }
  /* header on one line: inside a paragraph show only the logo + paragraph name */
  /* "check" / "next" stay at the bottom of the screen, in thumb reach */
  .actions {
    position: sticky; bottom: 0; z-index: 4; margin-top: 12px !important;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--line);
  }
  /* inside a card (typing, sentence builder, grammar set) buttons stay in place under the content:
     a bar stuck to the screen bottom hid the keyboard's last row and the feedback */
  .card .actions {
    position: static; margin: 12px 0 0 !important; padding: 0;
    background: none; border-top: none;
  }
  .actions > .btn { flex: 1 1 auto; }
  /* while a question is on screen: short header, so question + 4 options + next fit one screen */
  #app:has(.options, .kbd, .chips) .stage-head { margin-bottom: 8px; }
  #app:has(.options, .kbd, .chips) .stage-head > p.muted { display: none; }
  #app:has(.options, .kbd, .chips) .stage-head h1:not(.stage-name) { font-size: 19px; margin-bottom: 2px; }
  #app:has(.options, .kbd, .chips) .card { padding: 14px; }
  /* typing: Bangla prompt + 2–3 line box + keyboard + check button fit a small phone */
  #app:has(.kbd) .prompt { font-size: 19px !important; padding: 2px 4px !important; }
  #app:has(.kbd) .card.stack > * + * { margin-top: 10px; }
  #app:has(.kbd) .stack > .kbd { margin-top: 16px; }
  .type-input { font-size: 18px; padding: 10px 12px; }
  /* taller phones: bigger keys use the free space; a clear gap so "যাচাই করুন" is not pressed by mistake */
  .key { height: clamp(44px, 6.4vh, 54px); height: clamp(44px, 6.4dvh, 54px); }
  /* typing card fills the screen; keyboard pushed to the bottom, check button stays under the box */
  .type-card { display: flex; flex-direction: column; }
  .type-card > .kbd { margin-top: auto !important; padding-top: 12px; padding-bottom: 38px; gap: 5px; }
  .type-card .actions { margin-top: 10px !important; }
  /* structure builder: the check button alone at the screen bottom, away from the chips */
  .type-card.build-card > .actions { margin-top: auto !important; padding: 22px 0 38px; }
  #app:has(.options) .prompt { padding: 6px 4px 8px; }
  #app:has(.options) .prompt-sentence { padding: 4px 2px 10px; }
  .options { gap: 8px; }
  .opt { font-size: 17px; min-height: 54px; padding: 10px 12px; }
}
a.btn { text-decoration: none; }
.main-label { margin: 0; }
/* bottom tabs */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--bg); border-top: 1px solid var(--tab-border);
  padding-bottom: env(safe-area-inset-bottom); }
.tabbar[hidden] { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 60px; text-align: center; line-height: 1.2; padding: 0 2px;
  text-decoration: none; color: var(--ink-soft); font-size: var(--fs-tab); font-weight: 600; position: relative; }
.tab-icon { position: relative; display: flex; justify-content: center; margin-bottom: 3px; }
.tab.is-active { color: var(--ink-strong); }
.tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
body.has-tabs { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
/* focus / scrollIntoView keep the element above the fixed tab bar, not under it */
html:has(body.has-tabs) { scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 520px; border: 1px solid var(--tab-border); border-bottom: 0; border-radius: 16px 16px 0 0; } }
/* theme picker (আরও page) */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.theme-card { margin-top: 14px; }
.theme-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; min-height: 44px; border-radius: var(--r-btn);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: var(--fs-small); font-weight: 600; }
.theme-btn[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.swatch { width: 40px; height: 40px; border-radius: var(--r-field); border: 1px solid rgba(128,128,128,.4); display: grid; place-items: center; }
.swatch > i { width: 12px; height: 12px; border-radius: 3px; }
/* levels on the paragraph list */
.level + .level { margin-top: 26px; }
.level-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.level-head h2 { margin: 0; font-size: var(--fs-card-title); }
/* paragraph home: title, staircase, short intro */
.para-hero .stair { margin: 16px 0 8px; }
.para-intro { margin: 10px 0 0; }
/* transformation set */
.direction { text-align: center; margin-top: 0 !important; }
.direction .en { display: inline-block; padding: 3px 12px; border-radius: 99px; background: var(--warn-soft); color: var(--accent); font-weight: 700; }
.solved-line { color: var(--good); }
/* closed sections on a finished paragraph: certificate, full paragraph (start closed) */
.fold { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-top: 12px; }
.fold.fold-first { margin-top: 18px; }
.fold.fold-last { margin-bottom: 18px; }
.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; min-height: 52px; font-weight: 700; font-size: 18px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold-arrow { color: var(--ink-soft); transition: transform .2s; }
.fold[open] > summary .fold-arrow { transform: rotate(90deg); }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold-body { padding: 14px 16px 16px; }
.fold-body > .cert { margin: 0; }
@media (prefers-reduced-motion: reduce) { .fold-arrow { transition: none; } }
/* stage 9: board tables (matching, substitution) */
.tb-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tb-col { display: flex; flex-direction: column; gap: 6px; }
.tb-col-head { font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.tb-cell { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 16px; background: var(--surface); text-align: left; }
.tb-tap { cursor: pointer; min-height: 44px; color: inherit; font: inherit; font-family: var(--font-en); }
.tb-tap.is-on { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.tb-key { color: var(--ink-soft); font-weight: 700; font-family: var(--font-en); }
.tb-pick { border-top: 1px solid var(--line); padding-top: 10px; }
.tb-pick-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tb-pick-line .tb-a { flex: 1 1 100%; }
.tb-pick-line select { width: auto; min-width: 96px; }
.tb-made { color: var(--good); margin-top: 6px; }
.tb-preview { min-height: 52px; font-size: 18px; }
.tb-preview:empty::before { content: 'প্রতিটা কলাম থেকে একটা ঘর বাছুন'; }
.tb-list { margin: 0; padding-left: 22px; }
.tb-list li { margin: 4px 0; color: var(--good); }
.set-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
label > select { display: block; width: 100%; margin-top: 6px; }
/* whole paragraph with meaning (finished paragraph) */
.read-list { margin: 0; padding-left: 22px; }
.read-list li + li { margin-top: 14px; }
.read-en { margin: 0; font-size: 18px; line-height: 1.9; }
.read-word { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  border-bottom: 1.5px dotted var(--line); border-radius: 0; }
.read-word:active, .read-word:focus-visible { color: var(--brand-text); border-bottom-color: var(--brand-text); outline: none; }
.read-bn { margin: 2px 0 0; color: var(--ink-soft); }
.read-list.hide-bn .read-bn { display: none; }
.read-note { margin-top: 6px; display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.read-note[hidden] { display: none; }

/* ===== Dhap components (docs/design/DECISION.md + dhap-a-screens.html) ===== */
/* icons: built by js/icons.js (size = width/height attributes: 20 tab bar, 16 inline, 24 large) */
.icon { display: inline-block; flex: none; vertical-align: middle; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }

/* brand */
.wordmark { font-family: var(--font-bn); font-weight: 800; font-size: var(--fs-wordmark); letter-spacing: -1px; line-height: 1; color: var(--ink-strong); }
.wordmark > i { font-style: normal; display: inline-block; width: 10px; height: 10px; background: var(--gold); border-radius: 2px; margin-left: 4px; transform: translateY(-6px); }
.tagline { font-size: 15px; color: var(--ink-soft); margin: 6px 0 26px; }
.page-title { font-size: var(--fs-title); font-weight: 700; line-height: 1.3; margin: 0 0 4px; color: var(--ink-strong); }
.card-title { font-size: var(--fs-card-title); font-weight: 600; line-height: 1.3; margin: 4px 0 2px; }
.card-lg { border-radius: var(--r-card-lg); }

/* signature: the 9 stages as a rising staircase. <div class="stair"> + 9 <span>; done = blue, current = gold, ahead = dark */
.stair { display: flex; align-items: flex-end; gap: 5px; height: 120px; }
.stair > span { flex: 1; border-radius: 6px 6px 2px 2px; background: var(--surface-2); }
.stair > span:nth-child(1) { height: 22%; } .stair > span:nth-child(2) { height: 31%; } .stair > span:nth-child(3) { height: 40%; }
.stair > span:nth-child(4) { height: 49%; } .stair > span:nth-child(5) { height: 58%; } .stair > span:nth-child(6) { height: 67%; }
.stair > span:nth-child(7) { height: 76%; } .stair > span:nth-child(8) { height: 88%; } .stair > span:nth-child(9) { height: 100%; }
.stair > .is-done { background: var(--primary); }
.stair > .is-current { background: var(--gold); }
.stair-md { height: 70px; }
.m-bar { display: grid; gap: 6px; margin: 4px 0 2px; }
.m-current .main-step { font-weight: 600; }
.stair-mini { gap: 3px; height: 26px; width: 84px; }
.stair-mini > span { border-radius: 3px 3px 1px 1px; }
.stair-mini > span:nth-child(1) { height: 30%; } .stair-mini > span:nth-child(2) { height: 40%; } .stair-mini > span:nth-child(3) { height: 50%; }
.stair-mini > span:nth-child(4) { height: 60%; } .stair-mini > span:nth-child(5) { height: 70%; } .stair-mini > span:nth-child(6) { height: 78%; }
.stair-mini > span:nth-child(7) { height: 86%; } .stair-mini > span:nth-child(8) { height: 93%; } .stair-mini > span:nth-child(9) { height: 100%; }

/* pill chip (home streak line): "🔥 <b>৬ দিন</b> টানা" */
.pill { display: inline-flex; gap: 6px; align-items: center; background: var(--surface-2); border-radius: var(--r-chip); padding: 6px 12px; font-size: var(--fs-xs); }
.pill b, .streak-line b { color: var(--gold-text); }

/* form field: label.field-label → input.field → .field-error under it */
.field-label { display: block; font-size: var(--fs-small); color: var(--ink-soft); margin: 12px 0 6px; }
.field {
  display: block; width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-field);
  background: var(--field); border: 1px solid var(--field-border); color: var(--ink); font-family: var(--font-en); font-size: 16px;
}
.field::placeholder { color: var(--ink-faint); }
.field:focus { border-color: var(--primary); }
.field.is-error, .field[aria-invalid="true"] { border-color: var(--danger); }
.field-error { font-size: var(--fs-xs); color: var(--danger); margin-top: 5px; }
.field-error:empty { display: none; }
.search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; margin: 12px 0 4px; border-radius: var(--r-field);
  background: var(--field); border: 1px solid var(--field-border); color: var(--ink-faint); }
.search > input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--ink); font-size: 16px; outline: none; }
.search:focus-within { border-color: var(--primary); }

/* tiles: 3 across (streak / today / total) */
.tiles { display: flex; gap: 8px; margin: 14px 0; }
.tile { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-tile); padding: 10px 6px; text-align: center; }
.tile-num { display: block; font-family: var(--font-en); font-size: var(--fs-tile); font-weight: 600; }
.tile-label { font-size: var(--fs-tab); color: var(--ink-soft); }

/* list row (teacher's students): avatar initial · name/phone · today's time on the right */
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--divider); color: inherit; text-decoration: none; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-en); font-weight: 600; color: var(--primary-text); }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-sub { font-size: var(--fs-tab); color: var(--ink-soft); }
.list-row-end { text-align: right; font-size: var(--fs-xs); }
.list-row-end b { display: block; font-size: 14px; }
.list-row.is-banned { opacity: .45; }
.badge-banned { font-size: 10px; border-radius: var(--r-badge); padding: 1px 6px; margin-left: 4px; background: var(--banned-bg); color: var(--banned-ink); }

/* segmented control: <div class="seg" role="group"><button aria-pressed="true">…</button>…</div> */
.seg { display: flex; background: var(--seg-bg); border-radius: var(--r-field); padding: 3px; }
.seg > button, .seg > a { flex: 1; min-height: 36px; padding: 7px 0; border: 0; border-radius: 9px; background: none; color: var(--ink-soft);
  font-size: var(--fs-xs); text-align: center; text-decoration: none; cursor: pointer; }
.seg > .is-on, .seg > [aria-pressed="true"], .seg > [aria-selected="true"] { background: var(--seg-on); color: var(--ink-strong); }

/* bottom sheet (TPIN, confirmations): .scrim behind, .sheet on top. .modal is the same sheet */
.scrim { position: fixed; inset: 0; z-index: 20; background: var(--scrim); }
.sheet, .modal { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 520px; margin: 0 auto;
  background: var(--surface); border-top: 1px solid var(--sheet-border); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 20px 18px calc(26px + env(safe-area-inset-bottom)); }
.scrim[hidden], .sheet[hidden], .modal[hidden] { display: none; }
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-sub { font-size: var(--fs-small); color: var(--ink-soft); margin-top: 4px; }
.pins { display: flex; gap: 8px; justify-content: center; margin: 16px 0 6px; }
.pin { width: 36px; height: 44px; border-radius: 10px; background: var(--field); border: 1px solid var(--pin-border);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-en); font-size: 20px; }
.pin.is-filled { border-color: var(--primary); }
.pins.is-error .pin { border-color: var(--danger); }

/* soft action row (Reset · Ban · Delete): .acts > .btn (.btn-warn / .btn-danger) */
.acts { display: flex; gap: 6px; margin-top: 12px; }
.acts > .btn { flex: 1; min-height: 44px; padding: 0 6px; border-radius: var(--r-field); font-size: var(--fs-xs); gap: 5px; }

/* calendar (আমার সময়): weekday heads, day cells coloured by minutes studied */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.cal-title { flex: 1; min-width: 0; text-align: center; }
.cal-nav { position: relative; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cal-nav::after { content: ''; position: absolute; inset: -8px; } /* 44 px tap area */
.cal-nav:disabled { opacity: .4; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-wd { font-size: 9px; color: var(--ink-soft); padding-bottom: 2px; }
.cal-day { border-radius: var(--r-cal); padding: 3px 0; min-height: 31px; font-family: var(--font-en); font-size: 9px; background: var(--cal-0); color: var(--cal-ink); }
.cal-min { display: block; font-style: normal; font-size: 10px; font-weight: 600; }
.cal-l1 { background: var(--cal-1); }            /* < 20 min */
.cal-l2 { background: var(--cal-2); }            /* < 40 min */
.cal-l3 { background: var(--cal-3); color: var(--cal-ink-3); } /* ≥ 40 min */
.cal-future { background: var(--cal-future); color: var(--cal-future-ink); }
.cal-empty { background: none; }
.cal-today { outline: 2px solid var(--today); }
.cal-foot { margin-top: 10px; font-size: var(--fs-xs); color: var(--ink-soft); }

/* teacher panel (js/teacher.js): ছাত্র list, one student, codes, TPIN sheet */
.t-sub { font-size: var(--fs-xs); margin-bottom: 4px; }
.t-note { font-size: var(--fs-small); margin: 14px 0; }
.t-error { margin-top: 14px; }
.t-error p { margin: 0 0 12px; }
.t-page h1 .badge-banned { font-size: 12px; vertical-align: middle; }
.list-row-end b.muted { color: var(--ink-faint); }
.t-progress { margin-top: 10px; }
.t-level { font-size: var(--fs-xs); }
.t-bar { height: 6px; margin: 4px 0 10px; }
.t-bar > span { background: var(--primary); }
.t-now { font-size: var(--fs-xs); }
.t-paras { color: inherit; text-decoration: none; margin-bottom: 14px; }
.t-code-form { margin: 14px 0 6px; }
.t-code-form .field-label { margin-top: 0; }
.t-code-row { display: flex; gap: 8px; }
.t-code-row > .field { flex: 1; min-width: 0; text-transform: uppercase; }
.t-code-row > .btn { flex: none; min-height: 46px; }
.t-sheet-action { margin-top: 16px; }
.t-cancel { margin-top: 6px; font-size: var(--fs-small); }
.sheet .sheet-error { text-align: center; }
/* one numeric input over the 6 boxes: a tap anywhere on them opens the number keyboard */
.pin-field { position: relative; display: block; width: max-content; margin: 0 auto; }
.pin-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; color: transparent; background: none; caret-color: transparent; }
/* the next box to fill is outlined while typing */
.pin-field:focus-within .pin.is-filled + .pin:not(.is-filled), .pin-field:focus-within .pin:first-child:not(.is-filled) { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ===== Rearrange (docs/design/rearrange.html): #/r list, #/r/<n> question, finish ===== */
.rr-sub, .rr-count { font-size: var(--fs-xs); }
.rr-meter { margin: 12px 0 6px; border-radius: 4px; }
.rr-meter > span { background: var(--gold); border-radius: 4px; }
.rr-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-top: 8px; border-radius: var(--r-btn);
  background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; }
.rr-row:hover { border-color: var(--primary); }
.rr-row.is-current { border-color: var(--gold); }
.rr-num { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-en); font-weight: 600; font-size: 13px; }
.rr-num.is-done { background: var(--primary); color: var(--primary-ink); }
/* finished with mistakes = practised, not passed (Captain: pass = no wrong answer) */
/* E / M / B next to a student's name (teacher list) */
.badge-app { margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--surface-2, var(--warn-soft)); color: var(--ink-soft); vertical-align: middle; }
.t-app { font-size: 18px; margin: 20px 0 0; }
.t-math .t-now + .t-level { margin-top: 10px; }
.badge-app[data-apps="B"] { background: var(--primary); color: var(--primary-ink); }
.rr-num.is-tried { background: var(--warn-soft); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.rr-finish.is-fail { background: var(--warn-soft); border-color: var(--accent); color: var(--ink); }
.rr-pass-tip { margin-top: 6px; font-weight: 600; }
.rr-num.is-current { background: var(--gold); color: var(--gold-ink); }
.rr-row-main { flex: 1; min-width: 0; }
.rr-row-main > b { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.rr-meta { font-size: 11px; color: var(--ink-soft); }
.rr-badge { flex: none; font-size: 10px; border-radius: var(--r-badge); padding: 2px 7px; background: var(--primary-soft); color: var(--primary-text); }
.rr-q .back { margin-bottom: 8px; }
.rr-head { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.rr-story { border-radius: 16px; background: var(--surface); border: 1px dashed var(--pin-border); padding: 10px 12px; margin-bottom: 12px; }
.rr-line { display: flex; gap: 6px; font-size: 13px; line-height: 1.45; padding: 3px 0; }
.rr-line > i { font-style: normal; font-family: var(--font-en); color: var(--gold-text); font-weight: 600; width: 18px; flex: none; }
.rr-order { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--divider); font-size: var(--fs-xs); font-weight: 600; color: var(--gold-text); }
.rr-slot { color: var(--ink-faint); font-size: var(--fs-xs); padding: 4px 0; }
.rr-toggle { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); color: var(--ink-soft); margin: 6px 0 10px; }
.rr-switch { position: relative; width: 38px; height: 22px; flex: none; border: 0; border-radius: 11px; padding: 0; background: var(--surface-2); cursor: pointer;
  box-sizing: content-box; border-top: 11px solid transparent; border-bottom: 11px solid transparent; background-clip: padding-box; } /* 44 px tap height */
.rr-switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-faint); transition: left .15s ease; }
.rr-switch[aria-checked="true"] { background-color: var(--primary); }
.rr-switch[aria-checked="true"]::after { left: 19px; background: #fff; }
.rr-switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rr-sent { display: flex; gap: 8px; width: 100%; text-align: left; margin-top: 7px; padding: 9px 11px; border-radius: var(--r-btn);
  border: 1px solid var(--field-border); background: var(--field); color: inherit; font: inherit; cursor: pointer; }
.rr-sent:hover:not(:disabled) { border-color: var(--primary); }
.rr-sent.is-sel { border-color: var(--primary); background: var(--primary-soft); }
.rr-sent.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.rr-sent:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rr-k { font-weight: 600; color: var(--primary-text); width: 18px; flex: none; font-size: 14px; }
.rr-body { display: block; flex: 1; min-width: 0; }
.rr-en { display: block; font-size: 13px; line-height: 1.4; }
.rr-bn { display: block; font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.5; }
.rr-hide-bn .rr-bn { display: none; }
.rr-board { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 3px; line-height: 1.4; }
.rr mark { background: var(--banned-bg); color: var(--banned-ink); border-radius: 4px; padding: 0 3px; }
.rr-hint { margin-top: 10px; padding: 11px 12px; border-radius: var(--r-btn); background: var(--danger-soft); border: 1px solid var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent); font-size: 13px; line-height: 1.55; }
.rr-w { color: var(--banned-ink); }
.rr-good { margin-bottom: 10px; padding: 10px 12px; border-radius: var(--r-btn); background: var(--correct-bg); border: 1px solid var(--correct); color: var(--correct-text); font-size: 13px; }
.rr-good .rr-w { color: inherit; }
.rr-submit { margin-top: 12px; }
.rr-dline { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--divider); }
.rr-dline .rr-en { font-size: 13.5px; line-height: 1.45; }
.rr-dline .rr-bn { font-size: var(--fs-xs); }
.rr-next { margin-top: 12px; }
.rr-again { margin-top: 6px; font-size: 13px; }
/* Matching (js/matching.js) reuses the rr-* look; these are the parts Rearrange does not have */
.mt-passage .mt-line { padding: 4px 0; border-bottom: 1px solid var(--divider); }
.mt-cur { padding-top: 6px; }
.mt-built { font-weight: 600; }
.mt-slot { color: var(--ink-faint); }
.mt-ask { font-size: var(--fs-xs); color: var(--ink-soft); margin: 2px 0 4px; }
.mt-rule, .mt-mean { margin-top: 6px; }
.mt-lab { font-weight: 600; }
.mt-full { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--correct) 35%, transparent); }
.mt-full .rr-en { font-weight: 600; color: var(--ink); }

/* ---------- Grammar: Right form of verbs (js/grammar.js) ---------- */
.gr-card { padding: 14px; }
.gr-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.gr-meaning { font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.gr-lab { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-soft); margin: 12px 0 4px; }
.gr-clues { display: flex; flex-wrap: wrap; gap: 6px; }
.gr .gr-chip { font-size: 12px; }
.gr-pairs { display: grid; gap: 4px; font-size: 13px; }
.gr-ex { padding: 4px 0; }
.gr-mis { font-size: 13px; line-height: 1.6; }
.gr-bad { color: var(--danger); }
.gr-good { color: var(--correct-text); }
.gr-nav { display: flex; gap: 8px; margin-top: 12px; }
.gr-nav > * { flex: 1; }
.gr-sent { font-size: 15px; line-height: 1.6; }
.gr-blank { font-family: var(--font-en); color: var(--ink-faint); font-weight: 600; }
.gr-blank.is-cur { color: var(--gold-text); background: var(--surface-2); border-radius: 4px; padding: 0 4px; }
.gr-blank.is-filled { color: var(--primary-text); }
.gr-line { padding: 5px 0; border-bottom: 1px solid var(--divider); }
.gr-line:last-child { border-bottom: 0; }
.gr-line .rr-en { font-size: 13.5px; line-height: 1.55; }
.gr-line.is-cur .rr-en { color: var(--ink); }
.gr-line:not(.is-cur) .rr-en { color: var(--ink-soft); }
.gr-box { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.gr-chipbtn { min-height: 40px; padding: 0 14px; border-radius: var(--r-btn); border: 1px solid var(--border, var(--divider)); background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; }
.gr-chipbtn.is-sel { border-color: var(--primary); background: var(--primary-soft); }
.gr-chipbtn.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.gr-chipbtn:disabled { opacity: .3; text-decoration: line-through; cursor: default; }
.gr-chipbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gr-ruleref { margin-top: 4px; font-size: var(--fs-xs); opacity: .85; }

/* Matching: Column B and Column C side by side, one Submit (js/matching.js) */
.mt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.mt-col { min-width: 0; }
.mt-colhead { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-soft); margin: 4px 0 0; }
.mt-cols .mt-card { padding: 8px 8px; gap: 6px; }
.mt-cols .mt-card .rr-k { width: auto; min-width: 14px; font-size: 12px; }
.mt-cols .mt-card .rr-en { font-size: 12.5px; overflow-wrap: anywhere; }
.mt-cols .mt-card .rr-bn { font-size: 11px; }
.rr-sent.is-ok { border-color: var(--correct); background: var(--correct-bg); }
.mt-pickb, .mt-pickc { color: var(--primary-text); font-weight: 600; }

/* বোর্ড প্রশ্ন tab (#/b): exam-paper headings */
.board-paper { font-size: 15px; font-weight: 700; margin: 18px 0 2px; }
/* the বোর্ড প্রশ্ন tab: bigger section cards (Captain: "card size is too small") */
.board .rr-row { min-height: 72px; padding: 14px 16px; gap: 14px; margin-top: 10px; border-radius: 16px; }
.board .rr-num { width: 44px; height: 44px; border-radius: 12px; font-size: 15px; }
.board .rr-row-main > b { font-size: 17px; line-height: 1.3; }
.board .rr-meta { font-size: 13px; margin-top: 3px; display: block; }
.board .board-paper { font-size: 17px; margin-top: 22px; }
/* .main lays its children out at their own width (align-items: flex-start); the board cards take the full width */
.main.board { align-items: stretch; }
.main.board .rr-row { width: 100%; box-sizing: border-box; }

/* ---------- the Math app (js/math.js; rules carried over from Paragraph English, Dhap tokens) ---------- */
/* options: Bangla ক খ গ ঘ marker in front, the text, then ✓ / ✗ */
.opt.opt-bn { justify-content: flex-start; }
.opt.opt-bn::before { content: attr(data-l); flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-soft); font-family: var(--font-bn, inherit); font-size: 15px; font-weight: 700; }
.opt.opt-bn .opt-text { flex: 1; min-width: 0; }
.opt.is-picked { border-color: var(--brand); background: var(--brand-soft); }
.opt.is-picked::before { background: var(--brand); color: var(--brand-ink, #fff); }
.opt.is-right.opt-bn::before { background: var(--correct); color: var(--bg); }
.opt.is-wrong.opt-bn::before { background: var(--danger); color: var(--bg); }
.m-section { margin: 22px 0 0; font-size: 19px; }
.m-section + .muted { margin: 4px 0 0; }
.m-q { display: grid; gap: 8px; }
.m-num { font-weight: 700; color: var(--stage, var(--brand)); }
.m-stem { font-size: 19px; font-weight: 600; line-height: 1.6; white-space: pre-line; }
.m-src { font-weight: 600; color: var(--stage, var(--accent)); }
.m-angle { justify-self: start; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); color: var(--stage, var(--accent)); width: max-content; }
.m-fig { color: var(--ink); max-width: 260px; margin-inline: auto; } /* figures sit in the middle (Captain) */
/* sticky তথ্য with a figure: keep it short so the questions still have room */
.m-info.has-fig { display: grid; grid-template-columns: minmax(0, 150px) 1fr; gap: 4px 12px; align-items: center; }
.m-info.has-fig .rule-label { grid-column: 1 / -1; }
.m-info.has-fig .m-fig { justify-self: center; width: 100%; }
.m-info.has-fig .m-fig svg { max-height: 130px; }
.m-info.has-fig .m-info-text { font-size: 17px; }
.m-fig svg { width: 100%; height: auto; display: block; }
.m-fig-text { max-width: none; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.m-explain { display: grid; gap: 6px; font-weight: 400; color: var(--ink); line-height: 1.6; }
.m-explain .m-verdict { font-weight: 700; }
.feedback.good.m-explain .m-verdict { color: var(--good); }
.feedback.bad.m-explain .m-verdict { color: var(--bad); }
/* the quick test's তথ্য stays on screen while the student scrolls through its questions (Captain) */
.m-info { margin-bottom: 14px; border-left: 4px solid var(--stage, var(--brand));
  position: sticky; top: calc(6px + env(safe-area-inset-top)); z-index: 5; background: var(--surface); box-shadow: var(--shadow); }
.m-info-text { font-size: 20px; font-weight: 700; margin-top: 4px; }
.m-qs { margin-top: 12px; scroll-margin-top: 120px; } /* not hidden under the sticky তথ্য */
.m-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* math formulas (KaTeX): textbook look, never wider than the card */
.m-tex { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; padding: 2px 4px; } /* 4px: the √ sign pokes 1–2px out of KaTeX's box — less side padding made every root scroll sideways */
.m-tex .katex { font-size: 1.08em; }
.m-rule { margin: 0; }

/* data tables (statistics) */
.m-table-wrap { overflow-x: auto; margin: 4px 0; }
.m-table { border-collapse: collapse; font-size: 15px; min-width: 100%; }
.m-table th, .m-table td { border: 1px solid var(--line); padding: 5px 8px; text-align: center; white-space: nowrap; }
.m-table th { background: var(--surface-2); font-weight: 600; }
.m-info.has-fig .m-table-wrap { grid-column: 1 / -1; }

/* model test (#/math/exam): clock bar on top, question grid, result */
.m-timer { position: sticky; top: calc(6px + env(safe-area-inset-top)); z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; margin-bottom: 10px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; }
.m-timer-time { font-size: 20px; font-variant-numeric: tabular-nums; }
.m-timer.is-low { color: var(--bad); background: var(--bad-soft); }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.m-grid button { min-height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.m-grid button.is-answered { background: var(--brand-soft); border-color: var(--brand); }
.m-grid button.is-current { outline: 2px solid var(--brand); outline-offset: 1px; }
.m-score { font-size: 52px; font-weight: 800; color: var(--stage, var(--brand)); line-height: 1.1; }
.m-score span { font-size: 24px; color: var(--ink-soft); }
.m-exam-parts { margin: 0 auto; min-width: 0; width: 100%; max-width: 320px; }
.m-exam-past { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
/* a worked explanation: each step on its own line (an → / ⇒ in the markdown, see steps() in js/math.js) */
.m-steps { display: block; margin-top: 2px; }
.m-step { display: block; }
.m-step + .m-step { margin-top: 2px; }
/* board importance of a type (⭐, from **বোর্ডে:** in the lesson md) */
.m-stars { white-space: nowrap; font-size: 13px; letter-spacing: -1px; vertical-align: 1px; }
/* own test (#/math/custom): chapter checkboxes by part, count chips */
.m-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.m-pick legend { font-weight: 700; color: var(--stage, var(--brand)); margin-bottom: 4px; }
.m-pick-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.m-pick-row input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.m-pick-row:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
/* the explanation reads in the normal text colour; only its verdict line is green / red */
.feedback.m-explain { color: var(--ink); }
.m-card { margin-top: 14px; }
.m-head h1 { margin: 2px 0 4px; }
.m-load { margin-top: 24px; }
.m-list .m-stars-note { margin: 4px 0 8px; }
.m-time-line { text-decoration: none; color: inherit; }
/* list rows that are buttons (ভুলের খাতা: a test of one chapter) look like the link rows */
button.rr-row { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
/* tab bar: how many questions wait in the ভুলের খাতা */
.tab-count { position: absolute; top: -6px; right: -14px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
/* E ⇄ M (Captain): small floating switch above the tab bar, for students who have both apps */
.app-switch { position: fixed; right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 7;
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--primary); background: var(--surface); color: var(--brand-text); font: inherit; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow); cursor: pointer; touch-action: manipulation; }
.app-switch[hidden] { display: none; }
.app-switch:active { transform: scale(.97); }
body.has-tabs.has-switch { padding-bottom: calc(112px + env(safe-area-inset-bottom)); } /* the last row is never under the switch */
@media (min-width: 700px) { .app-switch { right: calc(50% - 250px); } }
