:root {
  --bg: #10110f;
  --panel: #181a16;
  --ink: #ebe6d8;
  --mute: #9a9486;
  --line: #2c2f28;
  --gold: #d6a441;
  --up: #3f9d72;
  --down: #c45c4a;
  --warn: #c9893a;
  --chip: #22251f;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 10% -10%, #2a2618 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 64px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 22px;
}
.brand { font-family: "Newsreader", Georgia, serif; font-size: 2rem; margin: 0; letter-spacing: -0.03em; }
.brand span { color: var(--gold); }
.lede { margin: 8px 0 0; color: var(--mute); max-width: 52ch; line-height: 1.45; }
.badge {
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
}
.panel h2, .block h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.25rem;
  margin: 0 0 12px;
}

.drop {
  border: 1px dashed var(--line);
  padding: 14px;
  margin-bottom: 10px;
  min-height: 88px;
}
.drop.over { border-color: var(--gold); }
.drop p { margin: 0 0 8px; color: var(--mute); font-size: 0.92rem; }
.drop strong { color: var(--ink); display: block; margin-bottom: 4px; }
.drop input[type="file"] {
  color: var(--ink);
  font: inherit;
  width: 100%;
}
.file-name { color: var(--gold); font-size: 0.85rem; margin-top: 8px; word-break: break-all; }

label.field { display: block; margin: 12px 0 6px; color: var(--mute); font-size: 0.85rem; }
input[type="number"], input[type="date"], select {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font: inherit;
}
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #1a160c;
  padding: 9px 12px;
}
button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

.hint { color: var(--mute); font-size: 0.82rem; line-height: 1.4; margin: 12px 0 0; }
.err { color: var(--down); font-size: 0.9rem; margin: 10px 0 0; }

.block { margin-bottom: 22px; }
.empty {
  border: 1px dashed var(--line);
  padding: 28px;
  color: var(--mute);
}

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--mute); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.num { font-variant-numeric: tabular-nums; }

.chip {
  display: inline-block;
  padding: 2px 7px;
  background: var(--chip);
  font-size: 0.75rem;
}
.chip.caliente { color: #1a160c; background: var(--gold); }
.chip.se-nota { color: var(--gold); }
.chip.tibio { color: var(--warn); }
.chip.interes-sube { color: var(--up); }
.chip.desinteres { color: var(--down); }
.chip.notable { color: var(--warn); }

.narrative {
  white-space: pre-wrap;
  line-height: 1.55;
  margin: 0;
  font-size: 0.98rem;
}
.narrative.slim { font-size: 0.88rem; color: var(--mute); margin-top: 12px; }

.story {
  border: 1px solid var(--line);
  background: #141611;
  padding: 4px 0 8px;
}
.story-sec {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.story-sec:last-child { border-bottom: 0; }
.story-sec h3 {
  margin: 0 0 6px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.story-sec.alarma h3 { color: var(--down); }
.story-lead {
  margin: 0 0 10px;
  color: var(--mute);
  line-height: 1.5;
  max-width: 62ch;
}
.story-list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.5;
}
.story-list li { margin: 0 0 8px; max-width: 68ch; }
.story-list li:last-child { margin-bottom: 0; }
.story-list li.alarma { color: #e0b4ad; }
.story-list li.sigue { color: #b7d4c5; }
.story-list li.suave { color: #e0c49a; }
.story-list li.caliente { color: var(--gold); }

.chart-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #141611;
}
.chart-dates-kicker {
  color: var(--mute);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 6px;
}
.chart-dates-gap { color: #4a4e45; }
.chart-date {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border: 1px solid #3a3424;
}
.chart-date.now { background: #2a2416; }
.chart-date small { color: var(--mute); font-size: 0.8em; }

.tv { width: 100%; height: auto; display: block; background: #121410; border: 1px solid var(--line); }
.tv line.day-grid { stroke: #3a3d36; stroke-width: 1.2; }
.tv .day-band { fill: #181b16; }
.tv .day-band.now { fill: #221e14; }
.tv .day-hit { fill: #d6a441; }
.tv .day-hit.gone { fill: #6a6e64; }
.tv .dlab { fill: #d6a441; font-size: 13px; font-weight: 500; text-anchor: middle; font-family: "IBM Plex Sans", sans-serif; }
.tv .dlab-year { fill: #8a8476; font-size: 10px; text-anchor: middle; }
.tv .axis-name { fill: #6f6a5e; font-size: 10px; font-family: "IBM Plex Sans", sans-serif; }
.tv .plot { fill: #121410; }
.tv line.live { stroke: #8a8476; stroke-width: 1; }
.tv line.watch { stroke: #c45c4a; stroke-width: 1.6; }
.tv line.seek { stroke: #d6a441; stroke-width: 2; }
.tv line.gone { stroke: #3a3d36; stroke-width: 1; stroke-dasharray: 4 4; }
.tv .plab { fill: #9a9486; font-size: 11px; font-family: "IBM Plex Sans", sans-serif; }
.tv .plab.watch { fill: #c45c4a; }
.tv .plab.seek { fill: #d6a441; font-weight: 600; }
.tv .plab.live { fill: #d6a441; }
.tv .plab.gone { fill: #4a4e45; }
.tv .plab.spot { fill: #ebe6d8; }
.tv .spot-path { fill: none; stroke: #c8c2b2; stroke-width: 1.4; }
.tv .spot-dot { fill: #ebe6d8; }
.tv .spot-now { fill: none; stroke: #ebe6d8; stroke-width: 1.2; }
.muted-id { margin-top: 4px; }
#tablero { margin-top: 14px; overflow-x: auto; }
#tablero td.on { color: var(--gold); }
#tablero td.off { color: #4a4e45; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
label.file-btn {
  display: inline-block;
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 12px;
}

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }

.seek-grid { display: grid; gap: 10px; }
.seek-card {
  border: 1px solid var(--line);
  padding: 12px 14px;
}
.seek-card.fuerte { border-color: var(--gold); }
.seek-card.posible { border-color: #3a4a32; }
.seek-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.seek-head strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.seek-card p { margin: 0 0 8px; }
.chip.fuerte, .chip.posible { color: var(--gold); }
.chip.suave { color: var(--warn); }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr; } }

.outlook { display: grid; gap: 12px; }
.outlook-card {
  border: 1px solid var(--line);
  padding: 12px 14px;
}
.outlook-card h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}
.outlook-card.up { border-color: #2a4a3a; }
.outlook-card.down { border-color: #4a2c28; }
.outlook-card.watch { border-color: #4a3d22; }
.outlook-card p { margin: 0 0 8px; line-height: 1.45; }
.outlook-list { margin: 0; padding-left: 18px; line-height: 1.5; }
.outlook-list li { margin: 0 0 6px; }
.outlook-list li.alarma { color: var(--down); }
.outlook-list li.sigue { color: var(--up); }
.outlook-list li.suave { color: var(--warn); }
.kpi { border: 1px solid var(--line); padding: 10px 12px; }
.kpi b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--mute); font-size: 0.8rem; }
