/*
 * Epic · El Código — panel del equipo. Tema oscuro con acento cian (logo CT), mobile first:
 * base para móvil (≥ 360 px), barra lateral de iconos desde 900 px y completa desde 1440 px. Sin fuentes ni recursos externos.
 *
 * Clases para las vistas (assets/views/*.js):
 *   Maquetación  page-head, page-title, toolbar, stack, stack-sm, stack-lg, row, row.between, spacer, grid, grid-2,
 *                grid-3, grid-4, split (lista + detalle; .show-detail en móvil), col, view.fill (alto visible exacto)
 *   Bloques      card, card-head, card-title, card.link, notice (.warn .bad .ok .info) + notice-body, empty,
 *                spinner / spinner-wrap, skeleton, kpis + kpi (kpi-label, kpi-value, kpi-sub, kpi-delta .up .down .flat),
 *                bar (> span = relleno), list + list-item (.active .unread), kv (lista dt/dd), shortcuts
 *   Controles    btn (.primary .danger .ghost .small .block .on .btn-icon), seg, tabs + tab ([aria-selected=true]),
 *                field + field-label + help + error-text, check, switch (checkbox), label.toggle, chip, input
 *   Etiquetas    pill (.on .ok .warn .bad .info), badge stage stage-<etapa> (variables --stage-color/--stage-bg),
 *                count (número), dot (punto de no leído)
 *   Chat         chat-scroll, msg (.user .assistant .team) + who, at, kind; note, typing, composer, avatar
 *   Específicos  kanban, kanban-col, kanban-head, kanban-list, kanban-card (.dragging, .drag-over),
 *                heatmap + heat-cell (--v de 0 a 1), diff + diff-line (.diff-add .diff-del .diff-gap), code
 *   Texto        muted, small, mono, num (cifras alineadas), truncate, nowrap, right, center, ok-text, warn-text,
 *                bad-text, sr-only
 *   Iconos       ico (SVG de Epic.ui.icon)
 *
 * UI v3 (fase A): tokens --fs-xs..--fs-2xl (12/13/14/16/20/24), --h-control (36; 44 en táctil), --h-control-sm (32; 44),
 *   --r-sm/--r-md/--r-lg, --sp-1..--sp-8 (4–32), --faint AA, --toast-lift. Componentes de core.js: ui-page-head,
 *   ui-tabs/ui-tab, ui-pager, ui-menu, ui-sheet, ui-chips/ui-chip, ui-empty, ui-skel-cards, rel-time. Con
 *   @media (pointer: coarse) todo control mide al menos 44 px.
 */

:root {
  color-scheme: dark;
  /* Superficies */
  --bg: #080a0e;
  --panel: #0e1217;
  --panel-2: #151a21;
  --panel-3: #1d232c;
  --hover: #181e26;
  --input: #0a0d12;
  /* Texto */
  --ink: #e8edf3;
  --ink-2: #c3cbd5;
  --muted: #8892a1;
  /* Texto secundario: ≥ 4,5:1 sobre --panel-2 (#151a21) y --panel (#0e1217). */
  --faint: #7b8796;
  /* Bordes */
  --line: #1f2630;
  --line-2: #2a323e;
  /* Acento (cian del logo) */
  --accent: #2ec5e0;
  --accent-hover: #5bd6ec;
  --accent-ink: #03161b;
  --accent-soft: rgba(46, 197, 224, .12);
  --accent-line: rgba(46, 197, 224, .38);
  --accent-glow: 0 0 0 3px rgba(46, 197, 224, .18);
  /* Estados */
  --warn: #f0b35b;
  --warn-bg: #241c11;
  --warn-line: #4a3920;
  --bad: #f2726a;
  --bad-bg: #29151a;
  --bad-line: #522a2e;
  --ok: #3fd18f;
  --ok-bg: #0e261d;
  --ok-line: #1d4836;
  --info: #62b8f2;
  --info-bg: #0e2031;
  --info-line: #1d3c58;
  --team: #29244a;
  --team-ink: #b8aaf6;
  /* Chat */
  --bot: #18202a;
  --me: #0d3944;
  --chat: #0a0d12;
  --focus: #5bd6ec;
  /* Forma */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: .15s;
  /* Pasar el cursor, enfocar y seleccionar (menús, iconos): ~150 ms. Sin movimiento con prefers-reduced-motion. */
  --dur-ui: 150ms;
  /* Espaciado */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  /* UI v3: escala de 6 tamaños de letra, alturas de control, radios y espaciado (úsalos en las vistas). */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --h-control: 36px;
  --h-control-sm: 32px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --top-h: 56px;
  --bottom-h: 62px;
  --side-w: 248px;
  --side-w-mini: 68px;
}

/* ─── Base ──────────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
img, video, canvas { max-width: 100%; height: auto; }
svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 var(--s2); line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0 0 var(--s2); }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 var(--s2); padding-left: 20px; }
hr, .divider { border: 0; border-top: 1px solid var(--line); margin: var(--s3) 0; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code, kbd { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-xs); padding: 1px 5px; }
pre, .code {
  margin: 0;
  padding: 10px 12px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12.5px;
}
details > summary { cursor: pointer; color: var(--ink); border-radius: var(--radius-xs); }
details > summary:hover { color: var(--accent-hover); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0; min-width: 0; }
legend { padding: 0 6px; color: var(--muted); font-size: 12px; }
dialog { color: var(--ink); }
::selection { background: rgba(46, 197, 224, .3); }
* { scrollbar-width: thin; scrollbar-color: #2b3440 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262e39; border: 2px solid transparent; border-radius: 99px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #34404e; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#main:focus, #main:focus-visible { outline: none; }

/* Iconos (Epic.ui.icon): biblioteca propia en un sprite de <symbol> (core.js). Trazo 1,6 en currentColor, 24 × 24. */
.ico {
  display: block;
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  transition: color var(--dur-ui) var(--ease), opacity var(--dur-ui) var(--ease), transform var(--dur-ui) var(--ease);
}
.ico-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* ─── Controles ─────────────────────────────────────────────────────────────────────────── */

button, input, select, textarea { font: inherit; color: inherit; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--h-control);
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 550;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform .08s;
}
button:hover, .btn:hover { background: var(--panel-3); border-color: #36404d; color: var(--ink); }
button:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(1px); }
button:disabled, .btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
button.primary, .btn.primary, .btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 4px 14px rgba(46, 197, 224, .18);
}
button.primary:hover, .btn.primary:hover, .btn.on:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
button.danger, .btn.danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
button.danger:hover, .btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); color: #ff9a92; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover, .btn.ghost:hover { background: var(--hover); color: var(--ink); border-color: transparent; }
button.small, .btn.small { min-height: var(--h-control-sm); padding: 4px 10px; font-size: var(--fs-sm); border-radius: 7px; }
.btn.block { display: flex; width: 100%; }
.btn-icon { min-width: var(--h-control); padding: 6px; font-size: 18px; line-height: 1; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn .ico, button .ico { width: 16px; height: 16px; }
.btn-icon .ico { width: 18px; height: 18px; }

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
select, textarea, .input {
  width: 100%;
  min-height: var(--h-control);
  padding: 7px 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):hover,
select:hover, textarea:hover { border-color: #36404d; }
textarea { min-height: 84px; line-height: 1.5; resize: vertical; }
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238892a1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px 16px;
}
select:not([multiple]):not([size]) { padding-right: 30px !important; }
select[multiple], select[size] { background-image: none; }
select option { background: var(--panel); color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: var(--accent-glow); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad) !important; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="file"] { max-width: 100%; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 550;
  cursor: pointer;
}
::placeholder { color: var(--faint); opacity: 1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.error-text, .field-error { margin: 0; color: var(--bad); font-size: 12px; }
.check, label.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type="checkbox"].switch, .switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
input[type="checkbox"].switch::before, .switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), background-color var(--dur);
}
input[type="checkbox"].switch:checked, .switch input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"].switch:checked::before, .switch input[type="checkbox"]:checked::before { transform: translateX(16px); background: #fff; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input);
  max-width: 100%;
}
.seg > button, .seg > .btn { min-height: calc(var(--h-control-sm) - 4px); padding: 4px 12px; border-color: transparent; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 550; box-shadow: none; }
.seg > button:hover, .seg > .btn:hover { color: var(--ink); border-color: transparent; background: var(--hover); }
.seg > .on, .seg > [aria-pressed="true"], .seg > [aria-selected="true"], .seg > [aria-checked="true"] {
  background: var(--panel-3);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 1px var(--line-2) inset;
}
.seg > .on:hover, .seg > [aria-pressed="true"]:hover { background: var(--panel-3); color: var(--ink); }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab, .tabs > button {
  flex: none;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 550;
  box-shadow: none;
}
.tab:hover, .tabs > button:hover { color: var(--ink); background: transparent; border-color: transparent; border-bottom-color: var(--line-2); }
.tab[aria-selected="true"], .tab.on, .tab.active, .tabs > button[aria-selected="true"], .tabs > button.on, .tabs > button.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 650;
  background: transparent;
  box-shadow: none;
}

