/* ═══════════════════════════════════════════════════════════════════════════════
   LIFEOS — ELITE DESIGN SYSTEM v8.0
   Philosophy: Quiet power. Every pixel intentional. Nothing wasted.
   Architecture: Token-based system → Component styles → View layouts → Utilities
═══════════════════════════════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS FALLBACK (if offline, system fonts take over gracefully) ── */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: local('Sora');
}

/* ════════════════════════════════════════════════════════════════
   1. DESIGN TOKENS
════════════════════════════════════════════════════════════════ */
:root {
  /* ── Color: Voids (backgrounds) ── */
  --void-0:  #000000;   /* pure black */
  --void-1:  #030407;   /* app background */
  --void-2:  #07080f;   /* sidebar */
  --void-3:  #0c0d18;   /* surface */
  --void-4:  #111220;   /* surface elevated */
  --void-5:  #161728;   /* surface high */
  --void-6:  #1d1f35;   /* hover state */

  /* ── Color: Borders ── */
  --rim-0: rgba(255,255,255,0.035);
  --rim-1: rgba(255,255,255,0.07);
  --rim-2: rgba(255,255,255,0.11);
  --rim-3: rgba(255,255,255,0.18);
  --rim-4: rgba(255,255,255,0.28);

  /* ── Color: Text ── */
  --text-0: rgba(255,255,255,0.97);  /* primary */
  --text-1: rgba(255,255,255,0.72);  /* secondary */
  --text-2: rgba(255,255,255,0.45);  /* tertiary */
  --text-3: rgba(255,255,255,0.22);  /* placeholder */
  --text-4: rgba(255,255,255,0.11);  /* disabled */

  /* ── Color: Accent (teal default, overridable) ── */
  --accent:        #00d4aa;
  --accent-bright: #00f5c8;
  --accent-dim:    rgba(0,212,170,0.12);
  --accent-glow:   rgba(0,212,170,0.22);
  --accent-deep:   rgba(0,212,170,0.06);
  --accent-text:   #00d4aa;

  /* ── Color: Semantic ── */
  --green:        #10b981;
  --green-dim:    rgba(16,185,129,0.12);
  --amber:        #f59e0b;
  --amber-dim:    rgba(245,158,11,0.12);
  --red:          #ef4444;
  --red-dim:      rgba(239,68,68,0.12);
  --blue:         #3b82f6;
  --blue-dim:     rgba(59,130,246,0.12);
  --violet:       #7c4dff;
  --violet-dim:   rgba(124,77,255,0.12);
  --rose:         #ec4899;
  --rose-dim:     rgba(236,72,153,0.12);
  --orange:       #f97316;

  /* ── Typography ── */
  --font-sans:    'DM Sans', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'DM Serif Display', 'SF Pro Display', Georgia, 'Times New Roman', serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* ── Font sizes ── */
  --fs-10: 0.625rem;   /* 10px */
  --fs-11: 0.6875rem;  /* 11px */
  --fs-12: 0.75rem;    /* 12px */
  --fs-13: 0.8125rem;  /* 13px */
  --fs-14: 0.875rem;   /* 14px */
  --fs-15: 0.9375rem;  /* 15px */
  --fs-16: 1rem;       /* 16px */
  --fs-18: 1.125rem;   /* 18px */
  --fs-20: 1.25rem;    /* 20px */
  --fs-24: 1.5rem;     /* 24px */
  --fs-28: 1.75rem;    /* 28px */
  --fs-32: 2rem;       /* 32px */
  --fs-40: 2.5rem;     /* 40px */
  --fs-48: 3rem;       /* 48px */
  --fs-56: 3.5rem;     /* 56px */
  --fs-64: 4rem;       /* 64px */

  /* ── Font weights ── */
  --fw-300: 300;
  --fw-400: 400;
  --fw-500: 500;
  --fw-600: 600;
  --fw-700: 700;
  --fw-800: 800;

  /* ── Spacing ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* ── Border radius ── */
  --r-2:  2px;
  --r-4:  4px;
  --r-6:  6px;
  --r-8:  8px;
  --r-10: 10px;
  --r-12: 12px;
  --r-16: 16px;
  --r-20: 20px;
  --r-24: 24px;
  --r-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-xl:  0 24px 64px rgba(0,0,0,0.7), 0 8px 24px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 24px rgba(0,212,170,0.2), 0 0 8px rgba(0,212,170,0.1);
  --shadow-glow:   0 0 40px rgba(0,212,170,0.15);

  /* ── Layout dimensions ── */
  --sidebar-w:      240px;
  --sidebar-w-collapsed: 60px;
  --topbar-h:       56px;
  --mob-nav-h:      64px;

  /* ── Transitions ── */
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --ease-io:     cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-expo:   cubic-bezier(0.19, 1, 0.22, 1);
  --t-fast:   120ms;
  --t-base:   200ms;
  --t-slow:   320ms;
  --t-xslow:  500ms;
}

/* ════════════════════════════════════════════════════════════════
   2. RESET & BASE
════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  background: var(--void-1);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: 1.5;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input, textarea, select, a {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  text-decoration: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

::selection {
  background: rgba(0,212,170,0.2);
  color: var(--text-0);
}

::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.14);
}

/* ════════════════════════════════════════════════════════════════
   3. BOOT SCREEN — Particle Canvas
════════════════════════════════════════════════════════════════ */
#boot {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: opacity 700ms var(--ease-io), transform 700ms var(--ease-io);
  overflow: hidden;
}
#boot.boot-exit {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

/* Canvas fills full screen */
#boot-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Progress UI sits at the bottom, above canvas */
.boot-progress-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(320px, 80vw);
  padding-bottom: 52px;
  animation: fadeUp 600ms var(--ease-expo) 800ms both;
}

.boot-progress-track {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-full);
  overflow: hidden;
}

.boot-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width 80ms linear;
  box-shadow: 0 0 16px var(--accent);
}

.boot-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.05em;
  min-height: 16px;
  text-align: center;
}

.boot-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.15);
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════════
   4. APP SHELL
════════════════════════════════════════════════════════════════ */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  touch-action: pan-y;
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms var(--ease-out), visibility 0s 500ms;
  pointer-events: none;
}

#app.app-ready {
  opacity: 1;
  visibility: visible;
  transition: opacity 500ms var(--ease-out);
  pointer-events: all;
}

/* ════════════════════════════════════════════════════════════════
   5. SIDEBAR
════════════════════════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  background: var(--void-2);
  border-right: 1px solid var(--rim-0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transition: width var(--t-slow) var(--ease-io),
              min-width var(--t-slow) var(--ease-io);
  flex-shrink: 0;
}

#sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
  min-width: var(--sidebar-w-collapsed);
}

/* Sidebar Brand */
.sb-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  gap: var(--sp-3);
  border-bottom: 1px solid var(--rim-0);
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-io);
}
.sb-brand:hover { background: rgba(255,255,255,0.02); }

.sb-mark {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: filter var(--t-base) var(--ease-io);
}
.sb-brand:hover .sb-mark { filter: drop-shadow(0 0 8px rgba(0,212,170,0.5)); }

.sb-name-wrap {
  flex: 1;
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--t-base) var(--ease-io);
}
#sidebar.collapsed .sb-name-wrap { opacity: 0; pointer-events: none; }

.sb-name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: var(--fw-700);
  letter-spacing: -0.03em;
  color: var(--text-0);
  white-space: nowrap;
  line-height: 1.1;
}

.sb-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-top: 1px;
  white-space: nowrap;
}

.sb-collapse-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-6);
  color: var(--text-3);
  transition: all var(--t-fast) var(--ease-io);
  flex-shrink: 0;
}
.sb-collapse-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-1);
}
#sidebar.collapsed .sb-collapse-btn {
  transform: rotate(180deg);
}

/* Sidebar quick stats */
.sb-stats {
  display: flex;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--rim-0);
  gap: var(--sp-2);
  flex-shrink: 0;
  overflow: hidden;
  transition: opacity var(--t-base), padding var(--t-slow);
}
#sidebar.collapsed .sb-stats {
  opacity: 0;
  padding: 0;
  height: 0;
  pointer-events: none;
}

.sb-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.sb-stat-val {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: var(--fw-700);
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.sb-stat-lbl {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-top: 2px;
  text-transform: uppercase;
}

.sb-stat-div {
  width: 1px;
  height: 24px;
  background: var(--rim-1);
  flex-shrink: 0;
}

/* Sidebar Navigation */
.sb-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-3) var(--sp-2);
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sb-section-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  font-weight: var(--fw-600);
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: var(--sp-3) var(--sp-2) var(--sp-1);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-base);
}
#sidebar.collapsed .sb-section-label { opacity: 0; height: 0; padding: 0; overflow: hidden; }

.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-2);
  height: 36px;
  border-radius: var(--r-8);
  color: var(--text-2);
  transition: background var(--t-fast) var(--ease-io),
              color var(--t-fast) var(--ease-io);
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  width: 100%;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-user-select: none;
  user-select: none;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
}
.nav-btn:hover .nav-icon { color: var(--text-1); }

.nav-btn:active {
  background: rgba(255,255,255,0.06);
  transform: scale(0.99);
}

.nav-btn.active {
  background: var(--accent-deep);
  color: var(--text-0);
}
.nav-btn.active .nav-icon { color: var(--accent); }
.nav-btn.active .nav-label { color: var(--accent); }

.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 2px;
  background: var(--accent);
  border-radius: 0 var(--r-full) var(--r-full) 0;
  box-shadow: 0 0 8px var(--accent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
  transition: color var(--t-fast);
}

.nav-label {
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--t-base), width var(--t-slow);
}
#sidebar.collapsed .nav-label { opacity: 0; width: 0; pointer-events: none; }

.nav-indicator {
  width: 4px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.nav-btn.active .nav-indicator { opacity: 1; }
#sidebar.collapsed .nav-indicator { display: none; }

.nav-badge {
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-600);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--t-base);
}
#sidebar.collapsed .nav-badge { opacity: 0; }

