/* ============================================================
   KAL — Noir editorial (dirección A, aprobada por Ricardo 2026-09-11)
   Sistema de tokens con modo oscuro (base) y modo claro (toggle).
   Reglas: portada a sangre + degradado + título HTML; número en
   pastilla HTML, nunca horneado; un solo CTA claro por vista.
   ============================================================ */

:root {
  --paper: #16120d;
  --paper-2: #1c1712;
  --card: #221c14;
  --card-2: #2a2318;
  --ink: #f2ead9;
  --ink-strong: #fbf6ea;
  --ink-soft: #cfc4ae;
  --muted: #8d8271;
  --line: #3a332a;
  --red: #c2402a;
  --red-dark: #a53320;
  --red-soft: #e8b07f;
  --on-red: #fff8ef;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.35);
  --shade: linear-gradient(180deg, rgba(10,8,5,.28) 0%, rgba(10,8,5,0) 34%, rgba(10,8,5,.58) 66%, rgba(10,8,5,.92) 100%);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --paper: #f5f0e6;
  --paper-2: #efe8da;
  --card: #fdfaf3;
  --card-2: #f7f1e4;
  --ink: #211c15;
  --ink-strong: #171310;
  --ink-soft: #4c443a;
  --muted: #7a7061;
  --line: #d8cfbd;
  --red: #b3341f;
  --red-dark: #8f2716;
  --red-soft: #b3341f;
  --on-red: #fdfaf3;
  --shadow: 0 14px 34px rgba(30, 24, 14, 0.16);
  --shadow-soft: 0 8px 22px rgba(30, 24, 14, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

main { display: block; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: var(--red); color: var(--on-red); }

/* ---------- Masthead ---------- */

.topbar { border-bottom: 1px solid var(--line); background: var(--paper); }

.masthead-rule { height: 4px; background: var(--red); }

.masthead {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.dateline {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand { text-decoration: none; color: var(--ink-strong); display: inline-block; }

.brand-mark {
  display: block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 6.4vw, 72px);
  line-height: 0.95;
  letter-spacing: 0.04em;
}

.brand-mark .vm, .colophon-mark .vm { color: var(--red); }

.brand-copy {
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
}

.theme-toggle {
  position: absolute;
  top: 18px;
  right: 24px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.theme-toggle:hover { color: var(--ink-strong); border-color: var(--muted); }

.nav {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.nav a {
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav a:hover { color: var(--red); border-bottom-color: var(--red); }

/* ---------- Shared type ---------- */

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red-soft);
}

.kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-soft);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.08; margin: 0; color: var(--ink-strong); }

.section-heading { max-width: 1240px; margin: 0 auto 28px; padding: 0 24px; }

.section-heading h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 8px; }

.section-heading p { max-width: 640px; margin: 0; color: var(--ink-soft); }

/* ---------- Player / hero ---------- */

.listen-stage {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.player-surface {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.player-surface > .eyebrow { margin-bottom: 20px; }

.now-playing {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* cover art: full-bleed con degradado + capas HTML */
.cover-art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--a, #2f2620) 32%, #16120d), color-mix(in srgb, var(--b, #6e2c1c) 32%, #16120d));
}

.cover-art > span.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  color: #f5efe2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-shade {
  position: absolute;
  inset: 0;
  background: var(--shade);
  pointer-events: none;
}

.cover-num {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--red);
  color: var(--on-red);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

.cover-tt {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.12;
  color: #fbf6ea;
  text-shadow: 0 2px 14px rgba(0,0,0,.5);
}

.cover-art.large {
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  box-shadow: var(--shadow);
  background-size: cover;
  background-position: center;
}

.cover-art.has-cover > span.cover-fallback { opacity: 0; }

.player-copy h1 { font-size: clamp(32px, 4.2vw, 52px); margin-bottom: 12px; }

.player-copy .summary { margin: 0; font-size: 17px; color: var(--ink-soft); max-width: 56ch; }

/* audio bar v2: transporte centrado + seek + secundarios (patrón app de audio) */
.audio-bar {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.transport { display: flex; align-items: center; justify-content: center; gap: 14px; }
.transport .primary-action { padding: 16px 36px; font-size: 13px; box-shadow: var(--shadow-soft); }
.transport .skip-action { padding: 13px 18px; background: transparent; }
.misc-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.misc-controls .secondary-action { padding: 10px 16px; font-size: 11px; background: transparent; }
.speed-group {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; background: transparent;
}
.speed-group input[type="range"] { width: 84px; }
.speed-group .speed-pill { min-width: 30px; text-align: center; }

.primary-action,
.secondary-action,
.skip-action,
.personal-actions button,
.ask-actions button,
.card-actions button,
.work-list button {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink);
  padding: 12px 22px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.primary-action, #askButton, #applyPreferences, .card-actions button:first-child {
  background: var(--red);
  border-color: var(--red);
  color: var(--on-red);
}

.primary-action:hover { background: var(--red-dark); }

.secondary-action:hover,
.skip-action:hover,
.personal-actions button:hover,
.ask-actions button:hover,
.card-actions button:hover,
.work-list button:hover { border-color: var(--muted); color: var(--ink-strong); }

#askButton:hover, #applyPreferences:hover, .card-actions button:first-child:hover { background: var(--red-dark); }

.control-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

input[type="range"] { accent-color: var(--red); }

.time-pill {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--ink-soft);
  background: var(--paper-2);
}

/* waveform */
.waveform {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
  margin-top: 18px;
  padding: 0 10px;
  margin: 24px 0 4px;
}

.waveform span { flex: 1; background: var(--line); height: 30%; transition: height 0.3s; }
.waveform span:nth-child(3n) { height: 60%; }
.waveform span:nth-child(4n) { height: 85%; }
.waveform span:nth-child(5n) { height: 45%; }

.waveform.playing span { background: var(--red); animation: calWave 0.9s ease-in-out infinite alternate; }
.waveform.playing span:nth-child(2n) { animation-delay: 0.15s; }
.waveform.playing span:nth-child(3n) { animation-delay: 0.3s; }
.waveform.playing span:nth-child(5n) { animation-delay: 0.45s; }

@keyframes calWave { from { height: 20%; } to { height: 95%; } }

/* chapters */
.chapters-panel { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }

.chapters-panel h2 { font-size: 24px; margin-bottom: 14px; }

.chapters-panel ol { margin: 0; padding: 0; list-style: none; }

.chapters-panel li {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}

.chapters-panel li span {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--red-soft);
  min-width: 22px;
}

