/* =========================================================================
   ODYSSEY — design system
   Celestial cartography: deep space, warm gold, cosmic violet.
   ========================================================================= */

:root {
  /* surfaces */
  --bg-0: #07070d;
  --bg-1: #0b0b15;
  --bg-2: #11111e;
  --panel: rgba(255, 255, 255, 0.022);
  --panel-2: rgba(255, 255, 255, 0.04);
  --panel-hi: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  /* ink */
  --ink: #f4f3fb;
  --ink-2: #c4c3d6;
  --ink-3: #8a89a0;
  --ink-4: #5d5c72;

  /* accents */
  --gold: #f0c073;
  --gold-2: #e8a94e;
  --gold-soft: rgba(240, 192, 115, 0.14);
  --violet: #9a8bf7;
  --violet-2: #7a6cf0;
  --violet-soft: rgba(154, 139, 247, 0.14);
  --teal: #5fe3cf;
  --teal-soft: rgba(95, 227, 207, 0.14);
  --rose: #f58aa3;
  --rose-soft: rgba(245, 138, 163, 0.14);
  --sky: #76c6ff;

  /* semantic */
  --good: #5fe3cf;
  --warn: #f0c073;
  --bad: #f58aa3;

  /* type */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* geometry */
  --r-sm: 9px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --sb-w: 256px;

  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  --glow-gold: 0 0 0 1px rgba(240, 192, 115, 0.25), 0 14px 40px -14px rgba(240, 192, 115, 0.35);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  font-feature-settings: "ss01", "cv11";
}

/* ambient gradient + starfield ------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 700px at 78% -8%, rgba(122, 108, 240, 0.18), transparent 60%),
    radial-gradient(900px 650px at 8% 108%, rgba(240, 192, 115, 0.10), transparent 55%),
    radial-gradient(700px 700px at 100% 100%, rgba(95, 227, 207, 0.06), transparent 60%),
    linear-gradient(180deg, #08080f, #06060c);
  z-index: -2;
}
#starfield { position: fixed; inset: 0; z-index: -1; opacity: 0.75; }

::selection { background: rgba(240, 192, 115, 0.28); color: #fff; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); background-clip: content-box; }

/* =========================================================================
   APP SHELL
   ========================================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  height: 100vh;
  transition: grid-template-columns 0.4s var(--ease);
}
.app[data-collapsed="true"] { grid-template-columns: 78px 1fr; }

/* ---------- sidebar ---------- */
.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0));
  backdrop-filter: blur(14px);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  cursor: pointer;
  user-select: none;
}
.brand-mark {
  flex: none;
  width: 38px; height: 38px;
  color: var(--gold);
  filter: drop-shadow(0 4px 14px rgba(240, 192, 115, 0.45));
  transition: transform 0.6s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(72deg); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.brand-sub { font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 3px; }

.app[data-collapsed="true"] .brand-text,
.app[data-collapsed="true"] .nav-label,
.app[data-collapsed="true"] .streak-label,
.app[data-collapsed="true"] .streak-count { display: none; }
.app[data-collapsed="true"] .streak { justify-content: center; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 4px 6px;
}
.nav-section {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 14px 12px 6px;
  font-weight: 600;
}
.app[data-collapsed="true"] .nav-section { opacity: 0; height: 10px; padding: 6px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  position: relative;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.nav-item:hover { color: var(--ink); background: var(--panel-2); }
.nav-item.active {
  color: var(--ink);
  background: linear-gradient(100deg, var(--gold-soft), rgba(154,139,247,0.06));
  border-color: var(--line-2);
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 4px;
  background: linear-gradient(var(--gold), var(--gold-2));
  box-shadow: 0 0 12px var(--gold);
}
.nav-ico, [data-icon] { flex: none; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: currentColor; }
.nav-ico svg, [data-icon] svg { width: 100%; height: 100%; }
.nav-item.active .nav-ico { color: var(--gold); }
.nav-label { white-space: nowrap; overflow: hidden; }

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.streak {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2);
}
.streak-flame { color: var(--gold); filter: drop-shadow(0 0 6px var(--gold)); }
.streak-count { font-weight: 700; color: var(--ink); }
.streak-label { color: var(--ink-3); }

/* ---------- main / topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,8,15,0.55);
  backdrop-filter: blur(16px);
  z-index: 20;
}
.menu-btn { display: none; }
.crumb { display: flex; flex-direction: column; min-width: 0; }
.crumb-eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.crumb-title { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.015em; line-height: 1.1; margin-top: 2px; }

.topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 9px;
  width: min(340px, 34vw);
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s;
}
.topbar-search:focus-within { border-color: var(--line-2); background: var(--panel-2); }
.topbar-search .search-ico { color: var(--ink-3); }
.topbar-search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-size: 13px; font-family: inherit; min-width: 0; }
.topbar-search input::placeholder { color: var(--ink-4); }
.topbar-search kbd {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-2);
  transition: 0.18s;
}
.icon-btn:hover { color: var(--ink); background: var(--panel-2); border-color: var(--line-2); }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--bg-0);
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 6px 18px -6px var(--gold-2); cursor: pointer;
}

/* ---------- view ---------- */
.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 30px 28px 60px; outline: none; scroll-behavior: smooth; }
.view-inner { max-width: 1180px; margin: 0 auto; }
.wide .view-inner { max-width: 1320px; }

