/* ===== NPTEL Practice Hub — styles ===== */
/* Dark + amber "quiz bench" theme */
:root {
  --bg: #f6f3ea; --surface: #ffffff; --surface-2: #faf7ef;
  --text: #1b1810; --muted: #6b6455; --border: #e5dfcd;
  --primary: #f2b01e; --primary-hover: #ffc233; --primary-text: #8a5a00; --primary-soft: #fdf1d1;
  --on-primary: #1a1405; --accent: #f2b01e;
  --ok: #0f7a4f; --ok-soft: #e3f6ec; --bad: #b42323; --bad-soft: #fdeaea;
  --warn: #9a6300; --warn-soft: #fff2d1;
  --shadow: none; --radius: 10px; --radius-sm: 8px;
  --font: "Space Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
[data-theme="dark"] {
  --bg: #0c0e11; --surface: #14171c; --surface-2: #1a1e25;
  --text: #eceff4; --muted: #8e97a6; --border: #262b34;
  --primary: #f2b01e; --primary-hover: #ffc233; --primary-text: #f2b01e; --primary-soft: rgba(242,176,30,.12);
  --on-primary: #1a1405; --accent: #f2b01e;
  --ok: #3ddc97; --ok-soft: rgba(61,220,151,.12); --bad: #ff7070; --bad-soft: rgba(255,112,112,.12);
  --warn: #f2b01e; --warn-soft: rgba(242,176,30,.12);
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.55; overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column;
  transition: background .25s, color .25s;
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0 0 .75rem; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
main.container { padding-top: 1.5rem; padding-bottom: 3rem; flex: 1; outline: none; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ----- Header ----- */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1120px; margin: 0 auto; padding: .65rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; background: none; border: 0; padding: 0; text-align: left; min-width: 0; }
.logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--on-primary); background: var(--primary); flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; letter-spacing: -.01em; }
.brand-course { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34ch; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav-link { background: none; border: 0; padding: .5rem .85rem; border-radius: 10px; font-weight: 600; color: var(--muted); }
.nav-link:hover { background: var(--primary-soft); color: var(--primary-text); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-text); }
.header-actions { display: flex; gap: .4rem; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.icon-btn:hover { background: var(--primary-soft); }
.menu-btn { display: none; }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1.1rem; border-radius: 12px; border: 1px solid transparent; font-weight: 650; transition: transform .12s, background .2s, box-shadow .2s, border-color .2s; text-align: center; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-text); }
.btn-ghost { background: transparent; color: var(--primary-text); padding: .45rem .7rem; }
.btn-ghost:hover:not(:disabled) { background: var(--primary-soft); }
.btn-ghost.danger, .btn.danger { color: var(--bad); }
.btn-ghost.danger:hover:not(:disabled) { background: var(--bad-soft); }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.02rem; }
.btn-danger { background: var(--bad); color: var(--on-primary); }
.btn.active-flag { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.btn.active-flag svg { fill: currentColor; }

/* ----- Cards / layout ----- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card-title { font-size: 1.1rem; margin-bottom: .35rem; }
.section-title { font-size: 1.25rem; margin: 2rem 0 .9rem; }
.page-title { font-size: 1.8rem; }
.page-sub { margin-top: .4rem; max-width: 70ch; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.row-between .section-title { margin-bottom: .9rem; }
.row-gap { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.stack { display: grid; gap: 1.25rem; align-content: start; }

/* ----- Hero ----- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; padding: 2.25rem; border-radius: 24px; border: 1px solid var(--border); background: linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--accent) 12%, var(--surface))); box-shadow: var(--shadow); }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-text); margin-bottom: .6rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.02em; margin-bottom: .6rem; }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 55ch; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.2rem; }
.hero-art { max-width: 280px; justify-self: center; width: 100%; }
.hero-art svg { --accent: var(--accent); }

/* ----- Stats ----- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); margin-bottom: .55rem; }
.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-weight: 600; font-size: .9rem; }
.stat-sub { color: var(--muted); font-size: .78rem; }

/* ----- Settings ----- */
.settings { display: grid; gap: 1rem; }
.seg { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.seg legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-opt span { display: flex; flex-direction: column; border: 2px solid var(--border); border-radius: 12px; padding: .75rem 1rem; background: var(--surface-2); transition: .15s; }
.seg-opt small { color: var(--muted); }
.seg-opt:hover span { border-color: var(--primary); }
.seg-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.toggles { display: flex; gap: 1rem 1.5rem; flex-wrap: wrap; align-items: center; }
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.check small { color: var(--muted); }
.check.disabled { opacity: .5; }
.minutes { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; }
.minutes.disabled { opacity: .5; }
input[type="number"], input[type="search"], select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .55rem .75rem; min-width: 0; max-width: 100%; }
.minutes input { width: 11rem; }
.field { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; margin: .5rem 0; }
.field small { font-weight: 400; color: var(--muted); }
.field.grow { flex: 1 1 220px; }

/* ----- Week cards ----- */
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.week-card { display: flex; flex-direction: column; gap: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; }
.week-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.week-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.week-name { font-size: 1.2rem; font-weight: 800; }
.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.week-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .75rem; font-size: .85rem; color: var(--muted); }
.week-meta b { color: var(--text); }
.progress { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .3s; }
.week-score { font-size: .82rem; color: var(--muted); min-height: 1.3em; }

