/* ==========================================================================
   Fullscreen Teleprompter
   Editorial, minimal, no build step. One stylesheet, CSS variables for themes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  --paper:        #f4f1ea;
  --paper-2:      #fbf9f4;
  --paper-3:      #eae5d9;
  --ink:          #14120e;
  --ink-2:        #3a362e;
  --muted:        #5f584c;
  --faint:        #6f685c;
  --rule:         #ddd6c7;
  --rule-strong:  #c4bba6;
  --accent:       #9c3b22;
  --accent-soft:  #f0e2dc;
  --accent-ink:   #fffaf6;
  --shadow:       0 1px 0 rgba(20, 18, 14, .04);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --step--1: clamp(.78rem, .76rem + .1vw, .84rem);
  --step-0:  clamp(.95rem, .92rem + .16vw, 1.05rem);
  --step-1:  clamp(1.1rem, 1rem + .5vw, 1.35rem);
  --step-2:  clamp(1.45rem, 1.2rem + 1.2vw, 2.1rem);
  --step-3:  clamp(2rem, 1.5rem + 2.4vw, 3.4rem);
  --step-4:  clamp(2.4rem, 1.6rem + 3.6vw, 4.2rem);

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --radius: 2px;
  --measure: 68ch;
}

[data-theme="dark"] {
  --paper:        #111110;
  --paper-2:      #171715;
  --paper-3:      #1f1e1b;
  --ink:          #f2efe7;
  --ink-2:        #ded8cb;
  --muted:        #948c7d;
  --faint:        #8b8477;
  --rule:         #2c2b27;
  --rule-strong:  #423f38;
  --accent:       #d4644a;
  --accent-soft:  #2a1c17;
  --accent-ink:   #16120f;
  --shadow:       0 1px 0 rgba(255, 255, 255, .03);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* El atributo hidden gana a cualquier display de las clases. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

.icon { width: 1.05em; height: 1.05em; flex: none; }

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

.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; border-radius: var(--radius);
  transition: top .15s ease;
}
.skip-link:focus { top: .5rem; }

/* --------------------------------------------------------------------------
   3. Type helpers
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .9rem;
}

.label {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   4. Buttons and controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .55rem .9rem;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); background: var(--paper-3); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  padding: .62rem 1.05rem;
}
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.btn--quiet { border-color: transparent; color: var(--muted); padding-inline: 0; }
.btn--quiet:hover { color: var(--ink); background: transparent; border-color: transparent; text-decoration: underline; }

.btn--ghost { border-color: var(--rule); color: var(--ink-2); }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.iconbtn:hover { color: var(--ink); border-color: var(--rule-strong); }
.iconbtn[aria-pressed="true"] { color: var(--accent); border-color: var(--rule-strong); }
.iconbtn .icon { width: 1.15rem; height: 1.15rem; }

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + .45rem); left: 50%;
  transform: translateX(-50%) translateY(-3px);
  background: var(--ink); color: var(--paper);
  font-size: .72rem; letter-spacing: .02em; line-height: 1.3;
  padding: .3rem .5rem;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  z-index: 60;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.topbar [data-tip]::after { top: calc(100% + .6rem); }

/* Sliders */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 1.1rem;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: var(--rule-strong); border-radius: 2px;
}
input[type="range"]::-moz-range-track {
  height: 2px; background: var(--rule-strong); border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -6px;
  background: var(--ink);
  border: 0; border-radius: 50%;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--ink);
  border: 0; border-radius: 50%;
}
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }

select {
  width: 100%;
  padding: .45rem .55rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: var(--step--1);
  cursor: pointer;
}