/* Sidebar Footer Vitals */
.sb-footer {
  padding: var(--sp-4);
  padding-bottom: 90px;
  border-top: 1px solid var(--rim-0);
  flex-shrink: 1;
  transition: opacity var(--t-base);
}
#sidebar.collapsed .sb-footer { opacity: 0; pointer-events: none; }

.sb-footer-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.vital-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: 7px;
}

.vital-name {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  width: 52px;
  flex-shrink: 0;
  white-space: nowrap;
}

.vital-track {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--r-full);
  overflow: hidden;
}

.vital-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 1.4s var(--ease-expo);
}

.vital-pct {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   6. MAIN AREA
════════════════════════════════════════════════════════════════ */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ════════════════════════════════════════════════════════════════
   7. TOPBAR
════════════════════════════════════════════════════════════════ */
#topbar {
  height: var(--topbar-h);
  background: var(--void-1);
  border-bottom: 1px solid var(--rim-0);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  flex-shrink: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.topbar-menu-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--t-fast) var(--ease-io);
  flex-shrink: 0;
}
.topbar-menu-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-1);
}
.topbar-menu-btn:active { transform: scale(0.92); }

.topbar-title {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: var(--fw-600);
  letter-spacing: -0.025em;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 32px;
  padding: 0 var(--sp-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rim-1);
  border-radius: var(--r-8);
  color: var(--text-3);
  font-size: var(--fs-13);
  width: min(400px, 100%);
  cursor: text;
  transition: all var(--t-fast) var(--ease-io);
}
.topbar-search:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--rim-2);
  color: var(--text-2);
}
.topbar-search span { flex: 1; text-align: left; }
.topbar-search kbd {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-4);
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.topbar-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: var(--sp-1);
}

.clock-time {
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  color: var(--text-0);
  letter-spacing: 0.04em;
  line-height: 1;
}

.clock-date {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.topbar-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  position: relative;
  transition: all var(--t-fast) var(--ease-io);
}
.topbar-icon-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-1);
}
.topbar-icon-btn:active { transform: scale(0.9); }

.icon-btn-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--red);
  border: 1.5px solid var(--void-1);
}

.topbar-capture-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 var(--sp-3);
  background: var(--accent);
  border-radius: var(--r-8);
  font-size: var(--fs-13);
  font-weight: var(--fw-600);
  color: #000;
  transition: all var(--t-fast) var(--ease-io);
  box-shadow: 0 0 20px rgba(0,212,170,0.18);
}
.topbar-capture-btn:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 30px rgba(0,212,170,0.3);
  transform: translateY(-1px);
}
.topbar-capture-btn:active { transform: translateY(0) scale(0.97); }

/* ════════════════════════════════════════════════════════════════
   8. CONTENT / VIEWS
════════════════════════════════════════════════════════════════ */
#content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: var(--sp-6) var(--sp-7) var(--sp-16);
  touch-action: pan-y;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out),
              visibility 0s var(--t-slow);
  pointer-events: none;
}

.view.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
  pointer-events: all;
}

/* View Header */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.view-header-left { flex: 1; min-width: 0; }
.view-header-right { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; flex-wrap: wrap; }

.view-title {
  font-family: var(--font-display);
  font-size: var(--fs-28);
  font-weight: var(--fw-700);
  letter-spacing: -0.035em;
  color: var(--text-0);
  line-height: 1.1;
}

.view-subtitle {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--text-3);
  margin-top: var(--sp-1);
  letter-spacing: 0.02em;
}

/* ════════════════════════════════════════════════════════════════
   9. CARDS
════════════════════════════════════════════════════════════════ */
.card {
  background: var(--void-3);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-12);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease-io),
              box-shadow var(--t-base) var(--ease-io),
              transform var(--t-base) var(--ease-io);
}

.card:hover { border-color: var(--rim-1); }

.card.interactive {
  cursor: pointer;
}
.card.interactive:hover {
  border-color: var(--rim-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.card.interactive:active {
  transform: translateY(0) scale(0.995);
}

.card.accent-card {
  background: linear-gradient(135deg, rgba(0,212,170,0.05) 0%, var(--void-3) 50%);
  border-color: rgba(0,212,170,0.15);
}
.card.accent-card:hover { border-color: rgba(0,212,170,0.25); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  gap: var(--sp-2);
}

.card-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  font-weight: var(--fw-600);
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
  display: block;
}
.card-head .card-label { margin-bottom: 0; }

.card-count {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.card-head-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--text-3);
}

/* ════════════════════════════════════════════════════════════════
   10. BUTTONS
════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-8);
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
}
.btn:hover::after { background: rgba(255,255,255,0.05); }
.btn:active { transform: scale(0.95); }

/* Accent */
.btn-accent {
  background: var(--accent);
  color: #000;
  font-weight: var(--fw-600);
  box-shadow: 0 0 20px rgba(0,212,170,0.15);
}
.btn-accent:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 28px rgba(0,212,170,0.28);
  transform: translateY(-1px);
}
.btn-accent:active { transform: translateY(0) scale(0.96); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--rim-1);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--rim-2);
  color: var(--text-1);
}

/* Danger */
.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

/* Sizes */
.btn-xs  { height: 24px; padding: 0 var(--sp-2); font-size: var(--fs-11); border-radius: var(--r-6); }
.btn-sm  { height: 28px; padding: 0 var(--sp-3); font-size: var(--fs-12); }
.btn-lg  { height: 40px; padding: 0 var(--sp-5); font-size: var(--fs-14); font-weight: var(--fw-600); }
.btn-xl  { height: 48px; padding: 0 var(--sp-7); font-size: var(--fs-15); font-weight: var(--fw-600); }
.btn-full { width: 100%; }

/* ════════════════════════════════════════════════════════════════
   11. BADGES
════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  font-weight: var(--fw-600);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.badge-accent { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(0,212,170,0.15); }
.badge-green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.15); }
.badge-amber  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,0.15); }
.badge-red    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.15); }
.badge-blue   { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(59,130,246,0.15); }
.badge-muted  { background: rgba(255,255,255,0.05); color: var(--text-2); border: 1px solid var(--rim-1); }

.badge-dot::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: var(--r-full);
  background: currentColor;
  animation: dotPulse 2s var(--ease-io) infinite;
}
@keyframes dotPulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

.live-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--accent);
  letter-spacing: 0.08em;
  animation: liveGlow 2s ease-in-out infinite;
}
@keyframes liveGlow { 0%,100%{opacity:1;} 50%{opacity:0.5;} }

/* ════════════════════════════════════════════════════════════════
   12. PROGRESS
════════════════════════════════════════════════════════════════ */
.progress-track {
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--accent);
  transition: width 1.2s var(--ease-expo);
}
.progress-track.thin  { height: 2px; }
.progress-track.thick { height: 6px; }
.progress-track.glow .progress-fill { box-shadow: 0 0 8px var(--accent); }

/* ════════════════════════════════════════════════════════════════
   13. FORM ELEMENTS
════════════════════════════════════════════════════════════════ */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.field-label {
  font-size: var(--fs-12);
  font-weight: var(--fw-500);
  color: var(--text-2);
}

.field-input,
.field-textarea,
.field-select {
  background: var(--void-4);
  border: 1px solid var(--rim-1);
  border-radius: var(--r-8);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  transition: border-color var(--t-fast) var(--ease-io),
              box-shadow var(--t-fast) var(--ease-io);
  width: 100%;
}

.field-input {
  height: 36px;
  padding: 0 var(--sp-3);
}

.field-textarea {
  padding: var(--sp-2) var(--sp-3);
  resize: none;
  line-height: 1.6;
  font-family: var(--font-sans);
}

.field-select {
  height: 36px;
  padding: 0 var(--sp-3);
  cursor: pointer;
}
.field-select option { background: var(--void-4); color: var(--text-0); }

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: rgba(0,212,170,0.4);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.08);
  outline: none;
}

.field-input::placeholder,
.field-textarea::placeholder { color: var(--text-3); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.form-grid .span-2 { grid-column: 1/-1; }

/* ════════════════════════════════════════════════════════════════
   14. TOGGLE SWITCH
════════════════════════════════════════════════════════════════ */
.toggle {
  width: 36px;
  height: 20px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.1);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast) var(--ease-io);
  border: none;
}

.toggle.on {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0,212,170,0.25);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: var(--r-full);
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform var(--ease-spring);
}

.toggle.on::after {
  transform: translateX(16px);
}

.toggle-list { display: flex; flex-direction: column; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--rim-0);
  gap: var(--sp-4);
}
.toggle-row:last-child { border-bottom: none; }

.toggle-title { font-size: var(--fs-13); font-weight: var(--fw-500); color: var(--text-1); }
.toggle-desc  { font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════════
   15. MODALS / OVERLAYS
════════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease-io),
              visibility 0s var(--t-base);
}

.overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--t-base) var(--ease-io);
}

.modal {
  background: var(--void-4);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-16);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--t-spring);
  box-shadow: var(--shadow-xl);
}

.overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal.modal-wide { max-width: 680px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) 0;
  margin-bottom: var(--sp-5);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: var(--fw-700);
  letter-spacing: -0.025em;
  color: var(--text-0);
}

.modal-sub {
  font-size: var(--fs-12);
  color: var(--text-3);
  margin-top: 3px;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--r-8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--t-fast) var(--ease-io);
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text-1); }
.modal-close:active { transform: scale(0.9); }

.modal-body {
  padding: 0 var(--sp-5) var(--sp-5);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--rim-0);
}

/* ════════════════════════════════════════════════════════════════
   16. COMMAND PALETTE
════════════════════════════════════════════════════════════════ */
#cmd-overlay {
  align-items: flex-start;
  padding-top: 14vh;
}

.cmd-palette {
  background: var(--void-5);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-16);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  transform: translateY(-12px) scale(0.97);
  transition: transform var(--t-spring);
  box-shadow: var(--shadow-xl);
  margin: 0 auto;
}
#cmd-overlay.open .cmd-palette { transform: translateY(0) scale(1); }

.cmd-search-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--rim-1);
}

.cmd-search-icon { color: var(--text-3); flex-shrink: 0; }

.cmd-input {
  flex: 1;
  height: 52px;
  background: none;
  color: var(--text-0);
  font-size: var(--fs-15);
  caret-color: var(--accent);
}
.cmd-input::placeholder { color: var(--text-3); }

