/* Smart Newton - fresh modern design. Brand: navy + Newton red + abacus yellow. */
:root {
  --navy: #0b2a5b;
  --navy-2: #133a78;
  --navy-3: #1d4f9c;
  --red: #e5383b;
  --red-soft: #fdeaea;
  --yellow: #ffc93c;
  --yellow-soft: #fff6dc;
  --green: #16a34a;
  --green-soft: #e7f7ee;
  --blue-soft: #e8f0fd;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #17203a;
  --muted: #5d6784;
  --line: #e3e7f0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 800; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 1rem; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--navy); color: #fff; padding: 1.25rem .9rem; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1rem; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 12px; padding: 3px; }
.brand b { display: block; font-size: 1.05rem; letter-spacing: .2px; }
.brand span { font-size: .75rem; opacity: .75; }
.nav { display: flex; flex-direction: column; gap: .2rem; }
.nav a {
  color: #dfe7f7; padding: .6rem .8rem; border-radius: 10px; display: flex; align-items: center; gap: .7rem; font-weight: 700;
}
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.nav a.active { background: #fff; color: var(--navy); }
.nav .ico { flex: 0 0 22px; width: 22px; display: inline-flex; justify-content: center; font-size: 1.05rem; line-height: 1; overflow: hidden; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; opacity: .55; padding: .6rem .8rem .2rem; }
.sidebar .spacer { flex: 1; }
.userbox { background: rgba(255,255,255,.07); border-radius: 12px; padding: .75rem; font-size: .9rem; }
.userbox b { display: block; }
.userbox .userbranch { display: block; margin-top: .2rem; color: var(--yellow); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox button { margin-top: .5rem; width: 100%; }

.main { min-width: 0; }
.topbar {
  display: none; position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff;
  padding: .6rem 1rem; align-items: center; gap: .75rem;
}
.topbar img { width: 34px; height: 34px; background: #fff; border-radius: 9px; padding: 2px; }
.topbar .grow { font-weight: 800; }
.content { padding: 1.75rem 2rem 3rem; max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: 0; }
.banner {
  background: var(--yellow-soft); border: 1px solid #f3dc9a; color: #6b4e00; padding: .6rem 1rem; border-radius: 12px;
  margin-bottom: 1rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; max-width: 300px; z-index: 40; transform: translateX(-105%); transition: transform .2s; height: 100%; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; }
  .content { padding: 1.1rem 1rem 3rem; }
  h1 { font-size: 1.4rem; }
}

/* ---------- cards & stats ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; border: 1px solid var(--line); }
.card.flush { padding: 0; overflow: hidden; }
.card-pad { padding: 1.25rem 1.25rem .5rem; }
.card-pad h2 { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.stat { display: flex; gap: .9rem; align-items: center; }
.stat .bubble { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.stat .num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .85rem; font-weight: 700; }
.b-yellow { background: var(--yellow-soft); }
.b-red { background: var(--red-soft); }
.b-green { background: var(--green-soft); }
.b-blue { background: var(--blue-soft); }

/* mode tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
a.card { color: inherit; display: flex; transition: border-color .12s; }
a.card:hover { text-decoration: none; border-color: var(--navy-3); }
.tile {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem;
  box-shadow: var(--shadow); color: var(--text); transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--navy-3); text-decoration: none; box-shadow: 0 8px 24px rgba(16,24,40,.1); }
.tile .emoji { font-size: 1.9rem; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: .6rem; }
.tile b { display: block; font-size: 1.05rem; }
.tile span { color: var(--muted); font-size: .88rem; }

/* ---------- buttons & forms ---------- */
.btn {
  font: inherit; font-weight: 800; border: 1px solid transparent; border-radius: 10px; padding: .6rem 1rem; cursor: pointer;
  background: var(--navy); color: #fff; display: inline-flex; align-items: center; gap: .45rem; justify-content: center; line-height: 1.2;
}
.btn:hover { background: var(--navy-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.red { background: var(--red); }
.btn.red:hover { background: #c92d30; }
.btn.yellow { background: var(--yellow); color: #3b2c00; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { background: #eef2fa; }
.btn.light { background: rgba(255,255,255,.12); color: #fff; }
.btn.light:hover { background: rgba(255,255,255,.2); }
.btn.small { padding: .38rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn.big { padding: .85rem 1.4rem; font-size: 1.1rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.danger-text { background: transparent; color: var(--red); border-color: #f5c6c7; }
.btn.danger-text:hover { background: var(--red-soft); }

label.field { display: block; font-weight: 700; font-size: .9rem; }
label.field > span { display: block; margin-bottom: .3rem; }
label.field small { font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); width: 100%; padding: .58rem .75rem; border: 1px solid #cfd6e4; border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29,79,156,.18); border-color: var(--navy-3); }
input[type=checkbox], input[type=radio] { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.inline-inputs { display: flex; gap: .5rem; align-items: center; }
.inline-inputs input, .inline-inputs select { min-width: 0; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 700; cursor: pointer; }
.segmented { display: inline-flex; background: #e9edf5; border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmented button { font: inherit; font-weight: 800; border: 0; background: transparent; padding: .45rem .9rem; border-radius: 9px; cursor: pointer; color: var(--muted); }
.segmented button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.error-text { color: var(--red); font-weight: 700; font-size: .9rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem 1rem; background: #f8f9fc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--navy-3); }
.table th.sortable::after { content: '↕'; margin-left: .35rem; opacity: .35; font-size: .9em; }
.table th.sortable[data-dir="asc"]::after { content: '▲'; opacity: .9; }
.table th.sortable[data-dir="desc"]::after { content: '▼'; opacity: .9; }
.table tr.click:hover td { background: #f6f8fd; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 800; background: #eef1f7; color: var(--muted); white-space: nowrap; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.yellow { background: var(--yellow-soft); color: #8a6400; }
.pill.blue { background: var(--blue-soft); color: var(--navy-3); }

.tabs { display: flex; gap: .25rem; box-shadow: inset 0 -2px 0 var(--line); margin-bottom: 1rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: .6rem 1rem; font-weight: 800; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-color: var(--red); }
.tabs a:hover { text-decoration: none; color: var(--navy); }

/* ---------- due soon (student home) ---------- */
.due-card { border-left: 6px solid var(--yellow); }
.due-row { display: flex; align-items: center; gap: .9rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.due-row:first-of-type { border-top: 0; }
.due-icon { font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--yellow-soft); flex: none; }
.due-row .grow { min-width: 0; }
@media (max-width: 600px) { .due-row { flex-wrap: wrap; } .due-row .btn { margin-left: auto; } }

/* ---------- personal best (practice result) ---------- */
.best-banner { border-radius: 14px; padding: .9rem 1.1rem; margin-bottom: 1rem; font-size: 1.05rem; background: var(--blue-soft); color: var(--navy); }
.best-banner.new { background: linear-gradient(90deg, #fff3cd, #ffe08a); color: #6b4e00; font-size: 1.15rem; box-shadow: 0 6px 18px rgba(255,200,61,.35); }
.best-banner.first { background: var(--green-soft); color: var(--green); }

/* ---------- show/hide password ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 3rem; }
.pw-eye { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; padding: .35rem .5rem; border-radius: 8px; line-height: 1; }
.pw-eye:hover, .pw-eye:focus-visible { background: #eef1f7; }

/* ---------- login cards (print) ---------- */
.print-sheet { position: fixed; inset: 0; z-index: 200; background: #fff; overflow: auto; padding: 1.5rem; }
.print-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.login-cardp { border: 2px dashed #9aa6bf; border-radius: 14px; padding: 14px 16px; break-inside: avoid; page-break-inside: avoid; display: flex; gap: 12px; align-items: flex-start; }
.login-cardp img { width: 64px; flex: none; }
.login-cardp .who { font-size: 1.15rem; font-weight: 900; }
.login-cardp .site { font-size: .85rem; color: #5d6b86; margin-bottom: 6px; }
.login-cardp .kv { font-family: Consolas, 'Courier New', monospace; font-size: 1.05rem; }
.login-cardp .kv b { font-family: Nunito, sans-serif; display: inline-block; width: 82px; font-size: .85rem; color: #5d6b86; }
@media print {
  body { background: #fff !important; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { position: static; padding: 0; overflow: visible; }
  .print-bar { display: none; }
  @page { margin: 12mm; }
}
@media (max-width: 600px) { .cards-grid { grid-template-columns: 1fr; } }

/* ---------- help / FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: .6rem; max-width: 860px; }
.faq details { padding: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-weight: 800; font-size: 1.05rem; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: '−'; }
.faq details[open] summary { color: var(--navy); }
.faq .faq-a { padding: 0 1.2rem 1.1rem; line-height: 1.6; color: #34405a; }
.faq section { gap: .6rem; }
.faq .faq-group { margin: .6rem 0 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art {
  background: linear-gradient(145deg, var(--navy) 0%, #163f86 60%, #1c4fa3 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 3rem 3.5rem; gap: 1.6rem; position: relative; overflow: hidden;
}
.login-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(255,200,61,.2), transparent 65%); pointer-events: none; }
.login-brand { display: flex; align-items: center; gap: 1.2rem; text-align: left; }
.login-brand img { width: 150px; background: #fff; border-radius: 28px; padding: 10px; }
.login-brand b { display: block; font-size: 1.15rem; letter-spacing: .25em; color: var(--yellow); }
.login-brand span { font-size: 1rem; opacity: .8; }
.login-art h1 { font-size: 3.3rem; font-weight: 900; line-height: 1.05; }
.login-art h1 em { font-style: normal; color: var(--yellow); }
.login-feats { display: grid; gap: .9rem; width: 100%; max-width: 32rem; text-align: left; }
.login-feats div { display: flex; gap: 1rem; align-items: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: .9rem 1.1rem; font-size: 1.12rem; font-weight: 700; }
.login-feats i { font-style: normal; font-size: 1.6rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: #fff; flex: none; }
.login-form-wrap { display: grid; place-items: center; padding: 2rem 1.5rem; background: #fff; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-size: 2.2rem; font-weight: 900; }
.login-card > .muted { font-size: 1.1rem; margin-bottom: 1rem; }
.login-card .field span { font-size: 1.05rem; }
.login-card .field input { font-size: 1.15rem; padding: .85rem 1rem; }
.login-help { margin-top: 1.4rem; padding: 1rem 1.1rem; border-radius: 14px; background: var(--bg, #f4f6fb); color: var(--muted); font-weight: 600; }
.demo-box { border: 1px dashed #c4cde0; border-radius: 12px; padding: .9rem; margin-top: 1.25rem; background: #fafbfe; }
.demo-box .row { margin-top: .5rem; }
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 2rem 1.25rem 2.2rem; align-items: center; text-align: center; gap: 1.1rem; }
  .login-brand { flex-direction: column; text-align: center; }
  .login-brand img { width: 170px; }
  .login-art h1 { font-size: 2.3rem; }
  .login-feats { display: none; }
}

/* ---------- practice runner ---------- */
.runbar {
  position: sticky; top: 0; z-index: 15; background: var(--navy); color: #fff; border-radius: var(--radius); padding: .75rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; box-shadow: var(--shadow);
}
@media (max-width: 860px) { .runbar { top: 50px; } }
.runbar .clock { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 5.5ch; }
.runbar .clock.warn { color: var(--yellow); }
.runbar .clock.danger { color: #ff8f91; }
.progress { flex: 1; min-width: 120px; height: 10px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--yellow); border-radius: 99px; transition: width .2s; }

.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .7rem .7rem; box-shadow: var(--shadow); }
.qcard .qno { font-size: .75rem; font-weight: 800; color: var(--muted); }
.qcard .nums { font-size: 1.35rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.35; padding: .2rem .2rem .4rem; border-bottom: 2px solid var(--text); margin-bottom: .45rem; }
.qcard .nums .neg { color: var(--red); }
.qcard .md { font-size: 1.3rem; font-weight: 800; text-align: center; padding: .4rem 0 .5rem; font-variant-numeric: tabular-nums; }
.qcard input { text-align: right; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.qcard.filled { border-color: #9fb5dd; background: #fbfcff; }
.qgrid.md { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.countdown-overlay { position: fixed; inset: 0; background: rgba(11,42,91,.92); display: grid; place-items: center; z-index: 60; color: #fff; }
.countdown-overlay .n { font-size: 9rem; font-weight: 800; animation: pop .9s ease-out infinite; }
.countdown-overlay .t { font-size: 1.4rem; opacity: .8; text-align: center; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { opacity: .9; } }

.flash-stage {
  background: #fff; border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); min-height: 52vh;
  display: grid; place-items: center; padding: 2rem; text-align: center;
}
.flash-num { font-size: clamp(4rem, 16vw, 11rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.flash-num.neg { color: var(--red); }
.flash-num.md { font-size: clamp(3rem, 10vw, 7rem); }
.flash-answer { max-width: 380px; margin: 0 auto; }
.flash-answer input { font-size: 2rem; text-align: center; font-weight: 800; padding: .7rem; }

/* ---------- results ---------- */
.score-hero { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.score-ring {
  --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), #e8ecf4 0);
}
.score-ring > div { width: 104px; height: 104px; background: #fff; border-radius: 50%; display: grid; place-items: center; text-align: center; }
.score-ring b { font-size: 1.7rem; display: block; line-height: 1; }
.score-ring span { font-size: .8rem; color: var(--muted); font-weight: 700; }
.facts { display: flex; gap: .6rem; flex-wrap: wrap; }
.fact { background: #f3f5fa; border-radius: 10px; padding: .45rem .8rem; font-weight: 700; font-size: .9rem; }
.fact b { font-size: 1.05rem; }
.levelup { background: linear-gradient(90deg, var(--yellow), #ffe08a); color: #3b2c00; border-radius: 12px; padding: .8rem 1rem; font-weight: 800; }
.ok { color: var(--green); font-weight: 800; }
.bad { color: var(--red); font-weight: 800; }
.qtext { font-variant-numeric: tabular-nums; font-weight: 700; }
.qtext .neg { color: var(--red); }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: grid; place-items: center; padding: 1rem; z-index: 70; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 820px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 80; }
.toast { background: var(--navy); color: #fff; padding: .75rem 1rem; border-radius: 12px; box-shadow: var(--shadow); font-weight: 700; max-width: 360px; animation: slide .2s ease-out; }
.toast.error { background: var(--red); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

.checklist { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .4rem; }
.checklist label { display: flex; gap: .6rem; align-items: center; padding: .35rem .5rem; border-radius: 8px; cursor: pointer; }
.checklist label:hover { background: #f5f7fb; }

/* question editor */
.qedit { display: grid; gap: .4rem; }
.qedit-row { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .5rem; align-items: center; }
.qedit-row .no { font-weight: 800; color: var(--muted); text-align: right; }
.qedit-row .md-inputs { display: grid; grid-template-columns: 1fr auto 1fr; gap: .4rem; align-items: center; }

/* projector (competition run) */
.projector { position: fixed; inset: 0; background: var(--navy); color: #fff; z-index: 50; display: flex; flex-direction: column; }
.projector .ptop { display: flex; gap: 1rem; align-items: center; padding: .8rem 1.2rem; flex-wrap: wrap; }
.projector .pstage { flex: 1; display: grid; place-items: center; text-align: center; padding: 1rem; }
.projector .pnum { font-size: clamp(5rem, 22vw, 18rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.projector .pnum.neg { color: #ff9a9c; }
.projector .pnum.md { font-size: clamp(3.5rem, 13vw, 11rem); }
.projector .pans { font-size: clamp(3rem, 12vw, 9rem); font-weight: 800; color: var(--yellow); }
.projector .pbottom { display: flex; gap: .6rem; justify-content: center; padding: 1rem; flex-wrap: wrap; }
.projector .hint { opacity: .6; font-size: .85rem; }

.spinner { width: 28px; height: 28px; border: 3px solid #d6dcea; border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Overview (super admin) */
.weekbars { display: flex; align-items: flex-end; gap: 1rem; height: 170px; padding-top: .5rem; }
.weekbars .wb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .2rem; text-align: center; }
.weekbars .wbar { width: 70%; min-height: 3px; background: var(--navy-3); border-radius: 8px 8px 3px 3px; }
.list-plain { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .4rem; }
/* Activity log */
.audit-what { font-size: .9rem; }
.audit-what .small { display: block; }

/* Teacher dashboard: needs attention + class activity */
.attention h3 { font-size: .95rem; margin: .2rem 0 .5rem; }
.daybars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.daybars .db { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.daybars .dbar { width: 100%; min-height: 2px; background: var(--navy-3); border-radius: 4px 4px 1px 1px; }
.daybars .db:hover .dbar { background: var(--yellow); }
.daybars span { font-size: .7rem; color: var(--muted); height: 1.1rem; white-space: nowrap; overflow: visible; }
/* Bulk action bar on the students list */
.bulkbar { position: sticky; top: .5rem; z-index: 5; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .6rem .9rem; margin-bottom: .75rem; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.bulkbar .btn { padding: .35rem .8rem; }
.table td.check, .table th.check { width: 2.2rem; padding-right: 0; }
/* Parent report (printable) */
.report { max-width: 820px; margin: 0 auto; }
.report .rhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 2px solid var(--line); padding-bottom: .8rem; margin-bottom: 1rem; }
.report .rhead img { height: 56px; }
.report table { width: 100%; }
@media print {
  .sidebar, .topbar, .no-print, .banner { display: none !important; }
  .shell, .main, .content { display: block !important; padding: 0 !important; margin: 0 !important; }
  body { background: #fff !important; }
  .report .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
/* Projector: answer timer + big class mode */
.ptimer { font-size: clamp(3rem, 12vw, 9rem); font-weight: 900; color: var(--yellow); font-variant-numeric: tabular-nums; }
.ptimer.low { color: #ff6b6b; }
.projector.big .pnum { font-size: clamp(8rem, 34vw, 30rem); }
.projector.big .pnum.md { font-size: clamp(4rem, 14vw, 12rem); }
.projector.big { background: #000; }
.projector input[type=range] { width: 160px; }
.answer-key { columns: 3; column-gap: 2rem; font-size: 1.05rem; }
.answer-key li { break-inside: avoid; padding: .15rem 0; }
@media (max-width: 700px) { .answer-key { columns: 1; } }

/* Student: streak + daily goal (S1) */
.streak-card { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.streak-num { display: flex; align-items: center; gap: .6rem; min-width: 170px; }
.streak-num .flame { font-size: 2.6rem; line-height: 1; }
.streak-num b { display: block; font-size: 2rem; line-height: 1; }
.streak-num span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.goalbar { height: 14px; border-radius: 99px; background: #eef1f7; overflow: hidden; margin: .45rem 0 .35rem; }
.goalbar i { display: block; height: 100%; background: var(--yellow); border-radius: 99px; transition: width .4s; }
.goalbar i.done { background: var(--green); }
.goal-banner { padding: .8rem 1rem; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 800; margin-bottom: .75rem; text-align: center; }
/* Student: progress charts (S6) */
.linechart text { font-family: inherit; }

/* Feedback */
.navbadge { margin-left: auto; background: var(--yellow); color: var(--navy); font-size: .72rem; font-weight: 900; border-radius: 99px; padding: .05rem .5rem; }
.fb-types { display: flex; gap: .5rem; flex-wrap: wrap; }
.fb-type input, .fb-stars input { position: absolute; opacity: 0; pointer-events: none; }
.fb-type span { display: inline-block; padding: .5rem .9rem; border: 2px solid var(--line); border-radius: 12px; font-weight: 800; cursor: pointer; }
.fb-type input:checked + span { border-color: var(--navy-3); background: var(--blue-soft); color: var(--navy); }
.fb-type input:focus-visible + span { outline: 2px solid var(--navy-3); }
.fb-stars { display: flex; gap: .2rem; flex-direction: row; }
.fb-stars span { font-size: 2rem; color: #d5d9e4; cursor: pointer; line-height: 1; }
.fb-stars:has(input:checked) label:has(input:checked) ~ label span { color: #d5d9e4; }
.fb-stars:has(input:checked) span { color: var(--yellow); }
.fb-stars label:has(input:checked) ~ label span { color: #d5d9e4 !important; }
.fb-stars label:hover span, .fb-stars label:has(~ label:hover) span { color: var(--yellow); }
.fb-msg { white-space: pre-wrap; margin: .5rem 0; }
.fb-reply { background: var(--green-soft); border-radius: 10px; padding: .6rem .8rem; }
.stars { color: var(--yellow); letter-spacing: .05em; }
.stars .off { color: #d5d9e4; }