/* Segmentado (botones, no radios) */
.segmented {
  display: inline-flex;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.segmented__opt {
  padding: .4rem .6rem;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  color: var(--muted);
  font-size: .74rem;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.segmented__opt:last-child { border-right: 0; }
.segmented__opt:hover { color: var(--ink); background: var(--paper-3); }
.segmented__opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* --------------------------------------------------------------------------
   5. Topbar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar__inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem var(--gutter);
  max-width: 1560px; margin: 0 auto;
}

.topbar__left {
  display: flex; align-items: center; gap: .85rem;
  min-width: 0;
}

.topbar__rule {
  width: 1px; height: 1.4rem;
  background: var(--rule);
  flex: none;
}

.topbar__end {
  display: flex; align-items: center; gap: .35rem;
  margin-left: auto;
}

.wordmark {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.02rem; letter-spacing: -.01em;
  white-space: nowrap;
}
.wordmark__mark {
  display: grid; place-items: center;
  width: 1.6rem; height: 1.6rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-display);
  font-size: .95rem; font-weight: 600;
  border-radius: var(--radius);
  flex: none;
}
.wordmark__text { font-weight: 500; }
.wordmark__text em { font-style: italic; }

/* Selector de guion */
.scriptpicker {
  display: inline-flex; align-items: center; gap: .45rem;
  min-width: 0;
  max-width: 16rem;
  padding: .35rem .5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.scriptpicker:hover { border-color: var(--rule-strong); color: var(--ink); }
.scriptpicker__name {
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--step--1);
  font-weight: 500;
}
.scriptpicker .icon { width: 1rem; height: 1rem; }
.scriptpicker .icon:last-child { color: var(--faint); width: .85rem; height: .85rem; }

.autosave {
  display: inline-flex; align-items: center; gap: .35rem;
  margin: 0;
  font-size: .74rem;
  color: var(--faint);
  white-space: nowrap;
}
.autosave .icon { width: .95rem; height: .95rem; color: var(--accent); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { color: var(--ink); border-color: var(--rule-strong); }

.dropdown__menu {
  position: absolute; top: calc(100% + .5rem); right: 0; z-index: 70;
  min-width: 12rem;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: .3rem;
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, .5);
}
.dropdown__menu--wide { min-width: 18rem; }

.menu__item {
  display: flex; align-items: center; gap: .55rem;
  width: 100%;
  padding: .45rem .55rem;
  background: transparent; border: 0;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: var(--step--1);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu__item:hover { background: var(--paper-3); color: var(--ink); }
.menu__item[aria-current="true"], .menu__item.is-current { color: var(--ink); font-weight: 600; }
.menu__item[aria-current="true"]::after { content: "·"; margin-left: auto; color: var(--accent); }
.menu__sep { height: 1px; background: var(--rule); margin: .3rem .2rem; }
.menu__empty { margin: .3rem .55rem; font-size: var(--step--1); color: var(--faint); }
.menu__note { margin: .4rem .55rem 0; font-size: .68rem; color: var(--faint); }

/* Gestor de guiones */
.scriptnew {
  display: flex; align-items: center; gap: .35rem;
  padding: .35rem .3rem .45rem;
}
.scriptnew input {
  flex: 1; min-width: 0;
  padding: .4rem .5rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: var(--step--1);
}
.scriptnew input::placeholder { color: var(--faint); }

.scriptrow {
  display: flex; align-items: center; gap: .1rem;
  border-radius: var(--radius);
}
.scriptrow:hover { background: var(--paper-3); }
.scriptrow__load { flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 0; }
.scriptrow__name {
  display: block; width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scriptrow__meta { font-size: .68rem; color: var(--faint); }
.scriptrow__act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem;
  background: transparent; border: 0; border-radius: var(--radius);
  color: var(--faint); cursor: pointer;
  flex: none;
}
.scriptrow__act:hover { color: var(--ink); background: var(--paper); }
.scriptrow__act:last-child:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   6. Page and control deck
   -------------------------------------------------------------------------- */

.page {
  padding: clamp(1rem, 2.5vw, 2rem) var(--gutter) 0;
  max-width: 1560px;
  margin: 0 auto;
}

/* El deck es un tablero de tarjetas: cada opcion en su propia caja, con su
   titulo y su pista. Nada de controles sueltos en fila. */
.deck {
  margin-bottom: clamp(.8rem, 1.5vw, 1.2rem);
}

.deck__cols {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: clamp(1rem, 2vw, 1.6rem);
  align-items: start;
}

.deck__col { min-width: 0; }

.deck__legend {
  margin: 0 0 .6rem;
  padding-left: .1rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.deck__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .75rem .85rem .8rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  /* Altura minima comun: las dos columnas cuadran sus filas al alto. */
  min-height: 7rem;
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  min-height: 1.1rem;
}

.card__label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .68rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__label .icon { width: .95rem; height: .95rem; flex: none; }

.card__value {
  font-family: var(--font-mono);
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  flex: none;
}

.card__hint {
  margin: 0;
  font-size: .7rem;
  line-height: 1.35;
  color: var(--faint);
}

.card select { width: 100%; }

/* Barra inferior del deck: cuenta atras y restablecer */
.deck__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  margin-top: .9rem;
  padding-top: .75rem;
  border-top: 1px solid var(--rule);
}

