/* ===== Visual DSA Learning Engine — Kapil ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0b;
  --bg-2: #111114;
  --ink: #f4f2ee;
  --ink-dim: #a8a49d;
  --ink-mute: #6f6b64;
  --gold: #d4a94a;
  --gold-hi: #f0c96b;
  --gold-lo: #8a6f2e;
  --line: rgba(255,255,255,0.08);
  --line-hi: rgba(255,255,255,0.16);
  --glass: rgba(20,20,22,0.55);
  --glass-hi: rgba(28,28,32,0.72);
  --danger: #e26d5c;
  --ok: #6dd39c;
  --warn: #f5b942;
  --info: #7fb6ff;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.005em;
}
.hidden { display: none !important; }
.muted { color: var(--ink-mute); font-size: 13px; }
.center-text { text-align: center; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; }
h4 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
     color: var(--gold); margin: 18px 0 8px; font-family: var(--sans); font-weight: 700; }

/* ---------- Aurora bg ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; }
.orb-1 { width: 520px; height: 520px; top: -140px; left: -120px;
         background: radial-gradient(circle, rgba(212,169,74,0.35), transparent 70%); animation: drift 22s ease-in-out infinite; }
.orb-2 { width: 620px; height: 620px; bottom: -180px; right: -160px;
         background: radial-gradient(circle, rgba(127,182,255,0.16), transparent 70%); animation: drift 28s ease-in-out infinite reverse; }
.orb-3 { width: 380px; height: 380px; top: 40%; left: 55%;
         background: radial-gradient(circle, rgba(255,255,255,0.05), transparent 70%); animation: drift 34s ease-in-out infinite; }
.grain { position: absolute; inset: 0; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' /></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
@keyframes drift {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(60px,-40px); }
}

/* ---------- Screens ---------- */
.screen { position: relative; z-index: 1; }
.screen:not(.active) { display: none !important; }
#app-shell { position: relative; z-index: 1; }

/* ---------- Glass card ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* =========================================================
   WELCOME SCREEN
========================================================= */
#welcome-screen { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; }
.welcome-wrap { max-width: 780px; width: 100%; text-align: center; }
.brand-mark { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 100px; font-size: 11px; letter-spacing: 0.24em;
  color: var(--ink-dim); background: rgba(255,255,255,0.02); margin-bottom: 40px;
  animation: fadeDown 700ms ease both; }
.mono-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 12px var(--gold); }
.hero-title { font-family: var(--serif); font-size: clamp(48px, 8vw, 96px);
  line-height: 0.98; letter-spacing: -0.02em; margin-bottom: 20px; font-weight: 400; }
.hero-line { display: block; animation: fadeUp 800ms ease both; }
.hero-line.italic { font-style: italic; color: var(--gold);
  background: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 50%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation-delay: 120ms; }
.hero-sub { font-size: 17px; color: var(--ink-dim); margin-bottom: 44px;
  animation: fadeUp 900ms ease 240ms both; }
.hero-card { padding: 32px; text-align: left; animation: fadeUp 900ms ease 360ms both; }
.input-label { display: block; font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 12px; }
#student-name { width: 100%; padding: 16px 18px; font-size: 18px; color: var(--ink);
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  border-radius: 12px; font-family: var(--sans); outline: none; transition: border 200ms, background 200ms; }
#student-name:focus { border-color: var(--gold); background: rgba(212,169,74,0.05); }
#student-name::placeholder { color: var(--ink-mute); }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.hero-foot { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px;
  margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line);
  animation: fadeUp 900ms ease 480ms both; }