/* =========================================================================
   PRIMITIVES
   ========================================================================= */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
}
.card.glow { box-shadow: var(--shadow); }
.card-pad-lg { padding: 28px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  transition: 0.18s; white-space: nowrap;
}
.btn:hover { background: var(--panel-hi); border-color: var(--line-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .ico, .btn [data-icon] { width: 16px; height: 16px; }
.btn.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #2a1d05; border-color: transparent; box-shadow: 0 10px 28px -12px var(--gold-2);
}
.btn.primary:hover { box-shadow: var(--glow-gold); filter: brightness(1.04); }
.btn.violet { background: linear-gradient(135deg, var(--violet), var(--violet-2)); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--panel); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2);
}
.chip.gold { background: var(--gold-soft); border-color: rgba(240,192,115,.3); color: var(--gold); }
.chip.violet { background: var(--violet-soft); border-color: rgba(154,139,247,.3); color: var(--violet); }
.chip.teal { background: var(--teal-soft); border-color: rgba(95,227,207,.3); color: var(--teal); }
.chip.rose { background: var(--rose-soft); border-color: rgba(245,138,163,.3); color: var(--rose); }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.tag { font-size: 11px; padding: 3px 9px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-3); }

.eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.section-title { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.tnum { font-variant-numeric: tabular-nums; }

/* inputs */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.02em; }
.input, .textarea, .select {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; outline: none; transition: border-color 0.18s, box-shadow 0.18s;
}
.input:focus, .textarea:focus, .select:focus { border-color: rgba(240,192,115,.5); box-shadow: 0 0 0 3px var(--gold-soft); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238a89a0' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; cursor: pointer; }

.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  cursor: pointer; transition: 0.2s; color: var(--ink-3); background: var(--panel);
}
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: var(--gold-soft); color: var(--ink-2); }
.dropzone .dz-ico { width: 34px; height: 34px; color: var(--gold); }

