@property --progress   { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --progress-t { syntax: '<percentage>'; inherits: false; initial-value: 0%; }

:root {
  --bg:       #f8f7f5;
  --surface:  #ffffff;
  --surface2: #fafaf9;
  --border:   rgba(0,0,0,0.06);
  --border2:  rgba(0,0,0,0.12);
  --text:     #18181b;
  --muted:    #71717a;
  --faint:    #f4f4f5;

  --p1: #c0392b; --p1-bg: #fff1f0; --p1-mid: rgba(192,57,43,0.15);
  --p2: #5b4fcf; --p2-bg: #f0effe; --p2-mid: rgba(91,79,207,0.15);
  --p3: #1a7a4a; --p3-bg: #f0fdf5; --p3-mid: rgba(26,122,74,0.15);
  --amber: #b35c00; --amber-bg: #fff8ee; --amber-mid: rgba(179,92,0,0.15);
  --launch: #0f6b8a; --launch-bg: #eef8fd; --launch-mid: rgba(15,107,138,0.15);
  --vera: #6366f1; --vera-bg: #eef2ff; --vera-mid: rgba(99,102,241,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 20px -4px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 40px -8px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 60px -12px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.06);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --dur: 0.2s;

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  --nav-height: 0px; /* desktop: no bottom nav */
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --bg:       #0f0f0f;
  --surface:  #1a1a1a;
  --surface2: #161616;
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.14);
  --text:     #e4e4e7;
  --muted:    #a1a1aa;
  --faint:    #1e1e1e;

  --p1: #ef6b5e; --p1-bg: rgba(239,107,94,0.1); --p1-mid: rgba(239,107,94,0.2);
  --p2: #8b82f0; --p2-bg: rgba(139,130,240,0.1); --p2-mid: rgba(139,130,240,0.2);
  --p3: #34d399; --p3-bg: rgba(52,211,153,0.1); --p3-mid: rgba(52,211,153,0.2);
  --amber: #f59e0b; --amber-bg: rgba(245,158,11,0.1); --amber-mid: rgba(245,158,11,0.2);
  --launch: #38bdf8; --launch-bg: rgba(56,189,248,0.1); --launch-mid: rgba(56,189,248,0.2);
  --vera: #818cf8; --vera-bg: rgba(129,140,248,0.1); --vera-mid: rgba(129,140,248,0.18);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 20px -4px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 40px -8px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.25);
  --shadow-xl: 0 20px 60px -12px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.3);

  color-scheme: dark;
}

/* Dark mode header & nav glass effect */
[data-theme="dark"] .app-header {
  background: rgba(15,15,15,0.85);
  border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(15,15,15,0.92);
  border-top-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .login-btn {
  background: var(--vera);
}
[data-theme="dark"] .nav-btn.active {
  color: var(--vera);
  background: var(--vera-bg);
}
/* Dark mode user chat bubble */
[data-theme="dark"] .vera-msg-user .vera-bubble {
  background: var(--vera);
}
/* Dark mode cc-toggle active */
[data-theme="dark"] .cc-toggle.active {
  background: var(--vera); border-color: var(--vera);
}
[data-theme="dark"] .phase-tab.active {
  background: var(--vera); border-color: var(--vera); color: white;
}
/* Dark mode identity gradient */
[data-theme="dark"] .cc-identity {
  background: linear-gradient(135deg, #1e1e1e, #1a1a1a);
}
/* Dark scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── THEME TOGGLE ── */
.theme-toggle {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
  min-width: 32px; min-height: 32px;
}
.theme-toggle:hover { color: var(--text); background: var(--faint); }
.theme-toggle svg { width: 16px; height: 16px; }
/* Show/hide sun/moon based on theme */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Geist', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Prevent background scroll when modal/voice open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── SKELETON / SHIMMER LOADING ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--faint) 25%, rgba(0,0,0,0.04) 50%, var(--faint) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ── LOGIN ── */
#login-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 44px 40px;
  width: 380px;
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column; gap: 14px;
}
.login-brand { display: flex; align-items: center; margin-bottom: 8px; }
.login-logo { height: 28px; width: auto; color: var(--text); }
.login-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.login-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: inherit; font-size: 14px;
  color: var(--text); background: var(--surface);
  outline: none; width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.login-input:focus {
  border-color: var(--vera);
  box-shadow: 0 0 0 3px var(--vera-mid);
}
.login-btn {
  background: var(--text); color: #fff;
  border: none; border-radius: var(--radius-md);
  padding: 12px; font-family: inherit;
  font-size: 14px; font-weight: 600;
  cursor: pointer; width: 100%;
  transition: opacity var(--dur) var(--ease), transform 0.1s;
}
.login-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }
.login-err { font-size: 12px; color: var(--p1); min-height: 16px; }

/* ── HEADER (Desktop) ── */
.app-header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--spacing-lg);
  display: flex; align-items: stretch;
  height: 52px;
  position: sticky; top: 0; z-index: 50;
}
.header-brand {
  display: flex; align-items: center; gap: 10px;
  padding-right: 20px; border-right: 1px solid var(--border);
  margin-right: 6px; flex-shrink: 0;
}
.header-logo { height: 22px; width: auto; color: var(--text); }
.header-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1; padding: 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  background: none; border: none;
  color: var(--muted);
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 6px 12px; cursor: pointer;
  border-radius: var(--radius-sm);
  height: 32px;
  display: flex; align-items: center;
  letter-spacing: -0.1px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
  position: relative;
}
.nav-btn:hover { color: var(--text); background: var(--faint); }
.nav-btn.active {
  color: var(--vera);
  background: var(--vera-bg);
  font-weight: 600;
}
.header-meta {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; padding-left: 16px;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.phase-pill {
  font-family: 'Geist Mono', monospace; font-size: 10px;
  font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
}
.signout-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  display: flex; align-items: center;
  transition: all var(--dur) var(--ease);
  min-width: 32px; min-height: 32px;
  justify-content: center;
}
.signout-btn:hover { color: var(--text); background: var(--faint); }