.deck__inline {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.deck__label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .68rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.deck__label .icon { width: .95rem; height: .95rem; flex: none; }

.deck__select { width: auto; min-width: 7.5rem; }

.deck__note {
  font-size: .72rem;
  color: var(--faint);
}

/* Pantallas del prompter: cuatro muestras */
.swatches {
  display: flex;
  gap: .5rem;
}
.swatch {
  display: flex; align-items: center; justify-content: center;
  padding: .2rem;
  cursor: pointer;
  position: relative;
  border-radius: var(--radius);
}
.swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch__chip {
  width: 1.6rem; height: 1.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  transition: box-shadow .12s ease, transform .12s ease;
}
.swatch__chip--oled { background: #000; }
.swatch__chip--broadcast { background: #000; box-shadow: inset 0 0 0 3px #ffe600; }
.swatch__chip--soft { background: #2a2a2e; }
.swatch__chip--paper { background: #f4f1ea; }
.swatch:hover .swatch__chip { transform: translateY(-1px); }
.swatch input:checked ~ .swatch__chip { box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 3px var(--ink); }
.swatch input:focus-visible ~ .swatch__chip { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   7. Sheet (hoja de guion)
   -------------------------------------------------------------------------- */

.sheet {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.sheet__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  padding: .6rem clamp(.75rem, 1.5vw, 1.1rem);
  border-bottom: 1px solid var(--rule);
}

.sheet__group {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

.sheet__label {
  font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted);
  margin-right: .2rem;
}

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .55rem;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: .74rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
  white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--ink); background: var(--paper-3); }
.chip .icon { width: .95rem; height: .95rem; }
.chip--mark { font-family: var(--font-mono); letter-spacing: .02em; }
.chip--danger:hover { color: var(--accent); border-color: var(--accent); }

.sheet__input {
  flex: 1;
  width: 100%;
  min-height: clamp(18rem, 42vh, 34rem);
  padding: clamp(1rem, 2vw, 1.75rem);
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, .98rem + .5vw, 1.28rem);
  line-height: 1.75;
  resize: vertical;
}
.sheet__input:focus { outline: none; }
.sheet__input::placeholder { color: var(--faint); font-style: italic; }

.sheet__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  padding: .55rem clamp(.75rem, 1.5vw, 1.1rem);
  border-top: 1px solid var(--rule);
}

.telemetry {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: .35rem 1.2rem;
  font-size: .74rem;
  color: var(--faint);
}
.telemetry strong {
  font-family: var(--font-mono);
  font-size: .86rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.telemetry em { font-style: normal; }
.telemetry--end { gap: .9rem; align-items: center; }

.gamepad {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--accent);
}
.gamepad .icon { width: .95rem; height: .95rem; }

.kbdhint { display: inline-flex; align-items: center; gap: .3rem; }
.kbdhint kbd {
  font-family: var(--font-mono);
  font-size: .66rem;
  background: var(--paper-3);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: .05em .32em;
}

/* --------------------------------------------------------------------------
   8. Dialog (atajos)
   -------------------------------------------------------------------------- */

.dialog {
  position: fixed; inset: 0; z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}
.dialog__backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 10, 9, .62);
  backdrop-filter: blur(3px);
}
.dialog__panel {
  position: relative;
  width: min(38rem, 100%);
  max-height: 84vh;
  overflow-y: auto;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.6rem);
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .7);
}
.dialog__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--rule);
}
.dialog__title { font-size: var(--step-1); }
.dialog__intro { margin: .9rem 0 .3rem; color: var(--ink-2); font-size: var(--step--1); }
.dialog__hint {
  margin: 1rem 0 0;
  padding-top: .8rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: .76rem;
}
.dialog .keys { margin-top: 1rem; }

