/* ===========================================================
   ASARCOB · Workshop demo · paleta sobria proyector-friendly
   =========================================================== */

:root {
  --bg:          #F8F8F6;   /* warm white */
  --bg-card:    #FFFFFF;
  --bg-subtle:  #EFEFEC;
  --ink:        #1A1A1A;
  --ink-muted:  #5E5E5E;
  --line:       #D9D9D6;
  --accent:     #0F5E4A;    /* deep green, projector-safe */
  --accent-soft:#D4E5DD;
  --highlight:  #C97F1A;    /* mustard for numbers */
  --highlight-soft:#F5E6D3;
  --rojo:       #B8483A;    /* veto hard */
  --rojo-soft:  #F2DAD6;
  --amarillo:   #B88A2A;    /* veto soft */
  --amarillo-soft:#F5EAD4;
  --verde:      #2E7D5B;    /* clean / playable */
  --verde-soft: #DBEDE2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------ layout ------ */
.app {
  display: block;            /* the chat is an on-demand drawer — no reserved column */
  min-height: 100vh;
}
.main {
  padding: 32px 40px 80px;
  max-width: 1100px;
  margin: 0 auto;
  transition: opacity 220ms ease;
}
body.copilot-open .main { opacity: 0.35; }

/* Copiloto — on-demand chat drawer */
.copilot-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  pointer-events: none;
}
body.copilot-open .copilot-backdrop { pointer-events: auto; }
.aside {
  position: fixed;
  top: 0; right: 0;
  width: 400px;
  max-width: 92vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--line);
  padding: 24px 28px;
  overflow-y: auto;
  z-index: 250;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(.4, 0, .2, 1);
}
body.copilot-open .aside {
  transform: translateX(0);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
}
.copilot-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink-muted);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.copilot-close:hover { color: var(--ink); border-color: var(--ink-muted); }

.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.header .meta {
  color: var(--ink-muted);
  font-size: 13px;
}

.replay-boot-btn {
  background: var(--ink);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 80ms;
  white-space: nowrap;
}
.replay-boot-btn:hover { opacity: 0.85; }

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

/* ------ stats ribbon ------ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
}
.stat .label {
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.stat .value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat .value.accent { color: var(--accent); }
.stat .value.highlight { color: var(--highlight); }

/* ------ veto ribbon (above the table) ------ */
.veto-ribbon {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 18px;
  color: var(--ink-muted);
  font-size: 14px;
}
.veto-ribbon strong { color: var(--ink); }
.veto-ribbon .pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-subtle); border-radius: 999px; padding: 4px 10px;
  font-size: 12px;
}

/* ------ ranking table ------ */
table.ranking {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
table.ranking thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
  font-weight: 600;
}
table.ranking tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}
table.ranking tbody tr:last-child td { border-bottom: none; }
table.ranking tbody tr {
  cursor: pointer;
  transition: background 80ms ease;
}
table.ranking tbody tr:hover { background: var(--accent-soft); }
table.ranking tbody tr.vetoed-hard { color: var(--ink-muted); }
table.ranking tbody tr.vetoed-hard:hover { background: var(--rojo-soft); }

.col-rank   { width: 50px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.col-name   { font-weight: 500; color: var(--ink); }
.col-monto  { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.col-score  { width: 120px; }
.col-razon  { color: var(--ink-muted); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.08em;
}
.badge.verde     { background: var(--verde-soft); color: var(--verde); }
.badge.amarillo  { background: var(--amarillo-soft); color: var(--amarillo); }
.badge.rojo      { background: var(--rojo-soft); color: var(--rojo); }

.score-bar {
  position: relative;
  background: var(--bg-subtle);
  height: 6px; border-radius: 3px; overflow: hidden;
  margin-top: 4px;
}
.score-bar .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 3px;
}
.score-num { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }

/* ------ case detail ------ */
.case {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px;
  margin-top: 8px;
}
.case h2 { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.case .case-dni { color: var(--ink-muted); font-size: 13px; margin-bottom: 24px; }

.case-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.case-row .k { color: var(--ink-muted); }
.case-row .v { color: var(--ink); font-variant-numeric: tabular-nums; }

.suggestion {
  margin-top: 28px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  border-radius: 0 6px 6px 0;
}
.suggestion h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.suggestion p { margin: 0; color: var(--ink); }

.whatsapp {
  margin-top: 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  position: relative;
}
.whatsapp h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  font-weight: 600;
}
.whatsapp .draft {
  background: var(--bg-subtle);
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 14px;
  white-space: pre-wrap;
  color: var(--ink);
  border-left: 3px solid var(--highlight);
}
.wa-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 20px;
  background: #25D366;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background 120ms ease;
}
.wa-cta:hover { background: #1EB257; }
.wa-note {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}
.whatsapp .pending {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--highlight);
  border-radius: 50%;
}