/* ── MOBILE BOTTOM NAV ── */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 56px;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  z-index: 50;
  justify-content: space-around; align-items: center;
}
.mobile-nav-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  background: none; border: none;
  color: var(--muted);
  font-family: inherit; font-size: 10px; font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 56px; min-height: 44px;
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease);
  letter-spacing: 0.01em;
}
.mobile-nav-btn svg { width: 22px; height: 22px; stroke-width: 1.6; }
.mobile-nav-btn.active { color: var(--vera); font-weight: 600; }
.mobile-nav-btn:active { transform: scale(0.95); }

/* ── MAIN ── */
.main {
  padding: var(--spacing-lg) var(--spacing-lg);
  padding-bottom: calc(var(--nav-height) + var(--spacing-lg) + env(safe-area-inset-bottom));
  max-width: 1180px;
  margin: 0 auto;
}
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.25s var(--ease) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { border-color: var(--border2); box-shadow: var(--shadow-md); }
.card-label {
  font-family: 'Geist Mono', monospace; font-size: 10px;
  font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
  margin-bottom: 16px;
}

/* ── TODAY ── */
.today-top {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
}
.today-date-row { display: flex; align-items: center; gap: 12px; }
.today-date { font-size: 26px; font-weight: 600; letter-spacing: -0.7px; line-height: 1.1; }
.today-sub {
  font-size: 11px; color: var(--muted);
  margin-top: 4px; font-family: 'Geist Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.today-counter .big {
  font-size: 54px; font-weight: 300; line-height: 1;
  color: var(--vera); letter-spacing: -3px;
}
.today-counter .label {
  font-size: 10px; color: var(--muted);
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.08em; text-align: right;
}
.day-arrow {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 32px; height: 32px;
  cursor: pointer; color: var(--muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
  min-width: 44px; min-height: 44px;
}
.day-arrow:hover { border-color: var(--border2); color: var(--text); background: var(--faint); }
.back-today-btn {
  font-size: 11px; background: var(--vera-bg);
  border: 1px solid var(--vera-mid);
  border-radius: var(--radius-sm); padding: 6px 12px;
  cursor: pointer; color: var(--vera);
  font-family: 'Geist Mono', monospace;
  transition: all var(--dur) var(--ease);
  min-height: 32px;
}
.back-today-btn:hover { background: var(--vera); color: white; border-color: var(--vera); }
.today-main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }

/* ── STAGE STRIP ── */
.stage-strip { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.stage-pill-item {
  font-size: 11px; font-family: 'Geist Mono', monospace;
  font-weight: 500; padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--muted);
  background: var(--surface); letter-spacing: 0.03em;
  transition: all var(--dur) var(--ease);
}
.stage-active { font-weight: 600; }
.stage-past { opacity: 0.5; }
.stage-future { opacity: 0.4; }

