/* ============================================================
   Focus Forge — interactive demo · app shell + dashboard
   Same design language as the landing
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #070A12;
  --bg-2: #0A0F1B;
  --surface: #101624;
  --surface-2: #141B2D;
  --elevated: #1A2236;
  --tint: #0E1422;

  /* Lines */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --fg: #F5F7FA;
  --fg-mid: #C8D0E0;
  --fg-mut: #8A95AE;

  /* Accents */
  --accent: #7C8CFF;
  --accent-2: #5BD7E8;
  --accent-violet: #A88BFF;
  --accent-cyan: #5BD7E8;
  --accent-amber: #F5B968;
  --accent-green: #5EEAD4;
  --accent-red: #F87171;

  --shadow-card: 0 1px 0 0 rgba(255, 255, 255, 0.04) inset, 0 30px 60px -30px rgba(0, 0, 0, 0.6);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --side-w: 250px;
  --notice-h: 44px;
}

/* ─────── Reset ─────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
code { font-family: var(--font-mono); font-size: 0.92em; }
::selection { background: rgba(124, 140, 255, 0.3); color: var(--fg); }

.skip-link { position: absolute; top: -100px; left: 0; padding: 10px 14px; background: var(--accent); color: #fff; border-radius: 0 0 var(--r) 0; z-index: 100; }
.skip-link:focus { top: 0; }

/* ─────── Demo notice ─────── */
.demo-notice {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(90deg, rgba(124, 140, 255, 0.15), rgba(91, 215, 232, 0.08));
  border-bottom: 1px solid var(--border-strong);
  font-size: 12.5px; color: var(--fg-mid);
  backdrop-filter: blur(8px);
}
.dn-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
.dn-label { flex: 1; }
.dn-label strong { color: var(--fg); font-weight: 600; }
.dn-link {
  font-size: 12px; padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg-mid);
  white-space: nowrap;
  transition: all .2s ease;
}
.dn-link:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.25); }
.dn-close {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--fg-mut);
  flex-shrink: 0;
  transition: all .2s ease;
}
.dn-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--fg); }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

@media (max-width: 640px) {
  .demo-notice .dn-link { display: none; }
}

/* ─────── App shell ─────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: calc(100vh - var(--notice-h));
}

/* ─────── Sidebar ─────── */
.side {
  position: sticky;
  top: var(--notice-h);
  align-self: start;
  height: calc(100vh - var(--notice-h));
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  padding: 22px 14px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(124, 140, 255, 0.25), rgba(168, 139, 255, 0.15));
  color: var(--accent);
  border: 1px solid rgba(124, 140, 255, 0.25);
  flex-shrink: 0;
}
.side-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-meta { font-size: 11px; color: var(--fg-mut); font-weight: 500; }

/* Language switcher */
.lang-switch, .side-lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}
.side-lang { display: flex; margin: 6px 8px 14px; align-self: stretch; justify-content: center; }
.lang-btn {
  padding: 5px 11px;
  border-radius: 999px;
  font: 600 11.5px var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--fg-mut);
  border: 1px solid transparent;
  transition: all .2s ease;
}
.lang-btn:hover { color: var(--fg); }
.lang-btn.active {
  background: rgba(124, 140, 255, 0.15);
  border-color: rgba(124, 140, 255, 0.3);
  color: var(--accent);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.side-eyebrow {
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-mut); font-weight: 600; padding: 8px 8px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--fg-mid); font-weight: 500;
  text-align: left;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  border: 1px solid transparent;
  width: 100%;
}
.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--fg); }
.nav-item.active {
  background: linear-gradient(180deg, rgba(124, 140, 255, 0.15), rgba(124, 140, 255, 0.05));
  color: var(--fg);
  border-color: rgba(124, 140, 255, 0.25);
}
.nav-item.active svg { opacity: 1; color: var(--accent); }