.cmd-esc {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-4);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
}

.cmd-results {
  max-height: 320px;
  overflow-y: auto;
  padding: var(--sp-1);
}

.cmd-group-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-3);
  border-radius: var(--r-8);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-io);
}
.cmd-item:hover,
.cmd-item.cmd-focused { background: rgba(255,255,255,0.05); }
.cmd-item.cmd-focused { background: var(--accent-deep); }

.cmd-item-icon { width: 20px; text-align: center; font-size: var(--fs-15); flex-shrink: 0; }
.cmd-item-label { flex: 1; font-size: var(--fs-13); color: var(--text-1); }
.cmd-item-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rim-1);
  border-radius: var(--r-4);
  padding: 1px 5px;
}
.cmd-item-desc { font-size: var(--fs-12); color: var(--text-3); }
.cmd-empty {
  padding: var(--sp-8);
  text-align: center;
  font-size: var(--fs-13);
  color: var(--text-3);
}

.cmd-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  border-top: 1px solid var(--rim-0);
}
.cmd-hint {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.cmd-hint kbd {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rim-1);
  border-radius: var(--r-4);
  padding: 1px 5px;
}

/* ════════════════════════════════════════════════════════════════
   17. TOAST NOTIFICATIONS
════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - var(--sp-10));
}

.toast {
  pointer-events: all;
  background: var(--void-5);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-12);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  cursor: pointer;
  animation: toastIn 300ms var(--ease-spring) both;
  transition: transform var(--t-fast) var(--ease-io), opacity var(--t-fast) var(--ease-io);
}
.toast:hover { transform: translateX(-3px); }
.toast:active { transform: scale(0.97); }

.toast.toast-out {
  animation: toastOut 250ms var(--ease-in) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 80px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(20px); max-height: 0; margin-bottom: -8px; }
}

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-icon svg { width: 18px; height: 18px; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: var(--fs-13); font-weight: var(--fw-600); color: var(--text-0); }
.toast-body  { font-size: var(--fs-12); color: var(--text-2); margin-top: 2px; line-height: 1.4; }

.toast.success { border-left: 2px solid var(--green); }
.toast.error   { border-left: 2px solid var(--red); }
.toast.warning { border-left: 2px solid var(--amber); }
.toast.info    { border-left: 2px solid var(--accent); }

.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--amber); }
.toast.info    .toast-icon { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   18. MOBILE OVERLAY + BOTTOM NAV
════════════════════════════════════════════════════════════════ */
#mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease-io);
}
#mob-overlay.active {
  opacity: 1;
  pointer-events: all;
}

#mob-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mob-nav-h);
  background: var(--void-2);
  border-top: 1px solid var(--rim-0);
  z-index: 50;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--sp-2);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mob-nav-btn {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  padding: var(--sp-2) 0;
  border-radius: var(--r-8);
  transition: all var(--t-fast) var(--ease-io);
  cursor: pointer;
}
.mob-nav-btn:active { transform: scale(0.88); background: rgba(255,255,255,0.04); }
.mob-nav-btn svg { color: var(--text-3); transition: color var(--t-fast); }
.mob-nav-btn span { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); transition: color var(--t-fast); }
.mob-nav-btn.active svg { color: var(--accent); }
.mob-nav-btn.active span { color: var(--accent); }

.mob-capture-fab {
  width: 46px;
  height: 46px;
  border-radius: var(--r-full);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(0,212,170,0.35);
  transition: all var(--t-fast) var(--ease-io);
  flex-shrink: 0;
}
.mob-capture-fab:active { transform: scale(0.9); }
.mob-capture-fab svg { color: #000; }

/* ════════════════════════════════════════════════════════════════
   19. FILTER BUTTONS
════════════════════════════════════════════════════════════════ */
.filter-btn {
  height: 28px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--fs-12);
  font-weight: var(--fw-500);
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
}
.filter-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.filter-btn:active { transform: scale(0.95); }
.filter-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0,212,170,0.2);
}

/* Period toggle */
.period-toggle {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rim-1);
  border-radius: var(--r-8);
  padding: 2px;
  gap: 1px;
}
.period-btn {
  height: 26px;
  padding: 0 var(--sp-3);
  border-radius: 6px;
  font-size: var(--fs-12);
  font-weight: var(--fw-500);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
}
.period-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.period-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,212,170,0.2);
}

/* Review type toggle */
.review-type-toggle {
  display: flex;
  gap: var(--sp-1);
}
.review-type-btn {
  height: 28px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--fs-12);
  font-weight: var(--fw-500);
  color: var(--text-2);
  border: 1px solid var(--rim-1);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
}
.review-type-btn:hover { border-color: var(--rim-2); color: var(--text-1); }
.review-type-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0,212,170,0.25);
}

/* ════════════════════════════════════════════════════════════════
   20. SETTINGS LAYOUT
════════════════════════════════════════════════════════════════ */
.settings-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--sp-5);
  padding: 0 var(--sp-5) var(--sp-5);
}

.settings-nav { display: flex; flex-direction: column; gap: 1px; }
.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-8);
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
  text-align: left;
  width: 100%;
}
.settings-nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.settings-nav-btn.active { background: var(--accent-deep); color: var(--accent); }

.settings-content { min-width: 0; }
.settings-section { display: none; }
.settings-section.active { display: block; }
.settings-section-title {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: var(--fw-600);
  letter-spacing: -0.02em;
  color: var(--text-0);
  margin-bottom: var(--sp-4);
}

.color-swatches { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--sc);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: white; transform: scale(1.1); }

.data-privacy-note {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: rgba(16,185,129,0.05);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: var(--r-10);
  margin-bottom: var(--sp-4);
  color: var(--green);
}
.dpn-title { font-size: var(--fs-13); font-weight: var(--fw-600); color: var(--text-1); }
.dpn-desc  { font-size: var(--fs-12); color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.data-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.shortcut-list { display: flex; flex-direction: column; gap: 1px; }
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--rim-0);
}
.shortcut-row:last-child { border-bottom: none; }
.shortcut-action { font-size: var(--fs-13); color: var(--text-2); }
.shortcut-keys { display: flex; align-items: center; gap: var(--sp-1); }
.shortcut-keys kbd {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-4);
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}

/* ════════════════════════════════════════════════════════════════
   21. CAPTURE MODAL
════════════════════════════════════════════════════════════════ */
.capture-types {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.capture-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-1);
  border-radius: var(--r-8);
  background: var(--void-5);
  border: 1px solid var(--rim-1);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
}
.capture-type-btn:hover { border-color: var(--rim-2); background: rgba(255,255,255,0.04); }
.capture-type-btn:active { transform: scale(0.94); }
.capture-type-btn.active {
  background: var(--accent-deep);
  border-color: rgba(0,212,170,0.3);
}
.ct-icon { font-size: 18px; }
.ct-label { font-size: var(--fs-10); font-weight: var(--fw-500); color: var(--text-2); }
.capture-type-btn.active .ct-label { color: var(--accent); }

.capture-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

/* ════════════════════════════════════════════════════════════════
   22. DASHBOARD SPECIFIC
════════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.kpi-card {
  background: var(--void-3);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-12);
  padding: var(--sp-4) var(--sp-5);
  transition: border-color var(--t-base), transform var(--t-base);
}
.kpi-card:hover { border-color: var(--rim-1); transform: translateY(-1px); }

.kpi-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.kpi-val {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-700);
  letter-spacing: -0.04em;
  color: var(--text-0);
  line-height: 1;
}

.kpi-val.accent { color: var(--accent); }
.kpi-val.green  { color: var(--green); }
.kpi-val.amber  { color: var(--amber); }
.kpi-val.violet { color: var(--violet); }

.kpi-unit {
  font-size: var(--fs-16);
  font-weight: var(--fw-400);
  color: var(--text-2);
  margin-left: 2px;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-11);
  font-weight: var(--fw-500);
  margin-top: var(--sp-1);
}
.kpi-trend.up   { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.kpi-trend.flat { color: var(--text-3); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--sp-5);
}

.dash-main { display: flex; flex-direction: column; gap: var(--sp-5); }
.dash-side  { display: flex; flex-direction: column; gap: var(--sp-5); }
.dash-row   { display: grid; grid-template-columns: 1fr 200px; gap: var(--sp-5); }

/* Heatmap */
.heatmap-wrap {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
  margin-bottom: var(--sp-3);
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-io), opacity var(--t-fast);
}
.heatmap-cell:hover { transform: scale(1.4); z-index: 1; position: relative; }
.heatmap-cell[data-level="0"] { background: rgba(255,255,255,0.04); }
.heatmap-cell[data-level="1"] { background: rgba(0,212,170,0.14); }
.heatmap-cell[data-level="2"] { background: rgba(0,212,170,0.30); }
.heatmap-cell[data-level="3"] { background: rgba(0,212,170,0.52); }
.heatmap-cell[data-level="4"] { background: var(--accent); box-shadow: 0 0 4px rgba(0,212,170,0.4); }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.legend-label { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); }
.legend-cells { display: flex; gap: 2px; }
.legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.legend-cell[style="--lv:0"] { background: rgba(255,255,255,0.04); }
.legend-cell[style="--lv:1"] { background: rgba(0,212,170,0.14); }
.legend-cell[style="--lv:2"] { background: rgba(0,212,170,0.30); }
.legend-cell[style="--lv:3"] { background: rgba(0,212,170,0.52); }
.legend-cell[style="--lv:4"] { background: var(--accent); }

/* Insight card */
.insight-card {
  border-left: 2px solid var(--accent);
  position: relative;
  overflow: hidden;
}

.insight-pulse {
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0.3;
  animation: insightPulse 3s var(--ease-io) infinite;
}
@keyframes insightPulse { 0%,100%{opacity:0.15;} 50%{opacity:0.5;} }

.insight-actions { display: flex; gap: var(--sp-1); }
.insight-text {
  font-size: var(--fs-14);
  color: var(--text-1);
  line-height: 1.7;
  margin-bottom: var(--sp-2);
}
.insight-meta { font-size: var(--fs-11); color: var(--text-3); font-family: var(--font-mono); }

