/* ============================================================
   LEVA — Dashboard design system v2
   Premium light theme + new components (voice timeline, risk gauge,
   loading skeletons, drafts toggle, hover-reveal actions, mini charts)
   ============================================================ */

/* ──────────────────────────────────────────────────────────
   1. DESIGN TOKENS
   ────────────────────────────────────────────────────────── */
:root {
  --bg:           #fafaf8;
  --bg-soft:      #f5f5f3;
  --surface:      #ffffff;
  --surface-2:    #fbfbfa;
  --surface-3:    #f6f6f4;

  --line:         #ececea;
  --line-soft:    #f0f0ee;
  --line-strong:  #d9d9d4;
  --line-focus:   #c8c8c2;

  --ink:          #0a0a0a;
  --ink-2:        #18181a;
  --ink-3:        #2a2a2e;
  --muted:        #5b5b62;
  --soft:         #8a8a92;
  --softer:       #b5b5bc;
  --dim:          #d4d4d8;

  --accent:       #5b21b6;
  --accent-2:     #6d28d9;
  --accent-soft:  #f4f0fb;
  --accent-line:  #e6dcf6;
  --accent-ink:   #4c1d95;

  --success:      #15803d;
  --success-bg:   #ecfdf3;
  --success-line: #c5e8d3;
  --warning:      #b45309;
  --warning-bg:   #fef6e7;
  --warning-line: #f4dca6;
  --danger:       #b91c1c;
  --danger-bg:    #fef1f1;
  --danger-line:  #f5c5c5;
  --info:         #1d4ed8;
  --info-bg:      #eef2ff;
  --info-line:    #d3dafa;

  --role-founder:  #5b21b6;   --role-founder-bg:  #f4f0fb;
  --role-exec:     #a21caf;   --role-exec-bg:     #fbf0fa;
  --role-investor: #166534;   --role-investor-bg: #f0faf3;
  --role-builder:  #1e40af;   --role-builder-bg:  #eff3fb;
  --role-manager:  #0e7490;   --role-manager-bg:  #f0fafc;
  --role-sales:    #c2410c;   --role-sales-bg:    #fdf6ec;
  --role-creator:  #7e22ce;   --role-creator-bg:  #f8f1fb;
  --role-advisor:  #57534e;   --role-advisor-bg:  #f7f6f4;
  --role-other:    #71717a;   --role-other-bg:    #f6f6f4;

  --shadow-xs:    0 1px 0 rgba(10,10,10,.025);
  --shadow-sm:    0 1px 2px rgba(10,10,10,.04), 0 1px 1px rgba(10,10,10,.02);
  --shadow:       0 2px 6px rgba(10,10,10,.04), 0 1px 2px rgba(10,10,10,.03);
  --shadow-md:    0 8px 20px rgba(10,10,10,.06), 0 2px 6px rgba(10,10,10,.03);
  --shadow-lg:    0 24px 48px rgba(10,10,10,.08), 0 8px 16px rgba(10,10,10,.04);

  --r-xs: 5px;  --r-sm: 7px;  --r:    9px;
  --r-md: 11px; --r-lg: 14px; --r-xl: 18px; --r-2xl: 22px;

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

  --sb-bg:           #fbfbfa;
  --sb-divider:      #ececea;
  --sb-text:         #5b5b62;
  --sb-text-active:  #0a0a0a;
  --sb-hover:        #f0f0ed;
  --sb-active-bar:   var(--accent);
  --sb-group:        #a3a3a8;
  --sb-badge-bg:     #ebebe7;
  --sb-badge-ink:    #5b5b62;
  --sb-badge-active-bg: #ece4f7;
  --sb-badge-active-ink: var(--accent);
}

