/* Mr Sharif's CS Practice – bright & friendly, one colour per year group */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --border: #e3e8f0;
  --text: #16202f;
  --muted: #5b6678;
  --faint: #8d97a8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .12);

  --y7: #2563eb; --y7-soft: #e8f0ff; --y7-ink: #1d4ed8;
  --y8: #7c3aed; --y8-soft: #f1eaff; --y8-ink: #6d28d9;
  --y9: #ea580c; --y9-soft: #fff0e6; --y9-ink: #c2410c;

  --good: #16a34a; --good-soft: #e7f7ec;
  --bad: #dc2626; --bad-soft: #fdecec;
  --warn: #d97706; --warn-soft: #fff5e0;

  --accent: var(--y7); --accent-soft: var(--y7-soft); --accent-ink: var(--y7-ink);
  --radius: 16px; --radius-sm: 10px;
  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --pixel: 'Press Start 2P', 'JetBrains Mono', monospace;
  --hack: #16a34a; --kw-bg: #fef08a; --kw-ink: #713f12; --caps: #db2777;
  --dots: rgba(37, 99, 235, .07);
}
:root[data-theme="dark"] {
  --bg: #0e1420;
  --surface: #161e2d;
  --surface-2: #1d2738;
  --border: #2a3548;
  --text: #e8edf5;
  --muted: #a3aec0;
  --faint: #748097;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .45);
  --y7: #5b8cff; --y7-soft: #17264a; --y7-ink: #9bb8ff;
  --y8: #a67cff; --y8-soft: #271c47; --y8-ink: #c9b0ff;
  --y9: #ff8a3d; --y9-soft: #3a2415; --y9-ink: #ffb27f;
  --good: #3ccf73; --good-soft: #13301f;
  --bad: #ff6b6b; --bad-soft: #3a1a1c;
  --warn: #f5b041; --warn-soft: #3a2c12;
  --hack: #4ade80; --kw-bg: #854d0e; --kw-ink: #fef9c3; --caps: #f472b6;
  --dots: rgba(148, 163, 184, .08);
}
body[data-year="7"] { --accent: var(--y7); --accent-soft: var(--y7-soft); --accent-ink: var(--y7-ink); }
body[data-year="8"] { --accent: var(--y8); --accent-soft: var(--y8-soft); --accent-ink: var(--y8-ink); }
body[data-year="9"] { --accent: var(--y9); --accent-soft: var(--y9-soft); --accent-ink: var(--y9-ink); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.55; min-height: 100vh;
}
a { color: var(--accent-ink); }
button { font-family: inherit; }
code, pre { font-family: var(--mono); }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .92em; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-family: var(--mono); font-weight: 700; font-size: .9rem;
  background: linear-gradient(135deg, var(--y7), var(--y8) 55%, var(--y9)); }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; letter-spacing: 0; }