.foot-item { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.foot-item b { font-family: var(--serif); font-size: 28px; color: var(--gold); font-weight: 600; }
.foot-item span { font-size: 11px; letter-spacing: 0.16em; color: var(--ink-mute); text-transform: uppercase; }
.copyright { margin-top: 40px; font-size: 11px; letter-spacing: 0.16em;
  color: var(--ink-mute); text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary, .btn-ghost {
  font-family: var(--sans); font-weight: 600; cursor: pointer;
  border-radius: 100px; transition: transform 160ms ease, background 200ms, border 200ms, color 200ms;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; letter-spacing: 0.02em;
}
.btn-primary { padding: 14px 26px; font-size: 15px; background: var(--gold); color: #1a1305;
  box-shadow: 0 8px 24px -8px rgba(212,169,74,0.6); margin-top: 20px; }
.btn-primary:hover { transform: translateY(-1px); background: var(--gold-hi); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { padding: 10px 18px; font-size: 13px; background: rgba(255,255,255,0.06);
  color: var(--ink); border-color: var(--line-hi); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-ghost { padding: 8px 14px; font-size: 12px; background: transparent;
  color: var(--ink-dim); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-hi); background: rgba(255,255,255,0.04); }

/* =========================================================
   HEADER
========================================================= */
.app-header { position: sticky; top: 12px; z-index: 100; margin: 12px 20px 0;
  padding: 12px 20px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px; border-radius: 100px; }
.hdr-left, .hdr-right { display: flex; align-items: center; gap: 12px; }
.hdr-right { justify-content: flex-end; }
.hdr-brand { font-size: 11px; letter-spacing: 0.24em; color: var(--ink-dim); }
.hdr-center { display: flex; align-items: center; gap: 10px; font-size: 13px;
  color: var(--ink-dim); font-family: var(--serif); font-style: italic; justify-content: center; }
.hdr-center #hdr-problem { color: var(--ink); font-style: normal; font-family: var(--sans); }
.dot-sep { color: var(--gold); }
#hdr-date, #hdr-time { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
#hdr-time { color: var(--ink); }
.pill { padding: 6px 12px; border-radius: 100px; border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-dim); background: rgba(255,255,255,0.02); }

/* =========================================================
   DASHBOARD
========================================================= */
#dashboard-screen { padding: 40px 28px 60px; max-width: 1440px; margin: 0 auto; }
.dash-hero { display: flex; justify-content: space-between; align-items: flex-end;
  gap: 40px; margin-bottom: 32px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: 0.24em; color: var(--gold);
  text-transform: uppercase; margin-bottom: 12px; }
.dash-title { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 8px; }
.dash-sub { color: var(--ink-dim); font-size: 15px; }
.stats-strip { display: grid; grid-template-columns: repeat(5, minmax(80px,1fr));
  gap: 8px; padding: 16px 24px; border-radius: 100px; background: var(--glass);
  border: 1px solid var(--line); backdrop-filter: blur(18px); }
.stat { text-align: center; padding: 0 6px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-num { display: block; font-family: var(--serif); font-size: 22px; color: var(--gold); font-weight: 600; }
.stat-lbl { display: block; font-size: 10px; letter-spacing: 0.18em; color: var(--ink-mute); text-transform: uppercase; margin-top: 4px; }

.progress-bar-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.progress-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  transition: width 600ms cubic-bezier(0.2,0.8,0.2,1); box-shadow: 0 0 12px rgba(212,169,74,0.5); }
.progress-text { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }

.pattern-grid { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 40px; }
.p-card { background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; cursor: pointer; transition: transform 240ms cubic-bezier(0.2,0.8,0.2,1), border-color 240ms, background 240ms;
  position: relative; overflow: hidden; }
.p-card::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(212,169,74,0.08), transparent 60%);
  opacity: 0; transition: opacity 240ms; }