/* source strip */
.source-strip {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  font-size: 13px;
}

.source-strip span { color: var(--muted); }

.source-strip a, .mini-link, .card-actions a {
  color: var(--red-soft);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.source-strip a:hover, .mini-link:hover, .card-actions a:hover { color: var(--ink-strong); }

.original-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-soft);
  border: 1px solid var(--red);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.card-topline > span:first-child { min-width: 0; }

/* ---------- Personal panel ---------- */

.personal-panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  position: sticky;
  top: 24px;
}

.panel-heading h2 { font-size: 24px; margin-bottom: 18px; }

.personal-panel label {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.personal-panel select,
.filters select,
.filters input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.priority-box p, .saved-box p {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.interest-control {
  display: grid !important;
  grid-template-columns: 1fr 90px 24px auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 13px !important;
}

.interest-control strong { font-weight: 600; color: var(--ink); }

.interest-control output { font-size: 13px; color: var(--red-soft); font-weight: 700; text-align: right; }

.personal-actions { display: flex; gap: 10px; margin-top: 16px; }
.personal-actions button { flex: 1; padding: 11px 10px; }

.saved-item {
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}

.saved-item:hover { border-left-color: var(--red-soft); }

.saved-list { font-size: 14px; color: var(--muted); }

/* ---------- Rails ---------- */

.rail-section { padding: 16px 0 48px; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 260px;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 24px 20px;
  scroll-snap-type: x mandatory;
}

.rail-card {
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.rail-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }

.rail-card .cover-art { border: 0; border-radius: 0; }

.rail-card-copy { padding: 14px 16px 18px; }

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail-card-copy h3 { font-size: 20px; margin-bottom: 8px; }

.rail-card-copy p { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* ---------- Library ---------- */

.library-section { padding: 24px 0 56px; }

.filters {
  max-width: 1240px;
  margin: 0 auto 18px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 14px;
}

.filters label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.result-count {
  max-width: 1240px;
  margin: 0 auto 18px;
  padding: 0 24px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 22px;
}

.investigation-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}

.investigation-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }

.investigation-card .cover-art { border: 0; border-radius: 0; aspect-ratio: 3/4; }

.investigation-card .card-topline { padding: 14px 18px 0; }

.investigation-card h3 { font-size: 22px; padding: 0 18px; margin-bottom: 10px; }

.investigation-card > p { margin: 0; padding: 0 18px 12px; font-size: 14px; color: var(--ink-soft); flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }

.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  padding: 3px 9px;
}

