/* Layout idea: a night-shift control room. Fixed rail on the left, a status strip (streak, XP, minutes) on top, cards that glow when they matter. */
:root {
  --bg: #090d18;
  --bg-2: #0e1424;
  --panel: #121a2d;
  --panel-2: #18213a;
  --line: #222c47;
  --text: #eaeef9;
  --muted: #8b95b4;
  --dim: #5d6787;
  --accent: #4f7dff;
  --accent-2: #87a6ff;
  --flame: #ff7a2f;
  --gold: #ffc93d;
  --good: #34d399;
  --bad: #ff5d73;
  --amber: #ffb547;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(900px 560px at 8% -12%, rgba(79,125,255,.28), transparent 60%),
    radial-gradient(800px 520px at 100% -5%, rgba(179,92,255,.20), transparent 60%),
    radial-gradient(700px 500px at 60% 110%, rgba(255,122,47,.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100%; }
.rail {
  position: sticky; top: 0; height: 100vh;
  padding: 22px 14px; display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--line); background: rgba(9,13,24,.6); backdrop-filter: blur(10px);
}
.me { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; }
.avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 19px;
  background: linear-gradient(140deg, #ffb547, #ff5d8f 55%, #7b5cff); box-shadow: 0 6px 20px rgba(255,93,143,.35); flex: none; }
.me b { display: block; font-family: var(--font-display); font-size: 16px; line-height: 1.2; }
.me span { font-size: 12px; color: var(--muted); font-weight: 600; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), #7b5cff); box-shadow: 0 6px 20px rgba(79,125,255,.45);
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand-name span { color: var(--accent-2); }
.nav-btn {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 600; text-align: left; transition: background .15s, color .15s;
}
.nav-btn svg { width: 20px; height: 20px; flex: none; }
.nav-btn:hover { background: var(--panel); color: var(--text); }
.nav-btn.active { background: linear-gradient(90deg, rgba(79,125,255,.28), rgba(123,92,255,.12)); color: var(--text); box-shadow: inset 3px 0 0 var(--accent-2), inset 0 0 0 1px #34407a; }
.nav-btn.active svg { color: var(--accent-2); }
.rail-foot { margin-top: auto; padding: 14px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.rail-foot strong { color: var(--text); display: block; font-size: 14px; }
.sync-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); margin-right: 6px; vertical-align: middle; }
.sync-dot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }

.main { min-width: 0; padding: 22px clamp(16px, 3vw, 40px) 60px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.topbar h1 { font-size: 26px; margin-right: auto; }
.topbar .sub { color: var(--muted); font-size: 14px; font-family: var(--font-body); font-weight: 500; letter-spacing: 0; display: block; margin-top: 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 14px;
}
.pill svg { width: 20px; height: 20px; }
.pill small { color: var(--muted); font-weight: 600; font-size: 12px; }
.pill.flame { color: var(--flame); background: rgba(255,122,47,.12); border-color: rgba(255,122,47,.35); }
.pill.flame.cold { color: var(--dim); }
.pill.xp { color: var(--gold); background: rgba(255,201,61,.1); border-color: rgba(255,201,61,.32); }
.pill.min { color: var(--accent-2); background: rgba(79,125,255,.12); border-color: rgba(79,125,255,.38); }
.pill.flame.cold { background: var(--panel); border-color: var(--line); }
.pill .val { color: var(--text); }

/* ---------- cards ---------- */
.card { background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 40%), var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.card h2 { font-size: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.hero { grid-template-columns: 1.15fr 1fr 1fr; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-weight: 700;
  background: linear-gradient(180deg, #5d88ff, var(--accent)); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 22px rgba(79,125,255,.35);
  transition: transform .12s, filter .12s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px #34437a; color: var(--accent-2); }
.btn.ghost:hover { background: rgba(79,125,255,.08); }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* level orb */
.orb-card { display: flex; gap: 20px; align-items: center; position: relative; overflow: hidden; background: linear-gradient(135deg, rgba(79,125,255,.22), rgba(179,92,255,.14) 60%, transparent), var(--panel); border-color: #33407a; }
.orb-card::after { content: ""; position: absolute; inset: auto -60px -80px auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(79,125,255,.22), transparent 70%); pointer-events: none; }
.orb { position: relative; width: 128px; height: 128px; flex: none; }
.orb svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.orb .lvl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.orb .lvl b { font-family: var(--font-display); font-size: 46px; font-weight: 800; line-height: .9; display: block; }
.orb .lvl small { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.rank { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.xp-line { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.xp-line b { color: var(--gold); }

.goal-ring { display: flex; align-items: center; gap: 16px; }
.bar { height: 10px; border-radius: 99px; background: #1d2742; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s ease; }
.bar.gold > i { background: linear-gradient(90deg, #ff9f2f, var(--gold)); }
.bar.rag { display: flex; }
.bar.rag > i { border-radius: 0; }
.big-stat { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1; }
.big-stat small { font-size: 15px; color: var(--muted); font-weight: 600; font-family: var(--font-body); }

/* week */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; text-align: center; }
.day { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.dot {
  width: 100%; max-width: 54px; aspect-ratio: 1; border-radius: 50%; background: #1a2340; position: relative; display: grid; place-items: center;
  border: 2px solid transparent;
}
.dot .fill { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--flame) calc(var(--p) * 1%), transparent 0); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); }
.dot.hit { background: radial-gradient(circle, rgba(255,122,47,.25), #1a2340 70%); }
.dot svg { width: 22px; height: 22px; color: var(--flame); position: relative; }
.dot.today { border-color: var(--accent); border-style: dashed; }
.dot.future { opacity: .4; }

.stats { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .v { font-family: var(--font-display); font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat:nth-child(1) { border-top: 3px solid var(--accent); } .stat:nth-child(2) { border-top: 3px solid #b35cff; }
.stat:nth-child(3) { border-top: 3px solid var(--good); } .stat:nth-child(4) { border-top: 3px solid var(--gold); }
.stat .v small { font-size: 14px; color: var(--muted); font-family: var(--font-body); font-weight: 600; }

/* subjects */
.subjects { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.subj {
  position: relative; padding: 18px; border-radius: var(--r); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, var(--panel)), var(--panel) 65%); border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line));
  display: flex; flex-direction: column; gap: 12px; overflow: hidden; transition: transform .15s, border-color .15s;
}
.subj:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.subj::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: .85; }
.subj-top { display: flex; align-items: center; gap: 12px; }
.glyph {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
}
.glyph svg { width: 22px; height: 22px; }
.subj h3 { font-size: 17px; }
.subj .board { font-size: 12px; color: var(--muted); }
.subj .mastery { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; }
.subj .bar > i { background: var(--c); }
.subj .acts { display: flex; gap: 8px; }
.subj .acts button { flex: 1; padding: 8px; border-radius: 10px; background: var(--panel-2); font-weight: 700; font-size: 13px; color: var(--text); }
.subj .acts button:hover { background: color-mix(in srgb, var(--c) 22%, var(--panel-2)); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 14px; }
.section-title h2 { font-size: 20px; }

.mock { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--panel-2); }
.mock .days { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--amber); min-width: 52px; text-align: center; line-height: 1; }
.mock .days small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--font-body); }

/* chips & selects */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); }
.chip:hover { color: var(--text); }
.chip.on { background: color-mix(in srgb, var(--c, var(--accent)) 18%, var(--panel)); border-color: color-mix(in srgb, var(--c, var(--accent)) 60%, var(--line)); color: var(--text); }
select {
  appearance: none; background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b95b4' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 11px 38px 11px 14px; font: inherit; font-weight: 600; width: 100%;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.setup { max-width: 760px; display: grid; gap: 22px; }
.mode-row { grid-template-columns: repeat(3, 1fr); }
.mode {
  text-align: left; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
}
.mode b { font-family: var(--font-display); font-size: 16px; }
.mode span { font-size: 13px; color: var(--muted); }
.mode.on { border-color: var(--accent); background: rgba(79,125,255,.1); }

/* ---------- quiz runner ---------- */
.runner { max-width: 780px; margin: 0 auto; }
.run-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.run-top .bar { flex: 1; height: 12px; }
.x-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: var(--panel); }
.x-btn:hover { color: var(--text); }
.combo { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--flame); font-size: 14px; min-width: 70px; justify-content: flex-end; }
.combo svg { width: 18px; height: 18px; }
.combo.zero { color: var(--dim); }
.qcard { padding: 28px; }
.qmeta { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.tag { padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent-2)); }
.qtext { font-family: var(--font-display); font-size: clamp(20px, 2.6vw, 26px); font-weight: 600; line-height: 1.3; margin-bottom: 22px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-radius: 14px; text-align: left;
  background: var(--panel-2); border: 1.5px solid var(--line); font-weight: 600; font-size: 16px; transition: border-color .12s, background .12s, transform .12s;
}
.opt:hover { border-color: #3a4b80; }
.opt .k { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: #222d4d; color: var(--muted); font-size: 13px; font-weight: 800; }
.opt.right { border-color: var(--good); background: rgba(52,211,153,.12); }
.opt.right .k { background: var(--good); color: #062a1c; }
.opt.wrong { border-color: var(--bad); background: rgba(255,93,115,.1); animation: shake .35s; }
.opt.wrong .k { background: var(--bad); color: #2a0610; }
.opts.locked .opt { pointer-events: none; }
.opts.locked .opt:not(.right):not(.wrong) { opacity: .5; }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 14px; display: flex; gap: 14px; align-items: flex-start; }
.feedback.good { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.35); }
.feedback.badf { background: rgba(255,93,115,.08); border: 1px solid rgba(255,93,115,.3); }
.feedback b { display: block; font-family: var(--font-display); font-size: 17px; }
.feedback .gain { margin-left: auto; font-weight: 800; color: var(--gold); white-space: nowrap; }
.run-actions { display: flex; justify-content: flex-end; margin-top: 18px; gap: 10px; }
.kbd-hint { color: var(--dim); font-size: 12px; margin-right: auto; align-self: center; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

.result { text-align: center; padding: 34px 24px; }
.result .score { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: 1; animation: pop .5s ease; }
.result .verdict { font-family: var(--font-display); font-size: 22px; margin: 10px 0 4px; }
.result-stats { display: flex; justify-content: center; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.result-stats div { padding: 12px 18px; border-radius: 14px; background: var(--panel-2); min-width: 110px; }
.result-stats b { display: block; font-family: var(--font-display); font-size: 22px; }
.result-stats span { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.review { text-align: left; margin-top: 18px; display: grid; gap: 10px; }
.review div { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font-size: 14px; }
.review b { color: var(--good); }

/* ---------- flashcards ---------- */
.decks { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.deck { text-align: left; padding: 18px; border-radius: var(--r); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, var(--panel)), var(--panel) 65%); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; transition: transform .15s, border-color .15s; }
.deck:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.deck h3 { font-size: 17px; }
.deck .meta { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.deck .bar > i { background: var(--c); }
.flip-wrap { perspective: 1400px; max-width: 680px; margin: 0 auto; }
.flip { position: relative; width: 100%; min-height: 300px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3,.7,.3,1); cursor: pointer; }
.flip.flipped { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; padding: 34px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid #2c3963; box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.face.back { transform: rotateY(180deg); background: linear-gradient(160deg, #1b2747, #141c33); }
.face .big { font-family: var(--font-display); font-size: clamp(20px, 2.8vw, 28px); font-weight: 600; line-height: 1.3; }
.face .hint { position: absolute; bottom: 16px; font-size: 12px; color: var(--dim); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.face .note { color: var(--muted); font-size: 15px; max-width: 46ch; }
.face .label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 680px; margin: 18px auto 0; }
.btn.again { background: linear-gradient(180deg, #ff7186, var(--bad)); box-shadow: 0 8px 22px rgba(255,93,115,.25); }
.btn.got { background: linear-gradient(180deg, #4ee3aa, var(--good)); color: #052a1b; box-shadow: 0 8px 22px rgba(52,211,153,.25); }

/* ---------- topics ---------- */
.topic-group { margin-bottom: 22px; }
.topic-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; font-family: var(--font-body); font-weight: 800; }
.topic { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
.topic .name { flex: 1; font-weight: 600; min-width: 0; }
.topic .qcount { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rag { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 3px; }
.rag button { width: 34px; height: 30px; border-radius: 8px; font-weight: 800; font-size: 13px; color: var(--dim); }
.rag button:hover { color: var(--text); }
.rag button.R.on { background: var(--bad); color: #2a0610; }
.rag button.A.on { background: var(--amber); color: #2b1a00; }
.rag button.G.on { background: var(--good); color: #052a1b; }
.mini-quiz { padding: 6px 10px; border-radius: 8px; background: var(--panel-2); font-size: 12px; font-weight: 800; color: var(--accent-2); }
.mini-quiz:hover { background: #24305a; }
.watch {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 8px; white-space: nowrap;
  background: rgba(255,59,59,.12); color: #ff8080; font-size: 12px; font-weight: 800; text-decoration: none;
}
.watch svg { width: 14px; height: 14px; }
.watch:hover { background: rgba(255,59,59,.22); color: #ffb0b0; }
.rag-legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.rag-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ---------- focus ---------- */
.focus { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.timer { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 34px 20px; }
.timer-ring { position: relative; width: min(300px, 70vw); aspect-ratio: 1; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring .t { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.timer-ring .t b { font-family: var(--font-display); font-size: clamp(48px, 9vw, 68px); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; display: block; line-height: 1; }
.timer-ring .t span { color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.timer-controls { display: flex; gap: 10px; }

/* ---------- trophies ---------- */
.badges { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.badge { padding: 18px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.badge .ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex: none; background: #1b2340; color: var(--dim); }
.badge .ico svg { width: 26px; height: 26px; }
.badge.got .ico { background: linear-gradient(140deg, #ffd65c, #ff9b2f); color: #3a2000; box-shadow: 0 6px 18px rgba(255,170,50,.35); }
.badge b { font-family: var(--font-display); font-size: 15px; display: block; }
.badge span { font-size: 13px; color: var(--muted); }
.badge:not(.got) b { color: var(--muted); }
.ladder { display: grid; gap: 8px; }
.rung { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.rung b { font-family: var(--font-display); min-width: 64px; }
.rung.done { border-color: rgba(255,201,61,.4); }
.rung.done b { color: var(--gold); }
.rung.now { border-color: var(--accent); background: rgba(79,125,255,.1); }

/* ---------- toasts, modal ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: #1a2442; border: 1px solid #33437a;
  box-shadow: 0 12px 30px rgba(0,0,0,.4); font-weight: 600; animation: pop .35s ease; max-width: 320px;
}
.toast .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, #ffd65c, #ff9b2f); color: #3a2000; flex: none; }
.toast .ico svg { width: 20px; height: 20px; }
.toast small { display: block; color: var(--muted); font-weight: 500; }
.float-xp { position: fixed; pointer-events: none; font-family: var(--font-display); font-weight: 800; color: var(--gold); font-size: 22px; z-index: 60; animation: rise 1s ease forwards; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
@keyframes rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-60px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(5,8,16,.7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 70; padding: 20px; }
.modal { max-width: 420px; width: 100%; text-align: center; padding: 30px; animation: pop .4s ease; }
.modal .lvl-big { font-family: var(--font-display); font-size: 84px; font-weight: 800; line-height: 1; background: linear-gradient(180deg, #fff, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.modal h2 { font-size: 24px; margin: 8px 0; }
.modal p { color: var(--muted); }
.modal .row { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

.flame-anim { animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.06) rotate(-3deg); } 60% { transform: scale(.97) rotate(2deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .hero > :first-child { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .focus { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 40; flex-direction: row; justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(9,13,24,.92);
  }
  .brand, .rail-foot { display: none; }
  .nav-btn { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 10.5px; flex: 1; align-items: center; }
  .main { padding-bottom: 96px; }
  .hero, .mode-row { grid-template-columns: 1fr; }
  .orb { width: 104px; height: 104px; }
  .orb .lvl b { font-size: 38px; }
  .topbar h1 { font-size: 22px; width: 100%; }
  .toasts { bottom: 84px; right: 12px; left: 12px; }
  .topic { flex-wrap: wrap; }
  .qcard { padding: 20px; }
}

/* ---------- daily plan ---------- */
.plan {
  position: relative; overflow: hidden; border-radius: 22px; padding: 24px;
  background: linear-gradient(125deg, #3d5cff 0%, #6a4dff 45%, #b04dd9 100%);
  box-shadow: 0 18px 50px rgba(90,80,255,.35);
}
.plan::before { content: ""; position: absolute; width: 380px; height: 380px; right: -120px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); pointer-events: none; }
.plan::after { content: ""; position: absolute; width: 300px; height: 300px; left: 30%; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,170,90,.35), transparent 65%); pointer-events: none; }
.plan-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; justify-content: space-between; margin-bottom: 18px; }
.plan .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.plan h2 { font-size: clamp(24px, 3vw, 32px); margin: 4px 0; color: #fff; }
.plan p { margin: 0; color: rgba(255,255,255,.82); font-size: 14px; max-width: 56ch; }
.plan-ring { position: relative; width: 92px; height: 92px; flex: none; }
.plan-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.plan-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 24px; font-weight: 800; color: #fff; }
.tasks { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.task {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px;
  background: rgba(10,14,40,.38); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); min-width: 0;
}
.task-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 30%, rgba(255,255,255,.08)); color: #fff; }
.task-ico svg { width: 22px; height: 22px; }
.task-body { flex: 1; min-width: 0; }
.task-body b { display: block; font-size: 15px; color: #fff; line-height: 1.3; }
.task-body span { font-size: 12.5px; color: rgba(255,255,255,.7); }
.task-bar { height: 6px; border-radius: 9px; background: rgba(255,255,255,.15); margin-top: 8px; overflow: hidden; }
.task-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd65c, #ff9b2f); transition: width .5s; }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.task-side .num { font-weight: 800; color: #fff; font-size: 13px; }
.task-go { background: #fff; color: #3a3fd6; box-shadow: 0 6px 16px rgba(0,0,0,.2); padding: 7px 14px; }
.task .watch { background: rgba(255,255,255,.14); color: #fff; padding: 4px 8px; }
.task.ok { background: rgba(52,211,153,.18); border-color: rgba(52,211,153,.5); }
.task.ok .task-ico { background: var(--good); color: #052a1b; }
.task.ok .task-bar i { background: var(--good); }
@media (max-width: 900px) { .tasks { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .me { display: none; } .plan { padding: 18px; } .plan-ring { width: 72px; height: 72px; } .plan-ring b { font-size: 19px; } }

/* ---------- sleek pass: flat surfaces, no glows, stronger type ---------- */
:root { --muted: #9ba4c2; --line: #232c46; --panel: #111829; --panel-2: #172036; }
body { background: radial-gradient(1000px 520px at 15% -15%, rgba(79,125,255,.14), transparent 60%), var(--bg); }
.card, .subj, .deck, .badge, .topic, .rung, .mock, .mode, .chip, .pill { box-shadow: none; }
.card { background: var(--panel); }
.orb-card { background: var(--panel); border-color: var(--line); }
.orb-card::after { display: none; }
.subj, .deck { background: var(--panel); border-color: var(--line); }
.subj:hover, .deck:hover { transform: none; border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }
.stat:nth-child(n) { border-top: 1px solid var(--line); }
.btn { background: var(--accent); box-shadow: none; }
.btn:hover { filter: none; background: #6a90ff; }
.btn.ghost { box-shadow: inset 0 0 0 1.5px #3a4a85; }
.btn.again { background: var(--bad); box-shadow: none; color: #fff; }
.btn.got { background: var(--good); box-shadow: none; }
.nav-btn.active { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.avatar { background: var(--accent); box-shadow: none; }
.face { box-shadow: none; background: var(--panel-2); border-color: #2c3760; }
.face.back { background: #1a2442; }
.toast { box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.badge.got .ico { background: var(--gold); box-shadow: none; }
.float-xp { text-shadow: none; }
.modal .lvl-big { background: none; color: var(--accent-2); -webkit-background-clip: initial; background-clip: initial; }

h1, h2, h3, .rank, .big-stat, .stat .v { font-weight: 800; }
.topbar h1 { font-size: 30px; }
.card h2 { font-size: 19px; }
.stat .label, .muted { color: var(--muted); }

/* plan: one solid, bold block */
.plan { background: var(--accent); box-shadow: none; border-radius: 20px; }
.plan::before, .plan::after { display: none; }
.plan h2 { font-size: clamp(26px, 3.2vw, 34px); }
.plan p { color: rgba(255,255,255,.88); }
.task { background: rgba(8,14,48,.28); border: 0; backdrop-filter: none; }
.task-ico { background: rgba(255,255,255,.16); }
.task-bar { background: rgba(255,255,255,.2); }
.task-bar i { background: #fff; }
.task-go { box-shadow: none; color: var(--accent); }
.task.ok { background: rgba(8,14,48,.18); }
.task.ok .task-ico { background: #fff; color: var(--accent); }
.task.ok .task-bar i { background: #fff; }
.task.ok .task-body b { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .85; }
.task .watch { background: rgba(255,255,255,.18); color: #fff; }
.plan .task-go { background: #fff; color: var(--accent); }
.plan .task-go:hover { background: #e8eeff; }


/* ---------- past papers ---------- */
.paper-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.paper-list { display: grid; gap: 8px; }
.paper-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); flex-wrap: wrap; }
.paper-name { flex: 1; min-width: 200px; }
.paper-name b { display: block; font-family: var(--font-display); font-size: 15px; }
.paper-name span { font-size: 13px; color: var(--muted); }
.paper-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.plink { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 13px; text-decoration: none; }
.plink svg { width: 15px; height: 15px; }
.plink:hover { background: #222c4a; }
.plink.ms { color: var(--good); }
.plink.go { background: var(--accent); color: #fff; }
.plink.go:hover { background: #6a90ff; }
.source { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.source:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }
.source b { display: block; font-size: 15px; }
.source span { font-size: 13px; color: var(--muted); }
.source svg { width: 18px; height: 18px; flex: none; color: var(--muted); }

/* ---------- annotator ---------- */
.ann { position: fixed; inset: 0; z-index: 90; background: #0b101d; display: flex; flex-direction: column; }
.ann[hidden] { display: none; }
.ann-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.ann-title { min-width: 0; margin-right: auto; }
.ann-title b { display: block; font-family: var(--font-display); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.ann-title span { font-size: 12px; color: var(--muted); }
.ann-tools, .ann-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ann-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: var(--panel-2); }
.ann-btn svg { width: 19px; height: 19px; }
.ann-btn:hover { color: var(--text); }
.ann-btn.on { background: var(--accent); color: #fff; }
.ann-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.ann-swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--s); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
.ann-swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #fff; }
.ann-size { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); }
.ann-size i { display: block; border-radius: 50%; background: var(--muted); }
.ann-size.on { background: #26335c; }
.ann-size.on i { background: #fff; }
.ann-pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.ann-pill svg { width: 17px; height: 17px; }
.ann-pill.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px #3a4a85; color: var(--accent-2); }
.ann-scroll { flex: 1; overflow: auto; padding: 24px 16px 80px; }
.ann-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 900px; margin: 0 auto; }
.ann-page { position: relative; background: #fff; border-radius: 4px; flex: none; }
.ann-page canvas { position: absolute; inset: 0; display: block; }
.ann-ink { touch-action: none; }
.ann-num { position: absolute; right: -34px; top: 0; font-size: 12px; color: var(--dim); font-weight: 700; }
.ann-text { position: absolute; z-index: 3; min-width: 120px; padding: 2px 4px; border: 1.5px dashed var(--accent); border-radius: 4px; background: rgba(255,255,255,.92);
  font: 600 16px Figtree, Arial, sans-serif; line-height: 1.25; resize: none; overflow: hidden; outline: none; }
.ann-drop { max-width: 520px; margin: 8vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 40px 28px;
  border: 2px dashed #34437a; border-radius: 20px; background: var(--panel); cursor: pointer; }
.ann-drop.over { border-color: var(--accent); background: #16204a; }
.ann-drop b { font-family: var(--font-display); font-size: 22px; }
.ann-drop span { color: var(--muted); font-size: 14px; max-width: 44ch; }
.ann-drop .ann-pill { color: #fff; margin-top: 6px; }
.ann-drop-ico { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: #1c2748; color: var(--accent-2); }
.ann-drop-ico svg { width: 30px; height: 30px; }
.ann-status { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 95; padding: 10px 16px; border-radius: 12px; background: #1a2442; border: 1px solid #33437a; font-weight: 600; font-size: 14px; max-width: 90vw; }
@media (max-width: 760px) {
  .ann-bar { gap: 8px; }
  .ann-title b { max-width: 20ch; }
  .ann-btn { width: 34px; height: 34px; }
  .ann-pill span { display: none; }
  .ann-num { display: none; }
}

/* ---------- videos ---------- */
.vid-topic { padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 10px; border-left: 3px solid var(--c); }
.vid-topic > b { display: block; font-size: 15px; margin-bottom: 10px; }
.vid-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.vid { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 11px; background: var(--panel-2); text-decoration: none; color: var(--text); min-width: 0; }
.vid:hover { background: #222c4a; }
.vid > span:last-child { min-width: 0; }
.vid b { display: block; font-size: 13.5px; line-height: 1.3; }
.vid small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.vid-play { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, #ff3b3b 22%, transparent); color: #ff6b6b; }
.vid-play svg { width: 14px; height: 14px; }
.vid.search .vid-play { background: var(--line); color: var(--muted); }

/* ---------- exam questions ---------- */
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; border-left: 3px solid var(--c); }
.ex-head h2 { margin-bottom: 4px; }
.ex-head .muted { font-size: 14px; font-weight: 600; }
.ex-ctrl { display: flex; gap: 10px; flex-wrap: wrap; }
.ex-ctrl select { max-width: 240px; }
.ex-list { display: grid; gap: 10px; }
.exq { border-radius: 14px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.exq.open { border-color: color-mix(in srgb, var(--c) 60%, var(--line)); }
.exq-top { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px; text-align: left; background: none; color: var(--text); }
.exq-top:hover { background: #141c30; }
.exq-m { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-content: center; text-align: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-family: var(--font-display); font-size: 21px; font-weight: 800; line-height: 1; }
.exq-m small { display: block; font-family: var(--font-body); font-size: 10px; font-weight: 700; opacity: .8; margin-top: 2px; }
.exq-q { flex: 1; min-width: 0; }
.exq-q small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.exq-q b { font-size: 15px; line-height: 1.45; font-weight: 600; }
.exq-body { padding: 0 14px 16px; display: grid; gap: 12px; }
.exq-ans { width: 100%; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; line-height: 1.55; }
.exq-ans:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.exq-body > .btn { justify-self: start; }
.msk { border-radius: 12px; background: var(--panel-2); padding: 12px; display: grid; gap: 6px; }
.ms-h { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ms-pt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 10px; text-align: left; background: var(--panel); color: var(--text); font-size: 14px; line-height: 1.45; border: 1px solid transparent; }
.ms-pt i { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; }
.ms-pt i svg { width: 14px; height: 14px; }
.ms-pt.on { border-color: color-mix(in srgb, var(--good) 50%, transparent); background: color-mix(in srgb, var(--good) 10%, var(--panel)); }
.ms-pt.on i { background: var(--good); border-color: var(--good); color: #052a1b; }
.ms-note { font-size: 13px; padding: 2px 4px; }
.ms-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.ms-foot b { font-family: var(--font-display); font-size: 22px; }
.mini-quiz.exq { color: var(--amber); }

/* ---------- papers: progress + checkboxes ---------- */
.pcheck { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); background: transparent; display: grid; place-items: center; color: transparent; }
.pcheck svg { width: 17px; height: 17px; }
.pcheck:hover { border-color: var(--good); }
.pcheck.on { background: var(--good); border-color: var(--good); color: #052a1b; }
.paper-row.done .paper-name b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--good) 70%, transparent); color: var(--muted); }
.paper-row.prog { border-left: 3px solid var(--accent); }
.plink.del { color: var(--bad); padding: 8px 10px; }
.plink.del:hover { background: color-mix(in srgb, var(--bad) 18%, var(--panel-2)); }

@media (max-width: 760px) {
  .rail { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .nav-btn { min-width: 62px; flex: 0 0 auto; }
  .exq-m { width: 44px; height: 44px; font-size: 18px; }
  .ex-ctrl select { max-width: 100%; flex: 1; }
}
.plink { white-space: nowrap; }
.paper-row .paper-name { flex: 1; min-width: 140px; }
@media (max-width: 760px) { .ex-ctrl { width: 100%; } .ex-ctrl .btn { flex: 1; } }
.ms-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ms-hide { padding: 5px 10px; border-radius: 8px; background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: none; }
.ms-hide:hover { color: var(--text); background: #222c4a; }
.ex-head { flex-wrap: wrap; }
.mchips { width: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.mchips-l { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.mchip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; background: var(--panel-2); color: var(--text); font-weight: 800; font-size: 14px; border: 1px solid transparent; }
.mchip small { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg); padding: 1px 6px; border-radius: 99px; }
.mchip:hover { background: #222c4a; }
.mchip.on { background: color-mix(in srgb, var(--c) 18%, var(--panel-2)); border-color: var(--c); color: var(--c); }
.mchip.on small { color: inherit; opacity: .8; }
.pad { border-radius: 12px; border: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.pad-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.pad-bar b { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pad-tools { display: flex; gap: 6px; }
.pad-t { height: 30px; min-width: 30px; padding: 0 9px; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.pad-t svg { width: 15px; height: 15px; }
.pad-t.on { background: var(--accent); color: #fff; }
.pad-c { display: block; width: 100%; height: 260px; touch-action: none; cursor: crosshair;
  background-image: linear-gradient(rgba(155,164,194,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(155,164,194,.09) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px; }
.nav-timer { margin-left: auto; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; animation: ntPulse 2s ease-in-out infinite; }
.nav-timer.paused { background: var(--panel-2); color: var(--muted); animation: none; }
@keyframes ntPulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); } }
@media (max-width: 760px) { .nav-timer { margin: 0; padding: 1px 6px; font-size: 10px; position: absolute; top: 2px; right: 2px; } .nav-btn { position: relative; } }
@media (prefers-reduced-motion: reduce) { .nav-timer { animation: none; } }
.ftfloat { display: none; }
@media (max-width: 760px) {
  .rail .nav-timer { display: none; }
  .ftfloat { display: inline-flex; align-items: center; gap: 6px; position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 45; padding: 8px 13px; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; box-shadow: 0 8px 22px rgba(0,0,0,.4); }
  .ftfloat svg { width: 16px; height: 16px; }
  .ftfloat.paused { background: var(--panel-2); color: var(--muted); }
}

/* ---------- calendar ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cal-card { padding: 18px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { min-width: 170px; text-align: center; }
.cal-nav { font-size: 22px; line-height: 1; }
.cal-jumps { margin-left: auto; display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 6px 4px; }
.cal-cell { min-height: 96px; display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left; padding: 7px; border-radius: 10px; background: var(--panel-2); color: var(--text); border: 1px solid transparent; min-width: 0; }
.cal-cell.blank { background: transparent; }
.cal-cell.wkend { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.cal-cell:hover { border-color: var(--line); }
.cal-cell.sel { border-color: var(--accent); }
.cal-cell.today .cal-n { background: var(--accent); color: #fff; }
.cal-cell.has-mock { box-shadow: inset 0 3px 0 #ff9f43; }
.cal-cell.has-gcse { box-shadow: inset 0 3px 0 #ff5d73; }
.cal-n { align-self: flex-start; display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 13px; padding: 1px 6px; border-radius: 99px; }
.cal-hit { display: inline-flex; color: #ff9f43; }
.cal-hit svg { width: 12px; height: 12px; }
.cal-ev { display: block; font-size: 11.5px; font-weight: 700; line-height: 1.25; padding: 3px 5px; border-radius: 5px; background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 75%, #fff); border-left: 2px solid var(--c); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.cal-ev b { font-size: 9.5px; }
.cal-ev b { font-weight: 800; opacity: .75; }
.cal-more { font-size: 11px; color: var(--muted); font-weight: 700; padding-left: 4px; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-legend .cal-hit + span { margin-left: -10px; }
.cal-side { display: grid; gap: 16px; }
.cal-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--panel-2); margin-bottom: 8px; }
.cal-item > i { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); flex: none; }
.cal-item > div { flex: 1; min-width: 0; }
.cal-item b { display: block; font-size: 14px; line-height: 1.35; }
.cal-item span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cal-add { display: flex; gap: 8px; margin-top: 10px; }
.cal-add input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.cal-add input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-up { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; background: none; color: var(--text); text-align: left; }
.cal-up:hover { background: var(--panel-2); }
.cal-days { flex: none; width: 50px; height: 46px; border-radius: 10px; display: grid; place-content: center; text-align: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1; }
.cal-days small { display: block; font-family: var(--font-body); font-size: 10px; font-weight: 700; margin-top: 2px; }
.cal-up b { display: block; font-size: 13.5px; line-height: 1.3; }
.cal-up small { font-size: 12px; color: var(--muted); font-weight: 600; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cal-cell { min-height: 54px; padding: 4px; }
  .cal-ev { font-size: 0; padding: 0; height: 5px; border: 0; background: var(--c); }
  .cal-more { display: none; }
  .cal-grid { gap: 4px; }
  .cal-jumps { margin-left: 0; width: 100%; }
}
.wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 18px; margin-top: 12px; }
.wk-row { display: grid; grid-template-columns: 44px 1fr 62px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; background: none; color: var(--text); text-align: left; }
.wk-row:hover { background: var(--panel-2); }
.wk-name { font-weight: 800; font-size: 13px; color: var(--c); }
.wk-bar { height: 8px; border-radius: 9px; background: var(--panel-2); overflow: hidden; }
.wk-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); }
.wk-n { font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: right; display: inline-flex; justify-content: flex-end; align-items: center; gap: 4px; }
.wk-n svg { width: 13px; height: 13px; color: var(--good); }
.wk-row.ok .wk-n { color: var(--good); }
.f-sub { display: grid; gap: 8px; justify-items: center; margin-bottom: 14px; }
.f-sub > span { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chip.small { padding: 5px 10px; font-size: 12.5px; }