.p-card:hover { transform: translateY(-4px); border-color: var(--gold-lo); }
.p-card:hover::before { opacity: 1; }
.p-card .p-idx { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.p-card .p-title { font-family: var(--serif); font-size: 20px; line-height: 1.2; margin: 8px 0 12px; letter-spacing: -0.01em; }
.p-card .p-prob { color: var(--ink-dim); font-size: 13px; margin-bottom: 16px; min-height: 34px; }
.p-card .p-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--ink-mute); }
.p-card .p-meta .p-diff { color: var(--ok); }
.p-card .p-status { position: absolute; top: 16px; right: 16px; font-size: 10px;
  padding: 4px 10px; border-radius: 100px; letter-spacing: 0.12em; text-transform: uppercase; }
.p-card .p-status.locked { color: var(--ink-mute); border: 1px solid var(--line); }
.p-card .p-status.progress { color: var(--warn); border: 1px solid rgba(245,185,66,0.3); background: rgba(245,185,66,0.06); }
.p-card .p-status.done { color: var(--ok); border: 1px solid rgba(109,211,156,0.3); background: rgba(109,211,156,0.06); }
.p-card.done { border-color: rgba(109,211,156,0.28); }
.p-card.progress { border-color: rgba(245,185,66,0.28); }

.certificate-btn { margin: 0 auto 40px; display: flex; }
.leaderboard { padding: 24px 28px; }
.leaderboard h3 { font-size: 20px; margin-bottom: 16px; }
.lb-row { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 16px; padding: 12px 0;
  border-top: 1px solid var(--line); font-size: 14px; align-items: center; }
.lb-row:first-child { border-top: none; }
.lb-rank { font-family: var(--serif); color: var(--gold); font-size: 18px; }
.lb-time { font-family: var(--mono); color: var(--ink-dim); font-size: 13px; }

/* =========================================================
   PROBLEM SCREEN
========================================================= */
#problem-screen { padding: 16px 20px 40px; max-width: 1600px; margin: 0 auto; }
.problem-topbar { display: flex; align-items: center; gap: 20px; margin: 16px 0 20px; flex-wrap: wrap; }
.timer-wrap { display: flex; align-items: baseline; gap: 10px; padding: 8px 16px;
  border-radius: 100px; border: 1px solid var(--line); background: var(--glass); }
.timer-label { font-size: 10px; letter-spacing: 0.2em; color: var(--ink-mute); text-transform: uppercase; }
.timer-display { font-family: var(--mono); font-size: 20px; color: var(--gold); font-weight: 500;
  font-variant-numeric: tabular-nums; }
.timer-display.urgent { color: var(--danger); animation: pulse 800ms ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.problem-meta-pills { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.detector { margin-bottom: 20px; padding: 20px 24px; }
.det-q { font-family: var(--serif); font-size: 17px; margin-bottom: 14px; }
.pattern-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-btn { padding: 8px 14px; border-radius: 100px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.03); color: var(--ink-dim); cursor: pointer; font-size: 13px;
  transition: all 200ms; }
.pc-btn:hover { border-color: var(--gold-lo); color: var(--ink); }
.pc-btn.chosen { border-color: var(--gold); color: var(--gold); background: rgba(212,169,74,0.06); }
.det-result { margin-top: 12px; font-size: 13px; min-height: 20px; }
.det-result.ok { color: var(--ok); }
.det-result.bad { color: var(--warn); }

.problem-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0,1fr) minmax(300px,380px);
  gap: 16px; align-items: start; }
@media (max-width: 1200px) { .problem-grid { grid-template-columns: 1fr; } }

.prob-left, .prob-center > *, .prob-right > * { padding: 22px 24px; }
.prob-left { max-height: calc(100vh - 140px); overflow-y: auto; }
.prob-title { font-size: 22px; line-height: 1.2; margin-bottom: 12px; letter-spacing: -0.01em; }
.prob-tags { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.prob-tags .tag { padding: 3px 10px; border-radius: 100px; font-size: 11px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--ink-dim); }
.prob-left p, .prob-left ul { color: var(--ink-dim); font-size: 13px; line-height: 1.6; }
.prob-left ul { padding-left: 18px; }
.prob-left pre { background: rgba(0,0,0,0.35); padding: 10px 14px; border-radius: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--ink); overflow-x: auto;
  border: 1px solid var(--line); }