/* ─── Etiquetas ─────────────────────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border: 1px solid transparent;
  border-radius: 99px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.6;
  white-space: nowrap;
}
.pill.on { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.pill.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.pill.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.pill.bad, .pill.error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.pill.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 12px; background: var(--panel-2); color: var(--ink-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 8px;
  border: 1px solid color-mix(in srgb, var(--stage-color, var(--ink)) 22%, transparent);
  border-radius: 6px;
  background: var(--stage-bg, var(--panel-2));
  color: var(--stage-color, var(--ink));
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  white-space: nowrap;
}
.badge.stage::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.stage-nuevo { --stage-color: #b9c6d2; --stage-bg: #1a222b; }
.stage-cualificando { --stage-color: #62c4f2; --stage-bg: #0d2534; }
.stage-precio_dado { --stage-color: #f0b35b; --stage-bg: #2a2012; }
.stage-enlace_enviado { --stage-color: #ae9cf8; --stage-bg: #211c3d; }
.stage-entrevista_premium { --stage-color: #f09fd8; --stage-bg: #2d1829; }
.stage-pagado { --stage-color: #3fd18f; --stage-bg: #0e261d; }
.stage-pospuesto { --stage-color: #9fb0bd; --stage-bg: #1b2229; }
.stage-no_encaja { --stage-color: #d8ad85; --stage-bg: #2a2119; }
.stage-perdido { --stage-color: #f2847c; --stage-bg: #2b1517; }
.stage-unknown { --stage-color: var(--ink-2); --stage-bg: var(--panel-2); }

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.count.bad { background: var(--bad); color: #1d0c0a; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px rgba(46, 197, 224, .15); }

/* ─── Bloques ───────────────────────────────────────────────────────────────────────────── */

.card {
  min-width: 0;
  padding: var(--s5);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025) inset, var(--shadow-sm);
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: var(--s4); }
.card-title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.005em; }
a.card, .card.link { display: block; color: inherit; text-decoration: none; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
a.card:hover, .card.link:hover { border-color: var(--accent-line); background: #10151b; }

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink-2);
  line-height: 1.45;
}
.notice-body { flex: 1 1 220px; min-width: 0; }
.notice-body > strong { display: block; margin-bottom: 2px; font-weight: 650; }
.notice p { margin: 0; }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: #f3d4a3; }
.notice.warn strong { color: var(--warn); }
.notice.bad, .notice.error { background: var(--bad-bg); border-color: var(--bad-line); color: #f6c1bc; }
.notice.bad strong, .notice.error strong { color: var(--bad); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-line); color: #b7ecd2; }
.notice.ok strong { color: var(--ok); }
.notice.info { background: var(--info-bg); border-color: var(--info-line); color: #c5e3f7; }
.notice.info strong { color: var(--info); }
.notice a { color: inherit; font-weight: 600; }
.notice .btn, .notice button { flex: none; }

.empty { margin: 0 auto; padding: 32px 16px; max-width: 460px; text-align: center; color: var(--muted); }
.empty::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6877' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 13.5 6.3 5.6a1.5 1.5 0 0 1 1.4-1.1h8.6a1.5 1.5 0 0 1 1.4 1.1l2.8 7.9V18a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 18z'/%3E%3Cpath d='M3.5 13.5h5l1.5 2.5h4l1.5-2.5h5'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--panel-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: epic-spin .7s linear infinite;
  flex: none;
}
.spinner-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px 12px; color: var(--muted); }
@keyframes epic-spin { to { transform: rotate(360deg); } }

.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.skeleton-line, .skel {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%);
  background-size: 200% 100%;
  animation: epic-shimmer 1.4s ease-in-out infinite;
}
@keyframes epic-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.list-item:hover { background: var(--hover); }
.list-item.active, .list-item[aria-current], .list-item[aria-selected="true"] { background: var(--panel-2); border-color: var(--line-2); }
.list-item.unread .title, .list-item.unread strong { font-weight: 700; }

.kv { display: grid; grid-template-columns: minmax(90px, max-content) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpis.kpis-3 .kpi { padding: 12px; }
.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card .kpi { background: var(--panel-2); border-color: var(--line); }
a.kpi:hover { border-color: var(--accent-line); background: #10161c; color: inherit; }
.kpi.attention { box-shadow: inset 3px 0 0 var(--warn); }
.kpi.attention .kpi-value { color: var(--warn); }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 550; hyphens: auto; }
.kpi-value { font-size: 28px; font-weight: 650; line-height: 1.1; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.kpi-delta { font-size: 12px; font-weight: 600; }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--bad); }
.kpi-delta.flat { color: var(--muted); }
.kpi-icon { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 16px; }
.kpi.attention .kpi-icon { background: var(--warn-bg); color: var(--warn); }
.kpi-icon ~ .kpi-label, .kpi-icon ~ .kpi-value { padding-right: 38px; }

.bar { display: block; height: 8px; min-width: 0; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.bar > span, .bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s var(--ease); }

/* ─── Maquetación ───────────────────────────────────────────────────────────────────────── */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: var(--s5); }
.page-title { margin: 0 0 2px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-title + p, .page-title + .muted { margin-top: 2px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--s3); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: var(--s5); }
.col { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.row > input, .row > select, .row > textarea { width: auto; flex: 1 1 140px; min-width: 0; }
.spacer { flex: 1 1 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--s3); }
.grid-2, .grid-3, .grid-4 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }

.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); min-height: 0; }
.split > * { min-width: 0; min-height: 0; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: var(--panel); }
thead th { border-bottom-color: var(--line-2); }
th[aria-sort], th.sortable { cursor: pointer; user-select: none; }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; color: var(--accent); }
th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; color: var(--accent); }
tbody tr { transition: background-color .1s; }
tbody tr:hover { background: rgba(255, 255, 255, .022); }
tbody tr:last-child td { border-bottom: 0; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* ─── Chat ──────────────────────────────────────────────────────────────────────────────── */

.chat-scroll { display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 16px; overflow-y: auto; background: var(--chat); }
.msg {
  align-self: flex-start;
  max-width: 88%;
  padding: 8px 11px 6px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  background: var(--bot);
  border: 1px solid rgba(255, 255, 255, .03);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25);
  line-height: 1.45;
}
.msg.user { align-self: flex-start; background: var(--bot); }
.msg.assistant { align-self: flex-end; background: var(--me); border-color: rgba(46, 197, 224, .14); border-top-left-radius: 12px; border-top-right-radius: 4px; }
.msg.team { align-self: flex-end; background: var(--team); border-color: rgba(184, 170, 246, .14); border-top-left-radius: 12px; border-top-right-radius: 4px; }
.msg .who { margin-bottom: 2px; font-size: 12px; font-weight: 650; color: var(--info); }
.msg.assistant .who { color: #8fe3f2; }
.msg.team .who { color: var(--team-ink); }
.msg .kind { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: rgba(0, 0, 0, .28); font-size: 11px; font-weight: 550; }
.msg .at { margin-top: 3px; font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.msg.assistant .at, .msg.team .at { color: rgba(232, 237, 243, .7); }
.msg a { color: #8fe3f2; }
.note { align-self: center; max-width: 86%; padding: 4px 12px; border: 1px solid var(--warn-line); border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: 12px; text-align: center; }
.typing { align-self: flex-start; color: var(--muted); font-style: italic; }
.composer { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { flex: 1; min-height: 40px; max-height: 160px; border-radius: 20px; padding: 9px 16px; resize: none; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; flex: none; }

/* ─── Embudo (kanban), mapa de calor, diferencias ──────────────────────────────────────── */

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 140px;
  max-height: calc(100vh - var(--top-h) - var(--bottom-h) - 140px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.kanban-col.drag-over, .kanban-col.over { border-color: var(--accent); background: #0f171d; box-shadow: var(--accent-glow); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.kanban-list { display: flex; flex-direction: column; gap: 6px; padding: 8px; overflow-y: auto; }
.kanban-card { padding: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); cursor: grab; }
.kanban-card:hover { border-color: var(--line-2); background: #19202a; }
.kanban-card.dragging { opacity: .45; }

.heatmap { display: grid; grid-template-columns: 32px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10px; color: var(--muted); }
.heat-cell {
  aspect-ratio: 1;
  min-height: 8px;
  border-radius: 3px;
  background: var(--panel-2);
  background: color-mix(in srgb, var(--accent) calc(var(--v, 0) * 100%), var(--panel-2));
}

.diff { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--input); font: 12px/1.55 var(--mono); }
.diff-line { display: grid; grid-template-columns: 3.2em 3.2em 1.4em minmax(0, 1fr); white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-line > span:not(:last-child) { color: var(--faint); text-align: right; padding-right: 6px; user-select: none; }
.diff-add { background: rgba(63, 209, 143, .12); }
.diff-del { background: rgba(242, 114, 106, .14); }
.diff-gap { padding: 2px 8px; color: var(--muted); text-align: center; background: var(--panel); }

/* ─── Texto ─────────────────────────────────────────────────────────────────────────────── */

.muted { color: var(--muted); }
.small { font-size: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.copy-buffer { position: fixed; top: -1000px; left: 0; width: 1px; height: 1px; opacity: 0; }

/* ─── Estructura del panel ──────────────────────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
.skip-link:focus { top: 8px; }

.app { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; min-height: 100dvh; }
.app[data-auth="loading"] { display: block; }
.boot { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60vh; color: var(--muted); }
.noscript { margin: 24px; text-align: center; color: var(--warn); }

/* Marca */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; border-radius: 10px; }
.brand:hover { color: var(--ink); }
/* Símbolo de marca: cuadrado de esquinas redondeadas con borde discreto y una luz interior muy sutil (cian del logo). */
.brand-logo-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  overflow: hidden;
  border: 1px solid rgba(46, 197, 224, .26);
  border-radius: 10px;
  background: radial-gradient(120% 120% at 30% 20%, #0d1b22 0%, #05080b 70%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 6px 18px rgba(46, 197, 224, .08);
  transition: border-color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease);
}
.brand-logo-box::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 12px rgba(46, 197, 224, .2);
  pointer-events: none;
}
.brand:hover .brand-logo-box, .brand:focus-visible .brand-logo-box { border-color: rgba(46, 197, 224, .45); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 6px 20px rgba(46, 197, 224, .16); }
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.brand-text { display: none; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-name { font-weight: 750; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 11.5px; font-weight: 550; white-space: nowrap; }

.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.brand-mark.big { width: 48px; height: 48px; font-size: 22px; }

/* Cabecera: una sola fila (≤ 56 px) en todos los anchos.
   Móvil: logo · título de la pantalla · «Estado de Epic». PC: entorno · «Estado de Epic» · campana · usuario. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(56px + env(safe-area-inset-top));
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: rgba(10, 13, 18, .9);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.app[data-live="true"] .topbar { box-shadow: inset 0 2px 0 rgba(63, 209, 143, .55); }
.topbar > .brand { flex: none; min-width: 44px; min-height: 44px; justify-content: center; }
.topbar > .brand .brand-text { display: none; }
.env-area { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.top-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.01em; }
.env-badges { display: none; align-items: center; gap: 6px; min-width: 0; }
.pill.env { font-weight: 700; letter-spacing: .06em; font-size: 11px; }
.pill.env-demo { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.pill.env-puente { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.pill.env-produccion { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.pill.live { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); font-weight: 650; }
.live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--ok); opacity: 0; animation: epic-live 2.4s ease-out infinite; }
@keyframes epic-live { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }

/* Botón «Estado de Epic»: resume Epic activo · presencia · Prueba/Real y abre la hoja. */
.topbar-controls { display: flex; align-items: center; flex: none; min-width: 0; }
.status-pill {
  gap: 7px;
  min-height: 40px;
  max-width: 100%;
  padding: 4px 10px 4px 12px;
  border-radius: 99px;
  border-color: var(--line-2);
  background: var(--input);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.status-pill:hover { background: var(--panel-2); color: var(--ink); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 209, 143, .16); flex: none; }
.status-pill.is-paused { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.status-pill.is-paused .status-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(240, 179, 91, .18); }
.status-pill.is-unknown .status-dot { background: var(--muted); box-shadow: none; }
.status-part { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status-part + .status-part::before { content: "·"; margin-right: 7px; color: var(--faint); }
.status-mode { color: var(--warn); }
.status-mode.is-real { color: var(--ok); }
.status-chevron { display: grid; place-items: center; color: var(--muted); }
.status-chevron .ico { width: 14px; height: 14px; }
/* Móvil estrecho: «Activo · Prueba» (la presencia está dentro de la hoja). */
.status-presence { display: none; }
.status-epic { font-size: 0; }
.status-epic::after { content: attr(data-short); font-size: var(--fs-sm); }

/* Hoja «Estado de Epic» */
.status-sec { display: flex; flex-direction: column; gap: 8px; }
.status-sec-title { margin: 0; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.status-lock { display: inline; color: var(--muted); }
.status-lock .ico { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; }
.epic-switch { justify-content: flex-start; gap: 12px; width: 100%; min-height: 48px; padding: 8px 14px; background: var(--input); border-color: var(--line-2); font-weight: 650; font-size: var(--fs-md); text-align: left; }
.epic-switch:hover { background: var(--panel-2); }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--accent); flex: none; transition: background-color var(--dur) var(--ease); }
.switch-knob { position: absolute; top: 3px; left: 19px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left var(--dur) var(--ease); }
.epic-switch.is-paused { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.epic-switch.is-paused .switch-track { background: #5d4a2c; }
.epic-switch.is-paused .switch-knob { left: 3px; background: var(--warn); }
.epic-switch.is-unknown .switch-track { background: var(--panel-3); }
.epic-switch.is-unknown .switch-knob { left: 11px; background: var(--muted); }
.switch-label { overflow: hidden; text-overflow: ellipsis; }
.epic-switch[aria-disabled="true"], .presence-opt[aria-disabled="true"] { opacity: .7; cursor: progress; }
.presence-options { display: flex; flex-direction: column; gap: 6px; }
.presence-opt {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--input);
  border-color: var(--line-2);
  text-align: left;
  font-weight: 500;
}
.presence-opt:hover { background: var(--panel-2); }
.presence-opt.on { border-color: var(--accent-line); background: var(--accent-soft); }
.presence-radio { position: relative; width: 18px; height: 18px; margin-top: 2px; border: 2px solid var(--line-2); border-radius: 50%; flex: none; }
.presence-opt.on .presence-radio { border-color: var(--accent); }
.presence-opt.on .presence-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.presence-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.presence-text strong { color: var(--ink); font-weight: 650; }

/* Interruptor Prueba · Real (dentro de la hoja) */
.mode-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--input); align-self: flex-start; }
.mode-opt {
  min-height: 38px;
  min-width: 96px;
  padding: 4px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-md);
  font-weight: 650;
  box-shadow: none;
}
.mode-opt:hover { background: var(--hover); color: var(--ink); border: 0; }
.mode-opt.on.mode-prueba { background: var(--warn-bg); color: var(--warn); box-shadow: 0 0 0 1px var(--warn-line) inset; }
.mode-opt.on.mode-real { background: var(--ok-bg); color: var(--ok); box-shadow: 0 0 0 1px var(--ok-line) inset; }
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.mode-switch.is-locked .mode-opt { cursor: not-allowed; }
.mode-switch.is-locked .mode-opt:not(.on) { opacity: .45; }
.mode-switch.is-locked .mode-opt:hover:not(.on) { background: transparent; color: var(--muted); }
.mode-opt[aria-disabled="true"] { transform: none !important; }

.bell {
  position: relative;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 19px;
  flex: none;
  transition: background-color var(--dur) var(--ease), color var(--dur);
}
.bell:hover { background: var(--hover); color: var(--ink); }
.bell .count { position: absolute; top: -1px; right: -3px; box-shadow: 0 0 0 2px var(--bg); }
.bell.stale { opacity: .55; }
.user-box { display: none; align-items: center; min-width: 0; flex: none; }
.user-btn { gap: 8px; min-height: 40px; padding: 2px 8px 2px 3px; border-color: transparent; background: transparent; border-radius: 99px; }
.user-btn:hover { background: var(--hover); border-color: transparent; }
.user-btn .user-name { display: none; }
.user-chevron { color: var(--muted); display: grid; }
.user-chevron .ico { width: 14px; height: 14px; }
.user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 550; }
.user-name.local, a.user-name.local { color: var(--warn); font-size: var(--fs-sm); }
.user-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-3); color: var(--muted); font-size: 15px; flex: none; }
.user-icon.has-initial { background: linear-gradient(135deg, #1b5f6d, #123c47); color: #d8f6fc; font-size: 13px; font-weight: 700; box-shadow: 0 0 0 1px rgba(46, 197, 224, .3); }

/* Barra lateral (escritorio) */
.sidebar { display: none; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }

main {
  --pad-top: 16px;
  --pad-x: 16px;
  --pad-bottom: calc(var(--bottom-h) + 24px);
  min-width: 0;
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom);
  overflow-wrap: break-word; /* «anywhere» encogería botones y etiquetas a media palabra */
}
.view { max-width: 1240px; margin: 0 auto; min-width: 0; animation: epic-view-in .22s var(--ease); }
.view.wide { max-width: none; }
.view.fill {
  display: flex;
  flex-direction: column;
  max-width: none;
  height: calc(100vh - var(--top-h) - var(--bottom-h));
  height: calc(100dvh - var(--top-h) - var(--bottom-h));
  min-height: 320px;
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-x)) calc(-1 * var(--pad-bottom));
  overflow: hidden;
  animation: none;
}
.view.fill > * { min-height: 0; }
@keyframes epic-view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Barra inferior (móvil) */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10, 13, 18, .92);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-top: 1px solid var(--line);
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  text-decoration: none;
  transition: background-color var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease), border-color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"], .nav-link.active { color: var(--accent); }
.nav-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.nav-icon { display: grid; place-items: center; width: 20px; height: 20px; font-size: 18px; line-height: 1; flex: none; transition: color var(--dur-ui) var(--ease), background-color var(--dur-ui) var(--ease); }
.nav-icon .ico { width: 20px; height: 20px; }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottomnav .nav-link {
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 6px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: var(--fs-xs);
  font-weight: 600;
  box-shadow: none;
}
.bottomnav .nav-more { color: var(--muted); min-height: 58px; }
/* Icono de la barra inferior dentro de una pastilla: la sección elegida la enciende (fondo suave y borde discreto). */
.bottomnav .nav-icon { width: 44px; height: 28px; border: 1px solid transparent; border-radius: 99px; }
.bottomnav .nav-icon .ico { width: 21px; height: 21px; }
.bottomnav .nav-link:hover { background: transparent; }
.bottomnav .nav-link:hover .nav-icon { background: var(--hover); }
.bottomnav .nav-link[aria-current="page"] .nav-icon, .bottomnav .nav-link.active .nav-icon { background: var(--accent-soft); border-color: var(--accent-line); }
.bottomnav .nav-link[aria-current="page"]::before, .bottomnav .nav-link.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 22px;
  height: 2px;
  margin-left: -11px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(46, 197, 224, .7);
}
.bottomnav .nav-link .count { position: absolute; top: 5px; left: calc(50% + 5px); box-shadow: 0 0 0 2px var(--bg); }
.bottomnav .nav-text { max-width: 100%; }
.nav-dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }

/* Hojas (Epic.ui.sheet): inferior en el móvil, panel centrado en el PC. «Más», «Estado de Epic», menús en el móvil. */
dialog.ui-sheet {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}
dialog.ui-sheet::backdrop { background: rgba(3, 5, 8, .62); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog.ui-sheet.is-panel {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  border-radius: var(--radius-xl);
}
dialog.ui-sheet.is-panel.wide { width: min(760px, calc(100vw - 24px)); }
/* Se anima el contenido, no el <dialog>: un transform en el diálogo movería los avisos (position: fixed) que viven dentro. */
dialog.ui-sheet.is-panel[open] > .ui-sheet-inner { animation: epic-modal-in .18s var(--ease); }
dialog.ui-sheet.is-bottom {
  width: 100%;
  max-width: 100%;
  margin: auto 0 0;
  max-height: 88vh;
  max-height: 88dvh;
  border-width: 1px 0 0;
  border-radius: 18px 18px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}
dialog.ui-sheet.is-bottom[open] > .ui-sheet-inner { animation: epic-sheet-up .22s var(--ease); }
.ui-sheet-inner { transition: transform .12s; }
@keyframes epic-sheet-up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.ui-sheet-inner { display: flex; flex-direction: column; max-height: inherit; }
.ui-sheet-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px 18px; border-bottom: 1px solid var(--line); touch-action: none; }
.is-bottom .ui-sheet-head { padding-top: 20px; }
.ui-sheet-grip { position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 99px; background: var(--line-2); }
.ui-sheet-title { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-lg); font-weight: 650; }
.ui-sheet-body { flex: 1 1 auto; min-height: 0; padding: 16px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.ui-sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.is-bottom .ui-sheet-actions > .btn { flex: 1 1 auto; }
.ui-menu-sheet .ui-sheet-body { padding: 8px 10px 14px; }
.ui-menu-list { display: flex; flex-direction: column; gap: 2px; }
.sheet-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.sheet-nav { display: flex; flex-direction: column; gap: 2px; }
/* Menú lateral y hoja «Más»: icono + texto a 10 px; la sección elegida lleva fondo suave, borde discreto e indicador lateral. */
.sheet-nav .nav-link, .sidenav .nav-link { gap: 10px; min-height: 38px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--ink-2); font-weight: 550; }
.sheet-nav .nav-link .nav-icon, .sidenav .nav-link .nav-icon { color: var(--muted); }
.sheet-nav .nav-link:hover, .sidenav .nav-link:hover { background: var(--hover); color: var(--ink); }
.sheet-nav .nav-link:hover .nav-icon, .sidenav .nav-link:hover .nav-icon { color: var(--ink-2); }
.sheet-nav .nav-link[aria-current="page"], .sidenav .nav-link[aria-current="page"] { background: var(--accent-soft); border-color: rgba(46, 197, 224, .22); color: var(--ink); font-weight: 650; }
.sheet-nav .nav-link[aria-current="page"] .nav-icon, .sidenav .nav-link[aria-current="page"] .nav-icon { color: var(--accent); }
.sheet-nav .nav-link[aria-current="page"]::before,
.sidenav .nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(46, 197, 224, .6);
}
.sheet-nav .nav-link .count, .sidenav .nav-link .count { margin-left: auto; }
.sheet-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.sheet-nav .nav-link { min-height: 48px; padding: 10px 12px; font-size: var(--fs-md); }
.sheet-nav .nav-link .nav-icon { width: 22px; }
.sheet-nav .nav-link[aria-current="page"]::before { left: -1px; top: 11px; bottom: 11px; }
.nav-sep { display: block; height: 1px; margin: 6px 10px; background: var(--line); }
.nav-tip {
  position: fixed;
  z-index: 70;
  transform: translateY(-50%);
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #1d232c;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow);
  pointer-events: none;
}

/* Fuera del panel y mientras carga la sesión: solo marca y entorno (sin controles, menú ni barra inferior). */
.app[data-auth="out"] .topbar > .brand .brand-text,
.app[data-auth="loading"] .topbar > .brand .brand-text { display: flex; }
.app[data-auth="out"] .env-badges,
.app[data-auth="loading"] .env-badges { display: flex; margin-left: auto; }
.app[data-auth="out"] .top-title,
.app[data-auth="loading"] .top-title,
.app[data-auth="out"] .topbar-controls,
.app[data-auth="out"] .bell,
.app[data-auth="out"] .user-box,
.app[data-auth="out"] .sidebar,
.app[data-auth="out"] .bottomnav,
.app[data-auth="out"] .mode-switch,
.app[data-auth="loading"] .topbar-controls,
.app[data-auth="loading"] .bell,
.app[data-auth="loading"] .user-box,
.app[data-auth="loading"] .sidebar,
.app[data-auth="loading"] .bottomnav,
.app[data-auth="loading"] .mode-switch { display: none !important; }
.app[data-auth="out"] main,
.app[data-auth="loading"] main { --pad-bottom: 24px; }
.app[data-auth="out"] .topbar > .brand .brand-text { display: flex; }

/* ─── Diálogos y avisos flotantes ───────────────────────────────────────────────────────── */

dialog.modal {
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}
dialog.modal[open] > .modal-inner { animation: epic-modal-in .18s var(--ease); }
dialog.modal.wide { width: min(980px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(3, 5, 8, .66); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.modal.modal-fallback { position: fixed; inset: 0; z-index: 90; margin: auto; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .6); }
@keyframes epic-modal-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-inner { display: flex; flex-direction: column; max-height: inherit; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-title { flex: 1; margin: 0; font-size: 16px; font-weight: 650; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-body > * { margin: 0; }
.modal-text { white-space: pre-line; color: var(--ink-2); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .012); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
/* Confirmación de algo que no tiene vuelta: borde y aviso rojos; el botón de peligro es rojo y relleno. */
dialog.modal.is-danger { border-color: var(--bad-line); box-shadow: var(--shadow), 0 0 0 1px rgba(242, 114, 106, .12); }
dialog.modal.is-danger .modal-head { border-bottom-color: var(--bad-line); background: linear-gradient(180deg, rgba(242, 114, 106, .07), transparent); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.modal-danger-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bad-bg); color: var(--bad); flex: none; }
.modal-danger-icon .ico { width: 17px; height: 17px; }
dialog.modal.is-danger .modal-actions .btn.danger { background: var(--bad); border-color: var(--bad); color: #1d0c0a; font-weight: 700; }
dialog.modal.is-danger .modal-actions .btn.danger:hover { background: #ff8a82; border-color: #ff8a82; color: #1d0c0a; }

.toasts {
  position: fixed;
  left: 12px;
  right: 12px;
  /* --toast-lift: una vista con un pie fijo (p. ej. «Guardar · Descartar») lo sube para no taparlo. */
  bottom: calc(var(--bottom-h) + 12px + var(--toast-lift, 0px));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(24, 30, 38, .97);
  color: var(--ink);
  box-shadow: var(--shadow);
  pointer-events: auto;
  cursor: pointer;
  animation: epic-toast-in .22s var(--ease);
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}
.toast.has-action { cursor: default; align-items: center; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 1px; }
.toast-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.toast-icon .ico { width: 15px; height: 15px; }
.toast-close { flex: none; min-height: 28px; min-width: 28px; padding: 4px; border: 0; background: transparent; color: var(--muted); box-shadow: none; }
.toast-close:hover { background: var(--hover); color: var(--ink); }
.toast-close .ico { width: 14px; height: 14px; }
.toast-action { flex: none; min-height: 32px; padding: 4px 12px; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-hover); font-weight: 700; }
.toast-action:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toast-kbd { flex: none; padding: 1px 5px; font-size: 11px; color: var(--muted); background: transparent; }
.toast-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left center; animation: epic-toast-progress linear forwards; opacity: .8; }
@keyframes epic-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast-ok .toast-icon { background: var(--accent); color: var(--accent-ink); }
.toast-info .toast-icon { background: var(--info); color: #06131d; }
.toast-warn { border-color: var(--warn-line); }
.toast-warn .toast-icon { background: var(--warn); color: #1d1406; }
.toast-error { border-color: var(--bad-line); }
.toast-error .toast-icon { background: var(--bad); color: #1d0c0a; }
@keyframes epic-toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

body.is-busy::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat;
  background-size: 40% 100%;
  animation: epic-busy 1.1s linear infinite;
}
@keyframes epic-busy { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ─── Componentes UI v3 (Epic.ui.*) ─────────────────────────────────────────────────────── */

/* Cabecera de pantalla: título + subtítulo a la izquierda; acciones y «Actualizar» (el último) a la derecha. */
.ui-page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: var(--sp-5); }
.ui-page-titles { flex: 1 1 0; min-width: min(100%, 170px); }
.ui-page-titles .page-title { margin: 0; }
.ui-page-sub { margin: 4px 0 0; font-size: var(--fs-md); }
.ui-page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 1 auto; margin-left: auto; }
.ui-refresh { gap: 7px; }
.ui-refresh-icon { display: grid; place-items: center; }
.ui-refresh.is-busy .ui-refresh-icon { animation: epic-spin .8s linear infinite; }

/* Pestañas (Epic.ui.tabs): desplazables en horizontal con sombras en los bordes. */
.ui-tabs { position: relative; min-width: 0; margin-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.ui-tabs::before, .ui-tabs::after { content: ""; position: absolute; top: 0; bottom: 1px; width: 28px; pointer-events: none; opacity: 0; transition: opacity var(--dur); z-index: 1; }
.ui-tabs::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.ui-tabs::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.ui-tabs.fade-start::before, .ui-tabs.fade-end::after { opacity: 1; }
.ui-tabs-list { display: flex; align-items: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.ui-tabs-list::-webkit-scrollbar { display: none; }
.ui-tab {
  flex: none;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
  scroll-snap-align: center;
  white-space: nowrap;
}
.ui-tab:hover { color: var(--ink); background: var(--hover); border-color: transparent; border-bottom-color: var(--line-2); }
.ui-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--tab-color, var(--accent)); background: transparent; font-weight: 700; }
.ui-tab-ico { width: 17px; height: 17px; flex: none; opacity: .75; }
.ui-tab.has-color .ui-tab-ico { opacity: 1; color: var(--tab-color); }
.ui-tab[aria-selected="true"] .ui-tab-ico { opacity: 1; color: var(--tab-color, var(--accent)); }
.ui-tab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tab-color, var(--accent)); flex: none; }
.ui-tab-count { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--panel-2); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 650; font-variant-numeric: tabular-nums; }
.ui-tab[aria-selected="true"] .ui-tab-count { background: var(--panel-3); color: var(--ink); }
.ui-tab-badge { padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-hover); font-size: var(--fs-xs); font-weight: 650; }
.ui-tab-sep { flex: none; align-self: center; width: 1px; height: 22px; margin: 0 6px; background: var(--line-2); }