/* ── LAUNCH BANNER ── */
.launch-banner {
  background: var(--launch-bg);
  border: 1px solid var(--launch-mid);
  border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.launch-banner:hover { border-color: var(--launch); box-shadow: var(--shadow-sm); }
.launch-banner-icon {
  width: 38px; height: 38px; background: var(--launch);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.launch-banner-text { flex: 1; min-width: 0; }
.launch-banner-text h3 {
  font-size: 13px; font-weight: 600;
  color: var(--launch); margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.launch-banner-text p { font-size: 11px; color: var(--muted); }
.launch-banner-pct {
  font-family: 'Geist Mono', monospace; font-size: 20px;
  font-weight: 600; color: var(--launch);
  text-align: right; line-height: 1; flex-shrink: 0;
}
.launch-banner-pct span { display: block; font-size: 9px; font-weight: 400; color: var(--muted); margin-top: 3px; }

/* ── SCHEDULE ── */
.sched-card { padding: 0; overflow: hidden; }
.sched-card > .card-label { padding: 20px 24px 0; margin-bottom: 12px; }
.sched-block { border-top: 1px solid var(--border); }
.sched-block:first-of-type { border-top: none; }
.sched-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.sched-head:hover { background: var(--faint); }
.sched-time {
  font-family: 'Geist Mono', monospace; font-size: 10px;
  color: var(--muted); width: 72px; flex-shrink: 0;
}
.sched-label {
  font-size: 13px; font-weight: 500; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.sched-prog { font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--muted); }
.sched-caret { color: var(--muted); font-size: 14px; transition: transform var(--dur) var(--ease); }
.sched-block.collapsed .sched-caret { transform: rotate(-90deg); }
.sched-block.collapsed .sched-tasks,
.sched-block.collapsed .sched-route-note { display: none; }
.sched-tasks { padding: 4px 24px 14px; }
.sched-route-note { padding: 0 24px 14px; font-size: 12px; color: var(--muted); font-style: italic; }
.sched-done .sched-label { color: var(--muted); text-decoration: line-through; opacity: 0.6; }
.sched-accent .sched-label { color: var(--vera); }

/* ── TASKS ── */
.task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--dur) var(--ease);
  margin-bottom: 2px;
  min-height: 44px;
}
.task-item:hover { background: var(--faint); }
.task-item.done .task-text { text-decoration: line-through; color: var(--muted); opacity: 0.6; }
.task-check {
  width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
  transition: all var(--dur) var(--ease);
  background: var(--surface);
  min-width: 18px;
}
.task-item.done .task-check { background: var(--p3); border-color: var(--p3); }
.task-text {
  font-size: 13px; line-height: 1.45; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ── SIDEBAR ── */
.today-sidebar { display: flex; flex-direction: column; gap: 12px; }
.phase-block {
  background: var(--faint); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 8px;
}
.phase-block.locked { opacity: 0.5; }
.phase-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.phase-block-name {
  font-size: 12px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}
.phase-block-status {
  font-family: 'Geist Mono', monospace; font-size: 9px;
  color: var(--muted); text-transform: uppercase; flex-shrink: 0;
}
.phase-block-tagline { font-size: 11px; color: var(--muted); line-height: 1.4; }
.prog-row { display: flex; align-items: center; gap: 10px; }
.prog-track { flex: 1; height: 5px; background: var(--faint); border-radius: 99px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 99px; transition: width 0.6s var(--ease); }
.prog-pct { font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--muted); width: 32px; text-align: right; }
.deadline-card { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.deadline-label { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.deadline-date { font-size: 15px; font-weight: 600; margin: 3px 0 2px; letter-spacing: -0.3px; }
.deadline-sub { font-size: 11px; color: var(--muted); }

/* ── VERA EVENTS WIDGET ── */
.vera-events-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.vera-events-label {
  font-family: 'Geist Mono', monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 12px;
}
.vera-ev-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.vera-ev-row:last-child { border-bottom: none; }
.vera-ev-time { font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--muted); width: 52px; flex-shrink: 0; }
.vera-ev-title {
  font-size: 12px; font-weight: 500; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vera-ev-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── CALENDAR ── */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.cal-nav {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 36px; height: 36px;
  cursor: pointer; font-size: 16px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
  min-width: 44px; min-height: 44px;
}
.cal-nav:hover { border-color: var(--border2); color: var(--text); background: var(--faint); }
.cal-month-label { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-left: auto; }
.cal-leg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.cal-leg-dot { width: 8px; height: 8px; border-radius: 3px; }
.cal-grid {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-md);
}
.cal-dows {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: var(--faint); border-bottom: 1px solid var(--border);
}
.cal-dow {
  padding: 10px 0; text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-day {
  min-height: 84px; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); cursor: pointer;
  position: relative; padding: 8px 8px 6px;
  transition: background var(--dur) var(--ease);
}
.cal-day:hover { background: var(--faint); }
.cal-day.inactive { opacity: 0.2; cursor: default; pointer-events: none; }
.cal-day.past { opacity: 0.55; }
.cal-day.today { background: var(--vera-bg); }
.cal-day:nth-child(7n) { border-right: none; }
.cal-stripe { height: 3px; border-radius: 2px; margin-bottom: 5px; }
.cal-dn { font-size: 12px; font-weight: 500; }
.cal-day.today .cal-dn {
  color: var(--vera); font-weight: 700;
  background: var(--vera); color: white;
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.cal-ms-label {
  font-size: 9px; color: var(--muted); margin-top: 3px;
  font-family: 'Geist Mono', monospace; line-height: 1.3;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }
/* Max 3 visible dots + overflow indicator */
.cal-dot:nth-child(n+4) { display: none; }
.cal-dots-overflow {
  font-family: 'Geist Mono', monospace; font-size: 8px;
  color: var(--muted); font-weight: 600; line-height: 6px;
}

/* ── CALENDAR VIEW TOGGLE ── */
.cal-view-toggle {
  display: flex; gap: 0;
  border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; flex-shrink: 0;
}
.cal-toggle-btn {
  font-size: 11px; font-family: 'Geist Mono', monospace;
  padding: 6px 14px; cursor: pointer; border: none;
  background: none; color: var(--muted);
  transition: all var(--dur) var(--ease);
  text-transform: uppercase; letter-spacing: 0.04em;
  min-height: 32px;
}
.cal-toggle-btn:hover { background: var(--faint); color: var(--text); }
.cal-toggle-btn.active { background: var(--vera); color: white; }
.cal-today-btn {
  font-size: 11px; font-family: 'Geist Mono', monospace;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: none;
  color: var(--muted); cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-transform: uppercase; letter-spacing: 0.04em;
  min-height: 32px;
}
.cal-today-btn:hover { border-color: var(--vera); color: var(--vera); background: var(--vera-bg); }

/* ── WEEK VIEW ── */
#cal-week-container {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-md);
}
.cal-week-header-row {
  display: grid; grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 1px solid var(--border); background: var(--faint);
}
.cal-week-corner { border-right: 1px solid var(--border); }
.cal-week-header {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px; cursor: pointer;
  transition: background var(--dur) var(--ease);
  border-right: 1px solid var(--border);
}
.cal-week-header:last-child { border-right: none; }
.cal-week-header:hover { background: var(--surface); }
.cal-week-today-header { background: var(--vera-bg); }
.cal-week-dow { font-family: 'Geist Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cal-week-date-num { font-size: 16px; font-weight: 600; margin-top: 2px; }
.cal-week-today-num { color: var(--vera); }

.cal-week-allday-row {
  display: grid; grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 1px solid var(--border); min-height: 36px;
}
.cal-week-allday-cell { padding: 4px 3px; border-right: 1px solid var(--border); }
.cal-week-allday-cell:last-child { border-right: none; }

.cal-week-body { position: relative; }
.cal-week-scroll { overflow-y: auto; max-height: 520px; }
.cal-week-grid-inner { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: relative; }
.cal-week-time-gutter { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.cal-week-time-label { font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--muted); padding: 0 6px; display: flex; align-items: flex-start; padding-top: 2px; }

.cal-week-col {
  position: relative; border-right: 1px solid var(--border);
  min-height: calc(var(--wk-hours, 17) * 52px);
}
.cal-week-col:last-child { border-right: none; }
.cal-week-today { background: var(--vera-bg); }

.cal-week-hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); pointer-events: none; }

.cal-week-event {
  border-left: 3px solid var(--vera); border-radius: 6px;
  padding: 4px 6px; cursor: pointer;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  overflow: hidden;
}
.cal-week-event:hover { opacity: 0.85; transform: translateX(1px); }
.cal-week-event-timed { position: absolute; left: 2px; right: 2px; z-index: 2; }
.cal-week-event-title {
  font-size: 11px; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; display: block;
}
.cal-week-event-time { font-family: 'Geist Mono', monospace; font-size: 9px; color: var(--muted); display: block; margin-top: 1px; }
.cal-week-event-cat { font-family: 'Geist Mono', monospace; font-size: 10px; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.cal-week-event-mobile { margin: 6px 12px; padding: 10px 14px; border-radius: var(--radius-md); }

.cal-week-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--muted); text-align: center; }
.cal-week-empty-day { font-size: 12px; color: var(--muted); text-align: center; padding: 40px 20px; }

.cal-week-mobile-nav { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 12px 6px; }
.cal-week-mobile-label { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; }
.cal-week-mobile-dots { display: flex; justify-content: center; gap: 6px; padding: 6px 0 10px; }
.cal-week-mobile-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border2); transition: all var(--dur) var(--ease); }
.cal-week-mobile-dot.active { background: var(--vera); transform: scale(1.3); }
.cal-week-mobile-dot.today { border: 1.5px solid var(--vera); }