/* ──────────────────────────────────────────────────────────
   2. RESET / BASE
   ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01", "ss03", "cv02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
hr { border: none; }
pre, code { font-family: var(--font-mono); }
::selection { background: var(--accent-soft); color: var(--accent-ink); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #e2e2dd; border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #cdcdc6; }

/* ──────────────────────────────────────────────────────────
   3. TYPOGRAPHY
   ────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 { font-family: var(--font-sans); color: var(--ink); margin: 0; letter-spacing: -0.02em; }
h1, .text-2xl { font-size: 26px; font-weight: 700; letter-spacing: -0.028em; line-height: 1.15; }
h2, .text-xl { font-size: 18px; font-weight: 650; letter-spacing: -0.018em; line-height: 1.2; }
h3, .text-lg { font-size: 16px; font-weight: 650; letter-spacing: -0.012em; line-height: 1.3; }
h4 { font-size: 14px; font-weight: 650; letter-spacing: -0.008em; }

.section-label, .nav-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}
.section-label { margin-bottom: 10px; }
.tab-nums { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.text-slate-500, .text-slate-600 { color: var(--muted) !important; }
.text-slate-400 { color: var(--soft) !important; }
.text-slate-300, .text-slate-200 { color: var(--softer) !important; }
.text-slate-700, .text-slate-800, .text-slate-900 { color: var(--ink) !important; }
.text-violet-600, .text-violet-700, .text-violet-800, .text-violet-900 { color: var(--accent) !important; }
.text-violet-500 { color: var(--accent-2) !important; }
.text-emerald-600, .text-emerald-700, .text-green-600, .text-green-700 { color: var(--success) !important; }
.text-amber-600, .text-amber-700 { color: var(--warning) !important; }
.text-red-500, .text-red-600 { color: var(--danger) !important; }
.text-blue-600, .text-blue-700 { color: var(--info) !important; }

.bg-white { background: var(--surface) !important; }
.bg-slate-50 { background: var(--surface-3) !important; }
.bg-slate-100 { background: var(--bg-soft) !important; }
.bg-violet-50 { background: var(--accent-soft) !important; }
.bg-violet-100 { background: var(--accent-line) !important; }
.bg-emerald-50, .bg-green-50 { background: var(--success-bg) !important; }
.bg-blue-50 { background: var(--info-bg) !important; }
.bg-amber-50 { background: var(--warning-bg) !important; }
.bg-red-50 { background: var(--danger-bg) !important; }

.border-slate-100, .border-slate-200 { border-color: var(--line) !important; }
.border-violet-100, .border-violet-200 { border-color: var(--accent-line) !important; }
.border-emerald-200, .border-green-200 { border-color: var(--success-line) !important; }
.border-blue-200 { border-color: var(--info-line) !important; }
.border-amber-200 { border-color: var(--warning-line) !important; }
.border-red-200 { border-color: var(--danger-line) !important; }
.border { border-color: var(--line) !important; }

.divide-slate-50 > * + *, .divide-slate-100 > * + * { border-color: var(--line-soft) !important; }

/* ──────────────────────────────────────────────────────────
   4. LAYOUT
   ────────────────────────────────────────────────────────── */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-divider);
  display: flex;
  flex-direction: column;
}
.sidebar > div:first-child {
  padding: 18px 18px 14px !important;
  border-bottom: 1px solid var(--sb-divider) !important;
  border-color: var(--sb-divider) !important;
}
.sidebar > div:first-child .w-8 {
  background: var(--ink) !important;
  color: var(--surface) !important;
  border-radius: 8px !important;
  width: 26px !important;
  height: 26px !important;
  font-size: 12.5px !important;
  letter-spacing: -.04em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.sidebar > div:first-child .font-bold {
  color: var(--ink) !important;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -.012em;
}
.sidebar > div:first-child .text-xs {
  color: var(--soft) !important;
  font-weight: 500;
  font-size: 12px !important;
  margin-top: 2px;
}
.sidebar nav { padding: 8px 10px 8px !important; }
.nav-group-label {
  padding: 16px 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--sb-group);
  text-transform: uppercase;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500;
  color: var(--sb-text);
  position: relative;
  transition: background .12s ease, color .12s ease;
  cursor: pointer;
  margin-bottom: 1px;
  white-space: nowrap;
}
.nav-link svg {
  width: 16px; height: 16px; flex-shrink: 0;
  opacity: 0.8; stroke-width: 1.85 !important;
}
.nav-link:hover { background: var(--sb-hover); color: var(--ink); }
.nav-link.active {
  background: transparent;
  color: var(--sb-text-active);
  font-weight: 600;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 99px 99px 0;
}
.nav-link.active svg { opacity: 1; color: var(--ink); }
.nav-badge {
  margin-left: auto;
  min-width: 20px; height: 18px;
  padding: 0 6px;
  background: var(--sb-badge-bg);
  border-radius: 99px;
  font-size: 10.5px; font-weight: 600;
  color: var(--sb-badge-ink);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.nav-link.active .nav-badge {
  background: var(--sb-badge-active-bg);
  color: var(--sb-badge-active-ink);
}
.sidebar > div:last-child {
  border-top: 1px solid var(--sb-divider) !important;
  border-color: var(--sb-divider) !important;
  padding: 10px 10px !important;
}

main.flex-1 { background: var(--bg); }
main.flex-1 > .p-6, main.flex-1 > .md\:p-8 {
  padding: 32px 36px !important;
  max-width: 1320px;
}
@media (min-width: 1500px) {
  main.flex-1 > .p-6, main.flex-1 > .md\:p-8 { padding: 40px 48px !important; }
}
main.flex-1 > div.md\:hidden {
  background: var(--surface) !important;
  border-color: var(--sb-divider) !important;
}

/* ──────────────────────────────────────────────────────────
   5. BUTTONS
   ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.003em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .04s;
  white-space: nowrap;
  user-select: none;
  position: relative;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; stroke-width: 2.1 !important; }

.btn-primary {
  background: var(--ink); color: var(--surface);
  box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, var(--shadow-xs);
}
.btn-primary:hover { background: var(--ink-3); }

.btn-accent {
  background: var(--accent); color: var(--surface);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, var(--shadow-xs);
}
.btn-accent:hover { background: var(--accent-ink); }

.btn-ghost {
  background: var(--surface); color: var(--ink-2);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line-focus); }

.btn-soft { background: var(--bg-soft); color: var(--ink-2); }
.btn-soft:hover { background: var(--line); }

.btn-danger { background: var(--danger); color: var(--surface); }
.btn-danger:hover { background: #991b1b; }

.btn-link {
  background: transparent; color: var(--muted);
  padding: 4px 6px; border-color: transparent;
  font-weight: 500;
}
.btn-link:hover { color: var(--ink); background: var(--surface-3); }

.btn-lg { padding: 10px 18px; font-size: 14.5px; border-radius: var(--r); }
.btn-lg svg { width: 16px; height: 16px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; gap: 5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs { padding: 4px 9px; font-size: 12px; gap: 4px; }
.btn-xs svg { width: 12px; height: 12px; }
.btn-block { width: 100%; }

/* ──────────────────────────────────────────────────────────
   6. INPUTS
   ────────────────────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--softer); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-focus); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3.5px var(--accent-line);
}
.textarea { resize: vertical; line-height: 1.55; }
.input-mono { font-family: var(--font-mono); font-size: 12.5px; }
.label {
  display: block;
  font-size: 13px; font-weight: 550;
  margin-bottom: 6px; color: var(--ink-2);
}
.help { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ──────────────────────────────────────────────────────────
   7. CARDS
   ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card-hover { transition: border-color .12s, box-shadow .12s, transform .12s; cursor: pointer; }
.card-hover:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.card-elevated { box-shadow: var(--shadow-md); }
.rounded-2xl, .rounded-xl { border-radius: var(--r-lg) !important; }
.shadow-sm { box-shadow: var(--shadow-xs) !important; }
.shadow { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-sm) !important; }

/* ──────────────────────────────────────────────────────────
   8. BADGES
   ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.005em; line-height: 1.4;
  border: 1px solid transparent;
}
.badge svg { width: 11px; height: 11px; }
.badge-draft     { background: var(--bg-soft);      color: var(--muted); }
.badge-approved  { background: var(--info-bg);      color: var(--info); }
.badge-scheduled { background: var(--warning-bg);   color: var(--warning); }
.badge-published { background: var(--success-bg);   color: var(--success); }
.badge-failed    { background: var(--danger-bg);    color: var(--danger); }
.badge-soft      { background: var(--accent-soft);  color: var(--accent); }
.badge-success   { background: var(--success-bg);   color: var(--success); }

.autopilot-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 99px;
  background: var(--success-bg);
  border: 1px solid var(--success-line);
  font-size: 11.5px; font-weight: 600;
  color: var(--success);
  letter-spacing: 0.005em;
  white-space: nowrap;
  flex-shrink: 0;
}
.autopilot-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(21,128,61,0.18);
  animation: pulseDot 2.2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(21,128,61,0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(21,128,61,0.08); }
}

/* ──────────────────────────────────────────────────────────
   9. STAT CARDS
   ────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px 16px;
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.stat-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.stat-card-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 10px;
}
.stat-card-value {
  font-size: 32px; font-weight: 700;
  line-height: 1; color: var(--ink);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  margin-bottom: 10px;
}
.stat-card-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 8px;
}
.stat-card-trend {
  font-size: 12px; font-weight: 500;
  color: var(--muted); line-height: 1.4;
  white-space: nowrap;
}
.trend-up { color: var(--success); font-weight: 550; }
.trend-neutral { color: var(--soft); }
.trend-down { color: var(--danger); font-weight: 550; }

/* ──────────────────────────────────────────────────────────
  10. TABS
   ────────────────────────────────────────────────────────── */
.tabs {
  display: inline-flex; gap: 2px;
  padding: 3px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.tab {
  padding: 5px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 550;
  color: var(--muted);
  cursor: pointer; border: none; background: transparent;
  transition: background .12s, color .12s, box-shadow .12s;
  letter-spacing: -0.003em;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

/* ──────────────────────────────────────────────────────────
  11. STEPPER (legacy)
   ────────────────────────────────────────────────────────── */
.step {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.step.step-active {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-line), 0 1px 2px rgba(91,33,182,0.05);
}
.step.step-done {
  background: var(--success-bg);
  border-color: var(--success-line);
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.step.step-active .step-num { background: var(--accent); color: var(--surface); }
.step.step-done .step-num { background: var(--success); color: var(--surface); }

/* ──────────────────────────────────────────────────────────
  12. EMPTY STATES (premium)
   ────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}
.empty h3 { font-size: 16px; font-weight: 650; color: var(--ink); margin-bottom: 4px; }
.empty p { font-size: 13.5px; color: var(--muted); }
.empty-icon {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  border-radius: 13px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--soft);
}
.empty-icon svg { width: 22px; height: 22px; stroke-width: 1.6; }

/* Drawn-paper empty illustration (used in homeView's "no draft yet") */
.empty-illustration {
  width: 220px;
  height: 130px;
  margin: 0 auto 18px;
  position: relative;
  border-radius: var(--r);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 14px,
      var(--line-soft) 14px,
      var(--line-soft) 15px
    );
  border: 1.5px dashed var(--line-strong);
  padding: 18px 22px;
  overflow: hidden;
}
.empty-illustration::before {
  content: "";
  position: absolute; top: 18px; left: 22px;
  width: 60%; height: 7px; border-radius: 2px;
  background: var(--softer);
  opacity: .35;
}
.empty-illustration::after {
  content: "";
  position: absolute; bottom: 18px; right: 22px;
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--accent-soft) 0 60%, transparent 60%);
  opacity: .6;
}

/* ──────────────────────────────────────────────────────────
  13. TOAST (responsive)
   ────────────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; pointer-events: none;
}
@media (max-width: 900px) {
  .toast-wrap { top: 14px; bottom: auto; left: 14px; right: 14px; }
}
.toast {
  pointer-events: auto;
  background: var(--ink); color: var(--surface);
  padding: 11px 14px;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  min-width: 240px; max-width: 380px;
  display: flex; align-items: flex-start; gap: 10px;
  transform: translateY(8px); opacity: 0;
  animation: toastIn .25s cubic-bezier(.2,.7,.3,1) forwards;
  font-weight: 500;
  letter-spacing: -0.003em;
}
.toast.toast-success { background: #064e3b; color: #d1fae5; }
.toast.toast-error   { background: #7f1d1d; color: #fee2e2; }
.toast .toast-close {
  margin-left: auto; cursor: pointer; opacity: 0.6;
  background: none; border: none; color: inherit;
  font-size: 16px; line-height: 1; padding: 0 4px;
}
.toast .toast-close:hover { opacity: 1; }
@keyframes toastIn { to { transform: translateY(0); opacity: 1; } }

/* ──────────────────────────────────────────────────────────
  14. BUSY OVERLAY
   ────────────────────────────────────────────────────────── */
.busy-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
}
.busy-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-lg);
  max-width: 380px; width: 92%;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line);
}
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ──────────────────────────────────────────────────────────
  15. ICON TILE
   ────────────────────────────────────────────────────────── */