/* Life score ring */
.ring-chart { position: relative; display: inline-flex; }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ring-val {
  font-family: var(--font-display);
  font-size: var(--fs-28);
  font-weight: var(--fw-700);
  letter-spacing: -0.05em;
  color: var(--text-0);
  line-height: 1;
}
.ring-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  margin-top: 2px;
}

.life-score-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-top: var(--sp-2);
}
.life-score-meta { display: flex; flex-direction: column; gap: var(--sp-1); }
.life-score-trend {
  font-size: var(--fs-12);
  font-weight: var(--fw-600);
}
.life-score-trend.up   { color: var(--green); }
.life-score-trend.down { color: var(--red); }
.life-score-rank { font-size: var(--fs-11); color: var(--text-3); font-family: var(--font-mono); }

/* Domain score list */
.domain-score-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--rim-0);
}
.domain-score-row:last-child { border-bottom: none; }
.domain-score-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.domain-score-name { font-size: var(--fs-12); color: var(--text-2); flex: 1; }
.domain-score-bar  { flex: 2; }
.domain-score-val  { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); width: 24px; text-align: right; flex-shrink: 0; }

/* Habit chain mini */
.habit-chain {
  display: flex;
  gap: 3px;
  margin-bottom: var(--sp-3);
}
.habit-chain-dot {
  flex: 1;
  height: 4px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.06);
  transition: background var(--t-base) var(--ease-io);
}
.habit-chain-dot.done { background: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   23. FOCUS VIEW
════════════════════════════════════════════════════════════════ */
.focus-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--sp-6);
  align-items: start;
}

.focus-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
}

.focus-modes {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.focus-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-10);
  background: var(--void-3);
  border: 1px solid var(--rim-1);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
  min-width: 80px;
}
.focus-mode-btn:hover { border-color: var(--rim-2); background: var(--void-4); }
.focus-mode-btn:active { transform: scale(0.95); }
.focus-mode-btn.active {
  background: var(--accent-deep);
  border-color: rgba(0,212,170,0.3);
}
.fm-name {
  font-size: var(--fs-12);
  font-weight: var(--fw-600);
  color: var(--text-2);
  transition: color var(--t-fast);
}
.focus-mode-btn.active .fm-name { color: var(--accent); }
.fm-dur {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  transition: color var(--t-fast);
}
.focus-mode-btn.active .fm-dur { color: rgba(0,212,170,0.7); }

/* Timer ring */
.timer-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.timer-ring-wrap {
  position: relative;
  display: inline-flex;
}
.timer-svg { display: block; }
.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
}

.timer-time {
  font-family: var(--font-mono);
  font-size: var(--fs-48);
  font-weight: var(--fw-300);
  letter-spacing: 0.08em;
  color: var(--text-0);
  line-height: 1;
}

.timer-mode-name {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
}

.timer-sub {
  font-size: var(--fs-12);
  color: var(--text-3);
}

/* Timer controls */
.timer-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.timer-ctrl-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--r-full);
  background: var(--void-3);
  border: 1px solid var(--rim-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
}
.timer-ctrl-btn:hover {
  background: var(--void-4);
  border-color: var(--rim-2);
  color: var(--text-1);
}
.timer-ctrl-btn:active { transform: scale(0.9); }

.timer-play-btn {
  width: 60px;
  height: 60px;
  border-radius: var(--r-full);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
  box-shadow: 0 0 28px rgba(0,212,170,0.3);
  border: none;
}
.timer-play-btn:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 40px rgba(0,212,170,0.5);
  transform: scale(1.06);
}
.timer-play-btn:active { transform: scale(0.94); }
.timer-play-btn.playing {
  background: rgba(239,68,68,0.9);
  box-shadow: 0 0 28px rgba(239,68,68,0.3);
}
.timer-play-btn.playing:hover {
  background: var(--red);
  box-shadow: 0 0 40px rgba(239,68,68,0.5);
}

/* Focus stats */
.focus-stats-row {
  display: flex;
  gap: var(--sp-5);
  justify-content: center;
}
.focus-stat { text-align: center; }
.focus-stat-val {
  font-family: var(--font-display);
  font-size: var(--fs-24);
  font-weight: var(--fw-700);
  letter-spacing: -0.04em;
  color: var(--accent);
  display: block;
  line-height: 1;
}
.focus-stat-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  margin-top: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Focus side panel */
.focus-side { display: flex; flex-direction: column; gap: var(--sp-4); }

.focus-task-display { margin: var(--sp-2) 0 var(--sp-3); }
.focus-task-name {
  font-size: var(--fs-14);
  font-weight: var(--fw-500);
  color: var(--text-1);
  line-height: 1.4;
}
.focus-task-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  margin-top: var(--sp-1);
}

.focus-task-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  max-height: 200px;
  overflow-y: auto;
}
.focus-task-pick-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-8);
  cursor: pointer;
  transition: background var(--t-fast);
  font-size: var(--fs-12);
  color: var(--text-2);
  border: 1px solid transparent;
}
.focus-task-pick-item:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.focus-task-pick-item.selected {
  background: var(--accent-deep);
  color: var(--accent);
  border-color: rgba(0,212,170,0.2);
}

/* Schedule list */
.schedule-list { display: flex; flex-direction: column; gap: 2px; }
.schedule-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-8);
  transition: background var(--t-fast);
}
.schedule-item.now {
  background: rgba(0,212,170,0.04);
}
.schedule-item.past { opacity: 0.4; }
.schedule-time {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  width: 38px;
  flex-shrink: 0;
}
.schedule-dot {
  width: 2px;
  height: 28px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.schedule-info { flex: 1; min-width: 0; }
.schedule-title-text {
  font-size: var(--fs-12);
  font-weight: var(--fw-500);
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-item.now .schedule-title-text { color: var(--accent); }
.schedule-dur {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  margin-top: 1px;
}

/* ════════════════════════════════════════════════════════════════
   24. HABITS VIEW
════════════════════════════════════════════════════════════════ */
.habits-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--sp-5);
  align-items: start;
}

.habits-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.habit-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--void-3);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-12);
  cursor: pointer;
  transition: all var(--t-base) var(--ease-io);
  position: relative;
  overflow: hidden;
}
.habit-item:hover { border-color: var(--rim-1); background: var(--void-4); }
.habit-item:active { transform: scale(0.995); }
.habit-item.done { border-color: rgba(0,212,170,0.12); }
.habit-item.done .habit-name { opacity: 0.5; text-decoration: line-through; }

.habit-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--rim-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-spring);
  background: transparent;
}
.habit-item.done .habit-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,212,170,0.3);
}
.habit-checkbox svg { width: 12px; height: 12px; color: #000; opacity: 0; transition: opacity var(--t-fast); }
.habit-item.done .habit-checkbox svg { opacity: 1; }

.habit-emoji { font-size: 22px; flex-shrink: 0; width: 28px; text-align: center; }

.habit-info { flex: 1; min-width: 0; }
.habit-name { font-size: var(--fs-14); font-weight: var(--fw-500); color: var(--text-0); }
.habit-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: 3px;
}
.habit-meta-text { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); }
.habit-streak-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--amber);
}
.habit-streak-badge svg { width: 10px; height: 10px; fill: var(--amber); }

.habit-progress-mini {
  width: 72px;
  flex-shrink: 0;
}
.habit-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.habit-progress-pct { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); }

/* Donut */
.donut-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--sp-3) 0;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.donut-val {
  font-family: var(--font-display);
  font-size: var(--fs-24);
  font-weight: var(--fw-700);
  letter-spacing: -0.04em;
  color: var(--text-0);
  line-height: 1;
}
.donut-sub { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); margin-top: 2px; }

.badge-row { display: flex; justify-content: center; gap: var(--sp-2); flex-wrap: wrap; }

/* Streak leaders */
.streak-leader-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--rim-0);
}
.streak-leader-row:last-child { border-bottom: none; }
.streak-leader-emoji { font-size: 16px; flex-shrink: 0; }
.streak-leader-name { font-size: var(--fs-12); font-weight: var(--fw-500); flex: 1; color: var(--text-1); }
.streak-leader-val {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: var(--fw-700);
  letter-spacing: -0.04em;
  color: var(--accent);
}

/* 7-day bar chart */
.bar-chart-7d {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-1);
  height: 56px;
  margin-top: var(--sp-2);
}
.bar-7d {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.bar-7d-fill {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  background: rgba(0,212,170,0.4);
  transition: height var(--t-slow) var(--ease-expo);
}
.bar-7d-fill.today { background: var(--accent); }
.bar-7d-label { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); }

/* ════════════════════════════════════════════════════════════════
   25. TASKS VIEW
════════════════════════════════════════════════════════════════ */
.tasks-layout { display: grid; grid-template-columns: 1fr 280px; gap: var(--sp-5); align-items: start; }
.tasks-stats-row { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.task-stat { display: flex; align-items: center; gap: var(--sp-2); }
.task-stat-num { font-family: var(--font-display); font-size: var(--fs-20); font-weight: var(--fw-700); letter-spacing: -0.04em; }
.task-stat-label { font-size: var(--fs-12); color: var(--text-3); }

.task-filter-row { display: flex; gap: var(--sp-1); }

.task-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--void-3);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-10);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
}
.task-item:hover { border-color: var(--rim-1); background: var(--void-4); }
.task-item:active { transform: scale(0.995); }
.task-item.done { opacity: 0.4; }
.task-item.done .task-name { text-decoration: line-through; }

.task-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--rim-3);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-spring);
  background: transparent;
}
.task-item.done .task-check {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0,212,170,0.2);
}
.task-check svg { width: 10px; height: 10px; color: #000; opacity: 0; transition: opacity var(--t-fast); }
.task-item.done .task-check svg { opacity: 1; }

.task-body { flex: 1; min-width: 0; }
.task-name { font-size: var(--fs-13); font-weight: var(--fw-500); color: var(--text-1); line-height: 1.4; }
.task-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 4px;
  flex-wrap: wrap;
}
.task-notes { font-size: var(--fs-12); color: var(--text-3); margin-top: 3px; line-height: 1.4; }