/* ── VERA VIEW ── */
.vera-shell {
  height: calc(100vh - 100px); max-height: 820px;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.vera-hdr {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.vera-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.vera-avatar svg { width: 18px; height: 18px; }
.vera-hdr-text { flex: 1; min-width: 0; }
.vera-hdr-name { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; }
.vera-hdr-role { font-size: 11px; color: var(--muted); font-family: 'Geist Mono', monospace; }
.vera-mode-tabs { display: flex; gap: 4px; }
.vera-tab {
  font-size: 11px; font-family: 'Geist Mono', monospace;
  padding: 5px 14px; border-radius: 20px;
  cursor: pointer; border: 1px solid var(--border);
  background: none; color: var(--muted);
  transition: all var(--dur) var(--ease);
  text-transform: uppercase; letter-spacing: 0.04em;
  min-height: 30px;
}
.vera-tab:hover { background: var(--faint); color: var(--text); }
.vera-tab.active { background: var(--vera); color: white; border-color: var(--vera); }
.vera-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border2); flex-shrink: 0; }
.vera-dot.online { background: var(--p3); box-shadow: 0 0 0 3px var(--p3-mid); animation: pulse 2.5s infinite; }
.vera-dot.loading { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-mid); animation: pulse 0.7s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.vera-ob-bar { padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--faint); flex-shrink: 0; }
.vera-ob-lbl { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 7px; }
.vera-ob-dots { display: flex; gap: 5px; }
.vera-ob-dot { flex: 1; height: 4px; border-radius: 99px; background: var(--border2); transition: background 0.4s var(--ease); }
.vera-ob-dot.done { background: var(--p3); }
.vera-ob-dot.active { background: var(--vera); }
.vera-ob-progress-track { margin-top: 8px; height: 3px; border-radius: 99px; background: var(--border2); overflow: hidden; }
.vera-ob-progress-fill { height: 100%; border-radius: 99px; background: var(--vera); width: 0%; transition: width 0.5s var(--ease); }
.vera-ob-lbl.complete { color: var(--vera); }

/* ── VERA MESSAGES (Chat App Feel) ── */
.vera-msgs {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  scroll-behavior: smooth;
}
.vera-msgs::-webkit-scrollbar { width: 4px; }
.vera-msgs::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
.vera-msg { display: flex; flex-direction: column; gap: 4px; max-width: 80%; }
.vera-msg-vera { align-self: flex-start; }
.vera-msg-user { align-self: flex-end; }
.vera-bubble {
  background: var(--faint); border: none;
  border-radius: 18px 18px 18px 6px;
  padding: 12px 16px; font-size: 13.5px; line-height: 1.6;
  box-shadow: var(--shadow-sm);
}
.vera-msg-user .vera-bubble {
  background: var(--vera); color: #fff;
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.vera-ts { font-family: 'Geist Mono', monospace; font-size: 9px; color: var(--muted); padding: 0 4px; }
.vera-msg-user .vera-ts { text-align: right; }
.vera-example {
  display: inline-block; background: var(--vera-bg);
  border: 1px solid var(--vera-mid);
  border-radius: var(--radius-sm);
  padding: 4px 10px; margin: 3px 2px 3px 0;
  font-size: 12px; color: var(--vera);
  cursor: pointer; font-family: 'Geist Mono', monospace;
  transition: all var(--dur) var(--ease);
}
.vera-example:hover { background: var(--vera); color: white; border-color: var(--vera); }
.vera-typing { display: flex; gap: 5px; padding: 6px 4px; align-items: center; }
.vera-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typeBounce 1.2s ease infinite; }
.vera-typing span:nth-child(2) { animation-delay: 0.15s; }
.vera-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typeBounce { 0%,80%,100%{transform:translateY(0);} 40%{transform:translateY(-6px);} }

.vera-ev-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; margin-top: 8px; }
.vera-ev-card-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.vera-ev-card-row { display: flex; gap: 10px; font-size: 12px; margin-bottom: 4px; align-items: flex-start; }
.vera-ev-card-lbl { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); width: 45px; flex-shrink: 0; padding-top: 1px; }
.cat-pill { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.cat-stride  { background: var(--p2-bg); color: var(--p2); border: 1px solid var(--p2-mid); }
.cat-health  { background: var(--p3-bg); color: var(--p3); border: 1px solid var(--p3-mid); }
.cat-career  { background: var(--p1-bg); color: var(--p1); border: 1px solid var(--p1-mid); }
.cat-money   { background: var(--launch-bg); color: var(--launch); border: 1px solid var(--launch-mid); }
.cat-life    { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-mid); }
.cat-admin   { background: var(--faint); color: var(--muted); border: 1px solid var(--border); }

/* ── VERA INPUT (Fixed Bottom Bar) ── */
.vera-input-area {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.vera-input-wrap { display: flex; gap: 10px; align-items: flex-end; }
.vera-input {
  flex: 1; border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  font-family: inherit; font-size: 14px;
  color: var(--text); background: var(--faint);
  resize: none; outline: none;
  max-height: 120px; line-height: 1.5;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.vera-input:focus { border-color: var(--vera); background: var(--surface); box-shadow: 0 0 0 3px var(--vera-mid); }
.vera-send {
  width: 40px; height: 40px;
  background: var(--vera); border: none;
  border-radius: var(--radius-md);
  cursor: pointer; color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--dur) var(--ease), transform 0.1s;
  min-width: 44px; min-height: 44px;
}
.vera-send:hover { opacity: 0.85; transform: translateY(-1px); }
.vera-send:disabled { opacity: 0.3; transform: none; cursor: default; }
.vera-input-hint { font-size: 10px; color: var(--muted); margin-top: 6px; font-family: 'Geist Mono', monospace; }

/* ── PLAN GENERATOR BUTTON ── */
.vera-plan-btn {
  display: inline-block; margin-top: 8px;
  padding: 10px 24px; background: var(--vera); color: #fff;
  border: none; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: opacity var(--dur) var(--ease), transform 0.1s;
}
.vera-plan-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.vera-plan-btn:disabled { opacity: 0.4; transform: none; cursor: default; }

/* ── REBUILD PLAN BUTTON (in VERA header) ── */
.vera-rebuild-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; background: var(--surface);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 500; font-family: inherit;
  color: var(--muted); cursor: pointer;
  transition: all var(--dur) var(--ease);
  margin-left: auto; flex-shrink: 0;
}
.vera-rebuild-btn:hover { border-color: var(--vera); color: var(--vera); }
.vera-rebuild-btn:disabled { opacity: 0.4; cursor: default; }