/* progress + bars */
.bar { height: 8px; border-radius: 99px; background: var(--panel-hi); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width 0.9s var(--ease); }
.bar.violet > span { background: linear-gradient(90deg, var(--violet), var(--violet-2)); }
.bar.teal > span { background: linear-gradient(90deg, var(--teal), #3fbfae); }
.bar.rose > span { background: linear-gradient(90deg, var(--rose), #e0657f); }

/* tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.tab { padding: 8px 15px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); cursor: pointer; border: none; background: none; font-family: inherit; transition: 0.16s; white-space: nowrap; }
.tab:hover { color: var(--ink-2); }
.tab.active { background: var(--panel-hi); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(0,0,0,.6); }

/* grids */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-sm { gap: 8px; }
.mt { margin-top: 18px; } .mt-lg { margin-top: 28px; } .mt-sm { margin-top: 10px; }
.mb { margin-bottom: 18px; } .mb-lg { margin-bottom: 28px; }

/* stat */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.stat-num.sm { font-size: 22px; }
.stat-label { font-size: 12px; color: var(--ink-3); }

/* =========================================================================
   PAGE HEADERS / HERO
   ========================================================================= */
.page-hero { margin-bottom: 26px; }
.page-hero h2 { font-family: var(--display); font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
.page-hero p { color: var(--ink-3); margin-top: 9px; max-width: 62ch; font-size: 14.5px; line-height: 1.55; }
.hero-ico {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--gold-soft), var(--violet-soft)); border: 1px solid var(--line-2); color: var(--gold);
}
.hero-ico svg { width: 26px; height: 26px; }

/* feature tile (dashboard) */
.tile {
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--line);
  cursor: pointer; transition: 0.22s var(--ease); position: relative; overflow: hidden; min-height: 168px;
}
.tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 200px at 80% -20%, var(--tile-glow, rgba(240,192,115,.14)), transparent 70%); opacity: 0; transition: 0.3s; pointer-events: none; }
.tile:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow); }
.tile:hover::after { opacity: 1; }
.tile-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel-2); color: var(--tile-c, var(--gold)); }
.tile-ico svg { width: 22px; height: 22px; }
.tile h3 { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tile p { font-size: 13px; color: var(--ink-3); line-height: 1.5; flex: 1; }
.tile-go { font-size: 12px; color: var(--ink-4); display: flex; align-items: center; gap: 6px; transition: 0.2s; }
.tile:hover .tile-go { color: var(--gold); gap: 9px; }

/* list rows */
.lrow { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: none; }

/* probability rank rows (Exam Oracle) */
.rankrow { padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); transition: 0.2s; cursor: pointer; }
.rankrow:hover { border-color: var(--line-2); background: var(--panel-2); }
.rankrow.open { border-color: rgba(240,192,115,.35); }
.rank-num { font-family: var(--display); font-size: 20px; color: var(--ink-4); width: 34px; flex: none; }
.rank-num.hot { color: var(--gold); }
.expand { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease); }
.rankrow.open .expand { max-height: 520px; }

/* priority quadrant */
.quad { position: relative; aspect-ratio: 1 / 0.78; border-radius: var(--r); background: linear-gradient(135deg, rgba(245,138,163,.05), rgba(95,227,207,.05)); border: 1px solid var(--line); overflow: hidden; }
.quad-axis { position: absolute; background: var(--line); }
.quad-dot { position: absolute; width: 30px; height: 30px; border-radius: 50%; transform: translate(-50%,-50%); display: grid; place-items: center; font-size: 11px; font-weight: 700; cursor: pointer; transition: 0.2s; border: 2px solid var(--bg-0); }
.quad-dot:hover { transform: translate(-50%,-50%) scale(1.18); z-index: 5; }
.quad-label { position: absolute; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); }

/* canvas mounts */
.canvas-wrap { position: relative; border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; background: radial-gradient(120% 120% at 50% 0%, rgba(122,108,240,.05), transparent), var(--bg-1); }
.canvas-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.canvas-wrap canvas:active { cursor: grabbing; }
.canvas-hud { position: absolute; display: flex; gap: 8px; }
.canvas-hud.tl { top: 14px; left: 14px; } .canvas-hud.tr { top: 14px; right: 14px; flex-direction: column; align-items: flex-end; }
.canvas-hud.bl { bottom: 14px; left: 14px; } .canvas-hud.br { bottom: 14px; right: 14px; }
.hud-btn { width: 34px; height: 34px; border-radius: 9px; background: rgba(10,10,18,.7); border: 1px solid var(--line-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.hud-btn:hover { color: var(--ink); background: rgba(20,20,32,.9); }
.hud-pill { padding: 7px 12px; border-radius: 9px; background: rgba(10,10,18,.7); border: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-2); backdrop-filter: blur(8px); font-family: var(--mono); }

/* node inspector panel (floats over canvas) */
.inspector { position: absolute; top: 14px; right: 14px; width: 290px; max-width: calc(100% - 28px); background: rgba(11,11,21,.92); border: 1px solid var(--line-2); border-radius: var(--r); padding: 18px; backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); transform: translateX(120%); transition: transform 0.4s var(--ease); }
.inspector.show { transform: translateX(0); }

