/* Brandwright · tokens y componentes base.
   Portado 1:1 de web/estilos.css del repo dp-estudio (0.116.0). Mismos nombres de variables y de clases:
   un cambio aquí se lleva al código cambiando la misma variable o clase en web/estilos.css.
   Tema: .bw = oscuro (por defecto), .bw.claro = claro (equivale a :root[data-theme="light"]). */

.bw {
  --color-paper: oklch(14.5% 0.005 286);
  --color-paper-2: oklch(17.8% 0.006 286);
  --color-paper-3: oklch(22% 0.006 286);
  --color-paper-4: oklch(27.4% 0.006 286);
  --color-rule: oklch(100% 0 0 / 0.09);
  --color-rule-2: oklch(100% 0 0 / 0.16);
  --color-ink: oklch(98.5% 0 0);
  --color-ink-2: oklch(80% 0.01 286);
  --color-ink-3: oklch(70.5% 0.015 286);
  --color-primary: oklch(96% 0.002 286);
  --color-primary-hover: oklch(88% 0.004 286);
  --color-primary-ink: oklch(21% 0.006 286);
  --color-accent: oklch(62% 0.19 260);
  --color-accent-soft: oklch(62% 0.19 260 / 0.14);
  --color-ring: oklch(62% 0.19 260 / 0.5);
  --color-focus: oklch(62% 0.19 260);
  --color-ok: oklch(76% 0.15 160);
  --color-ok-soft: oklch(76% 0.15 160 / 0.13);
  --color-warn: oklch(82% 0.15 80);
  --color-warn-soft: oklch(82% 0.15 80 / 0.13);
  --color-error: oklch(70.4% 0.191 22);
  --color-error-soft: oklch(70.4% 0.191 22 / 0.13);
  --color-fav: oklch(85% 0.16 85);
  --color-scrim: oklch(0% 0 0 / 0.6);
  --color-stage: oklch(11% 0.004 286);

  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --space-3xs: 0.25rem;
  --space-2xs: 0.375rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px oklch(0% 0 0 / 0.25);
  --shadow-1: 0 1px 3px oklch(0% 0 0 / 0.3), 0 1px 2px -1px oklch(0% 0 0 / 0.3);
  --shadow-2: 0 10px 38px -10px oklch(0% 0 0 / 0.55), 0 10px 20px -15px oklch(0% 0 0 / 0.4);
  --control: 36px;
  --barra-alto: 56px;
  color-scheme: dark;

  min-height: 100vh;
  background: var(--color-paper);
  color: var(--color-ink);
  font: 400 var(--text-sm)/1.5 var(--font-ui);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
.bw.claro {
  --color-paper: oklch(100% 0 0);
  --color-paper-2: oklch(100% 0 0);
  --color-paper-3: oklch(96.7% 0.001 286);
  --color-paper-4: oklch(93% 0.003 286);
  --color-rule: oklch(92% 0.004 286);
  --color-rule-2: oklch(87% 0.006 286);
  --color-ink: oklch(14.1% 0.005 286);
  --color-ink-2: oklch(37% 0.013 286);
  --color-ink-3: oklch(55.2% 0.016 286);
  --color-primary: oklch(21% 0.006 286);
  --color-primary-hover: oklch(32% 0.006 286);
  --color-primary-ink: oklch(98.5% 0 0);
  --color-accent: oklch(54.6% 0.215 263);
  --color-accent-soft: oklch(54.6% 0.215 263 / 0.09);
  --color-ring: oklch(54.6% 0.215 263 / 0.35);
  --color-focus: oklch(54.6% 0.215 263);
  --color-ok: oklch(52.7% 0.154 150);
  --color-warn: oklch(66.6% 0.179 58);
  --color-error: oklch(57.7% 0.245 27);
  --color-scrim: oklch(0% 0 0 / 0.4);
  --color-stage: oklch(96.7% 0.001 286);
  --shadow-xs: 0 1px 2px oklch(0% 0 0 / 0.05);
  --shadow-1: 0 1px 3px oklch(0% 0 0 / 0.08), 0 1px 2px -1px oklch(0% 0 0 / 0.08);
  --shadow-2: 0 10px 38px -10px oklch(20% 0.01 286 / 0.25), 0 10px 20px -15px oklch(20% 0.01 286 / 0.2);
  color-scheme: light;
}

.bw *, .bw *::before, .bw *::after { box-sizing: border-box; }
/* Reseteos sin especificidad (como @layer base en web/estilos.css): las clases de cada pantalla les ganan. */
:where(.bw) :where(h1, h2, h3, p) { margin: 0; }
:where(.bw) :where(h1, h2, h3) { line-height: 1.25; letter-spacing: -0.01em; }
:where(.bw) :where(h2) { font-size: var(--text-sm); font-weight: 600; }
.bw a { color: var(--color-ink); text-underline-offset: 3px; }
.bw a:hover { color: var(--color-ink-2); }
.bw button, .bw input, .bw select, .bw textarea { font: inherit; color: inherit; }
.bw kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--color-rule); background: var(--color-paper-3); color: var(--color-ink-3); font: 500 10px/1 var(--font-mono); }