.meta-box {
  margin: 0 18px 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  border-radius: 0 10px 10px 0;
  background: var(--paper-2);
  font-size: 13px;
  color: var(--ink-soft);
}

.meta-box span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.card-actions button { padding: 9px 16px; }

.card-actions a { margin-left: auto; font-size: 13px; }

/* ---------- People ---------- */

.people-section { padding: 24px 0 56px; }

.people-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.person-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }

.person-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.person-card-head p { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red-soft); }

.person-card-head h3 { font-size: 22px; }

.person-card-head > span { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--red-soft); }

.person-bio { font-size: 14px; color: var(--ink-soft); }

.person-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; font-size: 13px; }

.person-links a { color: var(--red-soft); text-decoration: none; border-bottom: 1px solid currentColor; font-weight: 600; }

.work-list strong { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.work-list > div { display: flex; flex-wrap: wrap; gap: 8px; }

.work-list button { padding: 7px 12px; font-size: 11px; }

.work-list span { font-size: 13px; color: var(--muted); }

/* ---------- ASK KAL ---------- */

.ask-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.ask-copy h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 12px; }

.ask-copy > p { color: var(--ink-soft); max-width: 52ch; }

.prompt-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.prompt-row button {
  font-size: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  font-family: var(--sans);
  color: var(--ink);
}

.prompt-row button:hover { border-color: var(--muted); color: var(--ink-strong); }

.ask-console {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.ask-console textarea {
  width: 100%;
  padding: 14px;
  font-family: var(--sans);
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink);
  resize: vertical;
}

.ask-actions { display: flex; gap: 10px; margin: 14px 0; }

.answer-box {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.answer-box h4 { font-family: var(--serif); margin: 14px 0 6px; font-size: 17px; color: var(--ink-strong); }
.answer-box a { color: var(--red-soft); font-weight: 600; }

/* ---------- Sources ---------- */

.sources-section { padding: 24px 0 64px; }

.source-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.source-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 16px;
  padding: 18px;
}

.source-tile h3 { font-size: 19px; margin-bottom: 8px; }

.source-tile p { margin: 0 0 10px; font-size: 14px; color: var(--ink-soft); }

/* ---------- Detail dialog ---------- */

.detail-dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  max-width: 860px;
  width: calc(100% - 40px);
  padding: 0;
  box-shadow: var(--shadow);
}

.detail-dialog::backdrop { background: rgba(8, 6, 4, 0.72); }

.dialog-shell { padding: 28px; }

.close-button {
  float: right;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
}

.close-button:hover { border-color: var(--muted); color: var(--ink-strong); }

.dialog-hero { margin-bottom: 20px; }

.dialog-hero .cover-art { aspect-ratio: 16 / 8; }

.dialog-body h2 { font-size: clamp(28px, 3.6vw, 42px); margin: 10px 0 12px; }