/* chat (interview) */
.chatwrap { display: flex; flex-direction: column; height: min(62vh, 560px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-1); overflow: hidden; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; max-width: 82%; animation: fadeUp 0.4s var(--ease); }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.msg.bot .msg-av { background: linear-gradient(135deg, var(--violet), var(--violet-2)); color: #fff; }
.msg.me .msg-av { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a1d05; }
.msg-body { padding: 12px 15px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; }
.msg.bot .msg-body { background: var(--panel-2); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.me .msg-body { background: var(--gold-soft); border: 1px solid rgba(240,192,115,.25); border-top-right-radius: 4px; color: var(--ink); }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--bg-2); }
.chat-input textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); margin: 0 1px; animation: blink 1.2s infinite; }
.typing span:nth-child(2){ animation-delay: .2s } .typing span:nth-child(3){ animation-delay: .4s }

/* casebook */
.case-card { perspective: 1400px; }
.case-stage { padding: 26px; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.choice { text-align: left; padding: 15px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: 0.18s; width: 100%; font-family: inherit; color: var(--ink-2); display: flex; gap: 12px; align-items: flex-start; }
.choice:hover { border-color: var(--line-2); background: var(--panel-2); color: var(--ink); transform: translateX(3px); }
.choice.picked { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.choice.real { border-color: var(--teal); background: var(--teal-soft); }
.choice-key { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--panel-hi); border: 1px solid var(--line); }
.choice.picked .choice-key { background: var(--gold); color: #2a1d05; border-color: transparent; }
.reveal { animation: fadeUp 0.5s var(--ease); }

/* heatmap (BrainGap) */
.heat-cell { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 600; cursor: default; transition: 0.2s; border: 1px solid rgba(255,255,255,.05); }
.heat-cell:hover { transform: scale(1.08); z-index: 2; }

/* line chart */
.linechart { width: 100%; height: auto; overflow: visible; }
.lc-grid { stroke: var(--line); stroke-width: 1; }
.lc-area { opacity: 0.18; }
.lc-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lc-dot { transition: r 0.2s; cursor: pointer; }

/* toast */
.toast-wrap { position: fixed; bottom: 26px; right: 26px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 17px; border-radius: var(--r); background: rgba(17,17,30,.96); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 13.5px; color: var(--ink); min-width: 240px; animation: toastIn 0.35s var(--ease); backdrop-filter: blur(12px); }
.toast .t-ico { width: 20px; height: 20px; flex: none; }
.toast.good .t-ico { color: var(--teal); } .toast.gold .t-ico { color: var(--gold); } .toast.bad .t-ico { color: var(--rose); }

/* modal */
.modal-root { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-root.show { display: flex; }
.modal-scrim { position: absolute; inset: 0; background: rgba(4,4,9,.66); backdrop-filter: blur(6px); animation: fadeIn 0.25s; }
.modal { position: relative; width: min(560px, 100%); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-lg); animation: modalIn 0.35s var(--ease); max-height: 88vh; overflow-y: auto; }

/* loading shimmer */
.shimmer { position: relative; overflow: hidden; background: var(--panel-2); border-radius: var(--r-sm); }
.shimmer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.4s infinite; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin 0.7s linear infinite; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch::after { content: ""; position: absolute; inset: 0; border-radius: 99px; background: var(--panel-hi); border: 1px solid var(--line-2); transition: 0.25s; }
.switch::before { content: ""; position: absolute; left: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-3); transition: 0.25s var(--ease); z-index: 1; }
.switch:has(input:checked)::after { background: linear-gradient(135deg, var(--gold), var(--gold-2)); border-color: transparent; }
.switch:has(input:checked)::before { transform: translateX(20px); background: #2a1d05; }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty .empty-ico { width: 48px; height: 48px; margin: 0 auto 14px; color: var(--ink-4); opacity: .6; }

/* analysing pulse line */
.analysing { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--r); background: var(--violet-soft); border: 1px solid rgba(154,139,247,.25); color: var(--ink-2); font-size: 13.5px; }

/* settings ---------------------------------------------------------------- */
.set-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; }
.set-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.set-ico { width: 22px; height: 22px; flex: none; color: var(--ink-2); display: inline-flex; }
.set-ico svg { width: 100%; height: 100%; }
.set-title { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.set-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.set-row-l { min-width: 0; }
.set-row-l b { font-size: 13.5px; }
.set-note { display: flex; gap: 10px; margin-top: 14px; padding: 12px 14px; background: var(--bg-1); border: 1px solid rgba(245, 138, 163, 0.2); border-radius: var(--r); }
.swatch { width: 27px; height: 27px; border-radius: 50%; background: var(--sw); border: 2px solid transparent; cursor: pointer; transition: transform 0.18s var(--ease), box-shadow 0.18s; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch:hover { transform: scale(1.14); }
.swatch.on { border-color: var(--bg-0); box-shadow: 0 0 0 2px var(--sw); }
.range { -webkit-appearance: none; appearance: none; width: 150px; height: 5px; border-radius: 99px; background: var(--panel-hi); outline: none; cursor: pointer; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg-0); cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.range::-moz-range-thumb { width: 15px; height: 15px; border: 2px solid var(--bg-0); border-radius: 50%; background: var(--gold); cursor: pointer; }
.mod-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); cursor: pointer; transition: border-color 0.18s; }
.mod-row:hover { border-color: var(--line-2); }
kbd { font-family: var(--mono); font-size: 11px; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; }