.priority-pill {
  height: 16px;
  padding: 0 6px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: var(--fw-600);
  display: inline-flex;
  align-items: center;
}
.priority-high   { background: rgba(239,68,68,0.1); color: var(--red); }
.priority-medium { background: rgba(245,158,11,0.1); color: var(--amber); }
.priority-low    { background: rgba(255,255,255,0.05); color: var(--text-3); }

.task-domain-pill {
  height: 16px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.05);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
}

.task-due {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
}
.task-due.overdue { color: var(--red); }

/* Priority matrix */
.priority-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.matrix-q {
  padding: var(--sp-3);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-8);
  min-height: 80px;
}
.matrix-q[data-q="1"] { border-color: rgba(239,68,68,0.15); }
.matrix-q[data-q="2"] { border-color: rgba(245,158,11,0.12); }
.matrix-q-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  margin-bottom: var(--sp-2);
  letter-spacing: 0.04em;
}
.matrix-q-list { display: flex; flex-direction: column; gap: 4px; }
.matrix-task-item {
  font-size: var(--fs-11);
  color: var(--text-2);
  padding: 3px 0;
  border-bottom: 1px solid var(--rim-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.matrix-task-item:last-child { border-bottom: none; }

/* ════════════════════════════════════════════════════════════════
   26. VISION VIEW
════════════════════════════════════════════════════════════════ */
.vision-insight-text {
  font-size: var(--fs-14);
  color: var(--text-1);
  line-height: 1.7;
}

.vision-layer-card {
  background: var(--void-3);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-12);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  transition: border-color var(--t-base);
}
.vision-layer-card.expanded { border-color: var(--rim-1); }

.vision-layer-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  transition: background var(--t-fast);
  user-select: none;
}
.vision-layer-header:hover { background: rgba(255,255,255,0.02); }
.vision-layer-header:active { background: rgba(255,255,255,0.04); }

.vision-layer-icon { font-size: 20px; flex-shrink: 0; }
.vision-layer-text { flex: 1; }
.vision-layer-name { font-size: var(--fs-15); font-weight: var(--fw-600); color: var(--text-0); }
.vision-layer-sub  { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); margin-top: 2px; }
.vision-layer-chevron {
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform var(--t-base) var(--ease-io);
}
.vision-layer-card.expanded .vision-layer-chevron { transform: rotate(180deg); }

.vision-layer-body {
  display: none;
  padding: 0 var(--sp-5) var(--sp-5);
}
.vision-layer-card.expanded .vision-layer-body {
  display: block;
  animation: slideDown 200ms var(--ease-out) both;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.goal-row {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--rim-0);
}
.goal-row:last-child { border-bottom: none; }
.goal-text-line { font-size: var(--fs-13); color: var(--text-1); margin-bottom: var(--sp-2); line-height: 1.5; }
.goal-progress-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.goal-pct { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); flex-shrink: 0; width: 32px; text-align: right; }

/* ════════════════════════════════════════════════════════════════
   27. FINANCE VIEW
════════════════════════════════════════════════════════════════ */
.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--rim-0);
  border-radius: var(--r-12);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}

.fin-summary-item {
  background: var(--void-3);
  padding: var(--sp-4) var(--sp-4);
  text-align: center;
  transition: background var(--t-fast);
}
.fin-summary-item:hover { background: var(--void-4); }

.fin-summary-label { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--sp-2); }
.fin-summary-val {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: var(--fw-700);
  letter-spacing: -0.03em;
  line-height: 1;
}

.finance-layout { display: grid; grid-template-columns: 1fr 280px; gap: var(--sp-5); }
.finance-side   { display: flex; flex-direction: column; gap: var(--sp-4); }

.fin-tx-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--rim-0);
  transition: background var(--t-fast);
}
.fin-tx-item:last-child { border-bottom: none; }
.fin-tx-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.fin-tx-info { flex: 1; min-width: 0; }
.fin-tx-name { font-size: var(--fs-13); font-weight: var(--fw-500); color: var(--text-1); }
.fin-tx-cat  { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); margin-top: 1px; }
.fin-tx-amount { font-family: var(--font-mono); font-size: var(--fs-13); font-weight: var(--fw-600); flex-shrink: 0; }
.fin-tx-amount.income  { color: var(--green); }
.fin-tx-amount.expense { color: var(--text-1); }
.fin-tx-amount.invest  { color: var(--violet); }

.budget-item { margin-bottom: var(--sp-3); }
.budget-item-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.budget-item-name  { font-size: var(--fs-12); color: var(--text-2); }
.budget-item-amount { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); }

.fin-goal-item { margin-bottom: var(--sp-4); }
.fin-goal-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.fin-goal-name { font-size: var(--fs-13); font-weight: var(--fw-500); color: var(--text-1); }
.fin-goal-pct  { font-family: var(--font-mono); font-size: var(--fs-11); }
.fin-goal-detail { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); margin-top: 4px; }

/* Sparkline */
.sparkline-wrap {
  height: 64px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-top: var(--sp-3);
}
.spark-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: rgba(0,212,170,0.3);
  min-height: 4px;
  transition: background var(--t-fast), height var(--t-slow);
}
.spark-bar:hover { background: var(--accent); }
.spark-bar.today { background: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   28. HEALTH VIEW
════════════════════════════════════════════════════════════════ */
.health-layout { display: flex; flex-direction: column; gap: var(--sp-5); }

.health-top-row { display: grid; grid-template-columns: auto 1fr 1fr; gap: var(--sp-5); }

.rings-svg { display: block; margin: var(--sp-2) auto; }
.rings-legend { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.rl-item { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-12); color: var(--text-2); }
.rl-item span { width: 8px; height: 8px; border-radius: var(--r-full); flex-shrink: 0; }

.health-vitals-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--rim-0);
}
.health-vitals-item:last-child { border-bottom: none; }
.hv-dot { width: 6px; height: 6px; border-radius: var(--r-full); flex-shrink: 0; margin-right: var(--sp-2); }
.hv-name  { font-size: var(--fs-12); color: var(--text-2); flex: 1; }
.hv-val   { font-family: var(--font-mono); font-size: var(--fs-12); font-weight: var(--fw-500); color: var(--text-0); }

.sleep-display { text-align: center; margin: var(--sp-4) 0; }
.sleep-num  { font-family: var(--font-display); font-size: var(--fs-48); font-weight: var(--fw-700); letter-spacing: -0.06em; color: var(--text-0); line-height: 1; }
.sleep-unit { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); margin-top: var(--sp-1); letter-spacing: 0.1em; }
.sleep-quality { font-size: var(--fs-12); color: var(--green); margin-top: var(--sp-1); }

.sleep-stages-chart { margin-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.sleep-stage-row { display: flex; flex-direction: column; gap: 4px; }
.sleep-stage-head { display: flex; justify-content: space-between; }
.sleep-stage-name { font-size: var(--fs-11); color: var(--text-3); }
.sleep-stage-val  { font-family: var(--font-mono); font-size: var(--fs-11); }

.health-bottom-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-5); }

.nutrition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.nutrition-item {
  padding: var(--sp-3);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-8);
}
.nutrition-item-head { display: flex; justify-content: space-between; margin-bottom: var(--sp-2); }
.nutrition-item-name { font-size: var(--fs-12); color: var(--text-2); }
.nutrition-item-val  { font-family: var(--font-mono); font-size: var(--fs-11); }

.training-log-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--rim-0);
  font-size: var(--fs-12);
}
.training-log-item:last-child { border-bottom: none; }
.tl-dot { width: 5px; height: 5px; border-radius: var(--r-full); flex-shrink: 0; }
.tl-name { flex: 1; color: var(--text-2); }

.body-comp-item { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-bottom: 1px solid var(--rim-0); }
.body-comp-item:last-child { border-bottom: none; }
.bc-name { font-size: var(--fs-12); color: var(--text-2); }
.bc-val  { font-family: var(--font-mono); font-size: var(--fs-12); font-weight: var(--fw-500); color: var(--text-1); }

/* ════════════════════════════════════════════════════════════════
   29. MIND VIEW
════════════════════════════════════════════════════════════════ */
.mind-layout { display: grid; grid-template-columns: 1fr 280px; gap: var(--sp-5); }

.mood-week { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.mood-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}
.mood-emoji { font-size: 22px; cursor: pointer; transition: transform var(--t-fast); }
.mood-emoji:hover { transform: scale(1.2); }
.mood-day-label { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); }

.journal-textarea {
  width: 100%;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--rim-1);
  border-radius: var(--r-8);
  padding: var(--sp-4);
  color: var(--text-1);
  font-size: var(--fs-14);
  line-height: 1.8;
  font-family: var(--font-sans);
  resize: none;
  min-height: 200px;
  transition: border-color var(--t-fast);
  margin: var(--sp-3) 0;
}
.journal-textarea:focus {
  border-color: rgba(0,212,170,0.3);
  outline: none;
  background: rgba(255,255,255,0.03);
}
.journal-textarea::placeholder { color: var(--text-3); line-height: 1.8; }

.journal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.journal-count { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); }
.journal-date  { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); }

.cbt-tool { display: flex; flex-direction: column; gap: var(--sp-3); }
.cbt-result {
  background: rgba(0,212,170,0.04);
  border: 1px solid rgba(0,212,170,0.12);
  border-radius: var(--r-8);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-13);
  color: var(--text-1);
  line-height: 1.6;
  display: none;
}
.cbt-result.visible { display: block; }

.gratitude-item { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rim-0); }
.gratitude-item:last-child { border-bottom: none; }
.gratitude-item::before { content: '✦'; color: var(--amber); font-size: 12px; flex-shrink: 0; margin-top: 1px; }
.gratitude-text { font-size: var(--fs-12); color: var(--text-2); line-height: 1.5; }