.mode-btn { color: var(--accent-amber); }
.mode-btn:hover { background: rgba(245, 185, 104, 0.08); color: var(--accent-amber); }
.mode-btn.warn { color: var(--accent-red); }
.mode-btn.warn:hover { background: rgba(248, 113, 113, 0.08); }
.mode-btn.active {
  background: rgba(245, 185, 104, 0.12);
  border-color: rgba(245, 185, 104, 0.35);
  color: var(--accent-amber);
}

.side-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  font-size: 12.5px; color: var(--fg-mut);
  border-radius: 6px;
  transition: background .2s ease, color .2s ease;
}
.side-link:hover { background: rgba(255, 255, 255, 0.03); color: var(--fg-mid); }
.side-footnote { font-size: 11px; color: var(--fg-mut); padding: 8px 10px; opacity: 0.8; font-style: italic; }

/* ─────── Mobile top bar ─────── */
.topbar { display: none; }
.mobile-drawer { display: none; }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: sticky; top: var(--notice-h); z-index: 40;
  }
  .topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
  .topbar .brand em { font-style: normal; color: var(--accent-2); font-size: 12px; font-weight: 500; padding: 2px 7px; border: 1px solid var(--border-strong); border-radius: 999px; margin-left: 4px; }
  .mobile-menu-btn { padding: 8px; border-radius: 8px; color: var(--fg-mid); }
  .mobile-menu-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
  .mobile-drawer {
    display: none; flex-direction: column; padding: 8px 14px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: sticky; top: calc(var(--notice-h) + 56px); z-index: 39;
  }
  .mobile-drawer.open { display: flex; }
  .mobile-drawer .nav-item { padding: 11px 12px; }
  .md-divider { height: 1px; background: var(--border); margin: 8px 0; }
}

/* ─────── App main ─────── */
.app-main { padding: 28px clamp(20px, 4vw, 44px) 60px; min-width: 0; }
@media (max-width: 920px) { .app-main { padding: 20px 18px 80px; } }

/* ─────── Views ─────── */
.view { display: none; animation: viewFade .4s ease; }
.view.active { display: block; }
@keyframes viewFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 22px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-mut); font-weight: 600;
}
.view-title {
  font-size: clamp(28px, 3.4vw, 38px);
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 6px 0 0;
  line-height: 1.1;
}

.mode-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(245, 185, 104, 0.12);
  border: 1px solid rgba(245, 185, 104, 0.3);
  color: var(--accent-amber);
  font-size: 12.5px; font-weight: 600;
}
.mp-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }

/* ─────── Cards ─────── */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: border-color .25s ease;
}
.card:hover { border-color: var(--border-strong); }

.card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px;
}
.card-eyebrow {
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-mut); font-weight: 600;
}
.card-eyebrow.warn { color: var(--accent-red); }
.card-title {
  font-size: 16px; font-weight: 700; letter-spacing: -0.015em;
  margin: 4px 0 0;
}