.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 20px; height: 20px; }

.entrada { display: flex; align-items: center; width: 100%; min-height: var(--control); padding: 0 var(--space-sm); background: transparent; border: 1px solid var(--color-rule-2); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); font-size: var(--text-sm); color: var(--color-ink); }
.entrada.vacia { color: var(--color-ink-3); }
.entrada.area { align-items: flex-start; padding: var(--space-xs) var(--space-sm); line-height: 1.55; }
.entrada.mono { font-family: var(--font-mono); }
.selector { justify-content: space-between; }

.boton { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: var(--control); padding: 0 var(--space-md); border-radius: var(--radius-md); border: 1px solid transparent; font-weight: 500; font-size: var(--text-sm); white-space: nowrap; cursor: pointer; background: transparent; color: var(--color-ink); }
.boton-primario { background: var(--color-primary); color: var(--color-primary-ink); box-shadow: var(--shadow-xs); }
.boton-primario:hover { background: var(--color-primary-hover); }
.boton-sec { border-color: var(--color-rule-2); box-shadow: var(--shadow-xs); }
.boton-sec:hover { background: var(--color-paper-3); }
.boton-fantasma { color: var(--color-ink-2); padding: 0 var(--space-sm); }
.boton-fantasma:hover { color: var(--color-ink); background: var(--color-paper-3); }
.boton-chico { min-height: 30px; padding: 0 var(--space-sm); font-size: var(--text-xs); gap: var(--space-2xs); border-radius: var(--radius-sm); }
.boton-icono { width: var(--control); padding: 0; }
.enlace { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: 0 var(--space-xs); min-height: 28px; color: var(--color-ink-3); font-weight: 500; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.enlace:hover { color: var(--color-ink); background: var(--color-paper-3); }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.chip { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 32px; padding: 0 var(--space-sm); border-radius: var(--radius-md); border: 1px solid var(--color-rule-2); color: var(--color-ink-2); box-shadow: var(--shadow-xs); font-size: var(--text-xs); font-weight: 500; white-space: nowrap; }
.chip.on { border-color: var(--color-ink); background: var(--color-paper-3); color: var(--color-ink); }
.segmento { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 3px; background: var(--color-paper-3); border-radius: var(--radius-lg); }
.seg { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs); min-height: 30px; padding: 0 var(--space-sm); border: 1px solid transparent; border-radius: 9px; color: var(--color-ink-3); font-weight: 500; font-size: var(--text-sm); white-space: nowrap; }
.seg.on { background: var(--color-paper); border-color: var(--color-rule); color: var(--color-ink); box-shadow: var(--shadow-1); }
.segmento.chico { border-radius: var(--radius-md); }
.segmento.chico .seg { min-height: 26px; font-size: var(--text-xs); padding: 0 var(--space-xs); border-radius: 5px; }
.opciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-xs); }
.opcion { position: relative; display: grid; gap: 2px; min-height: 58px; padding: var(--space-sm) var(--space-xl) var(--space-sm) var(--space-sm); border-radius: var(--radius-lg); border: 1px solid var(--color-rule-2); box-shadow: var(--shadow-xs); }
.opcion.on { border-color: var(--color-ink); background: var(--color-paper-3); }
.opcion b { font-size: var(--text-sm); font-weight: 500; }
.opcion small { font-size: var(--text-2xs); color: var(--color-ink-3); }
.radio { position: absolute; top: var(--space-sm); right: var(--space-sm); width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--color-rule-2); }
.opcion.on .radio { border: 4px solid var(--color-ink); }

