/* Oom v13 — Improvado brand: deep ink + #6D28D9 purple + neutrals. */
:root {
  --bg: #0b0b10;
  --bg-elev-1: #14141d;
  --bg-elev-2: #1c1c28;
  --border: #2a2a3a;
  --border-strong: #3b3b50;
  --text: #f3f3f7;
  --text-muted: #9a9aab;
  --text-dim: #6c6c80;
  --accent: #6D28D9;
  --accent-hover: #7c3aed;
  --accent-dim: #4c1d95;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --shadow-soft: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-elev: 0 12px 40px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(circle at 20% 0%, #1a0e2e 0%, var(--bg) 50%) fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-2 fix #3 (board #7).
   Screen-reader-only utility: visually invisible but readable by AT. Used by the
   #connect-aria region in index.html to announce chip state changes. */
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.required { color: var(--accent); margin-left: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.section-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); font-weight: 600; margin-bottom: 8px; display: block;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
code { font-family: var(--font-mono); background: var(--bg-elev-2); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }

/* ─── Buttons ─── */
.btn-primary, .btn-ghost {
  font: inherit; cursor: pointer; border-radius: var(--radius-sm);
  padding: 10px 18px; border: 1px solid transparent;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary {
  background: var(--accent); color: white; font-weight: 600;
  box-shadow: 0 2px 8px rgba(109,40,217,0.35);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--accent-dim); cursor: not-allowed; opacity: 0.6; transform: none; }
.btn-big { padding: 14px 28px; font-size: 16px; }
.btn-ghost {
  background: transparent; color: var(--text); border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-elev-1); border-color: var(--accent); }
.btn-ghost.danger { color: var(--danger); border-color: var(--danger); }
.btn-ghost.danger:hover { background: rgba(239,68,68,0.1); }