/* ── VOICE MODE ── */
.vera-voice-toggle {
  width: 40px; height: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--dur) var(--ease);
  min-width: 44px; min-height: 44px;
}
.vera-voice-toggle svg { width: 16px; height: 16px; }
.vera-voice-toggle:hover { border-color: var(--vera); color: var(--vera); background: var(--vera-bg); }

/* Voice modal overlay */
.voice-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.voice-modal.open { opacity: 1; pointer-events: auto; }
.voice-modal-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 28px;
  max-height: 85vh; overflow-y: auto;
  padding: 20px;
}

/* VERA circle */
.vera-circle {
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #818cf8, #6366f1 50%, #4f46e5);
  box-shadow: 0 0 40px rgba(99,102,241,0.3), 0 0 80px rgba(99,102,241,0.1);
  position: relative; display: flex; align-items: center; justify-content: center;
}
.vera-circle-inner {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(4px);
}

/* Circle state animations */
.vera-circle.listening { animation: vcListen 2.4s ease-in-out infinite; }
@keyframes vcListen {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(99,102,241,0.3), 0 0 80px rgba(99,102,241,0.1); }
  50% { transform: scale(1.06); box-shadow: 0 0 50px rgba(99,102,241,0.45), 0 0 100px rgba(99,102,241,0.15); }
}
.vera-circle.speaking { animation: vcSpeak 1.4s ease-in-out infinite; }
@keyframes vcSpeak {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(99,102,241,0.3), 0 0 80px rgba(99,102,241,0.1); }
  50% { transform: scale(1.12); box-shadow: 0 0 60px rgba(99,102,241,0.5), 0 0 120px rgba(99,102,241,0.2); }
}
.vera-circle.processing { animation: vcProcess 1s linear infinite; }
@keyframes vcProcess {
  0% { box-shadow: 0 0 40px rgba(99,102,241,0.3), 0 0 80px rgba(99,102,241,0.1); }
  50% { box-shadow: 0 0 30px rgba(99,102,241,0.5), 0 0 60px rgba(99,102,241,0.25); }
  100% { box-shadow: 0 0 40px rgba(99,102,241,0.3), 0 0 80px rgba(99,102,241,0.1); }
}
.vera-circle.error { animation: none; box-shadow: 0 0 40px rgba(239,68,68,0.4), 0 0 80px rgba(239,68,68,0.15); background: radial-gradient(circle at 40% 40%, #f87171, #ef4444 50%, #dc2626); }

/* State label */
.voice-state-label { font-family: 'Geist Mono', monospace; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.6); }

/* Transcript */
.voice-transcript { font-family: inherit; font-size: 15px; color: rgba(255,255,255,0.45); font-style: italic; max-width: 320px; text-align: center; min-height: 22px; line-height: 1.5; }

/* User circle */
.user-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(99,102,241,0.1); border: 2px solid rgba(99,102,241,0.25);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; opacity: 0.4;
  min-width: 48px; min-height: 48px;
}
.user-circle.active { opacity: 1; border-color: rgba(99,102,241,0.8); background: rgba(99,102,241,0.2); animation: userPulse 0.6s ease-in-out infinite; }
@keyframes userPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
  50% { transform: scale(1.15); box-shadow: 0 0 12px 4px rgba(99,102,241,0.15); }
}
.user-circle-inner { width: 16px; height: 16px; border-radius: 50%; background: rgba(99,102,241,0.4); }
.user-circle.active .user-circle-inner { background: rgba(99,102,241,0.8); }

/* Stop button */
.voice-stop-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px; padding: 12px 24px;
  color: rgba(255,255,255,0.7);
  font-family: 'Geist Mono', monospace; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  cursor: pointer; transition: all 0.2s ease;
  margin-top: 12px;
  min-height: 44px; min-width: 44px;
}
.voice-stop-btn svg { width: 14px; height: 14px; }
.voice-stop-btn:hover { background: rgba(255,255,255,0.18); color: white; border-color: rgba(255,255,255,0.3); }

/* ── PROGRESS ── */
.progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 22px;
  box-shadow: var(--shadow-sm); position: relative;
  overflow: hidden; transition: all var(--dur) var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--border2); transform: translateY(-1px); }
