/* VoiceNote — design tokens & base */
:root {
  /* Neutrals — warm cream + deep charcoal */
  --bg-stage: #f7f4ee;                        /* match marketing site cream */
  --bg-app: oklch(97.5% 0.004 85);           /* cream window */
  --bg-card: #ffffff;
  --bg-card-2: oklch(96.5% 0.005 85);        /* subtle inset */
  --bg-sunken: oklch(95% 0.006 85);

  --ink-1: oklch(18% 0.008 75);              /* primary text */
  --ink-2: oklch(38% 0.008 75);              /* secondary */
  --ink-3: oklch(55% 0.008 75);              /* tertiary */
  --ink-4: oklch(72% 0.008 75);              /* muted */

  --line: oklch(90% 0.006 85);
  --line-2: oklch(85% 0.006 85);

  /* Sidebar (dark) */
  --side-bg: oklch(18% 0.005 60);
  --side-bg-2: oklch(22% 0.005 60);
  --side-ink: oklch(95% 0.005 85);
  --side-ink-2: oklch(65% 0.01 85);
  --side-hover: oklch(28% 0.005 60);

  /* Accent (Tweaks-driven) */
  --accent: #dbef6a;                          /* chartreuse default */
  --accent-ink: #1a1a1a;
  --accent-soft: color-mix(in oklch, var(--accent) 28%, white);

  --radius-card: 22px;
  --radius-card-lg: 28px;
  --radius-btn: 12px;
  --radius-pill: 999px;

  --shadow-card: 0 0.5px 0 rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.04), 0 10px 30px -18px rgba(0,0,0,0.18);
  --shadow-pop: 0 8px 24px -8px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.06);

  --pad: 28px;        /* density-driven */
  --gap: 18px;
}

[data-density="compact"]  { --pad: 18px; --gap: 12px; }
[data-density="regular"]  { --pad: 24px; --gap: 16px; }
[data-density="comfy"]    { --pad: 32px; --gap: 22px; }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink-1);
  background: var(--bg-stage);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 800px at 18% 8%, oklch(95% 0.025 145) 0%, transparent 60%),
    radial-gradient(900px 700px at 92% 95%, oklch(94% 0.022 165) 0%, transparent 55%),
    var(--bg-stage);
  overflow: hidden;
}

/* macOS window chrome */
.win {
  width: 1240px; height: 800px;
  border-radius: 16px; overflow: hidden;
  background: var(--bg-app);
  display: flex; flex-direction: column;
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.18),
    0 30px 60px -20px rgba(0,0,0,0.35),
    0 12px 24px -10px rgba(0,0,0,0.18);
  position: relative;
}
.titlebar {
  height: 36px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  background: linear-gradient(180deg, oklch(98% 0.003 85), oklch(96.5% 0.003 85));
  border-bottom: 0.5px solid var(--line);
  user-select: none;
}
.tl { display: flex; gap: 8px; align-items: center; }
.tl i {
  width: 12px; height: 12px; border-radius: 50%;
  display: block; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.18);
}
.tl i:nth-child(1) { background: #ff5f57; }
.tl i:nth-child(2) { background: #febc2e; }
.tl i:nth-child(3) { background: #28c840; }
.title {
  flex: 1; text-align: center;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  letter-spacing: 0.01em;
}

/* App body */
.app {
  flex: 1; display: flex; min-height: 0;
}

/* ── Sidebar ───────────────────────────────────────── */
.side {
  width: 76px; flex-shrink: 0;
  background: var(--side-bg);
  color: var(--side-ink);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  gap: 6px;
  position: relative;
}
[data-sidebar="wide"] .side { width: 200px; align-items: stretch; }

.brand {
  height: 44px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.12);
}
[data-sidebar="wide"] .brand { justify-content: flex-start; padding-left: 4px; gap: 10px; }
[data-sidebar="wide"] .brand-text { font-weight: 600; font-size: 15px; }
.brand-text { display: none; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--side-ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
  border: 0; background: transparent;
  padding: 0;
  font-family: inherit; font-size: 13px; font-weight: 500;
}
[data-sidebar="wide"] .nav-item {
  justify-content: flex-start; padding: 0 12px; gap: 10px;
}
.nav-item:hover { background: var(--side-hover); color: var(--side-ink); }
.nav-item.active {
  background: var(--accent); color: var(--accent-ink);
}
.nav-item.active:hover { background: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { display: none; }
[data-sidebar="wide"] .nav-label { display: inline; }

.side-foot {
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; padding-top: 8px;
  border-top: 1px solid oklch(28% 0.005 60);
}
[data-sidebar="wide"] .side-foot { align-items: stretch; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, oklch(75% 0.08 50), oklch(60% 0.1 30));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 600; font-size: 13px;
  box-shadow: inset 0 0 0 1.5px oklch(30% 0.005 60);
}

/* ── Main pane ────────────────────────────────────── */
.main {
  flex: 1;
  overflow: auto;
  padding: var(--pad);
  min-width: 0;
}
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: oklch(85% 0.005 85); border-radius: 5px; border: 2px solid var(--bg-app); }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px; gap: 16px;
}
.page-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 8px;
}
.page-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 44px; line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink-1);
  margin: 0;
}
.page-title em { font-style: italic; color: var(--ink-2); }
.page-sub {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 14px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 0.5px solid var(--line);
  box-shadow: var(--shadow-card);
  padding: 22px;
}
.card-lg { border-radius: var(--radius-card-lg); padding: 26px; }
.card-flush { padding: 0; overflow: hidden; }
.card-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: color-mix(in oklch, var(--accent) 80%, black);
}
.card-dark {
  background: oklch(17% 0.005 60); color: oklch(95% 0.005 85);
  border-color: transparent;
}
.card h3 {
  margin: 0 0 4px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}