/* ─── Inputs ─── */
input[type=text], input[type=password], textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109,40,217,0.18);
}
textarea { resize: vertical; min-height: 120px; font-family: var(--font); }
.select { appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239a9aab' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
label { display: block; margin-bottom: 14px; }
small { display: block; margin-top: 4px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0; }
fieldset legend { padding: 0 8px; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* ─── Screens ─── */
.screen { min-height: 100vh; display: flex; flex-direction: column; }

/* Setup */
#setup-screen { justify-content: center; align-items: center; padding: 24px; }
.setup-card {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
  max-width: 540px; width: 100%; box-shadow: var(--shadow-elev);
}
.oom-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.oom-logo h1 { margin: 0; font-size: 28px; }
.oom-logo p { margin: 4px 0 0 0; font-size: 13px; }
.setup-intro { color: var(--text-muted); margin-bottom: 24px; }
.optional-block { margin: 20px 0; padding: 14px; background: var(--bg-elev-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.optional-block summary { cursor: pointer; padding: 4px 0; user-select: none; }
.optional-block[open] summary { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* Header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--border);
  background: rgba(11,11,16,0.85); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.user-chip {
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted);
}

/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — live Miras header chip.
   State-driven via data-state attribute set by wireMirasChip() in app.js. */
.miras-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); text-decoration: none;
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.miras-chip:hover { border-color: var(--accent); background: var(--bg-elev-1); }
.miras-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim); transition: background 0.2s, box-shadow 0.2s;
}
.miras-chip[data-state="up"]       { color: #34d399; border-color: rgba(52,211,153,0.40); background: rgba(52,211,153,0.10); }
.miras-chip[data-state="up"] .miras-dot { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,0.6); }
.miras-chip[data-state="probing"]  { color: var(--text-muted); }
.miras-chip[data-state="probing"] .miras-dot { background: var(--text-muted); animation: miras-pulse 1.4s ease-in-out infinite; }
.miras-chip[data-state="starting"] { color: #f59e0b; border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.10); }
.miras-chip[data-state="starting"] .miras-dot { background: #f59e0b; animation: miras-pulse 0.8s ease-in-out infinite; }
.miras-chip[data-state="down"]     { color: #ef4444; border-color: rgba(239,68,68,0.40); background: rgba(239,68,68,0.10); font-weight: 600; }
.miras-chip[data-state="down"] .miras-dot { background: #ef4444; }
@keyframes miras-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Main */
.app-main { padding: 32px 28px 80px; max-width: 980px; margin: 0 auto; width: 100%; flex: 1; }
section { margin-bottom: 28px; }

/* Quick-pick chips */
.quick-pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  background: var(--bg-elev-1); border: 1px solid var(--border);
  color: var(--text); transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); background: var(--bg-elev-2); }
.chip.active { background: var(--accent); border-color: var(--accent); }

/* Channels */
/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-6 fix #4 — 2x density.
   Narrower minmax (240→180) packs ~2x more chips above the fold; tighter padding
   (12/14 → 10/12) trims vertical run; .channels section margin trimmed below. */
.channel-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.channels { margin-bottom: 18px; }
.channel-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; background: var(--bg-elev-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s; position: relative;
}
.channel-card:hover { border-color: var(--accent); }
.channel-card.checked { background: rgba(109,40,217,0.08); border-color: var(--accent); }
.channel-card input { width: auto; margin: 4px 0 0 0; accent-color: var(--accent); }
.channel-card .ch-name { font-weight: 600; font-size: 14px; }
.channel-card .ch-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.channel-card .ch-tier {
  position: absolute; top: 10px; right: 10px;
  font-size: 9px; text-transform: uppercase; letter-spacing: 1px;
  padding: 2px 6px; border-radius: 3px;
}
.tier-high { background: rgba(109,40,217,0.15); color: var(--accent); }
.tier-medium { background: rgba(245,158,11,0.15); color: var(--warning); }
.tier-light { background: rgba(156,163,175,0.15); color: var(--text-muted); }

.voice-icp { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .voice-icp { grid-template-columns: 1fr; } }

/* Generate bar */
/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-5 fix #9 — sticky
   generate-bar so the primary CTA stays visible while the page scrolls. Glossy
   blur + top border + downward shadow give it a clear hover-above-content read. */
.generate-bar {
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; bottom: 0;
  padding: 14px 28px;
  background: rgba(11,11,16,0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.35);
  z-index: 30;
  border-radius: var(--radius);
  margin-top: 24px;
}
/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-5 fix #9 — soft horizontal
   separator between major sections (above #drafts-section). Linear-gradient fade so it
   reads as a divider, not a hard line. */
.section-rule {
  border: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 32px 0;
}
.cost-estimate { color: var(--text-muted); font-size: 13px; }
.cost-estimate strong { color: var(--text); font-size: 16px; }

/* Drafts output */
.drafts-section { margin-top: 36px; }
.drafts-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drafts-tools { display: flex; gap: 8px; }
.drafts-grid { display: grid; gap: 16px; }
.draft-card {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.draft-card header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.draft-card .draft-title { font-weight: 600; }
.draft-card .draft-meta { color: var(--text-muted); font-size: 12px; }
.draft-card .draft-actions { display: flex; gap: 8px; }
.draft-card .draft-actions .btn-ghost { padding: 6px 10px; font-size: 12px; }
.draft-body {
  padding: 18px; font-family: var(--font); line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.draft-body.streaming::after {
  content: '▋'; color: var(--accent); animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.draft-card .draft-status {
  padding: 4px 18px 14px; font-size: 11px; color: var(--text-dim);
  display: flex; gap: 14px;
}
.draft-card.error .draft-body { color: var(--danger); }

/* Footer */
.app-footer { text-align: center; padding: 20px; border-top: 1px solid var(--border); font-size: 12px; }

/* History drawer */
.history-drawer {
  position: fixed; top: 0; right: 0; width: 380px; max-width: 90vw;
  height: 100vh; background: var(--bg-elev-1); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-elev); z-index: 100;
  display: flex; flex-direction: column;
  transform: translateX(0); transition: transform 0.25s ease;
}
.history-drawer.hidden { transform: translateX(100%); display: flex !important; pointer-events: none; }
.history-drawer header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.history-drawer header h2 { margin: 0; font-size: 16px; }
.history-list { flex: 1; overflow-y: auto; padding: 8px; }
.history-item {
  padding: 12px 14px; margin-bottom: 6px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s;
}
.history-item:hover { background: var(--bg-elev-2); border-color: var(--border); }
.history-item .h-topic { font-weight: 500; font-size: 13px; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-item .h-meta { color: var(--text-dim); font-size: 11px; }
.history-drawer footer { padding: 14px 18px; border-top: 1px solid var(--border); }

/* Settings modal */
.settings-modal {
  background: var(--bg-elev-1); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; max-width: 520px; width: 90%;
  box-shadow: var(--shadow-elev);
}
.settings-modal::backdrop { background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.settings-modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.settings-modal header h2 { margin: 0; }
.settings-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Toast */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  background: var(--bg-elev-2); border: 1px solid var(--border);
  box-shadow: var(--shadow-soft); font-size: 13px;
  animation: slide-in 0.25s ease;
  max-width: 360px;
}
.toast.success { border-color: var(--success); }
.toast.warning { border-color: var(--warning); }
.toast.error { border-color: var(--danger); }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 4px; }
.tab {
  font: inherit; cursor: pointer;
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px;
  transition: all 0.15s;
}
.tab:hover { background: var(--bg-elev-1); color: var(--text); }
.tab.active { background: var(--bg-elev-2); color: var(--text); border-color: var(--border); }
.tab-panel { animation: fade-in 0.18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }
.panel-header { margin-bottom: 22px; }
.panel-header h2 { margin: 0 0 4px 0; font-size: 22px; }
.panel-header p { margin: 0; }

/* ─── Trends panel ─── */
.trends-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; padding: 12px 16px;
  background: var(--bg-elev-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.trends-tools { display: flex; gap: 10px; align-items: center; }
.cache-badge {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
}
.cache-badge.cache-hit { color: var(--success); border-color: var(--success); }
.cache-badge.cache-fresh { color: var(--accent); border-color: var(--accent); }
.trends-theme { margin-bottom: 28px; }
.theme-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 0 0 12px 0; }
.trends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.trend-card {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.trend-card:hover { border-color: var(--accent); }
.trend-card header { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.source-chip { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--bg-elev-2); border: 1px solid var(--border); }
.source-linkedin { color: #0a66c2; border-color: #0a66c2; }
.source-x        { color: #ffffff; border-color: #444; background: #000; }
.source-substack { color: #ff6719; border-color: #ff6719; }
.source-hackernews { color: #ff6600; border-color: #ff6600; }
.hook-chip { font-size: 10px; padding: 2px 8px; border-radius: 4px; background: var(--accent-dim); color: var(--text); }
.engagement-high, .engagement-medium, .engagement-rising {
  font-size: 10px; padding: 2px 8px; border-radius: 4px; margin-left: auto;
}
.engagement-high   { background: rgba(16,185,129,0.15); color: var(--success); }
.engagement-medium { background: rgba(245,158,11,0.15); color: var(--warning); }
.engagement-rising { background: rgba(156,163,175,0.15); color: var(--text-muted); }
.trend-title { font-weight: 600; line-height: 1.35; }
.trend-highlight { margin: 0; padding: 8px 12px; border-left: 2px solid var(--accent); color: var(--text-muted); font-size: 13px; font-style: italic; }
.trend-card footer { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.btn-use-topic { font-size: 11px !important; padding: 4px 10px !important; }
.error-banner { padding: 18px; background: rgba(239,68,68,0.1); border: 1px solid var(--danger); border-radius: var(--radius-sm); color: var(--danger); }
.error-banner small { display: block; margin-top: 6px; color: var(--text-muted); }

/* ─── Dashboard panel ─── */
.dashboard { display: flex; flex-direction: column; gap: 26px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-card {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-align: center;
}
.stat-num { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-num.stat-good { color: var(--success); }
.stat-num.stat-warn { color: var(--warning); }
.stat-num.stat-bad  { color: var(--danger); }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-top: 6px; }
.dashboard-section h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 0 0 14px 0; }

/* Heatmap */
.heatmap {
  display: grid; grid-template-columns: repeat(28, 1fr);
  gap: 3px; padding: 10px;
  background: var(--bg-elev-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.heatmap-cell {
  aspect-ratio: 1; border-radius: 2px;
  background: var(--bg-elev-2);
  transition: transform 0.1s;
}
.heatmap-cell:hover { transform: scale(1.4); border: 1px solid var(--text); }
.heat-0 { background: var(--bg-elev-2); }
.heat-1 { background: rgba(109,40,217,0.25); }
.heat-2 { background: rgba(109,40,217,0.5); }
.heat-3 { background: rgba(109,40,217,0.75); }
.heat-4 { background: var(--accent); }
.heatmap-legend { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 11px; }
.legend-cells { display: flex; gap: 3px; }
.legend-cells .heatmap-cell { width: 12px; height: 12px; aspect-ratio: auto; }

/* Bars */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 200px 1fr 40px; align-items: center; gap: 12px; }
.bar-label { font-size: 13px; }
.bar-track { background: var(--bg-elev-2); border-radius: 3px; height: 8px; overflow: hidden; }
.bar-fill { background: var(--accent); height: 100%; transition: width 0.3s; border-radius: 3px; }
.bar-value { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 12px; }

/* Cadence table */
.cadence-table { width: 100%; border-collapse: collapse; }
.cadence-table th { text-align: left; padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.cadence-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.cadence-on td:last-child      { color: var(--success); }
.cadence-partial td:last-child { color: var(--warning); }
.cadence-behind td:last-child  { color: var(--danger); }

/* ─── Self-build panel ─── */
.selfbuild-input { margin-bottom: 24px; }
.selfbuild-input details summary { cursor: pointer; padding: 8px 0; user-select: none; color: var(--text-muted); }
.selfbuild-actions { margin-top: 14px; }
.selfbuild-output {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.selfbuild-output header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.selfbuild-instructions {
  background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px 14px 28px;
  margin-bottom: 14px;
}
.selfbuild-instructions ol { margin: 0; padding: 0 0 0 16px; }
.selfbuild-instructions li { margin-bottom: 6px; line-height: 1.5; }
.selfbuild-prompt {
  background: #000; color: #d4d4d4;
  padding: 18px; border-radius: var(--radius-sm);
  overflow-x: auto; font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  max-height: 500px; overflow-y: auto;
  border: 1px solid var(--border);
}

/* ═══ v13.2 — Connect Everything strip (matches v12 gradient-strip pattern) ═══ */
.connect-strip {
  background: linear-gradient(135deg, rgba(109,40,217,0.18) 0%, rgba(76,29,149,0.08) 100%);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
}
.connect-strip-inner {
  display: flex; align-items: center; gap: 18px;
  max-width: 1240px; margin: 0 auto;
  flex-wrap: wrap;
}
.connect-mega {
  font-size: 14px; font-weight: 700; padding: 12px 22px;
  white-space: nowrap;
}
.connect-chips {
  display: flex; gap: 10px; flex-wrap: wrap; flex: 1;
}
.connect-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 4px 12px; border-radius: 999px;
  background: var(--bg-elev-1); border: 1px solid var(--border);
  white-space: nowrap;
}
.connect-chip .chip-msg { color: var(--text-dim); }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s;
}
.dot-unknown { background: var(--text-dim); }
.dot-probing { background: var(--warning); animation: pulse 1.5s ease-in-out infinite; }
.dot-ok      { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.dot-fail    { background: var(--danger); }
.dot-skip    { background: var(--text-dim); opacity: 0.5; }
@keyframes pulse { 50% { opacity: 0.3; transform: scale(0.8); } }

/* ═══ Centered nav (v12 pattern restored) ═══ */
.app-header { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; }
.app-header .brand    { justify-self: start; }
.app-header .tabs     { justify-self: center; }
.app-header .header-tools { justify-self: end; }

/* ═══ v12 card section title — purple uppercase h3 ═══ */
.dashboard-section h3,
.trends-theme .theme-title,
.panel-header h2 {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 700;
}

/* ═══ Sticky self-build bar (always-visible bottom — v12 pattern) ═══ */
.selfbuild-sticky {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(11,11,16,0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 12px 28px;
  display: flex; gap: 12px; align-items: center;
  z-index: 40;
}
.selfbuild-sticky input {
  flex: 1; background: var(--bg-elev-2); border-color: var(--border-strong);
}
.app-screen { padding-bottom: 80px; }  /* leave room for sticky bar */

/* ═══ History tab list (v12 history pattern) ═══ */
.history-tab-list {
  display: grid; gap: 8px;
}
.history-tab-row {
  display: grid; grid-template-columns: 1fr 200px 120px 120px;
  gap: 16px; align-items: center;
  padding: 14px 18px; background: var(--bg-elev-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s;
}
.history-tab-row:hover { border-color: var(--accent); background: var(--bg-elev-2); }
.history-tab-row .h-topic { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-tab-row .h-user  { color: var(--text-muted); font-size: 12px; }
.history-tab-row .h-meta  { color: var(--text-dim); font-size: 12px; }
.history-tab-row .h-time  { color: var(--text-dim); font-size: 12px; text-align: right; }

/* ═══ User-card grid (Who's been using Oom — v12 panel) ═══ */
.users-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.user-card {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; gap: 12px; align-items: center;
}
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-dim); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.user-card .u-name { font-weight: 600; font-size: 13px; }
.user-card .u-stat { color: var(--text-muted); font-size: 11px; }

/* ═══ Outbox banner ═══ */
.outbox-banner {
  background: rgba(245,158,11,0.1); border: 1px solid var(--warning); color: var(--warning);
  padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px;
  display: flex; gap: 12px; align-items: center;
}

/* ─── Calendar panel ─── */
.calendar-wrap { display: flex; flex-direction: column; gap: 18px; }
.calendar-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 4px;
}
.calendar-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.calendar-filters .chip {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 6px 14px;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.calendar-filters .chip:hover  { border-color: var(--accent); }
.calendar-filters .chip.active { background: var(--accent); border-color: var(--accent); color: white; }
.calendar-filters .chip.active .muted { color: rgba(255,255,255,0.75); }
.calendar-tools { display: flex; gap: 10px; align-items: center; }

.calendar-day {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
}
.calendar-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.calendar-day.is-past  { opacity: 0.82; }
.calendar-day-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 0 12px 0; font-size: 14px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text); font-weight: 600;
}
.calendar-day.is-today .calendar-day-header { color: var(--accent-hover); }
.calendar-day-list { display: flex; flex-direction: column; gap: 10px; }

.cal-entry {
  background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s, transform 0.1s;
}
.cal-entry:hover { border-color: var(--border-strong); }
.cal-entry.cal-saving { opacity: 0.6; }

.cal-entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cal-entry-title {
  font-weight: 600; color: var(--text); line-height: 1.35;
  text-decoration: none; flex: 1;
}
.cal-entry-title:hover { color: var(--accent-hover); text-decoration: underline; }
.cal-entry-meta { display: flex; gap: 12px; font-size: 12px; align-items: center; }
.cal-channel {
  background: rgba(109,40,217,0.18); color: var(--accent-hover);
  padding: 2px 10px; border-radius: 999px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.cal-status-badge {
  font-size: 10px; padding: 3px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
  border: 1px solid var(--border);
}
.cal-status-draft     { background: rgba(156,163,175,0.15); color: var(--text-muted); border-color: var(--border-strong); }
.cal-status-scheduled { background: rgba(245,158,11,0.15);  color: var(--warning); border-color: var(--warning); }
.cal-status-published { background: rgba(16,185,129,0.15);  color: var(--success); border-color: var(--success); }

.cal-entry-controls {
  display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
  border-top: 1px dashed var(--border); padding-top: 10px;
}
.cal-control { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 140px; }
.cal-control .select, .cal-control input[type=date] {
  padding: 6px 10px; font-size: 13px;
  background: var(--bg-elev-1);
}
.cal-flash { font-size: 11px; margin-left: auto; }
.cal-flash-success { color: var(--success); }
.cal-flash-error   { color: var(--danger); }

/* ═══ v13.2 — Credential broker UX (session 1458297f) ════════════════════ */

/* Welcome banner (replaces the legacy first-run setup screen) */
.welcome-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; font-size: 13px;
  background: linear-gradient(135deg, rgba(109,40,217,0.25) 0%, rgba(76,29,149,0.10) 100%);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: opacity 0.5s, max-height 0.5s;
  overflow: hidden;
}
.welcome-banner.welcome-banner-leaving { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }

/* Connect-strip chip enhancements (per-service Get-key + Paste-key actions) */
.connect-chip {
  flex-wrap: wrap;
}
.connect-chip[data-state="fail"]    { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.08); }
.connect-chip[data-state="skip"]    { border-color: var(--border); background: var(--bg-elev-1); opacity: 0.85; }
.connect-chip[data-state="ok"]      { border-color: rgba(16,185,129,0.30); background: rgba(16,185,129,0.06); }
.connect-chip .chip-label { font-weight: 500; }
.chip-actions {
  display: inline-flex; gap: 4px; margin-left: 4px;
}
.btn-xs {
  font-size: 11px; padding: 4px 9px; border-radius: var(--radius-sm);
  text-decoration: none;
}
.btn-xs.btn-getkey { letter-spacing: 0.3px; }

/* Inline paste-form (used by both Connect strip and Settings drawer) */
.paste-form {
  margin: 10px auto 0; max-width: 1200px;
  background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 14px 18px;
  animation: paste-slide-in 0.18s ease-out;
}
@keyframes paste-slide-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.paste-form-inner { display: flex; flex-direction: column; gap: 10px; }
.paste-form-inner strong { font-size: 13px; color: var(--text); }
.paste-field {
  display: flex; flex-direction: column; gap: 4px; margin: 0;
}
.paste-field span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.paste-field input {
  font-family: var(--font-mono); font-size: 12px;
  padding: 8px 12px; background: var(--bg-elev-1);
}
.paste-form-actions {
  display: flex; align-items: center; gap: 10px;
}
.paste-form-status { margin-left: auto; }

/* Settings drawer — Connected services list */
.settings-services {
  display: flex; flex-direction: column; gap: 6px;
}
.svc-row {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 14px; background: var(--bg-elev-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.svc-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim);
}
.svc-row.svc-ok   { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.05); }
.svc-row.svc-ok   .svc-dot { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.svc-row.svc-fail { border-color: rgba(239,68,68,0.30); background: rgba(239,68,68,0.05); }
.svc-row.svc-fail .svc-dot { background: var(--danger); }
.svc-row.svc-skip .svc-dot { background: var(--text-dim); opacity: 0.6; }
.svc-meta {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.svc-meta strong { font-size: 13px; }
.svc-actions { display: inline-flex; gap: 6px; }
.svc-paste-form {
  background: var(--bg-elev-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  margin: -2px 0 4px;
}

/* ═══ iter-2 fix #10 — chip ⋯ menu + inline spinner (session 1458297f) ═══ */
.chip-menu-wrap { position: relative; display: inline-flex; }
.chip-menu-trigger {
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); font-size: 14px; line-height: 1;
  padding: 1px 6px; border-radius: var(--radius-sm); cursor: pointer;
}
.chip-menu-trigger:hover { background: var(--bg-elev-2); color: var(--text); border-color: var(--border); }
.chip-menu[hidden] { display: none; }
.chip-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 4px 0;
  display: flex; flex-direction: column; min-width: 140px;
  z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.chip-menu-item {
  background: transparent; border: 0; color: var(--text);
  padding: 6px 12px; font-size: 12px; text-align: left; cursor: pointer;
}
.chip-menu-item:hover { background: var(--accent-dim); color: white; }

/* Brief flash for the chip that the jump-link scrolled to. */
@keyframes chip-flash-anim { 0%,100% { box-shadow: 0 0 0 0 transparent; } 30%,70% { box-shadow: 0 0 0 3px rgba(245,158,11,0.45); } }
.connect-chip.chip-flash { animation: chip-flash-anim 1.2s ease-in-out; }

/* Inline spinner used in paste-form-status (and elsewhere). */
.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--text-dim); border-top-color: var(--accent);
  border-radius: 50%; vertical-align: -2px; margin-right: 4px;
  animation: spinner-spin 0.8s linear infinite;
}
@keyframes spinner-spin { to { transform: rotate(360deg); } }

/* ═══ A — first-run guided tour (session 1458297f — C1 lift) ═══ */
/* Semi-transparent backdrop. pointer-events:none lets clicks fall through to
   the actual page underneath the cards so the user can still interact with
   anchored elements while the tour is up. */
.tour-overlay {
  position: fixed; inset: 0;
  background: rgba(11, 11, 16, 0.55);
  z-index: 9998;
  pointer-events: none;
  animation: tour-overlay-fade-in 0.25s ease-out;
}
@keyframes tour-overlay-fade-in { from { opacity: 0; } to { opacity: 1; } }

.tour-card {
  position: fixed;
  width: 300px;
  background: var(--bg-elev-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 2px rgba(109, 40, 217, 0.18);
  padding: 16px 18px 14px;
  z-index: 9999;
  pointer-events: auto;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  animation: tour-card-pop 0.28s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes tour-card-pop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.tour-card-header {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--accent); font-weight: 700; margin-bottom: 6px;
}
.tour-card-title {
  margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--text);
}
.tour-card-body {
  margin: 0 0 14px; color: var(--text-muted); font-size: 13px; line-height: 1.55;
}
.tour-card-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.tour-card-skip {
  background: transparent; border: 0; color: var(--text-dim);
  font: inherit; font-size: 12px; cursor: pointer; padding: 4px 8px;
}
.tour-card-skip:hover { color: var(--text-muted); }
.tour-card-next {
  background: var(--accent); color: white; border: 0;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
}
.tour-card-next:hover { background: var(--accent-hover); }

/* Arrow that points at the anchor element. The data-side attribute is set
   by tour.js based on which side of the anchor the card landed on. */
.tour-card-arrow {
  position: absolute;
  width: 0; height: 0;
  border: 8px solid transparent;
}
.tour-card-arrow[data-side="top"] {
  top: -16px;
  border-bottom-color: var(--accent);
  transform: translateX(-8px);
}
.tour-card-arrow[data-side="bottom"] {
  bottom: -16px;
  border-top-color: var(--accent);
  transform: translateX(-8px);
}
.tour-card-arrow[data-side="left"] {
  left: -16px;
  border-right-color: var(--accent);
  transform: translateY(-8px);
}
.tour-card-arrow[data-side="right"] {
  right: -16px;
  border-left-color: var(--accent);
  transform: translateY(-8px);
}
.tour-card-arrow[data-side="none"] { display: none; }

/* ═══ C — tab-tip exemplar banners (session 1458297f — C9 lift) ═══ */
.tab-tip {
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: rgba(109, 40, 217, 0.08);
  margin-bottom: 16px;
  border-radius: 4px;
}

/* Settings drawer — read-only Miras info */
.settings-miras-info { font-family: var(--font-mono); font-size: 11px; }
.miras-info-grid {
  display: grid; grid-template-columns: minmax(120px, auto) 1fr;
  gap: 4px 12px; margin: 0;
}
.miras-info-grid dt { color: var(--text-muted); }
.miras-info-grid dd { margin: 0; word-break: break-all; }
.miras-info-grid dd code { background: var(--bg-elev-2); }

/* ═══ iter-3 board fix #10 + iter-5 fixes #4/#10 — receipt modal (session 1458297f) ═══ */
.oom-receipt-modal {
  background: var(--bg-elev-1); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; max-width: 520px; width: 90%;
  box-shadow: var(--shadow-elev);
}
.oom-receipt-modal::backdrop { background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.oom-receipt-modal header { margin-bottom: 18px; }
.oom-receipt-modal header h2 { margin: 0; font-size: 22px; }
.oom-receipt-modal .receipt-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.oom-receipt-modal .stat {
  background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  text-align: center;
}
.oom-receipt-modal .stat-num {
  font-size: 26px; font-weight: 700; color: var(--accent-hover);
}
.oom-receipt-modal .stat-unit { font-size: 14px; color: var(--text-muted); margin-left: 2px; }
.oom-receipt-modal .stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-top: 4px;
}
/* iter-5 fix #10 — compute-key context line below stats. */
.oom-receipt-modal .receipt-compute {
  margin: 0 0 16px; padding: 8px 12px;
  background: var(--bg-elev-2); border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* iter-5 fix #4 — 3-chip next-action row. */
.oom-receipt-modal .receipt-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.oom-receipt-modal .receipt-chip {
  background: var(--bg-elev-2); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px;
  cursor: pointer; transition: all 0.15s ease;
}
.oom-receipt-modal .receipt-chip:hover {
  background: var(--accent-dim); border-color: var(--accent);
  color: white; transform: translateY(-1px);
}
.oom-receipt-modal footer {
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border); padding-top: 14px;
}
/* iter-5 fix #5 — per-card retry button visual lift. */
.btn-retry-channel { color: var(--accent-hover); }
.btn-retry-channel:hover { background: var(--accent-dim); color: white; border-color: var(--accent); }

/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-6 fix #3 — multi-frame receipt theatre.
   Frames A + B (Packaging drafts → Counting tokens) animate in/out with crossfade. */
.oom-receipt-frame { animation: receipt-frame-fade-in 0.28s ease-out; }
@keyframes receipt-frame-fade-in { from { opacity: 0; } to { opacity: 1; } }
.receipt-theatre {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; min-height: 160px; padding: 24px 12px;
}
.receipt-theatre-title {
  margin: 0; font-size: 22px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; gap: 12px;
}
.receipt-pulse-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(109,40,217,0.6);
  animation: receipt-pulse 1.2s ease-in-out infinite;
}
@keyframes receipt-pulse {
  0%   { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(109,40,217,0.55); }
  60%  { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(109,40,217,0); }
  100% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(109,40,217,0); }
}
.receipt-count {
  font-family: var(--font-mono); font-size: 42px; font-weight: 700;
  color: var(--accent-hover); font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   iter-7 polish (session 1458297f-1eb7-453e-999c-ac4d86045e66) — final 0.4 lift.
   Polish #2 — How-it-works diagram (Settings drawer).
   Polish #3 — Micro-animations on chips/cards + first-paint fade-in.
   Polish #4 — Typography pass for premium feel.
   Polish #5 — Receipt-modal motion refinement (pulse override + frame fade).
   ═══════════════════════════════════════════════════════════════════════════ */

/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-7 polish #4 — typography premium feel. */
body {
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.011em;
}
h1, h2, h3 {
  font-feature-settings: "ss01";
  letter-spacing: -0.022em;
  font-weight: 650;
}
/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-7 polish #4 — eyebrow nudge cooler. */
.section-label {
  letter-spacing: 1.4px;
  color: #7d7d92;
}
/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-7 polish #4 — kbd chip style for cheatsheet. */
kbd {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font: 11px/1 var(--font-mono);
  color: var(--text-muted);
}

/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-7 polish #3 — micro-animation refinements
   on chip / channel-card / connect-chip + first-paint fade-in keyframe. */
.connect-chip, .channel-card, .chip {
  transition: transform 0.12s ease, box-shadow 0.12s ease,
              background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.connect-chip:hover, .channel-card:hover, .chip:hover {
  transform: translateY(-1px);
}
@keyframes oom-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#connect-everything-strip .connect-strip {
  animation: oom-fade-in 0.18s ease-out;
}
.drafts-grid:not(.hidden) {
  animation: oom-fade-in 0.18s ease-out;
}
/* Already has transition: background 0.2s — restate for explicit pulse-in on state changes. */
.miras-dot {
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-7 polish #2 — How-it-works 3-step diagram (Settings drawer). */
.howit-grid {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
}
.howit-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  padding: 12px;
  min-width: 110px;
  flex: 1 1 0;
}
.howit-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}
.howit-body {
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
}
.howit-body strong { color: var(--text); }
.howit-arrow {
  font-size: 24px;
  color: var(--text-muted);
  align-self: center;
  line-height: 1;
  flex: 0 0 auto;
}
@media (max-width: 520px) {
  .howit-grid { flex-direction: column; align-items: stretch; }
  .howit-arrow { transform: rotate(90deg); }
}

/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-7 polish #5 — receipt pulse refinement.
   Cleaner scale curve + opacity fade per spec; overrides the earlier ring-pulse so the Frame A dot
   reads as a heartbeat instead of a sonar ping. */
.receipt-pulse-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: none;
  animation: pulse 800ms ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 0.85; }
  50%      { transform: scale(1.4); opacity: 0.4; }
}
/* Frame opacity transition for crossfade on mount — JS sets opacity:0 then rAF→1. */
.oom-receipt-frame {
  transition: opacity 200ms ease;
}

/* Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 — iter-8 gap #5 — gradient-shimmer sweep
   on `.howit-arrow` during celebration. JS toggles `.howit-arrow-shimmer` on celebrate, removes
   ~1.6s later. Linear-gradient + background-clip:text masks the gradient to the arrow glyph;
   keyframes sweep `background-position` 200% → -100% for a left-to-right pass. */
.howit-arrow-shimmer {
  background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--accent-hover) 50%, var(--accent) 60%, transparent 100%);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: oom-arrow-shimmer 1500ms ease-out forwards;
}
@keyframes oom-arrow-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

/* Added: session a3589bd3-c6ee-406a-bf4e-2e17354f1b92, one-click OAuth chip layout.
   Primary OAuth button + collapsible Advanced fallback. */
.connect-chip .btn-oauth {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  font-weight: 600;
  padding: 4px 12px;
  box-shadow: 0 1px 2px rgba(109,40,217,0.25);
}
.connect-chip .btn-oauth:hover {
  background: var(--accent-hover, #7c3aed);
  border-color: var(--accent-hover, #7c3aed);
}
.connect-chip .btn-oauth:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.connect-chip .paste-fallback {
  display: inline-block;
  margin-left: 6px;
}
.connect-chip .paste-fallback summary {
  cursor: pointer;
  list-style: none;
  padding: 2px 4px;
  border-radius: 4px;
  user-select: none;
}
.connect-chip .paste-fallback summary::-webkit-details-marker {
  display: none;
}
.connect-chip .paste-fallback summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 4px;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.connect-chip .paste-fallback[open] summary::before {
  transform: rotate(90deg);
}
.connect-chip .paste-fallback summary:hover {
  color: var(--text);
}
.connect-chip .paste-fallback summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.connect-chip .paste-fallback-body {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
  align-items: center;
}

/* Added: session a3589bd3-c6ee-406a-bf4e-2e17354f1b92, Device-Flow code banner.
   Shows the github.com user_code prominently when the popup is blocked OR when
   the user prefers to switch tabs manually. role="status" + aria-live="polite"
   so screen readers announce code arrival without stealing focus. */
.device-code-banner {
  margin-top: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(109,40,217,0.10), rgba(109,40,217,0.05));
  border: 1px solid rgba(109,40,217,0.35);
  border-radius: var(--radius-md);
  animation: oom-fade-in 0.22s ease-out;
}
.device-code-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.device-code-headline {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.device-code-headline strong {
  font-size: 14px;
  color: var(--text);
}
.device-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.device-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg-elev-2);
  border: 1px dashed var(--border);
  border-radius: 999px;
}
.device-code-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.device-code-value {
  font: 600 18px/1 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  letter-spacing: 2px;
  color: var(--accent);
  user-select: all;
}
.device-code-foot {
  margin: 0;
}
@media (max-width: 520px) {
  .device-code-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Added: session a3589bd3-c6ee-406a-bf4e-2e17354f1b92, high-contrast focus-visible
   on every interactive control inside the connect strip for WCAG 2.4.7. */
#connect-everything-strip button:focus-visible,
#connect-everything-strip a:focus-visible,
#connect-everything-strip [role="button"]:focus-visible,
.device-code-banner button:focus-visible,
.device-code-banner a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Added: session a3589bd3-c6ee-406a-bf4e-2e17354f1b92, prefers-reduced-motion
   honor across the new banner + chip animations. */
@media (prefers-reduced-motion: reduce) {
  .device-code-banner,
  #connect-everything-strip .connect-strip,
  .drafts-grid:not(.hidden) {
    animation: none !important;
  }
  .connect-chip:hover, .channel-card:hover, .chip:hover {
    transform: none !important;
  }
}

/* ═══ Added: session a3589bd3-c6ee-406a-bf4e-2e17354f1b92, council shards B + C ═══ */

/* Gap B6: determinate progress bar above the streaming/queued/done counter. */
.generate-status-bar {
  margin: 0 0 12px 0;
  padding: 10px 12px;
  background: var(--bg-elev-1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.generate-status-bar progress.generate-progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-bottom: 8px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.generate-status-bar progress.generate-progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}
.generate-status-bar progress.generate-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 999px;
  transition: width 0.18s ease;
}
.generate-status-bar progress.generate-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 999px;
}
.generate-status-bar .generate-status-text { font-size: 13px; }

/* Gap C7: explicit retention statement under the How-it-works diagram. */
.howit-retention {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
  text-align: center;
  font-style: italic;
}

/* Gap C8: inline hint paragraph under sensitive paste-field inputs. */
.paste-field-hint {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.4;
}

/* Gaps B1 / B2 / B14: device-code banner nudge + broker-error note + expired state. */
.device-code-nudge {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}
.device-code-error {
  margin: 0;
  color: var(--danger, #ef4444);
  font-weight: 500;
}
.device-code-banner.expired {
  background: linear-gradient(180deg, rgba(127, 127, 127, 0.06), rgba(127, 127, 127, 0.03));
  border-color: rgba(127, 127, 127, 0.25);
  opacity: 0.92;
}
.device-code-banner.expired .device-code-pill,
.device-code-banner.expired .device-code-value,
.device-code-banner.expired .device-code-countdown {
  opacity: 0.55;
  text-decoration: line-through;
}


/* ─────────────── Login screen ───────────────
 * Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 - GitHub OAuth login gate.
 * Full-viewport overlay shown before any /api/oom/auth/session call confirms a
 * valid Bearer session. Pairs with the #app-screen .hidden class used by the
 * legacy boot path so the two surfaces never co-exist visually.
 */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20%% 0%%, #1a0e2e 0%%, var(--bg) 60%%) fixed;
  padding: 32px;
  z-index: 200;
}
.login-card {
  max-width: 440px; width: 100%%;
  padding: 40px 36px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-elev);
  animation: oom-fade-in 0.24s ease-out;
}
.login-brand {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 6px;
}
.login-logo {
  font-size: 32px; color: var(--accent); line-height: 1;
}
.login-brand h1 {
  margin: 0; font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em;
}
.login-tagline {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 14px;
}
.btn-gh-sign-in {
  width: 100%%;
  justify-content: center;
  background: #24292e;
  border-color: #24292e;
  font-size: 15px;
  padding: 14px 28px;
  display: inline-flex; gap: 10px; align-items: center;
}
.btn-gh-sign-in:hover {
  background: #1a1f24;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.30);
}
.btn-gh-sign-in:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-gh-sign-in:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-gh-sign-in svg { flex: 0 0 auto; }
.login-fine-print {
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.login-fine-print code { font-size: 0.9em; padding: 1px 6px; }
.login-setup-hint {
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  color: #fcd34d;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}
.login-setup-hint strong { display: block; margin-bottom: 4px; color: #f59e0b; }
.login-setup-hint code { background: rgba(0, 0, 0, 0.30); }
.login-setup-hint a { color: #fcd34d; text-decoration: underline; }
.login-error {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  text-align: left;
}

/* Sign-out chip in the header tools.
 * Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 - login-gate header element.
 */
.user-chip-button {
  cursor: pointer;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font: inherit; color: var(--text-muted);
  font-size: 12px;
  transition: all 0.15s ease;
}
.user-chip-button:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-elev-1);
}
.user-chip-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.user-chip-name { font-weight: 500; }
.user-chip-icon { opacity: 0.7; }

@media (prefers-reduced-motion: reduce) {
  .login-card { animation: none !important; }
}

@media (max-width: 480px) {
  .login-card { padding: 28px 22px; }
  .login-brand h1 { font-size: 22px; }
  .login-tagline { font-size: 13px; }
}

/* ─────────── Device Flow + first-run wizard (oom-broker-1.4) ───────────
 * Added: session 1458297f-1eb7-453e-999c-ac4d86045e66 - Device Flow + inline
 * wizard styles. No yellow "admin setup required" alarm anywhere; setup hints
 * are rendered into the same #login-body via auth.js state machine, with the
 * same purple/neutral palette as the rest of the SPA. Errors use a compact red
 * tint, never a full-card banner.
 */
.login-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  width: 100%;
}
.login-body > * { width: 100%; }
.login-cta {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.login-cta-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.login-cta-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: oom-login-spin 0.9s linear infinite;
  margin-left: 6px;
}
@keyframes oom-login-spin {
  to { transform: rotate(360deg); }
}

.device-progress {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(109, 40, 217, 0.08);
  border: 1px solid rgba(109, 40, 217, 0.30);
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.device-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(109, 40, 217, 0.18);
  border: 1px solid rgba(109, 40, 217, 0.35);
  width: fit-content;
}
.device-progress-pill-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.device-progress-pill-value {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  background: transparent;
  padding: 0;
}
.device-progress-copy {
  margin-left: 4px;
}
.device-progress-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.device-progress-countdown {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text-muted);
}
.device-progress-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.device-progress-detail {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.device-progress-detail code {
  font-size: 0.92em;
  padding: 1px 6px;
}
.device-progress-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}
.device-progress-error .device-progress-status strong {
  color: var(--danger);
}

.login-wizard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wizard-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 0 0 4px;
}
.wizard-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.18s ease;
}
.wizard-dot.active { background: var(--accent); }
.wizard-dot.done { background: rgba(109, 40, 217, 0.55); }
.wizard-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wizard-step-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.wizard-step-tip {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.wizard-step-tip strong { color: var(--text); font-weight: 600; }
.wizard-step-tip code,
.wizard-instructions code {
  font-size: 0.9em;
  padding: 1px 6px;
}
.wizard-instructions ol {
  margin: 8px 0 0;
  padding-left: 22px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.wizard-instructions ol li { margin: 4px 0; }
.wizard-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.wizard-back {
  display: inline-flex;
  align-items: center;
}
.wizard-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wizard-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.18);
}
.wizard-input-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: -4px;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .login-cta-spinner { animation: none !important; }
  .device-progress,
  .login-wizard,
  .wizard-step { transition: none !important; }
}