.stat-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-label { font-family: 'Geist Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
.stat-val { font-size: 32px; font-weight: 300; letter-spacing: -1.5px; line-height: 1; margin-bottom: 6px; }
.stat-sub { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.stat-delta { font-family: 'Geist Mono', monospace; font-size: 10px; padding: 3px 10px; border-radius: 20px; }
.d-pos { background: var(--p3-bg); color: var(--p3); }
.d-neu { background: var(--faint); color: var(--muted); }
.d-link { background: var(--vera-bg); color: var(--vera); cursor: pointer; transition: all var(--dur) var(--ease); }
.d-link:hover { background: var(--vera); color: white; }

.arc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 26px;
  box-shadow: var(--shadow-md); display: flex;
  align-items: center; gap: 28px; margin-bottom: 20px;
}
.arc-wrap { position: relative; flex-shrink: 0; }
.arc-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.arc-big { font-size: 30px; font-weight: 300; letter-spacing: -2px; line-height: 1; }
.arc-sub-lbl { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.arc-legend { flex: 1; }
.arc-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.arc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.arc-name { font-size: 12px; flex: 1; }
.arc-pct { font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--muted); width: 30px; text-align: right; }
.arc-bar-wrap { width: 72px; height: 4px; background: var(--faint); border-radius: 99px; overflow: hidden; }
.arc-bar { height: 100%; border-radius: 99px; transition: width 0.8s var(--ease); }

.momentum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.momentum-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 22px; box-shadow: var(--shadow-sm); }
.momentum-label { font-family: 'Geist Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; }
.seg-bar { display: flex; gap: 3px; height: 28px; border-radius: var(--radius-sm); overflow: hidden; }
.seg { flex: 1; position: relative; overflow: hidden; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.seg-label { font-family: 'Geist Mono', monospace; font-size: 9px; font-weight: 500; position: relative; z-index: 1; }
.streak-grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.streak-sq { height: 12px; border-radius: 3px; background: var(--faint); transition: background var(--dur) var(--ease); }
.streak-sq.full { background: var(--p3); }
.streak-sq.partial { background: var(--amber-mid); }
.streak-sq.today-mark { outline: 2px solid var(--vera); outline-offset: 1px; }

.progress-section-lbl { font-family: 'Geist Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 20px 0 12px; }
.track-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.track-row:hover { border-color: var(--border2); box-shadow: var(--shadow-md); }
.track-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.track-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.track-name {
  font-size: 13px; font-weight: 500; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.track-count { font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--muted); }
.track-bar-bg { background: var(--faint); border-radius: 99px; height: 5px; overflow: hidden; }
.track-bar-fill { height: 100%; border-radius: 99px; transition: width 0.8s var(--ease); }

/* ── MILESTONES ── */
.ms-section { margin-bottom: 28px; }
.ms-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ms-phase-badge { font-family: 'Geist Mono', monospace; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 14px; border-radius: 20px; flex-shrink: 0; }
.ms-line { flex: 1; height: 1px; background: var(--border); }
.ms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ms-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur) var(--ease);
}
.ms-card:hover { box-shadow: var(--shadow-md); border-color: var(--border2); transform: translateY(-2px); }
.ms-card.locked { opacity: 0.5; }
.ms-card.done-ms { background: var(--p3-bg); border-color: var(--p3-mid); }
.ms-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.ms-date { font-family: 'Geist Mono', monospace; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; display: inline-block; background: var(--faint); padding: 3px 8px; border-radius: 4px; }
.ms-title {
  font-size: 14px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.2px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ms-desc { font-size: 11px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.ms-prog-track { height: 4px; background: var(--faint); border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.ms-prog-bar { height: 100%; border-radius: 99px; transition: width 0.8s var(--ease); }
.ms-prog-lbl { display: flex; justify-content: space-between; font-family: 'Geist Mono', monospace; font-size: 9px; color: var(--muted); }

/* ── LAUNCH VIEW ── */
.phase-tabs {
  display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.phase-tabs::-webkit-scrollbar { display: none; }
.phase-tab {
  padding: 8px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: none;
  color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--dur) var(--ease);
  white-space: nowrap; flex-shrink: 0;
  min-height: 40px;
}
.phase-tab:hover { background: var(--faint); color: var(--text); }
.phase-tab.active { font-weight: 600; background: var(--text); color: white; border-color: var(--text); }
.phase-tab.past { opacity: 0.6; }
.phase-tab.future { opacity: 0.4; }
.phase-hdr { margin-bottom: 24px; }
.phase-meta-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.phase-status { font-family: 'Geist Mono', monospace; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 12px; border-radius: 20px; }
.phase-dates { font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--muted); }
.phase-tagline { font-size: 20px; font-weight: 600; letter-spacing: -0.5px; margin-bottom: 6px; }
.phase-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.future-notice { background: var(--faint); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 18px; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.phase-objs { display: flex; flex-direction: column; gap: 8px; }
.phase-obj { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.phase-obj-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.phase-obj-text { font-size: 13px; line-height: 1.5; }

.gate-prog-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px;
  margin-bottom: 20px; display: flex; align-items: center; gap: 24px;
  box-shadow: var(--shadow-sm);
}
.gate-prog-pct { font-size: 44px; font-weight: 300; letter-spacing: -3px; line-height: 1; flex-shrink: 0; }
.gate-prog-detail { flex: 1; }
.gate-prog-track { height: 8px; background: var(--faint); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.gate-prog-fill { height: 100%; border-radius: 99px; transition: width 0.8s var(--ease); }
.gate-prog-sub { font-size: 12px; color: var(--muted); }
.gate-unlock { text-align: right; }
.gate-unlock strong { display: block; font-size: 13px; margin-bottom: 2px; }
.gate-unlock span { font-size: 11px; color: var(--muted); display: block; }

.gate-section-head { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; }
.gate-section-title { font-family: 'Geist Mono', monospace; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.gate-section-line { flex: 1; height: 1px; background: var(--border); }
.gate-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px; border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 8px;
  background: var(--surface); cursor: pointer;
  transition: all var(--dur) var(--ease);
  min-height: 48px;
}
.gate-item:hover { border-color: var(--border2); background: var(--faint); box-shadow: var(--shadow-sm); }
.gate-item.gate-done { opacity: 0.6; }
.gate-item.gate-done .gate-item-title { text-decoration: line-through; color: var(--muted); }
.gate-check {
  width: 22px; height: 22px;
  border: 2px solid var(--border2);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--surface);
  margin-top: 1px; transition: all var(--dur) var(--ease);
  min-width: 22px;
}
.gate-done .gate-check { background: var(--p3); border-color: var(--p3); }
.gate-item-body { flex: 1; min-width: 0; }
.gate-item-title {
  font-size: 13px; font-weight: 500; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gate-item-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }
.badge { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 20px; flex-shrink: 0; font-weight: 500; height: fit-content; }
.badge-critical  { background: var(--p1-bg); color: var(--p1); border: 1px solid var(--p1-mid); }
.badge-important { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-mid); }
.badge-done      { background: var(--p3-bg); color: var(--p3); border: 1px solid var(--p3-mid); }

/* ── STATS / COLE CARD ── */
.cc-toggle-row { display: flex; gap: 6px; margin-bottom: 20px; }
.cc-toggle {
  padding: 8px 22px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: none;
  color: var(--muted); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: 'Geist Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.06em;
  transition: all var(--dur) var(--ease);
  min-height: 40px;
}
.cc-toggle:hover { background: var(--faint); color: var(--text); }
.cc-toggle.active { background: var(--text); color: white; border-color: var(--text); }
.cc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg); }
.cc-identity {
  padding: 28px; background: linear-gradient(135deg, var(--faint), var(--surface));
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 20px;
}
.cc-position { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 6px; }
.cc-name { font-size: 24px; font-weight: 700; letter-spacing: -0.8px; }
.cc-era { font-family: 'Geist Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 4px; }
.cc-era-tgt { color: var(--p3); }
.cc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); }
.cc-stat { background: var(--surface); padding: 18px; transition: background var(--dur) var(--ease); }
.cc-stat:hover { background: var(--faint); }
.cc-stat-label { font-family: 'Geist Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; margin-bottom: 12px; }
.cc-tube-wrap { width: 44px; height: 76px; border: 2px solid var(--border2); border-radius: 22px; position: relative; overflow: hidden; background: var(--faint); margin-bottom: 8px; }
.cc-liquid { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 20px; transition: height 1s var(--ease); }
.cc-liquid-now { background: linear-gradient(to top, #0f6b8a, #1a9dc7); height: var(--progress); }
.cc-liquid-tgt { background: linear-gradient(to top, #1a7a4a, #2cb870); height: var(--progress-t); }
.cc-num { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: 13px; font-weight: 700; color: var(--text); z-index: 2; font-family: 'Geist Mono', monospace; }
.cc-letter { font-size: 14px; font-weight: 700; }
.cc-tier { font-family: 'Geist Mono', monospace; font-size: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.cc-subs { margin-top: 10px; }
.cc-sub { display: flex; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--border); font-size: 11px; }
.cc-sub-lbl { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.cc-sub-now { font-family: 'Geist Mono', monospace; font-weight: 500; color: var(--launch); flex-shrink: 0; }
.cc-sub-tgt { font-family: 'Geist Mono', monospace; font-weight: 500; color: var(--p3); flex-shrink: 0; }
.cc-proj-strip { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--border); }
.cc-proj-item { padding: 18px; border-right: 1px solid var(--border); }
.cc-proj-item:last-child { border-right: none; }
.cc-proj-label { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 4px; }
.cc-proj-val { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 2px; }
.cc-proj-sub { font-size: 11px; color: var(--muted); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 100; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); width: 480px;
  max-height: 80vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s var(--ease) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-date { font-size: 17px; font-weight: 600; letter-spacing: -0.4px; margin-bottom: 5px; }
.modal-close {
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: var(--muted);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
  min-width: 44px; min-height: 44px;
}
.modal-close:hover { background: var(--faint); color: var(--text); }
.modal-body { padding: 16px 22px; overflow-y: auto; flex: 1; }
.modal-section-lbl { font-family: 'Geist Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 10px 0 6px; }
.modal-task {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-md);
  cursor: pointer; margin-bottom: 2px;
  transition: background var(--dur) var(--ease);
  min-height: 44px;
}
.modal-task:hover { background: var(--faint); }
.modal-task.done .modal-task-text { text-decoration: line-through; color: var(--muted); opacity: 0.6; }
.mini-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
  transition: all var(--dur) var(--ease);
  background: var(--surface);
}
.modal-task.done .mini-check { background: var(--p3); border-color: var(--p3); }
.modal-task-text { font-size: 12.5px; }

/* ── DYNAMIC SCHEDULE (hour-by-hour from custom_events) ── */
.sched-time-block {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 24px; border-top: 1px solid var(--border);
  transition: background var(--dur) var(--ease);
  border-left: 4px solid transparent;
}
.sched-time-block:first-of-type { border-top: none; }
.sched-time-block:hover { background: var(--faint); }

.sched-tb-time {
  font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--muted);
  width: 72px; flex-shrink: 0; padding-top: 2px; text-transform: uppercase;
}
.sched-tb-body { flex: 1; min-width: 0; }
.sched-tb-title {
  font-size: 13px; font-weight: 500; line-height: 1.4;
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.sched-tb-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }

.sched-category-pill {
  font-family: 'Geist Mono', monospace; font-size: 9px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 12px; line-height: 1.4;
}
.sched-duration {
  font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--muted);
}
.sched-short {
  font-size: 10px; color: var(--muted); font-style: italic;
}

/* Google Calendar-style colored left border per category */
.sched-time-block[data-cat="stride"] { border-left-color: var(--p2); }
.sched-time-block[data-cat="health"] { border-left-color: var(--p3); }
.sched-time-block[data-cat="career"] { border-left-color: var(--p1); }
.sched-time-block[data-cat="money"] { border-left-color: var(--launch); }
.sched-time-block[data-cat="life"] { border-left-color: var(--amber); }
.sched-time-block[data-cat="admin"] { border-left-color: var(--muted); }

/* Locked events (moveable: false) */
.sched-locked {
  border-left: 4px solid var(--muted) !important;
  background: var(--faint);
}
.sched-locked .sched-tb-title { color: var(--text); }
.sched-lock-badge { display: inline-flex; align-items: center; color: var(--muted); }
.sched-lock-svg { vertical-align: middle; }

/* Current hour highlight */
.sched-current {
  border-left: 4px solid var(--vera) !important;
  background: var(--vera-bg);
}
.sched-current .sched-tb-time { color: var(--vera); font-weight: 600; }

/* Current time indicator line */
.sched-now-line {
  position: relative; height: 0;
  border-top: 2px solid var(--p1);
  margin: 0 24px; z-index: 5;
}
.sched-now-line::before {
  content: ''; position: absolute;
  left: -6px; top: -5px;
  width: 8px; height: 8px;
  border-radius: 50%; background: var(--p1);
}

/* Event task checkbox */
.sched-ev-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; margin-top: 2px; background: var(--surface);
  transition: all var(--dur) var(--ease);
  min-width: 20px; min-height: 20px;
}
.sched-ev-check:hover { border-color: var(--vera); }
.sched-ev-check.checked { background: var(--p3); border-color: var(--p3); }
.sched-ev-done .sched-tb-title { text-decoration: line-through; color: var(--muted); opacity: 0.6; }

/* Empty state */
.sched-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 24px; text-align: center;
}
.sched-empty-icon { margin-bottom: 16px; opacity: 0.4; }
.sched-empty-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.sched-empty-msg { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; max-width: 300px; }
.sched-empty-btn {
  font-family: inherit; font-size: 13px; font-weight: 500;
  background: var(--vera); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 10px 24px;
  cursor: pointer; transition: opacity var(--dur) var(--ease), transform 0.1s;
  min-height: 44px;
}
.sched-empty-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════ */
/* ── RESPONSIVE: 960px ──                               */
/* ══════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .today-main-grid { grid-template-columns: 1fr; }
  .ms-grid { grid-template-columns: 1fr 1fr; }
  .cc-grid { grid-template-columns: 1fr; }
  .progress-grid { grid-template-columns: 1fr 1fr; }
  .momentum-grid { grid-template-columns: 1fr; }
  .arc-card { flex-direction: column; text-align: center; }
  .arc-legend { width: 100%; }
  .gate-prog-card { flex-direction: column; text-align: center; }
  .gate-unlock { text-align: center; }
  .cc-proj-strip { grid-template-columns: 1fr; }
  .cc-proj-item { border-right: none; border-bottom: 1px solid var(--border); }
  .cc-proj-item:last-child { border-bottom: none; }
  .vera-hdr { flex-wrap: wrap; gap: 10px; }
  .vera-mode-tabs { order: 4; width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════ */
