/* Layout: sidebar fix + coloană de conținut; pe telefon meniu lateral glisant + bară de taburi jos.
   Paletă: „scrub teal” (accent), chihlimbar pentru XP/serie, verde/roșu/ocru semantic; neutre reci cu o tentă verde. */
:root {
  --bg: #F1F5F4; --surface: #FFFFFF; --surface-2: #E7EEEC; --ink: #12201E; --ink-2: #4B5D59; --ink-3: #7A8C88; --line: #D3DEDB;
  --accent: #0B7A72; --accent-2: #095F59; --accent-ink: #FFFFFF; --accent-soft: #D4EDE9;
  --amber: #C9741E; --amber-soft: #FBE9D5; --good: #2E8A55; --good-soft: #DDF1E4; --bad: #C2443B; --bad-soft: #F8E0DD; --part: #B48A12; --part-soft: #F6EDCB;
  --k: #2F62C4; --l: #B0513A; --s: #7556B0;
  --lv0: #E2E9E7; --lv1: #F0C8B8; --lv2: #F2DC94; --lv3: #ADDAB9; --lv4: #4FAE88; --lv5: #0B7A72;
  --shadow: 0 1px 2px rgba(18, 32, 30, .06), 0 4px 16px rgba(18, 32, 30, .05);
  --f-display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 10px; --r-sm: 7px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1615; --surface: #15201E; --surface-2: #1C2927; --ink: #E2ECE9; --ink-2: #A3B5B1; --ink-3: #748783; --line: #2A3A37;
    --accent: #3DBDB0; --accent-2: #5CD3C6; --accent-ink: #062320; --accent-soft: #143A36;
    --amber: #F0A04B; --amber-soft: #3A2A17; --good: #52C283; --good-soft: #17352A; --bad: #F07468; --bad-soft: #3D1F1C; --part: #E2B744; --part-soft: #3A3117;
    --k: #7FA6F0; --l: #E58E74; --s: #B49CEB;
    --lv0: #22312E; --lv1: #6B3F35; --lv2: #75632A; --lv3: #2F6A47; --lv4: #2E9A73; --lv5: #3DBDB0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1615; --surface: #15201E; --surface-2: #1C2927; --ink: #E2ECE9; --ink-2: #A3B5B1; --ink-3: #748783; --line: #2A3A37;
  --accent: #3DBDB0; --accent-2: #5CD3C6; --accent-ink: #062320; --accent-soft: #143A36;
  --amber: #F0A04B; --amber-soft: #3A2A17; --good: #52C283; --good-soft: #17352A; --bad: #F07468; --bad-soft: #3D1F1C; --part: #E2B744; --part-soft: #3A3117;
  --k: #7FA6F0; --l: #E58E74; --s: #B49CEB;
  --lv0: #22312E; --lv1: #6B3F35; --lv2: #75632A; --lv3: #2F6A47; --lv4: #2E9A73; --lv5: #3DBDB0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 700; }
h2 { font-size: 21px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
h4 { font-size: 14px; font-weight: 650; margin-top: 14px; }
p { margin: 0 0 .6em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--f-mono); font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=range] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.center { justify-content: center; text-align: center; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.warn-t { color: var(--part); font-weight: 600; }
.err-t { color: var(--bad); font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- butoane ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 550; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.ghost.on { color: var(--accent); }
.btn.sm { padding: 5px 10px; font-size: 13.5px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px 0; }
.link-btn.sm { font-size: 12.5px; }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 550; }
.link .ic { width: 15px; height: 15px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 5px; cursor: pointer; color: var(--ink-2); font-weight: 550; font-size: 13.5px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- cadru ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px var(--f-display); padding: 4px 8px 10px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); }
.brand-mark .ic { width: 20px; height: 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 520; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.badge { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--amber); color: #fff; border-radius: 99px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.demo-pill { margin-top: auto; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; }
.col { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.top-brand { display: flex; align-items: center; gap: 6px; font: 700 16px var(--f-display); color: var(--accent); }
.top-stats { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chip .muted { font-size: 12px; }
.chip-streak { color: var(--ink-3); }
.chip-streak.lit { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.chip-goal .ring { color: var(--accent); }
.chip-goal.done { border-color: var(--good); }
.chip-goal.done .ring { color: var(--good); }
.chip-level { color: var(--accent); }
.lvl-text { display: flex; gap: 6px; align-items: baseline; color: var(--ink); }
.lvl-text span { color: var(--ink-2); font-size: 12px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lvl-bar { display: block; width: 56px; height: 5px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.lvl-bar.wide { width: 100%; height: 8px; margin: 6px 0; }
.lvl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--amber)); border-radius: 9px; }
main { flex: 1; outline: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 18px; }
.page.narrow { max-width: 820px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--ink-3); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card > h3 { margin-bottom: 10px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.sec-h { margin-top: 8px; font-size: 18px; }
.loading { display: grid; place-items: center; padding: 60px; }
.loading span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.boot { display: grid; place-items: center; min-height: 100vh; }
@keyframes spin { to { transform: rotate(360deg); } }
.only-mobile { display: none; }
.tabbar { display: none; }
.scrim { display: none; }

/* ---------- autentificare ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art { position: relative; background: var(--accent); color: var(--accent-ink); padding: 48px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.auth-art .ecg { position: absolute; left: 0; right: 0; top: 18%; width: 100%; height: 140px; fill: none; stroke: currentColor; stroke-width: 2.4; opacity: .35; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: ecg 3.2s ease-out forwards; }
@keyframes ecg { to { stroke-dashoffset: 0; } }
.auth-copy { position: relative; max-width: 460px; }
.auth-copy .eyebrow { color: inherit; opacity: .8; }
.auth-copy h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 12px; }
.auth-copy p { opacity: .92; font-size: 16px; }
.auth-facts { list-style: none; padding: 0; margin: 22px 0 0; display: flex; gap: 22px; flex-wrap: wrap; }
.auth-facts li { font-size: 13px; opacity: .9; }
.auth-facts b { display: block; font: 700 26px var(--f-display); }
.auth-panel { display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); }
.auth-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.auth-form .seg { width: 100%; }
.auth-form .seg button { flex: 1; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-err { color: var(--bad); font-size: 13.5px; background: var(--bad-soft); padding: 8px 10px; border-radius: var(--r-sm); }
.note { background: var(--accent-soft); color: var(--ink); padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- acasă ---------- */
.hero-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: stretch; }
.hello { display: flex; flex-direction: column; justify-content: center; }
.hello h1 { margin-bottom: 6px; }
.today { display: flex; gap: 18px; align-items: center; }
.today .ring { color: var(--accent); }
.today .ring-done { color: var(--good); }
.today-info { display: flex; flex-direction: column; gap: 3px; min-width: 190px; }
.streak-big { display: flex; align-items: baseline; gap: 6px; color: var(--ink-3); }
.streak-big .ic { width: 22px; height: 22px; align-self: center; }
.streak-big b { font: 700 26px var(--f-display); color: var(--ink); }
.streak-big.lit { color: var(--amber); }
.lvl-line { font-size: 13.5px; margin-top: 6px; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring-label { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ring-label b { font: 700 1.3em var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 11px; color: var(--ink-2); }
.chip .ring-label { display: none; }
.actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.action { text-align: left; cursor: pointer; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic t" "n n" "s s"; gap: 4px 10px; align-items: center; transition: border-color .15s, transform .15s; }
.action:hover { border-color: var(--accent); transform: translateY(-1px); }
.action.hot { border-color: var(--amber); background: linear-gradient(180deg, var(--amber-soft), var(--surface) 70%); }
.a-ic { grid-area: ic; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.action.hot .a-ic { background: var(--amber); color: #fff; }
.a-t { grid-area: t; font-weight: 650; }
.a-n { grid-area: n; font: 700 30px var(--f-display); font-variant-numeric: tabular-nums; margin-top: 6px; }
.a-s { grid-area: s; font-size: 13px; color: var(--ink-2); }
.est-n { display: flex; align-items: baseline; gap: 6px; }
.est-n b { font: 700 44px var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.est-bar { position: relative; height: 10px; background: var(--surface-2); border-radius: 9px; margin: 10px 0; }
.est-bar i { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); border-radius: 9px; }
.est-bar b { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; background: var(--accent); border-radius: 2px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mini-stats div { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; }
.mini-stats b { font: 700 22px var(--f-display); font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 12.5px; color: var(--ink-2); }

/* ---------- tabele simple ---------- */
.tbl { display: flex; flex-direction: column; }
.tbl.scroll { max-height: 420px; overflow-y: auto; }
.tr { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: inherit; }
.tr:last-child { border-bottom: 0; }
.tr[data-topic], a.tr { cursor: pointer; }
.tr[data-topic]:hover, a.tr:hover { background: var(--surface-2); text-decoration: none; }
.tr .num { min-width: 42px; text-align: right; }
.meter { display: inline-block; width: 90px; height: 7px; border-radius: 9px; background: var(--surface-2); overflow: hidden; vertical-align: middle; flex: none; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }
.meter.ok i { background: var(--good); } .meter.mid i { background: var(--part); } .meter.low i { background: var(--bad); }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill-acc { background: var(--accent-soft); color: var(--accent); }

/* ---------- grafice ---------- */
.chart-scroll { overflow-x: auto; max-width: 100%; }
.barline { width: 100%; height: auto; display: block; min-width: 420px; }
.barline .grid { stroke: var(--line); stroke-width: 1; }
.barline .ax, .heatmap .ax { fill: var(--ink-3); font-size: 10.5px; font-family: var(--f-body); }
.barline .bar { fill: var(--accent); opacity: .85; }
.barline .line { stroke: var(--amber); stroke-width: 2.2; }
.barline .dot { fill: var(--amber); }
.barline .area { fill: var(--accent-soft); }
.barline path.line + .dot, .barline .dot { stroke: var(--surface); stroke-width: 1.5; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.lg-bar { background: var(--accent); } .lg-line { background: var(--amber); height: 3px !important; }
.empty-chart { padding: 26px; text-align: center; color: var(--ink-3); background: var(--surface-2); border-radius: var(--r-sm); font-size: 14px; }
.heatmap .hm0 { fill: var(--surface-2); }
.heatmap .hm1 { fill: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); }
.heatmap .hm2 { fill: color-mix(in srgb, var(--accent) 52%, var(--surface-2)); }
.heatmap .hm3 { fill: color-mix(in srgb, var(--accent) 76%, var(--surface-2)); }
.heatmap .hm4 { fill: var(--accent); }
.mmap { display: flex; flex-direction: column; gap: 6px; }
.mmap-row { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: stretch; }
.mmap-book { font-size: 12px; font-weight: 650; color: var(--ink-2); padding-top: 6px; }
.mmap-cells { display: flex; flex-wrap: wrap; gap: 3px; }
.mmap-cell { flex-basis: 22px; height: 28px; border: 0; border-radius: 4px; cursor: pointer; padding: 0; font-size: 9.5px; font-family: var(--f-mono); color: var(--ink-2); overflow: hidden; display: grid; place-items: center; }
.mmap-cell span { opacity: 0; transition: opacity .15s; white-space: nowrap; }
.mmap-cell:hover span { opacity: 1; }
.mmap-cell:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.lv0 { background: var(--lv0); } .lv1 { background: var(--lv1); } .lv2 { background: var(--lv2); } .lv3 { background: var(--lv3); } .lv4 { background: var(--lv4); color: #fff; } .lv5 { background: var(--lv5); color: var(--accent-ink); }
.mmap-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.mmap-legend i.mmap-cell { display: inline-block; width: 12px; height: 12px; flex: none; vertical-align: middle; margin-right: 4px; cursor: default; }

/* ---------- tematica ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 16px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); cursor: pointer; min-width: 110px; }
.tab span { font-size: 12px; color: var(--ink-2); }
.tab.on { border-color: var(--accent); background: var(--accent-soft); }
.tab.on b { color: var(--accent); }
.chapters { display: flex; flex-direction: column; gap: 12px; }
.chapter { padding: 0; overflow: hidden; }
.ch-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ch-h h3 { flex: 1; min-width: 180px; }
.ch-code { font: 600 12px var(--f-mono); color: var(--ink-3); }
.topic-row { display: grid; grid-template-columns: 12px 1fr auto 46px; gap: 12px; align-items: center; padding: 10px 16px; color: inherit; border-bottom: 1px solid var(--line); }
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: var(--surface-2); text-decoration: none; }
.tr-title { display: flex; flex-direction: column; min-width: 0; }
.tr-title b { font-weight: 560; }
.tr-counts { display: flex; gap: 12px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tr-counts span { display: inline-flex; align-items: center; gap: 3px; }
.tr-counts .ic { width: 14px; height: 14px; }
.tr-m { font-size: 13px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.lv-dot { width: 12px; height: 12px; border-radius: 3px; }
.topic-h { align-items: flex-start; }
.lv-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; font-weight: 650; font-size: 14px; }
.lv-pill { font-size: 12px; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.topic-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.topic-stats div { background: var(--surface); padding: 14px; display: flex; flex-direction: column; }
.topic-stats b { font: 700 24px var(--f-display); font-variant-numeric: tabular-nums; }
.topic-stats small { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.topic-stats span { font-size: 12.5px; color: var(--ink-2); }
.empty { text-align: center; color: var(--ink-2); }

/* ---------- grile ---------- */
.quiz-head { display: flex; align-items: center; gap: 12px; }
.qz-progress { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 13px; min-width: 0; }
.qz-bar { height: 8px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.qz-bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .3s; }
.combo { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.combo.hot { background: var(--amber); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.q { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.q-topic { color: var(--ink-2); }
.tag { font: 700 11px var(--f-mono); padding: 2px 7px; border-radius: 5px; letter-spacing: .03em; }
.tag-cs { background: var(--accent-soft); color: var(--accent); }
.tag-cm { background: var(--amber-soft); color: var(--amber); }
.tag-origin { background: var(--surface-2); color: var(--ink); }
.tag-new { background: var(--good-soft); color: var(--good); }
.tag-kind { background: var(--surface-2); color: var(--ink-2); font-family: var(--f-body); }
.q-instr { font-size: 12.5px; color: var(--ink-3); }
.q-stem { font-size: 17px; line-height: 1.55; font-weight: 500; }
.q-stem p:last-child { margin: 0; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: grid; grid-template-columns: 32px 1fr 22px; gap: 12px; align-items: center; text-align: left; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s; }
.opt:hover:not(:disabled) { border-color: var(--ink-3); }
.opt-l { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); font: 700 14px var(--f-mono); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.on .opt-l { background: var(--accent); color: var(--accent-ink); }
.opt:disabled { cursor: default; }
.opt.good { border-color: var(--good); background: var(--good-soft); }
.opt.good .opt-l { background: var(--good); color: #fff; }
.opt.missed { border-color: var(--good); border-style: dashed; }
.opt.missed .opt-l { color: var(--good); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.bad .opt-l { background: var(--bad); color: #fff; }
.opt.dim { opacity: .65; }
.opt-m .ic { width: 20px; height: 20px; }
.opt.good .opt-m, .opt.missed .opt-m { color: var(--good); }
.opt.bad .opt-m { color: var(--bad); }
.fb { border-radius: var(--r); padding: 14px 16px; border-left: 4px solid; display: flex; flex-direction: column; gap: 8px; }
.fb-good { background: var(--good-soft); border-color: var(--good); }
.fb-part { background: var(--part-soft); border-color: var(--part); }
.fb-bad { background: var(--bad-soft); border-color: var(--bad); }
.fb-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fb-head b { font: 700 17px var(--f-display); }
.fb-good .fb-head b { color: var(--good); } .fb-part .fb-head b { color: var(--part); } .fb-bad .fb-head b { color: var(--bad); }
.pts { font-weight: 650; font-variant-numeric: tabular-nums; }
.fb-ans { margin-left: auto; font-size: 13.5px; }
.fb-src { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-src .ic { width: 14px; height: 14px; }
.peer { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.quiz-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-tools { display: flex; gap: 2px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--ink-2); }
.kbd-hint { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kbd-hint .ic { width: 15px; height: 15px; }
.result-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.result-hero.good .ring { color: var(--good); } .result-hero.mid .ring { color: var(--part); } .result-hero.low .ring { color: var(--bad); }
.stat-row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.stat-row div { display: flex; flex-direction: column; }
.stat-row b { font: 700 22px var(--f-display); font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 12.5px; color: var(--ink-2); }
.score-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.score-big b { font: 800 64px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.score-big em { font-style: normal; padding: 3px 10px; background: var(--surface-2); border-radius: 99px; font-weight: 650; }
.result-hero.big.good .score-big b { color: var(--good); } .result-hero.big.mid .score-big b { color: var(--part); } .result-hero.big.low .score-big b { color: var(--bad); }
.result-hero.big { flex-direction: column; align-items: flex-start; }
.wrong-list { display: flex; flex-direction: column; gap: 8px; }
.wl { border: 1px solid var(--line); border-radius: var(--r); padding: 0; background: var(--surface); }
.wl > summary { padding: 11px 14px; cursor: pointer; list-style: none; display: block; }
.wl > summary::-webkit-details-marker { display: none; }
.wl[open] > summary { border-bottom: 1px solid var(--line); }
.wl .q { border: 0; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip-opt { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 11px; cursor: pointer; font-size: 13px; }
.chip-opt:hover { border-color: var(--accent); }
.comments { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.cmt { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.cmt-h { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.cmt-h .link-btn { margin-left: auto; }
.cmt-new { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.q-mini { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; }

/* ---------- antrenament ---------- */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-b { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.quick-b:hover { border-color: var(--accent); }
.quick-b span { font-size: 13px; color: var(--ink-2); }
.quick-b.hot { border-color: var(--amber); }
.builder { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.sticky-card { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 14px; }
.picker { display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; }
.pk-book { border: 1px solid var(--line); border-radius: var(--r-sm); }
.pk-book > summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; cursor: pointer; }
.pk-ch { padding: 2px 12px 8px; border-top: 1px solid var(--line); }
.pk-ch-l { display: flex; gap: 8px; padding: 6px 0 2px; font-weight: 600; font-size: 14px; cursor: pointer; }
.pk-t { display: flex; gap: 8px; padding: 3px 0; font-size: 14px; cursor: pointer; align-items: baseline; }
.pk-t.ind { padding-left: 22px; }
.pk-sum { font-size: 13.5px; color: var(--ink-2); }

/* ---------- flashcarduri ---------- */
.fc-wrap { perspective: 1400px; }
.fc { position: relative; min-height: 300px; cursor: pointer; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2, .7, .2, 1); outline: none; }
.fc.flipped { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; box-shadow: var(--shadow); }
.fc-back { transform: rotateY(180deg); }
.fc-meta { display: flex; justify-content: space-between; font-size: 12.5px; gap: 8px; }
.fc-body { font-size: 18px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.fc-back .fc-body { font-size: 16px; justify-content: flex-start; }
.fc-q { font-size: 13.5px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.fc-hint { text-align: center; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.rate.hidden-rate { visibility: hidden; }
.rate-b { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 6px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; position: relative; }
.rate-b span { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rate-b kbd { position: absolute; top: 4px; right: 6px; font: 10px var(--f-mono); color: var(--ink-3); }
.rate-b.again { border-color: var(--bad); } .rate-b.again b { color: var(--bad); }
.rate-b.hard { border-color: var(--part); } .rate-b.hard b { color: var(--part); }
.rate-b.good { border-color: var(--good); } .rate-b.good b { color: var(--good); }
.rate-b.easy { border-color: var(--accent); } .rate-b.easy b { color: var(--accent); }
.empty-big { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.big-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); }
.big-ic.ok { background: var(--good-soft); color: var(--good); }
.big-ic .ic { width: 28px; height: 28px; }

/* ---------- scheme + markdown ---------- */
.schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.scheme { display: flex; flex-direction: column; gap: 10px; }
.sc-h { display: flex; align-items: center; gap: 8px; }
.sc-h h3 { flex: 1; }
.sc-body { max-height: 520px; overflow: auto; }
.md { line-height: 1.6; min-width: 0; }
.md h2, .md h3, .md h4 { margin: 12px 0 6px; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md li.sub { margin-left: 18px; list-style: circle; }
.md mark { background: var(--amber-soft); color: inherit; padding: 0 3px; border-radius: 3px; }
.md blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 6px 6px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md .arr { color: var(--accent); font-weight: 700; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.md-table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 6px 0; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.md-table th { background: var(--surface-2); font-weight: 650; }
.callout { border-radius: var(--r-sm); padding: 10px 13px; margin: 8px 0; background: var(--accent-soft); }
.callout-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.callout-atentie { background: var(--bad-soft); } .callout-atentie .callout-label { color: var(--bad); }
.callout-cheie { background: var(--amber-soft); } .callout-cheie .callout-label { color: var(--amber); }
.callout-mnemonic { background: var(--part-soft); } .callout-mnemonic .callout-label { color: var(--part); }
.mermaid-wrap, .mermaid-svg { overflow-x: auto; max-width: 100%; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px; }
.mermaid-svg svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
pre.mermaid { margin: 0; white-space: pre; font: 12px var(--f-mono); color: var(--ink-2); }
pre.mermaid.mermaid-offline::before { content: "Schema se afișează când browserul are acces la internet (biblioteca de desenare se încarcă online)."; display: block; font-family: var(--f-body); font-size: 12px; color: var(--ink-3); margin-bottom: 6px; white-space: normal; }
pre.code { background: var(--surface-2); padding: 12px; border-radius: var(--r-sm); overflow: auto; font: 12.5px/1.5 var(--f-mono); max-width: 100%; }
pre.code.small { max-height: 220px; font-size: 11.5px; }
.filters { margin-bottom: 4px; }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; max-width: 360px; }
.search .ic { position: absolute; left: 10px; color: var(--ink-3); }
.search input { padding-left: 34px; }

/* ---------- simulare ---------- */
.exam-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.exam-opt { display: flex; flex-direction: column; gap: 8px; }
.exam-opt .btn { margin-top: auto; align-self: flex-start; }
.exam-opt.featured { grid-row: span 2; border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 60%); }
.eo-n { font: 800 38px/1 var(--f-display); color: var(--accent); display: flex; align-items: baseline; gap: 6px; }
.eo-n span { font: 500 14px var(--f-body); color: var(--ink-2); }
.eo-n .ic { width: 32px; height: 32px; }
.past-list { display: flex; flex-wrap: wrap; gap: 6px; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-color: var(--amber); background: var(--amber-soft); }
.exam-top { display: flex; align-items: center; gap: 14px; position: sticky; top: 64px; z-index: 5; padding: 12px 16px; }
.exam-top > div:first-child { flex: 1; min-width: 0; }
.timer { font: 700 24px var(--f-mono); font-variant-numeric: tabular-nums; padding: 4px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.timer.low { background: var(--bad); color: #fff; }
.exam-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.exam-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ex-num { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.exam-nav { position: sticky; top: 140px; padding: 12px; }
.navgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; max-height: 60vh; overflow-y: auto; margin: 8px 0; }
.navgrid button { border: 1px solid var(--line); background: var(--surface); border-radius: 4px; font: 10.5px var(--f-mono); padding: 4px 0; cursor: pointer; }
.navgrid .ans { background: var(--accent-soft); border-color: var(--accent); }
.navgrid .flg { box-shadow: inset 0 -3px 0 var(--amber); }
.navgrid .cur { outline: 2px solid var(--ink); outline-offset: 0; }
.nav-legend { display: flex; gap: 10px; font-size: 11.5px; color: var(--ink-2); }
.nav-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.nav-legend i.ans { background: var(--accent-soft); border: 1px solid var(--accent); }
.nav-legend i.flg { background: var(--amber); }
.board { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.board li { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board li.me { background: var(--accent-soft); border-radius: var(--r-sm); }
.board li.example { opacity: .7; }
.board .grow { display: flex; flex-direction: column; }
.pos { width: 26px; text-align: center; font: 700 15px var(--f-display); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.top1 .pos { color: var(--amber); } .top2 .pos { color: var(--ink-2); } .top3 .pos { color: var(--l); }
.av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 700 13px var(--f-display); color: #fff; flex: none; border: 2px solid transparent; }
.av-teal { background: #0B7A72; } .av-coral { background: #D2604F; } .av-indigo { background: #4657B8; } .av-amber { background: #C9741E; }
.av-plum { background: #8A4C93; } .av-moss { background: #5B7F2E; } .av-sky { background: #2D8AC0; } .av-rose { background: #C24B78; }
.av-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.av-pick .av { cursor: pointer; }
.av-pick .av.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.pod b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod span { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pod .av { width: 48px; height: 48px; font-size: 16px; }
.pod-base { width: 100%; border-radius: 8px 8px 0 0; background: var(--surface-2); display: grid; place-items: center; font: 800 26px var(--f-display); color: var(--ink-3); }
.pod1 .pod-base { height: 90px; background: var(--amber-soft); color: var(--amber); }
.pod2 .pod-base { height: 64px; } .pod3 .pod-base { height: 46px; }
.pod.me b { color: var(--accent); }

/* ---------- rapoarte ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi span { font-size: 12.5px; color: var(--ink-2); }
.kpi b { font: 700 26px var(--f-display); font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.book-card h3 { margin-bottom: 8px; }
.bk-stats { display: flex; gap: 18px; margin-bottom: 12px; }
.bk-stats div { display: flex; flex-direction: column; }
.bk-stats b { font: 700 22px var(--f-display); font-variant-numeric: tabular-nums; }
.bk-stats span { font-size: 12px; color: var(--ink-2); }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 1px; }
.stack i { display: block; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 900px; }
.rep-table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--ink-2); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rep-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rep-table .num { text-align: right; }
.rep-table tr.clickable { cursor: pointer; }
.rep-table tr.clickable:hover td { background: var(--surface-2); }
.rep-table .ch-row td { background: var(--surface-2); padding-top: 10px; }
.rep-table .meter { width: 70px; }

/* ---------- realizări ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.ach { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; opacity: .6; }
.ach.on { opacity: 1; border-color: var(--amber); }
.ach-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); margin-bottom: 4px; }
.ach.on .ach-ic { background: var(--amber); color: #fff; }
.ach em { font-style: normal; font-size: 11.5px; color: var(--amber); font-weight: 600; }
.rank-now { display: flex; align-items: baseline; gap: 8px; }
.rank-now b { font: 800 30px var(--f-display); color: var(--accent); }
.ranks { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; }
.ranks li { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); color: var(--ink-3); font-size: 13.5px; }
.ranks li.done { color: var(--ink); }
.ranks li.cur { background: var(--accent-soft); border-radius: 6px; }
.ranks li.cur b { color: var(--accent); }
.ranks em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 12px; }
.xp-rules { padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- formulare, admin ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form h3 { margin-top: 6px; }
.qe-opt { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; }
.file-drop { display: block; border: 1.5px dashed var(--line); border-radius: var(--r); padding: 14px; text-align: center; cursor: pointer; margin: 8px 0; }
.file-drop input { display: none; }
.file-drop span { display: inline-flex; gap: 6px; align-items: center; color: var(--accent); font-weight: 600; }
.errs { font-size: 13px; color: var(--bad); max-height: 220px; overflow: auto; }
.codes { font-size: 12.5px; columns: 2; max-height: 300px; overflow: auto; }
.rep { border-bottom: 1px solid var(--line); padding: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; max-height: 420px; overflow: auto; }

/* ---------- modal, toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(8, 16, 15, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 480px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
#toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 15px; border-radius: var(--r); max-width: 360px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; transform: translateY(8px); transition: all .25s; pointer-events: auto; font-size: 14px; }
.toast.in { opacity: 1; transform: none; }
.toast-ok { background: var(--good); color: #fff; }
.toast-err { background: var(--bad); color: #fff; }
.toast-warn { background: var(--part); color: #fff; }
.toast-win { background: var(--surface); color: var(--ink); border: 2px solid var(--amber); }
.cele { display: flex; gap: 10px; align-items: center; }
.cele .ic { width: 30px; height: 30px; color: var(--amber); }
.xp-float { position: fixed; z-index: 150; transform: translateX(-50%); font: 700 13px var(--f-display); color: var(--amber); pointer-events: none; animation: xpf 1.1s ease-out forwards; }
@keyframes xpf { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 26px); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .actions-grid, .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-102%); transition: transform .25s; height: 100%; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .35); }
  .only-mobile { display: inline-flex; }
  .lvl-text span, .lvl-bar { display: none; }
  .chip-level .lvl-text { display: flex; }
  .chip-goal .muted { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); flex-direction: row; gap: 0; }
  .tabbar a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; justify-content: center; }
  .tabbar a .badge { position: absolute; top: 2px; left: 55%; margin: 0; }
  main { padding-bottom: 70px; }
  .grid2, .builder, .hero-row, .exam-body, .split { grid-template-columns: 1fr; }
  .today { justify-content: flex-start; }
  .topic-stats { grid-template-columns: repeat(2, 1fr); }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .exam-nav { position: static; }
  .exam-top { top: 60px; }
  .sticky-card { position: static; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px max(16px, env(safe-area-inset-left, 0px)); min-height: 280px; }
  #toasts { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-grid, .quick { grid-template-columns: 1fr 1fr; gap: 10px; }
  .a-n { font-size: 24px; }
  .topic-row { grid-template-columns: 12px 1fr 40px; }
  .tr-counts { display: none; }
  .q { padding: 16px; }
  .q-stem { font-size: 16px; }
  .opt { grid-template-columns: 28px 1fr 18px; gap: 9px; padding: 9px 10px; }
  .opt-l { width: 28px; height: 28px; }
  .rate { grid-template-columns: repeat(2, 1fr); }
  .chip-level { display: none; }
  .navgrid { grid-template-columns: repeat(10, 1fr); }
  .score-big b { font-size: 48px; }
  .meter { width: 60px; }
  .codes { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* scheme pliabile pe subcapitole */
.sch-list { display: flex; flex-direction: column; gap: 10px; }
.sch-group > summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; list-style: none; }
.sch-group > summary::-webkit-details-marker { display: none; }
.sch-group > summary::before { content: "▸"; color: var(--ink-3); }
.sch-group[open] > summary::before { content: "▾"; }
.sch-group[open] > summary { margin-bottom: 12px; }
.sch-group > summary .link { margin-left: auto; }

/* subiecte de rezi */
.rezi-badge { display: inline-flex; align-items: center; gap: 3px; color: var(--amber); font-weight: 600; font-size: .85em; }
.rezi-badge svg { width: 14px; height: 14px; }