/* ─────── Hero ─────── */
.card-hero {
  position: relative;
  background:
    radial-gradient(ellipse 80% 100% at 0% 0%, rgba(124, 140, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  padding: 28px;
  border-radius: var(--r-xl);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-hero::after {
  content: ''; position: absolute; right: -100px; top: -100px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(168, 139, 255, 0.18), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}
.ch-eyebrow {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 8px;
}
.ch-title {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.15;
}
.ch-sub { color: var(--fg-mut); font-size: 13.5px; margin: 0 0 18px; }

.progress {
  position: relative;
  height: 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  margin-bottom: 22px;
}
.progress-fill {
  height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent), var(--accent-violet));
  border-radius: inherit;
  box-shadow: 0 0 20px rgba(124, 140, 255, 0.5);
  transition: width .8s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-label {
  position: absolute; right: 0; top: -22px;
  font-size: 12px; color: var(--fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
@media (max-width: 540px) { .hero-stats { grid-template-columns: 1fr; gap: 12px; } }

.hs {
  display: flex; align-items: center; gap: 12px;
  position: relative;
}
.hs-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 18px;
  border: 1px solid var(--border);
}
.hs-value {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
.hs-label { font-size: 11.5px; color: var(--fg-mut); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.hs-delta {
  position: absolute; top: -4px; right: 4px;
  font-size: 11px; font-weight: 700;
  color: var(--accent-green);
  padding: 2px 6px; border-radius: 5px;
  background: rgba(94, 234, 212, 0.15);
  animation: deltaIn .8s ease;
}
@keyframes deltaIn { 0% { opacity: 0; transform: translateY(8px); } 30% { opacity: 1; transform: translateY(-4px); } 100% { opacity: 0; transform: translateY(-12px); } }

/* ─────── Grid layout ─────── */
.grid-2 {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px;
  margin-bottom: 28px;
}
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }

.col-main, .col-side { display: grid; gap: 18px; }

.card-modes-mobile { display: none; }
@media (max-width: 920px) { .card-modes-mobile { display: block; } }

/* ─────── Wins (checklist) ─────── */
.wins-counter {
  font: 700 13px var(--font-mono);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 140, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(124, 140, 255, 0.25);
}
.wins-counter.full {
  background: rgba(94, 234, 212, 0.12);
  color: var(--accent-green);
  border-color: rgba(94, 234, 212, 0.35);
}

.wins { display: flex; flex-direction: column; gap: 8px; }
.win {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .25s ease;
  user-select: none;
}
.win:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); }

.win-check {
  width: 24px; height: 24px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.2);
  color: transparent;
  transition: all .25s ease;
}
.win-check svg { width: 14px; height: 14px; }
.win.done .win-check {
  background: linear-gradient(180deg, #5EEAD4, #34D399);
  border-color: rgba(94, 234, 212, 0.6);
  color: #06080F;
}
.win-label {
  flex: 1; font-size: 14.5px; color: var(--fg); font-weight: 500;
  letter-spacing: -0.005em;
  transition: color .25s ease;
}
.win.done .win-label { color: var(--fg-mut); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: rgba(255, 255, 255, 0.3); }

.win-fp {
  font: 700 11.5px var(--font-mono);
  color: var(--accent-2);
  padding: 3px 8px; border-radius: 5px;
  background: rgba(91, 215, 232, 0.1);
  border: 1px solid rgba(91, 215, 232, 0.25);
  white-space: nowrap;
}
.win.done .win-fp {
  background: rgba(94, 234, 212, 0.15);
  border-color: rgba(94, 234, 212, 0.4);
  color: var(--accent-green);
}

/* ─────── Reward ─────── */
.card-reward {
  position: relative;
  background:
    radial-gradient(ellipse 100% 70% at 100% 100%, rgba(245, 185, 104, 0.08), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
}
.card-reward.unlocked {
  border-color: rgba(245, 185, 104, 0.4);
  background:
    radial-gradient(ellipse 100% 70% at 100% 100%, rgba(245, 185, 104, 0.18), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: 0 0 0 1px rgba(245, 185, 104, 0.2), 0 30px 60px -30px rgba(245, 185, 104, 0.4);
}
.reward-badge {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-mut);
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--border);
}
.unlocked .reward-badge {
  background: rgba(245, 185, 104, 0.18);
  color: var(--accent-amber);
  border-color: rgba(245, 185, 104, 0.4);
}
.reward-cond { color: var(--fg-mut); font-size: 13.5px; margin: 8px 0 12px; }
.reward-progress {
  height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.rp-fill {
  height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, var(--accent-amber), #FFD580);
  border-radius: inherit;
  transition: width .8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reward-msg {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: rgba(245, 185, 104, 0.1);
  border: 1px solid rgba(245, 185, 104, 0.3);
  border-radius: 10px;
  color: var(--accent-amber);
  font-size: 13px; font-weight: 600;
}

/* ─────── Timer ─────── */
.card-timer .timer-state {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-mut);
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--border);
}
.card-timer.running .timer-state {
  background: rgba(91, 215, 232, 0.15);
  color: var(--accent-2);
  border-color: rgba(91, 215, 232, 0.35);
}

.timer { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; }
@media (max-width: 720px) { .timer { grid-template-columns: 1fr; gap: 18px; justify-items: center; } }

.timer-ring {
  position: relative;
  width: 180px; height: 180px;
}
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tr-track { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 6; }
.tr-fill {
  fill: none;
  stroke: url(#tr-grad);
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 276.46;
  stroke-dashoffset: 276.46;
  transition: stroke-dashoffset .3s linear;
  filter: drop-shadow(0 0 8px rgba(124, 140, 255, 0.6));
}
.timer-display {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font: 700 38px/1 var(--font-mono);
  letter-spacing: -0.04em;
  color: var(--fg);
}

.timer-controls { display: flex; flex-direction: column; gap: 14px; }
.timer-presets { display: flex; gap: 6px; }
.preset {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg-mid);
  font-size: 13px; font-weight: 600;
  transition: all .2s ease;
}
.preset:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
.preset.active {
  background: rgba(124, 140, 255, 0.12);
  border-color: rgba(124, 140, 255, 0.35);
  color: var(--accent);
}

.timer-actions { display: flex; gap: 8px; }

.timer-hint { font-size: 12.5px; color: var(--fg-mut); margin: 4px 0 0; }
.timer-hint em { font-style: normal; color: var(--fg-mid); font-weight: 600; }

/* ─────── Buttons ─────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn-lg { padding: 13px 22px; font-size: 14px; }
.btn-primary {
  background: linear-gradient(180deg, #8A99FF, #6776F0);
  color: #06080F;
  box-shadow: 0 0 0 1px rgba(124, 140, 255, 0.4), 0 14px 32px -12px rgba(124, 140, 255, 0.6);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(124, 140, 255, 0.5), 0 18px 36px -10px rgba(124, 140, 255, 0.7); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.22); }

/* ─────── Projects list (sidebar) ─────── */
.proj-list { display: grid; gap: 6px; }
.proj-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s ease;
}
.proj-list li:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); }
.proj-name { color: var(--fg); font-weight: 500; }
.proj-meta { display: flex; align-items: center; gap: 8px; color: var(--fg-mut); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.proj-mini-bar { width: 56px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.proj-mini-bar span {
  display: block; height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent));
  border-radius: inherit;
}