/* Breathing tool */
.breathing-tool { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); margin-top: var(--sp-3); }
.breath-circle {
  width: 100px;
  height: 100px;
  border-radius: var(--r-full);
  border: 2px solid rgba(0,212,170,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 4s var(--ease-io);
  background: rgba(0,212,170,0.04);
}
.breath-circle.inhale  { transform: scale(1.6); background: rgba(0,212,170,0.1); border-color: rgba(0,212,170,0.4); }
.breath-circle.hold    { border-color: rgba(245,158,11,0.4); }
.breath-circle.exhale  { transform: scale(0.85); background: transparent; }
.breath-text { font-size: var(--fs-12); color: var(--text-3); text-align: center; }
.breath-instructions { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); text-align: center; }

/* ════════════════════════════════════════════════════════════════
   30. KNOWLEDGE VIEW
════════════════════════════════════════════════════════════════ */
.knowledge-layout { display: grid; grid-template-columns: 1fr 260px; gap: var(--sp-5); }
.knowledge-side   { display: flex; flex-direction: column; gap: var(--sp-4); }

.reading-filter { display: flex; gap: 2px; }

.book-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--rim-0);
}
.book-item:last-child { border-bottom: none; }

.book-cover {
  width: 44px;
  height: 58px;
  border-radius: var(--r-6);
  background: var(--void-5);
  border: 1px solid var(--rim-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.book-info { flex: 1; min-width: 0; }
.book-title  { font-size: var(--fs-14); font-weight: var(--fw-600); color: var(--text-0); margin-bottom: 3px; }
.book-author { font-size: var(--fs-12); color: var(--text-3); margin-bottom: var(--sp-2); }
.book-status-badge { margin-bottom: var(--sp-2); }
.book-progress-wrap { max-width: 200px; margin-bottom: 4px; }
.book-progress-label { display: flex; justify-content: space-between; margin-bottom: 3px; }
.book-progress-pct { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.book-note { font-size: var(--fs-12); color: var(--text-3); font-style: italic; line-height: 1.5; margin-top: var(--sp-1); }

.reading-stat-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-bottom: 1px solid var(--rim-0); }
.reading-stat-row:last-child { border-bottom: none; }
.reading-stat-name { font-size: var(--fs-12); color: var(--text-2); }
.reading-stat-val  { font-family: var(--font-display); font-size: var(--fs-18); font-weight: var(--fw-700); letter-spacing: -0.04em; }

.insight-item { padding: var(--sp-2) 0; border-bottom: 1px solid var(--rim-0); }
.insight-item:last-child { border-bottom: none; }
.insight-item-text { font-size: var(--fs-12); color: var(--text-2); font-style: italic; line-height: 1.5; }
.insight-item-source { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); margin-top: 3px; }

.flashcard-item { padding: var(--sp-2) var(--sp-3); background: rgba(255,255,255,0.02); border: 1px solid var(--rim-0); border-radius: var(--r-8); margin-bottom: var(--sp-2); cursor: pointer; transition: all var(--t-fast); }
.flashcard-item:hover { border-color: var(--rim-1); }
.fc-question { font-size: var(--fs-12); color: var(--text-2); }
.fc-source   { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════════
   31. RELATIONSHIPS VIEW
════════════════════════════════════════════════════════════════ */
.relationships-layout { display: grid; grid-template-columns: 1fr 260px; gap: var(--sp-5); }
.rel-main { }
.rel-side { display: flex; flex-direction: column; gap: var(--sp-4); }

.rel-filter { display: flex; gap: 2px; }

.person-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--void-3);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-10);
  margin-bottom: var(--sp-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.person-item:hover { border-color: var(--rim-1); background: var(--void-4); }

.person-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 1px solid rgba(0,212,170,0.15);
}

.person-info { flex: 1; min-width: 0; }
.person-name { font-size: var(--fs-14); font-weight: var(--fw-500); color: var(--text-1); }
.person-role { font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }
.person-meta { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); margin-top: 2px; }

.person-badges { display: flex; gap: var(--sp-1); flex-shrink: 0; flex-wrap: wrap; }

.rel-due-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rim-0); }
.rel-due-item:last-child { border-bottom: none; }
.rel-due-avatar { width: 28px; height: 28px; border-radius: var(--r-full); background: var(--void-5); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.rel-due-name   { font-size: var(--fs-12); font-weight: var(--fw-500); flex: 1; color: var(--text-1); }
.rel-due-days   { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--red); flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════
   32. ANALYTICS VIEW
════════════════════════════════════════════════════════════════ */
.analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }

.analytics-domain-card {
  background: var(--void-3);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-12);
  padding: var(--sp-5);
  transition: border-color var(--t-base), transform var(--t-base);
}
.analytics-domain-card:hover { border-color: var(--rim-1); transform: translateY(-1px); }

.adc-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.adc-icon { font-size: 22px; }
.adc-name { font-size: var(--fs-14); font-weight: var(--fw-600); flex: 1; }
.adc-score { font-family: var(--font-display); font-size: var(--fs-24); font-weight: var(--fw-700); letter-spacing: -0.04em; }

.mini-spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: var(--sp-3); }
.mini-spark-bar {
  flex: 1;
  border-radius: 1px;
  opacity: 0.4;
  min-height: 3px;
  transition: opacity var(--t-fast);
}
.mini-spark-bar:hover { opacity: 0.8; }

/* ════════════════════════════════════════════════════════════════
   33. REVIEW VIEW
════════════════════════════════════════════════════════════════ */
.review-layout { display: grid; grid-template-columns: 1fr 260px; gap: var(--sp-5); }

.review-q {
  background: var(--void-3);
  border: 1px solid var(--rim-0);
  border-radius: var(--r-12);
  padding: var(--sp-5);
  margin-bottom: var(--sp-3);
}

.review-q-num  { font-family: var(--font-mono); font-size: var(--fs-10); color: var(--text-3); margin-bottom: var(--sp-2); letter-spacing: 0.08em; }
.review-q-text { font-size: var(--fs-14); font-weight: var(--fw-500); color: var(--text-1); margin-bottom: var(--sp-3); line-height: 1.5; }

.review-history-item { padding: var(--sp-2) 0; border-bottom: 1px solid var(--rim-0); }
.review-history-item:last-child { border-bottom: none; }
.rh-title  { font-size: var(--fs-12); color: var(--text-2); }
.rh-status { font-family: var(--font-mono); font-size: 10px; color: var(--green); margin-top: 2px; }

.review-patterns-text { font-size: var(--fs-13); color: var(--text-2); line-height: 1.7; }

/* ════════════════════════════════════════════════════════════════
   34. MINI BAR CHART
════════════════════════════════════════════════════════════════ */
.mini-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  margin-top: var(--sp-3);
}
.mini-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  justify-content: flex-end;
}
.mini-bar-fill {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  transition: height var(--t-slow) var(--ease-expo);
}
.mini-bar-label { font-family: var(--font-mono); font-size: 8px; color: var(--text-3); }

/* ════════════════════════════════════════════════════════════════
   35. PERFORMANCE OVERLAY
════════════════════════════════════════════════════════════════ */
#perf-overlay {
  position: fixed;
  top: var(--sp-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-full);
  padding: var(--sp-1) var(--sp-4);
  display: none;
  gap: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  color: var(--text-2);
  pointer-events: none;
}
#perf-overlay.visible { display: flex; }
.perf-item { display: flex; align-items: center; gap: var(--sp-1); }
.perf-item strong { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   36. UTILITY CLASSES
════════════════════════════════════════════════════════════════ */
.mt-4  { margin-top: var(--sp-1); }
.mt-8  { margin-top: var(--sp-2); }
.mt-12 { margin-top: var(--sp-3); }
.mt-16 { margin-top: var(--sp-4); }
.mb-4  { margin-bottom: var(--sp-1); }
.mb-8  { margin-bottom: var(--sp-2); }
.mb-12 { margin-bottom: var(--sp-3); }
.mb-16 { margin-bottom: var(--sp-4); }

.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-amber   { color: var(--amber); }
.text-red     { color: var(--red); }
.text-violet  { color: var(--violet); }
.text-muted   { color: var(--text-3); }
.text-secondary { color: var(--text-2); }

.font-mono    { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

.hidden      { display: none !important; }
.sr-only     { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }

.separator { height: 1px; background: var(--rim-0); margin: var(--sp-4) 0; }
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: var(--sp-2); }
.gap-3  { gap: var(--sp-3); }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* Fade in animation for dynamic content */
.fade-in {
  animation: fadeIn 250ms var(--ease-out) both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger children */
.stagger > *:nth-child(1)  { animation-delay: 0ms; }
.stagger > *:nth-child(2)  { animation-delay: 30ms; }
.stagger > *:nth-child(3)  { animation-delay: 60ms; }
.stagger > *:nth-child(4)  { animation-delay: 90ms; }
.stagger > *:nth-child(5)  { animation-delay: 120ms; }
.stagger > *:nth-child(6)  { animation-delay: 150ms; }
.stagger > *:nth-child(7)  { animation-delay: 180ms; }
.stagger > *:nth-child(8)  { animation-delay: 210ms; }
.stagger > *:nth-child(9)  { animation-delay: 240ms; }
.stagger > *:nth-child(10) { animation-delay: 270ms; }

/* Focus mode (F key) */
body.focus-mode #sidebar { opacity: 0.2; pointer-events: none; transition: opacity var(--t-slow); }
body.focus-mode #topbar  { opacity: 0.2; pointer-events: none; transition: opacity var(--t-slow); }
body.focus-mode #sidebar:hover,
body.focus-mode #topbar:hover { opacity: 1; pointer-events: all; }

/* ════════════════════════════════════════════════════════════════
   37. RESPONSIVE
════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-row  { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .health-top-row { grid-template-columns: 1fr 1fr; }
  .health-top-row .health-rings-card { grid-column: 1/-1; }
  .health-bottom-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .focus-layout { grid-template-columns: 1fr; }
  .habits-layout { grid-template-columns: 1fr; }
  .tasks-layout { grid-template-columns: 1fr; }
  .vision-layout { grid-template-columns: 1fr; }
  .finance-layout { grid-template-columns: 1fr; }
  .knowledge-layout { grid-template-columns: 1fr; }
  .relationships-layout { grid-template-columns: 1fr; }
  .analytics-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
  .review-layout { grid-template-columns: 1fr; }
  .mind-layout { grid-template-columns: 1fr; }
  .health-bottom-row { grid-template-columns: 1fr; }
  .finance-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: 1; }
  .capture-meta-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* Show mobile nav, hide sidebar from layout */
  #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform var(--t-slow) var(--ease-io);
    min-width: var(--sidebar-w) !important;
    width: var(--sidebar-w) !important;
    pointer-events: none;
    touch-action: pan-y;
  }
  #sidebar.mob-open {
    transform: translateX(0);
    pointer-events: all;
  }
  #sidebar.mob-open .nav-btn,
  #sidebar.mob-open .sb-brand,
  #sidebar.mob-open .sb-collapse-btn,
  #sidebar.mob-open .sb-footer,
  #sidebar.mob-open .sb-footer a {
    pointer-events: all;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    cursor: pointer;
  }
  #sidebar.mob-open .sb-nav {
    pointer-events: all;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #mob-overlay { display: block; pointer-events: none; }
  #mob-nav { display: flex; }

  .view {
    padding: var(--sp-4) var(--sp-4) calc(var(--mob-nav-h) + var(--sp-8));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
  .view-title { font-size: var(--fs-24); }

  #topbar { padding: 0 var(--sp-4); }
  .topbar-center { display: none; }
  .clock-time { font-size: var(--fs-13); }
  .topbar-capture-btn span { display: none; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .analytics-kpi-row { grid-template-columns: repeat(2, 1fr); }

  .capture-types { grid-template-columns: repeat(3, 1fr); }
  .capture-meta-row { grid-template-columns: 1fr; }

  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
  .modal { max-height: 95vh; border-radius: var(--r-16) var(--r-16) 0 0; }
  .overlay { align-items: flex-end; padding: 0; }

  .health-top-row { grid-template-columns: 1fr; }
  .finance-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .timer-time { font-size: var(--fs-40); }
  
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
  .kpi-val  { font-size: var(--fs-24); }
  .capture-types { grid-template-columns: repeat(3, 1fr); }
  .focus-modes { gap: var(--sp-1); }
  .focus-mode-btn { min-width: 60px; padding: var(--sp-2); }
  .fm-name { font-size: var(--fs-11); }
  #topbar { padding: 0 var(--sp-3); }
  #topbar-title { font-size: var(--fs-16); }
  .timer-time { font-size: var(--fs-32); }
}

/* ════════════════════════════════════════════════════════════════
   38. PRINT STYLES
════════════════════════════════════════════════════════════════ */

/* ── MOBILE TOUCH PERFORMANCE ── */
button, a, [role="button"], .nav-btn, .habit-item, .task-item,
.focus-mode-btn, .timer-play-btn, .timer-ctrl-btn, .capture-type-btn,
.card.interactive, .filter-btn, .period-btn, .mob-nav-btn,
.vision-layer-header, .book-item, .person-item, .mob-capture-fab,
.topbar-capture-btn, .topbar-icon-btn, .topbar-menu-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  cursor: pointer;
}
/* Prevent text selection on interactive mobile elements */
.nav-btn, .mob-nav-btn, .btn, .habit-item, .task-item {
  -webkit-user-select: none;
  user-select: none;
}
/* iOS safe area for bottom nav */
#mob-nav {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
}
/* Ensure content doesn't go under fixed topbar on iOS */
#content {
  -webkit-overflow-scrolling: touch;
}