.pista { color: var(--color-ink-3); font-size: var(--text-xs); line-height: 1.5; }
.titulo-bloque { display: flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-xs); font-weight: 500; color: var(--color-ink); }
.ayuda-q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--color-rule-2); color: var(--color-ink-3); font-size: 10px; font-weight: 600; }
.campo { display: grid; gap: var(--space-2xs); min-width: 0; }
.campo-titulo { font-size: var(--text-xs); font-weight: 500; color: var(--color-ink); }
.precio { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; background: var(--color-paper-3); color: var(--color-ink-3); font: 500 10px/1 var(--font-mono); white-space: nowrap; }
.etiqueta { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 var(--space-xs); border-radius: var(--radius-sm); border: 1px solid var(--color-rule-2); font-size: var(--text-2xs); font-weight: 500; color: var(--color-ink-2); white-space: nowrap; }
.etiqueta.alerta { border-color: color-mix(in oklch, var(--color-warn) 45%, transparent); background: var(--color-warn-soft); color: var(--color-warn); }
.etiqueta.ok { border-color: color-mix(in oklch, var(--color-ok) 45%, transparent); background: var(--color-ok-soft); color: var(--color-ok); }
.vacio { display: grid; justify-items: center; gap: var(--space-2xs); color: var(--color-ink-3); text-align: center; padding: var(--space-2xl) var(--space-md); border: 1px dashed var(--color-rule-2); border-radius: var(--radius-xl); font-size: var(--text-sm); }
.vacio b { color: var(--color-ink); font-weight: 600; }
.vacio-icono { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--space-xs); border-radius: var(--radius-lg); border: 1px solid var(--color-rule); background: var(--color-paper-2); color: var(--color-ink-2); box-shadow: var(--shadow-xs); }

.switch { position: relative; flex: none; width: 32px; height: 18px; border-radius: var(--radius-pill); background: var(--color-paper-4); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--color-ink); }
.switch.on { background: var(--color-primary); }
.switch.on::after { left: 16px; background: var(--color-primary-ink); }

.panel { display: grid; gap: var(--space-md); padding: var(--space-lg); background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-xl); min-width: 0; box-shadow: var(--shadow-1); align-content: start; }
.ajustes { display: grid; border: 1px solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-paper); overflow: hidden; }
.ajuste { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-sm); min-height: 52px; padding: var(--space-xs) var(--space-md); }
.ajuste + .ajuste { border-top: 1px solid var(--color-rule); }
.ajuste-titulo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); font-size: var(--text-sm); font-weight: 500; }
.ajuste-desc { font-size: var(--text-xs); color: var(--color-ink-3); }
.mono { font-family: var(--font-mono); font-size: var(--text-xs); }

.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-sm); min-height: var(--barra-alto); padding: var(--space-xs) var(--space-lg); background: color-mix(in oklch, var(--color-paper) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--color-rule); }
.logo-wordmark { display: block; height: 20px; aspect-ratio: 3952 / 776; background: var(--color-ink); -webkit-mask: url("brandwright.svg") center / contain no-repeat; mask: url("brandwright.svg") center / contain no-repeat; flex: none; }
.espacio { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; max-width: 340px; flex: none; min-height: 40px; padding: 4px var(--space-xs) 4px var(--space-sm); border: 1px solid var(--color-rule-2); border-radius: var(--radius-lg); background: var(--color-paper-2); box-shadow: var(--shadow-xs); }
.punto { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 3px var(--color-rule-2); }
.espacio-texto { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.espacio-texto b { font-size: var(--text-sm); font-weight: 600; }
.espacio-texto small { font-size: var(--text-2xs); color: var(--color-ink-3); }
.vistas { display: flex; gap: 2px; margin-left: var(--space-xs); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.vista { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 32px; padding: 0 var(--space-sm); border-radius: var(--radius-md); color: var(--color-ink-3); font-weight: 500; font-size: var(--text-sm); white-space: nowrap; }
.vista:hover { color: var(--color-ink); background: var(--color-paper-3); }
.vista.on { color: var(--color-ink); background: var(--color-paper-3); }
.buscador { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 32px; min-width: 210px; padding: 0 var(--space-2xs) 0 var(--space-sm); border: 1px solid var(--color-rule-2); border-radius: var(--radius-md); background: var(--color-paper-2); box-shadow: var(--shadow-xs); color: var(--color-ink-3); font-size: var(--text-xs); }
.buscador kbd { margin-left: auto; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--color-paper-3); border: 1px solid var(--color-rule-2); font-size: var(--text-xs); font-weight: 600; flex: none; }

.marcador { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--color-paper-3) 0 10px, var(--color-paper-2) 10px 20px); color: var(--color-ink-3); font: 500 10px/1.3 var(--font-mono); text-align: center; padding: var(--space-xs); }

.velo { position: absolute; inset: 0; background: var(--color-scrim); display: grid; place-items: start center; padding-top: 64px; }
.dialogo { width: min(640px, calc(100% - 32px)); display: grid; gap: var(--space-md); padding: var(--space-lg); background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