/* ─────── Notes ─────── */
.notes-list { display: grid; gap: 8px; }
.notes-list li {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  font-size: 13px; color: var(--fg-mid);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}
.note-tag {
  font: 500 10.5px var(--font-mono);
  padding: 2px 7px; border-radius: 5px;
  background: rgba(124, 140, 255, 0.12);
  color: var(--accent);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ─────── Mode chips (mobile card) ─────── */
.mode-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-chip {
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 13px; color: var(--fg-mid);
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
}
.mode-chip:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
.mode-chip.warn { color: var(--accent-red); border-color: rgba(248, 113, 113, 0.35); }
.mode-chip.warn:hover { background: rgba(248, 113, 113, 0.06); }

/* ─────── Card section (templates/plugins preview) ─────── */
.card-section {
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
}
.cs-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.cs-title { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; margin: 4px 0 0; }
.cs-foot { margin: 16px 0 0; font-size: 12.5px; color: var(--fg-mut); display: flex; align-items: center; gap: 6px; }
.cs-foot.center { justify-content: center; margin-top: 32px; }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-size: 12.5px; font-weight: 600;
  color: var(--accent);
  border-radius: 999px;
  border: 1px solid rgba(124, 140, 255, 0.25);
  background: rgba(124, 140, 255, 0.08);
  transition: all .2s ease;
}
.link-btn:hover { background: rgba(124, 140, 255, 0.15); border-color: rgba(124, 140, 255, 0.4); }
.link-btn span { transition: transform .25s ease; }
.link-btn:hover span { transform: translateX(2px); }

.pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(91, 215, 232, 0.55);
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(91, 215, 232, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(91, 215, 232, 0); }
  100% { box-shadow: 0 0 0 0   rgba(91, 215, 232, 0); }
}