.icon-tile {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--accent-line);
}
.icon-tile svg { width: 16px; height: 16px; stroke-width: 1.85; }

/* ──────────────────────────────────────────────────────────
  16. POST BODY
   ────────────────────────────────────────────────────────── */
.post-body {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
  letter-spacing: -0.003em;
}
.card .post-body {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
}

/* ──────────────────────────────────────────────────────────
  17. OUTREACH — contact rows (hover-reveal actions)
   ────────────────────────────────────────────────────────── */
[data-action^="scroll-to:"] {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
[data-action^="scroll-to:"]:hover {
  border-color: var(--line-strong) !important;
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px) !important;
}
[data-action^="scroll-to:"] .text-2xl {
  font-variant-numeric: tabular-nums;
  font-weight: 700 !important;
  letter-spacing: -0.025em;
  color: var(--ink) !important;
}
[data-action^="scroll-to:"] .text-xs {
  color: var(--soft) !important;
  opacity: 1 !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Hover-reveal action buttons — opt-in via .row-hover-actions */
.row-hover-actions { opacity: 0; transition: opacity .15s; }
.contact-row:hover .row-hover-actions,
.contact-row:focus-within .row-hover-actions { opacity: 1; }

/* DM expanded panel */
.divide-slate-100 > .bg-violet-50 {
  background: var(--surface-2) !important;
  position: relative;
}
.divide-slate-100 > .bg-violet-50::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
}
textarea[id^="inline-dm-"] {
  width: 100% !important;
  display: block !important;
  background: var(--surface) !important;
  border-color: var(--line) !important;
  border-radius: var(--r) !important;
  padding: 16px 18px !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  color: var(--ink-2) !important;
  box-shadow: var(--shadow-xs) !important;
  transition: border-color .12s, box-shadow .12s;
}
textarea[id^="inline-dm-"]:focus {
  outline: none !important;
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 3.5px var(--accent-line), var(--shadow-xs) !important;
}