/* --------------------------------------------------------------------------
   9. Longform (SEO content)
   -------------------------------------------------------------------------- */

.longform {
  max-width: 1560px;
  margin: clamp(2.5rem, 6vw, 5rem) auto 0;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--rule);
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.longform__head { max-width: var(--measure); margin-bottom: clamp(2rem, 4vw, 3rem); }
.longform__head h2 { font-size: var(--step-3); }
.longform__lede {
  margin: 1rem 0 0;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
  font-family: var(--font-display);
}

.longform__section {
  max-width: var(--measure);
  padding: clamp(1.4rem, 3vw, 2.2rem) 0;
  border-top: 1px solid var(--rule);
}
.longform__section:first-of-type { border-top: 0; padding-top: 0; }
.longform__section h3 { font-size: var(--step-2); margin-bottom: .9rem; }
.longform__section p { color: var(--ink-2); font-size: var(--step-1); line-height: 1.7; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps__item {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: .2rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.steps__item:last-child { border-bottom: 0; }
.steps__item::before {
  content: counter(step, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  padding-top: .45rem;
  letter-spacing: .04em;
}
.steps__title { grid-column: 2; font-family: var(--font-display); font-size: var(--step-1); font-weight: 500; }
.steps__text { grid-column: 2; color: var(--ink-2); }

.keys { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: var(--step-0); }
.keys thead th {
  font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: .5rem;
}
.keys thead th + th { padding-left: .8rem; }
.keys th, .keys td { text-align: left; padding: .6rem .8rem .6rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.keys th { font-weight: 500; white-space: nowrap; }
.keys td { color: var(--ink-2); }
.keys td kbd { white-space: nowrap; }
.keys tr:last-child th, .keys tr:last-child td { border-bottom: 0; }

kbd {
  font-family: var(--font-mono);
  font-size: .78em;
  background: var(--paper-3);
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: .1em .4em;
  color: var(--ink);
  white-space: nowrap;
}

.note {
  margin: 1.4rem 0 0;
  padding: .9rem 1.1rem;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-2);
  font-size: var(--step-0);
}

/* FAQ */
.faq { max-width: var(--measure); padding: clamp(1.4rem, 3vw, 2.2rem) 0; border-top: 1px solid var(--rule); }
.faq h3 { font-size: var(--step-2); margin-bottom: 1rem; }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__item:last-child { border-bottom: 0; }
.faq__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--step-1);
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "";
  width: .55rem; height: .55rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease;
  flex: none;
}
.faq__item[open] summary::after { transform: rotate(-135deg); }
.faq__answer { padding: 0 0 1.2rem; color: var(--ink-2); max-width: 62ch; }

/* --------------------------------------------------------------------------
   10. Paginas SEO (articulos)
   -------------------------------------------------------------------------- */

.page--article { padding-top: clamp(2rem, 5vw, 3.5rem); }

.article { max-width: var(--measure); margin: 0 auto; }

.article__head { margin-bottom: clamp(1.6rem, 3vw, 2.4rem); }
.article__head h1 { font-size: var(--step-4); line-height: 1.08; letter-spacing: -.02em; }
.article__lede {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
}

.summary {
  margin: 0 0 clamp(1.6rem, 3vw, 2.4rem);
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
}
.summary__title {
  margin: 0 0 .6rem;
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.bullets { margin: 0; padding-left: 1.1rem; }
.bullets li { margin-bottom: .45rem; color: var(--ink-2); }
.summary .bullets li { font-size: var(--step-0); }

.article__toc {
  margin: 0 0 clamp(1.6rem, 3vw, 2.4rem);
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
}
.article__toc-title {
  margin: 0 0 .5rem;
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.article__toc ul { margin: 0; padding-left: 1.1rem; }
.article__toc li { margin-bottom: .3rem; font-size: var(--step-0); }
.article__toc a { color: var(--ink-2); }
.article__toc a:hover { color: var(--ink); }

.article__section { padding: clamp(1.4rem, 3vw, 2.2rem) 0; border-top: 1px solid var(--rule); }
.article__section:first-of-type { border-top: 0; padding-top: 0; }
.article__section h2 { font-size: var(--step-3); margin-bottom: .9rem; line-height: 1.15; }
.article__section p { color: var(--ink-2); font-size: var(--step-1); line-height: 1.7; }

.links { margin: 0 0 1.2rem; padding-left: 1.1rem; }
.links li { margin-bottom: .35rem; color: var(--ink-2); }
.links a { color: var(--ink); }

.faq h2 { font-size: var(--step-2); margin-bottom: 1rem; }

.cta {
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--rule-strong);
  background: var(--paper-2);
}
.cta h2 { font-size: var(--step-2); margin-bottom: .6rem; }
.cta p { color: var(--ink-2); margin: 0 0 1.1rem; max-width: 56ch; }

.guides { margin: clamp(2rem, 4vw, 3rem) 0 0; }
.guides__title { font-size: var(--step-2); margin-bottom: 1rem; }
.guides__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.guides__link {
  display: block;
  height: 100%;
  padding: .9rem 1rem;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  text-decoration: none;
}
.guides__link:hover { border-color: var(--rule-strong); background: var(--paper-3); }
.guides__link-title { display: block; font-family: var(--font-display); font-weight: 500; color: var(--ink); }
.guides__link-desc { display: block; margin-top: .3rem; font-size: var(--step--1); color: var(--muted); line-height: 1.5; }
.guides--wide { max-width: 72rem; margin-inline: auto; }

.crumbs { font-size: var(--step--1); color: var(--muted); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--faint); }

/* --------------------------------------------------------------------------
   11. Support
   -------------------------------------------------------------------------- */

.support {
  max-width: 1560px;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  padding: clamp(1.6rem, 3vw, 2.4rem) var(--gutter);
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}
.support__inner { max-width: 72rem; margin: 0 auto; }
.support__title { font-size: var(--step-2); margin-bottom: .7rem; }
.support__copy { color: var(--ink-2); max-width: var(--measure); }

.support__features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem; margin: 1.6rem 0;
}
.support__feature {
  display: block; border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; background: var(--paper);
  transition: border-color .15s ease;
}
.support__feature:hover { border-color: var(--rule-strong); }
.support__feature img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.support__links-title { font-size: var(--step-1); margin-bottom: .2rem; }
.support__links-sub { color: var(--faint); font-size: var(--step--1); margin: 0 0 1rem; }
.support__links {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: .7rem;
}
.support__link {
  display: block; padding: .85rem 1rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.support__link:hover { border-color: var(--ink); background: var(--paper); }
.support__link-name { font-weight: 600; display: block; }
.support__link-desc { color: var(--muted); font-size: var(--step--1); display: block; margin-top: .15rem; }

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(2rem, 5vw, 4rem);
  padding: 1.6rem var(--gutter);
}
.footer__inner {
  max-width: 1560px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; align-items: baseline;
}
.footer__brand { font-family: var(--font-display); margin: 0; }
.footer__note { margin: 0; font-size: var(--step--1); color: var(--muted); }
.footer__note--muted { color: var(--faint); }

