:root {
  /* Paleta cromática — Modo Claro (Familia Stone / Arena Cálido — Contraste AA verificado) */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --surface-3: #e5e5e5;
  --ink: #0a0a0a;
  --ink-2: #262626;
  --muted: #525252;
  --line: #e5e5e5;
  --line-2: #f0f0f0;

  /* Marca: naranja vivo #f97316 con texto negro encima (7:1); como letra sobre blanco, --accent-text */
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-ink: #0a0a0a;
  --accent-soft: #fff1e6;
  --accent-text: #c2410c;
  --accent-muted: color-mix(in srgb, var(--accent) 14%, transparent);

  /* Estados semánticos con contraste verificado WCAG AA */
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --info: #1d4ed8;
  --info-soft: #e8efff;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;

  /* Tipografía y tracking óptico */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13.5px;
  --text-base: 15px;
  --text-md: 17px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 30px;
  --tracking-tight: -0.02em;
  --tracking-snug: -0.01em;
  --tracking-normal: -0.003em;
  --tracking-wide: 0.05em;

  /* Espaciado modular (base 4px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radios de curvatura */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Sombras y elevación multicapa cálidas */
  --shadow-xs: 0 1px 2px rgba(28, 25, 23, .04);
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, .06), 0 1px 2px rgba(28, 25, 23, .04);
  --shadow: 0 1px 3px rgba(28, 25, 23, .06), 0 1px 2px rgba(28, 25, 23, .04);
  --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, .07), 0 2px 4px -2px rgba(28, 25, 23, .04);
  --shadow-lg: 0 12px 28px -4px rgba(28, 25, 23, .12), 0 4px 8px -2px rgba(28, 25, 23, .04);
  --shadow-sheet: 0 -8px 32px rgba(28, 25, 23, .14);

  /* Físicas de movimiento y microinteracciones (Emil Kowalski / Apple Design) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-press: 120ms;
  --dur-fast: 160ms;
  --dur-normal: 240ms;
  --dur-slow: 320ms;
  --press-scale: scale(0.975);

  --px-min: 1.6px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  /* Paleta cromática — Modo Oscuro (Obsidiana cálida / Café tostado profundo — Contraste AA verificado) */
  --bg: #0a0a0a;
  --surface: #171717;
  --surface-2: #212121;
  --surface-3: #2e2e2e;
  --ink: #fafafa;
  --ink-2: #d4d4d4;
  --muted: #a3a3a3;
  --line: #2a2a2a;
  --line-2: #1f1f1f;

  /* Marca en oscuro: mismo naranja vivo, texto negro encima */
  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-ink: #0a0a0a;
  --accent-soft: #2a1406;
  --accent-text: #fb923c;
  --accent-muted: color-mix(in srgb, var(--accent) 18%, transparent);

  /* Estados semánticos en modo oscuro */
  --ok: #4ade80;
  --ok-soft: #12291a;
  --info: #60a5fa;
  --info-soft: #15243f;
  --warn: #f59e0b;
  --warn-soft: #261f0f;
  --bad: #f87171;
  --bad-soft: #321616;
  --violet: #a78bfa;
  --violet-soft: #241b3b;

  /* Sombras y elevación en modo oscuro */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, .55);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, .7);
  --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, .75);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --surface: #171717;
    --surface-2: #212121;
    --surface-3: #2e2e2e;
    --ink: #fafafa;
    --ink-2: #d4d4d4;
    --muted: #a3a3a3;
    --line: #2a2a2a;
    --line-2: #1f1f1f;

    --accent: #f97316;
    --accent-hover: #fb923c;
    --accent-ink: #0a0a0a;
    --accent-soft: #2a1406;
    --accent-text: #fb923c;
    --accent-muted: color-mix(in srgb, var(--accent) 18%, transparent);

    --ok: #4ade80;
    --ok-soft: #12291a;
    --info: #60a5fa;
    --info-soft: #15243f;
    --warn: #f59e0b;
    --warn-soft: #261f0f;
    --bad: #f87171;
    --bad-soft: #321616;
    --violet: #a78bfa;
    --violet-soft: #241b3b;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, .55);
    --shadow-lg: 0 14px 32px rgba(0, 0, 0, .7);
    --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, .75);

    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body, #app { margin: 0; height: 100%; }