/* ──────────────────────────────────────────────────────────
  18. MISC
   ────────────────────────────────────────────────────────── */
.chev { transition: transform .2s; }
details[open] .chev { transform: rotate(90deg); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
hr.divider { border: none; border-top: 1px solid var(--line); margin: 0; }
code.kbd {
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--font-mono);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.ring-focus:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#job-status-banner {
  background: var(--ink) !important;
  color: var(--surface) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  padding: 12px 18px !important;
  letter-spacing: -0.003em !important;
  border-top: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.06);
}

/* ══════════════════════════════════════════════════════════
   ▼▼ NEW IN v2 ▼▼
   ══════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────
  19. LOADING SKELETONS
   ────────────────────────────────────────────────────────── */
.skel {
  display: block;
  background:
    linear-gradient(90deg, var(--surface-3) 0%, var(--bg-soft) 50%, var(--surface-3) 100%);
  background-size: 200% 100%;
  border-radius: var(--r-xs);
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-text   { height: 13px; width: 100%; }
.skel-text-sm{ height: 11px; width: 100%; }
.skel-title  { height: 18px; width: 60%; border-radius: var(--r-sm); }
.skel-h1     { height: 26px; width: 40%; border-radius: var(--r-sm); }
.skel-circle { border-radius: 50%; }
.skel-line + .skel-line { margin-top: 8px; }
.skel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.skel-stack > * + * { margin-top: 10px; }

/* ──────────────────────────────────────────────────────────
  20. DRAFTS — list/grid toggle
   ────────────────────────────────────────────────────────── */
.drafts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .drafts-grid { grid-template-columns: 1fr; } }

