:root {
  --bg: #eef2f9;
  --card: #ffffff;
  --text: #16203a;
  --muted: #64708a;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, .1);
  --navy: #115e59;
  --red: #ea580c;
  --border: #dbe1ee;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --bad: #d11a2a;
  --bad-bg: #fdecee;
  --warn: #b7791f;
  --warn-bg: #fdf4e3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1422; --card: #182033; --text: #e8ecf6; --muted: #98a2bb;
    --accent: #2dd4bf; --accent-soft: rgba(45, 212, 191, .14);
    --border: #2a3450; --ok: #34c06a; --ok-bg: #12301f; --bad: #ff5a67; --bad-bg: #3a1720;
    --warn: #f0b84a; --warn-bg: #3a2c12;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
h2 { font-size: 1.3rem; margin: 0 0 18px; line-height: 1.4; }

/* Icons from the sprite in index.html */
.ico {
  width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Header ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; max-width: 760px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--shadow); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; }
.brand-text span { font-size: .78rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.brand-text strong, .brand-text span { white-space: nowrap; }
/* Narrow phones: when the timer joins the buttons there is no room for the title, keep just the logo. */
@media (max-width: 420px) {
  .topbar:has(.timer:not(.hidden)) .brand-text { display: none; }
}
.topbar-right { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer;
  font-size: 1.05rem; box-shadow: var(--shadow); transition: transform .12s, border-color .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn:active { transform: scale(.94); }
.timer {
  display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums; font-weight: 700; padding: 8px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.timer.low { color: var(--bad); border-color: var(--bad); animation: pulse 1s infinite; }

/* ---- Card ---- */
.card {
  max-width: 760px; margin: 4px auto 40px; background: var(--card);
  border: 1px solid var(--border); border-radius: 20px; padding: 26px; box-shadow: var(--shadow);
}
.view { animation: fadeUp .3s ease both; }

/* ---- Home ---- */
.hero { text-align: center; padding: 6px 0 18px; }
.hero-logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow); animation: float 3s ease-in-out infinite; }
.hero h2 { font-size: 1.5rem; margin: 14px 0 6px; }
.hero p { margin: 0 auto; color: var(--muted); max-width: 420px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 20px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 14px 8px; border-radius: 14px; background: var(--accent-soft); color: var(--accent);
}
.tile .ico { font-size: 1.3rem; margin-bottom: 4px; }
.tile b { font-size: 1.35rem; color: var(--text); }
.tile span { font-size: .78rem; color: var(--muted); }
.tile-btn {
  font: inherit; border: 2px dashed var(--accent); cursor: pointer;
  transition: transform .12s, background .2s, border-color .2s;
}
.tile-btn:active { transform: scale(.96); }
.tile-btn em { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--accent); margin-top: 2px; }
.tile-btn.on { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.tile-btn.on em { color: var(--ok); }
/* Name + question set */
/* minmax(0, 1fr): let the column shrink to the card, or the name box's natural width pushes the
   button off narrow phones. */
.name-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 8px; }
.name-form label { font-weight: 700; font-size: 1.05rem; }
.name-row { display: flex; gap: 8px; }
.name-row input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--card); color: var(--text); font: inherit; font-size: 1.05rem;
}
.name-row .btn { flex: none; }
.name-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.name-form .hint { margin: 0; }
.user-box { margin-bottom: 16px; }
.user-head { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg); }
.avatar {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--accent)); color: #fff; font-weight: 800; font-size: 1.2rem;
}
.user-hello { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-hello strong { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-hello span { font-size: .82rem; color: var(--muted); }
.btn.small { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.label { font-weight: 700; margin: 16px 0 8px; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mode {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px;
  border: 2px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text);
  font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .12s;
}
.mode:active:not(:disabled) { transform: scale(.96); }
.mode:disabled { opacity: .4; cursor: not-allowed; }
.mode .ico { font-size: 1.15rem; color: var(--accent); }
.mode.ok .ico { color: var(--ok); }
.mode.bad .ico { color: var(--bad); }
.mode b { font-size: .85rem; }
.mode span { font-size: 1.1rem; font-weight: 800; }
.mode.active { border-color: var(--accent); background: var(--accent-soft); }
.mode.ok.active { border-color: var(--ok); background: var(--ok-bg); }
.mode.bad.active { border-color: var(--bad); background: var(--bad-bg); }
.saved-note { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; font-size: .9rem; margin: 0 0 6px; }
@media (max-width: 380px) { .modes { grid-template-columns: repeat(2, 1fr); } }

.how { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .92rem; }
.how .ico { color: var(--accent); font-size: 1.15rem; }
.how b { color: var(--text); }
.disclaimer { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; line-height: 1.45; text-align: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 11px 18px;
  font: inherit; font-weight: 650; cursor: pointer; transition: transform .12s, filter .15s, background .15s;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(29, 78, 216, .28); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--border); }
.btn.ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.big { width: 100%; padding: 16px; font-size: 1.1rem; border-radius: 14px; }

/* ---- Question ---- */
.progress-row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; font-weight: 600; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn); font-weight: 750;
}
.pill .ico { fill: currentColor; }
.pill.bump { animation: pop .4s ease; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 22px; }
.dot {
  width: 22px; height: 8px; padding: 0; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--border); transition: transform .15s, background .2s;
}
.dot:disabled { cursor: default; }
.dot:hover:not(:disabled) { transform: scaleY(1.5); }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.current { background: var(--accent); opacity: .45; }
.dot.viewing { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Mock test: answered / flagged, no right or wrong until the end */
.dot.answered { background: var(--accent); }
.dot.partial { background: var(--accent); opacity: .4; } /* select-two question with only one ticked */
.dot.flagged { box-shadow: 0 -5px 0 -1px var(--warn); } /* orange mark above, keeps the answered colour */
.dot.flagged:not(.answered):not(.partial) { background: var(--warn-bg); }

/* ---- Mock test ---- */
.mock-btn { margin-top: 10px; justify-content: flex-start; gap: 14px; text-align: left; padding: 13px 16px; }
.mock-btn .ico { font-size: 1.4rem; color: var(--accent); flex: none; }
.mock-text { display: flex; flex-direction: column; gap: 2px; }
.mock-text small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.submit-summary { list-style: none; padding: 0; margin: 4px 0 14px; display: grid; gap: 6px; text-align: left; }
.submit-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--bg); font-size: .92rem; }
.submit-summary li b { font-weight: 750; }
.submit-summary li.warn { background: var(--warn-bg); color: var(--warn); }
.review-choices { display: grid; gap: 8px; margin-bottom: 4px; }
.review-choices .btn { width: 100%; }
.select-left { color: var(--warn); font-weight: 750; }
/* ---- Free version / unlock ---- */
.free-box {
  width: 100%; display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px;
  border: 1px solid var(--warn); border-radius: 14px; background: var(--warn-bg); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.free-box > .ico { font-size: 1.4rem; color: var(--warn); flex: none; }
.free-box span { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.free-box small { color: var(--muted); font-size: .82rem; }
.free-box em { font-style: normal; font-weight: 750; color: #fff; background: var(--accent); padding: 7px 12px; border-radius: 10px; white-space: nowrap; }
.alert-icon.unlock { background: var(--warn-bg); color: var(--warn); }
.unlock-list { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; gap: 8px; text-align: left; }
.unlock-list li { display: flex; gap: 10px; align-items: center; font-size: .95rem; }
.unlock-list .ico { color: var(--ok); flex: none; }
.unlock-status { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .9rem; }
.mock-btn.locked .ico { color: var(--warn); }
.flag-btn.on { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.mock-summary { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: .9rem; font-weight: 600; }
.mock-summary .ico { color: var(--accent); flex: none; }

.qbody.enter { animation: slideIn .28s ease both; }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.q-top .select-note { margin: 0; }
.listen-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--accent);
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; transition: transform .12s, background .15s;
}
.listen-btn:active { transform: scale(.95); }
.listen-btn.speaking { background: var(--accent); border-color: var(--accent); color: #fff; animation: pulse 1.2s infinite; }
.icon-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.q-top { flex-wrap: wrap; }
.q-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.tool-chip {
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.tool-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg-btn {
  padding: 5px 9px; border: 0; background: var(--card); color: var(--muted);
  font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.active { background: var(--accent); color: #fff; }

/* Hindi translation lines */
.hi-line { margin: -10px 0 16px; color: var(--muted); font-size: 1.05rem; line-height: 1.5; }
.option .hi { display: block; margin-top: 2px; font-size: .9rem; color: var(--muted); }
.option.correct .hi, .option.wrong .hi { color: inherit; opacity: .8; }
.hi-block { display: block; margin-top: 4px; color: var(--muted); }
.explain-box p.hi-block { margin: 2px 0 0; }
.review-item .hi-block { font-size: .85rem; margin-top: 2px; }
.hi-glyph { font-weight: 800; font-size: 1.1rem; width: 1.2em; text-align: center; }
.select-note {
  display: inline-block; margin: 0 0 10px; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em;
}
.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border: 2px solid var(--border); border-radius: 14px;
  cursor: pointer; background: transparent; color: inherit; font: inherit;
  transition: border-color .15s, background .15s, transform .12s;
}
.option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.option:active:not(:disabled) { transform: scale(.985); }
.option:disabled { cursor: default; }
.option .letter {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); font-weight: 750; font-size: .9rem; color: var(--muted);
  transition: background .15s, color .15s;
}
.option .label { flex: 1; }
.option .mark { font-size: 1.35rem; display: flex; }
.option .mark .ico { stroke-width: 2.8; }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.option.selected .letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.option.correct { border-color: var(--ok); background: var(--ok-bg); }
.option.correct .letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.correct .mark { color: var(--ok); }
.option.wrong { border-color: var(--bad); background: var(--bad-bg); }
.option.wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.option.wrong .mark { color: var(--bad); }
.option.shake { animation: shake .45s ease; }
.option.pop { animation: pop .45s ease; }
.option .tag {
  display: inline-block; font-size: .7rem; font-weight: 700; color: var(--muted); margin-left: 8px;
  padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); vertical-align: 2px;
}

.hint-box, .explain-box {
  display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  animation: fadeUp .25s ease both;
}
.hint-box { border: 1px dashed var(--warn); background: var(--warn-bg); }
.hint-box .ico { color: var(--warn); font-size: 1.2rem; }
.explain-box { flex-direction: column; gap: 4px; border: 1px solid var(--border); background: var(--accent-soft); }
.explain-box .explain-head { display: flex; align-items: center; gap: 8px; }
.explain-box p { margin: 0; }
.explain-box.ok { border-color: var(--ok); background: var(--ok-bg); }
.explain-box.ok .explain-head { color: var(--ok); }
.explain-box.bad { border-color: var(--bad); background: var(--bad-bg); }
.explain-box.bad .explain-head { color: var(--bad); }
.explain-box.warn { border-color: var(--warn); background: var(--warn-bg); }
.explain-box.warn .explain-head { color: var(--warn); }

.actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.actions.center { justify-content: center; }

/* ---- Results ---- */
.verdict {
  display: flex; align-items: center; gap: 22px; padding: 18px; border-radius: 18px; margin-bottom: 18px;
  border: 2px solid var(--border);
}
.verdict.pass { border-color: var(--ok); background: var(--ok-bg); }
.verdict.fail { border-color: var(--bad); background: var(--bad-bg); }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring-bg { stroke: var(--card); }
.ring-fg { stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }
.verdict.pass .ring-fg { stroke: var(--ok); }
.verdict.fail .ring-fg { stroke: var(--bad); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.verdict-text h2 { margin: 8px 0 4px; font-size: 1.35rem; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px;
  font-weight: 850; letter-spacing: .1em; color: #fff; font-size: .95rem;
}
.badge.pass { background: var(--ok); }
.badge.fail { background: var(--bad); }
.badge .ico { stroke-width: 3; }
.result { margin: 0; color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 8px 12px; font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.chip:active { transform: scale(.95); }
.chip .count { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--bg); text-align: center; font-size: .8rem; }
.chip.ok .ico { color: var(--ok); }
.chip.bad .ico { color: var(--bad); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active .ico { color: #fff; }
.chip.active .count { background: rgba(255, 255, 255, .22); }
.hint { color: var(--muted); font-size: .85rem; }

.review-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.review-list li { animation: fadeUp .3s ease both; }
.review-item {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--border); border-left: 5px solid; border-radius: 12px;
  background: var(--card); color: inherit; font: inherit; cursor: pointer; transition: transform .12s, box-shadow .15s;
}
.review-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.review-item.correct { border-left-color: var(--ok); }
.review-item.wrong { border-left-color: var(--bad); }
.review-item .icon {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff;
}
.review-item .icon .ico { stroke-width: 3; font-size: .9rem; }
.review-item.correct .icon { background: var(--ok); }
.review-item.wrong .icon { background: var(--bad); }
.review-item .body { flex: 1; min-width: 0; }
.review-item .qtext { display: block; font-weight: 600; }
.review-item .detail { display: block; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.review-item .detail b { color: var(--text); }
.review-item .go { flex: none; align-self: center; color: var(--muted); }
.review-empty { color: var(--muted); text-align: center; padding: 16px; }

/* ---- Progress / statistics ---- */
.stats-link {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .12s;
}
.stats-link:hover { border-color: var(--accent); }
.stats-link:active { transform: scale(.985); }
.stats-link > .ico:first-child { color: var(--accent); font-size: 1.3rem; }
.stats-link > .ico:last-child { color: var(--muted); }
.stats-link span { flex: 1; display: flex; flex-direction: column; }
.stats-link small { color: var(--muted); font-size: .8rem; }

.stats-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.stats-head h2 { margin: 0; }
.hero-stat { padding: 18px; border-radius: 16px; background: var(--bg); text-align: center; }
.hero-label { display: block; font-weight: 600; color: var(--muted); font-size: .9rem; }
.hero-stat > b { display: block; font-size: 3.2rem; line-height: 1.1; font-weight: 750; margin: 4px 0; }
.split { display: flex; gap: 2px; height: 10px; margin: 14px 0 10px; border-radius: 999px; overflow: hidden; background: var(--border); }
.split i { display: block; height: 100%; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.split .ok, .sw.ok { background: var(--ok); }
.split .bad, .sw.bad { background: var(--bad); }
.sw.none { background: var(--border); }
.split-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--muted); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend b { color: var(--text); }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat b { font-size: 1.5rem; font-weight: 750; }
.stat small { font-size: .75rem; color: var(--muted); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 26px 0 4px; font-size: 1.05rem; }
.section-title .ico { color: var(--accent); }
.chart-sub { margin: 0 0 10px; }

/* Column chart: single series, hairline grid, 75% pass line */
.score-chart { position: relative; padding: 0 0 0 34px; }
.plot { position: relative; height: 170px; border-bottom: 1px solid var(--border); }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); opacity: .6; }
.gridline span {
  position: absolute; left: -34px; top: -.6em; width: 28px; text-align: right;
  font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.passline { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--muted); z-index: 1; pointer-events: none; }
.passline span {
  position: absolute; right: 0; top: -1.5em; font-size: .7rem; font-weight: 700; color: var(--muted);
  background: var(--card); padding: 0 4px; border-radius: 4px;
}
.cols { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.col {
  flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center;
  padding: 0 2px; border: 0; background: transparent; cursor: pointer; position: relative;
}
.col .bar {
  width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--accent);
  transition: opacity .15s; min-height: 2px;
  transform-origin: bottom; animation: growUp .7s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes growUp { from { transform: scaleY(0); } to { transform: none; } }
.col:hover .bar, .col:focus-visible .bar, .col.on .bar { opacity: .75; }
.col .val { position: absolute; font-size: .72rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.xaxis { display: flex; }
.xaxis span { flex: 1; text-align: center; font-size: .7rem; color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%);
  background: var(--text); color: var(--card); padding: 7px 10px; border-radius: 10px; font-size: .78rem;
  white-space: nowrap; box-shadow: var(--shadow); line-height: 1.35;
}
.chart-empty { padding: 26px 12px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 14px; }

.test-list, .qstat-list, .people-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.test-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--bg);
  font-size: .88rem;
}
.test-list .when { flex: 1; color: var(--muted); }
.test-list .score { font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .05em; color: #fff;
}
.mini-badge .ico { stroke-width: 3; font-size: .85rem; }
.mini-badge.pass { background: var(--ok); }
.mini-badge.fail { background: var(--bad); }

.to-mock { width: 100%; border: 0; font: inherit; font-size: .9rem; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; }
.to-mock span { flex: 1; }
.mock-progress-link { margin-top: 10px; width: 100%; }
.mock-progress-link b span { color: var(--muted); font-weight: 600; }
.to-mock .ico:last-child { color: var(--muted); }
.to-mock:hover { box-shadow: inset 0 0 0 1px var(--accent); }

/* Home page: the Mock Test Journey in short */
.hj-head .ico { color: var(--muted); align-self: center; }
.home-journey {
  display: grid; gap: 10px; width: 100%; margin-top: 10px; padding: 12px 14px; text-align: left;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text);
  font: inherit; cursor: pointer;
}
.home-journey:hover { border-color: var(--accent); }
.home-journey:active { transform: scale(.985); }
.hj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hj-head b { font-size: .95rem; }
.hj-head b span { color: var(--muted); font-weight: 600; }
.hj-head small { color: var(--accent); font-weight: 700; font-size: .82rem; }
.hj-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hj-stats > span { display: grid; justify-items: center; padding: 6px 4px; border-radius: 10px; background: var(--bg); text-align: center; }
.hj-stats b { font-size: 1.25rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hj-stats small { color: var(--muted); font-size: .72rem; }
.hj-stats .ok b { color: var(--ok); }
.hj-steps { display: flex; align-items: center; }
/* Many mock tests: steps wrap into rows instead of a line */
.hj-steps.many { flex-wrap: wrap; gap: 6px; }
.hj-steps.many .hj-line { display: none; }
.hj-step {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: .85rem; background: var(--bg); color: var(--muted); border: 2px solid var(--border);
}
.hj-step .ico { font-size: .85rem; stroke-width: 3; }
.hj-step.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.hj-step.next { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.hj-step.started { background: var(--warn); border-color: var(--warn); color: #fff; }
.hj-step.locked { opacity: .6; }
.hj-line { flex: 1; min-width: 6px; height: 3px; background: var(--border); }
.hj-line.done { background: var(--ok); }
.hj-note { color: var(--muted); font-size: .8rem; }

/* Mock Test Journey: every numbered mock test, done / unfinished / next / not started */
.mock-note { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: .88rem; font-weight: 600; }
.mock-note:empty { display: none; }
.journey-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 8px 0 4px; }
.journey-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .6s ease; }
.journey-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.journey-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--border); font-size: .88rem; min-width: 0;
}
.journey-list li.next { border-color: var(--accent); background: var(--accent-soft); }
.journey-list .num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; background: var(--bg); color: var(--muted); font-variant-numeric: tabular-nums;
}
.journey-list li.done .num { background: var(--ok); color: #fff; }
.journey-list li.started .num { background: var(--warn); color: #fff; }
.journey-list li.next .num { background: var(--accent); color: #fff; }
.journey-list .what { flex: 1; min-width: 0; display: grid; }
.journey-list .what small { color: var(--muted); overflow-wrap: anywhere; }
.journey-list .tag { flex: none; font-size: .72rem; font-weight: 800; letter-spacing: .04em; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.journey-list li.next .tag { color: var(--accent); }
.journey-list li.started .tag { color: var(--warn); }
.journey-list li.has-btn { flex-wrap: wrap; }
.journey-btn { flex: none; padding: 6px 12px; font-size: .82rem; gap: 6px; }
/* Narrow phones: the button goes on its own line under the test, full width */
@media (max-width: 420px) {
  .journey-list li.has-btn .journey-btn { flex-basis: 100%; justify-content: center; }
}
.ok-num { color: var(--ok); }
.bad-num { color: var(--bad); }
.qchip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .85rem; font-weight: 650; cursor: pointer;
}
.qchip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.qstat-list li { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.qstat-list li.more-row { border: 0; padding: 4px 0 0; }
.more-row .btn { width: 100%; }
.qstat-list .qt { font-weight: 600; font-size: .92rem; }
.qstat-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: .82rem; color: var(--muted); }
.qstat-row .cnt { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.qstat-row .cnt.ok .ico { color: var(--ok); }
.qstat-row .cnt.bad .ico { color: var(--bad); }
.qstat-row .ico { stroke-width: 3; }
.meter { flex: 1; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; }
.meter i.good { background: var(--ok); }
.meter i.mid { background: var(--warn); }
.meter i.low { background: var(--bad); }
.qstat-row .pct { min-width: 38px; text-align: right; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.now-tag { font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); }
.people-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.people-list li.me { border-color: var(--accent); background: var(--accent-soft); }
.people-list .avatar { width: 38px; height: 38px; font-size: 1rem; }
.people-list .who { flex: 1; min-width: 0; }
.people-list .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-list .who small { color: var(--muted); font-size: .8rem; }
.people-list .meter i { background: var(--accent); }
.people-list .big { font-size: 1.15rem; font-weight: 750; min-width: 46px; text-align: right; }

/* ---- Dialogs ---- */
dialog {
  border: 1px solid var(--border); border-radius: 18px; background: var(--card); color: var(--text);
  padding: 22px; width: min(440px, 92vw); box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
dialog[open] { animation: popIn .22s ease both; }
dialog::backdrop { background: rgba(10, 15, 30, .5); }
.settings h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.row > span { flex: 1; }
.row-ico { color: var(--accent); }
.row select { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0;
  width: 46px; height: 26px; border-radius: 999px; background: var(--border); cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.alert { text-align: center; }
.alert h3 { margin: 10px 0 6px; }
.alert-icon {
  width: 56px; height: 56px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: var(--bad-bg); color: var(--bad); font-size: 1.7rem;
}
.alert-icon .ico { stroke-width: 2.8; }
.alert-icon.warn { background: var(--warn-bg); color: var(--warn); }

/* ---- Confetti (on pass) ---- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}

/* ---- Animations ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

/* ---- Phones ---- */
@media (max-width: 520px) {
  .topbar { padding: 12px 14px; }
  .card { padding: 18px 16px; border-radius: 16px; margin: 0 10px 24px; }
  h2 { font-size: 1.15rem; }
  .verdict { flex-direction: column; text-align: center; gap: 10px; }
  .tiles { gap: 8px; }
  .tile b { font-size: 1.15rem; }
  .actions .btn { padding: 11px 14px; }

  /* Question buttons stay pinned to the bottom of the screen so Next never needs scrolling */
  .qactions {
    position: sticky; bottom: 0; z-index: 10; flex-wrap: nowrap; gap: 8px;
    margin: 16px -16px -18px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--border); border-radius: 0 0 16px 16px;
    box-shadow: 0 -6px 16px rgba(16, 24, 40, .06);
  }
  .qactions .btn { padding: 11px 13px; }
  .qactions .btn.ghost span { display: none; } /* icon-only Previous / Hint / All questions */
  .qactions #nextBtn, .qactions #submitBtn { flex: 1; }
  .qactions .spacer { display: none; }
  .listen-btn span { display: none; } /* icon-only Listen on phones */
  .listen-btn { padding: 5px 8px; }
  .options { gap: 8px; }
  .option { padding: 10px 12px; }
  .dots { margin: 10px 0 16px; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .hero-stat > b { font-size: 2.8rem; }
}

/* ---- Study guide ---- */
.study-avatar .ico { font-size: 1.3rem; }
.study-free { margin: 0 0 4px; }
.study-ch { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
.study-ch small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.study-topics { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.study-topic {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .12s;
}
.study-topic:hover { border-color: var(--accent); }
.study-topic:active { transform: scale(.985); }
.study-topic span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.study-topic small { color: var(--muted); font-size: .85rem; }
.study-topic > .ico { color: var(--muted); }
.study-topic.done > .ico { color: var(--ok); }
.study-topic.locked { background: var(--bg); }
.study-topic.locked > .ico { color: var(--warn); }
.study-back {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 4px 0;
  border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer;
}
.study-chapter { margin: 0 0 4px; color: var(--muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.study-chapter .hi { display: inline; margin-left: 6px; text-transform: none; }
#studyTitle .hi { display: block; margin-top: 2px; font-size: 1.05rem; color: var(--muted); }
.study-body { display: grid; gap: 12px; }
.study-sec { padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid transparent; transition: border-color .2s, background .2s; }
.study-sec.reading { border-color: var(--accent); background: var(--accent-soft); }
.study-sec h3 { margin: 0 0 8px; font-size: 1.02rem; color: var(--navy); }
.study-sec ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.study-sec .hi { display: block; margin-top: 2px; color: var(--muted); font-size: .95rem; }
.study-sec h3 .hi { font-size: .9rem; font-weight: 600; }
@media (prefers-color-scheme: dark) { .study-sec h3 { color: var(--accent); } }
/* Language and voice-over stay at the bottom of the screen while reading. */
.study-bar {
  position: sticky; bottom: 10px; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 18px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow);
}
.study-bar .seg-btn { padding: 7px 12px; font-size: .85rem; }
.study-bar .listen-btn { padding: 7px 14px; font-size: .85rem; }
@media (max-width: 520px) {
  .study-bar .listen-btn span { display: inline; } /* the study bar has room for the word */
  .study-bar .seg-btn { padding: 7px 10px; }
}

/* ---- Language and subject choice ---- */
.lang-seg .seg-btn { white-space: nowrap; }
.seg.wide { display: flex; width: 100%; }
.seg.wide .seg-btn { flex: 1; padding: 10px 6px; font-size: .92rem; }
.subject-select {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
}
#mockDialog .label { margin: 12px 0 8px; font-weight: 700; text-align: left; }
#mockDialog .hint { text-align: left; }

/* Short message at the bottom of the screen */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 520px; margin: 0 auto;
  padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--card);
  font-size: .9rem; line-height: 1.45; box-shadow: var(--shadow);
}

/* Plans in the unlock dialog */
.plans { display: grid; gap: 10px; margin: 12px 0; }
.plan-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 12px 14px; font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: var(--card); border: 2px solid var(--border); border-radius: 14px;
}
.plan-btn.best { border-color: var(--accent); background: var(--accent-soft); }
.plan-btn b { display: block; }
.plan-btn small { display: block; margin-top: 2px; color: var(--muted); }
.plan-btn em { flex: none; font-style: normal; font-size: 1.2rem; font-weight: 800; color: var(--accent); }

/* ======== Colourful home page ======== */
.home-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap;
  margin: 22px 0 10px; font-size: 1.1rem;
}
.home-title small { color: var(--muted); font-size: .8rem; font-weight: 600; }

/* Subject cards: tap one to practise it. Each subject has its own colour (white text on a dark-enough gradient). */
.subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.subj {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 116px; padding: 14px; border: 0; border-radius: 18px; color: #fff; text-align: left;
  font: inherit; cursor: pointer; background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 6px 16px -8px var(--c1); transition: transform .15s ease, box-shadow .15s ease;
  animation: popIn .35s ease both;
}
.subj::after { /* soft bubble in the corner */
  content: ''; position: absolute; right: -26px; bottom: -26px; width: 100px; height: 100px;
  border-radius: 50%; background: rgba(255, 255, 255, .13); pointer-events: none;
}
.subj:hover { transform: translateY(-3px); box-shadow: 0 14px 24px -10px var(--c1); }
.subj:active { transform: scale(.97); }
.subj:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.subj i {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px;
  background: rgba(255, 255, 255, .22); font-style: normal; font-size: 1.4rem;
}
.subj i.glyph { font-weight: 800; font-size: 1.15rem; }
.subj span { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.subj b { font-size: 1rem; line-height: 1.2; }
.subj small { font-size: .82rem; opacity: .92; }
.subj.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
.subj.wide span { flex: 1; }
.subj .go { position: relative; z-index: 1; font-size: 1.15rem; opacity: .9; }
.subj-all { --c1: #0f766e; --c2: #0d9488; }
.subj-haryana { --c1: #1e40af; --c2: #4f46e5; }
.subj-awareness { --c1: #c2410c; --c2: #ea580c; }
.subj-science { --c1: #047857; --c2: #059669; }
.subj-maths { --c1: #b91c1c; --c2: #e11d48; }
.subj-reasoning { --c1: #6d28d9; --c2: #9333ea; }
.subj-english { --c1: #0e7490; --c2: #0891b2; }
.subj-hindi { --c1: #be185d; --c2: #db2777; }
.subject-grid .subj:nth-child(2) { animation-delay: .04s; }
.subject-grid .subj:nth-child(3) { animation-delay: .08s; }
.subject-grid .subj:nth-child(4) { animation-delay: .12s; }
.subject-grid .subj:nth-child(5) { animation-delay: .16s; }
.subject-grid .subj:nth-child(6) { animation-delay: .2s; }
.subject-grid .subj:nth-child(7) { animation-delay: .24s; }
.subject-grid .subj:nth-child(8) { animation-delay: .28s; }

/* Mock test and Study guide as coloured cards */
.btn.mock-btn {
  margin-top: 0; border: 0; color: #fff; background: linear-gradient(135deg, #4338ca, #7e22ce);
  box-shadow: 0 10px 22px -10px #4338ca;
}
.btn.mock-btn .ico, .btn.mock-btn.locked .ico { color: #fff; }
.mock-btn .mock-text small { color: rgba(255, 255, 255, .88); }
.btn.mock-btn:hover:not(:disabled) { color: #fff; filter: brightness(1.1); }
.btn.mock-btn.locked { background: linear-gradient(135deg, #57534e, #78716c); box-shadow: none; }
.stats-link.study-link { border: 0; color: #fff; background: linear-gradient(135deg, #92400e, #b45309); }
.study-link > .ico:first-child, .study-link > .ico:last-child { color: #fff; }
.study-link small { color: rgba(255, 255, 255, .9); }
.study-link:hover { filter: brightness(1.08); }
.row-sub { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; }

/* ======== Scroll layout: every question of a test on one page (Settings → Questions on screen) ======== */
.qlist { display: none; }
.scroll-mode .qlist { display: grid; gap: 14px; }
.scroll-mode #questionText, .scroll-mode #questionHi, .scroll-mode #options, .scroll-mode .q-top > .select-note,
.scroll-mode #listenBtn, .scroll-mode #hintBox, .scroll-mode #explainBox, .scroll-mode .qactions { display: none !important; }
.scroll-mode .q-top { justify-content: flex-end; margin-bottom: 12px; }
.scroll-mode .dots { margin-bottom: 14px; }
/* The count stays in view while scrolling */
.scroll-mode .progress-row {
  position: sticky; top: 0; z-index: 6; margin: -10px -8px 0; padding: 10px 8px;
  background: var(--card); border-radius: 0 0 12px 12px;
}
.qcard {
  padding: 16px; border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 16px;
  background: var(--card); scroll-margin-top: 64px; animation: fadeUp .3s ease both;
}
.qcard.ok { border-left-color: var(--ok); }
.qcard.bad { border-left-color: var(--bad); }
.qcard.answered { border-left-color: var(--accent); }
.qcard.flagged { border-left-color: var(--warn); }
.qcard.glow { animation: glow 1.3s ease; }
@keyframes glow {
  0% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 6px var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; }
}
.qc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.qc-head .select-note { margin: 0; }
.qc-num {
  flex: none; min-width: 32px; height: 32px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px;
  background: linear-gradient(135deg, var(--navy), var(--accent)); color: #fff; font-weight: 800; font-size: .9rem;
}
.qcard.ok .qc-num { background: var(--ok); }
.qcard.bad .qc-num { background: var(--bad); }
.qcard.flagged .qc-num { background: var(--warn); }
.qc-tool {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted);
  font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.qc-tool + .qc-tool { margin-left: 0; }
.qc-tool:hover { border-color: var(--accent); color: var(--accent); }
.qc-tool.on { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.qc-text { margin: 0 0 14px; font-size: 1.08rem; line-height: 1.45; }
.qcard .hi-line { margin: -8px 0 14px; }
.qc-check { margin-top: 12px; }
.qfoot { display: grid; gap: 10px; padding: 16px 0 4px; text-align: center; }
.qfoot p { margin: 0; color: var(--muted); font-weight: 600; }

@media (max-width: 520px) {
  .qcard { padding: 14px 12px; }
  .subj { min-height: 108px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .subj, .qcard { animation: none; }
  .subj:hover { transform: none; }
}

/* ======== Colourful home, part 2: every block has its own colour ======== */
:root {
  --c-blue: #1d4ed8; --c-violet: #6d28d9; --c-orange: #c2410c; --c-pink: #be185d; --c-cyan: #0e7490;
  --t-blue: rgba(37, 99, 235, .1); --t-violet: rgba(124, 58, 237, .1); --t-orange: rgba(234, 88, 12, .1);
  --t-pink: rgba(219, 39, 119, .1); --t-green: rgba(22, 163, 74, .1); --t-red: rgba(220, 38, 38, .09);
  --t-teal: rgba(13, 148, 136, .1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-blue: #7aa7ff; --c-violet: #b69cff; --c-orange: #ff9a5c; --c-pink: #f68ac0; --c-cyan: #4fd6ee;
    --t-blue: rgba(96, 165, 250, .14); --t-violet: rgba(167, 139, 250, .14); --t-orange: rgba(251, 146, 60, .14);
    --t-pink: rgba(244, 114, 182, .14); --t-green: rgba(52, 192, 106, .14); --t-red: rgba(255, 90, 103, .13);
    --t-teal: rgba(45, 212, 191, .13);
  }
}
body { background: radial-gradient(1200px 500px at 50% -120px, var(--t-teal), transparent 70%), var(--bg); }

/* Welcome banner */
.hero {
  position: relative; overflow: hidden; margin: -4px 0 16px; padding: 22px 16px 20px; border-radius: 20px;
  color: #fff; background: linear-gradient(135deg, #0f766e 0%, #1e40af 60%, #6d28d9 100%);
  box-shadow: 0 12px 26px -14px #1e40af;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none;
}
.hero::before { width: 160px; height: 160px; top: -60px; right: -40px; }
.hero::after { width: 110px; height: 110px; bottom: -50px; left: -30px; }
.hero > * { position: relative; }
.hero-logo { width: 72px; height: 72px; box-shadow: 0 8px 18px rgba(0, 0, 0, .25); }
.hero h2 { color: #fff; }
.hero p { color: rgba(255, 255, 255, .88); }

/* Name box */
.user-head { background: linear-gradient(135deg, var(--t-teal), var(--t-violet)); border: 1px solid var(--border); }
.avatar { background: linear-gradient(135deg, #0d9488, #6d28d9); box-shadow: 0 4px 10px -4px #6d28d9; }

/* Links as coloured cards */
.stats-link.progress-link { border: 0; color: #fff; background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.stats-link.mock-progress-link { border: 0; color: #fff; background: linear-gradient(135deg, #155e75, #0f766e); }
.progress-link > .ico:first-child, .progress-link > .ico:last-child,
.mock-progress-link > .ico:first-child, .mock-progress-link > .ico:last-child { color: #fff; }
.progress-link small, .mock-progress-link small { color: rgba(255, 255, 255, .9); }
.progress-link:hover, .mock-progress-link:hover { filter: brightness(1.1); }
.stats-link.progress-link, .stats-link.study-link, .stats-link.mock-progress-link { box-shadow: 0 8px 18px -12px #1e3a8a; }

/* Language: the chosen one is filled with colour */
.seg.wide { border: 0; background: var(--t-teal); padding: 3px; gap: 3px; }
.seg.wide .seg-btn { border: 0; border-radius: 999px; background: transparent; color: var(--accent); }
.seg.wide .seg-btn.active { background: linear-gradient(135deg, #0f766e, #2563eb); color: #fff; box-shadow: 0 4px 10px -6px #2563eb; }
.seg.wide .seg-btn + .seg-btn { border-left: 0; }

/* Which questions: each its own colour; the chosen one filled */
.mode { border-color: transparent; }
.mode[data-mode=all] { background: var(--t-teal); }
.mode.bad { background: var(--t-red); }
.mode.ok { background: var(--t-green); }
.mode[data-mode=new] { background: var(--t-violet); }
.mode[data-mode=new] .ico { color: var(--c-violet); }
.mode.active { color: #fff; border-color: transparent; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5); }
.mode.active .ico { color: #fff; }
.mode[data-mode=all].active { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.mode.bad.active { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.mode.ok.active { background: linear-gradient(135deg, #15803d, #22c55e); }
.mode[data-mode=new].active { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }

/* Questions / to pass / timer */
.tile.t-count { background: var(--t-blue); color: var(--c-blue); }
.tile.t-pass { background: var(--t-green); color: var(--ok); }
.tile-btn { background: var(--t-orange); color: var(--c-orange); border-color: var(--c-orange); }
.tile-btn em { color: var(--c-orange); }

/* Section titles get a coloured bar */
.home-title { padding-left: 10px; border-left: 4px solid #0d9488; border-radius: 2px; }
.home-title + .home-journey, .home-title + .mock-btn { margin-top: 0; }

/* Mock Test Journey: violet card, coloured counts */
.home-journey {
  border-color: transparent; background: linear-gradient(160deg, var(--t-violet), var(--t-blue));
}
.hj-stats > span { background: var(--card); }
.hj-stats > span:nth-child(1) b { color: var(--c-violet); }
.hj-stats > span:nth-child(3) b { color: var(--c-orange); }
.hj-step { background: var(--card); }
.hj-step.next { background: var(--card); }

/* Tips at the bottom: each icon in a coloured square */
.how .ico {
  flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 11px; font-size: 1rem;
}
.how li:nth-child(1) .ico { background: var(--t-teal); color: var(--accent); }
.how li:nth-child(2) .ico { background: var(--t-orange); color: var(--c-orange); }
.how li:nth-child(3) .ico { background: var(--t-pink); color: var(--c-pink); }
.stats-link small span { display: inline; }
.hj-step.started { background: var(--warn); color: #fff; } /* unfinished: stays orange even when it is next */
.disclaimer a { display: inline-block; margin-top: 4px; color: var(--accent); font-weight: 700; }
/* Access code row in the unlock dialog */
.code-row { display: flex; gap: 8px; margin-top: 10px; }
.code-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; letter-spacing: .04em; }
.code-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Disclaimer with official government sources (Google Play: Misleading Claims policy) */
.disclaimer p { margin: 0 0 6px; }
.disclaimer .official a { display: inline; margin: 0; }