/* exam planner — calendar + countdown */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-family: var(--display); font-weight: 600; font-size: 15.5px; }
.cal-nav { width: 32px; height: 32px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: 0.16s; }
.cal-nav:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-hi); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: 10px; letter-spacing: 0.06em; color: var(--ink-4); padding: 4px 0; font-weight: 700; text-transform: uppercase; }
.cal-cell { aspect-ratio: 1; border: 1px solid transparent; border-radius: 9px; background: var(--panel-2); color: var(--ink-2); font-family: inherit; font-size: 13px; cursor: pointer; display: grid; place-items: center; transition: 0.14s; }
.cal-cell:hover { background: var(--panel-hi); border-color: var(--line-2); color: var(--ink); transform: translateY(-1px); }
.cal-cell.empty { background: none; border: none; pointer-events: none; }
.cal-cell.past { color: var(--ink-4); opacity: 0.45; }
.cal-cell.today { border-color: var(--violet); color: var(--ink); font-weight: 600; }
.cal-cell.sel { background: linear-gradient(135deg, var(--violet), var(--violet-2)); color: #fff; border-color: transparent; font-weight: 700; box-shadow: 0 8px 18px -6px var(--violet-2); }
.cal-cell.sel:hover { transform: translateY(-1px) scale(1.03); }
.count-num { font-family: var(--display); font-size: 62px; font-weight: 600; line-height: 0.85; letter-spacing: -0.03em; background: linear-gradient(135deg, var(--violet), var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.exam-count { background: linear-gradient(120deg, var(--violet-soft), transparent); }
.exam-dash .count-num { font-size: 42px; }
@media (max-width: 860px) { #examGrid { grid-template-columns: 1fr !important; } }

/* reduce motion */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }

/* =========================================================================
   ANIMATIONS
   ========================================================================= */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.stagger > * { opacity: 0; animation: fadeUp 0.5s var(--ease) forwards; }
.stagger > *:nth-child(1){ animation-delay: .03s } .stagger > *:nth-child(2){ animation-delay: .08s }
.stagger > *:nth-child(3){ animation-delay: .13s } .stagger > *:nth-child(4){ animation-delay: .18s }
.stagger > *:nth-child(5){ animation-delay: .23s } .stagger > *:nth-child(6){ animation-delay: .28s }
.stagger > *:nth-child(7){ animation-delay: .33s } .stagger > *:nth-child(8){ animation-delay: .38s }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 980px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 100; transform: translateX(-104%); transition: transform 0.35s var(--ease); box-shadow: var(--shadow-lg); }
  .app[data-mobile-open="true"] .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar-search { display: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .view { padding: 22px 16px 50px; }
  .topbar { padding: 14px 16px; }
  .scrim-mobile { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
}
@media (max-width: 540px) {
  .crumb-title { font-size: 18px; }
  .page-hero h2 { font-size: 24px; }
}