.reveal-solution { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--gold-lo); }

/* ------ Editor ------ */
.prob-center { display: flex; flex-direction: column; gap: 16px; }
.editor-wrap { padding: 0 !important; overflow: hidden; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.25); }
.lang-tag { font-size: 11px; letter-spacing: 0.2em; color: var(--gold); text-transform: uppercase; font-weight: 600; }
.tb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.editor-body { position: relative; display: grid; grid-template-columns: 44px 1fr;
  min-height: 380px; max-height: 480px; background: #0a0a0c; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.line-numbers { padding: 12px 8px 12px 12px; color: var(--ink-mute); text-align: right;
  user-select: none; border-right: 1px solid var(--line); background: rgba(0,0,0,0.2);
  font-family: var(--mono); font-size: 12px; line-height: 1.6; overflow: hidden; }
.editor-mirror, #code-editor { position: relative; padding: 12px 14px; margin: 0;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre;
  word-wrap: normal; overflow: auto; grid-row: 1; grid-column: 2; }
.editor-mirror { pointer-events: none; color: var(--ink); }
#code-editor { background: transparent; color: transparent; caret-color: var(--gold);
  border: 0; outline: 0; resize: none; -webkit-text-fill-color: transparent; }
.editor-body { position: relative; }
/* stack mirror & textarea */
.editor-mirror { grid-row: 1; grid-column: 2; }
#code-editor { grid-row: 1; grid-column: 2; }