/* --------------------------------------------------------------------------
   13. Prompter mode
   -------------------------------------------------------------------------- */

.prompter {
  position: fixed; inset: 0; z-index: 100;
  background: var(--screen-bg, #000);
  color: var(--screen-text, #fff);
  overflow: hidden;
  transition: background-color .25s ease;
}

/* Temas de pantalla del prompter */
.prompter[data-screen="oled"] {
  --screen-bg: #000000;
  --screen-text: #ffffff;
  --screen-mark: #ffd76a;
  --screen-rule: rgba(255, 255, 255, .26);
}
.prompter[data-screen="broadcast"] {
  --screen-bg: #000000;
  --screen-text: #ffe600;
  --screen-mark: #ffffff;
  --screen-rule: rgba(255, 230, 0, .32);
}
.prompter[data-screen="soft"] {
  --screen-bg: #26262a;
  --screen-text: #ececec;
  --screen-mark: #ffd76a;
  --screen-rule: rgba(255, 255, 255, .24);
}
.prompter[data-screen="paper"] {
  --screen-bg: #f4f1ea;
  --screen-text: #14120e;
  --screen-mark: #9c3b22;
  --screen-rule: rgba(20, 18, 14, .28);
}

.prompter__stage { position: absolute; inset: 0; overflow: hidden; }

.prompter__mirror {
  position: absolute; inset: 0;
  transition: transform .22s ease;
}
.prompter__mirror[data-mirror="h"] { transform: scaleX(-1); }
.prompter__mirror[data-mirror="v"] { transform: scaleY(-1); }
.prompter__mirror[data-mirror="hv"] { transform: scale(-1, -1); }

.prompter__track {
  position: absolute; left: 0; right: 0;
  top: var(--guide-y, 30%);
  will-change: transform;
}

.prompter__text {
  max-width: var(--prompter-width, 70%);
  margin: 0 auto;
  padding: .3em 0 40vh;
  font-family: var(--prompter-font, "Inter", sans-serif);
  font-size: var(--prompter-size, 48px);
  line-height: var(--prompter-line, 1.6);
  color: var(--screen-text, #fff);
  font-weight: 400;
  text-wrap: pretty;
}
.prompter__text p { margin: 0 0 .85em; }
.prompter__text p:last-child { margin-bottom: 0; }
.prompter__text strong { font-weight: 700; }
.prompter__text em { font-style: italic; }
.prompter__text .mark { color: var(--screen-mark, #ffd76a); font-weight: 600; letter-spacing: .04em; }
.prompter__text hr {
  border: 0;
  border-top: 1px solid var(--screen-rule, rgba(255, 255, 255, .26));
  margin: 1.1em auto;
  width: 42%;
}

/* Guia de lectura */
.guide {
  position: absolute; left: 0; right: 0;
  top: var(--guide-y, 30%);
  height: 0;
  z-index: 3;
  pointer-events: none;
  opacity: var(--guide-opacity, 1);
  transition: opacity .2s ease;
}

.guide__band {
  position: absolute; left: 0; right: 0;
  top: -3.2rem; height: 6.4rem;
  background: color-mix(in srgb, var(--screen-text, #fff) 6%, transparent);
}
.guide__band-top,
.guide__band-bottom {
  position: absolute; left: 0; right: 0;
  height: 1px;
  background: var(--screen-rule, rgba(255, 255, 255, .26));
}
.guide__band-top { top: 0; }
.guide__band-bottom { bottom: 0; }

.guide__line {
  position: absolute; left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--screen-rule, rgba(255, 255, 255, .26)) 0%, transparent 80%);
}

.guide__arrows { position: absolute; inset: 0; }
.guide__arrow {
  position: absolute; top: -7px;
  width: .7rem; height: .7rem;
  border-top: 1.5px solid var(--screen-rule, rgba(255, 255, 255, .26));
  border-right: 1.5px solid var(--screen-rule, rgba(255, 255, 255, .26));
}
.guide__arrow--left { left: clamp(.6rem, 3vw, 2.5rem); transform: rotate(-135deg); }
.guide__arrow--right { right: clamp(.6rem, 3vw, 2.5rem); transform: rotate(45deg); }

.guide[data-style="band"] .guide__line,
.guide[data-style="band"] .guide__arrows { display: none; }
.guide[data-style="arrows"] .guide__band,
.guide[data-style="arrows"] .guide__line { display: none; }
.guide[data-style="line"] .guide__band,
.guide[data-style="line"] .guide__arrows { display: none; }
.guide[data-style="none"] > * { display: none; }

/* Barra de progreso clicable */
.progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 12;
  height: 10px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--screen-text, #fff);
  opacity: .8;
}

/* Cuenta atras */
.prompter__countdown {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: var(--screen-bg, #000);
  z-index: 12;
}
.prompter__countdown-num {
  font-family: var(--font-display);
  font-size: clamp(6rem, 22vw, 16rem);
  font-weight: 400;
  color: var(--screen-text, #fff);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  animation: countdownPulse .95s ease-out infinite;
}
.prompter__countdown-label {
  position: absolute;
  bottom: 18%;
  font-family: var(--font-ui);
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--screen-text, #fff) 55%, transparent);
}
@keyframes countdownPulse {
  0% { transform: scale(1.06); opacity: 1; }
  70% { transform: scale(1); opacity: .92; }
  100% { transform: scale(.98); opacity: .78; }
}

/* HUD */
.hud {
  position: absolute; left: 0; right: 0;
  z-index: 9;
  opacity: 1;
  transition: opacity .35s ease;
}
.hud.is-idle { opacity: 0; pointer-events: none; }

.hud--top {
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(.6rem, 2vw, 1.1rem) clamp(.6rem, 3vw, 2rem);
  background: linear-gradient(180deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .35) 60%, transparent);
}

.hud--bottom {
  bottom: 0;
  padding: 1.4rem clamp(.6rem, 3vw, 2rem) 1.6rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .62) 45%, transparent);
}

.hud__pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .6rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .35);
  color: rgba(255, 255, 255, .9);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}
.hud__pill--right { gap: .25rem; }

.hud__dot {
  width: .5rem; height: .5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .4);
  flex: none;
}
.hud__dot.is-playing { background: #6ee7a8; }
.hud__dot.is-paused { background: #ffd76a; }

.hud__sep {
  width: 1px; height: .9rem;
  background: rgba(255, 255, 255, .22);
}

.hud__badges { display: inline-flex; gap: .3rem; }
.hud__badge {
  padding: .1rem .35rem;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--radius);
  font-size: .66rem;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .75);
}