/* ════════════════════════════════════════════════════════════════
   CRUD ACTION BUTTONS (Edit / Delete)
   Premium icons, minimal footprint, never intrusive
════════════════════════════════════════════════════════════════ */

/* Row action button container — appears on hover */
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-io);
  flex-shrink: 0;
}
.habit-item:hover .row-actions,
.task-item:hover .row-actions,
.goal-row:hover .row-actions,
.book-item:hover .row-actions,
.person-item:hover .row-actions { opacity: 1; }

/* Always show on touch devices (no hover) */
@media (hover: none) {
  .row-actions { opacity: 1; }
}

/* Individual action icon button */
.action-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-6);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Edit button — subtle teal */
.action-btn.edit {
  color: var(--text-3);
}
.action-btn.edit:hover, .action-btn.edit:focus-visible {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(0,212,170,0.2);
}
.action-btn.edit:active { transform: scale(0.88); }

/* Delete button — subtle red */
.action-btn.delete {
  color: var(--text-3);
}
.action-btn.delete:hover, .action-btn.delete:focus-visible {
  color: var(--red);
  background: var(--red-dim);
  border-color: rgba(239,68,68,0.2);
}
.action-btn.delete:active { transform: scale(0.88); }

.action-btn svg { width: 14px; height: 14px; pointer-events: none; }

/* Make habit/task/goal rows position:relative so actions can sit inside */
.habit-item { position: relative; }
.task-item  { position: relative; }
.goal-row   { position: relative; }

/* Compact progress row on habit when actions visible */
.habit-progress-mini { transition: opacity var(--t-fast); }
.habit-item:hover .habit-progress-mini { opacity: 0.6; }

/* ════════════════════════════════════════════════════════════════
   CONFIRM DELETE MODAL — extra polish
════════════════════════════════════════════════════════════════ */
.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.25);
  font-weight: var(--fw-600);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.22);
  border-color: rgba(239,68,68,0.4);
  box-shadow: 0 0 20px rgba(239,68,68,0.15);
}
.btn-danger:active { transform: scale(0.95); }

/* ════════════════════════════════════════════════════════════════
   AUTH STYLES (kept minimal for future use)
════════════════════════════════════════════════════════════════ */
.auth-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rim-1);
  border-radius: var(--r-8);
  padding: 3px;
  margin-bottom: var(--sp-5);
}
.auth-tab {
  flex: 1;
  height: 30px;
  border-radius: 6px;
  font-size: var(--fs-12);
  font-weight: var(--fw-500);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-io);
  touch-action: manipulation;
}
.auth-tab:hover { color: var(--text-1); }
.auth-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,212,170,0.2);
}
.auth-section { display: none; }
.auth-section.active { display: block; }

.auth-link {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: var(--fs-12);
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--t-fast);
  background: none;
  border: none;
  width: 100%;
  touch-action: manipulation;
}
.auth-link:hover { color: var(--accent); }

.auth-terms {
  font-size: var(--fs-11);
  color: var(--text-3);
  text-align: center;
  line-height: 1.6;
  padding: 10px 8px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--r-8);
  border: 1px solid var(--rim-0);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
  color: var(--text-3);
  font-size: var(--fs-11);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rim-0);
}

.social-auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 38px;
  border-radius: var(--r-8);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rim-1);
  font-size: var(--fs-13);
  font-weight: var(--fw-500);
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--t-fast);
  touch-action: manipulation;
}
.social-btn:hover { background: rgba(255,255,255,0.07); border-color: var(--rim-2); }
.social-btn:active { transform: scale(0.96); }

.guest-info {
  text-align: center;
  padding: var(--sp-4) 0 var(--sp-5);
}
.guest-icon { font-size: 40px; margin-bottom: var(--sp-3); }
.guest-title { font-family: var(--font-display); font-size: var(--fs-18); font-weight: var(--fw-700); letter-spacing: -0.025em; color: var(--text-0); margin-bottom: var(--sp-2); }
.guest-desc  { font-size: var(--fs-13); color: var(--text-2); line-height: 1.5; }

.guest-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--sp-2); }
.guest-feature {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-13);
  color: var(--text-1);
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--r-8);
}
.gf-check {
  color: var(--green);
  font-weight: var(--fw-700);
  flex-shrink: 0;
  width: 16px;
}


/* ════════════════════════════════════════════════════════════════
   PWA INSTALL PROMPT — Desktop + Mobile
════════════════════════════════════════════════════════════════ */
#pwa-install-prompt {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 3000;
  width: calc(100% - 48px);
  max-width: 480px;
  background: var(--void-5);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-16);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,170,0.08);
  pointer-events: none;
  opacity: 0;
  transition: transform 500ms cubic-bezier(0.34,1.56,0.64,1),
              opacity 400ms var(--ease-out);
  will-change: transform, opacity;
}
#pwa-install-prompt.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}
/* On mobile, align to bottom nav */
@media (max-width: 768px) {
  #pwa-install-prompt {
    bottom: calc(var(--mob-nav-h) + 12px);
    width: calc(100% - 32px);
    border-radius: var(--r-12);
  }
}

.pwa-prompt-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.pwa-prompt-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0,212,170,0.15) 0%, rgba(0,212,170,0.05) 100%);
  border: 1px solid rgba(0,212,170,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.pwa-prompt-text {
  flex: 1;
  min-width: 0;
}
.pwa-prompt-title {
  font-family: var(--font-display);
  font-size: var(--fs-14);
  font-weight: var(--fw-700);
  letter-spacing: -0.02em;
  color: var(--text-0);
  line-height: 1.2;
}
.pwa-prompt-sub {
  font-size: var(--fs-11);
  color: var(--text-3);
  margin-top: 3px;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.pwa-prompt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-btn-install {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-8);
  background: var(--accent);
  color: #000;
  font-size: var(--fs-13);
  font-weight: var(--fw-700);
  cursor: pointer;
  border: none;
  transition: all var(--t-fast) var(--ease-io);
  touch-action: manipulation;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(0,212,170,0.25);
}
.pwa-btn-install:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 24px rgba(0,212,170,0.4);
  transform: scale(1.03);
}
.pwa-btn-install:active { transform: scale(0.96); }