body { font: var(--text-base)/1.5 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; letter-spacing: var(--tracking-normal); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: var(--radius-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; letter-spacing: var(--tracking-tight); }

/* ---------- Botones y campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 600;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-spring), box-shadow var(--dur-fast);
  white-space: nowrap; text-decoration: none; color: inherit; touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--surface-2); border-color: var(--line-2); }
}
.btn:active { transform: var(--press-scale, scale(0.975)); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-xs); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
}
.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
@media (hover: hover) and (pointer: fine) {
  .btn-danger:hover { background: var(--bad-soft); }
}
.btn-ghost { border-color: transparent; background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { background: var(--line-2); }
}
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: var(--radius-sm); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 13px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-full); border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-press) var(--ease-spring);
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .chip:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); box-shadow: var(--shadow-xs); }
.chip small { font-weight: 500; opacity: .75; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips-scroll::-webkit-scrollbar { display: none; }

/* Con muchas opciones (Ajustes tiene 5) se desplaza dentro de su fila en vez de ensanchar la página en 360 px. */
.seg {
  display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px;
  background: transparent; font-weight: 600; font-size: 13.5px; color: var(--ink-2);
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-press) var(--ease-spring);
  touch-action: manipulation;
}
.seg button[aria-pressed="true"],
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 700; }
.seg button:active { transform: scale(0.97); }