.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.recent li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.recent li:last-child { border: 0; }

/* ----- Practice page ----- */
.week-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; margin: .8rem 0; }
.week-checks label { display: flex; align-items: center; gap: .4rem; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: .9rem; }
.week-checks input { accent-color: var(--primary); }
.search-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.search-results { display: grid; gap: .75rem; margin-top: .5rem; max-height: 640px; overflow: auto; padding-right: .25rem; }
.sr-item { border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; background: var(--surface-2); }
.sr-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .35rem; flex-wrap: wrap; }
.sr-item ul { margin: .4rem 0; padding-left: 1.2rem; }
.sr-item details summary { cursor: pointer; font-weight: 600; color: var(--primary-text); }
.sr-item .ans { color: var(--ok); font-weight: 700; margin: .3rem 0 0; }
.bm-btn { background: none; border: 1px solid var(--border); border-radius: 8px; padding: .25rem .5rem; font-size: .8rem; font-weight: 600; display: inline-flex; gap: .3rem; align-items: center; }
.bm-btn[aria-pressed="true"] { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.bm-btn[aria-pressed="true"] svg { fill: currentColor; }

/* ----- Quiz ----- */
.quiz-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: .9rem; }
.quiz-title { font-size: 1.15rem; font-weight: 800; }
.quiz-sub { color: var(--muted); font-size: .9rem; }
.quiz-top-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.timer { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: .45rem .8rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text); }
.timer.low { background: var(--bad-soft); color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1.25rem; align-items: start; }
.q-card { padding: 1.5rem; }
.q-meta { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-weight: 700; margin-bottom: .6rem; }
.q-progress { margin-bottom: 1.25rem; }
.q-text { font-size: 1.2rem; font-weight: 650; max-width: 70ch; margin-bottom: 1.1rem; overflow-wrap: anywhere; }
.options { display: grid; gap: .65rem; max-width: 75ch; }
.option { position: relative; display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; border: 2px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; min-height: 52px; }
.option:hover { border-color: var(--primary); }
.option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.option:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.opt-letter { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface); border: 2px solid var(--border); font-size: .9rem; }
.opt-text { flex: 1; overflow-wrap: anywhere; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.selected .opt-letter { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.correct .opt-letter { background: var(--ok); border-color: var(--ok); color: var(--on-primary); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .opt-letter { background: var(--bad); border-color: var(--bad); color: var(--on-primary); }
.option.locked { cursor: default; }
.feedback { margin-top: 1rem; padding: .85rem 1rem; border-radius: 12px; border: 1px solid; max-width: 75ch; }
.feedback.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.feedback.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.feedback strong { font-size: 1.05rem; }
.feedback .acc { color: var(--text); display: block; margin-top: .2rem; }
.q-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.q-nav { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.q-nav .spacer { flex: 1; }
.palette-card h3 { font-size: 1rem; margin-bottom: .6rem; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: .4rem; max-height: 340px; overflow: auto; padding: 2px; }
.pal { height: 40px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface-2); font-weight: 700; position: relative; }
.pal:hover { border-color: var(--primary); }
.pal.answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.pal.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.pal.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.pal.current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pal.marked::after { content: ""; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); border: 1px solid var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .78rem; color: var(--muted); margin-top: .8rem; }
.legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: .3rem; vertical-align: -1px; background: var(--c, var(--border)); border: 1px solid var(--border); }
.palette-summary { margin-top: .8rem; font-size: .9rem; color: var(--muted); }

/* ----- Results ----- */
.results-card { text-align: center; padding: 2rem 1.25rem; }
.score-ring { width: 190px; height: 190px; margin: 0 auto 1rem; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .track { stroke: var(--border); }
.score-ring .bar { stroke: var(--primary); transition: stroke-dashoffset .8s ease; }
.score-ring.good .bar { stroke: var(--ok); }
.btn-danger { color: #fff; }
.score-ring.low .bar { stroke: var(--bad); }
.score-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-center b { font-size: 2.2rem; line-height: 1; }
.score-center span { color: var(--muted); font-size: .9rem; }
.result-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin: 1.5rem 0; }
.rs { border: 1px solid var(--border); border-radius: 12px; padding: .8rem; background: var(--surface-2); }
.rs b { display: block; font-size: 1.5rem; }
.rs.ok b { color: var(--ok); } .rs.bad b { color: var(--bad); } .rs.warn b { color: var(--warn); }
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--border); max-width: 520px; margin: 0 auto 1.2rem; }
.split-bar i { display: block; height: 100%; }
.split-bar .c { background: var(--ok); } .split-bar .w { background: var(--bad); } .split-bar .u { background: var(--warn); }
.result-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }

/* ----- Review ----- */
.review-top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .35rem .9rem; font-weight: 600; font-size: .9rem; }
.filter-btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.review-list { display: grid; gap: 1rem; }
.rv-card { padding: 1.1rem 1.25rem; border-left: 6px solid var(--border); }
.rv-card.correct { border-left-color: var(--ok); } .rv-card.incorrect { border-left-color: var(--bad); } .rv-card.unattempted { border-left-color: var(--warn); }
.rv-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.rv-q { font-weight: 650; margin-bottom: .7rem; overflow-wrap: anywhere; }
.rv-opts { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .4rem; }
.rv-opts li { padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 10px; display: flex; gap: .5rem; justify-content: space-between; flex-wrap: wrap; background: var(--surface-2); }
.rv-opts li.is-answer { border-color: var(--ok); background: var(--ok-soft); }
.rv-opts li.is-yours.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.tag { font-size: .75rem; font-weight: 800; }
.rv-summary { font-size: .92rem; }
.rv-summary b { font-weight: 700; }

/* ----- Misc ----- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1rem 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.footer-inner p { margin: 0; max-width: 70ch; }
dialog { border: 1px solid var(--border); border-radius: 18px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); max-width: min(440px, calc(100vw - 2rem)); width: 100%; }
dialog::backdrop { background: rgba(10,15,30,.55); }
.dialog-body { padding: 1.5rem; }
.dialog-body h2 { font-size: 1.2rem; margin-bottom: .5rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 140%); background: var(--text); color: var(--bg); padding: .65rem 1.1rem; border-radius: 12px; font-weight: 600; z-index: 60; max-width: calc(100vw - 2rem); transition: transform .25s; box-shadow: var(--shadow); }
.toast.show { transform: translate(-50%, 0); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .quiz-layout { grid-template-columns: 1fr; }
  .palette { max-height: 220px; }
}
@media (max-width: 820px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 1.5rem; }
  .hero-art { display: none; }
  .menu-btn { display: grid; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: .6rem 1.25rem 1rem; margin: 0; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav-link { text-align: left; padding: .75rem; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 560px) {
  .container, .header-inner { padding-left: .9rem; padding-right: .9rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .seg { grid-template-columns: 1fr; }
  .brand-course { max-width: 18ch; }
  .week-grid { grid-template-columns: 1fr; }
  .q-card { padding: 1rem; }
  .q-text { font-size: 1.08rem; }
  .q-nav .btn, .result-actions .btn, .hero-actions .btn { flex: 1 1 100%; }
  .q-nav .spacer { display: none; }
  .quiz-top-actions { width: 100%; }
  .quiz-top-actions .btn { flex: 1; }
  .minutes input { width: 100%; }
  .minutes { width: 100%; flex-wrap: wrap; }
  .search-row .field { flex: 1 1 100%; }
  .hero h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* ===== Quiz-bench theme overrides ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, .eyebrow, .stat-label, .week-meta, .week-sub, .panel-title, .chip, .legend { font-family: var(--mono); }
body { font-size: 15px; }
.site-header { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.brand-name { font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; text-decoration: underline; text-underline-offset: 3px; }
.brand-course { font-family: var(--mono); font-size: .7rem; }
.nav-link { font-family: var(--mono); font-size: .78rem; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: transparent; }
.nav-link:hover, .nav-link.active { background: transparent; color: var(--text); text-decoration-color: var(--primary); }
.card, .panel, .stat, .week-card, .focus { box-shadow: none; }
.btn { border-radius: 6px; font-weight: 700; padding: .55rem 1rem; }
.btn-primary { box-shadow: none; }
.btn-secondary { background: transparent; border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--text); }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: .5rem 0 0; font-family: var(--mono); font-size: .75rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--primary-text); }
.eyebrow { font-size: .72rem; color: var(--muted); letter-spacing: .08em; }
.masthead { padding: .5rem 0 1.25rem; }
.masthead h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; margin: .3rem 0 1rem; }
.hl { color: var(--primary); }
.stats { display: flex; gap: 1.75rem 2.25rem; flex-wrap: wrap; }
.stat { background: none; border: 0; padding: 0; }
.stat-ico, .stat-sub { display: none; }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .68rem; color: var(--muted); margin-top: .25rem; font-weight: 400; }
.rule { border: 0; border-top: 1px solid var(--border); margin: 0 0 1.25rem; }
.home-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.side { display: grid; gap: .9rem; position: sticky; top: 76px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.panel-title { font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--text); margin-bottom: .6rem; }
.focus { border: 1px solid var(--primary); border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.focus .panel-title { color: var(--text); }
.focus .hero-actions { margin-top: .75rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 1.5rem 0 .75rem; gap: 1rem; }
.section-head .section-title { margin: 0; }
.section-title { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 .75rem; outline: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; padding: 0; margin: 0 0 .6rem; }
.seg-opt span { border: 0; border-radius: 0; background: transparent; padding: .5rem; text-align: center; font-size: .85rem; }
.seg-opt:hover span { background: var(--surface-2); }
.seg-opt input:checked + span { background: var(--text); color: var(--bg); }
.seg-opt input:focus-visible + span { outline-offset: -3px; }
.settings .toggles { flex-direction: column; align-items: flex-start; gap: .55rem; margin-top: .6rem; font-size: .88rem; }
.minutes { width: 100%; justify-content: space-between; font-size: .88rem; }
.minutes input { width: 7.5rem; }
.week-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.week-card { gap: .45rem; padding: .85rem; border-radius: 10px; background: var(--surface); }
.week-card:hover { transform: none; border-color: var(--primary); }
.week-name { font-size: .95rem; font-weight: 700; }
.week-meta { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.week-meta b { font-weight: 500; color: var(--muted); }
.week-meta b.got { color: var(--primary-text); }
.week-sub { font-size: .68rem; color: var(--muted); min-height: 1.2em; }
.progress { height: 4px; }
.week-card .btn { padding: .5rem; font-size: .85rem; }
.chip { border-radius: 4px; font-weight: 500; letter-spacing: .02em; }
.option, .q-card, .pal, input[type="number"], input[type="search"], select { border-radius: 8px; }
.option.selected { background: var(--primary-soft); }
.option.selected .opt-letter, .pal.current { color: var(--on-primary); }
.quiz-title { font-family: var(--mono); font-size: 1rem; }
.page-title { font-size: 1.6rem; }
.dots { display: none; }
@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
  .side { position: static; order: 2; }
}
@media (max-width: 560px) {
  .week-grid { grid-template-columns: 1fr 1fr; }
  .stats { gap: 1rem 1.5rem; }
  .stats .stat:last-child { grid-column: auto; }
  .focus .hero-actions .btn { flex: 1 1 100%; }
}
.toast { opacity: 0; visibility: hidden; transition: transform .25s, opacity .25s, visibility .25s; }
.toast.show { opacity: 1; visibility: visible; }
