/* MCQ অনুশীলন */
/* Tiro Bangla (SIL Open Font License): the main Bangla text font, chosen to look
   like the NCTB textbooks. It has one weight; bold is drawn by the browser. */
@font-face { font-family: "Tiro Bangla"; font-weight: 400; font-display: swap; src: url(../fonts/tiro-bangla-bengali-400-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Tiro Bangla"; font-weight: 400; font-display: swap; src: url(../fonts/tiro-bangla-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hind Siliguri"; font-weight: 400; font-display: swap; src: url(../fonts/hind-siliguri-bengali-400-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 500; font-display: swap; src: url(../fonts/hind-siliguri-bengali-500-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 600; font-display: swap; src: url(../fonts/hind-siliguri-bengali-600-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 700; font-display: swap; src: url(../fonts/hind-siliguri-bengali-700-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 400; font-display: swap; src: url(../fonts/hind-siliguri-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hind Siliguri"; font-weight: 600; font-display: swap; src: url(../fonts/hind-siliguri-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hind Siliguri"; font-weight: 700; font-display: swap; src: url(../fonts/hind-siliguri-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo Da 2"; font-weight: 700; font-display: swap; src: url(../fonts/baloo-da-2-bengali-700-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Baloo Da 2"; font-weight: 800; font-display: swap; src: url(../fonts/baloo-da-2-bengali-800-normal.woff2) format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Baloo Da 2"; font-weight: 700; font-display: swap; src: url(../fonts/baloo-da-2-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo Da 2"; font-weight: 800; font-display: swap; src: url(../fonts/baloo-da-2-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f6f5ef;
  --surface: #ffffff;
  --surface-2: #efeee6;
  --ink: #1d2520;
  --ink-2: #4d5a53;
  --ink-3: #7a857f;
  --line: #e0ded3;
  --brand: #0d6e63;
  --brand-ink: #ffffff;
  --brand-soft: #dff1ec;
  --brand-deep: #0a4f47;
  --accent: #f2a516;
  --accent-soft: #fff2d3;
  --good: #15803d;
  --good-soft: #e3f5e8;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  --warn: #9a6700;
  --warn-soft: #fff6dc;
  --bar: #0d6e63;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 6px 18px rgba(20, 30, 25, .06);
  --font: "Tiro Bangla", "Noto Serif Bengali", "Hind Siliguri", serif;
  --display: "Tiro Bangla", "Noto Serif Bengali", "Hind Siliguri", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121714;
    --surface: #1b221e;
    --surface-2: #232c27;
    --ink: #e9efe9;
    --ink-2: #b4c0b8;
    --ink-3: #85928a;
    --line: #2f3a34;
    --brand: #3fb8a6;
    --brand-ink: #0b1f1b;
    --brand-soft: #173a34;
    --brand-deep: #8fdccf;
    --accent: #f5b83d;
    --accent-soft: #3a2f14;
    --good: #4fc57a;
    --good-soft: #163522;
    --bad: #f0857a;
    --bad-soft: #3d1b18;
    --warn: #e7b54a;
    --warn-soft: #362b12;
    --bar: #3fb8a6;
    --shadow: none;
    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); font-size: 17px; line-height: 1.6;
}
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0 0 .4em; letter-spacing: 0; }
h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; }
h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.narrow { max-width: 720px; }
main { padding: 20px 0 110px; min-height: 70vh; }
@media (min-width: 860px) { main { padding-bottom: 60px; } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; } .mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 14px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 21px; }
.logo .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 19px; }
.topnav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.topnav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.topnav a.on, .topnav a:hover { background: var(--surface-2); color: var(--ink); }
.topnav .desk { display: none; }
@media (min-width: 860px) { .topnav .desk { display: inline-block; } }

/* bottom tabs (phones) */
.tabs-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs-bottom a { flex: 1; text-align: center; text-decoration: none; color: var(--ink-3); font-size: 12.5px; padding: 8px 2px 7px; position: relative; }
.tabs-bottom a .ic { display: block; font-size: 21px; line-height: 1.2; }
.tabs-bottom a.on { color: var(--brand); font-weight: 600; }
.tabs-bottom .dot { position: absolute; top: 4px; left: 54%; background: var(--bad); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 5px; line-height: 17px; }
@media (min-width: 860px) { .tabs-bottom { display: none; } }

/* cards & buttons */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: 6px; }
a.card { display: block; text-decoration: none; color: inherit; transition: transform .12s, border-color .12s; }
a.card:hover { border-color: var(--brand); transform: translateY(-1px); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); padding: 12px 20px; border-radius: 12px;
  font-weight: 600; text-decoration: none; min-height: 48px; font-size: 17px;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn.accent { background: var(--accent); color: #2a1d00; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 15px; border-radius: 9px; }
.btn.block { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.chip.brand { background: var(--brand-soft); color: var(--brand-deep); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tabs button, .pill-tabs a { border: 1.5px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; cursor: pointer; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.pill-tabs .on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* forms */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-weight: 600; margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 11px; padding: 11px 13px; min-height: 48px;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--brand); outline: none; }
.err { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.ok { background: var(--good-soft); color: var(--good); padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.note { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 10px; }

/* landing */
.hero { padding: 34px 0 10px; display: grid; gap: 26px; align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.05fr .95fr; padding-top: 54px; } }
.hero .lead { font-size: 19px; color: var(--ink-2); max-width: 34em; }
.hero .badge { display: inline-block; background: var(--accent-soft); color: var(--warn); padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 14.5px; margin-bottom: 12px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--brand-soft); margin-bottom: 10px; }
.section { padding: 38px 0 6px; }
.price { text-align: left; }
.price .amt { font-family: var(--display); font-size: 34px; font-weight: 800; }
.price.best { border: 2px solid var(--brand); }
.price ul { padding-left: 20px; margin: 10px 0 16px; }
footer.foot { border-top: 1px solid var(--line); padding: 26px 0 120px; color: var(--ink-3); font-size: 14.5px; }
@media (min-width: 860px) { footer.foot { padding-bottom: 30px; } }

/* question card */
.qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qhead .x { margin-left: auto; }
.progressbar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; }
.progressbar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .25s; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
@media (min-width: 700px) { .qcard { padding: 28px; } }
.qmeta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.qctx { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; white-space: pre-line; }
.qtext { font-size: 20px; font-weight: 600; line-height: 1.55; margin-bottom: 14px; white-space: pre-line; }
.stmts { list-style: none; padding: 0; margin: 0 0 16px; }
.stmts li { padding: 6px 0 6px 38px; position: relative; }
.stmts li b { position: absolute; left: 0; width: 30px; color: var(--brand-deep); font-family: Georgia, serif; font-style: italic; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 56px; font-size: 18px;
  transition: border-color .12s, background .12s;
}
.opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.opt .l { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 17px; }
.opt .t { padding-top: 2px; flex: 1; }
.opt .mk { flex: none; font-weight: 700; font-size: 15px; padding-top: 4px; }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .l { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .l { background: var(--bad); color: #fff; }
.opt.dim { opacity: .6; }
.opt.busy { border-color: var(--brand); }
.verdict { margin: 18px 0 6px; padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.verdict.good { background: var(--good-soft); color: var(--good); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.explain { margin-top: 12px; display: grid; gap: 12px; }
.ex { border-radius: 12px; padding: 13px 15px; border: 1px solid var(--line); background: var(--surface); }
.ex h4 { margin: 0 0 6px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.ex p { margin: 0; white-space: pre-line; }
.ex.why { border-left: 5px solid var(--good); }
.ex.wrongs { border-left: 5px solid var(--bad); }
.ex.wrongs ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ex.wrongs li { display: flex; gap: 10px; }
.ex.wrongs li .l { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--bad-soft); color: var(--bad); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.ex.steps { border-left: 5px solid var(--brand); }
.ex.steps ol { margin: 0; padding-left: 22px; }
.ex.steps li { margin: 3px 0; font-family: var(--font); }
.ex.tip { background: var(--accent-soft); border-color: transparent; }
.ex.book { background: var(--surface-2); border-color: transparent; font-size: 15px; color: var(--ink-2); }
.qactions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.qactions .btn.next { flex: 1; min-width: 180px; }
.linkbtn { background: none; border: 0; color: var(--ink-3); cursor: pointer; text-decoration: underline; padding: 6px; font-size: 14.5px; }
.kbd { font-size: 12px; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--ink-3); }
.revnote { font-size: 14.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; margin-top: 8px; }

/* chapter list */
.chap { display: flex; align-items: center; gap: 12px; padding: 13px 15px; }
.chap .n { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-deep); display: grid; place-items: center; font-weight: 700; }
.chap .body { flex: 1; min-width: 0; }
.chap .title { font-weight: 600; }
.chap .sub { font-size: 14px; color: var(--ink-3); }
.chap.empty { opacity: .6; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--bar); }

/* stats */
.stat { padding: 16px; }
.stat .v { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat .k { color: var(--ink-2); font-size: 14.5px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; cursor: default; }
.bars .b i { display: block; width: min(34px, 70%); background: var(--bar); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b i.zero { background: var(--line); }
.bars .b .val { font-size: 13px; color: var(--ink-2); margin-bottom: 3px; }
.bars .b .tt { position: absolute; bottom: 100%; background: var(--ink); color: var(--bg); font-size: 13px; padding: 4px 8px; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .1s; z-index: 2; }
.bars .b:hover .tt, .bars .b:focus .tt { opacity: 1; }
.barlabels { display: flex; gap: 2px; }
.barlabels span { flex: 1; text-align: center; font-size: 13px; color: var(--ink-3); padding-top: 4px; }
.ring { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 28px; }

/* tables (admin) */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.scrollx { overflow-x: auto; }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 15, 12, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .modal-bg { align-items: center; } }
.modal { background: var(--surface); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 20px; }
@media (min-width: 700px) { .modal { border-radius: 18px; } }
.toast { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; z-index: 60; max-width: 90vw; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--surface-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-bar { background: var(--accent); color: #2a1d00; text-align: center; font-size: 14px; padding: 6px 10px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.desk-only { display: none; }
@media (min-width: 860px) { .desk-only { display: block; } }
.topnav a.btn { color: var(--brand-ink); background: var(--brand); }
.topnav a.btn:hover { color: var(--brand-ink); background: var(--brand); }
.verdict, #qcard { scroll-margin-top: 76px; }

/* Language switch (বাংলা / English) */
.langsw {
  margin-left: 6px; min-height: 38px; padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--brand); background: transparent; color: var(--brand);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.langsw:hover { background: var(--brand-soft); }
.langsw:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.langpick { border: 0; padding: 0; margin: 0 0 14px; }
.langpick legend { font-weight: 500; margin-bottom: 6px; padding: 0; }
.langpick label { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; min-height: 40px; cursor: pointer; }
html[lang="en"] { --font: "Hind Siliguri", system-ui, sans-serif; --display: "Baloo Da 2", "Hind Siliguri", system-ui, sans-serif; }
.logo, .topnav a { white-space: nowrap; }
@media (max-width: 420px) {
  .topnav { gap: 2px; }
  .topnav a { padding: 8px 8px; }
  .topnav a.btn.small { padding: 6px 10px; }
  .langsw { padding: 4px 9px; min-height: 34px; font-size: 13px; margin-left: 2px; }
  .logo { font-size: 17px; }
}
/* Narrow phones: the header must fit the logo, its links and the language button.
   Parents see text links in the header (students use the bottom bar), so the
   site name beside the ✓ mark is hidden for them; the mark still links home. */
@media (max-width: 420px) {
  .topnav a.cta { display: none; }
  .top.links .logo .name { display: none; }
}
@media (max-width: 340px) { .logo { font-size: 15px; gap: 7px; } .logo .mark { width: 30px; height: 30px; } }

/* ---------- diagrams ---------- */
.qfig { margin: 0 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; }
.qfig img { display: block; margin: 0 auto; max-width: 100%; height: auto; max-height: 300px; }
.ex .qfig { margin: 10px 0 0; }

/* ---------- save / note / revision buttons ---------- */
.studybar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.studybar .tool { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 14.5px; cursor: pointer; }
.studybar .tool:hover { border-color: var(--brand); }
.studybar .star.on { background: var(--accent-soft); border-color: var(--accent); color: var(--warn); font-weight: 600; }
.mynote { flex-basis: 100%; background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; font-size: 15px; white-space: pre-line; }
.savedq .qline { font-weight: 600; margin: 6px 0 8px; }
.savedq .mynote { margin-bottom: 8px; }

/* ---------- revision cards ---------- */
.revcard h2 { margin: 2px 0 10px; }
.revcard h4 { margin: 14px 0 6px; font-size: 16px; display: flex; gap: 8px; }
.revcard ul { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.revcard .keys li { font-family: var(--font); background: var(--brand-soft); border-radius: 8px; padding: 4px 10px; list-style: none; margin-left: -20px; }
.revcard .traps li::marker { color: var(--bad); }
.revlayout { display: grid; gap: 14px; }
@media (min-width: 860px) { .revlayout { grid-template-columns: 260px 1fr; align-items: start; } }

/* ---------- weak chapters ---------- */
.weak .topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.weak .row.small { gap: 14px; margin-top: 6px; }
.feature-link h3 { margin-bottom: 4px; }

/* ---------- model tests ---------- */
.testcard h3 { margin: 0; }
.testcard.locked { opacity: .75; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.exambar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.exambar .info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 140px; }
.exambar .timer { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep); }
.exambar .timer.warn { background: var(--warn-soft); color: var(--warn); }
.exambar .timer.bad { background: var(--bad-soft); color: var(--bad); }
.examlist { display: grid; gap: 14px; }
.examq { position: relative; padding-top: 18px; scroll-margin-top: 90px; }
.examq .qno { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-bottom: 10px; padding: 0 6px; }
.examq .qtext { font-size: 18.5px; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel .l { background: var(--brand); color: var(--brand-ink); }
.examq .clear { margin-top: 6px; }
.qnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.qnav button { font: inherit; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.qnav button.done { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.qnav small { font-size: 11px; }
.chapres { display: grid; gap: 12px; }
.meter.low > i { background: var(--bad); }
@media (max-width: 520px) {
  .exambar { padding: 8px 10px; gap: 8px; }
  .exambar .info { flex-basis: 100%; }
  .exambar .timer { font-size: 21px; }
  .tabs-bottom a { font-size: 11.5px; }
}

/* ---------- daily challenge ---------- */
.chip.accent { background: var(--accent-soft); color: var(--warn); }
.card.daily { border: 2px solid var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%); }
.card.daily.done { border-color: var(--good); background: linear-gradient(135deg, var(--good-soft), var(--surface) 60%); }
.card.daily h3 { margin: 0; }
.card.daily .meter { margin: 6px 0 12px; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--warn); }
.streak.big { font-size: 26px; justify-content: center; margin: 4px 0 10px; }
.badgerow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.badgerow .bdg { font-size: 22px; line-height: 1; padding: 4px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 10px; border-radius: 14px; background: var(--surface-2); opacity: .6; }
.badge-card.on { opacity: 1; background: var(--accent-soft); }
.badge-card .ic { font-size: 30px; line-height: 1.2; }

/* ---------- offline chapters ---------- */
.offline-bar { background: var(--ink); color: var(--surface); text-align: center; font-size: 14px; padding: 6px 10px; font-weight: 600; }
.card.pack { display: flex; flex-direction: column; gap: 6px; }
.packrow { padding: 8px 0; border-top: 1px solid var(--line); gap: 10px; }
.packrow:first-of-type { border-top: 0; }

/* terms page */
.terms h2 { font-size: 20px; margin-bottom: 6px; }
.terms ul { padding-left: 1.2em; }
.terms li { margin: 6px 0; }
.terms p, .terms li { line-height: 1.75; }

/* my exam: chapter checklist */
.chpick { display: grid; gap: 6px; margin: 10px 0; }
@media (min-width: 760px) { .chpick { grid-template-columns: 1fr 1fr; } }
.chpick label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.chpick input { margin-top: 5px; }

/* install card */
.installcard { border: 2px dashed var(--brand); }

/* formula sheets */
.fjump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.fjump a { min-width: 36px; text-align: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.fsec { margin-bottom: 14px; }
.fsec h2 { font-size: 19px; margin-bottom: 8px; }
.ftable { width: 100%; border-collapse: collapse; }
.ftable td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.ftable td.f { font-weight: 600; width: 50%; }
.ftable td.m { color: var(--ink-2, #444); font-size: 14.5px; }
@media (max-width: 600px) { .ftable td { display: block; width: auto; border-top: 0; padding: 2px 0; } .ftable tr { display: block; border-top: 1px solid var(--line); padding: 8px 0; } }
.printonly { display: none; }
@media print {
  header.top, nav.tabs-bottom, .noprint, .demo-bar, .offline-bar, footer.foot { display: none !important; }
  .printonly { display: block; font-size: 20px; }
  .fsec { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}

/* ---------- how-to videos ---------- */
.pill-tabs button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.helpgrid { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .helpgrid { grid-template-columns: minmax(0, 380px) 1fr; } .helppage { max-width: 900px; } }
.helpgrid video { width: 100%; max-height: 78vh; aspect-ratio: 9 / 16; background: #0d6e63; border-radius: var(--radius); display: block; margin: 0 auto; }
.helpgrid video::cue { font-family: var(--font); line-height: 1.35; background: rgba(20, 24, 30, .82); color: #fff; }
.helpsteps { margin: 8px 0 0; padding-left: 22px; }
.helpsteps li { margin: 4px 0; }
.helpsteps .linkbtn { text-align: left; color: var(--brand-deep); font-size: inherit; padding: 2px 0; }