/* Paginador (Epic.ui.pager) */
.ui-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: var(--sp-4); }
.ui-pager-info { margin: 0; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ui-pager-nav { display: flex; align-items: center; gap: 4px; }
.ui-pager-pages { display: flex; align-items: center; gap: 2px; }
.ui-pager-num { min-width: var(--h-control); padding: 4px 8px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ui-pager-num.is-current { background: var(--accent-soft); color: var(--ink); border-color: var(--accent-line); font-weight: 700; }
.ui-pager-gap { min-width: 22px; text-align: center; color: var(--muted); }
.ui-pager-arrow { gap: 4px; padding: 4px 10px; color: var(--ink-2); }
.ui-pager-compact { display: none; min-width: 6.5em; text-align: center; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ui-pager-sizebox { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-sm); }
.ui-pager-size { width: auto; min-width: 76px; }

/* Menú propio (Epic.ui.menu) */
.ui-menu {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: min(70vh, 480px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: #12171e;
  box-shadow: var(--shadow);
  animation: epic-modal-in .12s var(--ease);
}
.ui-menu:focus { outline: none; }
.ui-menu-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 550;
  text-align: left;
  box-shadow: none;
}
.ui-menu-item:hover, .ui-menu-item:focus-visible { background: var(--hover); color: var(--ink); outline: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.ui-menu-item[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.ui-menu-item.danger { color: var(--bad); }
.ui-menu-item.danger:hover { background: var(--bad-bg); color: #ff9a92; }
.ui-menu-item.is-checked { color: var(--ink); font-weight: 650; }
.ui-menu-icon { display: grid; place-items: center; width: 18px; color: var(--muted); flex: none; }
.ui-menu-dot { width: 9px; height: 9px; margin: 0 4px; border-radius: 50%; background: var(--item-color, var(--accent)); flex: none; }
.ui-menu-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.ui-menu-hint { color: var(--muted); font-size: var(--fs-xs); font-weight: 450; }
.ui-menu-check { display: grid; color: var(--accent); flex: none; }
.ui-menu-group { padding: 8px 10px 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ui-menu-sep { height: 1px; margin: 5px 6px; background: var(--line); }
.ui-menu-sheet .ui-menu-item { min-height: 48px; padding: 10px 12px; font-size: var(--fs-md); }

/* Filtros activos (Epic.ui.chips) */
.ui-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--sp-3); }
.ui-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 30px; padding: 2px 2px 2px 12px; border: 1px solid var(--accent-line); border-radius: 99px; background: var(--accent-soft); color: var(--ink); font-size: var(--fs-sm); font-weight: 550; }
.ui-chip-x { min-height: 26px; min-width: 26px; padding: 3px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-2); box-shadow: none; }
.ui-chip-x:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.ui-chip-x .ico { width: 13px; height: 13px; }

/* Vacío, error y esqueletos */
.ui-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 auto; padding: 28px 16px; max-width: 480px; text-align: center; }
.ui-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel-2); color: var(--muted); }
.ui-empty-icon .ico { width: 22px; height: 22px; }
.ui-empty-title { margin: 0; font-size: var(--fs-lg); font-weight: 650; color: var(--ink); }
.ui-empty-text { margin: 0; color: var(--muted); }
.ui-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.ui-skel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: var(--sp-3); }
.ui-skel-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.rel-time { white-space: nowrap; }

/* ─── Acceso ────────────────────────────────────────────────────────────────────────────── */

.view-login { animation: none; }
.login-wrap { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: calc(100vh - var(--top-h) - 48px); min-height: calc(100dvh - var(--top-h) - 48px); padding: 2vh 0 24px; }
.login-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(560px, 100%);
  height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(46, 197, 224, .14), transparent);
  pointer-events: none;
}
.login-card { position: relative; width: 100%; max-width: 420px; padding: 28px 24px; border-color: var(--line-2); box-shadow: var(--shadow); gap: var(--sp-4); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 4px; text-align: center; }
.login-logo { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(46, 197, 224, .3), 0 0 36px rgba(46, 197, 224, .3); background: #000; }
.login-title { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; }
.login-sub { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.login-env { margin: 8px 0 0; }
.login-form { gap: var(--sp-4); }
.login-form .field > label { font-size: var(--fs-md); }
.login-form input:not([type="checkbox"]) { min-height: 48px; font-size: var(--fs-lg); }
.login-pass { display: flex; gap: 6px; }
.login-pass input { flex: 1 1 auto; min-width: 0; }
.login-reveal { min-height: 48px; min-width: 104px; }
.login-submit { min-height: 50px; font-size: var(--fs-lg); }
.login-caps { margin: 0; }
.login-help summary { color: var(--ink-2); font-size: var(--fs-sm); padding: 6px 0; }
.login-help p { margin: 6px 0 0; }
.login-foot { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: var(--fs-xs); }
.login-foot .ico { width: 13px; height: 13px; }

/* ─── Inicio ────────────────────────────────────────────────────────────────────────────── */

.inicio .ui-page-head { margin-bottom: 0; }
.inicio > div:empty { display: none; }
.ini-section-title { margin: 0 0 10px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ini-paused { align-items: center; }
.ini-system { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.ini-system.is-warn { border-color: var(--warn-line); }
.ini-system-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 44px; padding: 8px 12px; list-style: none; }
.ini-system-sum::-webkit-details-marker { display: none; }
.ini-system-sum::after { content: "Ver"; margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }
.ini-system[open] .ini-system-sum::after { content: "Ocultar"; }
.ini-system-icon { display: grid; color: var(--info); }
.ini-system.is-warn .ini-system-icon { color: var(--warn); }
.ini-system-label { font-weight: 650; color: var(--ink-2); }
.ini-system-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ini-system-body { padding: 0 12px 12px; }
.ini-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: var(--sp-3); align-items: start; }
.ini-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-top: 3px solid var(--tone, var(--accent)); }
.ini-card.tone-bad { --tone: var(--bad); }
.ini-card.tone-warn { --tone: var(--warn); }
.ini-card.tone-info { --tone: var(--info); }
.ini-card.tone-accent { --tone: var(--accent); }
.ini-card-head { display: flex; align-items: center; gap: 10px; }
.ini-card-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); flex: none; }
.ini-card-icon .ico { width: 17px; height: 17px; }
.ini-card-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: var(--fs-md); font-weight: 650; }
.ini-card-count { min-width: 34px; padding: 2px 10px; border-radius: 99px; background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--tone); font-size: var(--fs-lg); font-weight: 750; text-align: center; font-variant-numeric: tabular-nums; }
.ini-card-note { margin: 0; }
.ini-card-all { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 32px; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.ini-card-all .ico { width: 14px; height: 14px; }
.ini-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ini-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ini-row:first-child { border-top: 0; padding-top: 2px; }
.ini-row-main { flex: 1 1 220px; min-width: 0; }
.ini-row-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ini-row-name { min-width: 0; font-weight: 650; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.ini-row-name:hover { color: var(--accent-hover); text-decoration: underline; }
.ini-row-name a { color: var(--ink); text-decoration: none; }
.ini-row-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-xs); }
.ini-row-text { margin: 3px 0 0; color: var(--ink-2); font-size: var(--fs-sm); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ini-row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; flex: none; margin-left: auto; }
.ini-row-why { flex-basis: 100%; color: var(--muted); font-size: var(--fs-xs); text-align: right; }
.ini-wait { display: inline-flex; align-items: center; gap: 4px; color: var(--bad); font-weight: 600; }
.ini-wait .ico { width: 13px; height: 13px; }
.ini-type { color: var(--muted); font-weight: 600; }
.ini-type.is-urgent { color: var(--bad); }
.ini-time { display: inline-block; min-width: 3em; color: var(--info); font-variant-numeric: tabular-nums; }
.ini-draft-text { display: block; padding: 8px 10px; border-radius: 10px; background: var(--me); color: var(--ink); }
.ini-clamp { display: -webkit-box; white-space: pre-wrap; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ini-row-text:has(.ini-draft-text) { -webkit-line-clamp: unset; display: block; }
.ini-calm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ini-calm-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: var(--ok); font-size: var(--fs-sm); font-weight: 650; }
.ini-calm-label .ico { width: 15px; height: 15px; }
.ini-calm-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--muted); font-size: var(--fs-sm); text-decoration: none; }
a.ini-calm-chip:hover { border-color: var(--line-2); color: var(--ink); }
.ini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ini-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--panel-2); }
.ini-stat-value { font-size: var(--fs-xl); font-weight: 700; text-align: left; }
.ini-stat-label { color: var(--muted); font-size: var(--fs-xs); }
.stage-bars { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.stage-row {
  display: grid;
  grid-template-columns: minmax(118px, 10em) minmax(0, 1fr) 3.2em;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease);
}
a.stage-row:hover { background: var(--hover); color: inherit; }
.stage-row .badge { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stage-row .bar > span { background: var(--stage-color, var(--accent)); opacity: .85; }
.stage-count { color: var(--ink); font-weight: 650; }
.stage-bars-sep { margin: 12px 8px 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
/* Compatibilidad: accesos rápidos (ya no los pinta Inicio, pueden usarlos otras vistas). */
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 8px; }
.shortcut { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.shortcut:hover { border-color: var(--accent-line); background: #121a21; color: var(--ink); }
.shortcut-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--panel-3); color: var(--accent); font-size: 17px; flex: none; }

/* ─── Entrevistas, plantillas y avisos de espera (SPEC 2) ───────────────────────────────── */

/* Seis cifras de Inicio: 2 columnas en el móvil y 3 en pantallas anchas (dos filas iguales). */
.kpis.kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi.urgent { box-shadow: inset 3px 0 0 var(--bad); }
.kpi.urgent .kpi-value { color: var(--bad); }
.kpi.urgent .kpi-icon { background: var(--bad-bg); color: var(--bad); }
.kpi-sub.kpi-next { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* «Esperando 12 min»: la persona escribió y nadie le ha contestado. */
.pill.waiting { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); font-weight: 650; }
.pill.waiting .ico { width: 13px; height: 13px; }

/* Botones con icono (Epic.ui.icon) */
.btn .ico, button .ico { width: 16px; height: 16px; flex: none; }
.btn.small .ico { width: 14px; height: 14px; }

/* Chips de huecos libres y de objeciones */
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.slot-chip { min-height: 32px; padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--panel-2); color: var(--ink); font-size: 13px; font-weight: 550; }
.slot-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.slot-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
.chip.objection { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }

/* Diálogo «Devolver chats a Epic» (cabecera → No estamos) */
.release-list { display: flex; flex-direction: column; gap: 6px; max-height: min(48vh, 360px); margin: 0; padding: 0; overflow-y: auto; border: 0; }
.release-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; }
.release-item:has(input:checked) { border-color: var(--accent-line); }
.release-item input { margin-top: 3px; flex: none; }
.release-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.release-last { color: var(--ink-2); overflow-wrap: anywhere; }

/* Vista previa de una plantilla */
.tpl-preview { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--me); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

@media (min-width: 700px) {
  .kpis.kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ─── Pantallas pequeñas ────────────────────────────────────────────────────────────────── */

@media (max-width: 899px) {
  .view table:not(.no-scroll) { display: block; max-width: 100%; overflow-x: auto; }
  .modal-actions > .btn { flex: 1 1 auto; }
  /* .split en móvil: la lista o el detalle (con .show-detail), nunca los dos a la vez */
  .split:not(.show-detail) > :last-child:not(:first-child) { display: none; }
  .split.show-detail > :first-child:not(:last-child) { display: none; }
  .card { padding: var(--s4); }
  .ui-page-head { margin-bottom: var(--sp-4); }
  .page-title { font-size: var(--fs-xl); }
  .ini-system-tags { display: none; }
  .ini-system-label::after { content: " (" attr(data-count) ")"; color: var(--muted); font-weight: 500; }
  .ini-row-actions { width: 100%; justify-content: stretch; }
  .ini-row-actions > .btn { flex: 1 1 0; }
  .ini-row-why { text-align: left; }
}

@media (max-width: 599px) {
  /* Paginador compacto: «‹ 2 de 15 ›». */
  .ui-pager { justify-content: center; }
  .ui-pager-info { flex-basis: 100%; text-align: center; }
  .ui-pager-pages, .ui-pager-arrow-text { display: none; }
  .ui-pager-compact { display: inline-block; }
  .ui-pager-arrow { min-width: 44px; }
  .ini-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ini-stat { padding: 8px; }
  .ini-stat-value { font-size: var(--fs-lg); }
  .stage-row { grid-template-columns: minmax(104px, 9em) minmax(0, 1fr) 2.6em; gap: 8px; }
  .login-card { padding: 22px 16px; }
}

@media (max-width: 399px) {
  .topbar { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .status-pill { padding-left: 10px; padding-right: 8px; gap: 6px; }
  .status-chevron { display: none; }
  .pill.env { padding: 1px 7px; }
}

/* ─── Escritorio ────────────────────────────────────────────────────────────────────────── */

@media (min-width: 480px) {
  .status-presence { display: inline; }
}

@media (min-width: 700px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .kpis.kpis-3 .kpi { padding: 16px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-epic { font-size: inherit; }
  .status-epic::after { content: none; }
}

@media (min-width: 900px) {
  .app {
    --side: var(--side-w);
    grid-template-columns: var(--side) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "side top" "side main";
  }
  /* Menú con texto desde 1200 px; entre 900 y 1199 px, iconos con su nombre al pasar (core.js pone data-side-eff). */
  .app[data-side-eff="mini"] { --side: var(--side-w-mini); }
  .app[data-auth="out"],
  .app[data-auth="loading"] { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .topbar { grid-area: top; gap: 12px; padding: 0 20px; }
  .topbar > .brand { display: none; }
  .app[data-auth="out"] .topbar > .brand,
  .app[data-auth="loading"] .topbar > .brand { display: inline-flex; }
  .top-title { display: none; }
  .env-badges { display: flex; }
  .bell { display: inline-grid; }
  .user-box { display: flex; }
  .sidebar {
    grid-area: side;
    position: sticky;
    top: 0;
    z-index: 31;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    background: #0b0e13;
    border-right: 1px solid var(--line);
  }
  .sidebar-head { display: flex; align-items: center; min-height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .side-brand .brand-text { display: flex; }
  .sidenav { flex: 1 1 auto; padding: 12px 10px; overflow-x: hidden; overflow-y: auto; }
  .sidenav .nav-link { min-height: 40px; }
  .sidebar-foot { padding: 10px; border-top: 1px solid var(--line); }
  .side-toggle {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: var(--h-control);
    padding: 6px 10px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 550;
    box-shadow: none;
  }
  .side-toggle:hover { background: var(--hover); border-color: transparent; color: var(--ink); }
  .side-toggle-icon { display: grid; place-items: center; width: 20px; font-size: 18px; }
  .app[data-side-eff="mini"] .sidebar-head { justify-content: center; padding: 10px 0; }
  .app[data-side-eff="mini"] .side-brand .brand-text,
  .app[data-side-eff="mini"] .side-toggle-text { display: none; }
  .app[data-side-eff="mini"] .side-toggle { justify-content: center; padding: 6px; }
  .app[data-side-eff="mini"] .sidenav { padding: 12px 10px; }
  .app[data-side-eff="mini"] .sidenav .nav-link { justify-content: center; padding: 9px 0; min-height: 44px; }
  .app[data-side-eff="mini"] .nav-sep { margin: 6px 4px; }
  .app[data-side-eff="mini"] .sidenav .nav-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .app[data-side-eff="mini"] .sidenav .nav-link .count {
    position: absolute;
    top: 3px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    box-shadow: 0 0 0 2px #0b0e13;
  }
  .app[data-side-eff="mini"] .sidenav .nav-link[aria-current="page"]::before { left: -10px; }
  main { grid-area: main; --pad-top: 24px; --pad-x: 28px; --pad-bottom: 40px; }
  .bottomnav { display: none; }
  .split { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toasts { left: auto; right: 20px; bottom: calc(20px + var(--toast-lift, 0px)); width: 400px; align-items: stretch; }
  .kpi-value { font-size: 30px; }
  .page-title { font-size: var(--fs-2xl); }
}

@media (min-width: 1280px) {
  .user-btn .user-name { display: block; }
  main { --pad-x: 32px; }
}

/* ─── Táctil: todo control ≥ 44 px ──────────────────────────────────────────────────────── */

@media (pointer: coarse) {
  :root { --h-control: 44px; --h-control-sm: 44px; }
  button, .btn, .btn.small, button.small,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  select, .slot-chip, .ui-tab, .ui-menu-item, .presence-opt, .status-pill, .user-btn, .side-toggle { min-height: 44px; }
  .btn-icon, .toast-close, .ui-chip-x, .ui-pager-num, .ui-pager-arrow, .bell { min-width: 44px; min-height: 44px; }
  .toast-action { min-height: 44px; padding: 6px 16px; }
  .ui-chip { min-height: 44px; }
  .ui-chip-x { min-height: 40px; min-width: 40px; }
  .seg > button, .seg > .btn { min-height: 40px; }
  /* Los interruptores (input.switch o dentro de label.switch) conservan su tamaño de 36×20: aquí solo crecen las casillas. */
  input[type="checkbox"]:not(.switch):not(.switch input), input[type="radio"] { width: 22px; height: 22px; }
  .check, label.toggle, .switch { min-height: 44px; }
  .mode-opt { min-height: 44px; }
  .ini-calm-chip, .ini-card-all { min-height: 44px; }
  .sheet-nav .nav-link, .sidenav .nav-link { min-height: 48px; }
  .toast-kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
  .toast-progress { display: none; }
}

/* Vista «WhatsApp» (views/whatsapp.js) */
.wa { max-width: 1100px; }
.wa-note { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 var(--s3); }
.wa-note .ico { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.wa-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); }
.wa-option {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px;
  min-height: 0; padding: 14px; border-radius: 12px; text-align: left; font-weight: 400; background: var(--panel-2);
}
.wa-option:hover:not(:disabled) { border-color: var(--line-2); background: var(--panel-3); }
.wa-option.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; cursor: default; }
.wa-option[aria-disabled="true"]:not(.is-on) { opacity: .55; }
.wa-option-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wa-option-ico .ico { width: 20px; height: 20px; color: var(--accent); }
.wa-option-title { flex: 1 1 auto; font-weight: 650; color: var(--ink); }
.wa-option-text { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.45; }
.wa-option-why { color: var(--warn); font-size: var(--fs-sm); }
.wa-option-now .ico { width: 13px; height: 13px; }
.wa-status { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--s3); }
.wa-status-text { margin: 0; color: var(--ink-2); }
.wa-status p { margin: 0; }
.wa-actions { margin-bottom: var(--s3); }
.wa-qr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: start; padding: var(--s4); border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.wa-qr .row { grid-column: 1 / -1; }
.wa-qr-frame { display: grid; place-items: center; width: 280px; height: 280px; padding: 8px; border-radius: 12px; background: #fff; }
.wa-qr-img { width: 264px; height: 264px; image-rendering: pixelated; }
.wa-qr-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.wa-screen { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.wa-screen-frame { display: grid; place-items: center; min-height: 200px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b141a; }
.wa-screen-img { display: block; width: 100%; height: auto; }
.wa-screen-img[hidden] { display: none; }
.wa-screen-wait { margin: 0; padding: 24px; }
.wa-screen-wait[hidden] { display: none; }
/* «Números de WhatsApp» y la hoja «Cambiar de número» */
.wa-num-intro { margin: 0 0 var(--s3); }
.wa-num-current { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: var(--s4); margin-bottom: var(--s3); border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.wa-num-current.is-lost { border-color: var(--bad-line); }
.wa-num-big { font-size: clamp(24px, 7vw, 34px); font-weight: 700; line-height: 1.15; letter-spacing: .01em; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wa-num-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--ink-2); font-size: var(--fs-sm); }
.wa-num-warn { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 0; color: var(--bad); font-size: var(--fs-sm); }
.wa-num-warn .ico { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.wa-num-actions { margin-top: 6px; align-items: center; }
.wa-num .notice { margin-bottom: var(--s3); }
.wa-num .notice .btn { align-self: center; }
.wa-num-sub { margin: var(--s4) 0 8px; }
.wa-num-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wa-num-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.wa-num-item-phone { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.wa-num-item-meta { flex-basis: 100%; color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.wa-num-foot { margin: var(--s4) 0 0; }
.wa-wiz .modal-text { margin: 0 0 var(--s3); }
.wa-wiz-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s3); }
.wa-wiz-dots { display: flex; gap: 6px; }
.wa-wiz-dot { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--line-2); }
.wa-wiz-dot.is-on { background: var(--accent); }
.wa-wiz-count { margin: 0; }
.wa-wiz-title { margin: 0; font-size: 17px; }
.wa-wiz-choices { display: grid; gap: 8px; margin-bottom: var(--s3); }
.wa-wiz-choices .wa-option { min-height: 44px; }
.wa-wiz textarea { width: 100%; }
.wa-wiz-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: var(--s4); }
.wa-wiz-nav .btn, .wa-wiz .row .btn { min-height: 44px; }
.wa-wiz .wa-qr { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.wa-wiz .wa-qr-frame { width: min(280px, 100%); height: auto; aspect-ratio: 1; }
.wa-wiz .wa-qr-img { width: 100%; height: auto; }
.wa-wiz-auto { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); }
.wa-wiz-auto li { display: flex; align-items: flex-start; gap: 8px; }
.wa-wiz-auto .ico { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--ok); }
.wa-check-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wa-check { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.wa-check input { flex: none; width: 20px; height: 20px; }
.wa-check:has(input:checked) span { color: var(--muted); text-decoration: line-through; }
@media (max-width: 699px) {
  .wa-qr { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .wa-qr-frame { width: min(280px, 100%); height: auto; aspect-ratio: 1; }
  .wa-qr-img { width: 100%; height: auto; }
  .wa-actions .btn { flex: 1 1 auto; }
  .wa-num-actions .btn, .wa-wiz-nav .btn { flex: 1 1 auto; }
}

/* Ajustes v5 (views/ajustes.js): tarjetas grandes para elegir, cartel de estado y pasos de «Conexión». */
.aj5-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--s3); }
.aj5-card {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px;
  width: 100%; min-height: 0; height: auto; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--panel); color: var(--ink); font-weight: 400; text-align: left; white-space: normal;
}
.aj5-card:hover { border-color: #36404d; background: var(--panel-3); }
.aj5-card.is-on, .aj5-card.is-on:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.aj5-card.is-on.is-pending, .aj5-card.is-on.is-pending:hover { border-color: var(--warn); background: var(--warn-bg); box-shadow: 0 0 0 1px var(--warn) inset; }
.aj5-card[aria-disabled="true"]:not(.is-on) { opacity: .6; cursor: not-allowed; }
.aj5-card[aria-disabled="true"]:not(.is-on):hover { border-color: var(--line-2); background: var(--panel); }
.aj5-card[aria-disabled="true"].is-on { cursor: default; }
.aj5-card:active:not(:disabled) { transform: none; }
.aj5-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aj5-card-ico { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--panel-3); }
.aj5-card-ico .ico, .aj5-card .aj5-card-ico .ico { width: 20px; height: 20px; color: var(--accent); }
.aj5-card-title { flex: 1 1 auto; min-width: 0; color: var(--ink); font-size: var(--fs-lg); font-weight: 650; line-height: 1.3; }
.aj5-card-pill { gap: 4px; }
.aj5-card-pill .ico, .aj5-card .aj5-card-pill .ico { width: 13px; height: 13px; }
.aj5-card-pill[hidden], .aj5-card-note[hidden] { display: none; }
.aj5-card-text { color: var(--ink-2); font-size: var(--fs-md); line-height: 1.45; }
.aj5-card-note { color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.aj5-card-note.is-ok { color: var(--ok); }
.aj5-card-note.is-warn { color: var(--warn); }
.aj5-card-why { display: flex; align-items: flex-start; gap: 6px; color: var(--warn); font-size: var(--fs-sm); line-height: 1.4; }
.aj5-card .aj5-card-why .ico { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.aj5-note { font-size: var(--fs-sm) !important; }
.aj5-after-cards { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.aj5-after-cards[hidden], .aj5-host[hidden], .aj5-left[hidden] { display: none; }
.aj5-after-cards .help { flex: 1 1 100%; }

/* Cartel de estado de la conexión */
.aj5-banner {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px 16px;
  padding: 16px 18px; border: 1px solid var(--info-line); border-left-width: 5px; border-radius: 12px; background: var(--info-bg);
  scroll-margin-top: calc(var(--top-h) + 12px);
}
.aj5-banner.is-ok { border-color: var(--ok-line); border-left-color: var(--ok); background: var(--ok-bg); }
.aj5-banner.is-warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-bg); }
.aj5-banner.is-bad { border-color: var(--bad-line); border-left-color: var(--bad); background: var(--bad-bg); }
.aj5-banner.is-info { border-left-color: var(--info); }
.aj5-banner-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--info); }
.aj5-banner-ico .ico { width: 26px; height: 26px; }
.aj5-banner.is-ok .aj5-banner-ico { color: var(--ok); }
.aj5-banner.is-warn .aj5-banner-ico { color: var(--warn); }
.aj5-banner.is-bad .aj5-banner-ico { color: var(--bad); }
.aj5-banner-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.aj5-banner-title { display: block; color: var(--ink); font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }
.aj5-banner-text { margin: 4px 0 0; max-width: 70ch; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.5; overflow-wrap: anywhere; }
.aj5-banner-text[hidden], .aj5-banner-pending[hidden] { display: none; }
.aj5-banner-pending { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
.aj5-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.aj5-fact { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 99px; background: rgba(0, 0, 0, .18); color: var(--ink); font-size: var(--fs-sm); }
.aj5-fact-label { color: var(--muted); }
.aj5-fact.is-warn { border-color: var(--warn-line); color: var(--warn); }
.aj5-banner-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.aj5-banner-slot { display: contents; }

/* Bloques de «Conexión» */
.aj5-sec-title { margin: 0; color: var(--ink); font-size: 15px; font-weight: 650; text-transform: none; letter-spacing: -.01em; }
.aj5-test-sec[hidden] { display: none !important; }
.aj5-test { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: calc(var(--top-h) + 12px); }
.aj5-test-btn { min-height: 44px; padding: 8px 20px; font-size: var(--fs-md); }
.aj5-test-result:empty { display: none; }
.aj5-meta { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); scroll-margin-top: calc(var(--top-h) + 12px); }
.aj5-meta[open] { border-color: var(--line-2); }
.aj5-meta-sum { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px 10px; min-height: 56px; padding: 12px 16px; cursor: pointer; list-style: none; }
.aj5-meta-sum::-webkit-details-marker { display: none; }
.aj5-meta-sum:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 12px; }
.aj5-meta-ico .ico { width: 20px; height: 20px; color: var(--accent); }
.aj5-meta-pill { flex: none; }
.aj5-meta-title { flex: 1 1 auto; min-width: 0; color: var(--ink); font-size: 15px; font-weight: 650; }
.aj5-meta-chev .ico { width: 18px; height: 18px; color: var(--muted); transition: transform var(--dur) var(--ease); }
.aj5-meta[open] .aj5-meta-chev .ico { transform: rotate(180deg); }
.aj5-meta-body { display: flex; flex-direction: column; gap: 14px; padding: 0 16px 16px; }
.aj5-meta-line { margin: 0; max-width: 70ch; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.5; }
.aj5-steps { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: aj5-step; }
.aj5-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); counter-increment: aj5-step; scroll-margin-top: calc(var(--top-h) + 12px); }
.aj5-step[hidden] { display: none; }
.aj5-step.is-ok { border-color: var(--ok-line); }
.aj5-step.is-bad { border-color: var(--bad-line); }
.aj5-step-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--panel-3); color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.aj5-step-num::before { content: counter(aj5-step); }
.aj5-step.is-ok .aj5-step-num { background: var(--ok-bg); color: var(--ok); }
.aj5-step.is-bad .aj5-step-num { background: var(--bad-bg); color: var(--bad); }
.aj5-step-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.aj5-step-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; min-height: 34px; }
.aj5-step-title { flex: 1 1 220px; min-width: 0; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.35; }
.aj5-step-text { margin: 0; max-width: 70ch; color: var(--muted); font-size: var(--fs-md); line-height: 1.5; }
.aj5-step-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.aj5-step-body:empty { display: none; }
.aj5-step-detail { margin: 0; color: var(--warn); font-size: var(--fs-sm); line-height: 1.45; overflow-wrap: anywhere; }
.aj5-step-detail[hidden] { display: none; }
.aj5-step-detail.is-muted { color: var(--muted); }
.aj5-badge { display: inline-flex; flex: none; align-items: center; gap: 5px; padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--panel-3); color: var(--ink-2); font-size: var(--fs-md); font-weight: 650; white-space: nowrap; }
.aj5-badge .ico { width: 16px; height: 16px; }
.aj5-badge.is-ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.aj5-badge.is-bad { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.aj5-badge.is-dirty { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.aj5-badge.is-opt, .aj5-badge.is-manual, .aj5-badge.is-wait { color: var(--muted); font-weight: 550; }
.aj5-secret-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aj5-secret { display: flex; align-items: flex-start; gap: 10px; }
.aj5-secret .u4-check-icon { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-3); color: var(--muted); font-weight: 700; }
.aj5-secret-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.aj5-secret-state { color: var(--muted); font-size: var(--fs-sm); }
.aj5-secret.is-ok .aj5-secret-state { color: var(--ok); }
.aj5-secret.is-bad .aj5-secret-state { color: var(--bad); }
.aj5-left { display: flex; flex-direction: column; gap: 8px; }
.aj5-more { border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 12px); }
.aj5-more > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 2px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.aj5-more > summary::-webkit-details-marker { display: none; }
.aj5-more > summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 0 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.aj5-more[open] > summary::before { transform: rotate(45deg); }
.aj5-more > summary:hover { color: var(--ink); }
.aj5-more > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.aj5-more.is-bad > summary { color: var(--bad); }
.aj5-more-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px; }
.aj5-secrets { margin-top: 16px; padding-top: 4px; }
.u4-ajustes .aj5-step .u4-field.aj5-in-step { padding: 0; border: 0; background: transparent; box-shadow: none; }
.u4-ajustes .aj5-in-step > .u4-field-head > .field-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.u4-ajustes .aj5-in-step > .u4-field-head:has(> .u4-source:empty) { display: none; }
.u4-ajustes .aj5-more-body > .u4-field { background: var(--panel); }
.u4-ajustes .u4-field.aj5-choice { gap: 12px; }
.u4-ajustes .u4-field.aj5-choice > .u4-field-head .field-label { font-size: var(--fs-lg); font-weight: 700; }
@media (max-width: 699px) {
  .aj5-banner { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .aj5-banner-ico { width: 38px; height: 38px; }
  .aj5-banner-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .aj5-banner-actions .btn { flex: 1 1 auto; }
  .aj5-banner-title { font-size: var(--fs-lg); }
  .aj5-step { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .aj5-step-num { width: 30px; height: 30px; }
  .aj5-step { position: relative; }
  .aj5-step-num { position: absolute; top: 12px; left: 12px; }
  .aj5-step-head { padding-left: 40px; }
  .aj5-meta-sum { padding: 12px; }
  .aj5-meta-body { padding: 0 12px 12px; }
  .aj5-test-btn { width: 100%; }
}
@media (pointer: coarse) {
  .aj5-card { min-height: 44px; }
  .aj5-meta-sum { min-height: 56px; }
}

/* Ajustes › «Claves» y «Usuarios» (ajustes.js: buildKeysCard / buildUsersCard). */
.aj5-keys { display: flex; flex-direction: column; gap: 18px; }
.aj5-key-group { display: flex; flex-direction: column; gap: 8px; }
.aj5-key-group-title { margin: 0; color: var(--ink); font-size: var(--fs-lg); font-weight: 700; }
.aj5-key-group-help { margin: 0; max-width: 70ch; color: var(--muted); font-size: var(--fs-md); line-height: 1.5; }
.aj5-key-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.aj5-key { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.aj5-key-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 4px 12px; }
.aj5-key-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--panel-3); color: var(--ink-2); }
.aj5-key-ico .ico { width: 17px; height: 17px; }
.aj5-key-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aj5-key-title strong { color: var(--ink); font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.aj5-key-purpose { margin: 0; color: var(--muted); font-size: var(--fs-md); line-height: 1.45; }
.aj5-key-pill { align-self: start; white-space: nowrap; }
.aj5-key-meta { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.45; }
.aj5-key-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.aj5-key-form .aj5-key-field { flex: 1 1 260px; min-width: 0; }
.aj5-key-field input { width: 100%; }
.aj5-key-error { margin: 2px 0 0; }
.aj5-key-error[hidden] { display: none; }
.aj5-key-save { display: flex; flex: none; }
.aj5-key-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.aj5-key-result:empty { display: none; }
.aj5-key-reveal .u4-code-block, .aj5-key-reveal .ins-code { margin-top: 6px; }
.aj5-key-reveal code { flex: 1 1 220px; min-width: 0; padding: 6px 8px; overflow-wrap: anywhere; word-break: break-all; }
.aj5-key-reveal .u4-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.aj5-key-reveal .row { margin-top: 8px; }
.aj5-key-parts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.aj5-key-parts li { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.aj5-key-parts .u4-check-icon { width: 20px; height: 20px; }
.aj5-key-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; font-weight: 600; cursor: pointer; }
.aj5-forms-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.aj5-forms-grid .aj5-key-save { justify-self: start; }
.aj5-key-history { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0 0 8px; list-style: none; font-size: var(--fs-sm); }
.aj5-users { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aj5-user { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.aj5-user-main { display: flex; flex: 1 1 260px; align-items: center; gap: 10px; min-width: 0; }
.aj5-user-ico { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-3); color: var(--ink-2); }
.aj5-user-ico .ico { width: 16px; height: 16px; }
.aj5-user-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.aj5-user-text strong { overflow-wrap: anywhere; }
.aj5-user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.aj5-user-add { display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.aj5-user-add input[type="text"], .aj5-user-add input[type="password"] { width: 100%; }
.aj5-user-check { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.aj5-user-add .error-text[hidden] { display: none; }
@media (min-width: 700px) {
  .aj5-forms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
}
@media (max-width: 599px) {
  .aj5-key { padding: 12px; }
  .aj5-key-head { grid-template-columns: auto minmax(0, 1fr); }
  .aj5-key-pill { grid-column: 2; justify-self: start; }
  .aj5-key-save, .aj5-key-save .btn { width: 100%; }
  .aj5-key-actions .btn { flex: 1 1 auto; }
  .aj5-user-actions { width: 100%; }
  .aj5-user-actions .btn { flex: 1 1 auto; }
}
@media (pointer: coarse) {
  .aj5-key-switch, .aj5-user-check { min-height: 44px; }
  .aj5-key-switch input.switch { min-height: 0; }
}

@media (forced-colors: active) {
  .aj5-card.is-on { outline: 2px solid Highlight; }
  .badge, .pill, .count, .kpi, .card, .notice { border: 1px solid CanvasText; }
  .bar > span, .bar-fill { background: Highlight; }
  .mode-opt[aria-pressed="true"], .presence-opt[aria-checked="true"], .ui-tab[aria-selected="true"] { outline: 2px solid Highlight; }
}