.dialog-body .dialog-meta { color: var(--ink-soft); font-size: 15px; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.meta-grid .meta-box { margin: 0; }

.dialog-body .tags { padding: 0; margin-bottom: 16px; }

.dialog-body .source-strip { border-top: 1px solid var(--line); padding-top: 16px; }

.dialog-body button[data-listen-id] {
  background: var(--red);
  border: 1px solid var(--red);
  color: var(--on-red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  margin-top: 8px;
}

/* ---------- Footer ---------- */

.colophon {
  border-top: 1px solid var(--line);
  background: #100d09;
  color: #f2ead9;
  text-align: center;
  padding: 44px 24px;
}

[data-theme="light"] .colophon { background: var(--ink); color: var(--paper); }

.colophon-mark {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 44px;
  margin: 0 0 8px;
  letter-spacing: 0.06em;
}

.colophon p:last-child { margin: 0 auto; max-width: 52ch; font-size: 14px; color: #b8ae9c; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .stage-grid { grid-template-columns: 1fr; }
  .personal-panel { position: static; }
  .now-playing { grid-template-columns: 280px minmax(0, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .now-playing { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .cover-art.large { max-width: min(320px, 82vw); aspect-ratio: 1 / 1; width: 100%; }
  .now-playing .player-copy { width: 100%; }
  .ask-section { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .time-pill { margin-left: 0; width: 100%; text-align: center; }
  .player-surface { padding: 22px 18px; }
  .rail { grid-auto-columns: 230px; }
  .card-grid { grid-template-columns: 1fr; }
  .interest-control { grid-template-columns: 1fr 90px 24px auto; }
  .theme-toggle { position: static; margin: 10px auto 0; }
}

/* ---------- Listening progress ---------- */

.listen-progress {
  position: relative;
  height: 4px;
  background: var(--line);
  margin: 14px 18px 2px;
}

.listen-progress i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); }

.listen-progress em {
  position: absolute;
  left: 0; top: 9px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.listen-progress.done i { background: #5f9e6e; }
.listen-progress.done em { color: #5f9e6e; }

.investigation-card .listen-progress { margin-bottom: -6px; }
.investigation-card .listen-progress + .card-topline { padding-top: 22px; }
.rail-card .listen-progress + .rail-card-copy { padding-top: 26px; }

.dialog-chapters {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-width: 60ch;
}

.dialog-chapters li {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}

.dialog-chapters li span {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--red-soft);
  min-width: 20px;
}

.skip-action { padding: 12px 14px; font-variant-numeric: tabular-nums; }

.speed-pill,
.seek-time {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.seek-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.seek-bar input[type="range"] { flex: 1; accent-color: var(--red); height: 4px; cursor: pointer; }

@media (max-width: 700px) { .seek-bar { width: 100%; } }

/* ---------- Brief diario (filas noir, CTA único) ---------- */

.brief-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
  margin: 0 0 18px;
  max-width: 1240px;
}
.rail-section .brief-card { margin-left: 24px; margin-right: 24px; }
@media (min-width: 1290px) { .rail-section .brief-card { margin-left: auto; margin-right: auto; } }

.brief-head .eyebrow { margin: 0 0 6px; }
.brief-head h3 { margin: 0 0 4px; font-size: 1.5rem; }
.brief-copy { margin: 0 0 12px; color: var(--ink-soft); }
.brief-themes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.brief-theme {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink-soft);
  background: var(--paper-2);
}
.brief-items { display: flex; flex-direction: column; margin: 0 0 14px; }
.brief-items button {
  display: flex;
  align-items: baseline;
  gap: 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 15px 2px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}
.brief-items button:last-child { border-bottom: none; }
.brief-items button:hover .brief-t, .brief-items button:focus-visible .brief-t { color: var(--red-soft); }
.brief-items .brief-n {
  color: var(--red-soft);
  font-family: var(--serif);
  font-weight: 800;
  font-size: 22px;
  min-width: 26px;
}
.brief-items .brief-t { flex: 1; font-size: 15.5px; }
.brief-items .brief-d { color: var(--ink-soft); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.brief-play { width: 100%; }
.interest-new { font-size: 0.72rem; color: var(--red-soft); font-style: normal; margin-left: auto; letter-spacing: 0.03em; }
.brief-themes-caption { margin: 10px 0 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

#askMic.listening { background: var(--red); color: var(--on-red); }

.bookmarks-box { margin: 10px 0 0; }
.bookmark-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.bookmark-row [data-mark-t] { border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink); font: inherit; padding: 2px 10px; cursor: pointer; }
.bookmark-row span { color: var(--ink-soft); font-size: 0.9rem; }
.bookmark-del { margin-left: auto; background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--red-soft); }

/* ---------- KAL Mediapedia ---------- */

.pedia-toolbar { display: flex; gap: 12px; align-items: center; margin: 18px 0 10px; flex-wrap: wrap; max-width: 1240px; padding: 0 24px; margin-left: auto; margin-right: auto; }
.pedia-toolbar input[type="search"] {
  flex: 1 1 240px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  background: var(--card);
  color: var(--ink);
}
.pedia-toggle { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; color: var(--ink-soft); }
.pedia-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; max-width: 1240px; padding: 0 24px; margin-left: auto; margin-right: auto; }
.pedia-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.pedia-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
[data-theme="light"] .pedia-chip.active { background: var(--ink); color: var(--paper); }

.people-section .people-grid {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
}

/* MediaPedia: índice de firmas editorial (grid fija: número | firma | insignia) */
.person-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: start;
  padding: 18px 2px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}
.person-row:hover, .person-row:focus-visible { background: var(--card); outline: none; }
.person-idx {
  grid-column: 1;
  padding-top: 7px;
  font-family: var(--serif);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.person-id { grid-column: 2; min-width: 0; }
.person-id h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.15;
  margin: 0 0 4px;
  color: var(--ink);
}
.person-meta {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.5;
}
.person-row .pedia-badge { grid-column: 2; justify-self: start; margin: 10px 0 0; }
.person-arrow { grid-column: 3; align-self: center; color: var(--muted); font-size: 17px; transition: transform 0.15s ease; }
.person-row:hover .person-arrow { transform: translateX(4px); color: var(--red); }
@media (max-width: 700px) {
  .person-row { grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 12px; padding: 16px 2px; }
  .person-idx { padding-top: 6px; }
}

.pedia-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pedia-card:hover, .pedia-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-soft); outline: none; }

.pedia-cover { aspect-ratio: 3/4; background: radial-gradient(120% 100% at 30% 20%, #3a2f20 0%, #221c14 70%); }
.pedia-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pedia-monogram { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pedia-monogram span {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(40px, 4vw, 56px);
  color: var(--red-soft);
}
.pedia-monogram.big { width: 84px; height: 112px; border-radius: 10px; flex: 0 0 auto; background: radial-gradient(120% 100% at 30% 20%, #3a2f20 0%, #221c14 70%); }
.pedia-monogram.big span { font-size: 34px; }

.pedia-meta { padding: 12px 14px 14px; }
.pedia-meta h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 4px; line-height: 1.15; }
.pedia-role { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 2px; }
.pedia-outlet { font-size: 12.5px; color: var(--muted); margin: 0; }
.pedia-badge { display: inline-block; margin-top: 8px; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; background: var(--red); color: var(--on-red); }

.pedia-card-compact .pedia-cover { aspect-ratio: 16/9; }
.pedia-card-compact .pedia-monogram span { font-size: 34px; }
.pedia-empty { grid-column: 1/-1; color: var(--muted); padding: 24px 0; }

.pedia-modal { position: fixed; inset: 0; background: rgba(8,6,4,.72); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 20px; }
.pedia-modal-box {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 520px;
  width: 100%;
  padding: 26px 26px 22px;
  position: relative;
  max-height: 85vh;
  overflow: auto;
  box-shadow: var(--shadow);
}
.pedia-modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 26px; cursor: pointer; line-height: 1; color: var(--ink-soft); }
.pedia-modal-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.pedia-modal-head h3 { font-family: var(--serif); margin: 2px 0; font-size: 22px; }
.pedia-bio { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.pedia-works-count { font-size: 13px; color: var(--red-soft); }
.pedia-modal .person-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pedia-modal .person-links a { font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--card); }

@media (max-width: 640px) {
  .people-section .people-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* Portadas: posición de recorte */
.dialog-hero .cover-img, .cover-art .cover-img { object-position: center; }
#heroCover { background-position: center 30%; }

/* Anti overflow-x global */
html, body { overflow-x: clip; }
.investigation-card, .rail-card, .pedia-card { min-width: 0; overflow-wrap: anywhere; }
img, video, canvas { max-width: 100%; }

/* Hero: ocultar el texto fallback cuando la portada cargó */
#heroCover.has-cover #heroCoverText { opacity: 0; }

/* Crédito de desarrollo (pedido de Ricardo 2026-09-11) */
.colophon-credit { margin: 14px 0 0; font-size: 12.5px; color: #8d8271; }
.colophon-credit a { color: #b8ae9c; text-decoration: none; border-bottom: 1px solid currentColor; }
.colophon-credit a:hover { color: #f2ead9; }

/* ===== Canal de propuestas (sistema A, theme-aware) ===== */
.pitch-section { max-width: 1180px; margin: 0 auto; padding: 64px 24px 72px; }
.pitch-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 28px; align-items: start; }
.pitch-rules { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px 26px 22px; box-shadow: var(--shadow-soft); }
.pitch-rules h3 { font-family: inherit; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--red-soft); margin: 0 0 10px; }
[data-theme="light"] .pitch-rules h3 { color: var(--red); }
.pitch-rules h3 + ul { margin: 0 0 20px; }
.pitch-rules ul { padding-left: 18px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }
.pitch-rules li { margin-bottom: 7px; }
.pitch-promise { background: color-mix(in srgb, var(--red-soft) 10%, transparent); border-left: 3px solid var(--red-soft); border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.55; color: var(--ink); margin: 4px 0 0; }
[data-theme="light"] .pitch-promise { background: color-mix(in srgb, var(--red) 7%, transparent); border-left-color: var(--red); }
.pitch-form { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; display: grid; gap: 16px; box-shadow: var(--shadow-soft); }
.pitch-form .hp { position: absolute; left: -9999px; top: -9999px; }
.pitch-form label { display: grid; gap: 7px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pitch-form input[type="text"], .pitch-form input[type="email"], .pitch-form input[type="url"], .pitch-form textarea {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--ink); font-size: 15px; font-family: inherit; letter-spacing: 0; text-transform: none;
}
.pitch-form input::placeholder, .pitch-form textarea::placeholder { color: var(--muted); }
.pitch-form input:focus, .pitch-form textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
.pf-check { display: flex !important; flex-direction: row; gap: 10px !important; align-items: flex-start; text-transform: none !important; letter-spacing: 0 !important; font-size: 13.5px !important; line-height: 1.45; color: var(--ink-soft) !important; }
.pf-check input { margin-top: 3px; accent-color: var(--red); }
.pitch-submit { justify-self: start; border: 0; cursor: pointer; background: var(--red); color: var(--on-red); border-radius: 999px; padding: 13px 26px; font-size: 14px; font-weight: 600; letter-spacing: .04em; font-family: inherit; }
.pitch-submit:hover { background: var(--red-dark); }
.pitch-submit:disabled { opacity: .6; cursor: wait; }
.pitch-note { font-size: 12.5px; color: var(--muted); margin: 0; }
.pitch-done { background: color-mix(in srgb, #35d07f 9%, transparent); border: 1px solid color-mix(in srgb, #35d07f 32%, transparent); border-radius: 20px; padding: 30px 26px; }
.pitch-done-title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.pitch-done p { color: var(--ink-soft); line-height: 1.55; margin: 0; }
@media (max-width: 860px) { .pitch-grid { grid-template-columns: 1fr; } .pf-row { grid-template-columns: 1fr; } }


/* ===== KAL Semanal (boletín) — sistema A, theme-aware ===== */
.boletin { padding: clamp(48px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.boletin-inner { max-width: 720px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.boletin .eyebrow { color: var(--red); letter-spacing: 0.18em; text-transform: uppercase; font-size: 12px; font-weight: 700; margin: 0 0 12px; }
.boletin h2 { font-family: var(--serif); font-size: clamp(28px, 4.6vw, 44px); line-height: 1.1; margin: 0 0 14px; color: var(--ink); }
.boletin-sub { color: var(--muted); font-size: 17px; line-height: 1.55; margin: 0 0 22px; }
.boletin-perks { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; }
.boletin-perks li { color: var(--muted); font-size: 15px; line-height: 1.5; padding-left: 18px; position: relative; }
.boletin-perks li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; }
.boletin-perks strong { color: var(--ink); }
.boletin-form { display: flex; gap: 10px; flex-wrap: wrap; }
.boletin-form input { flex: 1 1 260px; padding: 14px 16px; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.boletin-form input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.boletin-form button { padding: 14px 22px; font-size: 15px; font-weight: 700; color: #fff; background: var(--red); border: 0; border-radius: 10px; cursor: pointer; }
.boletin-form button:hover { filter: brightness(1.08); }
.boletin-legal { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.boletin-proof { margin: 18px 0 0; font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 14px; }
.boletin-ok { margin-top: 20px; padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; background: var(--card); color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip: rect(0 0 0 0); overflow: hidden; }

.boletin-form[hidden] { display: none; }

.cover-credit { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.cover-credit a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* Instalación PWA: banner propio, discreto */
.install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  animation: install-in 0.35s ease;
}
@keyframes install-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.install-title { font-family: var(--serif); font-size: 18px; margin: 0 0 4px; color: var(--ink); }
.install-copy { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.install-actions { display: flex; gap: 10px; }
.install-actions button {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 999px; padding: 10px 18px; cursor: pointer; border: 1px solid var(--line);
  background: transparent; color: var(--ink);
}
.install-actions [data-install="yes"] { background: var(--red); border-color: var(--red); color: #fff; }