.draft-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .12s;
}
.draft-row:hover { background: var(--surface-2); }
.draft-row:last-child { border-bottom: none; }
.draft-row .draft-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.draft-row .draft-status-dot.draft     { background: var(--softer); }
.draft-row .draft-status-dot.approved  { background: var(--info); }
.draft-row .draft-status-dot.scheduled { background: var(--warning); }
.draft-row .draft-status-dot.published { background: var(--success); }
.draft-row .draft-status-dot.failed    { background: var(--danger); }
.draft-row .draft-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.008em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-row .draft-row-meta {
  font-size: 11.5px;
  color: var(--soft);
  margin-top: 1px;
  display: flex; gap: 10px; align-items: center;
}
.draft-row .draft-row-actions {
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity .12s;
}
.draft-row:hover .draft-row-actions { opacity: 1; }

/* ──────────────────────────────────────────────────────────
  21. ANALYTICS — mini chart per metric
   ────────────────────────────────────────────────────────── */
.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px 14px;
  display: flex; flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  min-height: 150px;
}
.metric-card-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--soft);
}
.metric-card-row {
  display: flex; align-items: baseline; gap: 8px;
}
.metric-card-value {
  font-size: 30px; font-weight: 700;
  line-height: 1; color: var(--ink);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.metric-card-delta {
  font-size: 12px; font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.metric-card-chart {
  margin-top: auto;
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: -14px;
  height: 56px;
  overflow: hidden;
}
.metric-card-chart svg { width: 100%; height: 100%; display: block; }
.metric-chart-line { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric-chart-area { stroke: none; opacity: .14; }

/* ──────────────────────────────────────────────────────────
  22. VOICE — vertical timeline + accuracy gauge
   ────────────────────────────────────────────────────────── */
.voice-timeline {
  position: relative;
  margin-left: 14px;
  padding-left: 28px;
}
.voice-timeline::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    var(--success) 0%,
    var(--success) var(--progress, 0%),
    var(--line) var(--progress, 0%),
    var(--line) 100%
  );
  border-radius: 99px;
}
.voice-step {
  position: relative;
  padding: 16px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.voice-step:last-child { margin-bottom: 0; }
.voice-step::before {
  content: "";
  position: absolute;
  left: -34px; top: 22px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  z-index: 1;
}
.voice-step.is-done::before {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 0 3.5px rgba(21,128,61,.15);
}
.voice-step.is-done::after {
  content: "";
  position: absolute;
  left: -30.5px; top: 26.5px;
  width: 5px; height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.voice-step.is-active::before {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-line);
}
.voice-step.is-active {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-line);
}
.voice-step h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.012em;
  margin-bottom: 4px;
}
.voice-step p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 10px;
}
.voice-step-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--success-bg);
  color: var(--success);
  margin-left: 8px;
  vertical-align: middle;
}