/* ------ chat ejecutivo (aside) ------ */
.aside h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin: 0 0 14px;
  font-weight: 600;
}
.aside h2 .live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.quick-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.quick-buttons button {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 80ms;
}
.quick-buttons button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 0;
}
.bubble {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  max-width: 95%;
}
.bubble.user {
  background: var(--accent-soft);
  align-self: flex-end;
  color: var(--ink);
}
.bubble.assistant {
  background: var(--bg-subtle);
  color: var(--ink);
  align-self: flex-start;
}
.bubble.thinking {
  background: var(--bg-subtle);
  color: var(--ink-muted);
  font-style: italic;
}
.bubble.fallback {
  background: var(--highlight-soft);
  color: var(--ink);
  border-left: 3px solid var(--highlight);
}

.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.chat-input input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}
.chat-input input:focus {
  outline: none;
  border-color: var(--accent);
}
.chat-input button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.chat-input button:hover { opacity: 0.92; }

/* ------ top nav ------ */
.topnav {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
}
.topnav a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 80ms;
}
.topnav a:hover { color: var(--ink); background: var(--bg-subtle); text-decoration: none; }
.topnav a.active {
  background: var(--accent);
  color: white;
}
.topnav-copilot {
  margin-left: 6px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: all 80ms;
}
.topnav-copilot:hover { background: var(--accent); color: white; }