.hud__bar {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  flex-wrap: wrap;
}

.hudbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, .9);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.hudbtn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
.hudbtn .icon { width: 1.2rem; height: 1.2rem; }
.hudbtn--play { background: rgba(255, 255, 255, .92); color: #000; border-color: transparent; }
.hudbtn--play:hover { background: #fff; }
.hudbtn[aria-pressed="true"] { border-color: rgba(255, 255, 255, .75); color: #fff; }

.hud__speed {
  display: inline-flex; align-items: center; gap: .35rem;
  margin: 0 .35rem;
  padding: 0 .55rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
}
.hud__wpm {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: #fff;
  min-width: 2.4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.hud__speed input[type="range"] { width: 8rem; }
.hud__speed input[type="range"]::-webkit-slider-runnable-track { background: rgba(255, 255, 255, .35); }
.hud__speed input[type="range"]::-moz-range-track { background: rgba(255, 255, 255, .35); }
.hud__speed input[type="range"]::-webkit-slider-thumb { background: #fff; }
.hud__speed input[type="range"]::-moz-range-thumb { background: #fff; }

.hud__hint {
  margin: .6rem 0 0;
  text-align: center;
  font-size: .72rem;
  color: rgba(255, 255, 255, .5);
  letter-spacing: .02em;
}

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .deck__cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .topbar__inner { flex-wrap: wrap; gap: .5rem .75rem; }
  .topbar__left { flex: 1; min-width: 0; }
  .topbar__end { margin-left: auto; }
  .wordmark__text { display: none; }
  .autosave { display: none; }
  .scriptpicker { max-width: 12rem; }
}

@media (max-width: 620px) {
  /* En movil la cabecera se parte en dos filas: marca y botones arriba,
     el selector de guion debajo a todo lo ancho. */
  .topbar__inner { gap: .5rem; }
  .topbar__left { display: contents; }
  .topbar__rule { display: none; }
  .wordmark { order: 1; }
  .topbar__end { order: 2; }
  #scriptsDropdown { order: 3; flex: 1 1 100%; }
  .scriptpicker { max-width: none; width: 100%; border-color: var(--rule); }

  .deck__grid { grid-template-columns: minmax(0, 1fr); }
  .deck__foot { flex-direction: column; align-items: stretch; }
  .deck__inline { justify-content: space-between; }
  .deck__foot .btn { align-self: flex-end; }
  .swatches { gap: .35rem; }
  .steps__item { grid-template-columns: 1fr; gap: .2rem; }
  .steps__item::before { padding-top: 0; }
  .sheet__bar { align-items: flex-start; }
  .hud__speed input[type="range"] { width: 5.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