/* Voice fingerprint accuracy gauge (linear meter) */
.voice-gauge {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.voice-gauge-ring {
  width: 84px; height: 84px;
  flex-shrink: 0;
  position: relative;
}
.voice-gauge-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.voice-gauge-bg { fill: none; stroke: var(--line); stroke-width: 7; }
.voice-gauge-fg { fill: none; stroke: var(--success); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.voice-gauge-value {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -.02em;
}
.voice-gauge-body { flex: 1; min-width: 0; }
.voice-gauge-body h4 { font-size: 14px; margin-bottom: 4px; }
.voice-gauge-body p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.voice-gauge-detail { font-size: 12px; color: var(--soft); margin-top: 6px; }

/* ──────────────────────────────────────────────────────────
  23. RISK — radial gauge hero
   ────────────────────────────────────────────────────────── */
.risk-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  display: flex; align-items: center; gap: 28px;
  margin-bottom: 16px;
}
.risk-gauge {
  position: relative;
  width: 180px;
  height: 110px;
  flex-shrink: 0;
}
.risk-gauge svg { width: 100%; height: 100%; }
.risk-gauge-bg { fill: none; stroke: var(--line); stroke-width: 14; stroke-linecap: round; }
.risk-gauge-fg { fill: none; stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.risk-gauge-fg.low    { stroke: var(--success); }
.risk-gauge-fg.medium { stroke: var(--warning); }
.risk-gauge-fg.high   { stroke: var(--danger); }
.risk-gauge-value {
  position: absolute;
  left: 0; right: 0;
  bottom: 8px;
  text-align: center;
}
.risk-gauge-num {
  font-size: 40px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.risk-gauge-out { font-size: 12px; color: var(--soft); font-weight: 500; margin-left: 2px; }
.risk-hero-body { flex: 1; min-width: 0; }
.risk-level-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px;
}
.risk-level-label.low    { background: var(--success-bg); color: var(--success); }
.risk-level-label.medium { background: var(--warning-bg); color: var(--warning); }
.risk-level-label.high   { background: var(--danger-bg);  color: var(--danger); }
.risk-hero-body h2 { font-size: 20px; margin: 8px 0 6px; }
.risk-hero-body p  { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

.risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.risk-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.risk-item-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.risk-item-kind {
  font-size: 13px; font-weight: 600; color: var(--ink);
  letter-spacing: -.008em; text-transform: capitalize;
}
.risk-item-used {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
}
.risk-item-bar {
  height: 5px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.risk-item-bar i {
  display: block; height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}
.risk-item-bar i.low    { background: var(--success); }
.risk-item-bar i.medium { background: var(--warning); }
.risk-item-bar i.high   { background: var(--danger); }
.risk-item-week { font-size: 11.5px; color: var(--soft); }

/* ──────────────────────────────────────────────────────────
  24. WATERMARK — sticky preview
   ────────────────────────────────────────────────────────── */
.watermark-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) { .watermark-grid { grid-template-columns: 1fr; } }
.watermark-preview-sticky {
  position: sticky;
  top: 24px;
}

/* ──────────────────────────────────────────────────────────
  25. RESPONSIVE
   ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.is-open {
    display: flex; position: fixed; inset: 0 auto 0 0;
    z-index: 9100; box-shadow: var(--shadow-lg); width: 256px;
  }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(10,10,10,0.4); z-index: 9050;
  }
  .home-right-panel { display: none; }
  main.flex-1 > .p-6, main.flex-1 > .md\:p-8 { padding: 22px 18px !important; }
}
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
  .sidebar-backdrop { display: none; }
}

@media print {
  .sidebar, .toast-wrap, #job-status-banner { display: none !important; }
  main.flex-1 > .p-6 { padding: 0 !important; }
  .card { box-shadow: none !important; border-color: #ddd !important; }
}

/* ============================================================
   LEVA — "Apple-simple" layer (v3, 2026-10-30)
   One accent, system font, quiet surfaces, generous space.
   Loaded last on purpose: overrides earlier tokens/components and
   Tailwind utility colors (body-prefixed for specificity over the
   runtime-injected Tailwind CDN styles).
   ============================================================ */
:root {
  --bg: #f5f5f7;  --bg-soft: #f5f5f7;
  --surface: #ffffff; --surface-2: #ffffff; --surface-3: #f5f5f7;
  --line: #e5e5ea; --line-soft: #ededf0; --line-strong: #d2d2d7; --line-focus: #0071e3;
  --ink: #1d1d1f; --ink-2: #1d1d1f; --ink-3: #3a3a3c;
  --muted: #6e6e73; --soft: #707075; --softer: #aeaeb2; --dim: #d2d2d7;
  --accent: #0066cc; --accent-2: #0071e3; --accent-fill: #0071e3; --accent-fill-2: #0062c4; --accent-soft: #e8f2fd; --accent-line: #cfe3fb; --accent-ink: #0058b0;
  --success: #177232; --success-bg: #eaf6ec; --success-line: #cdeacf;
  --warning: #b25e00; --warning-bg: #fff4e5;
  --danger: #d70015; --danger-bg: #fff0f1; --danger-line: #ffd0d4;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sb-border: transparent;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --bg-soft: #000000;
    --surface: #1c1c1e; --surface-2: #1c1c1e; --surface-3: #2c2c2e;
    --line: #2c2c2e; --line-soft: #2c2c2e; --line-strong: #3a3a3c;
    --ink: #f5f5f7; --ink-2: #f5f5f7; --ink-3: #d1d1d6;
    --muted: #a1a1a6; --soft: #9a9aa0; --softer: #636366; --dim: #48484a;
    --accent: #2997ff; --accent-2: #3ea2ff; --accent-fill: #0a66d8; --accent-fill-2: #0b6fe0; --accent-soft: #0a2540; --accent-line: #12395f; --accent-ink: #64b5ff;
    --success-bg: #0f2a17; --danger-bg: #2c0b0e; --warning-bg: #2b1d05;
    --success: #30d158; --danger: #ff6961;
    --shadow-card: none;
    color-scheme: dark;
  }
}

html, body { background: var(--bg) !important; }
body, button, input, select, textarea { font-family: var(--font) !important; -webkit-font-smoothing: antialiased; }
body { color: var(--ink); letter-spacing: -0.01em; }
h1, .text-2xl { letter-spacing: -0.025em; }
body h1.text-2xl { font-size: 32px; line-height: 1.15; font-weight: 700; }

/* Tailwind color utilities → system palette */
body .text-slate-900, body .text-slate-800, body .text-slate-700 { color: var(--ink) !important; }
body .text-slate-600, body .text-slate-500 { color: var(--muted) !important; }
body .text-slate-400, body .text-slate-300 { color: var(--soft) !important; }
body .bg-white { background: var(--surface) !important; }
body .bg-slate-50, body .bg-slate-100 { background: var(--surface-3) !important; }
body .border-slate-200, body .border-slate-100, body .border-slate-300 { border-color: var(--line) !important; }
body .text-violet-900, body .text-violet-700, body .text-violet-600 { color: var(--accent) !important; }

/* Cards: quiet, soft, borderless */
body .card { background: var(--surface); border: none !important; border-radius: var(--r-lg); box-shadow: var(--shadow-card); }

/* Buttons: pills */
body .btn { border-radius: 980px; font-weight: 500; letter-spacing: -0.01em; transition: background .15s, transform .05s; }
body .btn:active { transform: scale(.98); }
/* Buttons use a slightly deeper blue than links so white text stays readable (WCAG AA 4.5:1) */
body .btn-primary, body .btn-accent { background: var(--accent-fill) !important; color: #fff !important; border: none !important; }
body .btn-primary:hover, body .btn-accent:hover { background: var(--accent-fill-2) !important; }
body .btn-ghost { background: var(--surface-3) !important; border: none !important; color: var(--ink) !important; }
body .btn-ghost:hover { background: var(--line) !important; }
body .btn-soft { background: transparent !important; border: 1px solid var(--line-strong) !important; color: var(--ink) !important; }
body .btn-link { color: var(--accent) !important; }
body .btn-lg { padding: 12px 22px; font-size: 17px; }

/* Inputs */
body .input, body .textarea, body .select, body input[type="text"], body input[type="url"], body input[type="email"], body input[type="password"], body textarea, body select {
  border-radius: var(--r-sm) !important; border: 1px solid var(--line-strong) !important; background: var(--surface) !important; color: var(--ink) !important;
}
body .input:focus, body textarea:focus, body select:focus, body input:focus { outline: none !important; border-color: var(--accent) !important; box-shadow: 0 0 0 4px var(--accent-soft) !important; }

/* Sidebar: light, translucent, airy */
body .sidebar { background: color-mix(in srgb, var(--bg) 82%, transparent) !important; backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--line) !important; }
body .sidebar .text-white { color: var(--ink) !important; }
body .nav-link { border-radius: var(--r-sm); color: var(--ink) !important; font-weight: 500; padding: 8px 10px; }
body .nav-link:hover { background: var(--surface-3) !important; }
body .nav-link.active { background: var(--surface) !important; color: var(--accent) !important; box-shadow: var(--shadow-card); }
body .nav-link.active::before { display: none !important; }
body .nav-link.active svg { color: var(--accent) !important; }
body .nav-badge { background: var(--accent) !important; color: #fff !important; border-radius: 980px; }
body .nav-group-label { display: none; }
.nav-more summary { list-style: none; cursor: pointer; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more[open] .nav-more-chevron { transform: rotate(90deg); }
.nav-more-chevron { transition: transform .15s; margin-left: auto; color: var(--soft); }

/* Badges */
body .badge { border-radius: 980px; font-weight: 600; font-size: 12px; padding: 3px 10px; border: none !important; background: var(--surface-3); color: var(--muted); }
body .badge-published { background: var(--success-bg) !important; color: var(--success) !important; }
body .badge-scheduled { background: var(--accent-soft) !important; color: var(--accent) !important; }
body .badge-failed { background: var(--danger-bg) !important; color: var(--danger) !important; }

/* Segmented control (replaces tab strips) */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 980px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { border: 0; background: transparent; padding: 7px 16px; border-radius: 980px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; cursor: pointer; text-decoration: none; }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
body .tabs { background: var(--surface-3); border-radius: 980px; padding: 3px; border: none; }
body .tab { border-radius: 980px !important; border: none !important; }
body .tab.active { background: var(--surface) !important; color: var(--ink) !important; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ⋯ menus (details/summary, no JS) */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; z-index: 50; background: var(--surface); border-radius: var(--r); box-shadow: 0 10px 40px rgba(0,0,0,.16), 0 0 0 1px var(--line); padding: 6px; }
.menu-panel.up { top: auto; bottom: calc(100% + 6px); }
.menu-panel.left { right: auto; left: 0; }
.menu-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: transparent; border-radius: 10px; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.menu-item:hover { background: var(--surface-3); }
.menu-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-note { padding: 6px 12px; font-size: 13px; color: var(--muted); }

/* Today */
.today-greet { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.today-sub { color: var(--muted); font-size: 17px; margin-top: 4px; }
.hero { padding: 28px; }
.hero-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
body .post-body { font-size: 17px; line-height: 1.55; color: var(--ink); background: transparent !important; border: none !important; padding: 0 !important; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-row:first-child { border-top: none; }
.list-row .when { min-width: 92px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.list-row .what { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--softer); }
.stat-line { color: var(--muted); font-size: 15px; display: flex; gap: 18px; flex-wrap: wrap; }
.stat-line b { color: var(--ink); font-weight: 600; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 980px; background: var(--surface-3); border: 0; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--line); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; }
.embedded > header:first-child, .embedded > div > header:first-child { display: none !important; }
.preview-toggle summary { cursor: pointer; color: var(--accent); font-size: 14px; list-style: none; }
.preview-toggle summary::-webkit-details-marker { display: none; }

/* Phone: bottom tab bar like iOS, no hamburger */
.tabbar { display: none; }
@media (max-width: 767px) {
  body .sidebar, #open-sidebar { display: none !important; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--soft); text-decoration: none; padding: 4px 0; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--accent); }
  main { padding-bottom: 84px; }
  .today-greet { font-size: 28px; }
  .hero { padding: 20px; }
  .page-title { font-size: 28px; }
}
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 10px; margin-top: 22px; }
.card-actions-main { display: flex; gap: 8px; flex: 1 0 auto; }
.card-actions-side { display: flex; gap: 6px; flex-shrink: 0; }
body .sidebar > div:first-child, body .sidebar > div:last-child { border: none !important; }
body .sidebar > div:first-child .w-8 { background: var(--accent) !important; color: #fff !important; }
.list-row { border-top: none; }
.list-row + .list-row { border-top: 1px solid var(--line); }
@media (max-width: 767px) {
  .card-actions-main .btn-lg { padding: 10px 18px; font-size: 16px; }
  .card-actions-side .icon-btn { width: 34px; height: 34px; }
}
@media (max-width: 380px) { .card-actions-side .icon-btn[title] { display: none; } }
.today-greet + .today-sub { }
header > .menu > summary.btn-ghost { background: var(--surface) !important; box-shadow: var(--shadow-card); }
.menu-panel { min-width: 250px; }
.embedded header h1, .embedded header h1 + p { display: none !important; }
:root { --info-bg: var(--accent-soft); --info: var(--accent); }
@media (prefers-color-scheme: dark) { :root { --info-bg: #0a2540; --success-bg: #0f2a17; } }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 980px; margin: 0 auto; align-items: stretch; }
@media (max-width: 900px) { .plans-grid { grid-template-columns: 1fr; max-width: 440px; } }

/* ── v0.2.22: switches, help, toast help link ── */
.switch { width: 44px; height: 26px; border-radius: 980px; background: var(--surface-3); position: relative; flex-shrink: 0; transition: background .2s; }
.switch > span { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on { background: var(--success, #34c759); }
.switch.on > span { transform: translateX(18px); }
.help-item { border-top: 1px solid var(--line); }
.help-item:first-child { border-top: none; }
.help-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 0; font-size: 16px; font-weight: 500; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary .chev { margin-left: auto; color: var(--soft); transition: transform .2s; }
.help-item[open] summary .chev { transform: rotate(90deg); }
.help-item p { margin: -4px 0 16px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.help-item a { color: var(--accent); }
.toast .toast-help { color: inherit; font-weight: 600; text-decoration: underline; flex-shrink: 0; }

/* ── Week calendar ── */
.week-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day { background: var(--surface-3); border-radius: 12px; padding: 8px; min-height: 110px; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; transition: border-color .15s; }
.cal-day.past { background: transparent; border-color: var(--line); }
.cal-day.past .cal-head, .cal-day.past .cal-head b { color: var(--muted); }
.cal-day.today .cal-head b { background: var(--accent-fill); color: #fff; border-radius: 980px; padding: 0 6px; }
.cal-day.drop { border-color: var(--accent); }
.cal-head { font-size: 12px; color: var(--muted); }
.cal-head b { color: var(--ink); font-weight: 600; }
.cal-post { background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: 12px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 2px; }
.cal-post:active { cursor: grabbing; }
.cal-time { color: var(--accent); font-weight: 600; }
.cal-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) {
  .week-cal { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cal-day .cal-head { width: 64px; }
  .cal-post { flex: 1; min-width: 160px; }
  .cal-day.past, .cal-hint { display: none; }
}

/* ── Why this post ── */
.why-line { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; margin-top: 14px; line-height: 1.4; }
.why-line b { font-weight: 600; color: var(--ink); }

/* ── Ideas review ── */
.idea-stack { max-width: 560px; margin: 0 auto; }
.idea-card { position: relative; padding: 30px 26px; min-height: 220px; transition: transform .2s ease, opacity .2s ease; touch-action: pan-y; user-select: none; }
.swipe-tag { position: absolute; top: 18px; font-weight: 700; font-size: 14px; padding: 4px 12px; border-radius: 980px; opacity: 0; transition: opacity .15s; }
.swipe-tag.keep { right: 18px; background: var(--success, #34c759); color: #fff; }
.swipe-tag.skip { left: 18px; background: var(--danger, #ff3b30); color: #fff; }
.idea-card.leaning-keep .swipe-tag.keep, .idea-card.leaning-skip .swipe-tag.skip { opacity: 1; }
.hint-keys { display: none; }
@media (hover: hover) and (pointer: fine) { .hint-touch { display: none; } .hint-keys { display: inline; } }


/* ── Accessibility ── */
:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
.help-item p a, .text-link { text-decoration: underline; text-underline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