.year-tabs { display: flex; gap: 6px; margin-left: auto; }
.year-tab { text-decoration: none; font-weight: 600; font-size: .92rem; padding: 7px 14px; border-radius: 999px; border: 2px solid transparent; color: var(--muted); background: var(--surface-2); transition: .15s; }
.year-tab[data-y="7"] { --c: var(--y7); --cs: var(--y7-soft); }
.year-tab[data-y="8"] { --c: var(--y8); --cs: var(--y8-soft); }
.year-tab[data-y="9"] { --c: var(--y9); --cs: var(--y9-soft); }
.year-tab:hover { color: var(--c); background: var(--cs); }
.year-tab.active { background: var(--c); color: #fff; }
.top-stats { display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 1rem; }
.icon-btn:hover { background: var(--surface-2); }
@media (max-width: 720px) {
  .topbar { position: static; }
  .topbar-inner { gap: 8px 10px; padding: 8px 16px; }
  .brand { font-size: .92rem; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; font-size: .78rem; }
  .year-tabs { order: 3; width: 100%; margin-left: 0; }
  .year-tab { flex: 1; text-align: center; padding: 6px 6px; }
  .top-stats { margin-left: auto; gap: 6px; }
  .chip { padding: 4px 8px; font-size: .74rem; }
  .icon-btn { width: 32px; height: 32px; }
  .brand small { display: none; }
  .hero { padding: 20px; }
  .hero-actions .btn { flex: 1 1 100%; }
}
@media (max-width: 420px) { #streakChip { display: none; } }

/* ---------- Layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 80px; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.link { text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s, border-color .12s; display: block; }
.card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }

/* Hero */
.hero { border-radius: 22px; padding: 28px; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); border: 1px solid var(--border); position: relative; overflow: hidden; }
.hero .kicker { display: inline-block; font-weight: 600; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--surface); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; }
.hero p { max-width: 640px; color: var(--muted); margin: 0 0 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.home-hero { background: linear-gradient(120deg, var(--y7-soft), var(--y8-soft) 50%, var(--y9-soft)); }
.home-hero h1 span { background: linear-gradient(90deg, var(--y7), var(--y8), var(--y9)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.year-card { --c: var(--y7); --cs: var(--y7-soft); border-top: 6px solid var(--c); }
.year-card[data-y="8"] { --c: var(--y8); --cs: var(--y8-soft); }
.year-card[data-y="9"] { --c: var(--y9); --cs: var(--y9-soft); }
.year-card .big { font-size: 2.4rem; font-weight: 800; color: var(--c); letter-spacing: -.03em; line-height: 1; }
.year-card ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature .ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 1.2rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: .95rem; padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; transition: .12s; min-height: 42px; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: .85rem; border-radius: 10px; }
.btn.lg { padding: 14px 22px; font-size: 1.05rem; border-radius: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* Unit cards */
.unit-card { display: flex; gap: 14px; align-items: flex-start; }
.unit-ico { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.5rem; }
.unit-card h3 { margin-bottom: 2px; }
.unit-num { font-size: .75rem; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.sem-label { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 10px; }
.sem-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Mock cards */
.mock-grid { grid-template-columns: 1fr; }
@media (min-width: 620px) { .mock-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .mock-grid { grid-template-columns: repeat(4, 1fr); } }
.mock-card h3 { display: flex; align-items: center; gap: 8px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .05em; }
.versions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ver { min-width: 38px; height: 34px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; font-weight: 600; font-size: .85rem; color: var(--text); text-decoration: none; padding: 0 8px; position: relative; }
.ver:hover { border-color: var(--accent); color: var(--accent-ink); }
.ver.done { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.ver .pct { position: absolute; top: -8px; right: -6px; font-size: .62rem; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 5px; line-height: 16px; }

/* ---------- Question rendering ---------- */
.q-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.q-num { font-weight: 800; color: var(--accent-ink); }
.q-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); padding: 3px 8px; border-radius: 99px; }
.q-marks { margin-left: auto; font-weight: 700; font-size: .9rem; color: var(--muted); }
.q-stem { font-size: 1.08rem; font-weight: 500; margin-bottom: 14px; }
.noselect { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: .92rem; line-height: 1.5; margin: 0 0 14px; }
:root[data-theme="dark"] pre.code { background: #0a0f1a; border: 1px solid var(--border); }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 13px 14px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; transition: .1s; }
.opt:hover { border-color: var(--accent); }
.opt .letter { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--muted); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.sel .letter { background: var(--accent); color: #fff; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .letter { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.opt:disabled { cursor: default; }
.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf-row .opt { justify-content: center; font-weight: 700; font-size: 1.05rem; }
.why { margin-top: 14px; }
.why label, .field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
textarea, input[type=text], input[type=password], select {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 2px solid var(--border); border-radius: 12px; padding: 11px 13px; outline: none; transition: border-color .12s;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.long { min-height: 230px; }
textarea:focus, input[type=text]:focus, input[type=password]:focus, select:focus { border-color: var(--accent); }
.wc { font-size: .8rem; color: var(--faint); text-align: right; margin-top: 4px; }
.nopaste-hint { font-size: .78rem; color: var(--faint); display: flex; gap: 6px; align-items: center; margin-top: 4px; }

.cloze { font-size: 1.05rem; line-height: 2.3; }
.cloze input { display: inline-block; width: 150px; padding: 3px 8px; margin: 0 3px; border-radius: 8px; border-width: 2px; font-size: .98rem; text-align: center; }
.cloze input.right { border-color: var(--good); background: var(--good-soft); }
.cloze input.wrong { border-color: var(--bad); background: var(--bad-soft); }
.wordbank { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: 2px dashed var(--border); border-radius: 12px; margin-bottom: 14px; }
.wordbank span { background: var(--surface-2); padding: 4px 10px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.fix { display: inline-block; font-size: .8rem; color: var(--good); font-weight: 700; margin-right: 4px; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.match-terms, .match-defs { display: grid; gap: 8px; align-content: start; }
.mterm { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--border); border-radius: 12px; }
.mterm b { flex: 1; }
.mterm select { width: 78px; padding: 6px 8px; }
.mterm.right { border-color: var(--good); background: var(--good-soft); }
.mterm.wrong { border-color: var(--bad); background: var(--bad-soft); }
.mdef { display: flex; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 12px; font-size: .95rem; }
.mdef .letter { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
@media (max-width: 720px) { .match { grid-template-columns: 1fr; } .match-defs { order: -1; } }

/* Feedback */
.feedback { margin-top: 16px; border-radius: 14px; padding: 14px 16px; border: 1.5px solid var(--border); background: var(--surface-2); }
.feedback.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.feedback.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.feedback.part { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.feedback h4 { margin: 0 0 6px; font-size: 1rem; }
.pts { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.pts li { display: flex; gap: 8px; align-items: flex-start; font-size: .93rem; }
.pts li::before { content: '○'; color: var(--faint); font-weight: 700; }
.pts li.hit::before { content: '✓'; color: var(--good); }
.model { margin-top: 8px; padding: 10px 12px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 8px; font-size: .95rem; }
.note { color: var(--warn); font-weight: 600; font-size: .9rem; }

/* ---------- Practice ---------- */
.practice-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; font-weight: 600; font-size: .9rem; }
.stat b { color: var(--accent-ink); font-size: 1.1rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.q-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.lock-note { font-size: .85rem; color: var(--faint); }
.xp-pop { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); font-weight: 800; font-size: 1.2rem; padding: 8px 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 90; animation: pop 1.2s ease forwards; pointer-events: none; }
.xp-pop.plus { color: var(--good); } .xp-pop.minus { color: var(--bad); }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 10px); } 20% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20px); } }

/* ---------- Exam ---------- */
.exam-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.exam-side { position: sticky; top: 76px; }
.navgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.navbtn { height: 36px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--muted); }
.navbtn.ans { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.navbtn.cur { outline: 3px solid var(--accent); outline-offset: 1px; }
.navbtn.flag { border-color: var(--warn); box-shadow: inset 0 -3px 0 var(--warn); }
.sec-name { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 10px 0 6px; }
.timer { font-family: var(--mono); font-weight: 700; font-size: 1.1rem; }
.sec-banner { font-size: .9rem; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.sec-banner b { color: var(--text); }
.warn-banner { background: var(--warn-soft); color: var(--text); border: 1.5px solid color-mix(in srgb, var(--warn) 50%, transparent); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: .92rem; }
@media (max-width: 860px) {
  .exam-layout { grid-template-columns: 1fr; }
  .exam-side { position: static; }
  .navgrid { grid-template-columns: repeat(10, 1fr); }
}
@media (max-width: 480px) { .navgrid { grid-template-columns: repeat(7, 1fr); } }

/* Results */
.score-hero { display: grid; grid-template-columns: auto auto 1fr; gap: 24px; align-items: center; }
.ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring > div { width: 118px; height: 118px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 2rem; line-height: 1; }
.band { display: inline-block; font-weight: 700; padding: 4px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); }
.bars { display: grid; gap: 8px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 60px; gap: 10px; align-items: center; font-size: .9rem; }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.integrity { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.integrity .stat { text-align: center; }
.integrity .stat.warn { border-color: var(--warn); background: var(--warn-soft); }
@media (max-width: 600px) { .score-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; } .bar-row { grid-template-columns: 100px 1fr 50px; } }

/* Flashcards */
.flash-wrap { max-width: 640px; margin: 0 auto; }
.flash { perspective: 1200px; height: 300px; cursor: pointer; margin: 16px 0; }
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 22px; display: grid; place-items: center; text-align: center; padding: 30px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.flash-front { background: var(--surface); font-size: 1.8rem; font-weight: 700; color: var(--accent-ink); }
.flash-back { background: var(--accent-soft); transform: rotateY(180deg); font-size: 1.2rem; }
.flash-hint { position: absolute; bottom: 14px; left: 0; right: 0; font-size: .8rem; color: var(--faint); font-weight: 400; }

/* Modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(10, 15, 25, .5); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; }
.field { margin-bottom: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem; z-index: 120; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }
.rules { margin: 0; padding-left: 20px; }
.rules li { margin-bottom: 6px; }
footer.site { text-align: center; color: var(--faint); font-size: .82rem; padding: 30px 16px 40px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.kbd { font-family: var(--mono); font-size: .8rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; }

/* Print (teacher papers) */
@media print {
  .topbar, .no-print, footer.site { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
}


/* =====================================================================
   Gamified layer: logo, Bit the robot, ranks, keywords, DnD, stacking
   ===================================================================== */
body { background-color: var(--bg); background-image: radial-gradient(var(--dots) 1.5px, transparent 1.6px), linear-gradient(transparent 0); background-size: 22px 22px; }
.logo-mark { flex: none; display: block; }
.logo-cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pixel, .pixel-label, .pixel-badge, .stamp { font-family: var(--pixel); letter-spacing: .02em; }
.hero .kicker.pixel { font-size: .62rem; color: var(--hack); background: #0b1220; border-color: #0b1220; }
.pixel-label { font-size: .7rem; color: var(--accent-ink); margin: 6px 0; }
.pixel-badge { font-size: .55rem; padding: 6px 8px; border-radius: 8px; background: var(--cs, var(--accent-soft)); color: var(--c, var(--accent-ink)); }
.center { text-align: center; }
.center .bit { margin: 0 auto; display: block; }

/* Header rank chip with XP bar */
#xpChip { gap: 8px; padding: 4px 12px 4px 6px; }
.rank-ico { font-size: 1.1rem; width: 28px; height: 28px; display: grid; place-items: center; background: var(--surface); border-radius: 50%; }
.rank-txt { display: grid; line-height: 1.15; }
.rank-txt b { font-size: .78rem; }
.rank-txt small { font-size: .66rem; color: var(--muted); font-weight: 500; }
.xpbar { display: block; height: 4px; border-radius: 9px; background: var(--border); overflow: hidden; margin-top: 2px; }
.xpbar > i { display: block; height: 100%; background: linear-gradient(90deg, #4ade80, #22c55e); }

/* Hero with art */
.hero-split { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.hero-art { position: relative; min-width: 240px; min-height: 220px; display: grid; place-items: center; }
.hero-art.small { min-width: 0; min-height: 0; max-width: 340px; }
.hero-art .bit { position: relative; z-index: 1; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.bit-light { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { fill: #fb923c; } }
.chips { position: absolute; inset: 0; pointer-events: none; }
.chip-float { position: absolute; font-family: var(--mono); font-weight: 700; font-size: .8rem; padding: 4px 8px; border-radius: 9px; background: var(--surface); border: 1.5px solid var(--border); box-shadow: var(--shadow); color: var(--accent-ink); animation: floaty 5s ease-in-out infinite; white-space: nowrap; }
.chip-float.c0 { top: 4%; left: 0; } .chip-float.c1 { top: 8%; right: 2%; animation-delay: -1s; color: var(--y8-ink); }
.chip-float.c2 { top: 42%; left: -6%; animation-delay: -2s; color: var(--y9-ink); } .chip-float.c3 { top: 40%; right: -4%; animation-delay: -3s; }
.chip-float.c4 { bottom: 10%; left: 4%; animation-delay: -1.5s; } .chip-float.c5 { bottom: 4%; right: 6%; animation-delay: -2.5s; color: var(--hack); background: #0b1220; border-color: #0b1220; }
.chip-float.c6 { top: -6%; left: 40%; animation-delay: -3.5s; } .chip-float.c7 { bottom: -6%; left: 38%; animation-delay: -.5s; color: var(--y8-ink); }
.chip-float.c8, .chip-float.c9 { display: none; }
@keyframes floaty { 50% { transform: translateY(-10px) rotate(-3deg); } }
.terminal { font-family: var(--mono); font-size: .92rem; background: #0b1220; color: #e2e8f0; display: inline-block; padding: 8px 14px; border-radius: 10px; max-width: 100%; }
.terminal .prompt { color: #4ade80; }
.typed { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; animation: type 2.2s steps(22) .3s both; }
@keyframes type { from { width: 0; } to { width: 22ch; } }
.caret { display: inline-block; width: .6em; height: 1.1em; background: #4ade80; vertical-align: text-bottom; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@media (max-width: 760px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-art { order: -1; min-height: 170px; }
  .hero-art .bit { width: 140px; height: 150px; }
  .hero-art.small { order: 0; }
}

/* Bit speech bubble */
.bit-say { display: flex; align-items: center; gap: 10px; text-align: left; }
.bit-say .bit { flex: none; }
.bubble { position: relative; background: var(--surface); border: 2px solid var(--border); border-radius: 16px; padding: 10px 14px; font-size: .92rem; box-shadow: var(--shadow); }
.bubble::before { content: ''; position: absolute; left: -9px; top: 50%; width: 14px; height: 14px; background: var(--surface); border-left: 2px solid var(--border); border-bottom: 2px solid var(--border); transform: translateY(-50%) rotate(45deg); }
.empty .bit-say { justify-content: center; margin-bottom: 14px; }

/* Home extras */
.rules-card { display: flex; gap: 18px; align-items: center; }
.rules-bit { flex: none; }
@media (max-width: 600px) { .rules-card { flex-direction: column; text-align: left; } }
.ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.rank { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 10px 6px; border-radius: 12px; border: 1.5px dashed var(--border); opacity: .55; filter: grayscale(.8); }
.rank span { font-size: 1.5rem; } .rank b { font-size: .8rem; } .rank small { font-size: .7rem; color: var(--muted); }
.rank.got { opacity: 1; filter: none; border-style: solid; border-color: var(--hack); background: color-mix(in srgb, var(--hack) 10%, var(--surface)); }

/* Keyword highlighting in questions */
.hl-cmd { color: var(--accent-ink); font-weight: 800; text-decoration: underline wavy color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 4px; }
.hl-caps { color: var(--caps); font-weight: 800; letter-spacing: .02em; }
.kw { background: var(--kw-bg); color: var(--kw-ink); font-weight: 700; padding: 0 5px; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Feedback stamps + Bit */
.feedback { display: flex; gap: 12px; align-items: flex-start; }
.fb-bit { flex: none; }
.fb-body { flex: 1; min-width: 0; }
.feedback h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stamp { font-size: .62rem; padding: 6px 9px; border-radius: 7px; border: 2px solid currentColor; transform: rotate(-3deg); display: inline-block; animation: stampIn .35s cubic-bezier(.2, 1.6, .5, 1); }
.stamp.good { color: var(--good); } .stamp.part { color: var(--warn); } .stamp.bad { color: var(--bad); }
@keyframes stampIn { from { transform: scale(1.8) rotate(-12deg); opacity: 0; } }
@media (max-width: 520px) { .fb-bit { display: none; } }

/* Drag-and-drop matching */
.dnd { display: grid; gap: 14px; }
.dnd-pool { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: 2px dashed var(--border); border-radius: 14px; background: var(--surface-2); min-height: 64px; align-items: flex-start; transition: .15s; }
.dnd-label { width: 100%; font-weight: 700; font-size: .85rem; }
.dnd-rows { display: grid; gap: 10px; }
.dnd-row { display: grid; grid-template-columns: minmax(110px, 200px) 1fr; gap: 10px; align-items: stretch; }
.dnd-term { display: flex; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; }
.dnd-slot { min-height: 52px; border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 12px; padding: 5px; display: flex; align-items: center; transition: .15s; }
.dnd-slot.filled { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.dnd-ph { color: var(--faint); font-size: .88rem; padding: 0 8px; }
.dnd-slot.over, .dnd-pool.over { border-color: var(--hack); background: color-mix(in srgb, var(--hack) 14%, var(--surface)); transform: scale(1.01); }
.mcard { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1.5px solid var(--border); box-shadow: var(--shadow); cursor: grab; font-size: .93rem; line-height: 1.35; touch-action: none; max-width: 100%; -webkit-user-drag: none; user-select: none; }
.dnd-slot .mcard { width: 100%; box-shadow: none; }
.mcard .grip { color: var(--faint); font-size: 1rem; line-height: 1.2; }
.mcard:hover { border-color: var(--accent); }
.mcard:focus-visible, .dnd-slot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mcard.picked { border-color: var(--hack); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hack) 35%, transparent); }
.mcard.dragging { opacity: .3; }
.mcard.ghost { position: fixed; z-index: 200; pointer-events: none; cursor: grabbing; transform: rotate(-2deg); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.dnd.done .mcard { cursor: default; }
.dnd-row.right .dnd-slot { border-color: var(--good); background: var(--good-soft); }
.dnd-row.wrong .dnd-slot { border-color: var(--bad); background: var(--bad-soft); }
.dnd-fix { grid-column: 2; color: var(--good); font-weight: 600; font-size: .88rem; }
@media (max-width: 560px) { .dnd-row { grid-template-columns: 1fr; gap: 4px; } .dnd-fix { grid-column: 1; } }

/* Practice HUD + stacking */
.hud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: 64px; z-index: 20; padding: 8px; margin: 0 -8px 6px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
@media (max-width: 720px) { .hud { top: 0; } }
.hud-note { margin: 0 0 12px; }
.trail { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 120px; }
.trail i { width: 14px; height: 14px; border-radius: 4px; background: var(--good); animation: pop1 .3s ease; }
.trail i.part { background: var(--warn); } .trail i.bad { background: var(--bad); }
.trail.big { justify-content: center; margin: 10px 0; } .trail.big i { width: 18px; height: 18px; }
@keyframes pop1 { from { transform: scale(0); } }
.stack { display: grid; gap: 16px; }
.pq { position: relative; scroll-margin-top: 130px; animation: slideUp .35s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } }
.pq-num { position: absolute; top: -10px; left: 16px; z-index: 2; font-family: var(--pixel); font-size: .55rem; background: var(--accent); color: #fff; padding: 5px 8px; border-radius: 7px; }
.pq.stacked .q-card { opacity: .92; }
.pq.stacked .pq-num { background: var(--good); }
.pq.stacked .pq-num::after { content: ' ✓'; }
.sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.sum-grid div { background: var(--surface-2); border-radius: 12px; padding: 10px 4px; display: grid; }
.sum-grid b { font-size: 1.3rem; color: var(--accent-ink); } .sum-grid span { font-size: .75rem; color: var(--muted); }
@media (max-width: 420px) { .sum-grid { grid-template-columns: repeat(2, 1fr); } }

/* Results */
.res-art .bit { display: block; }
@media (max-width: 600px) { .score-hero { grid-template-columns: 1fr !important; } }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti span { position: absolute; top: -30px; font-family: var(--mono); font-weight: 800; animation: fall 2s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--drift), 110vh) rotate(540deg); opacity: .2; } }

/* Unit icons get a little bounce */
.card.link:hover .unit-ico { animation: wiggle .5s ease; }
@keyframes wiggle { 30% { transform: rotate(-8deg) scale(1.08); } 60% { transform: rotate(6deg); } }

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

.wordmark { line-height: 1.2; }
.wm-chip { font-family: var(--mono); font-weight: 700; font-size: .82em; color: #4ade80; background: #0b1220; padding: 2px 7px; border-radius: 6px; letter-spacing: .02em; }

/* ---------- Home: compact year cards + upcoming exams ---------- */
.home-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.25fr); align-items: stretch; }
@media (max-width: 1040px) { .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .upcoming { grid-column: 1 / -1; } }
@media (max-width: 680px) { .home-grid { grid-template-columns: 1fr; } }
.year-card { display: flex; flex-direction: column; gap: 14px; }
.yc-team { display: flex; flex-direction: column; justify-content: center; gap: 10px; align-items: center; text-align: center; padding: 16px 12px; border-radius: 14px; background: var(--cs); flex: 1; }
.yc-ico { font-size: 2.6rem; line-height: 1; width: 76px; height: 76px; display: grid; place-items: center; background: var(--surface); border-radius: 16px; flex: none; box-shadow: var(--shadow); }
.yc-team b { display: block; color: var(--c); font-size: 1.02rem; }
.yc-team span { font-size: .82rem; color: var(--muted); }
.year-card:hover .yc-ico { animation: wiggle .5s ease; }
.yc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.year-card .big { text-decoration: none; }
.yc-ready .small { display: flex; justify-content: space-between; margin-bottom: 4px; }
.yc-ready .progress { margin-top: 0; }
.yc-ready .progress > i { background: var(--c); }
.year-card .yc-go { background: var(--c); border-color: var(--c); }
.yc-go:hover { color: #fff; }
.yc-units summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--muted); list-style: none; }
.yc-units summary::-webkit-details-marker { display: none; }
.yc-units summary::after { content: ' ▾'; }
.yc-units[open] summary::after { content: ' ▴'; }
.yc-units ol { margin: 8px 0 0; padding-left: 20px; font-size: .88rem; display: grid; gap: 3px; }
.yc-units a { color: var(--text); text-decoration: none; }
.yc-units a:hover { color: var(--c); text-decoration: underline; }

.upcoming { background: #0b1220; color: #e2e8f0; border-color: #0b1220; display: grid; gap: 12px; }
.upcoming .pixel-label { color: #4ade80; margin: 0 0 6px; font-size: .6rem; }
.upcoming h3 { color: #fff; font-size: 1.15rem; margin: 0; }
.upcoming .muted { color: #94a3b8; }
.countdown { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #111a2c; border: 1.5px solid #1f2b44; }
.countdown b { font-family: var(--pixel); font-size: 1.6rem; color: #facc15; }
.countdown span { font-weight: 600; color: #cbd5e1; }
.up-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.up-y a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: #e2e8f0; background: #111a2c; border-left: 4px solid var(--y7); font-size: .86rem; }
.up-y[data-y="8"] a { border-left-color: var(--y8); } .up-y[data-y="9"] a { border-left-color: var(--y9); }
.up-y a b { color: #fff; }
.up-y a:hover { background: #17233a; }
.up-y a span { display: grid; gap: 2px; }
.up-y a small { color: #cbd5e1; font-size: .8rem; }
.up-y a i { font-style: normal; color: #4ade80; font-weight: 800; font-size: 1.1rem; }
.up-y a:hover i { transform: translateX(3px); }
.up-next { border-top: 1px dashed #1f2b44; padding-top: 10px; }

/* ---------- Year page: learner journey ---------- */
.journey { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; }
.jstep { display: flex; flex-direction: column; gap: 8px; position: relative; }
.jstep h3 { margin: 0; }
.jstep p { margin: 0; flex: 1; }
.jstep .btn { align-self: flex-start; }
.jstep .progress { margin-top: 0; }
.jnum { font-family: var(--pixel); font-size: .5rem; color: var(--muted); }
.jstep.here { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.jstep.here::before { content: 'YOU ARE HERE'; position: absolute; top: -11px; right: 12px; font-family: var(--pixel); font-size: .48rem; background: var(--accent); color: #fff; padding: 5px 7px; border-radius: 6px; }
.jstep.locked { background: var(--surface-2); }
.jarrow { display: grid; place-items: center; font-size: 1.4rem; color: var(--faint); }
@media (max-width: 860px) { .journey { grid-template-columns: 1fr; } .jarrow { transform: rotate(90deg); } }

/* Practice check-ins */
.nudge { margin-top: 12px; display: grid; gap: 10px; border: 2px dashed var(--accent); background: var(--accent-soft); }
.nudge .bubble { background: var(--surface); }

.feat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .feat-grid { grid-template-columns: 1fr; } }

/* ---------- Arabic glossary (EAL support) ---------- */
:root { --arabic: 'Cairo', 'Noto Naskh Arabic', 'Geeza Pro', 'Segoe UI', Tahoma, sans-serif; --ar-ink: #0f766e; --ar-soft: #ccfbf1; }
:root[data-theme="dark"] { --ar-ink: #5eead4; --ar-soft: #134e4a; }
.ar-btn { font-family: var(--arabic); font-weight: 700; font-size: 1.05rem; }
body.ar-on .ar-btn { background: var(--ar-ink); color: #fff; border-color: var(--ar-ink); }
body.ar-on [data-ar] { cursor: help; }
body.ar-on .kw[data-ar] { box-shadow: inset 0 -2px 0 var(--ar-ink); }
body.ar-on .kwl { text-decoration: underline dotted var(--ar-ink); text-decoration-thickness: 2px; text-underline-offset: 4px; }
body.ar-on .kwl:hover, body.ar-on .kw[data-ar]:hover { background: var(--ar-soft); border-radius: 5px; }
body.ar-on .dnd-term .kwl { text-decoration-color: #fff; }
body.ar-on .wb-ar { box-shadow: inset 0 -2px 0 var(--ar-ink); }
.ar-pop { position: fixed; z-index: 400; background: var(--surface); color: var(--text); border: 2px solid var(--ar-ink); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 14px 16px 12px; display: grid; gap: 6px; animation: popIn .18s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.ar-x { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; width: 28px; height: 28px; border-radius: 8px; }
.ar-x:hover { background: var(--surface-2); }
.ar-en { font-weight: 700; font-size: .9rem; color: var(--muted); padding-right: 26px; }
.ar-term { font-family: var(--arabic); font-size: 1.6rem; font-weight: 700; color: var(--ar-ink); line-height: 1.4; }
.ar-def { font-family: var(--arabic); font-size: 1.02rem; line-height: 1.7; }
.ar-endef { font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 6px; }
.ar-actions { display: flex; gap: 6px; margin-top: 2px; }
.ar-actions .btn:last-child { font-family: var(--arabic); }
.ar-inline { font-family: var(--arabic); color: var(--ar-ink); font-weight: 700; margin: 0 4px; }
.flash-ar { font-family: var(--arabic); margin-top: 14px; display: grid; gap: 4px; color: var(--ar-ink); }
.flash-ar b { font-size: 1.5rem; } .flash-ar span { font-size: 1rem; color: var(--text); }

/* Mr Sharif avatar: round portrait badges */
.avatar { border-radius: 50%; background: radial-gradient(circle at 50% 40%, #ffffff 0%, var(--accent-soft) 70%); box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow-lg); flex: none; }
.home-hero .avatar { background: radial-gradient(circle at 50% 40%, #ffffff 0%, #e9e3ff 75%); box-shadow: 0 0 0 5px #fff, 0 0 0 9px #c4b5fd, var(--shadow-lg); }
.fb-bit .avatar, .bit-say .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent); }
:root[data-theme="dark"] .avatar { background: radial-gradient(circle at 50% 40%, #2a3550 0%, #161e2d 80%); }
.home-hero .hero-art { min-width: 300px; min-height: 250px; }
.home-hero .chips { z-index: 2; inset: -10px -24px; }

/* ---------- Student accounts ---------- */
body.locked .year-tabs, body.locked .top-stats > .chip { display: none; }
.user-chip { cursor: pointer; gap: 8px; padding: 4px 12px 4px 4px; font-family: inherit; color: var(--text); }
.user-chip:hover { border-color: var(--accent); }
.uc-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: .85rem; }
.uc-txt { display: grid; line-height: 1.1; text-align: left; }
.uc-txt b { font-size: .8rem; } .uc-txt small { font-size: .68rem; color: var(--muted); }
@media (max-width: 720px) { .uc-txt { display: none; } .user-chip { padding: 3px; } }

.login-wrap { display: grid; place-items: center; padding: 10px 0 30px; }
.login-card { width: 100%; max-width: 440px; text-align: center; padding: 28px 24px; position: relative; overflow: hidden; }
.login-art { position: relative; height: 175px; display: grid; place-items: center; margin-bottom: 6px; }
.login-art .chips { z-index: 2; }
.login-art .chip-float.c6, .login-art .chip-float.c7 { display: none; }
.login-kicker { font-size: .6rem; color: var(--hack); background: #0b1220; border: 0; display: inline-block; padding: 5px 10px; border-radius: 999px; }
.login-card h1 { margin-top: 10px; font-size: 1.7rem; }
.login-form { text-align: left; margin-top: 16px; }
.login-form input { font-size: 1.15rem; letter-spacing: .04em; }
#lgPin { font-family: var(--mono); letter-spacing: .3em; }
.pin-row { display: flex; gap: 8px; }
.pin-row input { flex: 1; }
.login-err { color: var(--bad); font-weight: 600; min-height: 1.4em; margin-bottom: 8px; }
.demo-note { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); font-size: .85rem; text-align: left; }
.acct-box { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--accent-soft); margin-bottom: 14px; }

.me-rank { display: flex; gap: 12px; align-items: center; margin-top: 12px; max-width: 460px; }
.rank-ico.big { width: 54px; height: 54px; font-size: 1.8rem; flex: none; box-shadow: var(--shadow); }
.me-rank > div { flex: 1; }
.me-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .me-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: grid; gap: 2px; text-align: center; }
.tile b { font-size: 1.8rem; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .85rem; }
.progress.big { height: 14px; margin-top: 10px; }
.cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; margin-top: 12px; max-width: 420px; }
.cal i { aspect-ratio: 1; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }
.cal i.on { background: var(--good); border-color: var(--good); }
.units-list { display: grid; gap: 8px; margin-top: 12px; }
.ur { display: grid; grid-template-columns: minmax(140px, 1.4fr) 2fr 52px 92px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--text); }
.ur:hover { background: var(--surface-2); }
.ur .bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.ur .bar i { display: block; height: 100%; border-radius: 99px; }
.ur.good .bar i { background: var(--good); } .ur.part .bar i { background: var(--warn); } .ur.bad .bar i { background: var(--bad); }
.ur b { text-align: right; font-variant-numeric: tabular-nums; } .ur small { color: var(--muted); }
@media (max-width: 600px) { .ur { grid-template-columns: 1fr 52px; } .ur .bar { grid-column: 1 / -1; grid-row: 2; } .ur small { display: none; } }
.table-wrap { overflow-x: auto; }
.hist { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .92rem; }
.hist th, .hist td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.hist th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

.me-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .me-two { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }
