/* ============================================================
   CertifAI — Design tokens & base
   ============================================================ */
:root {
  /* Surfaces (warm light) */
  --bg: #FBFAF7;
  --bg-2: #F5F4EE;
  --surface: #FFFFFF;
  --surface-2: #FAF9F4;
  --border: #ECEAE2;
  --border-strong: #DFDCD0;
  --border-focus: #14130F;

  /* Ink */
  --ink: #14130F;
  --ink-2: #4A4940;
  --ink-3: #87867B;
  --ink-4: #B5B3A6;

  /* Accents */
  --primary: #F26B1F;
  --primary-press: #DA5C16;
  --primary-soft: #FFF1E6;
  --primary-tint: #FFE3D0;

  --xp: #F5B100;
  --xp-soft: #FFF6DC;
  --xp-ink: #6A4900;

  --streak: #E04A1F;
  --streak-soft: #FFE9DF;

  --success: #1B9E4B;
  --success-soft: #E4F6EA;
  --info: #2563EB;
  --info-soft: #E8F0FE;
  --violet: #6E56CF;
  --violet-soft: #EFEBFA;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 1px rgba(20,19,15,0.03), 0 1px 0 rgba(20,19,15,0.02);
  --shadow-sm: 0 1px 2px rgba(20,19,15,0.04), 0 2px 6px rgba(20,19,15,0.04);
  --shadow-md: 0 4px 14px rgba(20,19,15,0.06), 0 1px 2px rgba(20,19,15,0.04);
  --shadow-lg: 0 12px 32px rgba(20,19,15,0.08), 0 2px 8px rgba(20,19,15,0.05);
  --shadow-hero: 0 24px 60px -20px rgba(242,107,31,0.25), 0 2px 8px rgba(20,19,15,0.04);

  /* Spacing scale (used inline mostly) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Sidebar (always-dark tokens) */
  --side-w: 248px;
  --top-h: 64px;
  --density: 1;

  --side-bg: #08140D;
  --side-bg-2: #0E2014;
  --side-line: rgba(160,240,190,0.12);
  --side-text: #CBD8CF;
  --side-muted: #73867A;
  --side-active: #4ADE80;
}

/* Dark mode — deep green canvas system, unified with sidebar #08140D */
:root[data-theme="dark"] {
  /* Canvas layers: bg → bg-2 → surface → surface-2 (lightest) */
  --bg: #06160D;
  --bg-2: #091A10;
  --surface: #0E2014;
  --surface-2: #142A1A;
  --border: rgba(160,240,190,0.14);
  --border-strong: rgba(160,240,190,0.26);
  --border-focus: #4ADE80;

  /* Green-tinted ink — cohesive with the green canvas */
  --ink: #EEF7F0;
  --ink-2: #B8CBBD;
  --ink-3: #7A8E82;
  --ink-4: #4E5E54;

  /* Accent softs (primary overridden by JS; keep green here as fallback) */
  --primary-soft: rgba(34,197,94,0.15);
  --primary-tint: rgba(34,197,94,0.25);
  --xp-soft: rgba(245,177,0,0.15);
  --xp-ink: #FBD86E;
  --streak-soft: rgba(224,74,31,0.18);
  --success-soft: rgba(34,197,94,0.15);
  --info-soft: rgba(37,99,235,0.18);
  --violet-soft: rgba(110,86,207,0.20);

  /* Deeper shadows sit naturally on the dark green canvas */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.55);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.50);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.55);
  --shadow-lg: 0 16px 44px rgba(0,0,0,0.65);
  --shadow-hero: 0 24px 60px -20px rgba(34,197,94,0.18), 0 2px 8px rgba(0,0,0,0.5);
}

/* Ambient green glow layered over the canvas in dark mode */
:root[data-theme="dark"] .app {
  background:
    radial-gradient(ellipse 900px 360px at 50% -4%, rgba(34,197,94,0.09) 0%, transparent 55%),
    var(--bg);
}

/* Density */
:root[data-density="compact"] { --density: 0.86; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02", "cv11";
}
button { font-family: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: "tnum", "zero"; }
.tabular { font-variant-numeric: tabular-nums; }

/* ============================================================
   App shell
   ============================================================ */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; background: var(--bg); }
.app[data-sidebar="collapsed"] { --side-w: 76px; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--side-line);
  background: #08140D;
  display: flex; flex-direction: column;
  padding: 16px 14px 14px;
  z-index: 20;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--side-line);
  margin-bottom: 14px;
}
.brand-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; min-width: 0;
}
.brand-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 10px;
}
.brand-logo {
  height: 28px; width: auto;
  object-fit: contain; display: block;
  flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: white; }
.brand-name em { font-style: normal; color: var(--side-active); }
.brand-toggle {
  margin-left: auto; background: none; border: 1px solid var(--side-line);
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  color: var(--side-muted); transition: all 0.15s;
}
.brand-toggle:hover { color: white; border-color: rgba(160,240,190,0.28); }

.nav-group { padding: 0; margin-bottom: 4px; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--side-muted); padding: 14px 10px 6px;
}
.app[data-sidebar="collapsed"] .nav-label,
.app[data-sidebar="collapsed"] .brand-name,
.app[data-sidebar="collapsed"] .nav-text,
.app[data-sidebar="collapsed"] .nav-badge,
.app[data-sidebar="collapsed"] .upsell,
.app[data-sidebar="collapsed"] .user-meta,
.app[data-sidebar="collapsed"] .brand-toggle { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--side-text); font-size: 13.5px; font-weight: 500;
  background: transparent; border: 1px solid transparent;
  text-decoration: none; width: 100%; position: relative;
  transition: background 0.12s, color 0.12s, transform 0.05s;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: white; }
.nav-item:active { transform: translateY(0.5px); }
.nav-item.is-active {
  background: rgba(74,222,128,0.14); color: var(--side-active);
  font-weight: 600;
}
.nav-item.is-active::before {
  content: ""; position: absolute;
  left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: #4ADE80; border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(74,222,128,0.55);
}
.nav-item .ico { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.nav-item.is-active .ico { opacity: 1; }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  font-size: 11px; font-weight: 600; padding: 2px 7px;
  border-radius: var(--r-pill); background: rgba(255,255,255,0.1); color: white;
}
.nav-item.is-active .nav-badge { background: rgba(74,222,128,0.2); color: var(--side-active); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; }

.upsell {
  margin-top: auto; border: 1px solid var(--side-line);
  background: linear-gradient(180deg, rgba(14,32,20,0.8), rgba(8,20,13,0.8));
  border-radius: var(--r-md); padding: 12px;
  display: flex; gap: 10px; align-items: center;
}
.upsell-ico {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #22C55E 0%, #4ADE80 100%);
  color: #051009; display: grid; place-items: center; flex-shrink: 0;
}
.upsell-title { font-size: 12.5px; font-weight: 700; color: white; }
.upsell-sub { font-size: 11px; color: var(--side-muted); margin-top: 1px; }

.user-row {
  margin-top: 10px; padding: 8px;
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--side-line);
  background: transparent;
}
.user-row:hover { background: rgba(255,255,255,0.03); cursor: pointer; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: white; }
.user-plan { font-size: 11px; color: var(--side-muted); }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 15;
  height: var(--top-h);
  background: color-mix(in srgb, #08140D 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(34,197,94,0.10);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
}
.topbar .search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 38px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(160,240,190,0.15);
  border-radius: var(--r-pill);
  color: var(--side-muted); font-size: 13px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.topbar .search:hover, .topbar .search:focus-within { border-color: rgba(160,240,190,0.3); }
.topbar .search input { flex: 1; border: 0; background: transparent; outline: none; color: white; font-size: 13px; font-family: inherit; }
.topbar .search input::placeholder { color: var(--side-muted); }
.topbar .search kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  padding: 2px 6px; border-radius: 5px; background: rgba(255,255,255,0.07); color: var(--side-muted);
  border: 1px solid rgba(160,240,190,0.12);
}

.chip-row { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-2);
  transition: border-color 0.12s, transform 0.05s;
  white-space: nowrap; flex-shrink: 0;
}
.chip > span { white-space: nowrap; }
.chip:hover { border-color: var(--border-strong); }
.chip:active { transform: translateY(0.5px); }
.chip .ico { width: 14px; height: 14px; }
.chip.xp { color: var(--xp-ink); background: var(--xp-soft); border-color: transparent; }
.chip.streak { color: var(--streak); background: var(--streak-soft); border-color: transparent; }
.chip.level { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
/* Icon keeps chip color (SVG currentColor); text spans are white */
.chip.xp span, .chip.streak span, .chip.level span { color: white; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-2); position: relative;
  transition: all 0.12s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 2px var(--bg);
}

.btn-tutor {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px 0 13px;
  border-radius: var(--r-pill); border: 0;
  background: linear-gradient(100deg, #22D3EE, #7C7FF0);
  color: #06121A;
  font-weight: 600; font-size: 13px;
  box-shadow: 0 4px 18px -6px rgba(124,127,240,0.55);
  transition: transform 0.06s, filter 0.12s;
}
.btn-tutor:hover { filter: brightness(1.08); }
.btn-tutor:active { transform: translateY(1px); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #F26B1F, #F5B100);
  color: white; display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

/* Topbar responsive — collapse right-side chrome at narrow widths */
@media (max-width: 1180px) {
  .topbar { padding: 0 20px; gap: 10px; }
  .btn-tutor { display: none; }
}
@media (max-width: 480px) {
  .chip.streak, .chip.level { display: none; }
  .topbar .search kbd { display: none; }
  .topbar .icon-btn { display: none; }
  .topbar { gap: 8px; }
}

/* ============================================================
   Main content
   ============================================================ */
.main { padding: 28px 32px 48px; max-width: 1480px; }

.h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.018em; }
.h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.012em; }
.h4 { font-size: 13.5px; font-weight: 700; letter-spacing: -0.005em; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card.clickable { cursor: pointer; transition: border-color 0.12s, transform 0.06s, box-shadow 0.12s; }
.card.clickable:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.card.clickable:active { transform: translateY(1px); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px;
  transition: transform 0.06s, background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 1px 0 rgba(0,0,0,0.06), inset 0 -1px 0 rgba(0,0,0,0.1); }
.btn-primary:hover { background: var(--primary-press); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { background: #2A2922; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 12.5px; border-radius: 999px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   Badges & pills
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--ink-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.solid-orange { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.solid-xp { background: var(--xp-soft); color: var(--xp-ink); border-color: transparent; }
.badge.solid-streak { background: var(--streak-soft); color: var(--streak); border-color: transparent; }
.badge.solid-green { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.solid-blue { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.solid-violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.badge.solid-ink { background: var(--ink); color: var(--bg); border-color: transparent; }
.badge.outline { background: transparent; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ============================================================
   Progress
   ============================================================ */
.progress {
  position: relative; height: 8px; background: var(--bg-2); border-radius: var(--r-pill); overflow: hidden;
}
.progress-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--primary) 0%, var(--xp) 100%);
  border-radius: inherit;
  transition: width 0.6s cubic-bezier(0.2,0.8,0.2,1);
}
.progress.thin { height: 4px; }
.progress.thick { height: 12px; }

/* ============================================================
   Status strip (hero status row)
   ============================================================ */
.status-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.status-tile {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--r-md);
  transition: background 0.12s;
}
.status-tile + .status-tile { border-left: 1px solid var(--border); }
.status-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.status-icon.xp { background: var(--xp-soft); color: var(--xp-ink); }
.status-icon.streak { background: var(--streak-soft); color: var(--streak); }
.status-icon.day { background: var(--primary-soft); color: var(--primary); }
.status-icon.cert { background: var(--violet-soft); color: var(--violet); }
.status-label { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.status-value { font-size: 19px; font-weight: 700; letter-spacing: -0.012em; line-height: 1.15; white-space: nowrap; }
.status-tile .progress { margin-top: 6px; }
.status-tile .delta { font-size: 11px; font-weight: 600; color: var(--success); }

/* ============================================================
   Hero "Continue learning" card
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-2xl);
  background:
    radial-gradient(55% 70% at 25% 50%, rgba(34,197,94,0.14), transparent 65%),
    linear-gradient(180deg, #071810 0%, #051009 100%);
  border: 1px solid rgba(34,197,94,0.2);
  padding: 28px 24px 28px 32px;
  display: grid; grid-template-columns: 1fr 240px;
  gap: 24px;
  box-shadow: 0 24px 60px -20px rgba(34,197,94,0.15), 0 2px 8px rgba(0,0,0,0.4);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(34,197,94,0.07) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}
.hero-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; position: relative; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #22C55E;
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: #22C55E; }

.hero-title {
  font-size: 30px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.1;
  color: #F0FFF4;
}
.hero-sub { font-size: 14px; color: rgba(200,240,220,0.72); max-width: 580px; line-height: 1.5; }
.hero-outline-btn {
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.18) !important;
  color: rgba(240,255,244,0.85) !important;
}
.hero-outline-btn:hover { background: rgba(255,255,255,0.12) !important; }
.hero-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero-progress { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.hero-progress .row { display: flex; justify-content: space-between; font-size: 12px; color: rgba(200,240,220,0.7); font-weight: 500; }
.hero-progress .row > span { white-space: nowrap; }
.hero-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

.hero-visual {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 18px;
  border: 1px solid #F6E3C2;
  display: flex; flex-direction: column; gap: 12px;
}
:root[data-theme="dark"] .hero-visual { background: var(--surface-2); border-color: #3A2C1A; }
.hero-visual .lesson-thumb {
  aspect-ratio: 16 / 10; border-radius: 12px;
  background:
    radial-gradient(60% 80% at 30% 30%, rgba(245,177,0,0.5), transparent 60%),
    radial-gradient(70% 80% at 80% 70%, rgba(242,107,31,0.55), transparent 60%),
    linear-gradient(135deg, #1A1814, #2A2419);
  position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.hero-visual .lesson-thumb::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(transparent 95%, rgba(255,255,255,0.08) 95%),
    linear-gradient(90deg, transparent 95%, rgba(255,255,255,0.08) 95%);
  background-size: 16px 16px;
}
.hero-visual .lesson-glyph {
  position: relative; z-index: 1;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500;
  color: white; padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  max-width: 80%; line-height: 1.5;
  backdrop-filter: blur(6px);
}
.hero-visual .lesson-glyph .blink::after { content: "▍"; animation: blink 1s infinite step-end; color: var(--xp); }
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   Tasks row
   ============================================================ */
.task-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
}
.task-card .accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.task-card.today .accent-bar { background: var(--primary); }
.task-card.practice .accent-bar { background: var(--violet); }
.task-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-card .title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.task-card .desc { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.task-card .meta { display: flex; gap: 8px; flex-wrap: wrap; }
.task-card .foot { display: flex; gap: 8px; align-items: center; margin-top: 4px; }

/* ============================================================
   Courses
   ============================================================ */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.course-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.12s, transform 0.05s, box-shadow 0.12s;
}
.course-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.course-thumb {
  aspect-ratio: 16 / 10; border-radius: var(--r-md);
  display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.course-thumb .glyph {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.14);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset;
  color: rgba(255,255,255,0.95);
}
.course-thumb .stripes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 10px, transparent 10px 20px);
}
.course-thumb.gp { background: linear-gradient(135deg, #1B9E4B, #2BB85E); }
.course-thumb.ai { background: linear-gradient(135deg, #6E56CF, #9C7BE0); }
.course-thumb.pr { background: linear-gradient(135deg, #F26B1F, #F5B100); }
.course-thumb.pw { background: linear-gradient(135deg, #2563EB, #5189F7); }
.course-thumb.locked { background: linear-gradient(135deg, #87867B, #B5B3A6); filter: grayscale(0.3); }
.course-card .title { font-size: 14.5px; font-weight: 700; }
.course-card .sub { font-size: 12px; color: var(--ink-3); }
.course-card .progress-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-2); font-weight: 600; white-space: nowrap; gap: 8px; }
.course-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ============================================================
   Challenge tracker
   ============================================================ */
.challenge {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-2xl);
  padding: 24px; position: relative; overflow: hidden;
}
.challenge::before {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224,74,31,0.10), transparent 70%);
  pointer-events: none;
}
.challenge-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; gap: 12px; }
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 6px;
  margin: 18px 0 22px;
}
@media (max-width: 1100px) { .challenge-grid { grid-template-columns: repeat(7, 1fr); } }
.day-cell {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1px solid var(--border);
  font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  transition: transform 0.1s;
  position: relative;
}
.day-cell.done { background: linear-gradient(135deg, var(--success-soft), color-mix(in srgb, var(--success-soft) 70%, white)); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }
.day-cell.done .check { width: 12px; height: 12px; }
.day-cell.today {
  background: #22C55E;
  color: white; border-color: transparent;
  box-shadow: 0 4px 14px rgba(34,197,94,0.45);
  transform: scale(1.06);
}
.day-cell.today .num { color: white; font-weight: 800; }
.day-cell.milestone { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.day-cell.milestone::after {
  content: ""; position: absolute; top: 4px; right: 4px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #E0B84C; pointer-events: none;
}
.day-cell .num { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 11px; }
.day-cell:hover { transform: translateY(-1px); }
.day-cell.today:hover { transform: scale(1.08) translateY(-1px); box-shadow: 0 6px 18px rgba(34,197,94,0.55); }

.milestones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.milestone-card {
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px;
  display: flex; gap: 12px; align-items: center;
  background: var(--surface-2);
}
.milestone-card.earned { background: var(--success-soft); border-color: transparent; }
.milestone-card.future { opacity: 0.85; }
.milestone-ico {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; flex-shrink: 0;
}
.milestone-card.earned .milestone-ico { background: var(--success); color: white; border-color: transparent; }
.milestone-title { font-size: 13px; font-weight: 700; }
.milestone-sub { font-size: 11.5px; color: var(--ink-3); }

/* ============================================================
   Right rail widgets
   ============================================================ */
.rail { display: flex; flex-direction: column; gap: 16px; }

.level-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; position: relative; overflow: hidden;
}
.level-card .head { display: flex; justify-content: space-between; align-items: flex-start; }
.level-medallion {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--xp));
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 22px;
  box-shadow: 0 6px 18px rgba(242,107,31,0.35);
}
.level-rank { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.level-name { font-size: 17px; font-weight: 700; letter-spacing: -0.012em; margin-top: 2px; }
.level-bar { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.level-bar .row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; gap: 8px; }

.level-track {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; margin-top: 14px;
}
.lvl-pip {
  height: 8px; border-radius: var(--r-pill); background: var(--bg-2);
}
.lvl-pip.done { background: linear-gradient(90deg, var(--primary), var(--xp)); }
.lvl-pip.current { background: linear-gradient(90deg, var(--primary) var(--lvl-prog, 60%), var(--bg-2) var(--lvl-prog, 60%)); }

.badges-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.badge-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 6px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.badge-chip .ico-circle {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
}

.weekly-stats { display: flex; align-items: flex-end; gap: 6px; height: 60px; margin-top: 6px; }
.bar {
  flex: 1; background: linear-gradient(180deg, #22C55E, rgba(34,197,94,0.55));
  border-radius: 4px 4px 2px 2px; min-height: 6px;
  position: relative;
}
.bar.today { background: linear-gradient(180deg, #4ADE80, #22C55E); box-shadow: 0 0 8px rgba(74,222,128,0.4); }
.bar.empty { background: var(--bg-2); }
.weekly-labels { display: flex; gap: 6px; margin-top: 6px; }
.weekly-labels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--ink-3); }

.cert-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--border);
}
.cert-row:first-of-type { border-top: 0; padding-top: 0; }
.cert-ico {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--violet-soft); color: var(--violet);
  display: grid; place-items: center; flex-shrink: 0;
}
.cert-ico.earned { background: linear-gradient(135deg, var(--xp), var(--primary)); color: white; }
.cert-ico.locked { background: var(--bg-2); color: var(--ink-3); }
.cert-title { font-size: 13px; font-weight: 700; }
.cert-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* ============================================================
   Layout grid
   ============================================================ */
.row-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.row-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.row-main { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
@media (max-width: 1280px) {
  .row-main { grid-template-columns: 1fr; }
  .row-equal, .row-2 { grid-template-columns: 1fr; }
}

.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 32px 0 14px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { margin: 0; }
.section-head .link { font-size: 12.5px; color: var(--ink-2); font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.section-head .link:hover { background: var(--bg-2); }

/* ============================================================
   Lesson detail view
   ============================================================ */
.lesson-shell { display: grid; grid-template-columns: 1fr 340px; gap: 24px; max-width: 1400px; min-width: 0; }
.lesson-shell > * { min-width: 0; }
@media (max-width: 1180px) { .lesson-shell { grid-template-columns: 1fr; } }
/* My Courses — mobile overflow fix (course.jsx only) */
@media (max-width: 760px) {
  .course-hero-grid { grid-template-columns: 1fr; gap: 18px; }
  .course-hero-art { display: none !important; }
  .tab-row { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.lesson-hero {
  border-radius: var(--r-2xl);
  background:
    radial-gradient(50% 80% at 80% 20%, rgba(245,177,0,0.5), transparent 60%),
    radial-gradient(60% 70% at 20% 90%, rgba(242,107,31,0.55), transparent 60%),
    linear-gradient(135deg, #1A1814, #2A2419);
  padding: 32px; color: white; position: relative; overflow: hidden;
}
.lesson-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(transparent 95%, rgba(255,255,255,0.05) 95%),
    linear-gradient(90deg, transparent 95%, rgba(255,255,255,0.05) 95%);
  background-size: 24px 24px; pointer-events: none;
}
.lesson-hero > * { position: relative; z-index: 1; }
.lesson-step {
  display: flex; gap: 14px; padding: 18px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
}
.lesson-step.done { background: var(--success-soft); border-color: transparent; }
.lesson-step.active { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.lesson-step .num {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--bg-2); color: var(--ink-2);
  display: grid; place-items: center; flex-shrink: 0;
  font-weight: 700; font-size: 13px;
}
.lesson-step.done .num { background: var(--success); color: white; }
.lesson-step.active .num { background: var(--primary); color: white; }

/* Submit form */
.submit-area textarea {
  width: 100%; min-height: 120px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6;
  resize: vertical; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.submit-area textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

/* ============================================================
   Course detail view
   ============================================================ */
.module {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.module-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.module-head:hover { background: var(--surface-2); }
.module-body { padding: 6px; }
.lesson-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  cursor: pointer;
}
.lesson-row:hover { background: var(--bg-2); }
.lesson-row.current { background: var(--primary-soft); }
.lesson-row .num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-2); color: var(--ink-2);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}
.lesson-row .num.done { background: var(--success); color: white; }
.lesson-row .num.current { background: var(--primary); color: white; }
.lesson-row .lab { font-size: 13.5px; font-weight: 600; flex: 1; }
.lesson-row .dur { font-size: 11.5px; color: var(--ink-3); font-family: 'JetBrains Mono', monospace; white-space: nowrap; flex-shrink: 0; }
.lesson-row .lab { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   Course Player (lesson view)
   ============================================================ */
.cp-shell { display: grid; grid-template-columns: 1fr 348px; min-height: calc(100vh - var(--top-h)); }
.cp-col { min-width: 0; overflow-y: auto; }
.cp-in { max-width: 780px; margin-inline: auto; padding: 28px 32px 40px; }
@media (max-width: 1180px) { .cp-shell { grid-template-columns: 1fr; } .cp-outline { display: none !important; } }
@media (max-width: 768px) { .cp-in { padding: 18px 16px 30px; } .cp-h1 { font-size: 22px; } }

/* Video player */
.v-player { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: linear-gradient(160deg,#0C1A14,#081410); position: relative; }
.v-stage { aspect-ratio: 16/9; max-height: 430px; position: relative; display: grid; place-items: center;
  background: radial-gradient(520px 280px at 50% 38%, rgba(27,158,75,0.26), transparent 62%); }
.v-stage::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,0.05) 1px,transparent 1px); background-size: 22px 22px; opacity: 0.5; pointer-events: none; }
.v-chip { position: absolute; top: 14px; left: 14px; z-index: 2; }
.v-playbtn { position: relative; width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.28); backdrop-filter: blur(6px); color: white; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 50px rgba(34,197,94,0.45); transition: transform 0.15s; }
.v-playbtn:hover { transform: scale(1.06); }
.v-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: rgba(0,0,0,0.25); color: #cfe; font-size: 12px; position: absolute; left: 0; right: 0; bottom: 0; }
.v-bar-track { flex: 1; height: 3px; background: rgba(255,255,255,0.2); border-radius: 999px; overflow: hidden; }
.v-bar-fill { height: 100%; background: white; width: 27%; }
.v-tabs { display: flex; gap: 4px; padding: 10px; border-top: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.22); }
.v-tab { font-weight: 600; font-size: 13px; color: #9fb3c6; background: transparent; border: none; padding: 7px 13px; border-radius: 9px; cursor: pointer; transition: all 0.15s; }
.v-tab:hover { color: white; }
.v-tab.on { color: #fff; background: linear-gradient(100deg, var(--success), #0e7a34); }

/* Lesson header */
.cp-h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.022em; line-height: 1.1; margin: 0; }
.cp-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 10px; }
.cp-sub { color: var(--ink-2); margin: 8px 0 0; font-size: 15px; line-height: 1.65; }
.cp-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }

/* Key takeaways */
.cp-takeaways { border-radius: 14px; padding: 20px 22px; margin: 24px 0; border: 1px solid rgba(27,158,75,0.3); background: rgba(27,158,75,0.06); }
.cp-tk-hd { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--success); margin-bottom: 12px; }
:root[data-theme="dark"] .cp-tk-hd { color: #6EE29A; }
.cp-takeaways ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.cp-takeaways li { display: flex; gap: 10px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.cp-takeaways li .ico { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; margin-top: 2px; }

/* Example prompt — always dark */
.cp-prompt { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,0.07); margin: 24px 0; background: #0B1622; }
.cp-prompt-hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.cp-prompt-label { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; color: #cdd9e6; }
.cp-prompt-label .ico { color: #22D3EE; width: 15px; height: 15px; }
.cp-copybtn { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12px; color: #9fb3c6; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); padding: 5px 11px; border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.cp-copybtn:hover { color: white; background: rgba(255,255,255,0.12); }
.cp-prompt pre { margin: 0; padding: 18px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.7; color: #aebfd0; white-space: pre-wrap; }
.cp-prompt pre .pv { color: #7fe3b0; }

/* Quiz */
.cp-quiz { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 22px; margin: 24px 0; }
.cp-quiz-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.cp-qi { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: rgba(110,86,207,0.16); color: var(--violet); }
.cp-quiz-q { font-size: 15px; font-weight: 500; color: var(--ink); margin: 14px 0; line-height: 1.55; }
.cp-qopt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; margin-bottom: 9px; font-size: 14px; color: var(--ink-2); transition: all 0.15s; background: var(--surface); }
.cp-qopt:hover { border-color: rgba(27,158,75,0.4); background: var(--surface-2); }
.cp-qopt.correct { border-color: var(--success); background: rgba(27,158,75,0.08); color: var(--ink); }
.cp-qopt.wrong { border-color: var(--streak); background: rgba(224,74,31,0.08); }
.cp-qopt .mk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; display: grid; place-items: center; transition: all 0.15s; }
.cp-qopt.correct .mk { background: var(--success); border-color: transparent; }
.cp-qopt.wrong .mk { background: var(--streak); border-color: transparent; }

/* Completion */
.cp-complete { border-radius: 14px; padding: 22px; margin: 24px 0 8px; border: 1px solid rgba(27,158,75,0.28); background: rgba(27,158,75,0.06); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cp-complete-icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--success); color: white; }

/* Bottom nav */
.cp-bottomnav { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 32px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); max-width: 780px; margin: 0 auto; width: 100%; }
.cp-bn-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; transition: all 0.15s; }
.cp-bn-btn:hover { border-color: var(--border-strong); }
.cp-bn-dots { display: flex; gap: 5px; margin-inline: auto; align-items: center; }
.cp-bn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-2); }
.cp-bn-dot.done { background: var(--success); }
.cp-bn-dot.cur { background: var(--success); width: 20px; border-radius: 4px; }

/* Outline rail */
.cp-outline { border-left: 1px solid var(--border); position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; background: var(--bg); display: flex; flex-direction: column; }
.cp-outline-course { padding: 18px; border-bottom: 1px solid var(--border); background: rgba(27,158,75,0.04); }
.cp-ob-c { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(140deg,#34D77F,#16A34A); color: white; font-weight: 800; font-size: 13px; font-family: 'JetBrains Mono', monospace; }
.cp-outline-back { display: flex; align-items: center; gap: 9px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; transition: background 0.12s; }
.cp-outline-back:hover { background: var(--surface-2); color: var(--ink); }
.cp-omods { padding: 6px; flex: 1; }
.cp-omod { margin-bottom: 4px; }
.cp-omod-h { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 10px; cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; }
.cp-omod-h:hover { background: var(--surface-2); }
.cp-omod-h .omtitle { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.cp-omod-count { font-size: 11px; font-family: 'JetBrains Mono', monospace; color: var(--ink-3); background: var(--bg-2); padding: 2px 7px; border-radius: 999px; flex-shrink: 0; }
.cp-omod-h.cur .omtitle { color: var(--success); }
.cp-oles { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--ink-2); margin: 1px 4px; transition: background 0.12s; border: none; background: transparent; width: 100%; text-align: left; }
.cp-oles:hover { background: var(--surface-2); }
.cp-oles.done .olix { background: var(--success); border-color: transparent; color: white; }
.cp-oles.cur { background: rgba(27,158,75,0.1); color: var(--ink); font-weight: 600; }
.cp-oles.locked { color: var(--ink-4); cursor: default; }
.cp-oles:not(.locked):hover { background: var(--surface-2); }
.olix { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; border: 1.5px solid var(--border-strong); color: var(--ink-3); font-family: 'JetBrains Mono', monospace; }
.olidur { margin-left: auto; font-size: 11px; color: var(--ink-4); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.cp-oles.cur .olix { border-color: var(--success); color: var(--success); }

/* AI Tutor drawer (dark) */
.cp-tutor { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw; z-index: 60; transform: translateX(103%); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1); background: linear-gradient(180deg,#0C1530,#0A1020); border-left: 1px solid rgba(124,127,240,0.4); display: flex; flex-direction: column; }
.cp-tutor.open { transform: none; }
.cp-tutor-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); z-index: 59; }
.cp-tutor.open ~ .cp-tutor-scrim { display: block; }
.cp-tutor-fab { position: fixed; right: 24px; bottom: 80px; z-index: 55; display: inline-flex; align-items: center; gap: 9px; padding: 12px 18px; border-radius: 999px; border: none; cursor: pointer; font-weight: 600; font-size: 14px; color: #06121A; background: linear-gradient(100deg,#22D3EE,#7C7FF0); box-shadow: 0 12px 28px -10px rgba(124,127,240,0.7); transition: transform 0.15s; }
.cp-tutor-fab:hover { transform: translateY(-2px); }
.cp-tp-hd { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.cp-tp-orb { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(140deg,#22D3EE,#7C7FF0); color: #06121A; box-shadow: 0 0 20px rgba(34,211,238,0.45); }
.cp-tp-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cp-bubble { max-width: 88%; padding: 11px 14px; border-radius: 13px; font-size: 13.5px; line-height: 1.55; }
.cp-bubble.ai { background: rgba(255,255,255,0.06); color: #DCE7F2; border: 1px solid rgba(255,255,255,0.08); border-top-left-radius: 4px; align-self: flex-start; }
.cp-bubble.me { background: linear-gradient(100deg,#22D3EE,#7C7FF0); color: #06121A; border-top-right-radius: 4px; align-self: flex-end; font-weight: 500; }
.cp-tp-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.cp-tp-input input { flex: 1; padding: 11px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05); color: white; font-size: 13.5px; font-family: inherit; }
.cp-tp-input input::placeholder { color: #6E8094; }
.cp-tp-input input:focus { outline: none; border-color: #22D3EE; }
.cp-tp-send { width: 44px; border-radius: 10px; border: none; cursor: pointer; background: linear-gradient(100deg,#22D3EE,#7C7FF0); color: #06121A; display: grid; place-items: center; }

/* ============================================================
   XP claim toast
   ============================================================ */
.xp-toast {
  position: fixed; top: 80px; right: 28px; z-index: 1000;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px 14px 14px;
  background: var(--ink); color: var(--bg);
  border-radius: var(--r-pill);
  box-shadow: 0 18px 50px rgba(20,19,15,0.25);
  animation: xpIn 0.5s cubic-bezier(0.2,0.8,0.2,1);
  font-weight: 600;
}
.xp-toast .burst {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--xp), var(--primary));
  display: grid; place-items: center;
  color: white; font-weight: 800;
  animation: pulse 1.5s infinite;
}
.xp-toast .amount { font-size: 18px; font-weight: 800; color: var(--xp); }
@keyframes xpIn {
  0% { transform: translateY(-20px) scale(0.9); opacity: 0; }
  60% { transform: translateY(4px) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245,177,0,0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(245,177,0,0); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* Confetti pieces (for XP claim) */
.confetti {
  position: fixed; pointer-events: none; z-index: 999;
  font-size: 16px;
  animation: confettiFall 1.6s ease-out forwards;
}
@keyframes confettiFall {
  0% { transform: translate(0,0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--dr)); opacity: 0; }
}

/* Modal */
.modal-scrim {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(20,19,15,0.5); backdrop-filter: blur(4px);
  display: grid; place-items: center;
  animation: fadeIn 0.18s ease-out;
}
.modal {
  background: var(--surface); border-radius: var(--r-xl);
  padding: 28px; width: min(480px, 92vw);
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.22s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes scaleIn { from { transform: scale(0.94); opacity: 0; } }

/* Breadcrumb */
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); margin-bottom: 12px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { opacity: 0.5; }

/* Tab pills */
.tab-row { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: var(--r-pill); width: fit-content; }
.tab-row button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 12.5px; color: var(--ink-3);
}
.tab-row button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ============================================================
   My Tasks  (.tsk- prefix)
   ============================================================ */

/* Mobile app-shell fix — sidebar hidden below 768px */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Page header */
.tsk-psub { font-size: 14px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; max-width: 64ch; }

/* Summary stat cards */
.tsk-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.tsk-sumc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: flex; align-items: center; gap: 13px; box-shadow: var(--shadow-xs); }
.tsk-sumc-icon { width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; }
.tsk-sumc-icon.today  { background: var(--primary-soft); color: var(--primary); }
.tsk-sumc-icon.done   { background: var(--success-soft); color: var(--success); }
.tsk-sumc-icon.xp     { background: var(--xp-soft); color: var(--xp-ink); }
.tsk-sumc-icon.streak { background: var(--streak-soft); color: var(--streak); }
.tsk-sumc-num { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-family: 'JetBrains Mono', monospace; line-height: 1; color: var(--ink); }
.tsk-sumc-label { font-size: 12px; color: var(--ink-3); margin-top: 3px; font-weight: 500; }

/* Priority hero card */
.tsk-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); border: 1px solid rgba(27,158,75,0.25); padding: 26px 28px; margin-bottom: 28px; background: radial-gradient(640px 300px at 90% -40%, rgba(27,158,75,0.18), transparent 60%), linear-gradient(180deg, rgba(27,158,75,0.08) 0%, var(--surface) 100%); box-shadow: 0 18px 44px -26px rgba(27,158,75,0.32); }
.tsk-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(27,158,75,0.07) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.tsk-hero > * { position: relative; }
.tsk-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 26px; align-items: center; }
.tsk-hero-eye { font-size: 11px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--success); margin-bottom: 10px; }
.tsk-hero-title { font-size: 22px; font-weight: 800; letter-spacing: -0.018em; line-height: 1.22; max-width: 34ch; }
.tsk-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
.tsk-hero-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.tsk-hero-chip.xp  { color: var(--xp-ink); background: var(--xp-soft); border-color: transparent; }
.tsk-hero-chip.due { color: var(--success); background: rgba(27,158,75,0.12); border-color: rgba(27,158,75,0.28); }
.tsk-hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.tsk-hero-badge { width: 110px; height: 110px; border-radius: var(--r-xl); flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(150deg, rgba(27,158,75,0.18), var(--surface-2)); border: 1px solid rgba(27,158,75,0.22); box-shadow: inset 0 0 24px rgba(27,158,75,0.10); color: var(--success); }

/* Filter tabs */
.tsk-controls { margin-bottom: 20px; }
.tsk-ftabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tsk-ftab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.12s; white-space: nowrap; }
.tsk-ftab:hover { border-color: var(--border-strong); color: var(--ink); }
.tsk-ftab.is-active { background: var(--ink); color: var(--bg); border-color: transparent; }
.tsk-ftab.is-overdue.is-active { background: var(--streak); border-color: transparent; }
.tsk-ftab-cnt { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--bg-2); color: var(--ink-3); }
.tsk-ftab.is-active .tsk-ftab-cnt { background: rgba(255,255,255,0.22); color: inherit; }

/* Task list */
.tsk-list { display: flex; flex-direction: column; gap: 10px; }

/* Task card */
.tsk-card { display: flex; align-items: center; gap: 16px; padding: 15px 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); cursor: pointer; transition: all 0.15s; }
.tsk-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tsk-card:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.tsk-card.is-done { opacity: 0.6; }
.tsk-card.is-overdue { border-color: rgba(224,74,31,0.38); }
.tsk-card-tic { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; }
.tsk-card.is-done .tsk-card-tic { background: var(--success-soft) !important; color: var(--success) !important; }
.tsk-card.is-overdue .tsk-card-tic { background: var(--streak-soft) !important; color: var(--streak) !important; }
.tsk-card-body { flex: 1; min-width: 0; }
.tsk-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.tsk-card-type { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); }
.tsk-card-title { font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; color: var(--ink); }
.tsk-card.is-done .tsk-card-title { text-decoration: line-through; color: var(--ink-3); }
.tsk-card-desc { font-size: 13px; color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55ch; }
.tsk-card-meta { display: flex; align-items: center; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.tsk-card-meta-item { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.tsk-card-meta-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.tsk-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.tsk-card-xp { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--xp-ink); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

/* Empty state */
.tsk-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 24px; gap: 10px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); }
.tsk-empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--bg-2); display: grid; place-items: center; color: var(--ink-4); margin-bottom: 4px; }
.tsk-empty-title { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.012em; }
.tsk-empty-sub { font-size: 14px; color: var(--ink-3); line-height: 1.6; max-width: 36ch; }
.tsk-empty-actions { display: flex; gap: 10px; margin-top: 6px; }

/* Overdue pulsing dot */
@keyframes tsk-dot-pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.35; } }
.tsk-pulse-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 3px; animation: tsk-dot-pulse 1.8s ease infinite; }

/* Scrim */
.tsk-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(2px); z-index: 59; }

/* Detail drawer */
.tsk-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 94vw; z-index: 60; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -20px 0 60px -30px rgba(0,0,0,0.25); display: flex; flex-direction: column; transform: translateX(103%); transition: transform 0.35s cubic-bezier(0.16,1,0.3,1); }
.tsk-drawer.is-open { transform: translateX(0); }
.tsk-drawer-hd { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tsk-drawer-tic { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; }
.tsk-drawer-hd-text { flex: 1; min-width: 0; }
.tsk-drawer-hd-type { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.tsk-drawer-hd-title { font-size: 17px; font-weight: 700; letter-spacing: -0.012em; line-height: 1.3; color: var(--ink); }
.tsk-drawer-close { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-3); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: all 0.12s; }
.tsk-drawer-close:hover { color: var(--ink); border-color: var(--border-strong); }
.tsk-drawer-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 22px; }
.tsk-drawer-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tsk-drawer-fact { background: var(--bg-2); border-radius: var(--r-sm); padding: 12px 14px; }
.tsk-drawer-fact-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.tsk-drawer-fact-value { font-size: 14px; font-weight: 600; color: var(--ink); }
.tsk-drawer-sec h4 { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 8px; letter-spacing: -0.005em; }
.tsk-drawer-sec p { font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.tsk-drawer-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: tsk-step; }
.tsk-drawer-steps li { display: flex; gap: 12px; font-size: 14px; color: var(--ink-2); line-height: 1.55; counter-increment: tsk-step; }
.tsk-drawer-steps li::before { content: counter(tsk-step); width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; font-family: 'JetBrains Mono', monospace; background: var(--success-soft); color: var(--success); }
.tsk-drawer-ai { border: 1px solid rgba(110,86,207,0.28); border-radius: var(--r-lg); padding: 16px; background: linear-gradient(165deg, rgba(110,86,207,0.06), var(--surface)); }
.tsk-drawer-ai-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tsk-drawer-ai-orb { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg,#22D3EE,#7C7FF0); color: #06121A; flex-shrink: 0; }
.tsk-drawer-ai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tsk-drawer-ai-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(110,86,207,0.3); background: rgba(110,86,207,0.06); color: var(--violet); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.12s; }
.tsk-drawer-ai-chip:hover { background: rgba(110,86,207,0.14); border-color: rgba(110,86,207,0.5); }
.tsk-drawer-foot { display: flex; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.tsk-drawer-foot .btn { flex: 1; justify-content: center; }
.tsk-drawer-done-note { font-size: 13px; color: var(--success); display: flex; align-items: center; gap: 6px; font-weight: 600; }

/* Responsive */
@media (max-width: 1100px) { .tsk-summary { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .tsk-hero-grid { grid-template-columns: 1fr; } .tsk-hero-badge { display: none; } .tsk-hero { padding: 22px 20px; } }
@media (max-width: 768px) {
  .tsk-drawer { width: 100%; max-width: 100%; top: auto; height: 90vh; border-radius: 20px 20px 0 0; border-left: none; border-top: 1px solid var(--border); transform: translateY(108%); }
  .tsk-drawer.is-open { transform: translateY(0); }
  .tsk-card-right { display: none; }
  .tsk-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .tsk-hero { padding: 18px 16px; } .tsk-hero-title { font-size: 18px; }
  .tsk-ftabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
}

/* Density scaling */
:root[data-density="compact"] .card,
:root[data-density="compact"] .task-card,
:root[data-density="compact"] .course-card,
:root[data-density="compact"] .level-card { padding: 14px; }
:root[data-density="compact"] .hero { padding: 22px; }
:root[data-density="compact"] .main { padding: 20px 24px 40px; }
:root[data-density="compact"] .section-head { margin: 22px 0 10px; }

/* Tweaks panel overrides for our aesthetic */
.tweaks-fab { background: var(--ink) !important; color: var(--bg) !important; }

/* ============================================================
   Hero — lesson-mini outline panel
   ============================================================ */
.hero-mini {
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--r-xl);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; z-index: 1;
  min-height: 200px;
}
.hero-mini-eye {
  font-size: 10px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(160,240,190,0.5);
}
.hero-mini-title {
  font-size: 13px; font-weight: 700; color: white; letter-spacing: -0.01em;
  margin-top: -4px;
}
.hero-mini-steps { display: flex; flex-direction: column; gap: 10px; }
.hero-mini-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: rgba(200,240,220,0.55); font-weight: 500;
}
.hero-mini-disc {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid rgba(160,240,190,0.25);
  display: grid; place-items: center;
}
.hero-mini-step.done { color: rgba(200,240,220,0.75); }
.hero-mini-step.done .hero-mini-disc {
  background: #22C55E; border-color: transparent; color: #051009;
}
.hero-mini-step.cur { color: white; font-weight: 700; }
.hero-mini-step.cur .hero-mini-disc {
  border-color: #4ADE80; border-width: 2px;
  box-shadow: 0 0 6px rgba(74,222,128,0.4);
}
.hero-mini-step.cur .hero-mini-disc::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4ADE80;
}

/* ============================================================
   Today's Focus card
   ============================================================ */
.focus-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.focus-card-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px 14px;
}
.focus-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.focus-row-icon {
  width: 40px; height: 40px; border-radius: 11px;
  flex-shrink: 0; display: grid; place-items: center;
}
.focus-row-body { flex: 1; min-width: 0; }
.focus-row-title { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -0.005em; }
.focus-row-desc { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.focus-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* ============================================================
   Right rail — AI Tutor card
   ============================================================ */
.rail-tutor {
  background: linear-gradient(160deg, #0C1530, #0A1020);
  border: 1px solid rgba(124,127,240,0.3);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.rail-tutor-orb {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #22D3EE, #7C7FF0);
  box-shadow: 0 0 18px rgba(34,211,238,0.35);
}
.rail-tutor-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.rail-tutor-chip {
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid rgba(124,127,240,0.3);
  background: rgba(124,127,240,0.08);
  color: #9FA3F0; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.12s;
}
.rail-tutor-chip:hover { background: rgba(124,127,240,0.18); border-color: rgba(124,127,240,0.5); color: white; }

/* ============================================================
   Certificates — circular progress ring
   ============================================================ */
.cert-ring-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 44px; height: 44px;
}
svg.cert-ring { position: absolute; top: 0; left: 0; display: block; }
.cert-ring-label {
  position: relative; z-index: 1;
  font-size: 10px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-2);
}

/* ============================================================
   Responsive — hero-mini hides at narrow widths
   ============================================================ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mini { display: none; }
  .focus-row { flex-wrap: wrap; }
  .focus-row-right { flex-direction: row; align-items: center; }
}
@media (max-width: 520px) {
  .milestones { grid-template-columns: 1fr; }
  .main { padding: 20px 18px 40px; }
}

/* ============================================================
   28-Day Challenge screen  (.chal- prefix)
   ============================================================ */

/* Header */
.chal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.chal-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

.chal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}

.chal-pill-green { background: var(--success-soft); color: var(--success); border-color: transparent; }
.chal-pill-rose  { background: var(--streak-soft);  color: var(--streak);  border-color: transparent; }
.chal-pill-gold  { background: var(--xp-soft);      color: var(--xp-ink);  border-color: transparent; }
.chal-pill-muted { background: var(--bg-2);          color: var(--ink-3);   }

/* Two-column layout */
.chal-layout {
  display: grid;
  grid-template-columns: 1fr 332px;
  gap: 24px;
  align-items: start;
}

.chal-col {
  min-width: 0;
}

/* Hero card */
.chal-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-2xl);
  background:
    radial-gradient(55% 70% at 25% 50%, rgba(34,197,94,0.14), transparent 65%),
    linear-gradient(180deg, #071810 0%, #051009 100%);
  border: 1px solid rgba(34,197,94,0.2);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  box-shadow: 0 24px 60px -20px rgba(34,197,94,0.15), 0 2px 8px rgba(0,0,0,0.4);
  margin-bottom: 4px;
}

.chal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(34,197,94,0.07) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.chal-hero-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  position: relative;
}

.chal-hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.chal-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Conic progress ring in hero */
.chal-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.chal-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.chal-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.chal-ring-num {
  font-size: 28px;
  font-weight: 800;
  color: white;
  line-height: 1;
  letter-spacing: -0.02em;
  font-family: 'JetBrains Mono', monospace;
}

.chal-ring-sub {
  font-size: 11px;
  font-weight: 600;
  color: rgba(200,240,220,0.55);
  margin-top: 3px;
}

/* Legend */
.chal-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.chal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
}

.chal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.chal-dot-done   { background: #22C55E; }
.chal-dot-today  { background: #22C55E; box-shadow: 0 0 0 2px rgba(34,197,94,0.3); }
.chal-dot-missed { background: #FB7185; }

/* 7-column day grid */
.chal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

/* Day cells */
.chal-day {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  padding: 0;
  color: var(--ink-3);
}

.chal-day:hover:not(.today) { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.chal-day.completed {
  background: linear-gradient(135deg, var(--success-soft), color-mix(in srgb, var(--success-soft) 70%, white));
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
  color: var(--success);
}

.chal-day.today {
  background: #22C55E;
  border-color: transparent;
  color: white;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.25), 0 6px 18px rgba(34,197,94,0.45);
  transform: scale(1.06);
}

.chal-day.today:hover { transform: scale(1.08) translateY(-1px); }

.chal-day.missed {
  background: rgba(251,113,133,0.1);
  border-color: rgba(251,113,133,0.22);
  color: #FB7185;
}

.chal-day.milestone::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #E0B84C;
  pointer-events: none;
}

.chal-day.cert-day {
  background: linear-gradient(135deg, rgba(34,211,238,0.1), rgba(124,127,240,0.14));
  border-color: rgba(124,127,240,0.22);
  color: var(--violet);
}

.chal-today-tag {
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  line-height: 1;
}

.chal-check { opacity: 0.85; }

.chal-day-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Milestones — 4 columns */
.chal-milestones {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.chal-milestone {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.15s;
}

.chal-milestone:hover { transform: translateY(-1px); }

.chal-milestone-future { opacity: 0.78; }

.chal-milestone-earned {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
}

.chal-milestone-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--ink-2);
}

.chal-milestone-ico-earned {
  background: var(--success);
  color: white;
  border-color: transparent;
}

.chal-milestone-ico-cert {
  background: linear-gradient(135deg, rgba(34,211,238,0.18), rgba(124,127,240,0.22));
  color: var(--violet);
  border-color: rgba(124,127,240,0.18);
}

.chal-milestone-day {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}

.chal-milestone-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.chal-milestone-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

.chal-sub-earned { color: var(--success); font-weight: 600; }

/* Right rail */
.chal-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 84px;
}

/* Stats 2×2 grid */
.chal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chal-stat {
  background: var(--bg-2);
  border-radius: var(--r-sm);
  padding: 12px;
  text-align: center;
  border: 1px solid var(--border);
}

.chal-stat-val {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
}

.chal-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Day detail drawer — scrim */
.chal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(2px);
  z-index: 40;
}

/* Drawer panel */
.chal-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-shadow: var(--shadow-lg);
}

.chal-drawer-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chal-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}

.chal-drawer-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.chal-drawer-fact {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chal-drawer-fact > span:first-child {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chal-drawer-fact > span:last-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.chal-drawer-tutor {
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 14px;
  border: 1px solid var(--border);
}

.chal-drawer-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Challenge responsive ──────────────────────────────────── */
@media (max-width: 1180px) {
  .chal-layout { grid-template-columns: 1fr; }
  .chal-rail { position: static; }
  .chal-milestones { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .chal-ring-wrap { display: none; }
  .chal-hero { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .chal-drawer {
    top: auto;
    width: 100%;
    max-width: 100%;
    height: 90vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }
  .chal-grid { gap: 5px; }
  .chal-day { border-radius: 8px; }
  .chal-day-num { font-size: 10px; }
}

@media (max-width: 600px) {
  .chal-milestones { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .chal-hero { padding: 20px 18px; gap: 16px; }
  .chal-pills { display: none; }
  .chal-grid { gap: 4px; }
}

/* ============================================================
   AI Tools Library  (.tl- prefix)
   ============================================================ */

/* Header */
.tl-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.tl-sub { font-size: 14px; color: var(--ink-2); margin-top: 6px; max-width: 56ch; line-height: 1.6; }
.tl-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.tl-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); }
.tl-pill-gold { background: var(--xp-soft); color: var(--xp-ink); border-color: transparent; }
.tl-pill-cyan { background: rgba(34,211,238,0.12); color: #22D3EE; border-color: transparent; }

/* Featured hero */
.tl-featured {
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, #0C1530 0%, #0A1020 100%);
  border: 1px solid rgba(124,127,240,0.3);
  padding: 28px 32px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}
.tl-featured:hover { border-color: rgba(124,127,240,0.5); }
.tl-featured::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 600px 300px at 80% 50%, rgba(124,127,240,0.12), transparent 60%);
  pointer-events: none;
}
.tl-featured-eye { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #7C7FF0; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.tl-featured-eye::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22D3EE; flex-shrink: 0; }
.tl-featured-title { font-size: 22px; font-weight: 700; color: white; letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 6px; }
.tl-featured-desc { font-size: 13.5px; color: rgba(200,220,255,0.65); line-height: 1.55; max-width: 520px; }
.tl-featured-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #22D3EE; font-weight: 600; margin-top: 10px; }
.tl-featured-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.tl-featured-ico {
  width: 80px; height: 80px; border-radius: 20px; flex-shrink: 0;
  display: grid; place-items: center;
  position: relative; z-index: 1;
}

/* Controls */
.tl-controls { margin-bottom: 22px; display: flex; flex-direction: column; gap: 12px; }
.tl-filterbar { display: flex; gap: 6px; flex-wrap: wrap; }
.tl-filter {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.tl-filter:hover { border-color: var(--border-strong); color: var(--ink); }
.tl-filter.is-active { background: var(--ink); color: var(--bg); border-color: transparent; }
.tl-filter-cnt { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--bg-2); color: var(--ink-3); }
.tl-filter.is-active .tl-filter-cnt { background: rgba(255,255,255,0.18); color: inherit; }
.tl-search-row { display: flex; gap: 10px; align-items: center; }
.tl-search {
  flex: 1; max-width: 400px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 14px; height: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); color: var(--ink-3);
  transition: border-color 0.12s;
}
.tl-search:focus-within { border-color: var(--border-strong); }
.tl-search input { flex: 1; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 13px; font-family: inherit; }
.tl-search input::placeholder { color: var(--ink-4); }
.tl-search-clear { background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 0; display: grid; place-items: center; }
.tl-sort {
  height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}

/* Tool icon */
.tl-ico {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Tool grid */
.tl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 36px; }

/* Tool card */
.tl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  cursor: pointer; transition: border-color 0.14s, transform 0.1s, box-shadow 0.14s;
}
.tl-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tl-card-hd { display: flex; align-items: flex-start; gap: 12px; }
.tl-card-name { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.2; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tl-card-desc { font-size: 13px; color: var(--ink-3); line-height: 1.55; margin: 0; flex: 1; }
.tl-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tl-tag { padding: 3px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; background: var(--bg-2); color: var(--ink-3); border: 1px solid var(--border); }
.tl-card-footer { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: auto; }

/* Pricing + level */
.tl-price { padding: 3px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; }
.tl-price-free { background: var(--success-soft); color: var(--success); }
.tl-price-freemium { background: var(--info-soft); color: var(--info); }
.tl-price-paid { background: var(--xp-soft); color: var(--xp-ink); }
.tl-level { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }

/* Bookmark/save */
.tl-save {
  width: 34px; height: 34px; border-radius: var(--r-pill); flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--ink-3); cursor: pointer; transition: all 0.12s;
}
.tl-save:hover { border-color: var(--border-strong); color: var(--xp-ink); }
.tl-save.is-saved { background: var(--xp-soft); border-color: transparent; color: var(--xp-ink); }

/* Empty state */
.tl-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 10px; text-align: center; }
.tl-empty-ico { width: 60px; height: 60px; border-radius: 18px; background: var(--primary-soft); display: grid; place-items: center; color: var(--primary); }
.tl-empty-title { font-size: 18px; font-weight: 700; margin-top: 4px; }
.tl-empty-sub { font-size: 13.5px; color: var(--ink-3); margin: 0 0 8px; }

/* Guided practice strip */
.tl-practice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 48px; }
.tl-practice-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: border-color 0.12s, transform 0.08s;
}
.tl-practice-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tl-practice-ico { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; color: white; }
.tl-practice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tl-practice-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.tl-practice-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tl-practice-course { font-size: 11.5px; color: var(--ink-3); }

/* Drawer */
.tl-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.42); backdrop-filter: blur(2px); z-index: 40; }
.tl-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 90vw;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 50; box-shadow: var(--shadow-lg);
  transform: translateX(102%); transition: transform 0.3s cubic-bezier(0.23,1,0.32,1);
}
.tl-drawer.is-open { transform: translateX(0); }
.tl-drawer-hd { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tl-drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 0; }
.tl-drawer-sec { padding: 16px 0; border-bottom: 1px solid var(--border); }
.tl-drawer-sec:first-child { padding-top: 0; }
.tl-drawer-sec:last-child { border-bottom: none; }
.tl-drawer-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tl-drawer-fact { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.tl-drawer-fact > span:first-child { font-size: 10.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.tl-drawer-fact > span:last-child { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.tl-prompt-block { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #6EE29A; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.tl-drawer-footer { display: flex; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 1180px) { .tl-grid { grid-template-columns: repeat(2, 1fr); } .tl-practice { grid-template-columns: repeat(2, 1fr); } .tl-featured { grid-template-columns: 1fr; } .tl-featured-ico { display: none; } }
@media (max-width: 900px) { .tl-filterbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; } }
@media (max-width: 760px) {
  .tl-grid { grid-template-columns: 1fr; }
  .tl-practice { grid-template-columns: 1fr; }
  .tl-drawer { top: auto; width: 100%; max-width: 100%; height: 90vh; border-left: none; border-top: 1px solid var(--border); border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(102%); }
  .tl-drawer.is-open { transform: translateY(0); }
  .tl-search-row { flex-wrap: wrap; }
  .tl-search { max-width: 100%; }
  .tl-drawer-footer { flex-direction: column; }
  .tl-drawer-footer .btn { width: 100%; }
}
@media (max-width: 520px) {
  .tl-header { flex-direction: column; align-items: flex-start; }
  .tl-featured { padding: 20px 18px; }
}

/* ============================================================
   Certificates screen  (.cert-)
   ============================================================ */

/* Fraunces serif — certificates only */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&display=swap');

/* ── Page layout ──────────────────────────────────────────────── */
.cert-main { padding: 32px 36px 80px; max-width: 960px; }
.cert-h1 { font-size: 28px; font-weight: 700; margin: 4px 0 0; line-height: 1.15; }

/* ── Header + summary pills ───────────────────────────────────── */
.cert-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.cert-header-text { display: flex; flex-direction: column; gap: 2px; }
.cert-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.cert-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.cert-pill--gold { background: var(--xp-soft); border-color: rgba(224,184,76,0.25); color: var(--xp-ink); }
.cert-pill--gold svg { color: var(--xp); }
.cert-pill--green { background: var(--success-soft); border-color: rgba(27,158,75,0.22); color: var(--success); }
.cert-pill--green svg { color: var(--success); }
.cert-pill--xp { background: var(--surface-2); }

/* ── Section ──────────────────────────────────────────────────── */
.cert-section { margin-bottom: 40px; }
.cert-section-hd { margin-bottom: 16px; }
.cert-section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0; color: var(--ink); }
.cert-section-title svg { color: var(--ink-3); }

/* ── Earned grid ──────────────────────────────────────────────── */
.cert-earned-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cert-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, border-color 0.15s; }
.cert-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.cert-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.cert-card-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.cert-card-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.cert-card-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.cert-view-btn { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 4px; font-size: 13px; }

/* ── Cream parchment — FIXED, does NOT theme-flip ─────────────── */
.cert-parchment {
  background: #FDFCE8;
  color: #14130F;
  border-bottom: 1px solid #E8E5C0;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.cert-parchment--mini { padding: 20px 20px 24px; min-height: 130px; display: flex; flex-direction: column; gap: 8px; }
.cert-parchment--full { padding: 28px 24px 32px; display: flex; flex-direction: column; gap: 10px; border-radius: var(--r-lg); border: 1px solid #E8E5C0; }

/* Subtle diagonal line watermark */
.cert-parchment-watermark {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 24px,
    rgba(20,19,15,0.025) 24px,
    rgba(20,19,15,0.025) 25px
  );
}

.cert-parchment-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.cert-wordmark { font-weight: 800; font-size: 14px; color: #14130F; letter-spacing: -0.01em; }
.cert-wordmark--lg { font-size: 16px; }
.cert-wordmark-ai { color: #14130F; }
.cert-verified-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill); background: rgba(27,158,75,0.12); color: #14731E; border: 1px solid rgba(27,158,75,0.22); letter-spacing: 0.04em; }
.cert-parchment-eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #5E6060; position: relative; z-index: 1; }
.cert-parchment-title { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 700; color: #14130F; line-height: 1.2; position: relative; z-index: 1; }
.cert-parchment-title--full { font-size: 26px; }
.cert-parchment-sub { font-size: 10.5px; color: #5E6060; position: relative; z-index: 1; }
.cert-parchment-issued { font-size: 11px; color: #5E6060; margin-top: 4px; position: relative; z-index: 1; }
.cert-parchment-name { font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-style: italic; color: #14130F; position: relative; z-index: 1; }
.cert-parchment-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 10.5px; color: #5E6060; border-top: 1px solid #E8E5C0; padding-top: 10px; position: relative; z-index: 1; }
.cert-parchment-cid { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; }

/* Green glowing seal */
.cert-seal {
  width: 36px; height: 36px; border-radius: 50%;
  background: #22C55E;
  color: #ffffff;
  display: grid; place-items: center;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.18), 0 0 16px rgba(34,197,94,0.28);
  align-self: flex-end;
  position: relative; z-index: 1;
  flex-shrink: 0;
}
.cert-seal--lg { width: 52px; height: 52px; box-shadow: 0 0 0 6px rgba(34,197,94,0.16), 0 0 24px rgba(34,197,94,0.30); align-self: center; margin: 4px auto 0; }

/* ── In-progress list ─────────────────────────────────────────── */
.cert-prog-list { display: flex; flex-direction: column; gap: 12px; }
.cert-prog-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px; display: flex; align-items: center; gap: 18px;
  box-shadow: var(--shadow-xs); transition: box-shadow 0.15s, border-color 0.15s;
}
.cert-prog-row:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.cert-prog-row--locked { opacity: 0.55; }
.cert-prog-ring-wrap { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cert-prog-pct { position: absolute; font-size: 10px; font-weight: 700; color: var(--ink-2); }
.cert-prog-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cert-prog-title { font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-prog-meta { font-size: 12.5px; color: var(--ink-3); }
.cert-prog-bar-wrap { margin-top: 6px; }
.cert-prog-bar { height: 4px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.cert-prog-fill { height: 100%; border-radius: var(--r-pill); background: var(--primary); transition: width 0.6s cubic-bezier(0.22,1,0.36,1); }
.cert-cta-btn { flex-shrink: 0; white-space: nowrap; font-size: 13px; padding: 8px 16px; }
.cert-cta-btn:disabled { cursor: not-allowed; }

/* ── Drawer ───────────────────────────────────────────────────── */
.cert-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.42); backdrop-filter: blur(2px); z-index: 40; }
.cert-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 50; box-shadow: var(--shadow-lg);
  transform: translateX(102%); transition: transform 0.3s cubic-bezier(0.23,1,0.32,1);
}
.cert-drawer.is-open { transform: translateX(0); }
.cert-drawer-hd { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cert-drawer-hd-text { flex: 1; min-width: 0; }
.cert-drawer-hd-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.cert-drawer-hd-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.cert-drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 0; }
.cert-drawer-sec { padding: 16px 0; border-bottom: 1px solid var(--border); }
.cert-drawer-sec:first-child { padding-top: 0; }
.cert-drawer-sec:last-child { border-bottom: none; }

/* Verified credential row */
.cert-verify-row { display: flex; align-items: center; gap: 12px; }
.cert-verify-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--success-soft); color: var(--success); display: grid; place-items: center; flex-shrink: 0; }
.cert-verify-body { flex: 1; min-width: 0; }
.cert-verify-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.cert-verify-url { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* Facts grid */
.cert-facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cert-fact { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.cert-fact > span:first-child { font-size: 10.5px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cert-fact > span:last-child { font-size: 13.5px; font-weight: 700; color: var(--ink); }

.cert-drawer-footer { display: flex; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }
.cert-drawer-btn { display: inline-flex; align-items: center; gap: 7px; flex: 1; justify-content: center; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cert-earned-grid { grid-template-columns: 1fr 1fr; }
  .cert-main { padding: 24px 24px 60px; }
}
@media (max-width: 760px) {
  .cert-earned-grid { grid-template-columns: 1fr; }
  .cert-header { flex-direction: column; gap: 12px; }
  .cert-drawer {
    top: auto; width: 100%; max-width: 100%; height: 92vh;
    border-left: none; border-top: 1px solid var(--border);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(102%);
  }
  .cert-drawer.is-open { transform: translateY(0); }
  .cert-drawer-footer { flex-direction: column; }
  .cert-drawer-btn { width: 100%; }
  .cert-prog-row { flex-wrap: wrap; gap: 12px; }
  .cert-cta-btn { width: 100%; justify-content: center; }
}
@media (max-width: 520px) {
  .cert-main { padding: 20px 16px 60px; }
  .cert-summary { gap: 6px; }
  .cert-pill { padding: 5px 10px; font-size: 12px; }
}

/* ============================================================
   Settings screen  (.stg-)
   ============================================================ */

/* ── Page layout ──────────────────────────────────────────────── */
.stg-main { padding: 32px 36px 120px; max-width: 1100px; }
.stg-h1 { font-size: 30px; font-weight: 700; margin: 4px 0 0; line-height: 1.15; }

/* ── Header + statusbar ───────────────────────────────────────── */
.stg-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.stg-statusbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.stg-status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.stg-status-chip--plan { background: var(--xp-soft); border-color: rgba(224,184,76,0.25); color: var(--xp-ink); }
.stg-status-chip--plan svg { color: var(--xp); }

/* ── Two-column layout ────────────────────────────────────────── */
.stg-layout { display: grid; grid-template-columns: 212px 1fr; gap: 24px; align-items: start; }

/* ── Sub-nav ──────────────────────────────────────────────────── */
.stg-subnav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.stg-snl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-md);
  background: transparent; border: none;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  text-align: left; width: 100%;
  cursor: pointer; transition: background 0.12s, color 0.12s;
}
.stg-snl-item:hover { background: var(--surface-2); color: var(--ink); }
.stg-snl-item.is-active { background: rgba(27,158,75,0.09); color: var(--success); font-weight: 600; }
.stg-snl-item.is-active svg { color: var(--success); }
.stg-snl-item.danger { color: var(--ink-3); }
.stg-snl-item.danger:hover { background: rgba(224,74,31,0.07); color: var(--streak); }
.stg-snl-item.danger.is-active { background: rgba(224,74,31,0.09); color: var(--streak); font-weight: 600; }
.stg-snl-item.danger.is-active svg { color: var(--streak); }
.stg-snl-item svg { color: var(--ink-4); flex-shrink: 0; transition: color 0.12s; }

/* ── Panel transitions ────────────────────────────────────────── */
.stg-panel { display: none; }
.stg-panel.is-active { display: block; animation: stg-fade 0.28s ease; }
@keyframes stg-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Card ─────────────────────────────────────────────────────── */
.stg-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px 24px; margin-bottom: 16px;
}
.stg-card.ai {
  border-color: rgba(110,86,207,0.28);
  background: linear-gradient(135deg, color-mix(in srgb, #22D3EE 4%, var(--surface)) 0%, color-mix(in srgb, #7C7FF0 6%, var(--surface)) 100%);
}
.stg-card.danger { border-color: rgba(224,74,31,0.22); }
.stg-card-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.stg-card-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; flex-shrink: 0; }
.stg-card-ico.ai { background: linear-gradient(135deg, #22D3EE, #7C7FF0); color: white; box-shadow: 0 0 14px rgba(124,127,240,0.25); }
.stg-card-ico.danger { background: rgba(224,74,31,0.10); color: var(--streak); }
.stg-card-title { font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.stg-card-helper { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.stg-card-footer { display: flex; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ── Avatar row ───────────────────────────────────────────────── */
.stg-avrow { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; }
.stg-avatar { width: 74px; height: 74px; border-radius: 50%; background: var(--success); color: white; font-size: 28px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.stg-av-body { flex: 1; min-width: 0; }
.stg-av-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.stg-av-email { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.stg-avrow-sep { height: 1px; background: var(--border); margin-bottom: 18px; }

/* ── Field layout ─────────────────────────────────────────────── */
.stg-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.stg-frow:last-of-type { margin-bottom: 0; }
.stg-field { display: flex; flex-direction: column; gap: 6px; }
.stg-field.full { grid-column: 1 / -1; }
.stg-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.stg-field-helper { font-size: 12px; color: var(--ink-3); }
.stg-input {
  padding: 10px 13px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 14px; color: var(--ink);
  font-family: inherit; width: 100%; outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.stg-input:focus { border-color: var(--success); box-shadow: 0 0 0 3px rgba(27,158,75,0.14); }
.stg-input::placeholder { color: var(--ink-4); }
.stg-input--narrow { max-width: 160px; }
.stg-select-wrap { position: relative; }
.stg-select {
  appearance: none; padding: 10px 38px 10px 13px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 14px; color: var(--ink); font-family: inherit; width: 100%; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2387867B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  cursor: pointer; transition: border-color 0.14s, box-shadow 0.14s;
}
.stg-select:focus { border-color: var(--success); box-shadow: 0 0 0 3px rgba(27,158,75,0.14); outline: none; }

/* ── Switch ───────────────────────────────────────────────────── */
.stg-sw {
  width: 44px; height: 25px; border-radius: 999px; border: none; padding: 0;
  background: var(--bg-2); position: relative; cursor: pointer; flex-shrink: 0;
  transition: background 0.2s;
}
.stg-sw:focus-visible { outline: 2px solid var(--success); outline-offset: 2px; }
.stg-sw.on { background: var(--success); }
.stg-sw.ai.on { background: linear-gradient(90deg, #22D3EE, #7C7FF0); }
.stg-sw-knob {
  position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%; background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.20);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.stg-sw.on .stg-sw-knob { transform: translateX(19px); }

/* ── Toggle row ───────────────────────────────────────────────── */
.stg-trow { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.stg-trow:first-of-type { border-top: none; }
.stg-trow-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; flex-shrink: 0; }
.stg-trow-ico.ai { background: linear-gradient(135deg, rgba(34,211,238,0.15), rgba(124,127,240,0.20)); color: var(--violet); }
.stg-trow-body { flex: 1; min-width: 0; }
.stg-trow-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.stg-trow-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.stg-trow-sep { height: 1px; background: var(--border); margin: 8px 0; }
.stg-reminder-time { padding: 12px 0 4px; display: flex; flex-direction: column; gap: 6px; }

/* ── Segmented control ────────────────────────────────────────── */
.stg-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.stg-seg-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.stg-seg-btn {
  padding: 7px 16px; border-radius: 8px; border: none;
  background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-3);
  cursor: pointer; transition: background 0.12s, color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
.stg-seg-btn:hover { color: var(--ink); }
.stg-seg-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ── Small action buttons ─────────────────────────────────────── */
.stg-sm-btn { padding: 7px 14px; font-size: 13px; }

/* ── Data row (privacy / account sections) ────────────────────── */
.stg-data-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.stg-data-row + .stg-data-row { border-top: 1px solid var(--border); }

/* ── Plan card row ────────────────────────────────────────────── */
.stg-plan-row { display: flex; align-items: center; gap: 16px; padding: 4px 0 16px; }
.stg-plan-badge { padding: 5px 12px; border-radius: var(--r-pill); background: var(--xp-soft); color: var(--xp-ink); font-size: 13px; font-weight: 700; border: 1px solid rgba(224,184,76,0.25); flex-shrink: 0; }
.stg-plan-body { flex: 1; }
.stg-plan-price { font-size: 22px; font-weight: 700; color: var(--ink); }
.stg-plan-price span { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.stg-plan-features { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-top: 4px; flex-wrap: wrap; }
.stg-plan-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }

/* ── Danger zone ──────────────────────────────────────────────── */
.stg-danger-text { color: var(--streak); }
.stg-danger-btn { background: rgba(224,74,31,0.09); border: 1px solid rgba(224,74,31,0.22); color: var(--streak); border-radius: var(--r-sm); }
.stg-danger-btn:hover { background: rgba(224,74,31,0.14); }
.stg-danger-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 960px) {
  .stg-main { padding: 24px 24px 80px; }
}
@media (max-width: 768px) {
  .stg-layout { grid-template-columns: 1fr; gap: 0; }
  .stg-subnav { position: static; display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding-bottom: 16px; -webkit-overflow-scrolling: touch; }
  .stg-snl-item { white-space: nowrap; flex-shrink: 0; }
  .stg-card { padding: 18px; }
}
@media (max-width: 520px) {
  .stg-main { padding: 20px 16px 80px; }
  .stg-frow { grid-template-columns: 1fr; }
  .stg-header { flex-direction: column; gap: 10px; }
  .stg-statusbar { gap: 6px; }
}

/* ── Bell notification badge ──────────────────────────────── */
.bell-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--streak);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  font-family: var(--mono);
  box-sizing: border-box;
}

/* ── NotFound / 404 / 403 / Offline ──────────────────────────── */
.nf-canvas {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--top-h, 64px));
  padding: 40px 26px 80px;
  position: relative;
  overflow: hidden;
}

/* Soft green radial glow */
.nf-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 640px 380px at 50% 28%, rgba(34,197,94,0.11) 0%, transparent 68%);
  pointer-events: none;
}

.nf-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Orb */
.nf-orb {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  flex-shrink: 0;
}

/* Eyebrow */
.nf-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 8px;
}

/* Big gradient-clipped code */
.nf-code {
  line-height: 1;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  background: linear-gradient(170deg, var(--ink) 35%, var(--ink-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Title */
.nf-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--ink);
}

/* Subtitle */
.nf-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0;
  text-wrap: pretty;
}

/* Recovery search — 404 only */
.nf-search {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 24px 0 0;
}

.nf-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.nf-search-inp {
  width: 100%;
  padding: 13px 16px 13px 42px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  -webkit-appearance: none;
}

.nf-search-inp:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.16), var(--shadow-sm);
}

.nf-search-inp::placeholder { color: var(--ink-3); }

/* CTA row */
.nf-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

/* Buttons */
.nf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: var(--primary);
  color: #04130A;
  transition: transform 0.14s, box-shadow 0.14s;
  min-height: 44px;
  white-space: nowrap;
}

.nf-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34,197,94,0.30);
}

.nf-btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink);
}

.nf-btn-outline:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.nf-btn-ai {
  background: linear-gradient(120deg, #22D3EE, #7C7FF0);
  color: #06121A;
}

.nf-btn-ai:hover {
  box-shadow: 0 6px 20px rgba(124,127,240,0.32);
}

.nf-btn-gold {
  background: var(--xp, #F5B100);
  color: #06121A;
}

.nf-btn-gold:hover {
  box-shadow: 0 6px 20px rgba(245,177,0,0.32);
}

/* Popular destinations */
.nf-dests {
  width: 100%;
  margin-top: 30px;
}

.nf-dests-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
}

.nf-dest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.nf-dest-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.24s var(--ease, ease), border-color 0.24s, box-shadow 0.24s;
  color: var(--ink);
}

.nf-dest-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(34,197,94,0.45);
  box-shadow: 0 6px 24px rgba(34,197,94,0.12), var(--shadow-sm);
}

.nf-dest-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.nf-dest-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.3;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nf-canvas { padding: 32px 18px 80px; }
  .nf-code { font-size: 74px !important; }
  .nf-title { font-size: 25px; }
  .nf-dest-grid { grid-template-columns: repeat(2, 1fr); }
  .nf-ctas { flex-direction: column; align-items: stretch; }
  .nf-btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .nf-dest-tile, .nf-btn { transition: none; }
}

/* ── Notifications screen ────────────────────────────────────── */
.ntf-main { min-height: calc(100vh - var(--top-h, 64px)); }

.ntf-canvas {
  max-width: 860px;
  margin: 0 auto;
  padding: 26px 26px 80px;
}

/* Header */
.ntf-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.ntf-h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
}

.ntf-hd-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 4px;
}

.ntf-markread {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.ntf-markread:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary);
}

/* Filter tabs */
.ntf-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ntf-tabs::-webkit-scrollbar { display: none; }

.ntf-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.ntf-tab:hover:not(.is-active) { background: var(--surface-2); }

/* Light mode: active = dark ink pill */
.ntf-tab.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Dark mode: active = green pill */
[data-theme="dark"] .ntf-tab.is-active {
  background: var(--primary);
  color: #04130A;
  border-color: var(--primary);
}

.ntf-tab-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #04130A;
  line-height: 1;
}

.ntf-tab.is-active .ntf-tab-pill {
  background: rgba(255,255,255,0.22);
  color: inherit;
}

[data-theme="dark"] .ntf-tab.is-active .ntf-tab-pill {
  background: rgba(4,19,10,0.25);
  color: #04130A;
}

/* Feed */
.ntf-feed { display: flex; flex-direction: column; }

/* Group */
.ntf-glabel {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 20px 0 8px 2px;
}

.ntf-group:first-child .ntf-glabel { margin-top: 4px; }

/* List card */
.ntf-nlist {
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* Row */
.ntf-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 0.24s;
}

.ntf-row:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); }
.ntf-row:hover         { background: var(--surface-2); }
.ntf-row + .ntf-row    { border-top: 1px solid var(--border); }

/* Unread: faint green wash + 3px left rail */
.ntf-row.is-unread { background: rgba(34,197,94,0.05); }

.ntf-row.is-unread::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 2px 0 0 2px;
}

.ntf-row.is-unread:hover { background: rgba(34,197,94,0.09); }

/* Dismiss animation */
@keyframes ntf-dismiss {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

.ntf-row.is-dismissing {
  animation: ntf-dismiss 0.2s ease forwards;
  pointer-events: none;
  overflow: hidden;
}

/* Icon tile */
.ntf-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Body */
.ntf-body { flex: 1; min-width: 0; }

.ntf-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ntf-ttl {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.ntf-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.ntf-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 4px 0 0;
  text-wrap: pretty;
}

/* Meta */
.ntf-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.ntf-time {
  font-size: 12px;
  color: var(--ink-3);
  flex-shrink: 0;
}

/* Inline action buttons */
.ntf-nbtn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 26px;
  transition: opacity 0.14s;
  flex-shrink: 0;
}

.ntf-nbtn:hover { opacity: 0.8; }

.ntf-nbtn-green {
  background: rgba(34,197,94,0.14);
  color: var(--primary);
}

.ntf-nbtn-rose {
  background: rgba(224,74,31,0.12);
  color: var(--streak, #E04A1F);
}

.ntf-nbtn-ai {
  background: rgba(34,211,238,0.12);
  color: #22D3EE;
}

/* Dismiss button — visible on hover */
.ntf-nx {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.14s, background 0.14s;
}

.ntf-row:hover .ntf-nx  { opacity: 1; }
.ntf-nx:hover           { background: var(--surface-2); color: var(--ink); }

/* Empty state */
.ntf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 24px 40px;
}

.ntf-empty-orb {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.ntf-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.ntf-empty-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 24px;
  max-width: 38ch;
  line-height: 1.55;
}

.ntf-empty-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.ntf-btn-primary {
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #04130A;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.14s, box-shadow 0.14s;
}

.ntf-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34,197,94,0.28);
}

.ntf-btn-outline {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.14s;
}

.ntf-btn-outline:hover { background: var(--surface-2); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ntf-canvas { padding: 22px 20px 80px; }
}

@media (max-width: 760px) {
  .ntf-canvas { padding: 18px 16px 80px; }
  .ntf-h1     { font-size: 25px; }
  .ntf-hd     { margin-bottom: 16px; }
  .ntf-ico    { width: 38px; height: 38px; }
  .ntf-row    { padding: 14px 16px; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ntf-row.is-dismissing { animation: none; opacity: 0; }
  .ntf-row, .ntf-tab, .ntf-markread, .ntf-nx, .ntf-btn-primary, .ntf-btn-outline { transition: none; }
}

/* ── Search Results screen ───────────────────────────────────── */
.srch-main { min-height: calc(100vh - var(--top-h, 64px)); }

.srch-canvas {
  max-width: 900px;
  margin: 0 auto;
  padding: 26px 26px 80px;
}

/* Heading */
.srch-h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 20px;
  line-height: 1.15;
}

.srch-h1 em {
  font-style: normal;
  color: var(--primary);
}

/* Query form */
.srch-form {
  position: relative;
  display: flex;
  align-items: center;
}

.srch-form-ico {
  position: absolute;
  left: 16px;
  color: var(--ink-3);
  pointer-events: none;
  z-index: 1;
}

.srch-input {
  width: 100%;
  padding: 15px 44px 15px 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.srch-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.16), var(--shadow-sm);
}

.srch-input::placeholder { color: var(--ink-3); }
.srch-input::-webkit-search-cancel-button { display: none; }

/* Clear button */
.srch-clear {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--surface-2);
  color: var(--ink-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, color 0.14s;
}

.srch-clear:hover { background: var(--border-strong); color: var(--ink); }

/* Result count */
.srch-count {
  font-size: 13px;
  color: var(--ink-2);
  margin: 14px 0 0;
}

/* Filter chips */
.srch-chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 14px 0 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.srch-chips::-webkit-scrollbar { display: none; }

.srch-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  box-shadow: var(--shadow-xs);
}

.srch-chip:hover:not(.is-active) {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.srch-chip.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

[data-theme="dark"] .srch-chip.is-active {
  background: var(--primary);
  color: #04130A;
  border-color: var(--primary);
}

.srch-chip-count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.65;
}

.srch-chip.is-active .srch-chip-count { opacity: 1; }

/* AI ask card */
.srch-ai-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin: 16px 0;
  border-radius: 15px;
  background: linear-gradient(120deg, rgba(34,211,238,0.07) 0%, rgba(124,127,240,0.10) 100%);
  border: 1px solid rgba(124,127,240,0.22);
  cursor: pointer;
  transition: box-shadow 0.24s, transform 0.24s;
}

.srch-ai-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.srch-ai-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124,127,240,0.15);
}

.srch-ai-orb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34,211,238,0.16), rgba(124,127,240,0.20));
  color: #7C7FF0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.srch-ai-body  { flex: 1; min-width: 0; }

.srch-ai-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7C7FF0;
  margin: 0 0 3px;
}

.srch-ai-q {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srch-ai-hint { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.srch-ai-arrow { color: var(--ink-3); flex-shrink: 0; }

/* Section labels */
.srch-section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 22px 0 10px 2px;
}

/* Results list */
.srch-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Result card */
.srch-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.24s, border-color 0.24s, box-shadow 0.24s;
}

.srch-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.srch-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34,197,94,0.40);
  box-shadow: 0 6px 20px rgba(34,197,94,0.10), var(--shadow-sm);
}

/* Top result — green ring */
.srch-card-top {
  border: 2px solid rgba(34,197,94,0.48);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.16), var(--shadow-sm);
}

.srch-card-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.srch-card-body { flex: 1; min-width: 0; }

.srch-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.srch-card-type {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.srch-card-best {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34,197,94,0.14);
  color: var(--primary);
  white-space: nowrap;
}

.srch-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 3px;
  line-height: 1.35;
}

.srch-card-context {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0 0 5px;
}

.srch-card-snippet {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}

/* Highlight <mark> */
mark.srch-mark {
  background: rgba(34,197,94,0.18);
  color: var(--success, #1B9E4B);
  border-radius: 3px;
  padding: 0 2px;
  font-style: normal;
}

[data-theme="dark"] mark.srch-mark {
  background: rgba(34,197,94,0.20);
  color: #86EFAC;
}

/* Empty / placeholder */
.srch-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px 32px;
}

.srch-empty-orb {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.srch-empty-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.srch-empty-sub {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 24px;
  max-width: 40ch;
  line-height: 1.55;
}

.srch-empty-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}

.srch-btn-ai {
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, #22D3EE, #7C7FF0);
  color: #06121A;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: box-shadow 0.14s, transform 0.14s;
}

.srch-btn-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124,127,240,0.32);
}

.srch-btn-outline {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.14s;
}

.srch-btn-outline:hover { background: var(--surface-2); }

/* Suggestion chips */
.srch-suggestions { width: 100%; max-width: 500px; }

.srch-suggestions-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  margin: 0 0 10px;
}

.srch-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.srch-suggestion-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  white-space: nowrap;
}

.srch-suggestion-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-2);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .srch-canvas { padding: 22px 20px 80px; }
}

@media (max-width: 760px) {
  .srch-canvas   { padding: 18px 16px 80px; }
  .srch-h1       { font-size: 22px; }
  .srch-input    { padding: 12px 40px 12px 44px; font-size: 15px; }
  .srch-card     { padding: 14px 16px; gap: 12px; }
  .srch-card-ico { width: 38px; height: 38px; }
  .srch-ai-card  { padding: 14px 16px; gap: 12px; }
  .srch-ai-orb   { width: 38px; height: 38px; }
  .srch-chips-row { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .srch-card, .srch-ai-card, .srch-chip,
  .srch-btn-ai, .srch-btn-outline, .srch-suggestion-chip,
  .srch-clear { transition: none; }
}

/* ============================================================
   Billing screen  (.bil-)
   ============================================================ */

/* Local coral/rose tokens — danger / failed payment ONLY */
.bil-main {
  --bil-rose: #F43F5E;
  --bil-rose-press: #E11D48;
  --bil-rose-soft: rgba(244,63,94,0.10);
  --bil-rose-line: rgba(244,63,94,0.28);
  min-height: calc(100vh - var(--top-h, 64px));
}
:root[data-theme="dark"] .bil-main {
  --bil-rose: #FB7185;
  --bil-rose-soft: rgba(251,113,133,0.14);
  --bil-rose-line: rgba(251,113,133,0.30);
}

.bil-canvas { max-width: 1100px; margin: 0 auto; padding: 32px 36px 96px; }

/* ── Page header ──────────────────────────────────────────────── */
.bil-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.bil-h1 { font-size: 30px; font-weight: 700; margin: 0; line-height: 1.15; color: var(--ink); }
.bil-hd-sub { font-size: 14px; color: var(--ink-3); margin: 6px 0 0; }
.bil-hd-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bil-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); }
.bil-chip-plan { background: var(--xp-soft); border-color: rgba(245,177,0,0.28); color: var(--xp-ink); }
.bil-chip-active { background: var(--success-soft); border-color: rgba(27,158,75,0.28); color: var(--success); }

/* ── Demo state preview (prototype affordance) ────────────────── */
.bil-demo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 22px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); }
.bil-demo-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.bil-demo-group { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; }
.bil-demo-btn { padding: 5px 11px; border-radius: 6px; border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: background 0.12s, color 0.12s; }
.bil-demo-btn:hover { color: var(--ink); }
.bil-demo-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.bil-demo-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bil-demo > .bil-demo-btn { border: 1px solid var(--border); border-radius: 8px; }

/* ── Sections ─────────────────────────────────────────────────── */
.bil-section { margin-bottom: 28px; }
.bil-sec-h2 { font-size: 19px; font-weight: 700; color: var(--ink); margin: 0 0 14px; line-height: 1.2; }
.bil-sec-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }

/* ── Card base ────────────────────────────────────────────────── */
.bil-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow-sm); }

/* ── Failed-payment banner (coral) ────────────────────────────── */
.bil-fail-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 22px; border-radius: var(--r-lg); background: var(--bil-rose-soft); border: 1px solid var(--bil-rose-line); }
.bil-fail-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--bil-rose-soft); color: var(--bil-rose); display: grid; place-items: center; flex-shrink: 0; }
.bil-fail-body { flex: 1; min-width: 0; }
.bil-fail-title { font-size: 14.5px; font-weight: 700; color: var(--ink); margin: 0; }
.bil-fail-sub { font-size: 13px; color: var(--ink-2); margin: 3px 0 0; line-height: 1.45; }
.bil-fail-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ── Current-plan hero ────────────────────────────────────────── */
.bil-plan-hero { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: stretch; padding: 24px; }
.bil-plan-hero-info { min-width: 0; }
.bil-plan-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bil-plan-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--xp-ink); margin: 0 0 6px; }
.bil-plan-name { font-size: 26px; font-weight: 800; color: var(--ink); margin: 0; line-height: 1.1; }
.bil-plan-blurb { font-size: 14px; color: var(--ink-3); margin: 4px 0 0; }
.bil-plan-price-block { display: flex; align-items: baseline; gap: 3px; flex-shrink: 0; }
.bil-plan-price { font-size: 34px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.bil-plan-period { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.bil-plan-status-note { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); margin: 16px 0 0; }
.bil-plan-status-note svg { color: var(--success); flex-shrink: 0; }
.bil-benefit-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.bil-benefit-item { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.bil-check-disc { width: 20px; height: 20px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; flex-shrink: 0; }

/* Upsell / usage panel */
.bil-plan-hero-upsell { background: var(--violet-soft); border: 1px solid rgba(110,86,207,0.22); border-radius: 15px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.bil-upsell-tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet); margin: 0; }
.bil-upsell-h { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.25; }
.bil-upsell-sub { font-size: 13px; color: var(--ink-2); margin: 0 0 4px; line-height: 1.5; }
.bil-usage { display: flex; flex-direction: column; gap: 7px; margin: 2px 0 6px; }
.bil-usage-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }
.bil-usage-val { font-weight: 600; color: var(--ink-2); }
.bil-usage-bar { height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bil-usage-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22D3EE, var(--violet)); transition: width var(--dur-slow, 0.5s) ease; }

/* ── Buttons ──────────────────────────────────────────────────── */
.bil-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; border-radius: var(--r-pill); border: 1px solid transparent; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease; background: var(--success); color: #fff; }
.bil-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.bil-btn:active { transform: translateY(0); }
.bil-btn.w-full { width: 100%; }
.bil-btn-sm { padding: 7px 13px; font-size: 13px; }
.bil-btn-gold { background: var(--xp); color: #1A1300; }
.bil-btn-gold:hover { background: #E5A600; }
.bil-btn-indigo { background: var(--violet); color: #fff; }
.bil-btn-indigo:hover { background: #5C46B5; }
.bil-btn-outline { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.bil-btn-outline:hover { background: var(--surface-2); border-color: var(--ink-4); box-shadow: none; }
.bil-btn-ghost { background: transparent; color: var(--ink-3); border-color: transparent; }
.bil-btn-ghost:hover { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.bil-btn-disabled { background: var(--surface-2); color: var(--ink-3); border-color: var(--border); cursor: default; }
.bil-btn-disabled:hover { transform: none; box-shadow: none; }
.bil-btn-rose { background: var(--bil-rose); color: #fff; }
.bil-btn-rose:hover { background: var(--bil-rose-press); }
.bil-btn-cancel { background: transparent; color: var(--bil-rose); border-color: var(--bil-rose-line); }
.bil-btn-cancel:hover { background: var(--bil-rose); color: #fff; border-color: var(--bil-rose); box-shadow: none; }

/* ── Plan comparison grid ─────────────────────────────────────── */
.bil-plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.bil-plan-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform 0.24s var(--ease, ease), box-shadow 0.24s ease; }
.bil-plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.bil-plan-card.featured { border-color: rgba(245,177,0,0.45); box-shadow: 0 0 0 1px rgba(245,177,0,0.30), var(--shadow-md); }
.bil-plan-card.current { border-color: rgba(27,158,75,0.40); }
.bil-ribbon { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: var(--r-pill); background: var(--xp); color: #1A1300; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; box-shadow: var(--shadow-sm); }
.bil-pc-header { margin-bottom: 12px; }
.bil-pc-name { font-size: 17px; font-weight: 700; margin: 0; }
.bil-pc-blurb { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; }
.bil-pc-price-row { display: flex; align-items: baseline; gap: 3px; margin-bottom: 2px; }
.bil-pc-amount { font-size: 30px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.bil-pc-period { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.bil-pc-note { font-size: 12px; color: var(--ink-3); margin: 0 0 4px; }
.bil-pc-features { list-style: none; margin: 16px 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 11px; flex: 1; }
.bil-pc-feat { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.bil-pc-feat.excluded { color: var(--ink-4); }
.bil-pc-check { width: 18px; height: 18px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; flex-shrink: 0; }
.bil-pc-check.excl { background: var(--bg-2); color: var(--ink-4); }
.bil-plan-card .bil-btn { margin-top: 4px; }

/* ── Period toggle ────────────────────────────────────────────── */
.bil-period-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.bil-pt-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px; border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: background 0.12s, color 0.12s, box-shadow 0.12s; white-space: nowrap; }
.bil-pt-btn:hover { color: var(--ink); }
.bil-pt-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.bil-pt-save { font-size: 10.5px; font-weight: 700; color: var(--success); background: var(--success-soft); padding: 2px 6px; border-radius: var(--r-pill); }

/* ── Payment method ───────────────────────────────────────────── */
.bil-pay-empty { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bil-pay-empty-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; flex-shrink: 0; }
.bil-pay-empty-body { flex: 1; min-width: 160px; }
.bil-pay-empty-title { font-size: 14.5px; font-weight: 600; color: var(--ink); margin: 0; }
.bil-pay-empty-sub { font-size: 13px; color: var(--ink-3); margin: 3px 0 0; }
.bil-pay-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bil-pay-card-brand { width: 50px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, var(--info), var(--violet)); color: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--shadow-xs); }
.bil-pay-card-info { flex: 1; min-width: 160px; }
.bil-pay-card-num { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--ink); margin: 0; }
.bil-pay-default-pill { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--success); background: var(--success-soft); padding: 2px 7px; border-radius: var(--r-pill); }
.bil-pay-card-exp { font-size: 13px; color: var(--ink-3); margin: 3px 0 0; }
.bil-pay-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Invoice table ────────────────────────────────────────────── */
.bil-inv-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bil-inv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bil-inv-table thead th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding: 0 12px 12px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.bil-inv-table tbody td { padding: 15px 12px 15px 0; border-bottom: 1px solid var(--border); color: var(--ink-2); vertical-align: middle; }
.bil-inv-table tbody tr:last-child td { border-bottom: none; }
.bil-inv-amount { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.bil-row-fail td { background: var(--bil-rose-soft); }
.bil-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.bil-status-paid { background: var(--success-soft); color: var(--success); }
.bil-status-failed { background: var(--bil-rose-soft); color: var(--bil-rose); }
.bil-dl-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: none; background: transparent; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; color: var(--success); cursor: pointer; transition: background 0.12s; }
.bil-dl-btn:hover { background: var(--success-soft); }
.bil-dl-btn--rose { color: var(--bil-rose); }
.bil-dl-btn--rose:hover { background: var(--bil-rose-soft); }

/* Invoice / payment empty + error states */
.bil-inv-empty, .bil-estate { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bil-inv-empty-title, .bil-estate-title { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; }
.bil-inv-empty-sub, .bil-estate-sub { font-size: 13px; color: var(--ink-3); margin: 0; max-width: 360px; }
.bil-inv-empty .bil-btn, .bil-estate .bil-btn { margin-top: 8px; }
.bil-estate-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 4px; }
.bil-estate-err .bil-estate-ico { background: var(--bil-rose-soft); color: var(--bil-rose); }

/* ── Skeleton ─────────────────────────────────────────────────── */
.bil-sk { display: flex; flex-direction: column; gap: 16px; }
.bil-sk-row { display: flex; align-items: center; gap: 14px; }
.bil-sk-circle { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.bil-sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.bil-sk-circle, .bil-sk-line { background: linear-gradient(90deg, var(--surface-2) 25%, var(--bg-2) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: bil-shimmer 1.3s ease infinite; }
.bil-sk-line { height: 11px; border-radius: 6px; }
@keyframes bil-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Cancel zone ──────────────────────────────────────────────── */
.bil-cancel-note { font-size: 13px; color: var(--ink-3); margin: 4px 0 0; padding: 14px 2px 0; border-top: 1px solid var(--border); }
.bil-cancel-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 8px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); }
.bil-cancel-copy { flex: 1; min-width: 220px; }
.bil-cancel-title { font-size: 14.5px; font-weight: 600; color: var(--ink-2); margin: 0; }
.bil-cancel-sub { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; line-height: 1.5; max-width: 540px; }

/* ── Toast ────────────────────────────────────────────────────── */
.bil-toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: inline-flex; align-items: center; gap: 9px; padding: 12px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: bil-toast-in 0.28s var(--ease-out, cubic-bezier(0.16,1,0.3,1)); max-width: calc(100vw - 48px); }
.bil-toast svg { color: var(--side-active); flex-shrink: 0; }
@keyframes bil-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 980px) {
  .bil-canvas { padding: 26px 24px 80px; }
  .bil-plan-hero { grid-template-columns: 1fr; gap: 20px; }
  .bil-plans-grid { grid-template-columns: 1fr; }
  .bil-plan-card.featured { order: -1; }
  .bil-benefit-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .bil-canvas { padding: 22px 16px 80px; }
  .bil-card { padding: 18px; }
  .bil-plan-hero { padding: 18px; }
  .bil-plan-name { font-size: 23px; }
  .bil-plan-price { font-size: 30px; }
  .bil-fail-banner { flex-direction: column; align-items: flex-start; }
  .bil-fail-actions { width: 100%; }
  .bil-fail-actions .bil-btn { flex: 1; }
  .bil-pay-card-actions { width: 100%; }
  .bil-pay-card-actions .bil-btn { flex: 1; }
  .bil-cancel-zone { flex-direction: column; align-items: stretch; }
  .bil-cancel-zone .bil-btn { width: 100%; }

  /* Invoice table → stacked cards */
  .bil-inv-table-wrap { overflow: visible; }
  .bil-inv-table, .bil-inv-table tbody, .bil-inv-table tr, .bil-inv-table td { display: block; width: 100%; }
  .bil-inv-table thead { display: none; }
  .bil-inv-table tbody tr { border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 12px; margin-bottom: 10px; }
  .bil-inv-table tbody tr:last-child { margin-bottom: 0; }
  .bil-inv-table tbody td { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); text-align: right; }
  .bil-inv-table tbody tr td:last-child { border-bottom: none; }
  .bil-inv-table tbody td::before { content: attr(data-l); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); text-align: left; }
  .bil-row-fail td { background: transparent; }
}
@media (max-width: 480px) {
  .bil-hd { flex-direction: column; gap: 10px; }
  .bil-plan-hero-top { flex-direction: column; gap: 8px; }
  .bil-demo { gap: 8px; }
  .bil-toast { right: 12px; left: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .bil-btn, .bil-plan-card, .bil-usage-fill, .bil-toast { transition: none; animation: none; }
  .bil-sk-circle, .bil-sk-line { animation: none; }
}

/* ============================================================
   Help & Support screen  (.help-)
   ============================================================ */
.help-main { min-height: calc(100vh - var(--top-h, 64px)); }
.help-canvas { max-width: 1040px; margin: 0 auto; padding: 32px 36px 96px; }

/* ── Header ───────────────────────────────────────────────────── */
.help-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.help-h1 { font-size: 30px; font-weight: 800; margin: 0; line-height: 1.15; color: var(--ink); }
.help-hd-sub { font-size: 14px; color: var(--ink-3); margin: 6px 0 0; }
.help-priority-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; background: var(--xp-soft); border: 1px solid rgba(245,177,0,0.28); color: var(--xp-ink); }
.help-priority-pill svg { color: var(--xp); }

/* ── Demo state preview (dev/QA only) ─────────────────────────── */
.help-demo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 22px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); }
.help-demo-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.help-demo-group { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; }
.help-demo-btn { padding: 5px 11px; border-radius: 6px; border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: background 0.12s, color 0.12s; }
.help-demo-btn:hover { color: var(--ink); }
.help-demo-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ── Search hero ──────────────────────────────────────────────── */
.help-hero { position: relative; overflow: hidden; text-align: center; padding: 42px 24px; margin-bottom: 30px; border-radius: 18px; border: 1px solid var(--line-green, rgba(27,158,75,0.22)); background:
  radial-gradient(ellipse 600px 200px at 50% 0%, rgba(34,197,94,0.14) 0%, transparent 70%), var(--success-soft); }
.help-hero-h { font-size: 30px; font-weight: 800; margin: 0; color: var(--ink); }
.help-hero-sub { font-size: 14.5px; color: var(--ink-2); margin: 8px 0 0; }
.help-bigsearch { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 20px auto 0; padding: 6px 6px 6px 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-sm); transition: border-color 0.14s, box-shadow 0.14s; }
.help-bigsearch:focus-within { border-color: var(--success); box-shadow: 0 0 0 3px rgba(27,158,75,0.16); }
.help-bigsearch svg { color: var(--ink-3); flex-shrink: 0; }
.help-bigsearch input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: inherit; font-size: 15px; color: var(--ink); }
.help-bigsearch input::placeholder { color: var(--ink-4); }
.help-bigsearch-btn { flex-shrink: 0; padding: 9px 16px; border: none; border-radius: 10px; background: var(--success); color: #fff; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background 0.14s; }
.help-bigsearch-btn:hover { background: #16803B; }
.help-popular { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.help-popular-label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.help-popular-chip { padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.help-popular-chip:hover { background: var(--surface-2); border-color: var(--success); color: var(--success); }

/* ── Sections ─────────────────────────────────────────────────── */
.help-section { margin-bottom: 30px; }
.help-sec-h2 { font-size: 19px; font-weight: 700; color: var(--ink); margin: 0 0 14px; line-height: 1.2; }

/* ── Topic grid ───────────────────────────────────────────────── */
.help-topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.help-topic { display: flex; align-items: flex-start; gap: 13px; text-align: left; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); cursor: pointer; transition: transform 0.24s var(--ease, ease), box-shadow 0.24s ease, border-color 0.24s ease; }
.help-topic:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.help-topic-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.help-topic-ico.tone-green   { background: var(--success-soft); color: var(--success); }
.help-topic-ico.tone-indigo  { background: var(--violet-soft); color: var(--violet); }
.help-topic-ico.tone-gold    { background: var(--xp-soft); color: var(--xp-ink); }
.help-topic-ico.tone-neutral { background: var(--surface-2); color: var(--ink-3); }
.help-topic-ico.tone-ai      { background: linear-gradient(135deg, rgba(34,211,238,0.18), rgba(124,127,240,0.22)); color: var(--violet); }
.help-topic-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.help-topic-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.help-topic-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }

/* ── FAQ accordion ────────────────────────────────────────────── */
.help-faq { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 4px 20px; box-shadow: var(--shadow-sm); }
.help-faq-item { border-bottom: 1px solid var(--border); }
.help-faq-item:last-child { border-bottom: none; }
.help-faq-q { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 2px; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; }
.help-faq-q::-webkit-details-marker { display: none; }
.help-faq-toggle { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); flex-shrink: 0; transition: transform 0.24s var(--ease, ease), background 0.2s, color 0.2s; }
.help-faq-item[open] .help-faq-toggle { transform: rotate(180deg); background: var(--success-soft); color: var(--success); }
.help-faq-a { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; padding: 0 2px 16px; max-width: 64ch; }
.help-faq-a strong { color: var(--ink); font-weight: 600; }

/* ── Two-column layout ────────────────────────────────────────── */
.help-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; min-width: 0; }
.help-two > * { min-width: 0; }

/* ── Card ─────────────────────────────────────────────────────── */
.help-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow-sm); }
.help-card-h { font-size: 16.5px; font-weight: 600; color: var(--ink); margin: 0; }
.help-card-helper { font-size: 13px; color: var(--ink-3); margin: 4px 0 0; }

/* ── Priority note (paid) ─────────────────────────────────────── */
.help-priority { display: flex; align-items: flex-start; gap: 11px; margin: 16px 0 4px; padding: 13px 14px; border-radius: var(--r-md); background: var(--xp-soft); border: 1px solid rgba(245,177,0,0.26); }
.help-priority-ico { width: 30px; height: 30px; border-radius: 9px; background: rgba(245,177,0,0.18); color: var(--xp-ink); display: grid; place-items: center; flex-shrink: 0; }
.help-priority-title { font-size: 13.5px; font-weight: 700; color: var(--ink); margin: 0; }
.help-priority-sub { font-size: 12.5px; color: var(--ink-2); margin: 2px 0 0; line-height: 1.45; }

/* ── Contact form ─────────────────────────────────────────────── */
.help-ff { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.help-ffrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.help-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.help-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.help-input, .help-textarea, .help-select { padding: 11px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; color: var(--ink); font-family: inherit; width: 100%; outline: none; transition: border-color 0.14s, box-shadow 0.14s; }
.help-textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.help-input:focus, .help-textarea:focus, .help-select:focus { border-color: var(--success); box-shadow: 0 0 0 3px rgba(27,158,75,0.14); }
.help-input::placeholder, .help-textarea::placeholder { color: var(--ink-4); }
.help-input.has-error, .help-textarea.has-error, .help-select.has-error { border-color: var(--streak); box-shadow: 0 0 0 3px rgba(224,74,31,0.12); }
.help-select-wrap { position: relative; }
.help-select { appearance: none; padding-right: 38px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2387867B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.help-err { font-size: 12px; font-weight: 500; color: var(--streak); }
.help-attach { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 11px; background: var(--surface-2); color: var(--ink-3); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color 0.14s, color 0.14s; width: 100%; }
.help-attach:hover { border-color: var(--success); color: var(--success); }
.help-ff-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Buttons ──────────────────────────────────────────────────── */
.help-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; border-radius: var(--r-pill); border: 1px solid transparent; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease; background: var(--success); color: #fff; }
.help-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.help-btn:active { transform: translateY(0); }
.help-btn-sm { padding: 7px 13px; font-size: 13px; }
.help-btn-primary { background: var(--success); color: #fff; }
.help-btn-outline { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.help-btn-outline:hover { background: var(--surface-2); border-color: var(--ink-4); box-shadow: none; }
.help-btn-ai { background: linear-gradient(120deg, #22D3EE, #7C7FF0); color: #06121A; }
.help-btn-ai:hover { box-shadow: 0 8px 22px -10px rgba(124,127,240,0.6); }

/* ── Ticket success state ─────────────────────────────────────── */
.help-success { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 24px; }
.help-success-tile { width: 54px; height: 54px; border-radius: 16px; background: var(--success-soft); color: var(--success); display: grid; place-items: center; margin-bottom: 4px; }
.help-success-h { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0; }
.help-success-sub { font-size: 13.5px; color: var(--ink-2); margin: 0; line-height: 1.55; max-width: 380px; }
.help-success-ref { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--success-soft); color: var(--success); font-size: 12.5px; font-weight: 700; font-family: var(--mono, monospace); }
.help-success-eta { font-size: 12.5px; color: var(--ink-3); margin: 2px 0 6px; }

/* ── Ticket list ──────────────────────────────────────────────── */
.help-ticket-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.help-ticket-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.help-ticket-row:hover { background: var(--surface-2); border-color: var(--border-strong); }
.help-ticket-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; flex-shrink: 0; }
.help-ticket-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.help-ticket-subject { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.help-ticket-meta { font-size: 12px; color: var(--ink-3); }
.help-status { flex-shrink: 0; padding: 4px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.help-status-green  { background: var(--success-soft); color: var(--success); }
.help-status-indigo { background: var(--violet-soft); color: var(--violet); }
.help-status-gold   { background: var(--xp-soft); color: var(--xp-ink); }

/* ── Empty / error / skeleton ─────────────────────────────────── */
.help-estate { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.help-estate-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; margin-bottom: 4px; }
.help-estate-ico--ok { background: var(--success-soft); color: var(--success); }
.help-estate-err .help-estate-ico { background: rgba(224,74,31,0.10); color: var(--streak); }
.help-estate-title { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; }
.help-estate-sub { font-size: 13px; color: var(--ink-3); margin: 0; max-width: 320px; line-height: 1.5; }
.help-estate .help-btn { margin-top: 8px; }
.help-sk { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.help-sk-row { display: flex; align-items: center; gap: 12px; }
.help-sk-circle { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }
.help-sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.help-sk-circle, .help-sk-line { background: linear-gradient(90deg, var(--surface-2) 25%, var(--bg-2) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: help-shimmer 1.3s ease infinite; }
.help-sk-line { height: 11px; border-radius: 6px; }
@keyframes help-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── AI help card ─────────────────────────────────────────────── */
.help-ai-card { background: linear-gradient(135deg, color-mix(in srgb, #22D3EE 5%, var(--surface)) 0%, color-mix(in srgb, #7C7FF0 8%, var(--surface)) 100%); border-color: rgba(110,86,207,0.26); }
.help-ai-orb { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, #22D3EE, #7C7FF0); color: #fff; display: grid; place-items: center; box-shadow: 0 0 18px rgba(124,127,240,0.3); margin-bottom: 12px; }
.help-ai-h { font-size: 16.5px; font-weight: 700; color: var(--ink); margin: 0; }
.help-ai-sub { font-size: 13px; color: var(--ink-2); margin: 6px 0 14px; line-height: 1.5; }
.help-ai-shortcuts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.help-ai-shortcut { text-align: left; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font-family: inherit; font-size: 13px; cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.help-ai-shortcut:hover { background: var(--surface-2); border-color: var(--violet); color: var(--ink); }

/* ── Learning resources ───────────────────────────────────────── */
.help-res-list { list-style: none; margin: 16px 0 0; padding: 0; }
.help-res-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 4px; border-top: 1px solid var(--border); background: transparent; border-left: none; border-right: none; border-bottom: none; cursor: pointer; transition: background 0.12s; }
.help-res-list li:first-child .help-res-row { border-top: none; }
.help-res-row:hover { background: var(--surface-2); }
.help-res-row > svg:last-child { color: var(--ink-4); flex-shrink: 0; }
.help-res-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; flex-shrink: 0; }
.help-res-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.help-res-title { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.help-res-ok { font-size: 10.5px; font-weight: 700; color: var(--success); background: var(--success-soft); padding: 2px 7px; border-radius: var(--r-pill); }
.help-res-desc { font-size: 12.5px; color: var(--ink-3); }

/* ── Toast ────────────────────────────────────────────────────── */
.help-toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: inline-flex; align-items: center; gap: 9px; padding: 12px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: help-toast-in 0.28s var(--ease-out, cubic-bezier(0.16,1,0.3,1)); max-width: calc(100vw - 48px); }
.help-toast svg { color: var(--side-active); flex-shrink: 0; }
@keyframes help-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 980px) {
  .help-canvas { padding: 26px 24px 80px; }
  .help-topic-grid { grid-template-columns: repeat(2, 1fr); }
  .help-two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .help-canvas { padding: 22px 16px 80px; }
  .help-hero { padding: 32px 18px; }
  .help-hero-h { font-size: 24px; }
  .help-topic-grid { grid-template-columns: 1fr; }
  .help-ffrow { grid-template-columns: 1fr; }
  .help-bigsearch-btn { padding: 9px 12px; }
  .help-card { padding: 18px; }
  .help-ff-actions .help-btn { flex: 1; }
}
@media (max-width: 480px) {
  .help-hd { flex-direction: column; gap: 10px; }
  .help-toast { right: 12px; left: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .help-topic, .help-btn, .help-faq-toggle, .help-toast { transition: none; animation: none; }
  .help-sk-circle, .help-sk-line { animation: none; }
}

/* ============================================================
   AI Tutor screen  (.tut-)
   ============================================================ */
.tut-main { min-height: calc(100vh - var(--top-h, 64px)); }
.tut-canvas { max-width: 1200px; margin: 0 auto; padding: 28px 32px 40px; }

/* ── Header ───────────────────────────────────────────────────── */
.tut-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.tut-hd-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tut-hd-orb { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #22D3EE, #7C7FF0); color: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 0 20px rgba(124,127,240,0.34); }
.tut-h1 { font-size: 30px; font-weight: 800; margin: 0; line-height: 1.1; color: var(--ink); }
.tut-hd-sub { font-size: 14px; color: var(--ink-3); margin: 4px 0 0; }
.tut-hd-actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

/* ── Demo state preview (dev/QA only) ─────────────────────────── */
.tut-demo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 18px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); }
.tut-demo-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.tut-demo-group { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; }
.tut-demo-btn { padding: 5px 11px; border-radius: 6px; border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: background 0.12s, color 0.12s; }
.tut-demo-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ── Buttons ──────────────────────────────────────────────────── */
.tut-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: var(--r-pill); border: 1px solid transparent; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease; }
.tut-btn-ai { background: linear-gradient(120deg, #22D3EE, #7C7FF0); color: #06121A; }
.tut-btn-ai:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -10px rgba(124,127,240,0.6); }
.tut-btn-outline { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.tut-btn-outline:hover { background: var(--surface-2); border-color: var(--ink-4); }

/* ── Body grid: rail + chat ───────────────────────────────────── */
.tut-body { display: grid; grid-template-columns: 284px 1fr; gap: 18px; align-items: start; min-width: 0; }
.tut-body > * { min-width: 0; }

/* ── Rail (themed) ────────────────────────────────────────────── */
.tut-rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.tut-rail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-xs); }
.tut-rail-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.tut-rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tut-conv { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 11px; border: none; background: transparent; cursor: pointer; transition: background 0.12s; }
.tut-conv:hover { background: var(--surface-2); }
.tut-conv-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; flex-shrink: 0; }
.tut-conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tut-conv-title { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tut-conv-prev { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tut-conv-time { font-size: 10.5px; color: var(--ink-4); flex-shrink: 0; }
.tut-saved { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.tut-saved:hover { background: var(--surface-2); border-color: var(--border-strong); }
.tut-saved svg { color: var(--xp); flex-shrink: 0; }
.tut-saved-label { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tut-ctx-list { display: flex; flex-direction: column; gap: 8px; }
.tut-ctx { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 10px 11px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.tut-ctx:hover { background: var(--surface-2); border-color: var(--border-strong); }
.tut-ctx-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.tut-ctx.tone-green .tut-ctx-ico  { background: var(--success-soft); color: var(--success); }
.tut-ctx.tone-indigo .tut-ctx-ico { background: var(--violet-soft); color: var(--violet); }
.tut-ctx.tone-ai .tut-ctx-ico     { background: linear-gradient(135deg, rgba(34,211,238,0.2), rgba(124,127,240,0.24)); color: var(--violet); }
.tut-ctx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tut-ctx-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.tut-ctx-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.tut-ctx-sub { font-size: 11.5px; color: var(--ink-3); }

/* ── Chat window (FIXED DARK — never theme-flips) ─────────────── */
.tut-chat {
  --cw-text: #E7EEF7; --cw-muted: #9DB2C8; --cw-line: rgba(255,255,255,0.10);
  --cw-ai-bubble: rgba(255,255,255,0.055);
  display: flex; flex-direction: column; min-width: 0;
  height: calc(100vh - 196px); min-height: 540px;
  border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(124,127,240,0.34);
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(180deg, #0C1530, #0A1020);
  box-shadow: var(--shadow-lg), 0 30px 70px -34px rgba(0,0,0,0.7);
  color: var(--cw-text);
}
.tut-chat-hd { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--cw-line); flex-wrap: wrap; }
.tut-chat-orb { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #22D3EE, #7C7FF0); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.tut-chat-id { display: flex; flex-direction: column; gap: 1px; margin-right: auto; min-width: 0; }
.tut-chat-name { font-size: 14.5px; font-weight: 700; color: var(--cw-text); }
.tut-chat-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cw-muted); }
.tut-dot { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 8px rgba(52,211,153,0.6); }
.tut-dot.busy { background: #FBBF24; box-shadow: 0 0 8px rgba(251,191,36,0.5); }
.tut-dot.offline { background: #FB7185; box-shadow: 0 0 8px rgba(251,113,133,0.5); }
.tut-chat-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tut-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; border: 1px solid var(--cw-line); color: var(--cw-text); background: rgba(255,255,255,0.04); white-space: nowrap; }
.tut-pill.tone-green svg  { color: #34D399; }
.tut-pill.tone-indigo svg { color: #A5B4FC; }
.tut-pill.tone-ai svg     { color: #67E8F9; }

/* Messages area */
.tut-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; }
.tut-msg { display: flex; gap: 10px; max-width: 100%; }
.tut-msg-me { justify-content: flex-end; }
.tut-msg-ai { justify-content: flex-start; }
.tut-msg-orb { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #22D3EE, #7C7FF0); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.tut-msg-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 80%; }
.tut-bubble { padding: 13px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; }
.tut-bubble-ai { background: var(--cw-ai-bubble); color: var(--cw-text); border-bottom-left-radius: 5px; }
.tut-bubble-ai p { margin: 0 0 8px; } .tut-bubble-ai p:last-child { margin-bottom: 0; }
.tut-bubble-ai ul, .tut-bubble-ai ol { margin: 6px 0; padding-left: 20px; } .tut-bubble-ai li { margin: 3px 0; }
.tut-bubble-ai strong { color: #fff; font-weight: 700; }
.tut-bubble-me { max-width: 80%; background: linear-gradient(120deg, #22D3EE, #7C7FF0); color: #06121A; font-weight: 500; border-bottom-right-radius: 5px; }
.tut-msg-actions { display: flex; gap: 4px; }
.tut-msg-act { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 8px; border: none; background: transparent; color: var(--cw-muted); font-family: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: background 0.12s, color 0.12s; }
.tut-msg-act:hover { background: rgba(255,255,255,0.06); color: var(--cw-text); }
.tut-followups { display: flex; gap: 7px; flex-wrap: wrap; }

/* Chips (followups + composer + saved) */
.tut-chip { padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--cw-line); background: rgba(255,255,255,0.04); color: var(--cw-text); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s; }
.tut-chip:hover { background: rgba(255,255,255,0.09); border-color: rgba(124,127,240,0.5); }

/* Typing indicator */
.tut-typing { display: inline-flex; align-items: center; gap: 5px; padding: 14px 16px; border-radius: 16px; border-bottom-left-radius: 5px; background: var(--cw-ai-bubble); }
.tut-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9DB2C8; animation: tut-bounce 1.2s infinite ease-in-out; }
.tut-typing span:nth-child(2) { animation-delay: 0.18s; } .tut-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes tut-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }

/* Empty state */
.tut-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 24px 16px; }
.tut-empty-orb { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, #22D3EE, #7C7FF0); color: #fff; display: grid; place-items: center; box-shadow: 0 0 26px rgba(124,127,240,0.4); margin-bottom: 6px; }
.tut-empty-h { font-size: 21px; font-weight: 700; color: var(--cw-text); margin: 0; }
.tut-empty-sub { font-size: 13.5px; color: var(--cw-muted); margin: 0 0 10px; }
.tut-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 560px; }
.tut-action { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 13px; border-radius: 13px; border: 1px solid var(--cw-line); background: rgba(255,255,255,0.03); color: var(--cw-text); cursor: pointer; transition: background 0.14s, border-color 0.14s, transform 0.14s; }
.tut-action:hover { background: rgba(255,255,255,0.07); border-color: rgba(124,127,240,0.5); transform: translateY(-2px); }
.tut-action-ico { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, rgba(34,211,238,0.22), rgba(124,127,240,0.28)); color: #A5F3FC; display: grid; place-items: center; }
.tut-action-label { font-size: 12.5px; font-weight: 600; line-height: 1.3; }

/* Unavailable state */
.tut-unavail { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 24px 16px; }
.tut-unavail-orb { width: 64px; height: 64px; border-radius: 18px; background: rgba(251,113,133,0.16); color: #FB7185; display: grid; place-items: center; margin-bottom: 6px; }
.tut-unavail-h { font-size: 19px; font-weight: 700; color: var(--cw-text); margin: 0; }
.tut-unavail-sub { font-size: 13.5px; color: var(--cw-muted); margin: 0 0 10px; max-width: 360px; line-height: 1.5; }
.tut-unavail-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tut-unavail .tut-btn-outline { color: var(--cw-text); border-color: var(--cw-line); }
.tut-unavail .tut-btn-outline:hover { background: rgba(255,255,255,0.06); }

/* Composer */
.tut-composer { border-top: 1px solid var(--cw-line); padding: 14px 16px 16px; }
.tut-composer-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.tut-composer-row { display: flex; align-items: flex-end; gap: 8px; background: rgba(255,255,255,0.05); border: 1px solid var(--cw-line); border-radius: 14px; padding: 8px 8px 8px 12px; transition: border-color 0.14s, box-shadow 0.14s; }
.tut-composer-row:focus-within { border-color: #22D3EE; box-shadow: 0 0 0 3px rgba(34,211,238,0.16); }
.tut-composer-attach { width: 32px; height: 32px; border-radius: 9px; border: none; background: transparent; color: var(--cw-muted); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: background 0.12s, color 0.12s; }
.tut-composer-attach:hover:not(:disabled) { background: rgba(255,255,255,0.08); color: var(--cw-text); }
.tut-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--cw-text); font-family: inherit; font-size: 14px; line-height: 1.5; resize: none; max-height: 120px; padding: 6px 0; }
.tut-input::placeholder { color: var(--cw-muted); }
.tut-send { width: 42px; height: 42px; border-radius: 11px; border: none; background: linear-gradient(135deg, #22D3EE, #7C7FF0); color: #06121A; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: transform 0.14s, box-shadow 0.14s, opacity 0.14s; }
.tut-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(124,127,240,0.6); }
.tut-send:disabled, .tut-composer-attach:disabled { opacity: 0.4; cursor: not-allowed; }
.tut-composer-hint { font-size: 11px; color: var(--cw-muted); margin: 8px 0 0; text-align: center; }
.tut-composer:has(.tut-input:disabled) .tut-composer-row { opacity: 0.55; }

/* ── Toast ────────────────────────────────────────────────────── */
.tut-toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: inline-flex; align-items: center; gap: 9px; padding: 12px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: tut-toast-in 0.28s cubic-bezier(0.16,1,0.3,1); max-width: calc(100vw - 48px); }
.tut-toast svg { color: var(--side-active); flex-shrink: 0; }
@keyframes tut-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 980px) {
  .tut-canvas { padding: 24px 22px 32px; }
  .tut-body { grid-template-columns: 1fr; }
  .tut-chat { order: -1; height: calc(100vh - 250px); }
  .tut-rail { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .tut-rail-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .tut-canvas { padding: 20px 14px 28px; }
  .tut-rail { grid-template-columns: 1fr; }
  .tut-rail-card:last-child { grid-column: auto; }
  .tut-chat { height: calc(100vh - 220px); min-height: 440px; }
  .tut-chat-pills { display: none; }
  .tut-hd-actions { width: 100%; }
  .tut-hd-actions .tut-btn { flex: 1; }
  .tut-actions-grid { grid-template-columns: 1fr; }
  .tut-msg-col, .tut-bubble-me { max-width: 88%; }
}
@media (max-width: 480px) {
  .tut-hd-left { gap: 10px; }
  .tut-toast { right: 12px; left: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tut-btn, .tut-action, .tut-send, .tut-toast { transition: none; animation: none; }
  .tut-typing span { animation: none; }
}