.card-accent h3 { color: rgba(0,0,0,0.55); }
.card-dark h3 { color: oklch(70% 0.008 85); }

.stat-num {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 44px;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-unit {
  font-size: 14px; color: var(--ink-3); font-weight: 500;
  margin-left: 4px;
}
.card-accent .stat-unit { color: rgba(0,0,0,0.55); }

/* Pills & chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-sunken); color: var(--ink-2);
  font-size: 11.5px; font-weight: 500;
  border: 0.5px solid var(--line);
}
.chip-accent { background: var(--accent-soft); border-color: color-mix(in oklch, var(--accent) 60%, white); color: var(--ink-1); }
.chip-dark { background: oklch(22% 0.005 60); color: oklch(95% 0.005 85); border: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: var(--radius-btn);
  border: 0.5px solid var(--line);
  background: var(--bg-card);
  color: var(--ink-1);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background .12s, transform .08s, box-shadow .12s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn:hover { background: var(--bg-card-2); }
.btn:active { transform: translateY(0.5px); }
.btn-primary {
  background: var(--ink-1); color: oklch(98% 0.005 85);
  border-color: var(--ink-1);
}
.btn-primary:hover { background: oklch(28% 0.005 60); }
.btn-accent {
  background: var(--accent); color: var(--accent-ink);
  border-color: color-mix(in oklch, var(--accent) 75%, black);
}
.btn-accent:hover { filter: brightness(0.97); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-sunken); }
.btn-icon { width: 40px; padding: 0; justify-content: center; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }

/* Layout helpers */
.row { display: flex; gap: var(--gap); }
.col { display: flex; flex-direction: column; gap: var(--gap); }
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.mt-auto { margin-top: auto; }

/* Inputs */
.field {
  display: flex; flex-direction: column; gap: 8px;
}
.field label {
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  letter-spacing: 0.01em;
}
.input {
  height: 42px; padding: 0 14px;
  border-radius: var(--radius-btn);
  border: 0.5px solid var(--line-2);
  background: var(--bg-card);
  font-family: inherit; font-size: 13.5px; color: var(--ink-1);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus {
  border-color: var(--ink-2);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 40%, transparent);
}
.input-mono { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 13px; }

/* Toggle */
.toggle {
  width: 38px; height: 22px; border-radius: 999px;
  background: oklch(82% 0.005 85);
  position: relative; cursor: pointer;
  border: 0.5px solid var(--line-2);
  transition: background .15s;
  flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 1.5px; left: 1.5px;
  width: 17px; height: 17px; border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform .15s;
}
.toggle[data-on="true"] { background: var(--ink-1); }
.toggle[data-on="true"]::after { transform: translateX(16px); }

/* Divider */
.divider { height: 1px; background: var(--line); }

/* Page transition */
.page { animation: fadeUp .25s cubic-bezier(.2,.7,.3,1); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
.tnum { font-variant-numeric: tabular-nums; }

.section-title {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.02em; text-transform: uppercase;
  margin: 0 0 14px;
}

/* Segmented control (used in Settings → Appearance) */
.seg-row {
  display: flex; gap: 0;
  background: var(--bg-sunken);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}
.seg {
  flex: 1; height: 30px;
  border: 0; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: 7px;
  transition: background .12s, color .12s, box-shadow .12s;
}
.seg:hover { color: var(--ink-1); }
.seg-on {
  background: var(--bg-card);
  color: var(--ink-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0.5px 0 rgba(0,0,0,0.04);
}

/* Locked overlay (Style page when AI disabled) */
.locked {
  position: relative;
}
.locked::before {
  content: ''; position: absolute; inset: 0;
  background: oklch(97% 0.004 85 / 0.65);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  z-index: 5;
  pointer-events: none;
}
.lock-banner {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  background: var(--ink-1); color: oklch(98% 0.005 85);
  padding: 18px 22px; border-radius: 16px;
  display: flex; gap: 14px; align-items: center;
  box-shadow: var(--shadow-pop);
  max-width: 460px;
}