/* ─────── Templates / Plugins grids ─────── */
.tpl-grid, .plg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 880px) { .tpl-grid, .plg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .tpl-grid, .plg-grid { grid-template-columns: 1fr; } }

.tpl, .plg {
  padding: 16px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  transition: all .25s ease;
  position: relative;
}
.tpl:hover, .plg:hover { border-color: var(--border-strong); transform: translateY(-2px); background: rgba(255, 255, 255, 0.04); }

.tpl-icon, .plg-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--c, var(--accent)) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 30%, transparent);
  color: var(--c, var(--accent));
  font-size: 16px;
  margin-bottom: 12px;
}
.tpl-name, .plg-name {
  font-size: 14.5px; font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.tpl-desc, .plg-desc { font-size: 12.5px; color: var(--fg-mut); margin: 0; line-height: 1.5; }
.tpl-tag {
  position: absolute; top: 14px; right: 14px;
  font: 500 10px var(--font-mono);
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg-mut);
  letter-spacing: 0.04em;
}

/* ─────── Goals view ─────── */
.goals-list { display: grid; gap: 14px; }
.goal {
  padding: 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
}
.goal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.goal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; margin: 4px 0 0; }
.goal-cat { font-size: 11px; padding: 3px 8px; border-radius: 5px; background: rgba(124, 140, 255, 0.12); color: var(--accent); letter-spacing: 0.04em; font-weight: 600; }
.goal-deadline { color: var(--fg-mut); font-size: 12.5px; margin: 4px 0 0; }
.goal-progress { margin-top: 14px; }
.goal .progress-label { top: -22px; }

/* ─────── Projects view ─────── */
.projects-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (max-width: 720px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  padding: 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  transition: border-color .25s ease;
}
.project-card:hover { border-color: var(--border-strong); }
.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.pc-title { font-size: 16px; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
.pc-status {
  font-size: 10.5px; padding: 3px 8px; border-radius: 5px;
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
}
.pc-status.active { background: rgba(94, 234, 212, 0.12); color: var(--accent-green); }
.pc-status.planning { background: rgba(124, 140, 255, 0.12); color: var(--accent); }
.pc-status.idle { background: rgba(255, 255, 255, 0.04); color: var(--fg-mut); }
.pc-desc { color: var(--fg-mut); font-size: 13px; margin: 0 0 14px; }
.pc-meta { display: flex; gap: 12px; align-items: center; padding-top: 12px; border-top: 1px dashed var(--border); }
.pc-tasks { font-size: 12px; color: var(--fg-mut); font-variant-numeric: tabular-nums; }
.pc-bar { flex: 1; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.pc-bar span {
  display: block; height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent));
}
.pc-pct { font: 700 12px var(--font-mono); color: var(--fg-mid); }

/* ─────── Roadmap timeline ─────── */
.timeline {
  position: relative;
  display: grid; gap: 16px;
  max-width: 880px; margin: 0 auto;
}
.timeline::before {
  content: ''; position: absolute;
  left: 19px; top: 18px; bottom: 18px; width: 1px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0.4;
}
.ti {
  position: relative;
  display: grid; grid-template-columns: 40px 1fr; gap: 18px;
  padding: 14px 0;
}
.ti-marker {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font: 700 13px var(--font-mono);
  color: var(--fg-mut);
  z-index: 1;
}
.ti-marker.active {
  background: linear-gradient(180deg, rgba(124, 140, 255, 0.25), rgba(124, 140, 255, 0.05));
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 140, 255, 0.1);
}
.ti-body {
  padding: 16px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.ti-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ti-head h3 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -0.015em; }