.pwa-btn-dismiss {
  width: 28px;
  height: 28px;
  border-radius: var(--r-6);
  background: transparent;
  border: 1px solid var(--rim-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
  touch-action: manipulation;
  flex-shrink: 0;
}
.pwa-btn-dismiss:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.pwa-btn-dismiss:active { transform: scale(0.9); }

/* ── iOS INSTALL HINT ── */
#ios-install-hint {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 3000;
  width: calc(100% - 32px);
  max-width: 360px;
  background: var(--void-5);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 450ms cubic-bezier(0.34,1.56,0.64,1), opacity 350ms var(--ease-out);
}
#ios-install-hint.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.ios-hint-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px;
}
.ios-hint-icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}
.ios-hint-text { flex: 1; }
.ios-hint-title {
  font-size: var(--fs-13);
  font-weight: var(--fw-700);
  color: var(--text-0);
  margin-bottom: 4px;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.ios-hint-steps {
  font-size: var(--fs-12);
  color: var(--text-2);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.ios-hint-steps strong { color: var(--accent); font-weight: var(--fw-600); }
.ios-share-icon {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  vertical-align: middle;
}
.ios-hint-close {
  width: 24px;
  height: 24px;
  border-radius: var(--r-6);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t-fast);
  touch-action: manipulation;
}
.ios-hint-close:hover { color: var(--text-1); }

/* Down arrow pointing to browser bottom bar */
.ios-hint-arrow {
  width: 14px;
  height: 14px;
  background: var(--void-5);
  border-right: 1px solid var(--rim-2);
  border-bottom: 1px solid var(--rim-2);
  transform: rotate(45deg) translateX(-50%);
  position: absolute;
  bottom: -8px;
  left: 50%;
  margin-left: -7px;
}

@media print {
  #boot, #mob-overlay, #mob-nav, #perf-overlay, #toast-container { display: none !important; }
  #app { position: static; opacity: 1; visibility: visible; }
  #sidebar { display: none; }
  #main { width: 100%; }
  .view { position: static; opacity: 1; visibility: visible; transform: none; padding: var(--sp-4); }
  .view:not(.active) { display: none; }
  .card { break-inside: avoid; }
  body { background: white; color: black; }
}

/* ════════════════════════════════════════════════════════════════
   39. REDUCED MOTION
════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   40. HIGH CONTRAST / FORCED COLORS
════════════════════════════════════════════════════════════════ */
@media (forced-colors: active) {
  .card { border: 1px solid ButtonText; }
  .btn-accent { background: ButtonText; color: ButtonFace; }
  .nav-btn.active { outline: 2px solid ButtonText; }
}

/* ════════════════════════════════════════════════════════════════
   41. PREMIUM OVERRIDES — Elite Refinement Layer
   Surgical enhancements for world-class presentation quality
════════════════════════════════════════════════════════════════ */

/* ── Display font applied to large numerics and view titles ── */
.view-title,
.ring-val,
.timer-time,
.kpi-val,
.sleep-num,
.fin-summary-val {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.view-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 400; /* DM Serif is naturally elegant at 400 */
  line-height: 1.1;
  color: var(--text-0);
}

.view-subtitle {
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: 0.01em;
  margin-top: 3px;
}

/* ── Cards: deeper depth, micro border glow ── */
.card {
  background: var(--void-3);
  border: 1px solid var(--rim-1);
  border-radius: var(--r-16);
  padding: var(--sp-5);
  transition: border-color var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.025) 0%, transparent 60%);
  pointer-events: none;
}

.card:hover {
  border-color: var(--rim-2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* ── KPI cards: number prominence ── */
.kpi-val {
  font-size: var(--fs-32);
  font-weight: 400;
  line-height: 1;
  margin: 6px 0 4px;
}

.kpi-unit {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  font-weight: 400;
  opacity: 0.5;
  margin-left: 2px;
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-2);
}

.kpi-trend {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  margin-top: 4px;
}

/* ── Transaction items: premium list treatment ── */
.fin-tx-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rim-0);
  transition: background var(--t-fast) var(--ease-out);
  border-radius: var(--r-8);
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
}

.fin-tx-item:last-child { border-bottom: none; }

.fin-tx-item:hover {
  background: var(--void-4);
}

.fin-tx-name {
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-0);
  line-height: 1.3;
}

.fin-tx-cat {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  color: var(--text-3);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.fin-tx-amount {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 400;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.fin-tx-amount.income  { color: var(--green); }
.fin-tx-amount.expense { color: var(--text-1); }
.fin-tx-amount.invest  { color: var(--violet); }

/* ── Sidebar brand: serif name treatment ── */
.sb-name {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-0);
}

/* ── Insight text: slightly more editorial ── */
.insight-text {
  font-family: var(--font-display);
  font-size: var(--fs-15);
  font-weight: 400;
  font-style: italic;
  line-height: 1.65;
  color: var(--text-1);
  letter-spacing: 0.01em;
}

/* ── Timer display: larger, more impactful ── */
.timer-time {
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ── Sleep and life score numerics ── */
.sleep-num {
  font-size: var(--fs-56);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.ring-val {
  font-size: var(--fs-32);
  font-weight: 400;
  letter-spacing: -0.03em;
}

/* ── Action buttons on list items: cleaner hit areas ── */
.action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: color var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}

.action-btn:hover {
  background: var(--void-5);
  color: var(--text-1);
}

.action-btn.delete:hover {
  background: var(--red-dim);
  color: var(--red);
}

.action-btn.edit:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Row actions: always visible on finance transactions ── */
.row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out);
}

.fin-tx-item:hover .row-actions,
.fin-tx-item .row-actions[style*="opacity:1"],
.fin-tx-item .row-actions[style*="opacity: 1"] {
  opacity: 1;
}

/* ── Settings sections: refined spacing ── */
.settings-section .field-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ── Modal: elevated, cleaner header ── */
.modal {
  background: var(--void-3);
  border: 1px solid var(--rim-2);
  border-radius: var(--r-20);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
  position: relative;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── Habit row: streak badge uses serif for the number ── */
.habit-streak-num,
.streak-val {
  font-family: var(--font-display);
  font-weight: 400;
}

/* ── Nav badges: sharper, crisper ── */
.nav-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Topbar title ── */
.topbar-title {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── Boot screen: more premium ── */
.boot-version {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.3;
  margin-top: 8px;
}

/* ── Domain score names ── */
.domain-score-name {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--text-1);
}

/* ── Section labels in sidebar ── */
.sb-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 12px 12px 4px;
  font-weight: 600;
}

/* ── Stats in sidebar ── */
.sb-stat-val {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-0);
}

.sb-stat-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Finance summary values ── */
.fin-summary-val {
  font-size: var(--fs-20);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 4px;
}

.fin-summary-label {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Habits card treatment ── */
.habit-row {
  border-radius: var(--r-12);
  transition: background var(--t-fast);
}

.habit-row:hover {
  background: var(--void-4);
}

/* ── Toast: elevated typography ── */
.toast-title {
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text-0);
}

.toast-body {
  font-size: var(--fs-12);
  color: var(--text-2);
  margin-top: 2px;
}

/* ── Buttons: DM Sans weight refinement ── */
.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.btn-accent {
  font-weight: 600;
}

/* ── Scrollbar: ultra thin, refined ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rim-2);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: var(--rim-3); }

/* ── Command palette: editorial style ── */
.cmd-group-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 8px 12px 4px;
}

.cmd-item-label {
  font-size: var(--fs-14);
  font-weight: 500;
}

/* ── Focus stats: serif numbers ── */
.focus-stat-val {
  font-family: var(--font-display);
  font-size: var(--fs-28);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

.focus-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════════
   FIX 1: HORIZONTAL SCROLL — Tasks & Habits sections
   Make filter rows and stats rows swipeable horizontally.
   Prevents content being clipped on narrow mobile screens.
════════════════════════════════════════════════════════════════ */

/* Task filter buttons row — always swipeable, never wraps */
.task-filter-row {
  display: flex;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: var(--sp-1);
}
.task-filter-row::-webkit-scrollbar { display: none; }

/* Ensure filter buttons never shrink below usable size */
.filter-btn {
  flex-shrink: 0;
}

/* Task stats row — scrollable on overflow, no wrapping */
.tasks-stats-row {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tasks-stats-row::-webkit-scrollbar { display: none; }

/* Stat cards never shrink so the numbers stay readable */
.task-stat {
  flex-shrink: 0;
}

/* Habits list — each row is a horizontal flex; on narrow screens
   allow the row to scroll rather than clip the action buttons.
   Only override overflow-x (keeps overflow-y: hidden from base rule
   so border-radius clipping still works on top/bottom edges). */
.habit-item {
  overflow-x: auto;
}

/* Prevent habit item children from shrinking beyond usable size */
.habit-checkbox,
.habit-emoji,
.habit-progress-mini {
  flex-shrink: 0;
}

/* Habit items — visible on desktop to show action buttons, scrollable on mobile */
.habit-item {
  overflow: visible;
}

@media (max-width: 600px) {
  .habit-item {
    overflow-x: auto;
  }
}

/* Task items — allow horizontal scroll on mobile to reveal action buttons */
.task-item {
  overflow: visible; /* allow action buttons to be seen */
}

@media (max-width: 600px) {
  .task-item {
    overflow-x: auto;
  }
}

/* Allow tasks & habits views to scroll horizontally on mobile
   so ANY content that the flex items push wider than the screen
   becomes reachable via a swipe gesture */
@media (max-width: 768px) {
  #view-habits,
  #view-tasks {
    overflow-x: auto;
  }
}

/* ════════════════════════════════════════════════════════════════
   FIX 2: FOCUS TIMER — Play button touch / overlap fix
   Constrain the SVG to its intended size so the absolutely-
   positioned timer-center text always stays within the ring
   bounds. Add extra clearance between the ring and the controls
   so the play button never overlaps the "Ready to begin" text.
════════════════════════════════════════════════════════════════ */

/* Lock SVG to its intended 280×280 design size.
   max-width: 100% lets it scale down on very narrow screens
   while keeping the height proportional via the viewBox ratio. */
.timer-svg {
  display: block;
  width: 280px;
  height: 280px;
  max-width: 100%;
  /* When container narrower than 280px the SVG shrinks;
     height follows via aspect-ratio from the viewBox */
}

/* Prevent the absolute text overlay from receiving accidental taps */
.timer-center {
  pointer-events: none;
}

/* Push controls away from ring on all screen sizes */
.timer-stage {
  margin-bottom: var(--sp-4); /* 16px extra below ring */
}

/* Extra clearance specifically for mobile viewports */
@media (max-width: 768px) {
  .timer-controls {
    margin-top: var(--sp-5); /* 20px on top of the flex gap */
  }

  /* Scale ring down proportionally on phones narrower than 300px */
  .timer-svg {
    width: min(280px, calc(100vw - 64px));
    height: min(280px, calc(100vw - 64px));
  }
}