/* ── RESPONSIVE: 768px ──                               */
/* ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ms-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════ */
/* ── RESPONSIVE: 640px (Mobile) ──                      */
/* ══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --nav-height: 56px; }

  /* Show mobile bottom nav, hide desktop header nav */
  .mobile-bottom-nav { display: flex; }
  .header-nav { display: none; }
  .header-meta .phase-pill { display: none; }

  .app-header {
    padding: 0 14px; height: 48px;
    border-bottom: 1px solid var(--border);
  }
  .header-brand { padding-right: 12px; border-right: none; margin-right: 0; }
  .header-meta { border-left: none; padding-left: 0; gap: 6px; }

  .main {
    padding: 14px;
    padding-bottom: calc(var(--nav-height) + 14px + env(safe-area-inset-bottom));
  }

  /* Today */
  .today-top { padding: 16px; border-radius: var(--radius-lg); }
  .today-date { font-size: 20px; }
  .today-counter .big { font-size: 36px; }
  .today-main-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Schedule */
  .sched-time-block { padding: 12px 14px; gap: 10px; }
  .sched-tb-time { width: 56px; font-size: 9px; }
  .sched-ev-check { min-width: 44px; min-height: 44px; width: 44px; height: 44px; border-radius: 10px; }
  .sched-ev-check svg { width: 14px; height: 11px; }

  /* Calendar */
  .cal-day { min-height: 60px; padding: 5px 5px; }
  .cal-dot { width: 4px; height: 4px; }
  .cal-legend { display: none; }
  .cal-week-header-row, .cal-week-allday-row, .cal-week-grid-inner { display: none; }
  .cal-week-mobile-nav, .cal-week-mobile-dots { display: flex; }

  /* Progress */
  .progress-grid { grid-template-columns: 1fr 1fr; }
  .stat-val { font-size: 26px; }
  .arc-card { gap: 16px; padding: 18px; }

  /* Milestones */
  .ms-grid { grid-template-columns: 1fr; }

  /* Launch */
  .gate-prog-card { gap: 14px; padding: 18px; flex-direction: column; text-align: center; }
  .gate-prog-pct { font-size: 32px; }
  .gate-unlock { text-align: center; }
  .phase-tabs { flex-wrap: nowrap; padding-bottom: 4px; scroll-snap-type: x mandatory; }
  .phase-tab { flex-shrink: 0; font-size: 12px; padding: 7px 14px; scroll-snap-align: start; }
  .phase-tagline { font-size: 16px; }

  /* Stats */
  .cc-identity { flex-direction: column; text-align: center; gap: 14px; padding: 22px; }
  .cc-grid { grid-template-columns: 1fr; }

  /* VERA chat */
  .vera-shell { height: calc(100vh - var(--nav-height) - 60px); max-height: none; border-radius: var(--radius-lg); }
  .vera-hdr { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .vera-mode-tabs { order: 4; width: 100%; justify-content: center; }
  .vera-msg { max-width: 90%; }
  .vera-msgs { padding: 14px; }
  .vera-input-area { padding: 10px 14px; }
  .vera-input { font-size: 16px; } /* Prevent iOS zoom on focus */
  .vera-bubble { padding: 10px 14px; font-size: 13px; }

  /* Login */
  .login-box { width: calc(100vw - 32px); max-width: 380px; padding: 32px 24px; }

  /* Modal → bottom sheet on mobile */
  .modal-overlay { align-items: flex-end; }
  .modal {
    width: 100%; max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: modalSlideUp 0.3s var(--ease) both;
  }
  @keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Voice modal mobile fix */
  .voice-modal-content {
    max-height: 85vh;
    padding: 20px;
    justify-content: center;
  }
  .vera-circle { width: 120px; height: 120px; }
  .vera-circle-inner { width: 40px; height: 40px; }

  /* Streak grid */
  .streak-grid { grid-template-columns: repeat(7, 1fr); }

  /* General touch targets */
  .day-arrow { min-width: 44px; min-height: 44px; }
  .cal-nav { min-width: 44px; min-height: 44px; }
}

/* ══════════════════════════════════════════════════════ */
/* ── RESPONSIVE: <400px (Small Phones) ──               */
/* ══════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .main { padding: 10px; padding-bottom: calc(var(--nav-height) + 10px + env(safe-area-inset-bottom)); }
  .today-top { padding: 14px; }
  .today-date { font-size: 18px; }
  .today-counter .big { font-size: 30px; letter-spacing: -2px; }
  .cal-day { min-height: 52px; padding: 3px 4px; }
  .cal-dot { width: 3px; height: 3px; }
  .cal-dn { font-size: 11px; }
  .progress-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
  .sched-tb-time { width: 48px; }
  .vera-shell { border-radius: var(--radius-md); }
  .cc-stat { padding: 14px; }
  .ms-card { padding: 14px; }
  .gate-item { padding: 12px 14px; }

  /* Nav items extremely small */
  .mobile-nav-btn { font-size: 9px; min-width: 48px; padding: 4px 4px; }
  .mobile-nav-btn svg { width: 20px; height: 20px; }
}

/* ══════════════════════════════════════════════════════ */
/* ── GLOBAL TEXT TRUNCATION UTILITIES ──                 */
/* ══════════════════════════════════════════════════════ */
.truncate {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.line-clamp-2 {
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