/* ------ analyzer (transcript list + viewer) ------ */
.transcript-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}
.transcript-item {
  display: grid;
  grid-template-columns: 80px 1fr 140px 100px 80px;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 13.5px;
  transition: background 80ms;
}
.transcript-item:last-child { border-bottom: none; }
.transcript-item:hover { background: var(--accent-soft); }
.transcript-item .id { font-family: ui-monospace, monospace; color: var(--ink-muted); font-size: 12px; }
.transcript-item .name { color: var(--ink); font-weight: 500; }
.transcript-item .outcome { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.transcript-item .monto { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.transcript-item .src-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
}
.src-pill.real { background: var(--accent-soft); color: var(--accent); }
.src-pill.synthetic { background: var(--bg-subtle); color: var(--ink-muted); }

.analyzer-view {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  margin-top: 8px;
}
@media (max-width: 1000px) {
  .analyzer-view { grid-template-columns: 1fr; }
}

.transcript-pane {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
}
.transcript-pane h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.transcript-pane .meta {
  color: var(--ink-muted);
  font-size: 12px;
  margin-bottom: 20px;
  font-family: ui-monospace, monospace;
}

.turn {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
}
.turn.esmeralda {
  background: var(--bg-subtle);
  margin-right: 60px;
}
.turn.deudor {
  background: var(--accent-soft);
  margin-left: 60px;
}
.turn .who {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.turn .sentiment {
  font-weight: 500;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.sentiment.cooperativo  { background: var(--verde-soft);     color: var(--verde); }
.sentiment.neutro       { background: var(--bg-subtle);      color: var(--ink-muted); }
.sentiment.irritado     { background: var(--rojo-soft);      color: var(--rojo); }
.sentiment.confundido   { background: var(--highlight-soft); color: var(--highlight); }
.sentiment.desconectado { background: var(--bg-subtle);      color: var(--ink-muted); }

.turn.winner {
  outline: 2px solid var(--verde);
  outline-offset: -2px;
}
.turn.loser {
  outline: 2px solid var(--rojo);
  outline-offset: -2px;
}
.turn .badge-flag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.turn.winner .badge-flag { background: var(--verde); color: white; }
.turn.loser .badge-flag  { background: var(--rojo); color: white; }

.analysis-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.analysis-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
}
.analysis-card h3 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  font-weight: 600;
}
.analysis-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.analysis-card.accent {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.analysis-card.accent h3 { color: var(--accent); }
.analysis-card.warn {
  background: var(--rojo-soft);
  border-color: var(--rojo);
}
.analysis-card.warn h3 { color: var(--rojo); }
.analysis-card ul { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }
.analysis-card ul li { margin: 4px 0; }

/* ------ playbook generator ------ */
.playbook-card {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 22px 24px;
  margin-bottom: 24px;
}
.playbook-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.playbook-card .blurb { color: var(--ink-muted); font-size: 13px; margin: 0 0 14px; }
.playbook-card button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.playbook-card button:hover { opacity: 0.92; }

.playbook-result {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px;
  margin-top: 16px;
}
.playbook-result h2 { margin: 0 0 4px; font-size: 22px; }
.playbook-result .subtitle { color: var(--ink-muted); font-size: 13px; margin-bottom: 24px; }
.playbook-result .section { margin-bottom: 24px; }
.playbook-result .section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  font-weight: 600;
}
.playbook-result .frase {
  background: var(--verde-soft);
  border-left: 3px solid var(--verde);
  padding: 10px 14px;
  margin: 6px 0;
  font-size: 13.5px;
  border-radius: 0 4px 4px 0;
}
.playbook-result .frase.bad {
  background: var(--rojo-soft);
  border-left-color: var(--rojo);
}
.playbook-result .pattern {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.playbook-result .pattern:last-child { border-bottom: none; }
.playbook-result .pattern .count {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

/* ------ simulator ------ */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.sim-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 24px;
  text-align: left;
}
.sim-card.delta {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.sim-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.sim-card.delta .label { color: var(--accent); }
.sim-card .big {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.sim-card.delta .big { color: var(--accent); }
.sim-card .sub { color: var(--ink-muted); font-size: 12px; margin-top: 4px; }

.slider-row {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 16px 0 24px;
}
.slider-row .slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 12px;
}
.slider-row .slider-label .lbl { color: var(--ink-muted); }
.slider-row .slider-label .val {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
  font-size: 18px;
}
.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.funnel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  margin: 16px 0;
}
.funnel-row {
  display: grid;
  grid-template-columns: 200px 1fr 120px;
  gap: 16px;
  align-items: center;
  margin: 12px 0;
}
.funnel-row .stage { color: var(--ink); font-size: 14px; font-weight: 500; }
.funnel-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; font-size: 14px; }
.funnel-bar {
  height: 28px;
  border-radius: 4px;
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}
.funnel-bar .now {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--ink-muted);
  opacity: 0.4;
  transition: width 200ms ease;
}
.funnel-bar .with-ia {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--accent);
  transition: width 200ms ease;
}
.funnel-bar .with-ia-fill {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: white; font-weight: 600;
}

.assumption-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-muted);
}
.assumption-row strong { color: var(--ink); }

/* ------ "Generado por Claude" provenance pill ------ */
.gen-by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-muted);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0;
  border: 1px solid var(--line);
}
.gen-by::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.gen-by.live::before {
  background: var(--highlight);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ------ live streaming analyzer ------ */
.live-stream {
  margin-top: 16px;
}
.stream-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--highlight-soft);
  border-left: 3px solid var(--highlight);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 16px;
}
.stream-status .dot-live {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--highlight);
  animation: pulse 1s ease-in-out infinite;
}
.stream-status.done {
  background: var(--verde-soft);
  border-left-color: var(--verde);
}
.stream-status.done .dot-live {
  background: var(--verde);
  animation: none;
}

.live-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 80ms;
}
.live-button:hover { opacity: 0.85; }
.live-button::before {
  content: "▶";
  font-size: 10px;
}

/* ================================================
   WOW LAYER — visible process (boot, ranking, case, sim)
   ================================================ */