/* ---------- Selector de Rubros (SaaS) ---------- */
.grid-rubros {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
}
.card-rubro {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-press) var(--ease-spring);
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .card-rubro:hover {
    background: var(--surface-2);
    border-color: var(--line-2);
    color: var(--ink);
  }
}
.card-rubro:active {
  transform: scale(0.975);
}
.card-rubro svg {
  flex: none;
  color: var(--muted);
  transition: color var(--dur-fast);
}
.card-rubro[aria-checked="true"], .card-rubro.activo {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  font-weight: 700;
}
.card-rubro[aria-checked="true"] svg, .card-rubro.activo svg {
  color: var(--accent-text);
}
.card-rubro .label-rubro {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; }
.b-confirmada { background: var(--info-soft); color: var(--info); }
.b-en_silla { background: var(--ok-soft); color: var(--ok); }
.b-terminada { background: var(--line-2); color: var(--muted); }
.b-no_show, .b-cancelada_cliente, .b-cancelada_negocio { background: var(--bad-soft); color: var(--bad); }
.b-oferta { background: var(--violet-soft); color: var(--violet); }
.b-fuera { background: var(--warn-soft); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

.card-team {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  text-align: left; cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-press) var(--ease-spring), box-shadow var(--dur-fast);
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 14px 18px; box-shadow: var(--shadow-xs);
  touch-action: manipulation;
}
.card-team:active { transform: scale(0.985); }
@media (hover: hover) and (pointer: fine) {
  .card-team:hover { background: var(--surface-2); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
}
.card-team.inactivo { opacity: 0.6; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ---------- Login ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 26px;
  display: grid;
  gap: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: up 0.25s var(--ease-out);
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex: none;
}
.login-card .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px -2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.login-card h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  margin: 0;
}
.login-card p.hint {
  font-size: 13.5px;
  color: var(--muted);
  margin: 4px 0 0 0;
  line-height: 1.4;
}
.login-card .btn-ghost {
  color: var(--muted);
  font-weight: 600;
}
.login-card .btn-ghost:hover {
  color: var(--ink);
}
.pin {
  letter-spacing: .5em;
  font-size: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.pin:placeholder-shown {
  letter-spacing: normal;
  font-size: 14px;
  text-align: left;
}
.pin::placeholder {
  letter-spacing: normal;
  font-size: 14px;
  text-align: left;
}

/* ---------- Estructura ---------- */
.shell { min-height: 100%; display: grid; grid-template-rows: auto 1fr; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.topbar .brand b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.tabs { display: none; gap: 4px; }
.tab { position: relative; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--ink-2); }
.tab[aria-current="page"] { background: var(--line-2); color: var(--ink); }
.tab .count { position: absolute; top: 0; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.bottombar { position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 6px 8px max(6px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.bottombar .tab { flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 4px; font-size: 12px; }
.bottombar .tab svg { width: 22px; height: 22px; }
.bottombar .tab[aria-current="page"] { background: transparent; color: var(--accent-text); }
.bottombar .tab .count { top: 2px; right: calc(50% - 22px); }
/* min-width: 0: como elemento de la grilla .shell, sin esto no se encoge por debajo de su contenido más ancho
   (p. ej. el selector de Ajustes) y toda la página se desborda en 360 px. */
.main { padding: 16px 16px 96px; max-width: 1400px; width: 100%; margin: 0 auto; min-width: 0; }
@media (min-width: 900px) {
  .tabs { display: flex; }
  .bottombar { display: none; }
  .main { padding: 20px 24px 40px; }
}
.view-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.view-head h2 { font-size: 20px; }
.datenav { display: flex; align-items: center; gap: 4px; }
.datenav .label { min-width: 132px; text-align: center; font-weight: 700; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px; display: grid; z-index: 30; }
.menu button { justify-content: flex-start; border: 0; }
.menu .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who small { display: block; color: var(--muted); }

/* ---------- Agenda ---------- */
.agenda-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
@media (max-width: 899px) {
  .agenda-tools {
    position: sticky; top: var(--topbar-h, 55px); z-index: 15;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    margin: -8px 0 12px 0;
  }
}
/* ---------- Selector de profesional (< Ana >) ---------- */
.profesionalnav { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.profesionalnav-trigger {
  min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; white-space: nowrap; max-width: 140px; color: var(--ink);
  box-shadow: var(--shadow-xs); transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-press) var(--ease-spring);
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .profesionalnav-trigger:hover { background: var(--surface-2); border-color: var(--accent); }
}
.profesionalnav-trigger:active { transform: scale(0.97); }
.profesionalnav-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profesionalnav-flecha { font-size: 11px; opacity: .7; }
.profesionalnav-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: 6px; z-index: 35;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: up .15s var(--ease-out);
}
.profesionalnav-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0;
  min-height: 38px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-2);
  transition: background var(--dur-fast), color var(--dur-fast);
}
@media (hover: hover) and (pointer: fine) {
  .profesionalnav-item:hover { background: var(--surface-2); color: var(--ink); }
}
.profesionalnav-item.activo { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }

@media (max-width: 600px) {
  .agenda-tools {
    height: 48px; min-height: 48px; max-height: 48px;
    padding: 0 12px;
    margin: -16px -16px 12px -16px;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  .agenda-tools .datenav { flex: none; display: flex; align-items: center; gap: 2px; }
  .agenda-tools .datenav .label { min-width: 82px; font-size: 13px; font-weight: 700; padding: 0 4px; text-align: center; }
  .agenda-tools .datenav .btn { min-height: 34px; height: 34px; padding: 0 6px; }
  .agenda-tools .datenav .icon-btn { width: 32px; height: 32px; min-height: 32px; padding: 0; }
  .profesionalnav { flex: none; gap: 2px; }
  .profesionalnav .icon-btn { width: 32px; height: 32px; min-height: 32px; padding: 0; }
  .profesionalnav-trigger { min-height: 34px; height: 34px; padding: 0 8px; font-size: 13px; max-width: 105px; }
}
@media (min-width: 900px) {
  .shell.view-agenda, .shell:has(.agenda-scroll) {
    height: 100dvh; max-height: 100dvh; overflow: hidden;
  }
  .main.main-agenda, .main:has(.agenda-scroll) {
    height: calc(100dvh - var(--topbar-h, 60px));
    padding: 14px 24px 16px;
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  }
  .agenda-tools { flex: none; margin-bottom: 10px; }
  .agenda-scroll {
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: auto;
    border-radius: var(--radius); border: 1px solid var(--line);
    background: var(--surface); box-shadow: var(--shadow-sm); position: relative;
  }
  .agenda-scroll .agenda { border: 0; border-radius: 0; box-shadow: none; }
  .agenda-scroll .corner, .agenda-scroll .cols-head {
    position: sticky; top: 0; z-index: 10; background: var(--surface);
  }
}
.agenda { display: grid; grid-template-columns: 56px 1fr; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.colhead { padding: 12px 14px; font-weight: 700; font-size: 14px; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.colhead small { color: var(--muted); font-weight: 600; font-size: 12px; }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.gutter { position: relative; border-right: 1px solid var(--line); }
.gutter span { position: absolute; right: 8px; white-space: nowrap; transform: translateY(-50%); font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.col { position: relative; border-right: 1px solid var(--line-2); min-width: 0; }
.col:last-child { border-right: 0; }
.slotline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-2); }
.slotline.hour { border-top-color: var(--line); }
.closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--line-2) 80%, transparent) 6px 9px); }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 1; pointer-events: none; }
.nowline::before {
  content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.appt {
  position: absolute; left: 6px; right: 6px; z-index: 2; text-align: left;
  border: 1px solid var(--line); border-left: 3.5px solid var(--info);
  border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs);
  padding: 6px 10px; overflow: hidden; display: grid; align-content: start; gap: 2px;
  transition: box-shadow var(--dur-normal) var(--ease-out), transform var(--dur-press) var(--ease-spring);
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .appt:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); z-index: 4; }
}
.appt:active { transform: scale(0.985); }
.appt .t { font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.appt .n { font-weight: 700; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.appt .meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 2px; }
.appt .meta .num { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.appt.s-en_silla { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface)); }
.appt.s-terminada { border-left-color: var(--muted); opacity: .75; background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.appt.s-no_show, .appt.s-cancelada_cliente, .appt.s-cancelada_negocio { border-left-color: var(--bad); opacity: .55; }
.appt.s-no_show .n, .appt.s-cancelada_cliente .n, .appt.s-cancelada_negocio .n { text-decoration: line-through; }
.appt.fuera { outline: 2px dashed var(--warn); outline-offset: -2px; }
.appt.compact { padding-top: 3px; padding-bottom: 3px; }
.appt.compact .meta { display: none; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.fab {
  position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 25;
  height: 54px; padding: 0 22px; border-radius: 18px; border: 0;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -4px color-mix(in srgb, var(--accent) 45%, transparent);
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px;
  transition: transform var(--dur-press) var(--ease-spring), box-shadow var(--dur-normal) var(--ease-out), background var(--dur-fast);
}
@media (hover: hover) and (pointer: fine) {
  .fab:hover { background: var(--accent-hover); box-shadow: 0 10px 28px -4px color-mix(in srgb, var(--accent) 55%, transparent); }
}
.fab:active { transform: scale(0.96); }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }

.btn-ahora {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 24;
  height: 40px; padding: 0 16px; border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 8px;
  animation: up .15s var(--ease-out); cursor: pointer;
  transition: transform var(--dur-press) var(--ease-spring), background var(--dur-fast), border-color var(--dur-fast);
}
@media (hover: hover) and (pointer: fine) {
  .btn-ahora:hover { background: var(--surface); border-color: var(--accent); }
}
.btn-ahora:active { transform: translateX(-50%) scale(0.96); }
.btn-ahora .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
@media (max-width: 600px) {
  .btn-ahora { left: 16px; transform: none; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .btn-ahora:active { transform: scale(0.96); }
}
@media (min-width: 900px) { .btn-ahora { bottom: 28px; } }

/* ---------- Multiselect Popover ---------- */
.multiselect-wrap { position: relative; }
.multiselect-trigger {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.multiselect-trigger:hover { background: var(--surface-2); border-color: var(--line-2); }
.multiselect-trigger:focus, .multiselect-trigger[aria-expanded="true"] {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.multiselect-val {
  display: flex; align-items: baseline; gap: 6px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.multiselect-popover {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  max-height: 250px; overflow-y: auto; padding: 8px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: grid; gap: 4px; animation: up .15s ease-out;
}
.multiselect-popover .btn-listo { margin-top: 6px; }
.multiselect-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; user-select: none; transition: background .12s;
}
.multiselect-row:hover { background: var(--surface-2); }
.multiselect-row input[type="checkbox"] {
  width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: none;
}
.multiselect-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.multiselect-info b { font-size: 14px; font-weight: 600; }
.multiselect-info small { font-size: 12px; color: var(--muted); }
.multiselect-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-removable {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; background: var(--line-2); font-size: 13px; font-weight: 600;
  color: var(--ink); border: 1px solid var(--line);
}
.chip-removable .btn-remove {
  background: transparent; border: 0; padding: 0 2px; font-size: 12px; line-height: 1;
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.chip-removable .btn-remove:hover { color: var(--bad); }

/* ---------- Hoja (dialog) ---------- */
dialog#sheet {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92dvh;
  border-radius: 24px 24px 0 0; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sheet); overflow: hidden;
}
dialog#sheet::backdrop {
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
dialog#sheet[open] {
  display: flex; flex-direction: column;
  animation: sheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheetUp {
  from { transform: translateY(100%); opacity: .8; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 900px) {
  dialog#sheet {
    margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: 480px;
    border-radius: 0; border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  }
  dialog#sheet[open] { animation: sheetSide 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes sheetSide {
    from { transform: translateX(100%); opacity: .8; }
    to { transform: translateX(0); opacity: 1; }
  }
}
.sheet-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 20px; font-weight: 800; letter-spacing: var(--tracking-tight); color: var(--ink); margin: 0; }
.sheet-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sheet-head .grab { position: absolute; left: 50%; top: 8px; width: 36px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--line) 75%, var(--muted)); transform: translateX(-50%); }
@media (min-width: 900px) { .sheet-head .grab { display: none; } }
.sheet-body { padding: 18px 22px 28px; overflow-y: auto; display: grid; gap: 20px; align-content: start; }
.sheet-foot {
  padding: 14px 22px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  display: grid; gap: 10px; background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.section { display: grid; gap: 10px; }
.section > h4 { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
/* minmax(0, 1fr): columnas iguales aunque un texto sea largo; el texto se parte en vez de desbordar en 360 px. */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-2 .btn, .grid-3 .btn { white-space: normal; line-height: 1.25; text-align: center; padding: 8px 12px; }
.lines { display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line-2); }
.line:first-child { border-top: 0; }
.line .grow { flex: 1; min-width: 0; }
.line.total { background: var(--surface-2); font-weight: 700; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.callout { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.callout.violet { background: var(--violet-soft); color: var(--violet); }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.ok { background: var(--ok-soft); color: var(--ok); }
.inline-form { display: grid; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.line.horario { flex-wrap: wrap; }
.line.horario .pausa { display: flex; align-items: center; gap: 8px; flex-basis: 100%; justify-content: flex-end; }
.line.horario .input { width: 140px; min-height: 40px; padding: 6px 8px; } /* cabe "05:00 p. m." en formato de 12 h */
.line.horario input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.inline-form .seg { justify-self: start; }
.main .inline-form { max-width: 560px; }
.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.slots .chip {
  justify-content: center;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  padding: 0 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
@media (min-width: 380px) {
  .slots {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 520px) {
  .slots {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }
}

/* ---------- Listas, reporte y liquidación ---------- */
.list { display: grid; gap: 10px; }
.alert-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px; }
.alert-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.alert-ico svg { width: 20px; height: 20px; }
.metrics { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.metric-card { padding: 16px; display: grid; gap: 12px; align-content: start; }
.metric-card header { display: flex; justify-content: space-between; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.kpi small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi b { font-size: 18px; font-variant-numeric: tabular-nums; }
.kpi.flag { background: var(--warn-soft); }
.kpi.flag small, .kpi.flag b { color: var(--warn); }
.summary { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.big-total { padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.big-total b { font-size: 26px; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar .field { min-width: 150px; }
.toolbar .input { width: auto; min-width: 150px; }

/* ---------- Reserva pública (cliente) ---------- */
body:has(.publico),
body:has(.publico) #app {
  min-height: 100%;
  height: auto;
}
.publico { max-width: 540px; margin: 0 auto; padding: 24px 16px calc(140px + env(safe-area-inset-bottom, 20px)); display: grid; gap: 28px; }
.publico::after { content: ""; display: block; height: calc(60px + env(safe-area-inset-bottom, 20px)); }
.publico-head { display: flex; gap: 14px; align-items: center; }
.publico-head .brand-mark {
  width: 44px; height: 44px; border-radius: 13px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); flex: none;
}
.publico-head h1 { font-size: 22px; font-weight: 800; letter-spacing: var(--tracking-tight); color: var(--ink); }
.publico-head p.hint { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.paso { display: grid; gap: 14px; }
.paso > h2 { font-size: 16.5px; font-weight: 700; letter-spacing: var(--tracking-snug); color: var(--ink); }
.servicio {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-press) var(--ease-spring);
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .servicio:hover { background: var(--surface-2); border-color: var(--line-2); }
}
.servicio:active { transform: scale(0.985); }
.servicio .grow { flex: 1; display: grid; gap: 2px; }
.servicio .grow b { font-size: 15px; font-weight: 600; color: var(--ink); }
.servicio .grow .hint { font-size: 13px; color: var(--muted); }
.servicio .num { font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.servicio .check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex: none;
  display: grid; place-items: center; transition: all var(--dur-fast) var(--ease-out);
  color: transparent;
}
.servicio .check .ico {
  transform: scale(0.6); opacity: 0;
  transition: transform var(--dur-fast) var(--ease-spring), opacity var(--dur-fast);
}
.servicio[aria-pressed="true"] {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.servicio[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.servicio[aria-pressed="true"] .check .ico { transform: scale(1); opacity: 1; }
.resumen-bar {
  position: fixed; inset: auto 0 0 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px max(20px, calc((100vw - 540px) / 2)) max(14px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); box-shadow: var(--shadow-sheet);
}
.resumen-bar b.num { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); display: block; line-height: 1.2; }
.resumen-bar .hint { font-size: 12.5px; color: var(--muted); line-height: 1.2; }
.resumen-bar .btn-primary {
  flex: none; min-height: 46px; padding: 0 22px; font-size: 15px; font-weight: 700; border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}
.resumen-bar .btn-primary:disabled {
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  opacity: 1; cursor: not-allowed; box-shadow: none;
}
body:has(.publico) #toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-lg);
  font-weight: 600; animation: up .2s ease-out; }
.toast.error { background: var(--bad); color: var(--surface); } /* oscuro sobre rojo claro en modo oscuro */
@media (min-width: 900px) {
  #toasts { bottom: 28px; }
  /* Dentro de la hoja lateral, arriba bajo el encabezado: abajo taparía los campos y los botones. */
  dialog #toasts { left: auto; right: 20px; transform: none; width: 420px; top: 84px; bottom: auto; }
}

/* ---------- Modo TV ---------- */
.tv {
  min-height: 100dvh;
  padding: clamp(24px, 4vw, 44px) clamp(24px, 5vw, 56px);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 75%),
    #0a0a0a;
  color: #fafafa;
  /* La TV siempre es oscura: sus tokens no siguen el modo claro/oscuro del aparato. */
  --surface: #171717;
  --surface-2: #1f1f1f;
  --line: #262626;
  --line-2: #2e2e2e;
  --ink: #fafafa;
  --muted: #a3a3a3;
  --accent-text: #fb923c;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 32px;
}
.tv header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.tv header h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: #ffffff;
  margin: 0;
}
.tv header .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px -2px color-mix(in srgb, var(--accent) 45%, transparent);
}
.tv .clock {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  align-content: start;
}
.tv-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  display: grid;
  gap: 20px;
  align-content: start;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}
.tv-col h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: var(--tracking-snug);
  color: #ffffff;
  margin: 0;
}
.tv-now {
  padding: 18px 20px;
  border-radius: 18px;
  background: color-mix(in srgb, #15803d 18%, var(--surface));
  border: 1.5px solid color-mix(in srgb, #22c55e 32%, transparent);
}
.tv-now small {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
  color: #4ade80;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tv-now small::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
  animation: pulseNow 2s infinite ease-in-out;
}
@keyframes pulseNow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.tv-now b {
  display: block;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin-top: 6px;
  line-height: 1.2;
}
.tv-free {
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1.5px dashed var(--line-2);
  font-size: 22px;
  color: var(--muted);
  font-weight: 700;
}
.tv-next {
  display: grid;
  gap: 10px;
}
.tv-next small {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}
.tv-next div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(24px, 2.2vw, 30px);
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: #ffffff;
}
.tv-next div span:first-child {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.tv-next div span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
  font-weight: 800;
  font-size: clamp(22px, 2vw, 28px);
}
.tv .exit {
  position: fixed;
  right: 16px;
  bottom: 16px;
  opacity: .25;
  transition: opacity var(--dur-fast);
}
.tv .exit:hover { opacity: 1; }

/* ---------- Documentos y Políticas (Legal) ---------- */
.doc-page { max-width: 680px; margin: 0 auto; padding: 32px 16px 90px; display: grid; gap: 24px; min-width: 0; }
.doc-header { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.doc-header h1 { font-size: 24px; font-weight: 800; letter-spacing: var(--tracking-tight); color: var(--ink); line-height: 1.25; margin: 0; }
.doc-header .hint { font-size: 13.5px; color: var(--muted); margin: 3px 0 0 0; }
.doc-card { padding: 32px 28px; display: grid; gap: 26px; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.doc-section { display: grid; gap: 12px; }
.doc-section h2 { font-size: 17px; font-weight: 700; letter-spacing: var(--tracking-snug); color: var(--ink); margin: 0; }
.doc-section p { margin: 0; color: var(--ink-2); line-height: 1.65; font-size: 14.5px; text-wrap: pretty; }
.doc-section ul { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); line-height: 1.6; font-size: 14.5px; }
.doc-section li strong { color: var(--ink); }
.doc-section a { color: var(--accent-text); font-weight: 600; text-underline-offset: 3px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
.doc-table th, .doc-table td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.doc-table th { background: var(--surface-2); font-weight: 600; color: var(--ink); }
.doc-footer { text-align: center; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: grid; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