.ti-tag {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(124, 140, 255, 0.15); color: var(--accent);
  border: 1px solid rgba(124, 140, 255, 0.3);
}
.ti-tag.soft { background: rgba(255, 255, 255, 0.04); color: var(--fg-mut); border-color: var(--border); }
.ti-body ul { display: grid; gap: 4px; margin-top: 6px; }
.ti-body li { font-size: 13px; color: var(--fg-mid); padding-left: 14px; position: relative; }
.ti-body li::before { content: '·'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ─────── Final CTA ─────── */
.cta-block {
  text-align: center;
  padding: 40px 24px;
  margin-top: 24px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(124, 140, 255, 0.18), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
}
.cta-block h2 { font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.02em; margin: 0 0 8px; }
.cta-block p { color: var(--fg-mut); margin: 0 auto 22px; max-width: 42em; }
.cta-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.cta-tag { font-size: 12px; color: var(--fg-mut); padding: 6px 12px; border: 1px dashed var(--border-strong); border-radius: 999px; }

/* ─────── Modal ─────── */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  animation: fadeIn .25s ease;
}
.modal-content {
  position: relative;
  width: 100%; max-width: 540px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  animation: modalIn .35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh; overflow-y: auto;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }

.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 0; }
.modal-sub { color: var(--fg-mut); font-size: 13.5px; margin: 6px 0 0; }
.modal-close {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--fg-mid);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: all .2s ease;
  position: relative; z-index: 10;
}
.modal-close:hover { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); color: var(--accent-red); }
.modal-close svg { pointer-events: none; }

.stuck-list { display: grid; gap: 8px; }
.stuck-list li {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center;
  padding: 12px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s ease;
  user-select: none;
}
.stuck-list li:hover, .stuck-list li:focus-visible {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.06);
  outline: none;
}
.sl-arrow {
  color: var(--fg-mut);
  font-size: 18px; font-weight: 600;
  transition: transform .25s ease, color .2s ease;
}
.stuck-list li:hover .sl-arrow, .stuck-list li:focus-visible .sl-arrow {
  color: var(--accent-red);
  transform: translateX(3px);
}
.sl-num {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 7px;
  font: 700 12px var(--font-mono);
  background: rgba(248, 113, 113, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.25);
}
.stuck-list strong { font-size: 14px; color: var(--fg); display: block; margin-bottom: 2px; font-weight: 600; }
.stuck-list p { margin: 0; font-size: 12.5px; color: var(--fg-mut); line-height: 1.5; }

.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ─────── Toasts ─────── */
.toasts {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 250;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  font-size: 13.5px;
  min-width: 240px; max-width: 340px;
  animation: toastIn .35s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-color: rgba(94, 234, 212, 0.4); box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.2), 0 20px 40px -10px rgba(0, 0, 0, 0.6); }
.toast.unlock  { border-color: rgba(245, 185, 104, 0.4); box-shadow: 0 0 0 1px rgba(245, 185, 104, 0.2), 0 20px 40px -10px rgba(0, 0, 0, 0.6); }
.toast.fade { animation: toastOut .4s ease forwards; }
.toast-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 14px;
}
.toast.success .toast-icon { background: rgba(94, 234, 212, 0.15); color: var(--accent-green); }
.toast.unlock  .toast-icon { background: rgba(245, 185, 104, 0.15); color: var(--accent-amber); }
.toast-msg { color: var(--fg); }
.toast-msg .small { display: block; font-size: 12px; color: var(--fg-mut); margin-top: 2px; }

@keyframes toastIn  { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

@media (max-width: 540px) {
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { width: 100%; min-width: 0; max-width: none; }
}

/* ─────── Light Day Mode adjustments ─────── */
body.mode-light .card-hero::after { background: radial-gradient(circle, rgba(245, 185, 104, 0.15), transparent 60%); }
body.mode-light .progress-fill { background: linear-gradient(90deg, var(--accent-amber), #FFD580); box-shadow: 0 0 16px rgba(245, 185, 104, 0.4); }
body.mode-light .ch-eyebrow { color: var(--accent-amber); }
body.mode-light .nav-item.active { background: linear-gradient(180deg, rgba(245, 185, 104, 0.15), rgba(245, 185, 104, 0.05)); border-color: rgba(245, 185, 104, 0.3); }
body.mode-light .nav-item.active svg { color: var(--accent-amber); }

/* ─────── Reveal ─────── */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