/* ---- A. boot overlay ---- */
.wow-boot {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 380ms ease;
}
.wow-boot.done { opacity: 0; pointer-events: none; }
.wow-boot-inner {
  max-width: 1200px;
  width: 92vw;
  padding: 56px 72px;
}
.wow-boot-eyebrow {
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: 44px;
}
.wow-boot-steps {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 20px;
  line-height: 1.7;
  color: var(--ink);
  min-height: 360px;
}
.wow-boot-step {
  display: flex;
  align-items: center;
  gap: 18px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms ease, transform 320ms ease;
  padding: 9px 0;
}
.wow-boot-step.on { opacity: 1; transform: translateY(0); }
.wow-boot-dot {
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: wow-pulse-dot 1.2s ease-in-out infinite;
}
@keyframes wow-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.wow-boot-step:not(:last-child) .wow-boot-dot {
  animation: none;
  background: var(--verde);
}
.wow-boot-progress {
  margin-top: 52px;
  height: 12px;
  background: var(--bg-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.wow-boot-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 360ms ease;
}

/* ---- B. ranking: vetos already have base, just need stagger ---- */
/* the JS handles stagger via inline styles; nothing else needed */

/* ---- C. case-detail thinking (3x size, ~15s) ---- */
.wow-case-thinking {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 90px 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  width: min(1240px, 92vw);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 38px;
  color: var(--ink-muted);
  margin-top: 8px;
}
.wow-case-dot {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 50%;
  animation: wow-pulse-dot 1s ease-in-out infinite;
  flex-shrink: 0;
}
.wow-case-step {
  transition: opacity 140ms ease;
  white-space: nowrap;
}

/* ---- D. simulator pulse ---- */
.sim-card.delta {
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.sim-card.delta.pulse {
  animation: wow-sim-pulse 600ms cubic-bezier(.4, .0, .2, 1);
}
@keyframes wow-sim-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(15, 94, 74, 0.0); transform: scale(1); }
  30%  { box-shadow: 0 0 0 8px rgba(15, 94, 74, 0.18); transform: scale(1.012); }
  100% { box-shadow: 0 0 0 0 rgba(15, 94, 74, 0.0); transform: scale(1); }
}

/* ---- E. case detail as a centered modal overlay ---- */
.case-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 20, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: case-fade 150ms ease-out;
}
.case-modal:empty { display: none; }
@keyframes case-fade { from { opacity: 0; } to { opacity: 1; } }
.case-modal .case {
  margin-top: 0;
  position: relative;
  max-width: 760px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  animation: case-pop 200ms cubic-bezier(.34, 1.3, .64, 1);
}
@keyframes case-pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.case-modal .wow-case-thinking {
  min-width: 420px;
  animation: case-pop 200ms cubic-bezier(.34, 1.3, .64, 1);
}
.case-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink-muted);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.case-close:hover { color: var(--ink); border-color: var(--ink-muted); }

/* analyzer detail + playbook reuse the modal overlay (#analyzer-view) */
.case-modal .analyzer-view,
.case-modal .playbook-result {
  margin-top: 0;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 56px 40px 36px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  animation: case-pop 200ms cubic-bezier(.34, 1.3, .64, 1);
}
.case-modal .analyzer-view { max-width: 1160px; }
.case-modal .playbook-result { max-width: 880px; }

/* ---- F. chat — thinking dots (ChatGPT-style) ---- */
.chat-dots { display: inline-flex; gap: 5px; align-items: center; }
.chat-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: chat-dot 1s ease-in-out infinite;
}
.chat-dots span:nth-child(2) { animation-delay: .15s; }
.chat-dots span:nth-child(3) { animation-delay: .30s; }
@keyframes chat-dot {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50%      { opacity: 1; transform: translateY(-3px); }
}

/* ------ footer ------ */
.footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ------ utilities ------ */
.muted { color: var(--ink-muted); }
.right { text-align: right; }
.mono  { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.spacer-lg { height: 32px; }
.spacer-md { height: 16px; }

/* hint indicator while htmx loads */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }

button:disabled { opacity: 0.5; cursor: not-allowed; }