/* syntax colors */
.tok-kw { color: #c792ea; }
.tok-type { color: #7fb6ff; }
.tok-str { color: #b3e88a; }
.tok-num { color: #f5b942; }
.tok-com { color: #6f6b64; font-style: italic; }
.tok-fn { color: #f0c96b; }
.tok-op { color: #d4a94a; }

/* Console */
.console { padding: 0 !important; overflow: hidden; }
.console-tabs { display: flex; border-bottom: 1px solid var(--line); background: rgba(0,0,0,0.2); }
.console-tabs .tab { padding: 12px 20px; background: transparent; color: var(--ink-mute);
  border: none; cursor: pointer; font-family: var(--sans); font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.console-tabs .tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; padding: 18px 22px; max-height: 260px; overflow-y: auto; }
.tab-panel.active { display: block; }
.tc-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--line); font-size: 13px; }
.tc-row:first-child { border-top: none; }
.tc-status { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 6px;
  min-width: 30px; text-align: center; flex-shrink: 0; }
.tc-status.pass { background: rgba(109,211,156,0.14); color: var(--ok); }
.tc-status.fail { background: rgba(226,109,92,0.14); color: var(--danger); }
.tc-status.hidden-pass { background: rgba(109,211,156,0.08); color: var(--ok); }
.tc-status.hidden-fail { background: rgba(226,109,92,0.08); color: var(--danger); }
.tc-body { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.tc-body b { color: var(--ink); }
.bug-card { padding: 14px; border-radius: 10px; border: 1px solid rgba(245,185,66,0.3);
  background: rgba(245,185,66,0.05); margin-bottom: 10px; }
.bug-title { color: var(--warn); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.bug-desc { color: var(--ink-dim); font-size: 13px; line-height: 1.6; }

/* Viz */
.prob-right { display: flex; flex-direction: column; gap: 16px; }
.viz-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.viz-head h4 { margin: 0; }
.viz-ctrl { display: flex; gap: 4px; }
.viz-stage { min-height: 200px; padding: 20px; border-radius: 12px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--line); display: flex;
  align-items: center; justify-content: center; overflow-x: auto; }
.viz-step-info { display: flex; justify-content: space-between; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }

/* array viz cells */
.arr-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.arr-cell { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono);
  font-size: 14px; color: var(--ink); background: rgba(255,255,255,0.03);
  position: relative; transition: all 300ms cubic-bezier(0.2,0.8,0.2,1); }
.arr-cell.compare { border-color: var(--info); background: rgba(127,182,255,0.14); box-shadow: 0 0 12px rgba(127,182,255,0.3); }
.arr-cell.swap { border-color: var(--warn); background: rgba(245,185,66,0.16); transform: translateY(-4px); }
.arr-cell.done { border-color: var(--ok); background: rgba(109,211,156,0.14); color: var(--ok); }
.arr-cell.current { border-color: var(--gold); background: rgba(212,169,74,0.14); box-shadow: 0 0 12px rgba(212,169,74,0.35); }
.arr-cell.target { border-color: var(--danger); background: rgba(226,109,92,0.14); }
.arr-cell.hi { border-color: var(--gold); }
.arr-idx { position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--ink-mute); }
.ptr-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--gold); font-weight: 700; }

/* Watch */
.watch-list { display: flex; flex-direction: column; gap: 8px; }
.watch-item { display: flex; justify-content: space-between; padding: 8px 12px;
  background: rgba(0,0,0,0.25); border-radius: 8px; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; }
.watch-item b { color: var(--gold); }

/* Memory */
.memory-panel { display: flex; flex-direction: column; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.mem-slot { padding: 8px 12px; background: rgba(0,0,0,0.2); border-radius: 6px;
  border: 1px solid var(--line); }
.mem-slot.hi { border-color: var(--gold); color: var(--gold); }

/* linked list viz */
.ll-row { display: flex; align-items: center; gap: 6px; }
.ll-node { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.03); font-family: var(--mono); font-size: 13px;
  transition: all 300ms; }
.ll-node.current { border-color: var(--gold); background: rgba(212,169,74,0.14); box-shadow: 0 0 12px rgba(212,169,74,0.3); }
.ll-arrow { color: var(--ink-mute); font-family: var(--mono); }

/* Tree viz */
.tree-viz { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tree-level { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.tree-node { width: 40px; height: 40px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; border: 1px solid var(--line);
  background: rgba(255,255,255,0.03); font-family: var(--mono); font-size: 13px; transition: all 300ms; }
.tree-node.visited { border-color: var(--ok); background: rgba(109,211,156,0.14); color: var(--ok); }
.tree-node.current { border-color: var(--gold); background: rgba(212,169,74,0.18); box-shadow: 0 0 12px var(--gold); }

/* Stack/Queue */
.sq-container { display: flex; flex-direction: column-reverse; gap: 4px; align-items: center; }
.sq-item { padding: 8px 16px; min-width: 60px; text-align: center; background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 13px;
  animation: slideIn 300ms ease; }
.sq-item.top { border-color: var(--gold); background: rgba(212,169,74,0.12); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Toast */
.toast-host { position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 14px 20px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--glass-hi); backdrop-filter: blur(20px); font-size: 13px;
  min-width: 220px; animation: toastIn 300ms cubic-bezier(0.2,0.8,0.2,1); }
.toast.ok { border-color: rgba(109,211,156,0.4); color: var(--ok); }
.toast.err { border-color: rgba(226,109,92,0.4); color: var(--danger); }
.toast.info { border-color: var(--line-hi); color: var(--ink); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* mobile */
@media (max-width: 720px) {
  .app-header { grid-template-columns: 1fr; text-align: center; gap: 8px; border-radius: 20px; }
  .hdr-right, .hdr-left { justify-content: center; }
  .hdr-center { justify-content: center; }
  .stats-strip { grid-template-columns: repeat(5,1fr); border-radius: 20px; padding: 12px 10px; }
  .stat-num { font-size: 18px; }
  .problem-topbar { flex-direction: column; align-items: stretch; }
  .problem-meta-pills { margin-left: 0; justify-content: center; }
  .prob-left { max-height: none; }
}
