/* Integra: estilos base del framework
   Tipografía: Archivo variable (ancho 62–125 %, peso 100–900), una sola familia.
   Escala: 14 · 16 · 18 · 21 · 24 · 36 */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --asfalto: #1b2430;
  --aluminio: #e6eaee;
  --papel: #fbfcfd;
  --acero: #5e6b78;
  --senal: #ffc629;
  --bandera: #c62828;

  --bg: var(--aluminio);
  --surface: var(--papel);
  --text: var(--asfalto);
  --muted: var(--acero);
  --line: #c9d1d9;
  --input-border: #aeb8c2;
  --button-bg: var(--asfalto);
  --button-text: var(--papel);
  --button-hover: #2c3949;
  --error-bg: #fbeaea;
  --error-text: #8e1b1b;
  --notice-bg: #eef1f4;
  --ok-bg: #e2f1e3;
  --ok-text: #1e5b22;
  --warn-bg: #fff1c7;
  --warn-text: #6b4e00;
  --focus: var(--asfalto);
  --shadow: 0 1px 0 rgb(27 36 48 / 0.06), 0 28px 48px -28px rgb(27 36 48 / 0.45);

  --radius-pass: 16px;
  --radius-control: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121820;
    --surface: #1c242e;
    --text: #e7ebef;
    --muted: #9aa6b2;
    --line: #323d4a;
    --input-border: #4a5664;
    --button-bg: #e7ebef;
    --button-text: var(--asfalto);
    --button-hover: #ffffff;
    --error-bg: #3a1c1f;
    --error-text: #ffb4ab;
    --notice-bg: #243040;
    --ok-bg: #1f3524;
    --ok-text: #9ad3a0;
    --warn-bg: #3a3115;
    --warn-text: #ffd970;
    --focus: var(--senal);
    --shadow: 0 28px 48px -28px rgb(0 0 0 / 0.8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121820;
  --surface: #1c242e;
  --text: #e7ebef;
  --muted: #9aa6b2;
  --line: #323d4a;
  --input-border: #4a5664;
  --button-bg: #e7ebef;
  --button-text: var(--asfalto);
  --button-hover: #ffffff;
  --error-bg: #3a1c1f;
  --error-text: #ffb4ab;
  --notice-bg: #243040;
  --ok-bg: #1f3524;
  --ok-text: #9ad3a0;
  --warn-bg: #3a3115;
  --warn-text: #ffd970;
  --focus: var(--senal);
  --shadow: 0 28px 48px -28px rgb(0 0 0 / 0.8);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }

a { color: inherit; text-underline-offset: 3px; }

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

/* ---------- Marca ---------- */

.wordmark {
  font-size: 1.3125rem;           /* 21 */
  font-weight: 800;
  font-stretch: 62%;
  letter-spacing: 0.01em;
  text-decoration: none;
}

/* ---------- Pantallas de acceso ---------- */

.page-access {
  display: flex;
  flex-direction: column;
}

.access-header {
  padding: 20px 24px;
}

.access-main {
  flex: 1;
  display: grid;
  place-items: start center;
  padding: 24px 16px 64px;
}

@media (min-height: 760px) {
  .access-main { place-items: center; padding-bottom: 12vh; }
}

/* La acreditación */
.pass {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
  background: var(--surface);
  border-radius: var(--radius-pass);
  box-shadow: var(--shadow);
  transform-origin: 50% -40px;
  animation: pass-hang 900ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

.pass--wide { max-width: 460px; }

/* Ranura del cordón */
.pass::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 56px;
  height: 10px;
  margin-left: -28px;
  border-radius: 5px;
  background: var(--bg);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.25);
  z-index: 1;
}

.pass__band {
  padding: 36px 24px 14px;
  border-radius: var(--radius-pass) var(--radius-pass) 0 0;
  background: var(--senal);
  color: var(--asfalto);
  font-size: 2.25rem;             /* 36 */
  font-weight: 800;
  font-stretch: 62%;
  line-height: 1;
  letter-spacing: -0.005em;
}

.pass__body {
  padding: 28px 24px 24px;
}

.pass__heading {
  font-size: 1.5rem;              /* 24 */
  font-weight: 700;
  font-stretch: 88%;
  line-height: 1.2;
}

.pass__lede {
  margin-top: 8px;
  color: var(--muted);
  max-width: 34em;
}

/* Talón: separado por una línea perforada con muescas */
.pass__stub {
  position: relative;
  padding: 18px 24px 22px;
  border-top: 2px dashed var(--line);
  color: var(--muted);
  font-size: 0.875rem;            /* 14 */
  line-height: 1.5;
}

.pass__stub::before,
.pass__stub::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
}
.pass__stub::before { left: -9px; }
.pass__stub::after { right: -9px; }

.pass__step {
  display: block;
  color: var(--text);
  font-weight: 700;
}

/* ---------- Mensajes ---------- */

.message {
  margin-top: 20px;
  padding: 12px 14px;
  border-left: 4px solid var(--text);
  border-radius: 4px;
  background: var(--notice-bg);
  font-size: 0.9375rem;
}

.message--error {
  border-left-color: var(--bandera);
  background: var(--error-bg);
  color: var(--error-text);
}

.page-console .message { margin: 0 0 24px; }

/* ---------- Formularios ---------- */

.form { margin-top: 24px; }

.field + .field { margin-top: 18px; }

.field__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.field__input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.0625rem;
}

.field__input:hover { border-color: var(--muted); }

.field__input:focus-visible {
  outline: none;
  border-color: var(--asfalto);
  box-shadow: 0 0 0 3px var(--senal);
}

.field__input[aria-describedby~="form-error"] { border-color: var(--bandera); }

.field__input--code {
  height: 60px;
  font-size: 2rem;
  font-weight: 700;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.18em;
}
.field__input--code::placeholder { color: var(--line); }

.field__toggle {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.field__toggle:hover { color: var(--text); }

.field__hint {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--error-text);
}

.button {
  display: block;
  width: 100%;
  height: 50px;
  margin-top: 24px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--button-bg);
  color: var(--button-text);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
}
.button:hover { background: var(--button-hover); }
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: 0.6; cursor: progress; }

.button--quiet {
  width: auto;
  height: 36px;
  margin: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--input-border);
  font-size: 0.9375rem;
}
.button--quiet:hover { background: var(--notice-bg); }

/* ---------- Alta de la verificación en dos pasos ---------- */

.setup {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: setup;
}

.setup__step {
  position: relative;
  padding-left: 36px;
  counter-increment: setup;
}
.setup__step + .setup__step { margin-top: 22px; }

.setup__step::before {
  content: counter(setup);
  position: absolute;
  left: 0;
  top: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.setup__step .form { margin-top: 0; }

.setup__qr {
  display: block;
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-control);
  background: #ffffff;
}

.setup__secret {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  user-select: all;
}

/* ---------- Consola ---------- */

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--radius-control);
  z-index: 10;
}
.skip-link:focus { top: 12px; }

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

.console-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 4px solid var(--senal);
  background: var(--surface);
}

.console-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.console-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-control);
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.console-nav a:hover { color: var(--text); background: var(--notice-bg); }
.console-nav a[aria-current="page"] { color: var(--text); background: var(--notice-bg); }

.console-bar__user { display: flex; gap: 12px; align-items: center; margin-left: auto; }
.console-bar__account { padding: 6px 10px; border-radius: var(--radius-control); color: var(--text); font-weight: 600; text-decoration: none; }
.console-bar__account::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--senal); vertical-align: 1px; }
.console-bar__account:hover, .console-bar__account[aria-current="page"] { background: var(--notice-bg); }

.console {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

.console > .message { margin: 0 0 24px; }

.breadcrumb {
  margin-bottom: 6px;
  font-size: 0.9375rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a::before { content: "\2190\00a0"; }   /* ← */
.breadcrumb a:hover { color: var(--text); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.page-head__title {
  font-size: 2.25rem;              /* 36 */
  font-weight: 800;
  font-stretch: 62%;
  line-height: 1.1;
}

.page-head__title + .form-panel { margin-top: 24px; }

.page-head__lede {
  margin-top: 8px;
  max-width: 38em;
  color: var(--muted);
}

/* Botones en línea (en la consola no ocupan todo el ancho) */
.button--inline {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: 44px;
  margin: 0;
  padding: 0 20px;
  font-size: 1rem;
  text-decoration: none;
}

.button--danger { color: var(--bandera); border-color: currentColor; }
.button--danger:hover { background: var(--error-bg); }

.link-quiet { color: var(--muted); }
.link-quiet:hover { color: var(--text); }

/* Búsqueda y filtros */
.toolbar {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  max-width: 560px;
}
.toolbar--flush { margin-top: 0; flex: 1; }
.toolbar__search { height: 44px; font-size: 1rem; }
.toolbar .button--quiet { height: 44px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 16px;
  font-size: 0.9375rem;
}
.filters a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 3px solid transparent; }
.filters a:hover { color: var(--text); }
.filters a[aria-current] { color: var(--text); font-weight: 600; border-bottom-color: var(--senal); }

/* Tablas */
.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border-radius: var(--radius-control);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table tr:last-child td { border-bottom: 0; }

.table__link { font-weight: 600; text-decoration: none; }
.table__link:hover { text-decoration: underline; }

.table__sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.875rem;
}

.table__num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.table th.table__num { text-align: right; }

.table__host { font-weight: 600; font-stretch: 80%; white-space: nowrap; }
.table__host span { color: var(--muted); font-weight: 400; }

/* Estados */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--notice-bg);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--active,
.badge--ready { background: var(--ok-bg); color: var(--ok-text); }
.badge--suspended,
.badge--maintenance { background: var(--warn-bg); color: var(--warn-text); }
.badge--failed { background: var(--error-bg); color: var(--error-text); }

/* Ficha del cliente: el subdominio es su identidad en la plataforma */
.tenant-head {
  display: grid;
  gap: 4px;
}

.tenant-head__name {
  font-size: 2.25rem;
  font-weight: 800;
  font-stretch: 62%;
  line-height: 1.05;
}

.tenant-head__host {
  font-size: 1.3125rem;            /* 21 */
  font-stretch: 75%;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.tenant-head__slug { font-weight: 700; }
.tenant-head__host a { color: inherit; text-decoration: none; }
.tenant-head__host a:hover .tenant-head__slug { text-decoration: underline; }
.tenant-head__domain { color: var(--muted); }

.tenant-head__status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tabs {
  display: flex;
  gap: 4px 24px;
  margin-top: 24px;
  overflow-x: auto;
  box-shadow: inset 0 -1.5px 0 var(--line);   /* línea base; no se recorta con overflow */
}

.tabs a {
  padding: 10px 0 9px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--senal); }

.tenant-section { margin-top: 28px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.section-head__text { color: var(--muted); }

.section-title {
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 700;
  font-stretch: 88%;
}

/* Formularios de la consola */
.form-panel {
  max-width: 720px;
  padding: 24px;
  border-radius: var(--radius-control);
  background: var(--surface);
}
.form-panel > .message:first-of-type { margin-top: 0; margin-bottom: 20px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.form-grid > .field + .field,
.fieldset .form-grid > .field + .field { margin-top: 0; }
.form-grid__wide { grid-column: 1 / -1; }

.field__optional { color: var(--muted); font-weight: 400; }

.field__help {
  margin: -2px 0 6px;
  color: var(--muted);
  font-size: 0.875rem;
}

.field__error {
  margin-top: 6px;
  color: var(--error-text);
  font-size: 0.875rem;
  font-weight: 600;
}

.field__input[aria-invalid="true"] { border-color: var(--bandera); }

.field__input--area {
  height: auto;
  padding: 10px 14px;
  line-height: 1.5;
  resize: vertical;
}

.field__input--select { appearance: auto; padding-right: 8px; }

.field__static {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 600;
}
.field__static + .field__help { margin-top: 0; }

.field__affix {
  display: flex;
  align-items: stretch;
}
.field__affix .field__input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.field__prefix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1.5px solid var(--input-border);
  border-right: 0;
  border-radius: var(--radius-control) 0 0 var(--radius-control);
  background: var(--notice-bg);
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.9375rem;
}
.field__prefix + .field__input { border-radius: 0 var(--radius-control) var(--radius-control) 0; }
.field__suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1.5px solid var(--input-border);
  border-left: 0;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--notice-bg);
  color: var(--muted);
  white-space: nowrap;
}

.fieldset {
  margin: 28px 0 0;
  padding: 0;
  border: 0;
}
.fieldset legend {
  margin-bottom: 12px;
  padding: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.fieldset .field + .field { margin-top: 18px; }

.checklist { display: grid; gap: 4px; }

.check {
  display: inline-flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9375rem;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--asfalto); flex: none; }
.check--block {
  display: flex;
  padding: 10px 12px;
  border-radius: var(--radius-control);
}
.check--block:hover { background: var(--notice-bg); }
.form-panel > .check--block { margin-top: 24px; border: 1.5px solid var(--line); }
.check__help { display: block; color: var(--muted); font-size: 0.875rem; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-top: 28px;
}

/* Paneles */
.panel {
  max-width: 720px;
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: var(--radius-control);
  background: var(--surface);
}
.panel__title { font-size: 1.125rem; font-weight: 700; }
.panel__text { margin-top: 6px; color: var(--muted); font-size: 0.9375rem; max-width: 60ch; }
.panel__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.panel form { margin-top: 14px; }
.panel__actions form { margin-top: 0; }

.panel--alert { border-left: 4px solid var(--bandera); }
.panel--key { border-left: 4px solid var(--senal); }
.panel__code {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--notice-bg);
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 1040px;
}
.split > .panel { max-width: none; margin-top: 0; }
.split + .panel { max-width: 1040px; margin-top: 20px; }
.tenant-section > .panel:first-child { margin-top: 0; }

.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form .field__input { height: 40px; font-size: 1rem; max-width: 240px; }
.inline-form .button--quiet { height: 40px; }

.facts { margin: 12px 0 0; display: grid; gap: 6px; font-size: 0.9375rem; }
.facts div { display: grid; grid-template-columns: 11em 1fr; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* URLs */
.url-rows { display: grid; gap: 10px; margin-top: 16px; }
.url-row {
  display: grid;
  grid-template-columns: 15em minmax(0, 1fr) 5.5em;
  gap: 8px 10px;
  align-items: center;
}
.url-row .field__input { height: 42px; font-size: 1rem; }
.url-row__error { grid-column: 2 / -1; margin-top: 0; }

.copy { display: flex; gap: 8px; margin-top: 12px; }
.copy__input { height: 42px; font-size: 0.9375rem; }
.copy .button--quiet { height: 42px; white-space: nowrap; }

.empty {
  max-width: 720px;
  margin-top: 28px;
  padding: 28px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-control);
}
.empty h2 { font-size: 1.125rem; font-weight: 700; }
.empty p { margin-top: 6px; color: var(--muted); max-width: 60ch; }
.empty .button, .empty form { margin-top: 16px; }

/* ---------- Imagen corporativa ---------- */

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

.branding__form {
  padding: 24px;
  border-radius: var(--radius-control);
  background: var(--surface);
}
.branding__form .fieldset:first-of-type { margin-top: 0; }

.branding__preview { position: sticky; top: 24px; }
.branding__preview-label { margin-bottom: 10px; color: var(--muted); font-size: 0.875rem; }

.upload__row { display: flex; gap: 14px; align-items: center; }
.upload__thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 120px;
  height: 64px;
  padding: 8px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-control);
  background: #ffffff;
  color: var(--acero);
  font-size: 0.75rem;
  text-align: center;
}
.upload__thumb--dark { background: var(--asfalto); color: #9aa6b2; }
.upload__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.upload__input { font: inherit; font-size: 0.875rem; min-width: 0; }
.upload + .upload { margin-top: 20px; }
.upload .check { margin-top: 8px; }

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 16px;
}
.swatch { display: grid; gap: 6px; }
.swatch__label { font-size: 0.9375rem; font-weight: 600; }
.swatch__input {
  width: 100%;
  height: 56px;
  padding: 0;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-control);
  background: none;
  cursor: pointer;
}
.swatch__input::-webkit-color-swatch-wrapper { padding: 3px; }
.swatch__input::-webkit-color-swatch { border: 0; border-radius: 5px; }
.swatch__input::-moz-color-swatch { border: 0; border-radius: 5px; }
.swatches + .field__help { margin-top: 14px; }
.swatch__hex { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

/* Vista previa: usa solo los colores del cliente (variables --b-*, puestas por JS) */
.preview {
  --b-primary: #1b2430;
  --b-secondary: #5e6b78;
  --b-accent: #ffc629;
  --b-background: #ffffff;
  --b-text: #1b2430;
  --b-font-heading: system-ui;
  --b-font-body: system-ui;
  overflow: hidden;
  border-radius: 12px;
  background: var(--b-background);
  color: var(--b-text);
  font-family: var(--b-font-body), system-ui, sans-serif;
  box-shadow: var(--shadow);
}
.preview__bar {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 12px 18px;
  border-bottom: 4px solid var(--b-accent);
  background: var(--b-primary);
  color: var(--b-background);
}
.preview__logo { max-height: 36px; max-width: 120px; object-fit: contain; }
.preview__name { font-family: var(--b-font-heading), system-ui, sans-serif; font-weight: 700; }
.preview__body { padding: 20px 18px 24px; }
.preview__title { font-family: var(--b-font-heading), system-ui, sans-serif; font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.preview__text { margin-top: 6px; color: var(--b-secondary); font-size: 0.9375rem; }
.preview__field {
  display: block;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1.5px solid var(--b-secondary);
  border-radius: 6px;
  color: var(--b-secondary);
  font-size: 0.875rem;
}
.preview__button {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 20px;
  border-radius: 6px;
  background: var(--b-primary);
  color: var(--b-background);
  font-weight: 700;
}

@media (max-width: 860px) {
  .branding { grid-template-columns: 1fr; }
  .branding__preview { position: static; order: -1; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .url-row { grid-template-columns: 1fr; }
  .url-row__error { grid-column: 1; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
  .form-panel, .branding__form, .panel { padding: 18px 16px; }
  .console-nav { order: 3; flex-basis: 100%; }
  .copy { flex-direction: column; }
  .table th, .table td { padding-left: 12px; padding-right: 12px; }
}

/* Aviso de acceso automático de desarrollo: visible pero sin tapar nada */
.dev-banner {
  padding: 8px 24px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.875rem;
  text-align: center;
}
.dev-banner code { font-size: 0.8125rem; }

/* Ficha de inscrito en la consola */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.person { padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius-control); }
.person__name { font-weight: 700; }
.person__photo { display: block; width: 88px; height: 88px; margin-bottom: 6px; border-radius: 50%; object-fit: cover; }
.person__photo-flag { margin-bottom: 8px; color: var(--muted); font-size: 0.8125rem; }
.vehicle-photo { display: block; width: 100%; max-width: 320px; margin-top: 12px; border-radius: var(--radius-control); }
.team-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.team-strip figure { margin: 0; width: 120px; }
.team-strip img { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-control); }
.team-strip figcaption { margin-top: 4px; font-size: 0.8125rem; color: var(--muted); }
.person__role { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 0.875rem; }
.person .facts div { grid-template-columns: 7.5em 1fr; }

/* Documentación y salud en la ficha del inscrito */
.panel__count { margin-left: 6px; color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.panel--restricted { border-left: 4px solid var(--bandera); }
.restricted-note { margin-bottom: 14px; padding: 10px 12px; border-radius: 4px; background: var(--error-bg); color: var(--error-text); font-size: 0.9375rem; }
.doc-owner { margin: 16px 0 4px; font-weight: 700; }
.doc-owner span { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 0.875rem; }
.table--docs td:first-child { width: 28%; }
.table__actions { text-align: right; }
.table__actions > a { margin-right: 10px; }
.review-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 6px; }
.review-form--block { display: flex; justify-content: flex-start; margin-top: 18px; }
.review-form .button--quiet { height: 34px; font-size: 0.875rem; }
.review-form__note { width: 14em; height: 34px; font-size: 0.875rem; }

/* Matriz de documentación por papel */
.req-matrix tbody th[scope="row"] { color: var(--text); font-size: 0.9375rem; font-weight: 600; text-align: left; white-space: normal; border-bottom: 1px solid var(--line); }
.req-matrix tbody tr:last-child th { border-bottom: 0; }
.req-matrix__role { text-align: center; white-space: normal; width: 7.5em; }
.req-matrix__cell { text-align: center; vertical-align: middle; }
.req-matrix__cell input { width: 20px; height: 20px; accent-color: var(--asfalto); cursor: pointer; }
.req-matrix tbody tr:hover { background: var(--notice-bg); }
.type-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Correo ---------- */

.mail-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  max-width: 720px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.form-grid--spaced { margin-top: 20px; }
.form-subtitle { margin: 28px 0 14px; font-size: 1.0625rem; font-weight: 700; }

.check--inline { margin-top: 10px; }
.form-panel > .check--boxed { margin-top: 28px; border: 1.5px solid var(--line); }

.test-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 14em) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}
.test-form .field + .field { margin-top: 0; }
.test-form .field__input { height: 44px; font-size: 1rem; }

.test-result {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--ok-text);
  border-radius: 4px;
  background: var(--ok-bg);
  color: var(--ok-text);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}
.test-result p + p { margin-top: 6px; }
.test-result--fail { border-left-color: var(--bandera); background: var(--error-bg); color: var(--error-text); }

.panel--wide { max-width: 1040px; }
.button--link { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { color: var(--text); }

.signature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.signature-item {
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control);
}
.signature-item__head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-bottom: 10px;
}
.signature-item__head form { margin: 0 0 0 auto; }

/* La firma se ve siempre sobre blanco, como en un correo */
.signature-item__preview {
  display: block;
  width: 100%;
  height: 170px;
  border: 0;
  border-radius: 6px;
  background: #ffffff;
}
.signature-item__preview--tall { height: 260px; }

.signature-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  gap: 28px;
  align-items: start;
}
.signature-edit__preview { position: sticky; top: 24px; }
.signature-edit__delete { margin-top: 20px; }

@media (max-width: 1040px) {
  .signature-edit { grid-template-columns: 1fr; }
  .signature-edit__preview { position: static; }
}

@media (max-width: 640px) {
  .test-form { grid-template-columns: 1fr; }
}

/* ---------- Eventos ---------- */

.badge--cancelled { background: var(--error-bg); color: var(--error-text); }

.table__dates { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table--compact td, .table--compact th { padding: 10px 0; }
.table--compact td + td, .table--compact th + th { padding-left: 16px; }
.table--compact { margin-top: 12px; }

.event-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: flex-end;
}
.event-head__name {
  font-size: 1.75rem;
  font-weight: 800;
  font-stretch: 70%;
  line-height: 1.1;
}
.event-head__meta { margin-top: 2px; color: var(--muted); }
.event-head__status { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
/* Fase según el calendario (distinta del estado): un punto de color y texto */
.phase { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.phase::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.phase--open::before { background: var(--ok-text); }
.phase--running::before { background: var(--senal); box-shadow: 0 0 0 2px var(--warn-bg); }
.phase--closed, .phase--finished { color: var(--muted); }

/* Línea de tiempo: la inscripción (con sus hitos) y el evento sobre la misma escala */
.timeline {
  margin-top: 18px;
  padding: 18px 20px 16px;
  border-radius: var(--radius-control);
  background: var(--surface);
}
.timeline__rows {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}
.timeline__label { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.timeline__bar {
  display: block;
  width: 100%;
  height: 18px;
  border-radius: 3px;
  background: var(--notice-bg);
}
.tl-tier { fill: var(--senal); }
.tl-base { fill: var(--line); }
.tl-event { fill: var(--asfalto); }
.tl-stage { fill: var(--senal); }
.tl-today { fill: var(--bandera); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tl-event { fill: #e7ebef; }
  :root:not([data-theme="light"]) .tl-stage { fill: var(--asfalto); }
}
:root[data-theme="dark"] .tl-event { fill: #e7ebef; }
:root[data-theme="dark"] .tl-stage { fill: var(--asfalto); }

.timeline__dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.timeline__dates span { color: var(--muted); }
.timeline__tier span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
  background: var(--senal);
}


.form-panel--wide { max-width: 1040px; }
.form-panel--wide + .panel { margin-top: 20px; }
.form-panel > .panel__title + .panel__text { margin-bottom: 4px; }
.fieldset--first { margin-top: 0; }
.form-grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }


/* Filas repetibles (hitos, etapas, extras) */
.rows { display: grid; gap: 10px; margin-top: 16px; }
.row-card {
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control);
}
.row-card--error { border-color: var(--bandera); }
.row-card .field__input { height: 42px; font-size: 1rem; }
.row-card .field__label { font-size: 0.875rem; }
.row-card > .field__error { margin-top: 10px; }
.row-grid { display: grid; gap: 12px; align-items: end; }
.row-grid .field + .field { margin-top: 0; }
.row-grid--tiers { grid-template-columns: minmax(0, 1.6fr) minmax(13em, 1fr) minmax(10em, 0.8fr) 6em; }
.row-grid--stages { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.2fr); }
.row-grid--extras { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row-grid__wide { grid-column: 1 / -1; }
.row-grid__span2 { grid-column: span 2; }
.row-card__remove { padding-bottom: 10px; }
.row-card__checks { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.row-card__checks .row-card__remove { margin-left: auto; padding: 0; }
.field__suffix--select { padding: 0 6px; font: inherit; font-size: 1rem; color: var(--text); cursor: pointer; }
.add-row { margin-top: 12px; }

@media (max-width: 900px) {
  .row-grid--tiers, .row-grid--stages { grid-template-columns: 1fr 1fr; }
  .row-grid--extras { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .form-grid--thirds, .row-grid--tiers, .row-grid--stages, .row-grid--extras { grid-template-columns: 1fr; }
  .row-grid__span2 { grid-column: auto; }
  .timeline__rows { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Manual ---------- */
.manual { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 28px; align-items: start; }
.manual__nav { position: sticky; top: 20px; }
.manual__nav ol { margin: 0; padding: 0; list-style: none; counter-reset: page; }
.manual__nav li { counter-increment: page; }
.manual__nav a { display: flex; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 0.9375rem; line-height: 1.35; }
.manual__nav a::before { content: counter(page); min-width: 1.2em; color: var(--muted); font-variant-numeric: tabular-nums; }
.manual__nav a:hover { color: var(--text); background: var(--notice-bg); }
.manual__nav a[aria-current="page"] { color: var(--text); background: var(--notice-bg); font-weight: 600; }
.manual__nav-title { margin: 0 0 8px 10px; font-weight: 700; }
.manual__article { min-width: 0; max-width: 46rem; }
.manual__title { margin: 0 0 12px; font-size: 2rem; line-height: 1.15; }
.manual__note { margin-bottom: 16px; padding: 10px 12px; border-radius: 6px; background: var(--notice-bg); color: var(--muted); font-size: 0.9375rem; }
.manual__toc { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 22px; padding: 0 0 14px; list-style: none; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.manual__toc a { color: var(--muted); }
.manual__pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.9375rem; }

.prose { font-size: 1.0625rem; line-height: 1.7; }
.prose > * + * { margin-top: 0.9em; }
.prose h2 { margin-top: 1.8em; font-size: 1.375rem; line-height: 1.25; scroll-margin-top: 16px; }
.prose h3 { margin-top: 1.4em; font-size: 1.125rem; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.3em; }
.prose code { padding: 1px 5px; border-radius: 4px; background: var(--notice-bg); font-size: 0.875em; }
.prose pre { overflow-x: auto; padding: 12px 14px; border-radius: 6px; background: var(--notice-bg); font-size: 0.875rem; line-height: 1.5; }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin-left: 0; padding: 10px 14px; border-left: 4px solid var(--senal); background: var(--notice-bg); }
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.45; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; }

@media (max-width: 860px) {
  .manual { grid-template-columns: 1fr; }
  .manual__nav { position: static; }
  .manual__nav ol { display: flex; flex-wrap: wrap; gap: 4px; }
  .manual__nav a::before { display: none; }
}

.manual-sections { display: flex; gap: 6px; margin-bottom: 22px; }
.manual-sections a { padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--muted); font-weight: 600; text-decoration: none; }
.manual-sections a[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.page-console .prose { color: var(--text); }

/* ---------- Banderas de los inscritos y revisión de documentos ---------- */

/* Bandera: banderín de color + estado corto (el nombre lo da la columna) */
.fl { --flag: var(--line); }
.fl--green  { --flag: var(--ok-text); }
.fl--yellow { --flag: var(--senal); }
.fl--red    { --flag: var(--bandera); }
.fl__mark { display: inline-block; width: 10px; height: 13px; margin-right: 7px; vertical-align: -1px; background: var(--flag); clip-path: polygon(0 0, 100% 25%, 0 55%, 0 100%); box-shadow: inset 2px 0 0 rgb(0 0 0 / 0.35); }
.fl__text { font-size: 0.875rem; }
.fl--red .fl__text { color: var(--error-text); font-weight: 600; }
.fl--yellow .fl__text { color: var(--warn-text); font-weight: 600; }
.fl--grey .fl__text { color: var(--muted); }

/* Pendiente: lo que te toca a ti y lo que espera del equipo */
.desk { margin-bottom: 18px; border-radius: var(--radius-control); background: var(--surface); }
.desk__row { display: grid; grid-template-columns: 11.5rem 1fr; gap: 8px 16px; align-items: center; padding: 12px 16px; }
.desk__row + .desk__row { border-top: 1px solid var(--line); }
.desk__title { margin: 0; font-size: 0.9375rem; font-weight: 700; }
.desk__title::before { content: ""; display: inline-block; width: 10px; height: 13px; margin-right: 8px; vertical-align: -1px; clip-path: polygon(0 0, 100% 25%, 0 55%, 0 100%); background: var(--senal); }
.desk__row--theirs .desk__title::before { background: var(--bandera); }
.desk__items { display: flex; flex-wrap: wrap; gap: 8px; }
.desk__item { padding: 5px 12px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--text); font-size: 0.9375rem; text-decoration: none; }
.desk__item strong { font-variant-numeric: tabular-nums; }
.desk__item:hover { border-color: var(--text); }
.desk__item.is-on { background: var(--text); border-color: var(--text); color: var(--surface); }
.desk__none { color: var(--muted); font-size: 0.9375rem; }

/* Buscador y filtros */
.finder { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 15rem) minmax(9rem, 12rem) auto; gap: 10px; align-items: center; }
.finder .field__input { height: 44px; font-size: 0.9375rem; }
.finder__go { height: 44px; }
.finder__more { grid-column: 1 / -1; }
.finder__more > summary { width: max-content; color: var(--muted); font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.finder__more[open] > summary { color: var(--text); }
.finder__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 10px; padding: 14px 16px; border-radius: var(--radius-control); background: var(--surface); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.active-filter { display: inline-flex; gap: 8px; align-items: center; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--text); color: var(--surface); font-size: 0.875rem; text-decoration: none; }
.active-filter__x { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgb(255 255 255 / 0.16); font-size: 1rem; line-height: 1; }
.active-filter:hover .active-filter__x { background: var(--bandera); color: #fff; }

/* Pestañas de estado */
.status-tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 20px 0 0; border-bottom: 1px solid var(--line); }
.status-tab { margin-bottom: -1px; padding: 8px 0 9px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; }
.status-tab span { margin-left: 3px; font-variant-numeric: tabular-nums; font-weight: 400; }
.status-tab:hover { color: var(--text); }
.status-tab.is-on { border-bottom-color: var(--senal); color: var(--text); }

/* Lista de inscritos */
.entries-wrap { margin-top: 14px; border-radius: var(--radius-control); background: var(--surface); overflow-x: auto; }
.entries { width: 100%; border-collapse: collapse; }
.entries th { padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; font-weight: 600; text-align: left; white-space: nowrap; }
.entries td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 0.9375rem; }
.entries tr:last-child td { border-bottom: 0; }
.entries th:first-child, .entries td:first-child { padding-left: 16px; }
.entries th:last-child, .entries td:last-child { padding-right: 16px; }
.ent:hover td { background: var(--bg); }
.ent--off td { opacity: 0.55; }
.ent__num { width: 4.5rem; }
.ent__flag { width: 8.5rem; }
.fl__in { display: flex; align-items: baseline; }
.fl__in .fl__mark { flex: none; align-self: flex-start; margin-top: 3px; }
.page-wide .console { max-width: 1320px; }
.ent__team { min-width: 11rem; }
.ent__cat { min-width: 8.5rem; }
.ent__link { color: var(--text); font-weight: 700; text-decoration: none; }
.ent__link:hover { text-decoration: underline; }
.ent__sub { display: block; margin-top: 1px; color: var(--muted); font-size: 0.8125rem; }
.ent__ids { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 3px; }
.ent__reg { margin-right: 2px; color: var(--muted); font-size: 0.8125rem; }
.idtag { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.idtag__k { color: var(--muted); font-weight: 700; }
.ent__state .badge { white-space: nowrap; }

/* Placa del dorsal: como la de las puertas del coche */
.plate { display: inline-grid; place-items: center; min-width: 3.1rem; height: 2.35rem; padding: 0 6px; border: 2px solid var(--asfalto); border-radius: 6px; background: var(--papel); color: var(--asfalto); font-size: 1.6rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.plate--org { border-color: var(--senal); background: var(--senal); font-size: 1.2rem; font-stretch: 75%; }
.plate--none { border: 2px dashed var(--line); background: transparent; color: var(--muted); font-weight: 400; }

.entries-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 0.875rem; }

@media (max-width: 980px) {
  .finder { grid-template-columns: 1fr 1fr; }
  .finder__search { grid-column: 1 / -1; }
  .finder__go { grid-column: 1 / -1; }
  .finder__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk__row { grid-template-columns: 1fr; }

  /* Cada inscrito pasa a ser una ficha: placa a la izquierda, banderas en rejilla de dos */
  .entries-wrap { overflow: visible; }
  .entries thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .entries, .entries tbody { display: block; }
  .entries tr.ent { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .entries tr.ent:last-child { border-bottom: 0; }
  .entries td, .entries td:first-child, .entries td:last-child { display: block; width: auto; padding: 0; border: 0; }
  .ent:hover td { background: none; }
  .ent__num { grid-row: 1 / span 5; }
  .ent__team, .ent__state { grid-column: 2 / -1; }
  .ent__state { display: flex !important; gap: 8px; align-items: baseline; }
  .ent__state .ent__sub { display: inline; }
  .ent__car, .ent__cat, .ent__flag { grid-column: auto; }
  .ent__car::before, .ent__cat::before, .ent__flag::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
}
@media (max-width: 640px) {
  .finder { grid-template-columns: 1fr; }
  .finder__grid { grid-template-columns: 1fr; }
}


/* Visor de un documento */
.doc-head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: flex-start; }
.doc-head__title { margin-bottom: 4px; }
.doc-head__meta { color: var(--muted); }
.doc-head__status { display: flex; gap: 10px; align-items: center; }
.doc-head__queue { color: var(--muted); font-size: 0.875rem; }
.doc-review { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 20px; align-items: start; margin-top: 18px; }
.doc-viewer { padding: 12px; border-radius: var(--radius-control); background: var(--surface); }
.doc-viewer__frame { display: block; width: 100%; height: 78vh; min-height: 480px; border: 0; border-radius: 4px; background: var(--notice-bg); }
.doc-viewer__image { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 4px; }
.doc-viewer__fallback { margin-top: 10px; color: var(--muted); font-size: 0.875rem; }
.doc-side { display: grid; gap: 16px; position: sticky; top: 16px; }
.doc-side > .panel { margin-top: 0; max-width: none; }
.doc-side .panel form + form { margin-top: 18px; }
.doc-approve { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-approve .button--quiet { height: 44px; }
.doc-reject { padding-top: 16px; border-top: 1px solid var(--line); }
.doc-reject .field__input--area { margin-top: 6px; }
.doc-reject__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.facts--narrow div { grid-template-columns: 6.5em 1fr; }
.doc-next { font-size: 0.9375rem; }

@media (max-width: 1040px) {
  .doc-review { grid-template-columns: 1fr; }
  .doc-side { position: static; }
}
@media (max-width: 640px) {
  .doc-viewer__frame { height: 70vh; }
}

/* ---------- Pagos ---------- */

.pay-provider .check--block { margin-top: 12px; }
.pay-envs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.pay-env { padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-control); }
.pay-env--live { border-color: var(--input-border); }
.pay-env__title { display: flex; gap: 8px; align-items: center; font-size: 1rem; font-weight: 700; }
.pay-env .field + .field { margin-top: 12px; }
.pay-checks { margin-top: 20px; max-width: 1040px; }
.pay-checks .panel form { margin-top: 12px; }
.check--muted { opacity: 0.7; }

.pay-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 10px; margin: 12px 0; }
.pay-summary div { padding: 10px 12px; border-radius: var(--radius-control); background: var(--notice-bg); border-left: 4px solid var(--line); }
.pay-summary dt { color: var(--muted); font-size: 0.875rem; }
.pay-summary dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-summary--green { border-left-color: #2e7d32 !important; }
.pay-summary--yellow { border-left-color: var(--senal) !important; }
.pay-summary--red { border-left-color: var(--bandera) !important; }
.pay-subtitle { margin: 18px 0 6px; font-size: 1rem; font-weight: 700; }
.table tr.is-cancelled td { color: var(--muted); text-decoration: line-through; }
.table tr.is-cancelled .table__sub { text-decoration: none; }
.pay-forms { margin-top: 18px; max-width: none; }
.pay-form { padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-control); }
.pay-form .pay-subtitle { margin-top: 0; }
.pay-form .field + .field, .pay-form .form-grid { margin-top: 10px; }
.pay-form > .button { margin-top: 14px; }

@media (max-width: 860px) {
  .pay-envs { grid-template-columns: 1fr; }
}

/* ---------- Páginas de error ---------- */

.pass__actions { display: grid; gap: 10px; margin-top: 24px; }
.pass__actions .button { display: flex; align-items: center; justify-content: center; margin-top: 0; text-decoration: none; }
.pass__actions .button--quiet { width: 100%; height: 50px; }
.empty .button--inline + .button--inline { margin-left: 8px; }

/* ---------- Usuarios del framework y Mi cuenta ---------- */

.badge--root { background: var(--senal); color: var(--asfalto); }
.role-app { margin: 18px 0 6px; font-size: 1rem; font-weight: 700; }
.fieldset .panel__text + .role-app { margin-top: 10px; }
.account { margin-top: 24px; }
.account > .form-panel { max-width: none; }
.account > .form-panel .panel__title + .field, .account > .form-panel .panel__text + .field { margin-top: 12px; }
.split + .panel--wide { margin-top: 20px; }
.form-panel--wide + .split { margin-top: 20px; max-width: 1040px; }
.fieldset .check--boxed { border: 1.5px solid var(--line); }
.session-list { margin: 12px 0 0; padding: 0; list-style: none; }
.session-list__item { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.session-list__agent { overflow-wrap: anywhere; }
.panel form + form { margin-top: 12px; }

/* ---------- Aplicación Tareas ---------- */

.tasks-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 24px; }

/* Carpetas y semillas: plegadas por defecto, en cualquier ancho */
.task-folders { border: 1.5px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.task-folders__summary { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 16px; cursor: pointer; list-style: none; font-weight: 600; }
.task-folders__summary::-webkit-details-marker { display: none; }
.task-folders__current { min-width: 0; overflow-wrap: anywhere; }
.task-folders__hint { flex: none; display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.task-folders__hint::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
.task-folders[open] .task-folders__hint::after { transform: rotate(-135deg); }
.task-folders__summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-control); }
.task-folders .task-tree { padding: 4px 8px 8px; border-top: 1px solid var(--line); }
.task-tree__link { min-height: 48px; align-items: center; padding: 0 12px; font-size: 1rem; }
.task-tree__actions { padding: 4px 4px 0; }
.task-tree__actions a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 8px; }
.task-seeds { padding-top: 0; border: 1.5px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.task-seeds__summary { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 56px; margin: 0; padding: 0 16px; list-style: none; cursor: pointer; pointer-events: auto; font-weight: 600; }
.task-seeds__summary::-webkit-details-marker { display: none; }
.task-seeds__hint { display: inline-flex; gap: 8px; align-items: center; font-size: 0.875rem; font-weight: 500; }
.task-seeds__hint::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
.task-seeds[open] .task-seeds__hint::after { transform: rotate(-135deg); }
.task-seeds__summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-control); }
.seed-cloud { max-height: 45vh; overflow-y: auto; padding: 10px 12px 14px; border-top: 1px solid var(--line); }
.seed-cloud .seed { min-height: 48px; padding: 0 16px 0 14px; font-size: 0.9375rem; }

/* Árbol de carpetas */
.tasks-side { position: sticky; top: 20px; display: grid; gap: 20px; max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.task-seeds__title { font-size: 1rem; font-weight: 700; }
.task-seeds__hint { color: var(--muted); font-size: 0.8125rem; }
.seed-cloud .seed { padding: 2px 10px 2px 8px; font-size: 0.8125rem; }
.task-tree { font-size: 0.9375rem; }
.task-tree__list { margin: 0; padding: 0; list-style: none; }
.task-tree__list .task-tree__list { margin: 2px 0 2px 12px; padding-left: 8px; border-left: 1.5px solid var(--line); }
.task-tree__link { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; padding: 4px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; line-height: 1.35; }
.task-tree__link:hover { color: var(--text); background: var(--notice-bg); }
.task-tree__link[aria-current="page"] { color: var(--text); background: var(--notice-bg); font-weight: 600; box-shadow: inset 3px 0 0 var(--senal); }
.task-tree__all { margin-bottom: 4px; }
.task-tree__count { min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 0.8125rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.task-tree__actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.task-tree__actions a { color: var(--muted); }
.task-tree__actions a:hover { color: var(--text); }

.tasks-filters { display: flex; flex-wrap: wrap; gap: 0 36px; }
.tasks-filters .filters { margin-top: 0; }
.tasks-main > .empty { margin-top: 20px; }

/* Lista de tareas */
.task-group { margin-top: 24px; }
.task-group__title { margin-bottom: 8px; font-size: 1rem; font-weight: 700; }
.task-group__title a { color: var(--text); text-decoration: none; }
.task-group__title a:hover { text-decoration: underline; }
.tasks-main > .task-list { margin-top: 20px; }

.task-list { margin: 0; padding: 0; list-style: none; border-radius: var(--radius-control); background: var(--surface); }
.task { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.task:last-child { border-bottom: 0; }
.task:target { box-shadow: inset 3px 0 0 var(--senal); }
.task__toggle { flex: none; margin: 0; }
.task__body { min-width: 0; }
.task__title { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.task__title:hover { text-decoration: underline; }
.task__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 4px; color: var(--muted); font-size: 0.875rem; }
.task__doc { color: var(--muted); font-size: 0.8125rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.task__doc:hover { color: var(--text); }

/* Realizadas: se quedan en la lista, con el check y el título tachado */
.task--done .task__title { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1px; }
.task--done .task__title:hover { color: var(--text); }

/* Casilla de realizada: el botón mide 48 px (zona táctil) y el cuadro se dibuja dentro */
.task__check { position: relative; display: block; width: 48px; height: 48px; margin: -12px -10px -12px -12px; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.task__check::before { content: ""; position: absolute; inset: 11px; border: 2px solid var(--input-border); border-radius: 7px; background: var(--surface); transition: background-color 0.15s, border-color 0.15s, transform 0.15s; }
.task__check:hover::before { border-color: var(--text); }
.task__check:active::before { transform: scale(0.9); }
.task__check:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; }
.task__check[aria-pressed="true"]::before, .task__check--static[data-done="true"]::before { border-color: var(--button-bg); background: var(--button-bg); }
.task__check[aria-pressed="true"]::after, .task__check--static[data-done="true"]::after { content: ""; position: absolute; left: 20px; top: 15px; width: 7px; height: 13px; border: solid var(--button-text); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.task__check--large { width: 56px; height: 56px; margin: -10px 0 -10px -14px; }
.task__check--large::before { inset: 11px; border-radius: 9px; }
.task__check--large[aria-pressed="true"]::after, .task__check--large.task__check--static[data-done="true"]::after { left: 23px; top: 17px; width: 9px; height: 16px; border-width: 0 3px 3px 0; }
.task__check[disabled] { cursor: progress; opacity: 1; }
.task__check--static { cursor: default; }
.task__check--static:hover::before { border-color: var(--input-border); }
.task__check--static[data-done="false"]::before { border-style: dashed; opacity: 0.55; }
/* Guardando: la casilla ya se ve cambiada y late hasta que vuelve la página */
.task__toggle.is-saving .task__check::before { animation: task-saving 0.9s ease-in-out infinite; }
.task.is-saving, .task-head.is-saving { opacity: 0.85; }
@keyframes task-saving { 50% { transform: scale(0.82); } }

/* Prioridad */
.priority { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.priority--1 { background: var(--error-bg); color: var(--error-text); }
.priority--2 { background: var(--warn-bg); color: var(--warn-text); }
.priority--3 { background: var(--notice-bg); color: var(--text); }
.priority--4 { border: 1px solid var(--line); color: var(--muted); }

/* Ficha de la tarea */
.task-head { display: flex; gap: 16px; align-items: flex-start; }
.task-head .task__toggle { margin-top: 2px; }
.task-head .task__meta { margin-top: 8px; }
.task-head--done .page-head__title { color: var(--muted); }

.task-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 20px; align-items: start; max-width: 1180px; margin-top: 24px; }
.task-page > .panel, .task-page > .form-panel { max-width: none; margin-top: 0; }
.task-side { display: grid; gap: 20px; }
.task-side > .panel, .task-side > .form-panel { max-width: none; margin-top: 0; }
.task-doc .section-head { align-items: center; }
.task-doc .section-head .button--quiet { display: inline-flex; align-items: center; text-decoration: none; }
.task-file { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 16px; font-size: 0.875rem; }
.task-file code { padding: 1px 5px; border-radius: 4px; background: var(--notice-bg); }
.task-doc .prose { padding-top: 14px; border-top: 1px solid var(--line); }
.task-doc .prose h2:first-child { margin-top: 0; }
.task-prompt { margin-top: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.8125rem; line-height: 1.5; }
.form-actions--tight { margin-top: 12px; }
.task-data .panel__title { margin-bottom: 4px; }

/* Editor del .md */
.task-editor__area { margin-top: 8px; min-height: 28rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.875rem; line-height: 1.55; tab-size: 4; }
.task-help__list { margin: 12px 0 0; font-size: 0.9375rem; }
.task-help__list dt { margin-top: 12px; font-weight: 700; }
.task-help__list dd { margin: 2px 0 0; color: var(--muted); }
.task-help code { font-size: 0.875em; }

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

@media (max-width: 860px) {
  .tasks-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .task-folders { position: static; }
}

/* ---------- Movimiento ---------- */

@keyframes pass-hang {
  0%   { opacity: 0; transform: translateY(-24px) rotate(-4deg); }
  45%  { opacity: 1; }
  70%  { transform: translateY(0) rotate(1.2deg); }
  100% { transform: translateY(0) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pass { animation: none; }
  .button:active { transform: none; }
}

@media (max-width: 420px) {
  .access-header { padding: 16px; }
  .pass__band { font-size: 2rem; padding-left: 20px; padding-right: 20px; }
  .pass__body, .pass__stub { padding-left: 20px; padding-right: 20px; }
  .console { padding: 28px 16px 64px; }
  .console-bar { padding: 12px 16px; }
}

/* ---------- Categorías del evento ---------- */
.cats-intro { max-width: 70ch; }
.cats { align-items: start; }
.cat-tree { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.cat-tree--root { padding-left: 0; border-left: 0; }
.cat { margin: 6px 0; }
.cat__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 10px; border-radius: var(--radius-control); background: var(--bg); }
.cat__name { font-weight: 700; flex: 1 1 10rem; }
.cat--leaf > .cat__row .cat__name { font-weight: 600; }
.cat__price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat__count { color: var(--muted); font-size: 0.875rem; }
.cat__edit { flex-basis: 100%; }
.cat__edit > summary, .cat-new > summary { cursor: pointer; }
.cat__edit > summary { color: var(--muted); font-size: 0.875rem; width: max-content; }
.cat-form { display: grid; gap: 10px; margin: 10px 0; }
.cat-form .field + .field { margin-top: 0; }
.cat-new { margin-top: 14px; }
.cat-new > summary { list-style: none; width: max-content; }
.cat-new > summary::-webkit-details-marker { display: none; }
.org-member { margin-top: 10px; }

/* Ficha del inscrito: gestión de la organización */
.manage-form { margin-top: 8px; align-content: start; }
.assigned-list { list-style: none; margin: 0 0 12px; padding: 0; }
.assigned-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.assigned-list form { display: inline; }
@media (max-width: 640px) {
  .manage-form, .org-member { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Ficha del inscrito ---------- */
.sheet-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; align-items: baseline; margin-bottom: 14px; font-size: 0.9375rem; }
.breadcrumb-link { color: var(--muted); }
.breadcrumb-link::before { content: "\2190\00a0"; }
.breadcrumb-link:hover { color: var(--text); }
.sheet-top__pager { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.sheet-top__pager a { color: var(--muted); }
.sheet-top__pager a:hover { color: var(--text); }
.sheet-top__pos { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Cabecera del equipo: placa grande, tripulación y vehículo */
.crew { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 24px; align-items: center; padding: 22px 24px; border-radius: var(--radius-control); background: var(--surface); }
.plate--xl { min-width: 6.4rem; height: 4.8rem; padding: 0 12px; border-width: 3px; border-radius: 10px; font-size: 3.6rem; }
.plate--xl.plate--org { font-size: 2.4rem; }
.plate--xl.plate--none { font-size: 2rem; }
.crew__name { margin: 0; font-size: 2.1rem; font-stretch: 62%; font-weight: 800; line-height: 1.02; letter-spacing: 0.005em; }
.crew__co { margin: 2px 0 0; font-size: 1.35rem; font-stretch: 62%; font-weight: 700; color: var(--muted); line-height: 1.1; }
.crew__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 10px 0 0; font-size: 0.9375rem; }
.crew__state { display: grid; justify-items: end; gap: 4px; text-align: right; }
.crew__date { margin: 0; color: var(--muted); font-size: 0.875rem; }
.crew__money { margin: 4px 0 0; font-size: 0.9375rem; }
.crew__money strong { display: block; font-size: 1.5rem; font-stretch: 75%; font-variant-numeric: tabular-nums; }
.crew__money--red strong { color: var(--error-text); }
.crew__money--green strong { color: var(--ok-text); }

/* Barra de secciones: las banderas de la lista hacen de índice */
.sheet-nav { position: sticky; top: 0; z-index: 5; display: flex; gap: 2px 4px; overflow-x: auto; margin: 0 0 18px; padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.sheet-nav__link { display: inline-flex; align-items: baseline; gap: 0; flex: none; padding: 6px 12px; border-radius: 999px; color: var(--text); font-size: 0.9375rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.sheet-nav__link:hover { background: var(--surface); }
.sheet-nav__state { margin-left: 8px; font-weight: 400; font-size: 0.8125rem; color: var(--muted); }
.sheet-nav__link.fl--red .sheet-nav__state { color: var(--error-text); font-weight: 600; }
.sheet-nav__link.fl--yellow .sheet-nav__state { color: var(--warn-text); font-weight: 600; }
.sheet-nav__link--plain { color: var(--muted); }

/* Dos columnas: lo que se revisa y lo que se cambia */
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 20px; align-items: start; }
.sheet__main, .sheet__side { display: grid; gap: 20px; min-width: 0; }
.sheet__panel { max-width: none; margin-top: 0; scroll-margin-top: 64px; }
.sheet__alert { margin: 8px 0 0; padding: 8px 12px; border-left: 4px solid var(--bandera); background: var(--error-bg); color: var(--error-text); font-size: 0.9375rem; }

/* Personas y vehículos */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 12px; margin-top: 14px; }
.pcard { padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-control); }
.pcard__head { display: flex; gap: 12px; align-items: center; }
.pcard__photo { flex: none; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.pcard__photo--car { border-radius: 8px; width: 72px; }
.pcard__photo--none { display: grid; place-items: center; background: var(--bg); color: var(--muted); font-weight: 800; font-stretch: 75%; font-size: 1.1rem; }
.pcard__name { margin: 0; font-size: 1.0625rem; font-weight: 700; line-height: 1.2; }
.pcard__roles { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; }
.pcard--car { border-style: dashed; }
.pcard__facts { display: grid; gap: 4px; margin: 12px 0 0; font-size: 0.875rem; }
.pcard__facts div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 10px; }
.pcard__facts dt { color: var(--muted); }
.pcard__facts dd { margin: 0; overflow-wrap: anywhere; }
.pcard__facts a { color: var(--text); }
.pcard__missing { color: var(--error-text); }

/* Documentos y salud: una línea por requisito */
.sheet__panel .doc-owner { margin: 18px 0 4px; font-size: 0.9375rem; }
.doclist { list-style: none; margin: 0; padding: 0; }
.doc { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 16px; align-items: center; padding: 9px 0 9px 12px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.doc:last-child { border-bottom: 0; }
.doc--missing, .doc--rejected, .doc--expired { border-left-color: var(--bandera); }
.doc--pending { border-left-color: var(--senal); }
.doc--approved { border-left-color: var(--ok-text); }
.doc__label { font-size: 0.9375rem; }
.doc__sub { display: block; color: var(--muted); font-size: 0.8125rem; }
.doc__state { justify-self: end; }
.doc__actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; min-width: 10.5rem; }
.doc__actions form, .lines__form { margin: 0 !important; }
.doc__lock { color: var(--muted); font-size: 0.8125rem; }
.doc-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1.5px solid var(--input-border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.doc-btn:hover { border-color: var(--text); }
.doc-btn--ok { border-color: var(--text); background: var(--text); color: var(--surface); }
.doc-btn--ok:hover { opacity: 0.9; }

/* Formularios plegados */
.reveal-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 16px; }
.reveal > summary { list-style: none; width: max-content; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal[open] > summary { background: var(--text); color: var(--surface); border-color: var(--text); }
.reveal-actions .reveal[open] { flex-basis: 100%; }
.reveal__body { margin-top: 12px !important; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-control); }
.reveal__body > .button { margin-top: 14px; }

/* Columna lateral */
.side-panel .panel__title { font-size: 1.0625rem; }
.side-form { display: grid; gap: 12px; }
.side-form .field + .field { margin-top: 0; }
.side-form__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-form .field__help { margin: 0; }
.side-form > .button { justify-self: start; }
.lines { list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.9375rem; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.lines__num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines__sub { display: block; color: var(--muted); font-size: 0.8125rem; }
.lines__total { font-weight: 700; border-bottom: 0 !important; }
.side-panel .reveal { margin-top: 14px; }
.side-facts { display: grid; gap: 6px; margin: 10px 0 0; font-size: 0.9375rem; }
.side-facts div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 10px; }
.side-facts dt { color: var(--muted); }
.side-facts dd { margin: 0; overflow-wrap: anywhere; }
.side-facts a { color: var(--text); }

@media (max-width: 1100px) {
  .sheet { grid-template-columns: 1fr; }
  .sheet__side { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }
}
@media (max-width: 720px) {
  .crew { grid-template-columns: auto minmax(0, 1fr); padding: 18px 16px; }
  .crew__state { grid-column: 1 / -1; justify-items: start; text-align: left; grid-auto-flow: column; align-items: baseline; justify-content: start; gap: 12px; }
  .crew__money strong { display: inline; font-size: 1.15rem; }
  .plate--xl { min-width: 4.2rem; height: 3.4rem; font-size: 2.5rem; }
  .crew__name { font-size: 1.6rem; }
  .crew__co { font-size: 1.1rem; }
  .sheet-nav__state { display: none; }
  .doc { grid-template-columns: minmax(0, 1fr) auto; }
  .doc__actions { grid-column: 1 / -1; justify-content: flex-start; min-width: 0; }
  .sheet-top__name { display: none; }
}

/* «Entrar como el equipo» */
.ent__enter { display: inline-block; margin: 6px 0 0 !important; }
.ent__enter .doc-btn { height: 28px; padding: 0 10px; font-size: 0.8125rem; }
.crew__enter { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: flex-end; margin-top: 6px; }
.crew__enter form { margin: 0; }
.crew__enter .link-button { font-size: 0.875rem; }
.support-link { display: grid; gap: 6px; margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid var(--senal); border-radius: var(--radius-control); background: var(--surface); }
.support-link p { margin: 0; color: var(--muted); font-size: 0.875rem; }
.support-link .copy { margin-top: 0; }
@media (max-width: 720px) { .crew__enter { justify-content: flex-start; } }

/* ---------- Programa del evento: etapas ---------- */
.leg--stage { --kind: var(--text); }
.leg--scrutineering, .kind-pick__opt--scrutineering { --kind: var(--senal); }
.leg--shakedown, .kind-pick__opt--shakedown { --kind: var(--acero, #5E6B78); }
.leg--prologue, .kind-pick__opt--prologue { --kind: var(--ok-text); }
.leg--other, .kind-pick__opt--other { --kind: var(--line); }
.kind-pick__opt--stage { --kind: var(--text); }

.program-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.program-head__sum { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.program-head__sum strong { color: var(--text); }
.program-day { margin-top: 26px; }
.program-day__title { margin: 0 0 10px; font-size: 1.6rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; }
.legs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.leg { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 17rem; grid-template-areas: "time body map" "time body stats"; gap: 4px 22px; padding: 16px 18px 16px 0; border-radius: var(--radius-control); background: var(--surface); }
.leg__time { grid-area: time; display: grid; align-content: start; justify-items: end; padding: 0 16px 0 12px; border-right: 4px solid var(--kind); }
.leg__start { font-size: 2.1rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.leg__end { margin-top: 4px; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.leg__alias { max-width: 100%; font-size: 2.1rem; font-stretch: 62%; font-weight: 800; line-height: 1; overflow-wrap: anywhere; text-align: right; }
.leg__time--alias .leg__start { margin-top: 8px; font-size: 1.2rem; font-stretch: 75%; }
.leg__body { grid-area: body; min-width: 0; }
.leg__kind { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.leg__kind::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--kind); }
.leg__name { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.leg__name a { color: var(--text); text-decoration: none; }
.leg__name a:hover { text-decoration: underline; }
.leg__place { margin: 4px 0 0; font-size: 0.9375rem; }
.leg__notes { margin: 6px 0 0; max-width: 70ch; color: var(--muted); font-size: 0.875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.leg__files { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.leg__edit { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 0.875rem; }
.leg__edit:hover { color: var(--text); }
.fchip { padding: 2px 10px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
.fchip span { color: var(--muted); font-weight: 400; }
.fchip--track { border-color: var(--text); }
.fchip--wpt { border-color: var(--senal); }
.fchip--missing { border-style: dashed; color: var(--error-text); }
.leg__map { grid-area: map; display: block; }
.leg__nomap { display: grid; place-items: center; height: 100%; min-height: 6rem; border: 1.5px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 0.875rem; }
.leg__stats { grid-area: stats; display: flex; gap: 18px; margin: 4px 0 0; }
.leg__stats div { display: grid; }
.leg__stats dt { color: var(--muted); font-size: 0.75rem; }
.leg__stats dd { margin: 0; font-size: 1.05rem; font-weight: 800; font-stretch: 75%; font-variant-numeric: tabular-nums; }

/* Trazado (SVG dibujado en el servidor) y perfil */
.map { display: block; width: 100%; height: auto; }
.map__bg { fill: var(--bg); }
.map__route-under { fill: none; stroke: var(--surface); stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; }
.map__route { fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.map__wpt { fill: var(--senal); stroke: var(--asfalto); stroke-width: 0.8; }
.map__start { fill: var(--ok-text); stroke: var(--surface); stroke-width: 2; }
.map__end { fill: var(--bandera); stroke: var(--surface); stroke-width: 2; }
.prof { display: block; width: 100%; height: 90px; }
.prof__area { fill: var(--notice-bg); }
.prof__line { fill: none; stroke: var(--text); stroke-width: 1.6; vector-effect: non-scaling-stroke; }

/* Ficha de una etapa */
.stage-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
.stage-edit > .panel { max-width: none; margin-top: 0; }
.stage-edit__data .field + .field, .stage-edit__data .stage-edit__pair, .stage-edit__data .field__help { margin-top: 14px; }
.stage-edit__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stage-edit__pair .field + .field { margin-top: 0; }
.stage-edit__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.stage-edit__delete { margin-left: auto; color: var(--error-text); }
.kind-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; border: 0; }
.kind-pick legend { margin-bottom: 6px; }
.kind-pick__opt { position: relative; }
.kind-pick__opt input { position: absolute; opacity: 0; }
.kind-pick__opt span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.kind-pick__opt span::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--kind); }
.kind-pick__opt input:checked + span { border-color: var(--text); background: var(--text); color: var(--surface); }
.kind-pick__opt input:checked + span::before { box-shadow: 0 0 0 1.5px var(--surface); }
.kind-pick + .field { margin-top: 16px; }
.kind-pick__opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.route-map { margin-top: 12px; }
.route-map--empty { display: grid; place-items: center; min-height: 14rem; padding: 20px; border: 1.5px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.route-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 0; color: var(--muted); font-size: 0.8125rem; }
.route-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; }
.route-legend__start::before { background: var(--ok-text); }
.route-legend__end::before { background: var(--bandera); }
.route-legend__wpt::before { background: var(--senal); }
.route-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.route-stats dt { color: var(--muted); font-size: 0.8125rem; }
.route-stats dd { margin: 0; font-size: 1.7rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.route-stats small { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.route-profile { margin-top: 10px; }
.sfiles { display: grid; gap: 18px; margin-top: 8px; }
.sfiles__title { margin: 0 0 6px; font-size: 0.9375rem; font-weight: 700; }
.sfiles__title span { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 0.875rem; }
.sfile-list { list-style: none; margin: 0 0 8px; padding: 0; }
.sfile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sfile__name { font-weight: 600; overflow-wrap: anywhere; }
.sfile__meta { grid-column: 1; color: var(--muted); font-size: 0.8125rem; }
.sfile__actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 10px; align-items: center; }
.drop { position: relative; display: grid; place-items: center; min-height: 3.6rem; padding: 10px 14px; border: 1.5px dashed var(--input-border); border-radius: var(--radius-control); color: var(--muted); font-size: 0.9375rem; text-align: center; cursor: pointer; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop:hover, .drop.is-over { border-color: var(--text); color: var(--text); background: var(--bg); }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop.is-chosen { border-style: solid; border-color: var(--text); color: var(--text); font-weight: 600; }

@media (max-width: 1100px) {
  .leg { grid-template-columns: 6rem minmax(0, 1fr) 13rem; }
  .stage-edit { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .leg { grid-template-columns: minmax(0, 1fr); grid-template-areas: "time" "body" "map" "stats"; gap: 8px; padding: 14px 16px; border-left: 4px solid var(--kind); }
  .leg__time { display: flex; gap: 8px; align-items: baseline; padding: 0; border-right: 0; }
  .leg__start { font-size: 1.6rem; }
  .leg__end { margin-top: 0; }
  .leg__time--alias { display: grid; gap: 2px; justify-items: start; }
  .leg__alias { font-size: 2rem; text-align: left; }
  .leg__time--alias .leg__start { margin-top: 0; font-size: 1.1rem; }
  .leg__time--alias .leg__end { margin-top: 0; }
  .route-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-edit__pair { grid-template-columns: 1fr; }
}

/* ---------- Documentación del evento (permisos) ---------- */
.pstatus--draft { --pst: var(--muted); }
.pstatus--submitted { --pst: var(--text); }
.pstatus--processing { --pst: var(--senal); }
.pstatus--fix { --pst: var(--bandera); }
.pstatus--granted { --pst: var(--ok-text); }
.pstatus--denied { --pst: var(--error-text); }

.dossier-bar { display: block; width: 100%; height: 14px; margin-top: 14px; border-radius: 7px; overflow: hidden; background: var(--surface); }
.dossier-bar__seg { fill: var(--pst); }
.dossier-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 10px 0 0; padding: 0; color: var(--muted); font-size: 0.9375rem; }
.dossier-legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; background: var(--pst); vertical-align: -1px; }
.dossier-legend strong { color: var(--text); font-variant-numeric: tabular-nums; }

.permit-group { margin-top: 26px; }
.permit-group__title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 1.45rem; font-stretch: 62%; font-weight: 800; }
.permit-group__title > span:last-child { color: var(--muted); font-weight: 600; font-size: 1.1rem; }
.pdot { width: 12px; height: 12px; border-radius: 3px; background: var(--pst); }
.permits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.permit { display: grid; grid-template-columns: minmax(0, 1fr) 12rem minmax(0, 16rem); gap: 10px 22px; align-items: start; padding: 16px 18px; border-left: 5px solid var(--pst); border-radius: var(--radius-control); background: var(--surface); }
.permit__kind { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.permit__title { margin: 2px 0 0; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.permit__title a { color: var(--text); text-decoration: none; }
.permit__title a:hover { text-decoration: underline; }
.permit__who { margin: 4px 0 0; font-size: 0.9375rem; }
.permit__ref { margin-left: 8px; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.permit__alert { display: inline-block; margin: 8px 0 0; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); font-size: 0.8125rem; font-weight: 700; }
.permit--alert-red .permit__alert, .permit__alert--red { background: var(--error-bg); color: var(--error-text); }
.permit__dates { display: grid; gap: 4px; margin: 0; font-size: 0.875rem; }
.permit__dates div { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; }
.permit__dates dt { color: var(--muted); }
.permit__dates dd { margin: 0; font-variant-numeric: tabular-nums; }
.permit__side { display: grid; gap: 8px; justify-items: start; }
.permit__stages { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.permit__stages li { display: grid; gap: 2px; width: 96px; font-size: 0.75rem; color: var(--muted); }
.permit__stages li span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.permit__nomap { display: block; aspect-ratio: 96 / 60; border: 1.5px dashed var(--line); border-radius: 6px; }
.permit__files { color: var(--muted); font-size: 0.8125rem; }

/* Cabecera de la ficha con el sello del estado */
.permit-head { display: flex; flex-wrap: wrap; gap: 16px 30px; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 20px 24px; border-radius: var(--radius-control); background: var(--surface); }
.permit-head__title { margin: 2px 0 0; font-size: 2rem; font-stretch: 62%; font-weight: 800; line-height: 1.05; }
.stamp { display: grid; justify-items: center; gap: 2px; padding: 10px 18px; border: 4px double var(--pst); border-radius: 8px; color: var(--pst); transform: rotate(-4deg); }
.stamp__state { font-size: 1.7rem; font-stretch: 62%; font-weight: 800; line-height: 1; letter-spacing: 0.01em; }
.stamp__date { font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pstatus--processing.stamp { color: var(--warn-text); }

.status-pick .kind-pick__opt span::before { background: var(--pst); }
.stage-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 8px; margin-top: 10px; }
.stage-pick__opt { position: relative; }
.stage-pick__opt input { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; accent-color: var(--text); }
.stage-pick__card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 34px 8px 8px; border: 1.5px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.stage-pick__card .permit__nomap { width: 120px; }
.stage-pick__text { display: grid; gap: 2px; font-size: 0.875rem; }
.stage-pick__text span { color: var(--muted); font-size: 0.8125rem; }
.stage-pick__opt input:checked + .stage-pick__card { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.stage-pick__opt input:focus-visible + .stage-pick__card { outline: 3px solid var(--focus); outline-offset: 2px; }
.linked-stage { margin-top: 10px; }
.linked-stage__name { margin: 0 0 4px; font-weight: 700; }
.linked-stage__name a { color: var(--text); }
.linked-stage__name span { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 0.875rem; }
.permit-upload { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 12px; align-items: end; margin-top: 10px; }
.permit-upload .field + .field { margin-top: 0; }
.stage-edit__data .kind-pick + .stage-edit__pair { margin-top: 16px; }
.stage-edit__data > .panel__title + .field { margin-top: 14px; }

@media (max-width: 1100px) {
  .permit { grid-template-columns: minmax(0, 1fr) 12rem; }
  .permit__side { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .permit { grid-template-columns: 1fr; }
  .permit-upload { grid-template-columns: 1fr; }
  .stamp { transform: none; }
  .permit-head { padding: 16px; }
  .permit-head__title { font-size: 1.55rem; }
}

/* ---------- Evento: menú en dos carriles y resumen ---------- */
.evnav { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 18px 0 22px; border-radius: var(--radius-control); background: var(--surface); overflow: hidden; }
.evnav__home { grid-row: 1 / span 2; display: grid; place-items: center; padding: 0 18px; border-right: 1px solid var(--line); color: var(--text); font-size: 1.2rem; font-stretch: 62%; font-weight: 800; text-decoration: none; }
.evnav__home:hover { background: var(--bg); }
.evnav__home[aria-current="page"] { background: var(--text); color: var(--surface); }
.evnav__lane { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: 6px 8px; align-items: center; padding: 7px 10px; }
.evnav__lane + .evnav__lane { border-top: 1px solid var(--line); }
.evnav__label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.875rem; font-weight: 700; }
.evnav__label::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--text); }
.evnav__lane--participants .evnav__label::before { background: var(--senal); }
.evnav__items { display: flex; flex-wrap: wrap; gap: 2px 4px; list-style: none; margin: 0; padding: 0; }
.evnav__items a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; color: var(--text); font-size: 0.9375rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.evnav__items a:hover { background: var(--bg); }
.evnav__items a[aria-current="page"] { background: var(--text); color: var(--surface); }
.evnav__count { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.evnav__items a[aria-current="page"] .evnav__count { color: inherit; opacity: 0.75; }
.evnav__count--alert { padding: 0 7px; border-radius: 999px; background: var(--senal); color: var(--asfalto) !important; font-weight: 700; opacity: 1 !important; }

/* Resumen del evento: dos bloques (Organización e Inscripción) con una tarjeta por apartado */
.ck-lanes { display: grid; gap: 20px; }
.ckl { padding: 18px 20px 20px; border-radius: 14px; background: var(--surface); border-top: 6px solid var(--text); }
.ckl--participants { border-top-color: var(--senal); }
.ckl__head { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.ckl__title { margin: 0; font-size: 1.75rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; }
.ckl__hint { margin: 2px 0 0; color: var(--muted); font-size: 0.9375rem; }
.ckl__progress { display: grid; gap: 6px; min-width: min(100%, 16rem); }
.ckl__count { margin: 0; font-size: 0.9375rem; text-align: right; }
.ckl__bar { width: 100%; height: 8px; display: block; }
.ckl__bar-base { fill: var(--line); }
.ckl__bar-fill { fill: var(--ok-text); }
.ckl__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ck-item { display: flex; min-width: 0; }
.ck { display: grid; flex: 1; align-content: start; gap: 4px; min-width: 0; min-height: 6.5rem; padding: 12px 14px; border: 1.5px solid var(--line); border-left: 6px solid var(--flag); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; transition: box-shadow 0.15s, border-color 0.15s; }
.ck:hover { border-color: var(--text); border-left-color: var(--flag); box-shadow: 0 8px 18px -14px rgb(27 36 48 / 0.7); }
.ck:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ck__state { display: flex; align-items: center; gap: 0; color: var(--muted); font-size: 0.8125rem; font-weight: 700; }
.ck__title { font-size: 1.1875rem; font-weight: 800; line-height: 1.2; }
.ck__text { color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.ck--red { background: var(--error-bg); }
.ck--red .ck__state, .ck--red .ck__text { color: var(--error-text); }
.ck--yellow { background: var(--warn-bg); }
.ck--yellow .ck__state, .ck--yellow .ck__text { color: var(--warn-text); }
.ck--grey { border-left-color: var(--input-border); background: transparent; }
.ck--grey .ck__title { color: var(--muted); }
.ckl__public { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; }

@media (max-width: 860px) {
  .evnav { grid-template-columns: minmax(0, 1fr); }
  .evnav__home { grid-row: auto; place-items: start; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .evnav__lane { grid-template-columns: minmax(0, 1fr); }
  .ckl { padding: 14px 12px 16px; }
  .ckl__count { text-align: left; }
  .ckl__progress { width: 100%; }
  .ck { min-height: 0; }
}

/* Ficha del inscrito: derechos de inscripción que no cuadran con la categoría */
.entry-adjust { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin: 12px 0; padding: 12px 16px; border-left: 4px solid var(--senal); border-radius: var(--radius-control); background: var(--warn-bg); }
.entry-adjust__text { margin: 0; max-width: 72ch; font-size: 0.9375rem; }
.entry-adjust form { margin: 0 !important; }
.crew__warn { padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); font-size: 0.8125rem; font-weight: 700; text-decoration: none; }
.crew__warn:hover { text-decoration: underline; }

/* Ficha del inscrito: confirmar o rechazar */
.decide { display: grid; justify-items: end; gap: 6px; margin-top: 8px; }
.decide form { margin: 0; }
.decide__ok { height: 38px; padding: 0 16px; font-size: 0.9375rem; }
.decide__reject { text-align: right; }
.decide__reject > summary { list-style: none; cursor: pointer; color: var(--error-text); font-size: 0.875rem; }
.decide__reject > summary::-webkit-details-marker { display: none; }
.decide__reject form { display: grid; gap: 8px; width: min(26rem, 80vw); margin-top: 8px !important; text-align: left; }
.decide__note { margin: 0; max-width: 26rem; color: var(--muted); font-size: 0.8125rem; text-align: right; }
.decide__note--red { color: var(--error-text); font-weight: 600; }
.field__input--number { max-width: 8rem; font-size: 1.4rem; font-stretch: 75%; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .decide, .decide__reject, .decide__note { justify-items: start; text-align: left; } }

/* ---------- Dorsales: tablero por categoría ---------- */
.numbers-pending { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin: 16px 0 0; padding: 14px 18px; border-left: 4px solid var(--senal); border-radius: var(--radius-control); background: var(--warn-bg); }
.numbers-pending__title { margin: 0; font-size: 1.15rem; font-weight: 800; }
.numbers-pending__who { margin: 4px 0 0; font-size: 0.9375rem; }
.numbers-pending__who a { color: var(--text); }
.numbers-pending form { margin: 0; }
.nboard { margin-top: 20px; padding: 18px 20px; border-radius: var(--radius-control); background: var(--surface); }
.nboard__head { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: end; justify-content: space-between; margin-bottom: 14px; }
.nboard__title { margin: 0; font-size: 1.6rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; }
.nboard__range { margin: 2px 0 0; color: var(--muted); font-size: 0.9375rem; }
.nboard__stats { display: flex; gap: 20px; margin: 0; }
.nboard__stats div { display: grid; }
.nboard__stats dt { color: var(--muted); font-size: 0.75rem; }
.nboard__stats dd { margin: 0; font-size: 1.4rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; }
.nst--reserved dd { color: var(--warn-text); }
.nboard__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 0; }
.nplate { display: grid; place-items: center; height: 2.2rem; border-radius: 5px; font-size: 1.05rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; text-decoration: none; }
.nplate--taken { border: 2px solid var(--asfalto); background: var(--papel); color: var(--asfalto); }
a.nplate--taken:hover { background: var(--asfalto); color: var(--papel); }
.nplate--reserved { border: 2px solid var(--senal); background: var(--senal); color: var(--asfalto); }
.nplate--free { border: 1.5px dashed var(--line); color: var(--muted); font-weight: 600; }
.nplate--inline { display: inline-grid; min-width: 3rem; padding: 0 6px; margin: 0 6px 6px 0; }
.nplate--legend { display: inline-grid; width: 2.4rem; height: 1.6rem; font-size: 0.875rem; vertical-align: middle; }
.numbers-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.numbers-tools > .panel { max-width: none; margin-top: 0; }
.numbers-tools .side-form { margin-top: 12px; }
.nt-range-title { margin-top: 26px; }
.res-list { list-style: none; margin: 12px 0 0; padding: 0; }
.res-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.res-list .nplate--inline { margin: 0; }
.res-list__text a { color: var(--text); font-weight: 600; }
.res-list__note { display: block; color: var(--muted); font-size: 0.8125rem; }
.res-list form { margin: 0 !important; }
.nb-outside { margin-top: 20px; }
@media (max-width: 860px) { .numbers-tools { grid-template-columns: 1fr; } }

/* ---------- «Tu trabajo»: portada del personal de los clientes ---------- */
.work { margin-top: 22px; }
.work__head { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.work__title { margin: 0; font-size: 1.7rem; font-stretch: 62%; font-weight: 800; }
.work__links { display: flex; gap: 14px; margin: 0; font-size: 0.9375rem; }
.work__links a { color: var(--muted); }
.work__event { margin-top: 10px; padding: 16px 20px; border-left: 4px solid var(--senal); border-radius: var(--radius-control); background: var(--surface); }
.work__event-name { margin: 0; font-size: 1.2rem; font-weight: 700; }
.work__event-name a { color: var(--text); text-decoration: none; }
.work__event-name a:hover { text-decoration: underline; }
.work__event-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.9375rem; }
.work__todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.work__todo a { display: block; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-control); color: var(--text); text-decoration: none; }
.work__todo strong { font-size: 1.5rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 4px; }
.work__todo .is-due a { border-color: var(--senal); background: var(--warn-bg); }
.work__todo .is-done a { color: var(--muted); }
.work__todo a:hover { border-color: var(--text); }
.work__note { margin: 10px 0 0; color: var(--muted); font-size: 0.875rem; }

/* ---------- Tareas: búsqueda y semillas ---------- */
.task-search { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.task-search .field__input { flex: 1 1 18rem; height: 42px; }
.seeds { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.seed-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0 6px; }
.seed { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 9px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--text); font-size: 0.875rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.seed::before { content: ""; width: 7px; height: 9px; border-radius: 50% 50% 50% 0; background: var(--ok-text); transform: rotate(-45deg); }
.seed span { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.seed:hover { border-color: var(--text); }
.seed.is-on { border-color: var(--text); background: var(--text); color: var(--surface); }
.seed.is-on span { color: inherit; opacity: 0.75; }
.seed--small { padding: 0 8px 0 7px; font-size: 0.75rem; font-weight: 500; }
.seed--title { font-size: 1rem; }
.task-group__count { color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.task__excerpt { margin: 4px 0 0; color: var(--muted); font-size: 0.8125rem; max-width: 80ch; }
.tasks-found { margin: 0 0 10px; color: var(--muted); font-size: 0.9375rem; }

/* ---------- Tareas: móvil primero ---------- */
/* Pastillas de orden y de realizadas */
.filters--pills { gap: 6px; margin-top: 0; }
.filters--pills a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 500; white-space: nowrap; }
.filters--pills a:hover { border-color: var(--text); }
.filters--pills a[aria-current] { border-color: var(--text); background: var(--text); color: var(--surface); font-weight: 600; }
.tasks-filters { gap: 10px 28px; margin-bottom: 4px; }
.tasks-main, .task-page > *, .task-side > * { min-width: 0; }

.task { transition: background-color 0.15s; }
.task:hover { background: color-mix(in srgb, var(--notice-bg) 55%, transparent); }
.task__title { display: inline-block; padding: 2px 0; font-size: 1.0625rem; line-height: 1.35; }

@media (max-width: 860px), (pointer: coarse) {

  /* Búsqueda */
  .task-search .field__input { flex: 1 1 100%; height: 52px; font-size: 1rem; }
  .task-search .button--inline { flex: 1 1 auto; height: 48px; justify-content: center; }
  .task-search .link-quiet { display: inline-flex; align-items: center; min-height: 48px; padding: 0 6px; }

  /* Semillas y pastillas: una fila que se desliza con el dedo */
  .filters--pills { flex-wrap: nowrap; margin-right: -16px; padding-right: 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .filters--pills::-webkit-scrollbar { display: none; }
  .filters--pills a { flex: none; scroll-snap-align: start; }
  .tasks-side { position: static; max-height: none; overflow: visible; gap: 10px; }
  .filters--pills a { min-height: 48px; }
  .tasks-filters { display: grid; gap: 8px; }

  /* Lista */
  .task { gap: 12px; padding: 12px 16px 12px 16px; }
  .task__meta { gap: 6px 10px; font-size: 0.875rem; }
  .task__title { font-size: 1.0625rem; padding: 6px 0; }
  .task__doc { display: inline-flex; align-items: center; min-height: 32px; }
  /* Chips pequeños: la zona táctil real llega a 48 px sin engordar la fila */
  .seed--small { position: relative; min-height: 28px; font-size: 0.8125rem; }
  .seed--small::after { content: ""; position: absolute; inset: -10px -4px; }
  .task-group__title { margin-bottom: 10px; font-size: 1.0625rem; }
  .task-group__title a:not(.seed) { display: inline-flex; align-items: center; min-height: 48px; }
  .tasks-main > .task-list { margin-top: 12px; }
}

@media (max-width: 640px) {
  .page-head__title { font-size: 1.75rem; }
  .page-head__lede { font-size: 0.9375rem; }
  /* Nueva tarea: botón flotante al alcance del pulgar */
  .task-new { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; height: 56px; padding: 0 22px; border-radius: 28px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
  .tasks-layout { margin-bottom: 88px; }
  .task__doc { display: none; }
}

/* Ficha de la tarea: barra inferior con la acción principal */
.task-bar { display: none; }
@media (max-width: 860px) {
  .task-bar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 10px; margin: 20px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
  .task-bar .button { flex: 1 1 auto; height: 52px; justify-content: center; margin: 0; }
  .task-head { gap: 8px; }
  .task-head .page-head__title { font-size: 1.5rem; }
  .task-doc .section-head .button--quiet, .task-data .button, .task-side .button, .task-side .link-button { min-height: 48px; }
  .task-prompt { font-size: 0.875rem; }
}

/* Feedback al enviar un formulario con data-once: el botón se apaga y gira */
form[data-sent] .button[disabled]::after { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-left: 0.6em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -0.1em; animation: task-spin 0.7s linear infinite; }
@keyframes task-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .task__toggle.is-saving .task__check::before, form[data-sent] .button[disabled]::after { animation: none; }
  .task__check::before, .task, .task-folders__hint::after { transition: none; }
}

/* ---------- Pagos: configuración, evento y saldo ---------- */
.pay-status { margin: 20px 0 16px; padding: 14px 18px; border-left: 6px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.pay-status--ok { border-left-color: var(--ok-text); }
.pay-status--none { border-left-color: var(--senal); background: var(--warn-bg); }
.pay-status__title { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.pay-status__text { margin: 2px 0 0; color: var(--muted); font-size: 0.9375rem; }

.pay-stack { display: grid; gap: 12px; max-width: 1040px; }
.pay-prov { border: 1.5px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.pay-prov[open] { border-color: var(--input-border); }
.pay-prov__head { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 68px; padding: 10px 18px; cursor: pointer; list-style: none; }
.pay-prov__head::-webkit-details-marker { display: none; }
.pay-prov__head:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-control); }
.pay-prov__name { display: grid; font-size: 1.125rem; font-weight: 700; }
.pay-prov__name small { color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.pay-prov__state { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: flex-end; }
.pay-prov__state::after { content: ""; flex: none; width: 9px; height: 9px; margin-left: 4px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
.pay-prov[open] .pay-prov__state::after { transform: rotate(-135deg); }
.pay-prov__env { padding: 1px 10px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.pay-prov__env--live { border-color: var(--bandera); color: var(--bandera); }
.pay-prov__body { display: grid; gap: 16px; padding: 4px 18px 20px; border-top: 1px solid var(--line); }
.pay-prov__body > .panel__text { margin: 12px 0 0; }
.pay-prov__body .form-grid, .pay-prov__body .field { margin-top: 0; }
.pay-opts { display: grid; gap: 6px; }
.pay-opts__title { margin: 0; font-weight: 700; }

/* Interruptor */
.switch { position: relative; display: flex; gap: 14px; align-items: flex-start; min-height: 48px; padding: 6px 0; cursor: pointer; }
.switch__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch__track { position: relative; flex: none; width: 52px; height: 32px; margin-top: 4px; border-radius: 16px; background: var(--input-border); transition: background-color 0.15s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); transition: transform 0.15s; }
.switch__input:checked + .switch__track { background: var(--ok-text); }
.switch__input:checked + .switch__track::after { transform: translateX(20px); }
.switch__input:focus-visible + .switch__track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch__text { display: grid; gap: 2px; padding-top: 6px; }
.switch__help { color: var(--muted); font-size: 0.9375rem; }

/* Entorno: pruebas o real */
.seg { display: inline-flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0; padding: 3px; border: 1.5px solid var(--line); border-radius: 999px; }
.seg__opt { position: relative; display: block; }
.seg__opt input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.seg__opt span { display: flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; color: var(--muted); font-weight: 600; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.seg__opt input:checked + span { background: var(--text); color: var(--surface); }
.seg__opt--live input:checked + span { background: var(--bandera); color: #fff; }
.seg__opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.pay-checks__title { max-width: 1040px; margin: 32px 0 0; font-size: 1.125rem; }
.pay-save { margin-top: 4px; }

/* Formas de pago del evento */
.paym-list { display: grid; gap: 10px; margin-top: 16px; }
.paym { position: relative; display: block; }
.paym__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.paym__card { display: flex; gap: 14px; align-items: center; min-height: 72px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; transition: border-color 0.15s; }
.paym__card:hover { border-color: var(--muted); }
.paym__tick { position: relative; flex: none; width: 28px; height: 28px; border: 2px solid var(--input-border); border-radius: 8px; background: var(--surface); }
.paym__body { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.paym__name { font-size: 1.0625rem; }
.paym__help { color: var(--muted); font-size: 0.9375rem; }
.paym__title { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.paym__input:checked + .paym__card { border-color: var(--text); box-shadow: inset 5px 0 0 var(--senal); }
.paym__input:checked + .paym__card .paym__tick { border-color: var(--button-bg); background: var(--button-bg); }
.paym__input:checked + .paym__card .paym__tick::after { content: ""; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid var(--button-text); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.paym__input:focus-visible + .paym__card { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Saldo de la inscripción */
.balance { margin: 14px 0 18px; padding: 16px 18px; border-left: 6px solid var(--line); border-radius: var(--radius-control); background: var(--notice-bg); }
.balance--due { border-left-color: var(--bandera); }
.balance--ok { border-left-color: var(--ok-text); }
.balance__main { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; margin: 0 0 10px; }
.balance__label { color: var(--muted); font-weight: 600; }
.balance__amount { font-size: 2.125rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.paybar { display: block; width: 100%; height: 12px; border-radius: 6px; overflow: hidden; }
.paybar__track { fill: var(--line); }
.paybar__paid { fill: var(--ok-text); }
.paybar__declared { fill: var(--senal); }
.balance__figs { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 12px 0 0; }
.balance__figs dt { color: var(--muted); font-size: 0.875rem; }
.balance__figs dd { margin: 0; font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.balance__fig--declared dd { color: var(--warn-text); }
.pay-concept { margin: 12px 0 0; color: var(--muted); font-size: 0.9375rem; }

@media (max-width: 720px) {
  .pay-envs { grid-template-columns: minmax(0, 1fr); }
  .pay-prov__head { padding: 10px 14px; }
  .pay-prov__body { padding: 4px 14px 18px; }
  .paym__card { align-items: flex-start; }
  .balance__amount { font-size: 1.875rem; }
  .seg { width: 100%; }
  .seg__opt { flex: 1 1 0; }
  .seg__opt span { justify-content: center; padding: 0 10px; text-align: center; }

  /* Cargos y cobros: cada fila pasa a ficha */
  .pay-table, .pay-table tbody, .pay-table tr, .pay-table td { display: block; }
  .pay-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .pay-table td { padding: 0; border: 0; }
  .pay-table td[colspan] { grid-column: 1 / -1; }
  .pay-table .table__num { text-align: right; font-weight: 700; }
  .pay-table .table__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; }
  .pay-table .table__actions:empty { display: none; }
  .pay-table .table__actions .doc-btn, .pay-table .table__actions .link-button { display: inline-flex; align-items: center; min-height: 48px; }
}

@media (max-width: 860px) {
  /* Guardar siempre a mano en pantallas estrechas */
  .pay-save { position: sticky; bottom: 0; z-index: 20; margin: 8px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
  .pay-save .button { width: 100%; height: 52px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .switch__track, .switch__track::after, .seg__opt span, .paym__card, .pay-prov__state::after { transition: none; }
}

.reveal-actions summary.button { display: inline-flex; align-items: center; min-height: 48px; }

/* ---------- Correo: mensajes masivos ---------- */
.mail-tabs { margin: 18px 0 20px; }
.mail-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 24px 0 12px; }
.mail-head .section-title { margin: 0; }

/* Lista de envíos */
.campaigns { display: grid; gap: 10px; margin: 0 0 8px; padding: 0; list-style: none; }
.campaign { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; padding: 14px 18px; border-left: 5px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.campaign--sending { border-left-color: var(--senal); }
.campaign--done { border-left-color: var(--ok-text); }
.campaign__main { display: grid; gap: 2px; min-width: 0; color: var(--text); text-decoration: none; }
.campaign__main:hover .campaign__subject { text-decoration: underline; }
.campaign__subject { font-size: 1.0625rem; font-weight: 700; overflow-wrap: anywhere; }
.campaign__meta { color: var(--muted); font-size: 0.875rem; }
.campaign__counts { margin: 4px 0 0; color: var(--muted); font-size: 0.875rem; }
.campaign__failed { color: var(--bandera); font-weight: 600; }
.campaign .paybar { height: 10px; }

.starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.starter { display: grid; gap: 4px; min-height: 84px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--text); text-decoration: none; }
.starter:hover { border-color: var(--text); }
.starter span { color: var(--muted); font-size: 0.9375rem; }

/* Redactar */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 24px; align-items: start; max-width: 1180px; }
.compose__main { display: grid; gap: 20px; min-width: 0; }
.step { padding: 20px; border-radius: var(--radius-control); background: var(--surface); }
.step__title { display: flex; gap: 12px; align-items: center; margin: 0 0 16px; font-size: 1.25rem; }
.step__n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--surface); font-size: 1rem; font-weight: 700; }
.step__label { margin: 0 0 6px; font-weight: 700; }
.step__field { margin-bottom: 16px; }
.step__extra { margin-top: 14px; }
.step .paym-list { margin-top: 0; }
.step .filters--pills { margin-top: 0; }

.refine { margin-top: 16px; border: 1.5px solid var(--line); border-radius: var(--radius-control); }
.refine__head { display: flex; align-items: center; min-height: 52px; padding: 0 16px; font-weight: 600; cursor: pointer; }
.refine__body { display: grid; gap: 16px; padding: 4px 16px 18px; border-top: 1px solid var(--line); }
.refine__group { margin: 12px 0 0; padding: 0; border: 0; }
.refine__group legend { margin-bottom: 8px; font-weight: 600; }
.refine__selects { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 12px; }

/* Etiquetas marcables */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chip span, .chip--btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.9375rem; font-weight: 500; cursor: pointer; }
.chip input:checked + span { border-color: var(--text); background: var(--text); color: var(--surface); font-weight: 600; }
.chip input:focus-visible + span, .chip--btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip span:hover, .chip--btn:hover { border-color: var(--text); }
.chip--btn { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.875rem; }
.vars { margin: 4px 0 16px; }
.vars__title { margin: 0 0 8px; color: var(--muted); font-size: 0.9375rem; }
.compose__body { min-height: 14rem; font-size: 1.0625rem; line-height: 1.55; }

/* Resumen */
.compose__side { position: sticky; top: 20px; display: grid; gap: 12px; }
.send-card { padding: 16px 18px; border-left: 6px solid var(--senal); border-radius: var(--radius-control); background: var(--surface); }
.send-card--test { border-left-color: var(--line); }
.send-card--test .button { margin-top: 10px; }
.send-card__count { display: flex; gap: 8px; align-items: baseline; margin: 0; }
.send-card__count strong { font-size: 2.5rem; font-stretch: 62%; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.send-card__kinds { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); }
.send-card__skipped { margin: 8px 0 0; color: var(--muted); font-size: 0.875rem; }
.send-card__sample { margin: 12px 0 0; padding: 12px 0 0 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.send-card__more { list-style: none; margin-left: -18px; }
.send-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; margin: 0; font-size: 1.0625rem; }
.send-btn[disabled] { cursor: not-allowed; }
.button.is-loading::after { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-left: 0.6em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: task-spin 0.7s linear infinite; }

/* Seguimiento */
.campaign-head { margin-bottom: 14px; }
.campaign-head .section-title { margin-bottom: 2px; overflow-wrap: anywhere; }
.paybar__fail { fill: var(--bandera); }
.balance__fig--failed dd { color: var(--bandera); }
.campaign-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.campaign-actions .button { margin: 0; }
.campaign-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; margin-top: 20px; }
.campaign-body { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 0.9375rem; line-height: 1.55; }
.recipients { margin: 12px 0 0; padding: 0; list-style: none; }
.recipient { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.recipient__who { display: grid; min-width: 0; overflow-wrap: anywhere; }
.recipient__who span, .recipient__kind { color: var(--muted); font-size: 0.875rem; }
.recipient__kind { grid-column: 1; }
.recipient .pay-chip { grid-column: 2; grid-row: 1; justify-self: end; }
.recipient__error { grid-column: 1 / -1; color: var(--bandera); font-size: 0.875rem; }
.pay-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--notice-bg); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.pay-chip--paid { color: var(--ok-text); }
.pay-chip--failed { color: var(--bandera); }

@media (max-width: 980px) {
  .compose { grid-template-columns: minmax(0, 1fr); }
  .compose__side { position: static; }
  .campaign-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .campaign { grid-template-columns: minmax(0, 1fr); }
  .campaign .badge { justify-self: start; }
  .step { padding: 16px; }
  .send-btn, .compose__side .button { min-height: 52px; }
  /* Enviar siempre a mano */
  .compose__side { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .button.is-loading::after { animation: none; }
}
.campaigns + .section-title, .campaigns ~ .section-title, .mail-head ~ .empty + .section-title { margin-top: 32px; }

/* ---------- Contactos del cliente ---------- */
.contacts-head { margin: 4px 0 14px; }
.contacts-head__sum { margin: 0; color: var(--muted); }
.contacts-head__sum strong { color: var(--text); font-size: 1.25rem; }
.contacts-tools { display: grid; gap: 12px; margin-bottom: 14px; padding: 16px; border-radius: var(--radius-control); background: var(--surface); }
.contacts-tools__search { display: flex; gap: 10px; }
.contacts-tools__search .field__input { flex: 1 1 auto; min-width: 0; }
.contacts-tools__search .button { flex: none; height: 48px; }
.contacts-tools__more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px 12px; align-items: end; }
.contacts-tools__more .field { margin: 0; }
.contacts-tools__more .button { height: 48px; margin: 0; }
.contacts-found { margin: 14px 0 10px; color: var(--muted); font-size: 0.9375rem; }

.contacts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.contact { display: grid; grid-template-columns: minmax(16rem, 1fr) minmax(0, 1.5fr) auto; gap: 14px 22px; align-items: start; padding: 16px 18px; border-radius: var(--radius-control); background: var(--surface); }
.contact--off { opacity: 0.75; }
.contact__who { display: flex; gap: 14px; min-width: 0; }
.contact__photo { flex: none; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--notice-bg); }
.contact__photo--initials { display: grid; place-items: center; color: var(--muted); font-size: 1.25rem; font-stretch: 62%; font-weight: 800; }
.contact__id { min-width: 0; }
.contact__name { margin: 0 0 2px; font-size: 1.125rem; overflow-wrap: anywhere; }
.contact__lines { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; font-size: 0.9375rem; }
.contact__lines a { display: inline-flex; align-items: center; min-height: 32px; overflow-wrap: anywhere; }
.contact__meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; }

/* Trayectoria: una placa por evento, la más reciente primero */
.trail { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trail__item { display: flex; gap: 10px; align-items: center; min-height: 52px; padding: 6px 12px 6px 6px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.trail__item:hover { border-color: var(--text); }
.trail__item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.trail__item .plate { min-width: 2.6rem; height: 2rem; font-size: 1.25rem; }
.trail__item .plate--org { font-size: 1rem; }
.trail__text { display: grid; line-height: 1.25; }
.trail__text strong { font-size: 0.9375rem; }
.trail__text span { color: var(--muted); font-size: 0.8125rem; }
.trail__item--confirmed { border-color: var(--ok-text); }
.trail__item--submitted { border-color: var(--senal); }
.trail__item--draft { border-style: dashed; }
.trail__item--rejected, .trail__item--cancelled { opacity: 0.6; }
.trail__none { margin: 14px 0 0; color: var(--muted); font-size: 0.9375rem; }

/* Preinscripción rápida */
.contact__act { justify-self: end; }
.prereg { position: relative; }
.prereg__open { display: inline-flex; align-items: center; min-height: 48px; margin: 0; white-space: nowrap; list-style: none; }
.prereg__open::-webkit-details-marker { display: none; }
.prereg[open] .prereg__open { background: var(--text); color: var(--surface); }
.prereg__form { position: absolute; right: 0; z-index: 30; display: grid; gap: 10px; width: min(24rem, 86vw); margin-top: 8px; padding: 16px; border: 1.5px solid var(--text); border-radius: var(--radius-control); background: var(--surface); box-shadow: 0 10px 28px rgba(27, 36, 48, 0.22); }
.prereg__form .button { justify-content: center; width: 100%; height: 48px; }
.prereg__none { margin: 12px 0 0; color: var(--muted); font-size: 0.875rem; text-align: right; }

.pager { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center; margin: 20px 0 0; }
.pager .button { min-height: 48px; }
.pager__info { color: var(--muted); }

@media (max-width: 1100px) {
  .contact { grid-template-columns: minmax(0, 1fr) auto; }
  .contact__trail { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 720px) {
  .contacts-tools__more { grid-template-columns: minmax(0, 1fr); }
  .contacts-tools__search .button { padding: 0 16px; }
  .contact { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .contact__trail { grid-row: auto; }
  .contact__act { justify-self: stretch; }
  .prereg__open { justify-content: center; width: 100%; }
  .prereg__form { position: static; width: auto; box-shadow: none; }
  .prereg__none { text-align: left; }
  .trail { flex-direction: column; }
  .trail__item { width: 100%; }
}

/* Configuración del cliente: el bloque CRM va debajo de los datos */
.tenant-section #crm.section-title { margin-top: 36px; }

/* ---------- Configuración del cliente ---------- */
.cfg { display: grid; gap: 16px; max-width: 1180px; }
.cfg-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 10px; }
.cfg-tile { display: grid; align-content: start; gap: 4px; min-width: 0; min-height: 96px; padding: 12px 14px; border: 1.5px solid var(--line); border-top: 5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.cfg-tile:hover { border-color: var(--input-border); border-top-color: var(--input-border); }
.cfg-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cfg-tile.is-on { border-color: var(--text); border-top-color: var(--senal); box-shadow: 0 0 0 1.5px var(--text); }
.cfg-tile__title { color: var(--muted); font-size: 0.8125rem; font-weight: 700; }
.cfg-tile__value { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 1.75rem; font-size: 1.0625rem; font-weight: 800; overflow-wrap: anywhere; }
.cfg-tile__value .badge { font-size: 0.8125rem; }
.cfg-tile__sub { color: var(--muted); font-size: 0.8125rem; }
.cfg-tile__none { color: var(--muted); font-weight: 600; }
.cfg-tile__swatches { width: 100%; max-width: 7.5rem; height: 20px; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); }
.cfg-tile__n { min-width: 1.75rem; padding: 0 6px; border-radius: 6px; background: var(--notice-bg); font-size: 1.25rem; font-stretch: 62%; text-align: center; }
.cfg-tile__n--on { background: var(--ok-bg); color: var(--ok-text); }
.cfg__flag { width: 9px; height: 9px; border-radius: 50%; background: var(--senal); box-shadow: 0 0 0 2px var(--text); }
.cfg__main { display: grid; min-width: 0; margin-top: 8px; }
.cfg__panel { display: grid; gap: 14px; min-width: 0; }
.cfg__panel[hidden] { display: none; }
.cfg__phead { display: grid; gap: 2px; }
.cfg__title { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0; font-size: 1.75rem; font-weight: 800; font-stretch: 62%; line-height: 1.15; }
.cfg__title .badge { font-stretch: 100%; }
.cfg__lead { max-width: 66ch; margin: 0; color: var(--muted); font-size: 0.9375rem; }
.cfg__card { display: block; margin: 0; padding: 22px; border-radius: 12px; background: var(--surface); }
.cfg__card .form-actions { margin-top: 20px; }
.cfg-state { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; padding: 18px 22px; border-left: 6px solid var(--ok-text); border-radius: 12px; background: var(--surface); }
.cfg-state--suspended { border-left-color: var(--senal); }
.cfg-state--archived { border-left-color: var(--input-border); }
.cfg-state__now { display: grid; gap: 6px; justify-items: start; max-width: 52ch; }
.cfg-state__now p { margin: 0; }
.cfg-state__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-state__actions form { margin: 0; }
/* El bloque de imagen y el del CRM traen sus propias tarjetas */
.cfg .branding { gap: 16px; }
.cfg .tenant-section, .cfg .panel, .cfg .form-panel { max-width: none; }
.cfg .branding__form { display: grid; gap: 14px; }
.cfg .branding__form .fieldset { margin: 0; padding: 18px 20px; border: 0; border-radius: 12px; background: var(--surface); }
.cfg .branding__form .fieldset > legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; font-size: 1.125rem; font-weight: 800; }
.cfg .branding__form .fieldset > legend + * { clear: both; }
.cfg .branding__form .form-actions { margin: 0; }

@media (max-width: 1180px) {
  .cfg .branding { grid-template-columns: minmax(0, 1fr); }
  .cfg .branding__preview { position: static; }
}
@media (max-width: 860px) {
  .cfg { gap: 12px; }
  .cfg-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cfg-tile { min-height: 84px; padding: 10px 12px; }
  .cfg__title { font-size: 1.5rem; }
  .cfg__card { padding: 16px; }
  .cfg-state { padding: 14px 16px; }
  .cfg-state__actions { width: 100%; }
  .cfg-state__actions form { flex: 1 1 auto; }
  .cfg-state__actions .button { width: 100%; height: 52px; justify-content: center; }
  .cfg__card .form-actions .button, .cfg .branding__form .form-actions .button { width: 100%; height: 52px; justify-content: center; }
  .cfg .branding__form .fieldset { padding: 14px; }
  .cfg .upload__row { flex-wrap: wrap; }
  .cfg .upload__input { flex: 1 1 100%; min-width: 0; max-width: 100%; }
}
@media (max-width: 640px) {
  .cfg-tile { min-height: 0; }
  .cfg-tile__sub { display: none; }
}

/* ---------- Móvil primero: menús desplegables, sin desbordes y márgenes mínimos ---------- */

/* Menús con varias opciones: en móvil son un solo botón con la opción actual (integra.js añade .dd--on) */
.dd__btn { display: none; }
.dd--on { display: block !important; position: relative; flex: 1 1 100% !important; width: 100%; margin-left: 0 !important; padding: 0 !important; overflow: visible !important; border: 0 !important; background: transparent !important; }
.dd--on > .dd__btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.dd--on > .dd__btn::after { content: ""; flex: none; width: 9px; height: 9px; margin-left: 4px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform 0.2s; }
.dd--on.is-open > .dd__btn::after { transform: translateY(2px) rotate(-135deg); }
.dd--on > .dd__btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.dd__k { color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.dd__v { flex: 1 1 auto; min-width: 0; margin-left: 8px; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.dd--on:not(.is-open) > :not(.dd__btn) { display: none !important; }
.dd--on.is-open { margin-bottom: 4px; border: 1.5px solid var(--text) !important; border-radius: 8px; background: var(--surface) !important; }
.dd--on.is-open > .dd__btn { border-color: transparent; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.dd--on.is-open > :not(.dd__btn) { display: grid !important; margin: 0 !important; padding: 0 !important; border: 0 !important; gap: 0 !important; grid-template-columns: minmax(0, 1fr) !important; }
.dd--on.is-open a { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 0 14px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; color: var(--text); font-size: 1rem; white-space: normal !important; }
.dd--on.is-open a[aria-current] { background: var(--notice-bg) !important; box-shadow: inset 4px 0 0 var(--senal); font-weight: 700; }
.dd--on.is-open a:hover { background: var(--notice-bg) !important; }
.dd--on.is-open li, .dd--on.is-open .evnav__lane { display: block; margin: 0; padding: 0; border: 0; }
.dd--on.is-open .evnav__label { padding: 10px 14px 2px; }
.dd--on.is-open .evnav__items { display: grid !important; }
.dd--on.is-open .evnav__home { grid-row: auto; border: 0; }

/* Nada se sale por los lados: los elementos de formulario y de texto se encogen y las palabras largas se parten */
html, body { max-width: 100%; overflow-x: clip; }
input, select, textarea, button, img, svg, video, iframe { max-width: 100%; }
.field, .field__input, .form-grid > *, .fieldset, .upload, .upload__row, .panel, .form-panel, .branding > *, .cfg__card { min-width: 0; }
.fieldset { min-inline-size: 0; }
code, pre, .table__sub, .field__help, .panel__text { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; }
.table-scroll, .table-wrap { overflow-x: auto; }

@media (max-width: 720px) {
  .console-bar { gap: 6px 12px; padding: 8px 12px; }
  .console-nav { order: 3; flex: 1 1 100%; }
  .console-bar__user { gap: 8px; }
  .console-bar__user .button { min-height: 44px; padding: 0 12px; }
  .tabs { margin-top: 10px; }
}

@media (max-width: 640px) {
  /* Márgenes mínimos: el contenido aprovecha casi todo el ancho */
  .console { padding: 12px 12px 72px; }
  .console > .message { margin: 0 0 10px; }
  .breadcrumb { margin-bottom: 6px; }
  .tenant-head { margin-bottom: 8px; }
  .tenant-section { margin-top: 10px; }
  .tabs { margin-bottom: 0; }
  .page-head { gap: 8px; }
  .page-head__title { font-size: 1.625rem; }
  .section-title { margin: 14px 0 8px; font-size: 1.25rem; }
  .form-panel, .branding__form, .panel, .step, .cfg__card, .send-card, .contacts-tools, .contact, .campaign { padding: 12px; }
  .form-panel, .panel, .branding__form { margin-top: 10px; }
  .fieldset { padding: 12px; margin-top: 12px; }
  .form-actions { margin-top: 12px; }
  .field + .field { margin-top: 12px; }
  .cfg__main { gap: 8px; }
  .cfg__body { margin-top: 8px; }
  .step { gap: 0; }
  .compose__main { gap: 10px; }
  .contacts, .campaigns, .tasks-list, .permits { gap: 8px; }
  .pay-prov__head { min-height: 56px; padding: 8px 12px; }
  .pay-prov__body { padding: 4px 12px 12px; gap: 12px; }
  .evnav { margin: 10px 0; }
  .event-head { gap: 6px; }
  .table th, .table td { padding: 8px 10px; }
}

/* Ficha del inscrito en móvil: cabecera en una columna y acciones debajo */
@media (max-width: 720px) {
  .crew { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 12px; }
  .crew__state { grid-column: 1 / -1; grid-auto-flow: row; justify-items: start; text-align: left; }
  .crew__name { font-size: 1.6rem; }
  .crew__enter { justify-content: flex-start; }
  .decide { justify-items: start; }
  .decide__note, .decide__reject { text-align: left; }
  .decide__reject form { width: 100%; }
  .task-bar { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .task__check--large { margin-left: -4px; }
}

/* Acceso (pase) y últimos ajustes de desborde */
.access-main { grid-template-columns: minmax(0, 1fr); }
.pass { min-width: 0; }
.dd--on { margin-right: 0 !important; }
@media (max-width: 640px) {
  .access-main { padding: 12px 12px 40px; }
  .pass__body { padding: 20px 16px 16px; }
  .pass__stub { padding: 14px 16px 16px; }
  .pay-save { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 860px) {
  .filters--pills { margin-right: 0; padding-right: 0; flex-wrap: wrap; }
}

/* Grupos de opciones plegables en móvil (integra.js: .pick) y calendario del evento plegable */
.pick__btn { display: none; }
.pick--on > .pick__btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--input-border); border-radius: 8px; background: var(--surface); cursor: pointer; list-style: none; }
.pick--on > .pick__btn::-webkit-details-marker { display: none; }
.pick--on > .pick__btn::after { content: ""; flex: none; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform 0.2s; }
.pick--on[open] > .pick__btn::after { transform: translateY(2px) rotate(-135deg); }
.pick--on > .pick__btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pick--on > .kind-pick, .pick--on > .chips { margin-top: 8px; padding: 6px; border: 1.5px solid var(--line); border-radius: 8px; }
.pick--on > .kind-pick > legend { display: none; }
.pick--on .chip span, .pick--on .kind-pick__opt { min-height: 44px; }
.timeline__summary { position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 44px 0 14px; border-radius: 8px; background: var(--surface); font-weight: 600; cursor: pointer; list-style: none; }
.timeline__summary::-webkit-details-marker { display: none; }
.timeline__summary::after { content: ""; position: absolute; top: 50%; right: 18px; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
.timeline[open] > .timeline__summary::after { transform: translateY(-30%) rotate(-135deg); }
.timeline__summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.timeline[open] > .timeline__summary { border-radius: 8px 8px 0 0; }

fieldset { min-width: 0; min-inline-size: 0; }
.step, .compose__main, .compose__side, .refine__body, .refine__group { min-width: 0; }

/* Grupo plegable: entra siempre plegado, en cualquier ancho */
.fold__summary { position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 44px 0 14px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 600; cursor: pointer; list-style: none; }
.fold__summary::-webkit-details-marker { display: none; }
.fold__summary::after { content: ""; position: absolute; top: 50%; right: 18px; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
.fold[open] > .fold__summary::after { transform: translateY(-30%) rotate(-135deg); }
.fold__summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fold[open] > .fold__summary { border-radius: 8px 8px 0 0; }
.fold > :not(summary) { margin-top: 8px; }
/* Cabecera del cliente más compacta en móvil */
@media (max-width: 640px) {
  .tenant-head__name { font-size: 1.5rem; line-height: 1.15; }
  .tenant-head__host { margin: 2px 0 6px; font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tenant-head__status { margin: 0 0 8px; }
  .event-head__name { font-size: 1.5rem; }
}

/* ---------- Listados: en móvil cada fila es una ficha con los datos en horizontal (título y «dato … valor») ---------- */
.table-wrap > .table:not(.req-matrix) td:first-child { min-width: 11rem; }
@media (max-width: 720px) {
  .table-wrap:has(> .table:not(.req-matrix)) { margin-top: 10px; overflow: visible; background: transparent; }
  .table-wrap > .table:not(.req-matrix), .table-wrap > .table:not(.req-matrix) tbody { display: block; }
  .table-wrap > .table:not(.req-matrix) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap > .table:not(.req-matrix) tr { display: block; margin: 0 0 8px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--surface); }
  .table-wrap > .table:not(.req-matrix) td { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; min-height: 32px; padding: 2px 0 !important; border: 0 !important; text-align: right; white-space: normal !important; }
  .table-wrap > .table:not(.req-matrix) td:first-child { display: block; min-width: 0; margin-bottom: 6px; padding: 0 0 8px !important; border-bottom: 1px solid var(--line) !important; text-align: left; font-size: 1.0625rem; }
  .table-wrap > .table:not(.req-matrix) td[data-label]:not(:first-child)::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 0.875rem; text-align: left; }
  .table-wrap > .table:not(.req-matrix) td:empty { display: none; }
  .table-wrap > .table:not(.req-matrix) .table__sub { display: block; margin-top: 2px; text-align: left; overflow-wrap: anywhere; }
  .table-wrap > .table:not(.req-matrix) .table__actions { justify-content: flex-end; padding-top: 6px !important; }
  .table-wrap > .table:not(.req-matrix) .table__link { display: inline-block; min-height: 32px; }
}
@media (max-width: 720px) {
  .table-wrap > .table:not(.req-matrix) td { flex-wrap: wrap; }
  .table-wrap > .table:not(.req-matrix) td:not(:first-child) .table__sub { flex-basis: 100%; text-align: right; }
}

/* ---------- Marcar varias filas y actuar a la vez ---------- */
.ent__pick { width: 3rem; text-align: center; }
.bulk-one, .bulk-all { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -8px; cursor: pointer; }
.bulk-one input, .bulk-all input { width: 22px; height: 22px; margin: 0; accent-color: var(--text); cursor: pointer; }
.bulk { position: sticky; bottom: 0; z-index: 25; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 10px 0 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); border: 1.5px solid var(--text); border-radius: var(--radius-control); background: var(--surface); box-shadow: 0 -6px 18px rgb(27 36 48 / 0.18); }
.bulk[hidden] { display: none; }
.bulk__count { margin: 0; font-size: 1rem; }
.bulk__count strong { font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.bulk__pending { color: var(--warn-text); font-weight: 600; }
.bulk__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk__actions .button { height: 48px; margin: 0; }
.bulk-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 10px 0 0; }
.bulk-tools .link-button { min-height: 44px; }
.decide__policy { margin: 0 0 8px; padding: 10px 12px; border-left: 4px solid var(--line); background: var(--notice-bg); font-size: 0.875rem; text-align: left; }
@media (max-width: 980px) {
  .ent__pick { position: absolute; top: 8px; right: 8px; width: auto; }
  .ent { position: relative; }
  .ent__pick:empty { display: none; }
  .bulk__actions { width: 100%; }
  .bulk__actions .button { flex: 1 1 auto; justify-content: center; }
}

/* Contactos: alta nueva, casillas y barra de preinscripción en bloque */
.contacts-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; }
.newcontact { position: relative; }
.newcontact__open { display: inline-flex; align-items: center; min-height: 48px; margin: 0; list-style: none; }
.newcontact__open::-webkit-details-marker { display: none; }
.newcontact[open] .newcontact__open { background: var(--text); color: var(--surface); }
.newcontact__form { position: absolute; right: 0; z-index: 30; display: grid; gap: 10px; width: min(34rem, 92vw); margin-top: 8px; padding: 16px; border: 1.5px solid var(--text); border-radius: var(--radius-control); background: var(--surface); box-shadow: 0 10px 28px rgb(27 36 48 / 0.22); }
.newcontact__form .form-grid { margin: 0; }
.newcontact__form .button { justify-content: center; height: 48px; }
.contact-link { display: grid; gap: 8px; margin: 0 0 12px; padding: 14px; border-left: 6px solid var(--senal); border-radius: var(--radius-control); background: var(--surface); }
.contact { position: relative; }
.contact__pick { position: absolute; top: 12px; right: 12px; margin: 0; }
.bulk--contacts { display: grid; gap: 10px; }
.bulk--contacts .bulk__fields { display: grid; gap: 10px; }
.bulk--contacts .field { margin: 0; }
@media (min-width: 981px) {
  .bulk--contacts { grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; }
}
@media (max-width: 720px) {
  .newcontact { width: 100%; }
  .newcontact__open { justify-content: center; width: 100%; }
  .newcontact__form { position: static; width: auto; box-shadow: none; }
}

/* ---------- Rutas y secciones de una etapa ---------- */
/* Color por tipo de sección (segmento de la tira, chips y lateral de la ficha). */
.rt-t--ROADBOOK { --sec: var(--text); }
.rt-t--CAP { --sec: var(--senal); }
.rt-t--SEGUIMIENTO { --sec: var(--ok-text); }
.rt-t--BUSQUEDA { --sec: var(--muted); }
.rt-t--SS { --sec: var(--bandera); }
.rt-t--none { --sec: var(--line); }

.rt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin: 0; padding: 0 18px; border: 1.5px solid var(--text); border-radius: var(--radius-control); background: transparent; color: var(--text); font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.rt-btn:hover { background: var(--notice-bg); }
.rt-btn--main { border-color: var(--button-bg); background: var(--button-bg); color: var(--button-text); }
.rt-btn--main:hover { border-color: var(--button-hover); background: var(--button-hover); }
.rt-btn--quiet { border-color: var(--input-border); }
.rt-btn--danger { border-color: transparent; color: var(--error-text); }
.rt-btn--danger:hover { background: var(--error-bg); }
.rt-btn--small { min-height: 44px; padding: 0 14px; font-size: 0.9375rem; }
.rt-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.rt-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; padding: 16px 18px; border-left: 6px solid var(--kind, var(--line)); border-radius: var(--radius-control); background: var(--surface); }
.rt-head__id { min-width: 0; }
.rt-head__title { margin: 2px 0 0; font-size: 1.9rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.rt-head__meta { margin: 6px 0 0; color: var(--muted); font-size: 0.9375rem; }
.rt-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.rt-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; padding: 0 4px; }
.rt-stats div { display: flex; align-items: baseline; gap: 8px; }
.rt-stats dt { order: 2; color: var(--muted); font-size: 0.9375rem; }
.rt-stats dd { order: 1; margin: 0; font-size: 1.7rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.rt-stats__warn dt, .rt-stats__warn dd { color: var(--warn-text); }

.rt-block { margin-top: 26px; }
.rt-block__title { margin: 0 0 10px; font-size: 1.25rem; font-weight: 700; }
.rt-lead { max-width: 70ch; margin: 16px 0 0; color: var(--muted); }
.rt-lead strong { color: var(--text); }

.rt-track { margin-top: 10px; padding: 16px 18px; border-radius: var(--radius-control); background: var(--surface); }
.rt-track__top { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.rt-track__id { min-width: 0; }
.rt-track__name { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.rt-track__file { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.rt-track__km { margin: 0; font-size: 2.1rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.rt-track__km small { font-size: 0.9rem; font-stretch: 100%; font-weight: 600; color: var(--muted); }
.rt-strip { display: block; width: 100%; height: 28px; margin-top: 14px; }
.rt-strip__base { fill: var(--line); }
.rt-strip__seg { fill: var(--sec); }
.rt-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.rt-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--text); font-size: 0.875rem; font-weight: 700; text-decoration: none; }
.rt-chip::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--sec); }
.rt-chip span { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.rt-chip:hover { border-color: var(--text); }
.rt-track__foot { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rt-track__wp { display: flex; flex: 1 1 16rem; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-width: 0; margin: 0; }
.rt-track__note { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.rt-track__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-track__actions form { margin: 0; }

.rt-add { margin-top: 10px; padding: 16px 18px; border: 1.5px dashed var(--input-border); border-radius: var(--radius-control); }
.rt-add__title { margin: 0; font-size: 1rem; font-weight: 700; }
.rt-add__help { margin: 4px 0 0; color: var(--muted); font-size: 0.9375rem; }
.rt-add__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: 12px; }
.rt-add__fields .field { min-width: 0; margin: 0; }

.rt-secs { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rt-sec { overflow: hidden; border-left: 6px solid var(--sec); border-radius: var(--radius-control); background: var(--surface); }
.rt-sec__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 16px; }
.rt-code { display: inline-grid; place-items: center; min-width: 4.6rem; height: 3rem; padding: 0 10px; border: 2px solid var(--text); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 1.7rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; text-decoration: none; }
a.rt-code:hover { background: var(--notice-bg); }
.rt-code--static { min-width: 4rem; height: 2.6rem; font-size: 1.5rem; }
.rt-sec__type { margin: 0; font-size: 1rem; font-weight: 700; }
.rt-sec__declared { margin: 2px 0 0; color: var(--muted); font-size: 0.9375rem; }
.rt-sec__declared strong { color: var(--text); font-variant-numeric: tabular-nums; }
.rt-sec__actions { display: flex; gap: 8px; }
.rt-sec__actions form { margin: 0; }
.rt-rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rt-row { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center; padding: 10px 16px; }
.rt-row + .rt-row { border-top: 1px solid var(--line); }
.rt-row__track { font-weight: 600; }
.rt-row__path { min-width: 0; overflow-wrap: anywhere; }
.rt-row__km { font-variant-numeric: tabular-nums; }
.rt-row__note { grid-column: 2 / -1; color: var(--warn-text); font-size: 0.875rem; }
.rt-row--none { color: var(--muted); }
.rt-row--review { background: var(--warn-bg); }

.rt-empty { padding: 20px; border: 1.5px dashed var(--input-border); border-radius: var(--radius-control); }
.rt-empty p { max-width: 62ch; margin: 0 0 10px; }
.rt-empty__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.rt-empty__inline { margin: 12px 0 0; color: var(--muted); }

.rt-props { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.rt-prop { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-left: 6px solid var(--sec); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; }
.rt-prop__check { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rt-prop__box { position: relative; width: 28px; height: 28px; margin-top: 4px; border: 2px solid var(--input-border); border-radius: 6px; background: var(--surface); }
.rt-prop__check:checked + .rt-prop__box { border-color: var(--text); background: var(--text); }
.rt-prop__check:checked + .rt-prop__box::after { content: ""; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid var(--surface); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.rt-prop__check:focus-visible + .rt-prop__box { outline: 3px solid var(--focus); outline-offset: 2px; }
.rt-prop__check:disabled + .rt-prop__box { opacity: 0.5; }
.rt-prop:has(.rt-prop__check:not(:checked)) { opacity: 0.8; }
.rt-prop--bajo { background: var(--notice-bg); cursor: not-allowed; }
.rt-prop__main { display: grid; gap: 8px; min-width: 0; }
.rt-prop__top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.rt-prop__id { display: grid; flex: 1 1 10rem; min-width: 0; }
.rt-prop__type { color: var(--muted); font-size: 0.875rem; }
.rt-prop__path { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rt-prop__path small { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.rt-prop__arrow { color: var(--muted); }
.rt-prop__km { margin-left: auto; font-size: 1.3rem; font-stretch: 75%; font-weight: 800; font-variant-numeric: tabular-nums; }
.rt-prop__missing { color: var(--error-text); font-weight: 600; }
.rt-prop__reason { color: var(--muted); font-size: 0.875rem; }

.rt-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; padding: 12px 0; }
.rt-bar__end { margin-left: auto; }

.rt-limit { min-inline-size: 0; margin: 14px 0 0; padding: 12px 14px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-control); }
.rt-limit legend { padding: 0 6px; font-weight: 700; }
.rt-limit--review { border-color: var(--warn-text); background: var(--warn-bg); }
.rt-limit__state { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 10px; font-size: 0.9375rem; }
.rt-limit__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.rt-limit__pair .field { min-width: 0; margin: 0; }

/* Acceso destacado en la ficha de la etapa, junto a su nombre */
.stage-edit__head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.stage-edit__head .panel__title { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.rt-open { display: grid; gap: 1px; min-height: 48px; padding: 6px 16px 6px 20px; border: 2px solid var(--text); border-radius: var(--radius-control); background: var(--surface); box-shadow: inset 6px 0 0 var(--senal); color: var(--text); text-decoration: none; }
.rt-open:hover { background: var(--notice-bg); }
.rt-open__main { font-size: 1rem; font-weight: 700; }
.rt-open__sub { color: var(--muted); font-size: 0.8125rem; }

/* Botones de cada tarjeta del programa */
.leg__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.leg__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--input-border); border-radius: var(--radius-control); background: transparent; color: var(--text); font-size: 0.9375rem; font-weight: 600; text-decoration: none; }
.leg__btn:hover { background: var(--notice-bg); }
.leg__btn--routes { border-color: var(--button-bg); background: var(--button-bg); color: var(--button-text); }
.leg__btn--routes:hover { background: var(--button-hover); }
.leg__count { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 6px; border-radius: 999px; background: var(--senal); color: var(--asfalto); font-size: 0.8125rem; font-weight: 800; }
.leg__review { padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); font-size: 0.75rem; font-weight: 700; }

@media (max-width: 720px) {
  .rt-head { padding: 14px; }
  .rt-head__title { font-size: 1.6rem; }
  .rt-head__actions { width: 100%; }
  .rt-head__actions .rt-btn { flex: 1 1 auto; }
  .rt-track { padding: 14px; }
  .rt-track__foot { align-items: stretch; }
  .rt-track__actions { width: 100%; }
  .rt-track__actions form { flex: 1 1 auto; }
  .rt-track__actions .rt-btn { width: 100%; min-height: 48px; }
  .rt-add__fields { grid-template-columns: minmax(0, 1fr); }
  .rt-sec__head { grid-template-columns: auto minmax(0, 1fr); }
  .rt-sec__actions { grid-column: 1 / -1; }
  .rt-sec__actions > * { flex: 1 1 0; }
  .rt-sec__actions .rt-btn { width: 100%; min-height: 48px; }
  .rt-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 14px; }
  .rt-row__track { grid-column: 1 / -1; color: var(--muted); font-size: 0.875rem; }
  .rt-row .badge { grid-column: 1 / -1; justify-self: start; }
  .rt-row__note { grid-column: 1 / -1; }
  .rt-limit__pair { grid-template-columns: minmax(0, 1fr); }
  .rt-bar { position: sticky; bottom: 0; z-index: 20; margin-inline: -12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .rt-bar .rt-btn { flex: 1 1 auto; }
  .stage-edit__head .rt-open { width: 100%; }
  .leg__btn { flex: 1 1 auto; justify-content: center; min-height: 48px; }
}

/* ---------- Autorizados (lista oficial) e importación de inscritos ---------- */
.badge--external { background: var(--notice-bg); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--input-border); }

.az-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.az-head__title { margin: 0; font-size: 2rem; font-stretch: 62%; font-weight: 800; line-height: 1.05; }
.az-head__meta { max-width: 70ch; margin: 6px 0 0; color: var(--muted); }
.az-head__meta strong { color: var(--text); }
.az-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Lo que pasaría al generar: la pieza principal de la pantalla */
.az-sync { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px 28px; align-items: center; margin-top: 16px; padding: 16px 20px; border-radius: var(--radius-control); background: var(--surface); box-shadow: inset 6px 0 0 var(--ok-text); }
.az-sync--pending { box-shadow: inset 6px 0 0 var(--senal); }
.az-sync__title { margin: 0; font-size: 1.125rem; font-weight: 700; }
.az-sync__help { max-width: 60ch; margin: 4px 0 0; color: var(--muted); font-size: 0.9375rem; }
.az-sync__nums { display: flex; gap: 22px; margin: 0; }
.az-sync__nums div { display: grid; justify-items: center; }
.az-sync__nums dt { order: 2; color: var(--muted); font-size: 0.8125rem; }
.az-sync__nums dd { order: 1; margin: 0; font-size: 2.2rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.az-sync__in dd { color: var(--ok-text); }
.az-sync__out dd { color: var(--error-text); }
.az-sync__go { margin: 0; }

.az-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; align-items: start; margin-top: 12px; }
.az-panel { min-width: 0; padding: 0; background: transparent; }
.az-panel > :not(summary) { margin-right: 14px; margin-left: 14px; }
.az-panel[open] { padding-bottom: 12px; border-radius: var(--radius-control); background: var(--surface); }
.az-panel[open] > .fold__summary { border-color: transparent; }
.az-panel__text { max-width: 62ch; margin: 8px 0 0; color: var(--muted); font-size: 0.9375rem; }
.az-panel form { margin: 0; }
.az-rules { display: grid; gap: 2px; min-inline-size: 0; margin: 8px 0 12px; padding: 0; border: 0; }
.az-rule { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.az-rule input { width: 22px; height: 22px; margin: 0; accent-color: var(--text); }
.az-count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--notice-bg); font-size: 0.8125rem; font-weight: 800; vertical-align: 2px; }
.az-nonum { color: var(--text); }
.az-left { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.az-left li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.az-left__who { display: grid; min-width: 0; }
.az-left__who a { color: var(--text); font-weight: 600; }
.az-left__why { color: var(--warn-text); font-size: 0.875rem; overflow-wrap: anywhere; }
.az-left__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.az-left__actions form { margin: 0; }

.az-list { margin-top: 18px; }
.az-table th, .az-table td { padding-right: 8px; padding-left: 8px; vertical-align: middle; }
.az-table th { vertical-align: bottom; line-height: 1.2; }
.az-table td { min-width: 0; }
.az-table .plate { min-width: 2.6rem; height: 2rem; font-size: 1.35rem; }
.table-wrap > .az-table td:first-child { min-width: 0; }
.az-table td:nth-child(-n+3), .az-table td:nth-child(10) { width: 1%; white-space: nowrap; }
.az-table td:nth-child(n+4):nth-child(-n+6) { min-width: 7rem; }
.az-table td:nth-child(n+7):nth-child(-n+9) { min-width: 4.5rem; }
.az-tag { white-space: nowrap; }
.az-num { width: 1%; }
.az-empty { color: var(--muted); }
.az-tag { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); font-size: 0.75rem; font-weight: 700; vertical-align: 1px; }
.az-out { margin-top: 26px; padding: 4px 18px 10px; border-radius: var(--radius-control); background: var(--surface); opacity: 0.92; }
.az-out .rt-block__title { margin-top: 12px; }
.az-reset { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 28px; color: var(--muted); font-size: 0.875rem; }

.az-plate { margin-right: 10px; vertical-align: middle; }
.az-form { display: grid; gap: 12px; margin-top: 14px; }
.az-form .panel { max-width: none; margin-top: 0; }
.az-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.az-form__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.az-form__row .field { min-width: 0; margin: 0; }
.az-form__block > .field { margin-top: 12px; }
.az-more { display: grid; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.az-more form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0; color: var(--muted); font-size: 0.875rem; }
.az-more__reason { flex: 1 1 18rem; max-width: 28rem; }

.imp-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: imp; }
.imp-steps__step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 0.9375rem; font-weight: 600; counter-increment: imp; }
.imp-steps__step::before { content: counter(imp); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--notice-bg); color: var(--text); font-weight: 800; }
.imp-steps__step.is-current { background: var(--button-bg); color: var(--button-text); }
.imp-steps__step.is-current::before { background: var(--senal); color: var(--asfalto); }
.imp-upload { display: grid; gap: 12px; justify-items: start; max-width: 46rem; margin-top: 18px; }
.imp-drop { width: 100%; min-height: 8rem; font-size: 1rem; }
.imp-upload__help { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.imp-help { max-width: 46rem; margin-top: 18px; }
.imp-help__list { display: grid; gap: 6px; margin: 10px 0 0; padding-left: 18px; font-size: 0.9375rem; }
.imp-file { max-width: 70ch; margin: 16px 0 0; }
.imp-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.imp-col { display: grid; gap: 8px; align-content: start; padding: 12px 14px; border-left: 5px solid var(--text); border-radius: var(--radius-control); background: var(--surface); }
.imp-col--off { border-left-color: var(--line); }
.imp-col--off .imp-col__title { color: var(--muted); }
.imp-col__head { display: grid; gap: 2px; min-width: 0; }
.imp-col__title { font-weight: 700; overflow-wrap: anywhere; }
.imp-col__sample { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.imp-result { display: flex; flex-wrap: wrap; gap: 12px 36px; margin: 18px 0 0; padding: 16px 20px; border-radius: var(--radius-control); background: var(--surface); }
.imp-result div { display: grid; }
.imp-result dt { color: var(--muted); font-size: 0.9375rem; }
.imp-result dd { margin: 0; font-size: 2.6rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.imp-result__ok dd { color: var(--ok-text); }
.imp-result__bad dd { color: var(--error-text); }
.imp-msgs { margin-top: 14px; padding-top: 12px; }
.imp-msgs__list { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.imp-msg { padding: 8px 0 8px 12px; border-top: 1px solid var(--line); border-left: 4px solid var(--senal); font-size: 0.9375rem; }
.imp-msg--error { border-left-color: var(--bandera); }
.imp-msg__row { margin-right: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .az-grid { grid-template-columns: minmax(0, 1fr); }
  .az-sync { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .az-head__actions { width: 100%; }
  .az-head__actions .rt-btn { flex: 1 1 auto; }
  .az-sync { padding: 14px; }
  .az-sync__nums { justify-content: space-around; }
  .az-sync__go .rt-btn { width: 100%; }
  .az-left li { grid-template-columns: auto minmax(0, 1fr); }
  .az-table td:nth-child(n) { width: auto; min-width: 0; white-space: normal; }
  .az-left__actions { grid-column: 1 / -1; }
  .az-left__actions form, .az-left__actions .rt-btn { flex: 1 1 auto; width: 100%; }
  .az-form__row, .az-form__row--3 { grid-template-columns: minmax(0, 1fr); }
  .az-more form .rt-btn { width: 100%; }
  .imp-upload .rt-btn { width: 100%; }
}
/* Autorizados en móvil: la ficha empieza por la placa del dorsal y el piloto, no por el ID GPS */
@media (max-width: 720px) {
  .table-wrap > .table.az-table tr { display: flex; flex-direction: column; }
  .table-wrap > .table.az-table td:first-child { display: flex; margin-bottom: 0; padding: 2px 0 !important; border-bottom: 0 !important; font-size: 1rem; text-align: right; }
  .table-wrap > .table.az-table td:first-child::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 0.875rem; text-align: left; }
  .table-wrap > .table.az-table td:nth-child(3) { order: -2; justify-content: flex-start; }
  .table-wrap > .table.az-table td:nth-child(3)::before { display: none; }
  .table-wrap > .table.az-table td:nth-child(5) { order: -1; justify-content: flex-start; margin-bottom: 6px; padding-bottom: 8px !important; border-bottom: 1px solid var(--line) !important; font-size: 1.125rem; text-align: left; }
  .table-wrap > .table.az-table td:nth-child(5)::before { display: none; }
}

/* Ficha del inscrito: nombre del equipo y nacionalidades */
.crew__team { margin: 0 0 2px; color: var(--muted); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.01em; }
.ent__teamname { display: block; color: var(--muted); font-size: 0.8125rem; font-weight: 700; }
.nat-list { display: grid; gap: 8px; min-inline-size: 0; margin: 14px 0 0; padding: 0; border: 0; }
.nat-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 12rem); gap: 8px 12px; align-items: center; }
.nat-row__who { display: grid; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.nat-row__who span { color: var(--muted); font-size: 0.8125rem; font-weight: 400; }
@media (max-width: 720px) { .nat-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* Autorizados: nacionalidad junto al nombre y ficha de cada persona */
.az-nat { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1.5px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 0.75rem; font-weight: 700; line-height: 1.5; vertical-align: 1px; }
.az-person { display: grid; gap: 8px; min-width: 0; }
.az-person .field { margin: 0; }

/* Autorizados en escritorio: 13 columnas con anchos fijos para que quepan sin desplazar */
@media (min-width: 981px) {
  .table-wrap > .table.az-table { width: 100%; table-layout: fixed; font-size: 0.875rem; }
  .az-table th, .az-table td { min-width: 0 !important; width: auto; white-space: normal !important; overflow-wrap: break-word; }
  .az-table th { overflow-wrap: normal; }
  .az-table .rt-btn { white-space: nowrap; }
  .az-table th:nth-child(1) { width: 7%; }
  .az-table th:nth-child(2) { width: 7%; }
  .az-table th:nth-child(3) { width: 6.5%; }
  .az-table th:nth-child(4) { width: 10%; }
  .az-table th:nth-child(5) { width: 11%; }
  .az-table th:nth-child(6) { width: 10%; }
  .az-table th:nth-child(7), .az-table th:nth-child(8), .az-table th:nth-child(9) { width: 7%; }
  .az-table th:nth-child(10) { width: 9%; }
  .az-table th:nth-child(11) { width: 5%; }
  .az-table th:nth-child(12) { width: 7.5%; }
  .az-table th:nth-child(13) { width: 7.5%; }
  .az-table .plate { min-width: 2.4rem; height: 1.9rem; font-size: 1.2rem; }
  .az-table .rt-btn--small { min-height: 40px; padding: 0 10px; }
}

/* Borrado de inscripciones: marcado rápido en la lista y pantalla de revisión */
.button--danger-solid { background: var(--bandera); color: #fff; }
.button--danger-solid:hover { background: #a82020; }
.bulk-pick { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-control); background: var(--surface); }
.bulk-pick > summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.bulk-pick .field__help { margin: 4px 0 0; }
.bulk-pick__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.bulk-pick__btn { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--input-border); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.bulk-pick__btn:hover { border-color: var(--text); background: var(--notice-bg); }
.bulk-pick__btn span { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.bulk-pick__cat { flex: 1 1 14rem; max-width: 22rem; }
.bulk-pick__cat select { min-height: 44px; }
.bulk__actions .button--danger-solid { border: 0; }
@media (max-width: 720px) {
  .bulk-pick { padding: 10px 12px; }
  .bulk-pick__cat { max-width: none; width: 100%; }
}

.del-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-end; justify-content: space-between; padding: 16px 18px; border-left: 6px solid var(--bandera); border-radius: var(--radius-control); background: var(--surface); }
.del-head__title { margin: 0; font-size: 1.9rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; }
.del-head__lead { max-width: 64ch; margin: 6px 0 0; color: var(--muted); }
.del-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; padding: 0 4px; }
.del-stats div { display: flex; align-items: baseline; gap: 8px; }
.del-stats dt { order: 2; color: var(--muted); font-size: 0.9375rem; }
.del-stats dd { order: 1; margin: 0; font-size: 1.9rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.del-stats__bad dd { color: var(--error-text); }
.del-block { margin-top: 20px; }
.del-block__title { margin: 0 0 8px; font-size: 1.125rem; font-weight: 700; }
.del-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.del-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 12px 14px; border-radius: var(--radius-control); background: var(--surface); }
.del-item--blocked { box-shadow: inset 5px 0 0 var(--senal); }
.del-item__who { display: grid; min-width: 0; }
.del-item__name { font-weight: 700; overflow-wrap: anywhere; }
.del-item__name a { color: var(--text); }
.del-item__sub { color: var(--muted); font-size: 0.875rem; }
.del-item__with { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.del-item__with li { padding: 1px 10px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 0.8125rem; }
.del-item__with .is-warn { border-color: var(--warn-text); color: var(--warn-text); }
.del-item__why { margin: 6px 0 0; color: var(--warn-text); font-size: 0.9375rem; font-weight: 600; }
.del-keeps { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-control); background: var(--notice-bg); font-size: 0.9375rem; }
.del-keeps p { margin: 0; max-width: 70ch; }
.del-form { display: grid; gap: 14px; margin-top: 20px; padding: 16px 18px; border: 2px solid var(--bandera); border-radius: var(--radius-control); background: var(--surface); }
.del-form__check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; font-weight: 600; }
.del-form__check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--bandera); }
.del-form__word { max-width: 20rem; }
.del-form__word .field__input { text-transform: uppercase; letter-spacing: 0.08em; }
.del-form__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 720px) {
  .del-head { padding: 14px; }
  .del-head__title { font-size: 1.6rem; }
  .del-form__actions .rt-btn { flex: 1 1 auto; }
}
.rt-btn--delete { border-color: var(--bandera); background: var(--bandera); color: #fff; }
.rt-btn--delete:hover { border-color: #a82020; background: #a82020; }
.side-form--danger { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.link-button--danger { color: var(--error-text); font-size: 0.9375rem; min-height: 44px; }

/* Waypoints de una sección */
.wpt-tracks { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.wpt-tracks__tab { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--input-border); border-radius: 999px; color: var(--text); font-weight: 600; text-decoration: none; }
.wpt-tracks__tab span { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.wpt-tracks__tab.is-on { border-color: var(--button-bg); background: var(--button-bg); color: var(--button-text); }
.wpt-tracks__tab.is-on span { color: inherit; opacity: 0.8; }
.wpt-name { font-size: 1.1rem !important; font-stretch: 75% !important; overflow-wrap: anywhere; }
.wpt-form { margin-top: 14px; }
.wpt-table td { vertical-align: middle; }
.wpt-table input.field__input { min-height: 44px; padding: 6px 10px; font-size: 1rem; }
.wpt-km { max-width: 7.5rem; text-align: right; }
.wpt-sec { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.wpt-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; min-height: 0; }
.wpt-badges:empty { display: none; }
.wpt-row--start { box-shadow: inset 5px 0 0 var(--ok-text); }
.wpt-row--end { box-shadow: inset 5px 0 0 var(--bandera); }
.wpt-remove { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; cursor: pointer; font-size: 0.9375rem; }
.wpt-remove input { width: 22px; height: 22px; margin: 0; accent-color: var(--bandera); }
.wpt-new { margin-top: 12px; padding: 4px 18px 14px; }
.wpt-new__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.wpt-new__grid .field { margin: 0; min-width: 0; }
.wpt-out { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-control); background: var(--surface); }
.wpt-out__list { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.wpt-summary { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.wpt-summary li { display: grid; grid-template-columns: minmax(7rem, auto) auto minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.wpt-summary__track { font-weight: 700; }
.wpt-summary__n { color: var(--muted); font-variant-numeric: tabular-nums; }
.wpt-summary__ends { min-width: 0; overflow-wrap: anywhere; }
.rt-row__wps { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
@media (min-width: 981px) {
  .table-wrap > .table.wpt-table { width: 100%; table-layout: fixed; }
  .wpt-table th:nth-child(1) { width: 23%; }
  .wpt-table th:nth-child(2), .wpt-table th:nth-child(3) { width: 10.5%; }
  .wpt-table th:nth-child(4) { width: 9.5%; }
  .wpt-table th:nth-child(5) { width: 8.5%; }
  .wpt-table th:nth-child(6) { width: 10%; }
  .wpt-table th:nth-child(7) { width: 17%; }
  .wpt-table th:nth-child(8) { width: 11%; }
  .wpt-table th { white-space: nowrap; }
  .wpt-table td { min-width: 0 !important; padding-right: 6px; padding-left: 6px; }
  .wpt-km { max-width: none; }
}
@media (max-width: 980px) {
  .wpt-new__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wpt-summary li { grid-template-columns: minmax(0, 1fr) auto; }
  .wpt-summary__ends { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .wpt-new__grid { grid-template-columns: minmax(0, 1fr); }
  .wpt-table td input.field__input { flex: 1 1 8rem; min-width: 0; max-width: none; text-align: left; }
  .wpt-table td:first-child { display: grid !important; }
  .wpt-table td:first-child input { width: 100%; }
}
.stage-edit__wide { grid-column: 1 / -1; max-width: none; }
@media (max-width: 720px) {
  .table-wrap > .table.wpt-table td:first-child { display: grid !important; grid-template-columns: minmax(0, 1fr); text-align: left; }
  .table-wrap > .table.wpt-table td:first-child input.field__input { width: 100%; max-width: none; flex: none; }
  .wpt-table td[data-label] input.field__input { flex: 1 1 10rem; max-width: none; }
}

/* Sección: datos y límites arriba, waypoints editables debajo */
.sec-id { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.sec-id__code { height: 3.4rem; min-width: 5rem; font-size: 1.9rem; }
.sec-data__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.sec-data__grid .field { margin: 0; min-width: 0; }
.stage-edit__data .field + .field { margin-top: 12px; }
.sec-wps { margin-top: 4px; }
.sec-wps__title { margin: 12px 0 4px; font-size: 1.375rem; font-weight: 700; }
.sec-wps__lead { max-width: 70ch; margin: 0 0 10px; color: var(--muted); font-size: 0.9375rem; }
.sec-track { margin-top: 12px; padding: 4px 18px 16px; border-radius: var(--radius-control); background: var(--surface); }
.sec-track__summary { list-style: none; }
.sec-track__head { margin: 12px 0 10px; }
.sec-track__title { margin: 0; font-size: 1.125rem; font-weight: 700; }
.sec-track__ends { margin: 2px 0 0; color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.sec-track__ends strong { color: var(--text); }
.sec-track__out { margin: 0; font-size: 1rem; font-weight: 700; }
.sec-track__reset { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 14px 0 0; color: var(--muted); font-size: 0.875rem; }
.sec-track .wpt-new { margin-top: 12px; padding: 0; }
.wpt-new__summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.sec-track .wpt-out { margin-top: 12px; padding: 12px 14px; background: var(--notice-bg); }
@media (min-width: 861px) {
  .sec-track__summary { display: none; }
  .sec-track:not([open]) { padding-bottom: 4px; }
}
@media (max-width: 860px) {
  .sec-track { padding: 0; background: transparent; }
  .sec-track__head { display: none; }
  .sec-track[open] > :not(summary) { margin-right: 0; margin-left: 0; }
  .sec-track > .table-wrap, .sec-track > .wpt-new, .sec-track > .wpt-out, .sec-track > .sec-track__reset, .sec-track > .message, .sec-track > .rt-empty { margin-top: 8px; }
  .sec-data__grid { grid-template-columns: minmax(0, 1fr); }
}
.rt-row__ends { display: block; color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.rt-row__ends i { font-style: normal; }
.rt-sec__actions .rt-btn--main { white-space: nowrap; }
.rt-form { margin-top: 12px; }
.sec-data__grid { align-items: start; }
.sec-data__help { margin: 8px 0 0; }
.stage-edit__data .sec-data__grid .field + .field { margin-top: 0; }
.sec-data__help + .field { margin-top: 14px; }

/* Rutas de una etapa (una por categoría o grupo de categorías) */
.rte-lead { max-width: 72ch; margin: 10px 0 0; color: var(--muted); font-size: 0.9375rem; }
.rte-lead strong { color: var(--text); }
.rte { margin-top: 16px; padding: 18px 20px; border-radius: var(--radius-control); background: var(--surface); box-shadow: inset 6px 0 0 var(--line); }
.rte--main { box-shadow: inset 6px 0 0 var(--text); }
.rte__head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; }
.rte__id { min-width: 0; flex: 1 1 22rem; }
.rte__name { margin: 0; font-size: 1.6rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; }
.rte__tag { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--text); color: var(--surface); font-size: 0.8125rem; font-stretch: 100%; font-weight: 700; vertical-align: 4px; }
.rte__cats { margin: 6px 0 0; color: var(--muted); font-size: 0.9375rem; }
.rte__cat { display: inline-block; margin: 2px 2px 0 0; padding: 1px 10px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--text); font-size: 0.875rem; font-weight: 600; }
.rte__muted { color: var(--muted); }
.rte__token { display: grid; gap: 2px; }
.rte__token-label { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.rte__token-row { display: flex; gap: 8px; align-items: center; }
.rte__token-value { width: 7.2rem; min-height: 44px; padding: 0 10px; border: 1.5px dashed var(--input-border); border-radius: var(--radius-control); background: var(--bg); color: var(--text); font: inherit; font-size: 1.6rem; font-stretch: 75%; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.12em; text-align: center; }
.rte__token-help { color: var(--muted); font-size: 0.75rem; }
.rte__files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.rte__files dt { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.rte__files dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 0.9375rem; }
.rte__files .badge { margin-left: 4px; }
.rte__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.rte__actions form { margin: 0; }
.rte__del { margin-left: auto !important; }
.rte__empty { margin: 14px 0 0; color: var(--muted); font-size: 0.9375rem; }
.rte__secs { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rte-sec { display: grid; grid-template-columns: auto minmax(8rem, 0.8fr) minmax(0, 1.4fr) auto auto; gap: 6px 16px; align-items: center; padding: 10px 0 10px 12px; border-bottom: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--sec); }
.rte-sec--review { background: var(--warn-bg); }
.rte-sec__code { min-width: 4.4rem; height: 2.6rem; font-size: 1.4rem; }
.rte-sec__id, .rte-sec__wps { display: grid; min-width: 0; }
.rte-sec__wps a { color: var(--text); }
.rte-sec__ends { font-size: 0.8125rem; overflow-wrap: anywhere; }
.rte-sec__km { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.rte-sec__open { white-space: nowrap; }
.rf { display: grid; gap: 12px; margin-top: 12px; }
.rf .panel { max-width: none; margin-top: 0; }
.rf__cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 6px 16px; min-inline-size: 0; margin: 12px 0 0; padding: 0; border: 0; }
.rf__cat { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.rf__cat input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--text); }
.rf__cat span { display: grid; }
.rf__cat small { color: var(--muted); }
.rf__cat:has(input:checked) { border-color: var(--text); }
.rf__cat--off { opacity: 0.6; cursor: not-allowed; }
.rf__choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-inline-size: 0; margin: 12px 0; padding: 0; border: 0; }
.rf__opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.rf__opt input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--text); }
.rf__opt span { display: grid; gap: 2px; }
.rf__opt small { color: var(--muted); overflow-wrap: anywhere; }
.rf__opt:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
@media (max-width: 980px) {
  .rte-sec { grid-template-columns: auto minmax(0, 1fr) auto; }
  .rte-sec__wps { grid-column: 2 / -1; }
  .rte-sec__km { grid-column: 1 / 3; justify-content: flex-start; }
}
@media (max-width: 720px) {
  .rte { padding: 14px; }
  .rte__files, .rf__choice { grid-template-columns: minmax(0, 1fr); }
  .rte__del { margin-left: 0 !important; }
  .rte__actions .rt-btn, .rte__actions form { flex: 1 1 auto; }
  .rte__actions form .rt-btn { width: 100%; }
  .rte-sec { grid-template-columns: auto minmax(0, 1fr); padding-right: 0; }
  .rte-sec__wps, .rte-sec__km { grid-column: 1 / -1; }
  .rte-sec__open { grid-column: 1 / -1; min-height: 48px; }
}

/* Categorías del evento: árbol con precio, dorsales e inscritos; edición y revisión al eliminar */
.ct-intro { max-width: 78ch; margin: 14px 0 0; }
.ct { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius-control); background: var(--surface); }
.ct__head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.ct__title { margin: 0; font-size: 1.5rem; font-stretch: 62%; font-weight: 800; }
.ct-tree { margin: 0; padding: 0; list-style: none; }
.ct-tree--root { margin-top: 12px; border-top: 1px solid var(--line); }
.ct-tree .ct-tree { margin-left: 18px; padding-left: 14px; border-left: 2px solid var(--line); }
.ct-node { border-bottom: 1px solid var(--line); }
.ct-node > .ct-tree { border-top: 0; }
.ct-tree .ct-tree > .ct-node:last-child { border-bottom: 0; }
.ct-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px 16px; align-items: center; padding: 10px 0; }
.ct-name { display: grid; min-width: 0; }
.ct-link { color: var(--text); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.ct-row--group > .ct-name .ct-link { font-size: 1.0625rem; }
.ct-link:hover { text-decoration: underline; }
.ct-sub { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ct-chip { padding: 2px 10px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-chip span { color: var(--muted); }
.ct-count { display: flex; gap: 8px; align-items: center; min-width: 6.5rem; }
.ct-count .plate { min-width: 2.6rem; height: 2rem; font-size: 1.25rem; }
.ct-count__label { color: var(--muted); font-size: 0.8125rem; }
.ct-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ct-new { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--input-border); }
.ct-new__summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; }
.ct-form { display: grid; gap: 12px; max-width: 40rem; margin-top: 10px; }
.ct-form .field { margin: 0; }
.ct-form__actions { display: flex; gap: 10px; }
.ct-dest { display: grid; gap: 8px; padding: 12px 14px; border-left: 5px solid var(--senal); border-radius: var(--radius-control); background: var(--warn-bg); }
.ct-dest[hidden] { display: none; }
.ct-dest__warn { margin: 0; color: var(--warn-text); font-size: 0.9375rem; }
.ct-alert { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-top: 16px; padding: 14px 18px; border-left: 6px solid var(--senal); border-radius: var(--radius-control); background: var(--warn-bg); color: var(--warn-text); }
.ct-alert__title { margin: 0; font-size: 1.125rem; font-weight: 700; }
.ct-alert p { margin: 4px 0 0; }
.ct-alert a { color: inherit; }
.ct-alert__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ct-alert__form select { min-width: 16rem; min-height: 48px; }
.ct-edit { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 12px; }
.ct-edit .panel { max-width: none; margin-top: 0; }
.ct-edit__form { display: grid; gap: 14px; }
.ct-edit__form .field { margin: 0; }
.ct-facts { display: grid; gap: 10px; margin: 10px 0 0; }
.ct-facts dt { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.ct-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.ct-facts dd span { color: var(--muted); font-size: 0.875rem; }
.ct-impact { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.ct-impact li { padding: 8px 12px; border-radius: var(--radius-control); background: var(--surface); }
.ct-impact__n { margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); font-size: 0.8125rem; font-weight: 700; }
.ct-dest-review { display: grid; gap: 10px; padding: 14px; border-left: 5px solid var(--senal); border-radius: var(--radius-control); background: var(--warn-bg); }
.ct-dest-review .field { margin: 0; max-width: 32rem; }
.ct-dest-review .field__help { color: var(--warn-text); }
.ct-who > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
@media (max-width: 980px) {
  .ct-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ct-chips { grid-column: 1 / 2; justify-content: flex-start; }
  .ct-count { grid-column: 2 / 3; grid-row: 1; }
  .ct-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .ct-edit { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .ct { padding: 12px; }
  .ct-tree .ct-tree { margin-left: 8px; padding-left: 10px; }
  .ct__head .rt-btn { width: 100%; }
  .ct-actions .rt-btn { flex: 1 1 auto; min-height: 48px; }
  .ct-alert__form { width: 100%; }
  .ct-alert__form select, .ct-alert__form .rt-btn { width: 100%; }
}

/* Cambio de categoría en bloque y ajuste de derechos de inscripción */
.del-head--soft { border-left-color: var(--senal); }
.del-form--plain { border-color: var(--line); }
.adj-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.adj__row { display: grid; grid-template-columns: auto auto minmax(0, 1.3fr) auto minmax(0, 1fr); gap: 6px 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius-control); background: var(--surface); cursor: pointer; }
.adj__check { width: 24px; height: 24px; margin: 0; accent-color: var(--text); }
.adj__who { display: grid; min-width: 0; }
.adj__who strong { overflow-wrap: anywhere; }
.adj__sub { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.adj__amounts { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.adj__from { color: var(--muted); }
.adj__arrow { color: var(--muted); }
.adj__to { font-size: 1.125rem; }
.adj__after { font-size: 0.875rem; color: var(--muted); }
.adj__credit { color: var(--warn-text); font-weight: 600; }
@media (max-width: 860px) {
  .adj__row { grid-template-columns: auto auto minmax(0, 1fr); }
  .adj__amounts, .adj__after { grid-column: 2 / -1; }
}

/* Waypoints de la sección: una línea por waypoint en escritorio, tarjeta plegable en móvil; edición en bloque fija arriba */
.wpb__bar { position: sticky; top: 0; z-index: 15; display: grid; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-control); background: var(--notice-bg); box-shadow: 0 6px 14px -10px rgb(27 36 48 / 0.5); }
.wpb__top { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.wpb__count { margin: 0; font-size: 0.9375rem; }
.wpb__count strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.wpb__marks { display: flex; flex-wrap: wrap; gap: 6px; }
.wpb__mark { min-height: 36px; padding: 0 12px; border: 1.5px solid var(--input-border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.wpb__mark:hover { border-color: var(--text); }
.wpb__dirty { margin: 0 0 0 auto; padding: 2px 12px; border-radius: 999px; background: var(--senal); color: var(--asfalto); font-size: 0.875rem; font-weight: 700; }
.wpb__dirty[hidden] { display: none; }
.wpb__tools { display: grid; grid-template-columns: minmax(10rem, 0.8fr) auto minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; align-items: end; }
.wpb__set { min-width: 0; }
.wpb__label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.wpb__set select { min-height: 44px; }
.wpb__buttons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wpb__num { width: 5.5rem; min-height: 44px; text-align: right; }
.wpb__btn { min-height: 44px; min-width: 44px; padding: 0 14px; border: 1.5px solid var(--text); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font: inherit; font-size: 0.9375rem; font-weight: 700; cursor: pointer; }
.wpb__btn:hover { background: var(--text); color: var(--surface); }
.wpb__btn--yes { border-color: var(--ok-text); color: var(--ok-text); }
.wpb__btn--yes:hover { background: var(--ok-text); color: var(--surface); }
.wpb__btn--ghost { border-color: transparent; background: transparent; color: var(--muted); font-weight: 600; }
.wpb__btn--ghost:hover { background: var(--surface); color: var(--text); }
.wpb__status { margin: 0; color: var(--muted); font-size: 0.8125rem; min-height: 1.2em; }
.wpb__status.is-done { color: var(--ok-text); font-weight: 600; }

.wp-list { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.wp-head { display: none; }
.wp { position: relative; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0 10px; align-items: start; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.wp:hover { background: var(--notice-bg); }
.wp.is-marked { background: var(--warn-bg); }
.wp.is-dirty::after { content: ""; position: absolute; top: 12px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--senal); box-shadow: 0 0 0 2px var(--surface); }
.wp__check { display: grid; place-items: center; min-height: 44px; cursor: pointer; }
.wp__check input { width: 22px; height: 22px; margin: 0; accent-color: var(--text); }
.wp__d { min-width: 0; }
.wp__sum { display: none; }
.wp__grid { display: grid; gap: 8px 10px; padding: 0 0 2px; }
.wp__c { display: block; min-width: 0; }
.wp__l { display: block; margin-bottom: 2px; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.wp__c .field__input { width: 100%; min-height: 44px; padding: 6px 10px; font-size: 1rem; }
.wp__c--n .field__input { text-align: right; }
.wp__c--ro .wp__v { display: flex; align-items: center; min-height: 44px; justify-content: flex-end; color: var(--muted); font-variant-numeric: tabular-nums; }
.wp__c--name .wpt-badges { margin-bottom: 3px; }
.wp__c--del { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; color: var(--muted); font-size: 0.9375rem; cursor: pointer; }
.wp__c--del input { width: 22px; height: 22px; margin: 0; accent-color: var(--bandera); }
.wp__c--del:has(input:checked) { color: var(--error-text); font-weight: 700; }
.wp:has([data-wpt-remove]:checked) .wp__grid { opacity: 0.55; }

/* Escritorio ancho: todos los campos en una sola línea, sin desplegables */
@media (min-width: 1241px) {
  .wp-head, .wp { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .wp-head { display: grid; gap: 0 10px; margin-top: 10px; padding: 0 4px 6px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: 0.75rem; font-weight: 700; }
  .wp-cols, .wp__grid { display: grid; grid-template-columns: minmax(11rem, 1.7fr) 6.6rem 6.6rem 5.4rem 4.4rem 5rem 5.4rem 5.2rem 5.6rem minmax(6rem, 1.2fr) 4.8rem; gap: 0 8px; align-items: center; }
  .wp-cols .n { text-align: right; }
  .wp__l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wp__c .field__input { min-height: 40px; padding: 4px 8px; font-size: 0.9375rem; }
  .wp__c--name .wpt-badges { display: inline-flex; margin: 0 0 2px; }
  .wp__c--del { justify-content: flex-start; font-size: 0.875rem; }
}

/* Tarjeta: datos en cuadrícula; en móvil se pliega y la línea resumen basta para recorrer la lista */
@media (max-width: 1240px) {
  .wp-head { display: none; }
  .wp__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 0 8px; }
  .wp__c--name { grid-column: 1 / -1; }
  .wp__c--notes { grid-column: span 3; }
  .wp__c--del { grid-column: 1 / -1; }
  .wp__sum { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; min-height: 44px; padding: 4px 28px 4px 0; list-style: none; cursor: pointer; position: relative; }
  .wp__sum::-webkit-details-marker { display: none; }
  .wp__sum::after { content: ""; position: absolute; right: 8px; top: 50%; width: 9px; height: 9px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; }
  .wp__d[open] > .wp__sum::after { margin-top: -2px; transform: rotate(225deg); }
  .wp__sum-name { font-weight: 700; overflow-wrap: anywhere; }
  .wp__sum-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .wp__chip { padding: 1px 9px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
  .wp__chip:empty, .wp__chip[hidden] { display: none; }
  .wp__chip--req { border-color: var(--ok-text); background: var(--ok-bg); color: var(--ok-text); font-weight: 700; }
  /* Con la ficha abierta, el nombre ya está en su campo: el resumen solo sirve para cerrarla. */
  .wp__d[open] > .wp__sum { min-height: 36px; }
  .wp__d[open] > .wp__sum .wp__sum-chips { display: none; }
  .wp__d[open] > .wp__sum .wp__sum-name { color: var(--muted); font-weight: 600; font-size: 0.875rem; }
  .wp__c--name .wpt-badges:empty { display: none; }
}
@media (max-width: 720px) {
  .wpb__bar { top: 0; padding: 10px 12px; }
  .wpb__tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wpb__set--scope { grid-column: 1 / -1; }
  .wpb__set:nth-child(n+3) { grid-column: 1 / -1; }
  .wpb__dirty { margin-left: 0; }
  .wp__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wp__c--notes { grid-column: 1 / -1; }
}
@media (min-width: 1241px) {
  .wp { align-items: center; }
  .wp__c--name { display: flex; gap: 6px; align-items: center; min-width: 0; }
  .wp__c--name .wpt-badges { display: flex; flex: none; gap: 4px; margin: 0; }
  .wp__c--name .wpt-badges:empty { display: none; }
  .wp__c--name .field__input { flex: 1 1 auto; min-width: 0; }
  .wp__c--name .badge { white-space: nowrap; }
}

/* Ajustes de tablet y móvil de los waypoints */
.wpb__sum { display: flex; align-items: center; min-height: 44px; padding: 0; font-weight: 700; list-style: none; cursor: pointer; position: relative; }
.wpb__sum::-webkit-details-marker { display: none; }
.wpb__sum::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.wpb__bar[open] > .wpb__sum::after { margin-top: -2px; transform: rotate(225deg); }
.wpb__bar:not([open]) { gap: 0; }
@media (max-width: 1240px) {
  .wpb__bar { position: static; }
  /* Entre 861 y 1240: dos líneas por waypoint, sin resumen (el nombre ya es un campo) */
  .wp__sum { display: none; }
  .wp__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .wp__grid > .wp__c { grid-column: span 2; }
  .wp__grid > .wp__c--name { grid-column: span 4; }
}
@media (max-width: 860px) {
  /* Tarjeta plegable: cerrada es una línea con sus datos clave; abierta enseña los campos */
  .wp__sum { display: flex; }
  .wp__d[open] > .wp__sum { min-height: 32px; justify-content: flex-end; padding-right: 28px; }
  .wp__d[open] > .wp__sum .wp__sum-name, .wp__d[open] > .wp__sum .wp__sum-chips { display: none; }
  .wp__d[open] > .wp__sum::after { right: 8px; }
  .wp__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wp__grid > .wp__c { grid-column: auto; }
  .wp__grid > .wp__c--name, .wp__grid > .wp__c--notes, .wp__grid > .wp__c--del { grid-column: 1 / -1; }
}

/* Token de lectura (rutas, categorías y autorizados): una sola fila con valor, copiar, publicar y renovar */
.ptk { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; min-width: 0; }
.ptk__id { display: flex; gap: 8px; align-items: center; }
.ptk__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ptk__value { width: 8.6rem; min-height: 48px; padding: 0 10px; border: 1.5px dashed var(--input-border); border-radius: var(--radius-control); background: var(--bg); color: var(--text); font: inherit; font-size: 1.5rem; font-stretch: 75%; font-weight: 800; letter-spacing: 0.14em; text-align: center; }
.ptk form { margin: 0; }
.ptk__check { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--input-border); border-radius: var(--radius-control); background: var(--bg); font-weight: 600; cursor: pointer; }
.ptk__check input { width: 20px; height: 20px; accent-color: var(--ok-text); }
.ptk__check:has(input:checked) { border-color: var(--ok-text); background: var(--ok-bg); }
.ptk__publish.is-saving .ptk__check { opacity: 0.6; }
@media (max-width: 640px) {
  .ptk { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .ptk__id { grid-column: 1 / -1; }
  .ptk__value { flex: 1; width: auto; min-width: 0; }
}

/* Cabecera de categorías: título y token en una sola franja */
.pub-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pub-head__id { min-width: 0; }
.pub-head__title { margin: 0; font-size: 1.5rem; font-stretch: 62%; font-weight: 800; }
.pub-head__meta { margin: 2px 0 0; color: var(--muted); font-size: 0.9375rem; }
.az-head + .ptk, .az-pdf + .ptk { margin: 16px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

/* Categorías: tarjetas por familia */
.ctv { margin-top: 20px; padding: 16px; border-radius: 14px; background: var(--surface); border-top: 6px solid var(--senal); }
.ctv--organization { border-top-color: var(--asfalto); }
.ctv__head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ctv__title { margin: 0; font-size: 1.5rem; font-stretch: 62%; font-weight: 800; }
.ctv__meta { margin: 2px 0 0; color: var(--muted); font-size: 0.9375rem; }
.ctv__grid, .cg__body { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 12px; }
.cf { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.cf--empty { border-style: dashed; }
.cf__name { margin: 0; font-size: 1.125rem; font-weight: 800; overflow-wrap: anywhere; }
.cf__name a, .cg__name a { color: var(--text); text-decoration: none; }
.cf__name a:hover, .cg__name a:hover { text-decoration: underline; }
.cf__desc, .cf__routes { margin: 0; color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.cf__facts { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: flex-end; margin: 0; }
.cf__facts dt { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.cf__facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.cf__facts small { display: block; color: var(--muted); font-size: 0.6875rem; font-weight: 500; }
.cf__price { font-size: 1.5rem; font-stretch: 62%; font-weight: 800; }
.cf__regs { margin-left: auto; }
.cf__regs .plate { min-width: 2.6rem; height: 2rem; font-size: 1.25rem; }
.cf__bar { width: 100%; height: 6px; display: block; }
.cf__bar-base { fill: var(--line); }
.cf__bar-fill { fill: var(--senal); }
.cg__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cf__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.cf__actions .rt-btn { justify-content: center; text-align: center; }
.cf__actions .rt-btn--danger { grid-column: 1 / -1; }
.cg { grid-column: 1 / -1; padding: 12px; border-radius: 12px; background: var(--bg); }
.cg__head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.cg__id { flex: 1 1 14rem; min-width: 0; }
.cg__name { margin: 0; font-size: 1.1875rem; font-weight: 800; overflow-wrap: anywhere; }
.cg__meta { margin: 2px 0 0; color: var(--muted); font-size: 0.8125rem; }
.cg__regs { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.8125rem; }
.cg__regs .plate { min-width: 2.6rem; height: 2rem; font-size: 1.25rem; }
.cg .cg { border: 1px dashed var(--input-border); background: transparent; }
@media (max-width: 640px) {
  .ctv { padding: 12px; }
  .ctv__head .rt-btn { width: 100%; }
  .cg__actions .rt-btn { flex: 1 1 auto; }
}

/* Configuración › Publicar datos: por evento, lo general y lo de cada etapa */
.pub-how { max-width: 72ch; margin: 0; color: var(--muted); font-size: 0.9375rem; }
.pub-ev { border-radius: 12px; background: var(--surface); }
.pub-ev + .pub-ev { margin-top: 12px; }
.pub-ev__head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; min-height: 64px; padding: 12px 18px; cursor: pointer; list-style: none; border-radius: 12px; }
.pub-ev__head::-webkit-details-marker { display: none; }
.pub-ev__head:hover { box-shadow: inset 0 0 0 1.5px var(--line); }
.pub-ev__head:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pub-ev__id { display: grid; min-width: 0; }
.pub-ev__name { font-size: 1.25rem; font-stretch: 62%; font-weight: 800; }
.pub-ev__meta { color: var(--muted); font-size: 0.875rem; }
.pub-ev__body { display: grid; gap: 18px; padding: 4px 18px 18px; }
.pub-evtok { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.pub-evtok__label { font-size: 0.8125rem; font-weight: 700; }
.pub-evtok__label small { color: var(--muted); font-weight: 500; }
.pub-evtok__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pub-evtok__row form { margin: 0; }
.pub-evtok__value { width: 12rem; min-height: 44px; padding: 0 10px; border: 1.5px dashed var(--input-border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font: inherit; font-size: 1.25rem; font-stretch: 75%; font-weight: 800; letter-spacing: 0.1em; text-align: center; }
.pub-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pub-fold { border: 1.5px solid var(--line); border-left: 6px solid var(--text); border-radius: 0 12px 12px 0; background: var(--bg); }
.pub-fold--general { border-left-color: var(--senal); }
.pub-fold[open] { padding-bottom: 10px; }
.pub-fold > .pub-rows, .pub-fold > .pub-row__help { margin: 0 10px; }
.pub-fold__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-height: 56px; padding: 8px 52px 8px 14px; position: relative; cursor: pointer; list-style: none; }
.pub-fold__head::-webkit-details-marker { display: none; }
.pub-fold__head::after { content: ""; position: absolute; top: 50%; right: 20px; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
.pub-fold[open] > .pub-fold__head::after { transform: translateY(-30%) rotate(-135deg); }
.pub-fold__head:hover { background: var(--notice-bg); }
.pub-fold__head:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pub-fold__title { font-size: 1.0625rem; font-weight: 800; }
.pub-fold__meta, .pub-fold__count { color: var(--muted); font-size: 0.8125rem; }
.pub-fold__head .badge { margin-left: auto; }
.pub-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pub-row { display: grid; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.pub-row--on { border-color: var(--ok-text); }
.pub-row__head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; }
.pub-row__id { flex: 1 1 14rem; min-width: 0; }
.pub-row__name { margin: 0; font-size: 1.0625rem; font-weight: 800; overflow-wrap: anywhere; }
.pub-row__help { margin: 2px 0 0; color: var(--muted); font-size: 0.8125rem; }
.pub-tag { padding: 1px 8px; border-radius: 999px; background: var(--text); color: var(--surface); font-size: 0.6875rem; font-weight: 700; vertical-align: middle; }
.pub-secs { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 6px 0 0; }
.pub-secs__n { margin-right: 4px; color: var(--muted); font-size: 0.8125rem; }
.pub-sec { padding: 1px 8px; border: 1.5px solid var(--line); border-radius: 6px; font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pub-row__ctl { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pub-row__tok { padding: 2px 8px; border: 1.5px dashed var(--input-border); border-radius: 6px; font-stretch: 75%; font-weight: 800; letter-spacing: 0.1em; }
.pub-switch { margin: 0; }
.pub-switch__label { display: inline-flex; gap: 10px; align-items: center; min-height: 48px; padding: 0 4px; font-weight: 700; cursor: pointer; }
.pub-switch__label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pub-switch__track { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--input-border); transition: background 0.15s; }
.pub-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); transition: transform 0.15s; }
.pub-switch__label input:checked + .pub-switch__track { background: var(--ok-text); }
.pub-switch__label input:checked + .pub-switch__track::after { transform: translateX(20px); }
.pub-switch__label input:focus-visible + .pub-switch__track { outline: 3px solid var(--focus); outline-offset: 2px; }
.pub-switch.is-saving { opacity: 0.6; }
.pub-urls { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.pub-url { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.pub-url__fmt { color: var(--muted); font-size: 0.8125rem; font-weight: 800; }
.pub-url__value { min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--input-border); border-radius: var(--radius-control); background: var(--bg); color: var(--text); font: inherit; font-size: 0.875rem; }
.pub-row__reads { margin: 2px 0 0; color: var(--muted); font-size: 0.8125rem; }
@media (max-width: 640px) {
  .pub-ev__head { padding: 10px 12px; }
  .pub-ev__body { padding: 4px 12px 12px; }
  .pub-fold__head { padding: 8px 44px 8px 12px; }
  .pub-fold > .pub-rows, .pub-fold > .pub-row__help { margin: 0 8px; }
  .pub-row { padding: 10px 12px; }
  .pub-url { grid-template-columns: 2.6rem minmax(0, 1fr) minmax(0, 1fr); }
  .pub-url__value { grid-column: 2 / -1; }
  .pub-url .rt-btn { grid-row: 2; justify-content: center; }
  .pub-url button.rt-btn { grid-column: 2; }
  .pub-url a.rt-btn { grid-column: 3; }
  .pub-evtok__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pub-evtok__value { grid-column: 1 / -1; width: 100%; }
  .pub-evtok__row .rt-btn { width: 100%; justify-content: center; }
}
.sec-track__export { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }

/* Autorizados: PDF para el tablón */
.az-pdf { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 16px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.az-pdf__text { display: grid; flex: 1 1 16rem; min-width: 0; gap: 2px; }
.az-pdf__text span { color: var(--muted); font-size: 0.875rem; }
.az-pdf__name { flex: 1 1 14rem; min-width: 0; margin: 0; }
@media (max-width: 640px) { .az-pdf .rt-btn { width: 100%; justify-content: center; } }

/* Datos personales (RGPD) de una cuenta */
.privacy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.contact__rgpd { margin-top: 6px; font-size: 0.875rem; }
@media (max-width: 860px) { .privacy-grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Tablón
   Tablón de anuncios oficial: lo publicado es un pase sellado (banda de señal, troquel, número grande).
   ========================================================================== */

/* Cabecera y menú de un tablón */
.tb-head { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-end; justify-content: space-between; margin: 4px 0 0; }
.tb-head__title { min-width: 0; }
.tb-head__name { margin: 0; font-size: clamp(1.75rem, 5vw, 2.5rem); font-stretch: 62%; font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.tb-head__meta { margin-top: 4px; color: var(--muted); font-size: 0.9375rem; }
.tb-head__status { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.tb-nav { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 16px 0 24px; box-shadow: inset 0 -1.5px 0 var(--line); }
.tb-nav a { display: inline-flex; align-items: center; min-height: 48px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tb-nav a:hover { color: var(--text); }
.tb-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--senal); }
.tb-nav a:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 4px; }
.tb-draft { max-width: 720px; }

/* Lista de tablones */
.tb-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; margin: 20px 0 0; padding: 0; list-style: none; }
.tb-board { position: relative; display: grid; align-content: start; gap: 10px; min-width: 0; padding: 18px 18px 16px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 6px 0 var(--senal), var(--shadow); }
.tb-board--finished { box-shadow: inset 0 6px 0 var(--acero), var(--shadow); }
.tb-board--draft { background: transparent; box-shadow: inset 0 0 0 1.5px var(--input-border); border-top: 6px dashed var(--input-border); }
.tb-board--archived { opacity: 0.7; box-shadow: inset 0 6px 0 var(--line), var(--shadow); }
.tb-board__link { display: grid; gap: 2px; padding-top: 6px; color: inherit; text-decoration: none; }
.tb-board__link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }   /* toda la tarjeta es el enlace */
.tb-board__link:focus-visible { outline: none; }
.tb-board__link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.tb-board__name { font-size: 1.625rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.tb-board__dates { color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.tb-board__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.tb-board__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 4px 0 0; padding-top: 12px; border-top: 1.5px dashed var(--line); }
.tb-board__stats dt { color: var(--muted); font-size: 0.75rem; overflow-wrap: anywhere; }
.tb-board__stats dd { margin: 0; font-size: 1.625rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* Códigos */
.tb-code { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 6px; background: var(--asfalto); color: var(--senal); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; overflow-wrap: anywhere; }
:root[data-theme="dark"] .tb-code { background: var(--senal); color: var(--asfalto); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-code { background: var(--senal); color: var(--asfalto); } }
.tb-code--big { min-height: 0; padding: 4px 14px 6px; border: 2px dashed var(--text); background: var(--surface); color: var(--text); font-size: clamp(1.5rem, 7vw, 2.25rem); font-stretch: 62%; font-weight: 800; letter-spacing: 0.05em; line-height: 1.1; user-select: all; }
:root[data-theme="dark"] .tb-code--big { background: var(--surface); color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-code--big { background: var(--surface); color: var(--text); } }
.tb-code-field .field__input { text-transform: uppercase; letter-spacing: 0.05em; }

/* Estados y prioridades */
.tb-status, .tb-prio { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--notice-bg); color: var(--muted); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.tb-status--published { background: var(--ok-bg); color: var(--ok-text); }
.tb-status--scheduled { background: var(--warn-bg); color: var(--warn-text); }
.tb-status--draft { background: transparent; box-shadow: inset 0 0 0 1.5px var(--input-border); }
.tb-status--superseded { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.tb-status--withdrawn { background: var(--error-bg); color: var(--error-text); }
.tb-prio--important { background: var(--warn-bg); color: var(--warn-text); }
.tb-prio--urgent { background: var(--bandera); color: #fff; }

/* Lista de publicaciones y avisos */
.tb-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-filter a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.tb-filter a:hover { border-color: var(--text); }
.tb-filter a[aria-current="page"] { border-color: var(--text); background: var(--text); color: var(--surface); }
.tb-filter a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tb-count { min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--notice-bg); color: var(--text); font-size: 0.8125rem; text-align: center; font-variant-numeric: tabular-nums; }
.tb-filter a[aria-current="page"] .tb-count { background: var(--senal); color: var(--asfalto); }

.tb-posts { display: grid; gap: 10px; max-width: 980px; margin: 20px 0 0; padding: 0; list-style: none; }
.tb-post { --stripe: var(--line); position: relative; min-width: 0; padding: 12px 16px 12px 22px; border-radius: 10px; background: var(--surface); box-shadow: inset 6px 0 0 var(--stripe); }
.tb-post--important { --stripe: var(--senal); }
.tb-post--urgent { --stripe: var(--bandera); }
.tb-post--draft { background: transparent; box-shadow: inset 6px 0 0 var(--stripe), inset 0 0 0 1.5px var(--input-border); }
.tb-post--withdrawn { background: var(--error-bg); }
.tb-post--superseded .tb-post__title { color: var(--muted); }
.tb-post__link { display: flex; gap: 14px; align-items: center; min-height: 48px; margin: 0; color: inherit; text-decoration: none; }
a.tb-post__link:hover .tb-post__title { text-decoration: underline; text-underline-offset: 3px; }
a.tb-post__link:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.tb-post__number { max-width: 10rem; display: inline-grid; flex: none; place-items: center; min-width: 3.6rem; height: 2.5rem; padding: 0 8px; border: 2px solid var(--text); border-radius: 6px; background: var(--text); color: var(--surface); font-size: 1.5rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.tb-post--scheduled .tb-post__number { border-color: var(--senal); background: var(--senal); color: var(--asfalto); }
.tb-post--draft .tb-post__number { border: 2px dashed var(--input-border); background: transparent; color: var(--muted); font-size: 1.0625rem; font-stretch: 75%; }
.tb-post--superseded .tb-post__number { border-color: var(--input-border); background: transparent; color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.tb-post--withdrawn .tb-post__number { border-color: var(--bandera); background: transparent; color: var(--bandera); text-decoration: line-through; text-decoration-thickness: 2px; }
.tb-post__title { min-width: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tb-post--withdrawn .tb-post__title { color: var(--error-text); }
.tb-post__body { margin-top: 4px; color: var(--text); font-size: 0.9375rem; overflow-wrap: anywhere; }
.tb-post__meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 6px; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.tb-post__extra { margin-top: 2px; color: var(--muted); font-size: 0.8125rem; }
.tb-post form { margin-top: 10px; }

/* Formularios del Tablón: opciones en tarjeta (prioridad, cuándo publicar) */
.kind-pick:has(.kind-pick__item) { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 8px; }
.kind-pick__item { position: relative; display: grid; align-content: start; gap: 2px; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.kind-pick__item input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.kind-pick__item span { font-weight: 700; }
.kind-pick__item small { color: var(--muted); font-size: 0.8125rem; line-height: 1.3; }
.kind-pick__item:hover { border-color: var(--text); }
.kind-pick__item:has(input:checked) { border-color: var(--text); background: var(--notice-bg); box-shadow: inset 0 0 0 1.5px var(--text), inset 6px 0 0 var(--senal); padding-left: 20px; }
.kind-pick__item:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-panel > .check, .form-panel .field > .check { margin-top: 14px; min-height: 44px; align-items: center; }
.tb-publish { position: relative; max-width: 720px; margin-top: 28px; padding: 22px 24px 24px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 6px 0 var(--senal), var(--shadow); }
.tb-publish .panel__title { padding-top: 6px; font-size: 1.5rem; font-stretch: 75%; font-weight: 800; }
.tb-publish .form-actions .button { height: 52px; padding: 0 28px; background: var(--senal); color: var(--asfalto); font-size: 1.0625rem; font-weight: 800; box-shadow: inset 0 0 0 2px var(--asfalto); }
.tb-publish .form-actions .button:hover { background: #ffd35c; }
.tb-publish .field { margin-top: 14px; }
.tb-publish .kind-pick { margin-top: 14px; }
.tb-delete { max-width: 720px; margin-top: 32px; }
.tb-delete .button { margin: 0; }

/* Ficha sellada de una publicación */
.tb-seal { --seal-ink: var(--ok-text); position: relative; max-width: 860px; margin-top: 8px; border-radius: var(--radius-pass); background: var(--surface); box-shadow: var(--shadow); }
.tb-seal__head { position: relative; overflow: hidden; border-radius: var(--radius-pass) var(--radius-pass) 0 0; }
.tb-seal__band { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; min-height: 52px; margin: 0; padding: 10px 24px; background: var(--senal); color: var(--asfalto); }
.tb-seal__kind { font-size: 1.25rem; font-stretch: 75%; font-weight: 800; }
.tb-seal__state { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tb-seal__band .tb-status, .tb-seal__band .tb-prio { background: var(--asfalto); color: #fff; box-shadow: none; text-decoration: none; }
.tb-seal__band .tb-prio { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.tb-seal__id { position: relative; padding: 18px 24px 22px; }
.tb-seal__number { display: block; font-size: clamp(4.5rem, 20vw, 8.5rem); font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 0.88; }
.tb-seal__title { margin: 12px 0 0; max-width: 26ch; font-size: clamp(1.375rem, 4vw, 1.875rem); font-stretch: 75%; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.tb-seal__number + .tb-seal__title { margin-top: 10px; }
/* Sello de estado */
.tb-seal__id::after { content: "Vigente"; position: absolute; top: 20px; right: 24px; padding: 2px 14px 4px; border: 3px solid var(--seal-ink); border-radius: 8px; color: var(--seal-ink); font-size: 1.5rem; font-stretch: 62%; font-weight: 800; line-height: 1.15; opacity: 0.9; transform: rotate(-7deg); box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3.5px var(--seal-ink); }
/* Troquel */
.tb-seal__perf { position: relative; height: 0; border-top: 2.5px dashed var(--line); }
.tb-seal__perf::before, .tb-seal__perf::after { content: ""; position: absolute; top: -14px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); }
.tb-seal__perf::before { left: -13px; }
.tb-seal__perf::after { right: -13px; }
.tb-seal__main { padding: 22px 24px 8px; }
.tb-seal__main > .message { margin: 0 0 16px; }
.tb-seal__data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.tb-seal__data > div { min-width: 0; }
.tb-seal__data dt { color: var(--muted); font-size: 0.8125rem; }
.tb-seal__data dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.tb-seal__data .tb-seal__when { grid-column: 1 / -1; padding-bottom: 16px; border-bottom: 1.5px solid var(--line); }
.tb-seal__when dd { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.tb-seal__when strong { display: inline-block; font-size: clamp(2rem, 9vw, 2.75rem); font-stretch: 62%; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; vertical-align: -0.08em; }
.tb-seal__body { margin-top: 20px; padding-top: 18px; border-top: 1.5px solid var(--line); }
.tb-seal .sfile-list { margin: 20px 0 8px; }
.tb-seal .sfile { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 0; }
.tb-seal .sfile__name { display: inline-flex; align-items: center; min-height: 28px; }
.tb-hash { display: block; margin-top: 2px; color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.75rem; line-height: 1.35; overflow-wrap: anywhere; word-break: break-all; }
.sfile__meta .tb-hash { display: block; }
.tb-seal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; padding: 18px 24px 22px; border-top: 2.5px dashed var(--line); border-radius: 0 0 var(--radius-pass) var(--radius-pass); background: var(--notice-bg); }
.tb-seal__actions .button { margin: 0; }
.tb-seal__actions .button--quiet { height: 44px; display: inline-flex; align-items: center; text-decoration: none; }

/* Anulada: sustituida por otra versión. Banda gris, número tachado, sello gris. */
.tb-seal--superseded { --seal-ink: var(--muted); }
.tb-seal--superseded .tb-seal__band { background: var(--acero); color: #fff; }
.tb-seal--superseded .tb-seal__band .tb-status { background: #fff; color: var(--asfalto); }
.tb-seal--superseded .tb-seal__number { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 0.07em; text-decoration-color: var(--bandera); }
.tb-seal--superseded .tb-seal__title { color: var(--muted); }
.tb-seal--superseded .tb-seal__id::after { content: "Anulada"; }
.tb-seal--superseded .tb-seal__main > :not(.message) { opacity: 0.85; }
/* Retirada: banda roja, trama de aviso, sello rojo. */
.tb-seal--withdrawn { --seal-ink: var(--bandera); }
.tb-seal--withdrawn .tb-seal__band { background: var(--bandera); color: #fff; }
.tb-seal--withdrawn .tb-seal__band .tb-status { background: #fff; color: var(--bandera); }
.tb-seal--withdrawn .tb-seal__id { background: repeating-linear-gradient(-45deg, transparent 0 12px, rgb(198 40 40 / 0.09) 12px 24px); }
.tb-seal--withdrawn .tb-seal__number { color: var(--bandera); }
.tb-seal--withdrawn .tb-seal__id::after { content: "Retirada"; }
:root[data-theme="dark"] .tb-seal--published { --seal-ink: var(--ok-text); }

#corregir, #retirar { max-width: 860px; }
#retirar { margin-top: 12px; }
#retirar form { padding: 14px 0 4px; }

/* Códigos y audiencias */
.tb-audiences { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; margin: 20px 0 24px; padding: 0; list-style: none; }
.tb-aud { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 20px; align-items: start; min-width: 0; padding: 20px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 6px 0 var(--line), var(--shadow); }
.tb-aud--general { box-shadow: inset 0 6px 0 var(--senal), var(--shadow); }
.tb-aud__qr { width: 160px; padding: 6px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1.5px var(--line); }
.tb-aud__qr .qr { display: block; width: 100%; height: auto; }
.tb-aud__body { display: grid; gap: 10px; min-width: 0; }
.tb-aud__name { margin: 0; font-size: 1.375rem; font-stretch: 75%; font-weight: 800; line-height: 1.1; }
.tb-aud__code, .tb-aud__link { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0; min-width: 0; }
.tb-aud__link .link-quiet { flex: 1 1 100%; font-size: 0.875rem; overflow-wrap: anywhere; }
.tb-aud__stats { margin: 0; color: var(--muted); font-size: 0.875rem; }
.tb-aud .button--quiet { display: inline-flex; align-items: center; height: 44px; text-decoration: none; }
.tb-aud .fold { margin-top: 4px; }
.tb-aud .fold form { margin-top: 10px; }
.section-head__text + .tb-audiences { margin-top: 20px; }

/* Formularios en línea */
.tb-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.tb-inline-form .field__input { flex: 1 1 12rem; width: auto; min-width: 0; }
.tb-inline-form input[type="file"] { padding: 10px 12px; }
.tb-inline-form .button { margin: 0; }
.tb-row-actions { display: inline-flex; gap: 6px; margin: 0; }
.tb-row-actions .button { min-width: 44px; height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; }
.panel form.tb-row-actions { margin-top: 0; }

/* Secciones: árbol de hasta tres niveles */
.tb-sections { margin: 16px 0 12px; padding: 0; list-style: none; }
.tb-section { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; min-height: 56px; padding: 6px 0; border-top: 1.5px solid var(--line); }
.tb-section--d2 { margin-left: 22px; padding-left: 14px; border-left: 3px solid var(--senal); border-top-color: transparent; }
.tb-section--d3 { margin-left: 44px; padding-left: 14px; border-left: 3px solid var(--line); border-top-color: transparent; }
.tb-section__name { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.tb-section--d1 .tb-section__name { font-size: 1.0625rem; }
.tb-section__count { min-width: 1.8em; padding: 1px 8px; border-radius: 999px; background: var(--notice-bg); color: var(--muted); font-size: 0.8125rem; text-align: center; font-variant-numeric: tabular-nums; }
.tb-section__edit { grid-column: 1 / -1; }
@media (min-width: 721px) {
  .tb-section { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
  .tb-section__edit:not([open]) { grid-column: auto; margin: 0; }
  .tb-section__edit:not([open]) > .fold__summary { min-height: 44px; }
}
.tb-section__edit .field__input { flex: 1 1 10rem; }
.tb-icon { display: inline-block; flex: none; width: 28px; height: 28px; background: currentColor; -webkit-mask: var(--tb-i) center / contain no-repeat; mask: var(--tb-i) center / contain no-repeat; }
.tb-section .tb-icon { padding: 0; width: 30px; height: 30px; color: var(--text); }
.tb-section--d1 .tb-icon { color: var(--text); }
.tb-section--d2 .tb-icon, .tb-section--d3 .tb-icon { color: var(--muted); }
.tb-kinds { margin: 14px 0 12px; padding: 0; list-style: none; }
.tb-kind { padding: 10px 0; border-top: 1.5px solid var(--line); }
.tb-kind .tb-inline-form { margin-top: 0; }
.tb-kind__prefix { flex: 0 1 8rem !important; font-stretch: 62%; font-weight: 800; font-size: 1.25rem; letter-spacing: 0.04em; }
.tb-kind__last { flex: 1 1 8rem; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

/* Equipo */
.tb-staff { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin: 20px 0; padding: 0; list-style: none; }
.tb-member { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 14px; min-width: 0; padding: 20px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 6px 0 var(--senal), var(--shadow); }
.tb-member__name { margin: 4px 0 0; font-size: 1.375rem; font-stretch: 75%; font-weight: 800; line-height: 1.15; }
.tb-member__mail { display: block; margin-top: 2px; color: var(--muted); font-size: 0.875rem; font-stretch: 100%; font-weight: 400; overflow-wrap: anywhere; }
.tb-member form, .tb-member fieldset { margin: 0; min-width: 0; min-inline-size: 0; }
.tb-member .field__input { max-width: 100%; }
.tb-member .field + .field, .tb-member .field { margin-top: 12px; }
.tb-member__signature { padding-top: 14px; border-top: 1.5px dashed var(--line); }
.tb-signature { display: block; max-width: 220px; max-height: 80px; margin-bottom: 8px; padding: 6px 10px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1.5px var(--line); }

/* Configuración */
.tb-logo { display: block; max-width: 240px; max-height: 96px; padding: 8px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1.5px var(--line); }
.tb-sponsors { margin: 14px 0 0; padding: 0; list-style: none; }
.tb-sponsor { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 10px 0; border-top: 1.5px solid var(--line); }
.tb-sponsor__logo { width: 64px; height: 40px; padding: 4px; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1.5px var(--line); object-fit: contain; }
.tb-sponsor__name { font-weight: 700; overflow-wrap: anywhere; }
.tb-sponsor .link-quiet { grid-column: 2; min-width: 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.tb-sponsor .tb-row-actions { grid-column: 3; grid-row: 1 / span 2; }
.panel + .panel, .form-panel + .panel, .panel + .form-panel { max-width: 720px; }

/* Fieldsets del Tablón sin el marco del navegador */
.form-panel fieldset.field, .tb-member fieldset.field { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.form-panel fieldset.field > legend, .tb-member fieldset.field > legend { float: left; width: 100%; margin: 0 0 8px; padding: 0; }
.form-panel fieldset.field > legend + *, .tb-member fieldset.field > legend + * { clear: both; }
.form-panel .form-actions .button--quiet, .form-panel .sfile .button--quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; text-decoration: none; }
.form-panel input[type="file"] { padding: 10px 12px; height: auto; min-height: 48px; }
.form-panel .form-actions .button:not(.button--quiet) { height: 52px; width: auto; min-width: 12rem; margin: 0; }
@media (max-width: 640px) { .form-panel .form-actions .button:not(.button--quiet) { width: 100%; } }

@media (max-width: 720px) {
  .tb-aud { grid-template-columns: minmax(0, 1fr); }
  .tb-aud__qr { width: 200px; justify-self: center; }
  .tb-seal__data { grid-template-columns: minmax(0, 1fr); }
  .tb-aud .button--quiet, .tb-seal__actions .button, .tb-inline-form .button { min-height: 48px; }
  .tb-seal__actions { flex-direction: column; }
  .tb-seal__actions .button { justify-content: center; text-align: center; }
  .tb-seal__id::after { top: 14px; right: 16px; font-size: 1.25rem; }
}
@media (max-width: 640px) {
  .tb-head { align-items: flex-start; }
  .tb-seal__band { padding: 10px 14px; }
  .tb-seal__id { padding: 14px 14px 18px; }
  .tb-seal__main { padding: 18px 14px 4px; }
  .tb-seal__actions { padding: 14px 14px 18px; }
  .tb-seal__perf::before, .tb-seal__perf::after { width: 22px; height: 22px; top: -12px; }
  .tb-seal__perf::before { left: -11px; }
  .tb-seal__perf::after { right: -11px; }
  .tb-post { padding: 10px 12px 10px 18px; }
  .tb-post__number { min-width: 3rem; font-size: 1.375rem; }
  .tb-board, .tb-aud, .tb-member { padding: 16px 12px; }
  .tb-publish { padding: 18px 12px 20px; }
  .tb-publish .form-actions .button { width: 100%; justify-content: center; }
  .tb-section--d2 { margin-left: 12px; }
  .tb-section--d3 { margin-left: 24px; }
  .tb-sponsor { grid-template-columns: auto minmax(0, 1fr); }
  .tb-sponsor .tb-row-actions { grid-column: 1 / -1; grid-row: auto; }
  .tb-inline-form .field__input { flex-basis: 100%; }
}

/* ==========================================================================
   Tablón · página pública
   Lo ve cualquiera que escanee el QR del justificante: primero el veredicto, después el documento.
   ========================================================================== */
.page-tablon { background: var(--bg); }
.tbp { width: 100%; max-width: 680px; margin: 0 auto; padding: 16px 12px 64px; }
.tbp-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; margin-bottom: 16px; }
.tbp-head__logo { max-width: 72px; max-height: 56px; border-radius: 6px; background: #fff; }
.tbp-head > div { min-width: 0; }
.tbp-head__kicker { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.tbp-head__board { font-size: 1.375rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.tbp-head__org { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.tbp-lang { display: inline-flex; gap: 4px; }
.tbp-lang a { display: grid; place-items: center; min-width: 48px; min-height: 48px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none; }
.tbp-lang a[aria-current="page"] { border-color: var(--text); background: var(--text); color: var(--surface); }
.tbp-lang a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tbp-card { position: relative; padding: 0 0 20px; border-radius: var(--radius-pass); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.tbp-card > * { margin-left: 16px; margin-right: 16px; }
.tbp-card__title { margin: 0; padding: 14px 0 12px; color: var(--muted); font-size: 0.9375rem; font-weight: 600; }
.tbp-verdict { display: flex; gap: 14px; align-items: center; min-height: 72px; margin: 0; padding: 14px 16px; border-radius: 12px; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.tbp-verdict::before { content: ""; flex: none; width: 40px; height: 40px; background: currentColor; -webkit-mask: var(--tb-i) center / contain no-repeat; mask: var(--tb-i) center / contain no-repeat; }
.tbp-verdict--ok { background: var(--ok-bg); color: var(--ok-text); border-left: 6px solid var(--ok-text); }
.tbp-verdict--bad { background: var(--error-bg); color: var(--error-text); border-left: 6px solid var(--bandera); }
.tbp-card > .message { margin-top: 14px; margin-bottom: 0; }
.tbp-note { margin-top: 12px; font-size: 0.9375rem; }
.tbp-doc { display: grid; gap: 6px; margin-top: 22px; margin-bottom: 0; padding-top: 18px; border-top: 2.5px dashed var(--line); font-size: 1.375rem; font-stretch: 75%; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.tbp-doc__number { display: block; font-size: clamp(4rem, 22vw, 6rem); font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 0.9; }
.tbp-data { display: grid; gap: 0; margin-top: 16px; margin-bottom: 0; }
.tbp-data > div { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1.5px solid var(--line); }
.tbp-data dt { color: var(--muted); font-size: 0.875rem; }
.tbp-data dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tbp-text, .tbp-files { margin-top: 22px; }
.tbp-text h3, .tbp-files h3, .tbp-check h3 { margin: 0 0 8px; font-size: 1.125rem; font-stretch: 75%; font-weight: 800; }
.tbp-text__body { overflow-wrap: anywhere; max-width: 65ch; }
.tbp-files__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tbp-file { display: grid; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
.tbp-file__name { display: inline-flex; align-items: center; min-height: 28px; font-weight: 700; overflow-wrap: anywhere; }
.tbp-file__meta { color: var(--ok-text); font-size: 0.875rem; font-weight: 600; }
.tbp-hash { display: block; color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.75rem; line-height: 1.35; overflow-wrap: anywhere; word-break: break-all; }
.tbp-check { margin-top: 16px; padding: 16px; border: 2px dashed var(--input-border); border-radius: 12px; }
.tbp-check .field__help { margin: 0 0 12px; }
.tbp-check__pick { cursor: pointer; }
.tbp-check__pick:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.tbp-check__result { margin-top: 12px; font-weight: 700; overflow-wrap: anywhere; }
.tbp-check__result:empty { display: none; }
.tbp-check__result--ok { padding: 10px 12px; border-radius: 8px; background: var(--ok-bg); color: var(--ok-text); }
.tbp-check__result--bad { padding: 10px 12px; border-radius: 8px; background: var(--error-bg); color: var(--error-text); }
.tbp-seal { margin-top: 22px; }
.tbp-pre { max-width: 100%; margin: 8px 0 14px; padding: 12px; border-radius: 8px; background: var(--notice-bg); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.75rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; }
.tbp-seal > :not(summary) { margin-left: 0; margin-right: 0; }
.tbp-seal .fold__summary { margin: 0; }
@media (min-width: 641px) {
  .tbp { padding-top: 32px; }
  .tbp-card > * { margin-left: 28px; margin-right: 28px; }
  .tbp-verdict { font-size: 1.25rem; }
  .tbp-data > div { grid-template-columns: 9rem minmax(0, 1fr); }
}

/* Iconos del Tablón (secciones y veredicto): máscaras SVG en data URI; el color lo pone currentColor */
.tb-icon--folder { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
.tb-icon--document { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l4 4v14H6z'/%3E%3Cpath d='M14 3v4h4'/%3E%3Cpath d='M9 12h6'/%3E%3Cpath d='M9 16h6'/%3E%3C/svg%3E"); }
.tb-icon--flag { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4'/%3E%3Cpath d='M5 4h12l-2 4 2 4H5'/%3E%3C/svg%3E"); }
.tb-icon--clock { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18a9 9 0 0 0 0-18z'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.tb-icon--trophy { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4h8v5a4 4 0 0 1-8 0z'/%3E%3Cpath d='M8 6H4v2a3 3 0 0 0 4 3'/%3E%3Cpath d='M16 6h4v2a3 3 0 0 1-4 3'/%3E%3Cpath d='M12 13v4'/%3E%3Cpath d='M8 20h8'/%3E%3Cpath d='M10 17h4'/%3E%3C/svg%3E"); }
.tb-icon--map { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2z'/%3E%3Cpath d='M9 4v14'/%3E%3Cpath d='M15 6v14'/%3E%3C/svg%3E"); }
.tb-icon--info { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18a9 9 0 0 0 0-18z'/%3E%3Cpath d='M12 11v6'/%3E%3Cpath d='M12 7.5v.5'/%3E%3C/svg%3E"); }
.tb-icon--alert { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l10 18H2z'/%3E%3Cpath d='M12 10v5'/%3E%3Cpath d='M12 18v.5'/%3E%3C/svg%3E"); }
.tb-icon--car { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 16h18v-4l-2-5H5l-2 5z'/%3E%3Cpath d='M6 16v2h2v-2'/%3E%3Cpath d='M16 16v2h2v-2'/%3E%3Cpath d='M3 12h18'/%3E%3C/svg%3E"); }
.tb-icon--users { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5a3 3 0 1 0 0 6a3 3 0 0 0 0-6z'/%3E%3Cpath d='M3 20a6 6 0 0 1 12 0'/%3E%3Cpath d='M17 6.5a2.5 2.5 0 1 1 0 5'/%3E%3Cpath d='M17 14a5 5 0 0 1 4 6'/%3E%3C/svg%3E"); }
.tb-icon--megaphone { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10v4h4l8 4V6L7 10z'/%3E%3Cpath d='M18 9a4 4 0 0 1 0 6'/%3E%3C/svg%3E"); }
.tb-icon--camera { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h4l2-3h6l2 3h4v11H3z'/%3E%3Cpath d='M12 9.5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 0 0 0-7z'/%3E%3C/svg%3E"); }
.tb-icon--medical { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3h6v6h6v6h-6v6H9v-6H3V9h6z'/%3E%3C/svg%3E"); }
.tb-icon--phone { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h10v18H7z'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }
.tb-icon--hotel { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 20V5'/%3E%3Cpath d='M3 14h18v6'/%3E%3Cpath d='M21 14v-2a3 3 0 0 0-3-3h-7v5'/%3E%3Cpath d='M7 9a2 2 0 1 0 0 4a2 2 0 0 0 0-4z'/%3E%3C/svg%3E"); }
.tb-icon--fuel { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4h9v17'/%3E%3Cpath d='M3 21h13'/%3E%3Cpath d='M5 9h9'/%3E%3Cpath d='M14 8l3 2v7a2 2 0 0 0 4 0V9l-3-3'/%3E%3C/svg%3E"); }
.tb-icon--link { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1'/%3E%3Cpath d='M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
.tb-icon--star { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.8 5.7 6.2.9-4.5 4.4 1 6.2L12 17.2 6.5 20.2l1-6.2L3 9.6l6.2-.9z'/%3E%3C/svg%3E"); }
.tb-icon--check { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.tb-icon--cross { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12'/%3E%3Cpath d='M18 6L6 18'/%3E%3C/svg%3E"); }
.tbp-verdict--ok { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.tbp-verdict--bad { --tb-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12'/%3E%3Cpath d='M18 6L6 18'/%3E%3C/svg%3E"); }

/* ==========================================================================
   Tablón · web espejo e inserción
   Lo que ve el público con el código general (móvil primero, en la cuneta) y la versión para insertar en un <iframe>.
   Los colores del cliente no se aplican: la CSP no admite estilos en línea, así que mandan los tokens.
   ========================================================================== */
.tbp--wide { max-width: 1120px; }

/* Cabecera: cartel con la banda de señal */
.tbm-head { display: grid; gap: 14px; margin-bottom: 14px; padding: 18px 14px 16px; border-radius: var(--radius-pass); background: var(--surface); box-shadow: inset 0 8px 0 var(--senal), var(--shadow); }
.tbm-head__top { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-top: 6px; }
.tbm-head__kicker { color: var(--muted); font-size: 0.9375rem; font-weight: 600; }
.tbm-head__id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.tbm-head__logo { flex: none; width: auto; max-width: 96px; max-height: 72px; border-radius: 8px; background: #fff; object-fit: contain; }
.tbm-head__text { min-width: 0; }
.tbm-head__name { margin: 0; font-size: clamp(2rem, 9vw, 3.5rem); font-stretch: 62%; font-weight: 800; line-height: 1; overflow-wrap: anywhere; }
.tbm-head__org { margin-top: 6px; font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; }
.tbm-head__meta { color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.tbm-head__phase { display: inline-flex; gap: 8px; align-items: center; justify-self: start; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--notice-bg); color: var(--text); font-size: 0.9375rem; font-weight: 700; }
.tbm-head__phase::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.tbm-phase--live { background: var(--ok-bg); color: var(--ok-text); }
.tbm-phase--upcoming { background: var(--warn-bg); color: var(--warn-text); }
.tbm-phase--finished { color: var(--muted); }
.tbm-phase--finished::before { border-radius: 2px; }

/* Patrocinadores */
.tbm-sponsors { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tbm-sponsor { display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 48px; max-width: 100%; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.tbm-sponsor img { display: block; max-width: 140px; max-height: 40px; object-fit: contain; }
a.tbm-sponsor:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a.tbm-sponsor:hover { border-color: var(--text); }

/* Rejilla: una columna en móvil, dos en escritorio */
.tbm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.tbm-main { display: grid; gap: 26px; min-width: 0; align-content: start; }
.tbm-note { color: var(--muted); font-size: 0.875rem; }
.tbm-empty { padding: 18px 14px; border: 2px dashed var(--input-border); border-radius: 12px; color: var(--muted); font-weight: 600; }
.tbm-block__title { display: flex; gap: 10px; align-items: baseline; margin: 0 0 10px; font-size: clamp(1.5rem, 5vw, 1.875rem); font-stretch: 62%; font-weight: 800; line-height: 1.1; }
.tbm-count { display: inline-block; min-width: 1.6em; padding: 0 8px; border-radius: 999px; background: var(--notice-bg); color: var(--text); font-size: 0.8125rem; font-stretch: 100%; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

/* Avisos */
.tbm-notices { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tbm-notice { padding: 12px 14px 12px 18px; border-radius: 10px; background: var(--notice-bg); box-shadow: inset 6px 0 0 var(--input-border); }
.tbm-notice--important { background: var(--warn-bg); box-shadow: inset 6px 0 0 var(--senal); color: var(--warn-text); }
.tbm-notice--urgent { background: var(--error-bg); box-shadow: inset 6px 0 0 var(--bandera); color: var(--error-text); }
.tbm-notice__title { display: flex; gap: 8px; align-items: flex-start; font-size: 1.0625rem; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.tbm-notice .tb-icon { width: 22px; height: 22px; margin-top: 1px; }
.tbm-notice__body { margin-top: 4px; overflow-wrap: anywhere; }
.tbm-notice__when { color: inherit; font-size: 0.875rem; font-variant-numeric: tabular-nums; opacity: 0.85; }
.tbm-notice__title + .tbm-notice__body + .tbm-notice__when, .tbm-notice__title + .tbm-notice__when { margin-top: 4px; }
.tbm-notices .tbm-notice__when { display: block; }

/* Publicación: ficha con placa de número */
.tbm-block > .tbm-post { margin-top: 10px; }
.tbm-post { --stripe: var(--line); display: grid; gap: 12px; min-width: 0; margin-top: 8px; padding: 14px 14px 12px 20px; border-radius: 12px; background: var(--surface); box-shadow: inset 6px 0 0 var(--stripe), var(--shadow); }
.tbm-post--important { --stripe: var(--senal); }
.tbm-post--urgent { --stripe: var(--bandera); }
.tbm-post--withdrawn { background: var(--error-bg); }
.tbm-post__head { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.tbm-post__id { display: grid; gap: 2px; min-width: 0; }
.tbm-post__kind { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 0.9375rem; font-weight: 600; }
.tbm-post__kind .tb-icon { width: 20px; height: 20px; color: var(--text); }
.tbm-post--urgent .tbm-post__kind .tb-icon { color: var(--bandera); }
.tbm-post__title { margin: 0; font-size: 1.25rem; font-stretch: 75%; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.tbm-post__when { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.tbm-post__number { display: inline-grid; flex: none; place-items: center; min-width: 3.4rem; max-width: 8rem; height: 2.75rem; padding: 0 10px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 1.75rem; font-stretch: 62%; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.tbm-post__number--none { visibility: hidden; }
.tbm-post--superseded .tbm-post__number { background: transparent; box-shadow: inset 0 0 0 2px var(--input-border); color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.tbm-post--withdrawn .tbm-post__number { background: transparent; box-shadow: inset 0 0 0 2px var(--bandera); color: var(--bandera); text-decoration: line-through; text-decoration-thickness: 2px; }
.tbm-post--superseded .tbm-post__title { color: var(--muted); }
.tbm-post--withdrawn .tbm-post__title { color: var(--error-text); }
.tbm-post__flag { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: 0.9375rem; font-weight: 700; overflow-wrap: anywhere; }
.tbm-post__flag--bad { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bandera); color: var(--error-text); }
.tbm-post__body { min-width: 0; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.tbm-post__body img, .tbm-post__body table { max-width: 100%; }
.tbm-post__body pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.tbm-post--superseded .tbm-post__body { color: var(--muted); }
.tbm-post__files { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tbm-post__file { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--text); font-weight: 700; text-decoration: none; }
.tbm-post__file:hover { border-color: var(--text); }
.tbm-post__file:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tbm-post__fname { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.tbm-post__size { flex: none; color: var(--muted); font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tbm-post__foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 2px dashed var(--line); }
.tbm-post__signer { min-width: 0; color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.tbm-post__verify, .tbe-post__verify { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--text); border-radius: 10px; color: var(--text); font-weight: 700; text-decoration: none; }
.tbm-post__verify:hover, .tbe-post__verify:hover { background: var(--notice-bg); }
.tbm-post__verify:focus-visible, .tbe-post__verify:focus-visible, .tbe-foot__link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Secciones plegables (siempre plegadas al entrar) */
.tbm-section { margin-top: 8px; }
.tbm-section > .fold__summary { gap: 10px; min-height: 56px; padding-left: 12px; font-size: 1.0625rem; font-weight: 700; }
.tbm-section > .fold__summary .tb-icon { width: 26px; height: 26px; }
.tbm-section__name { min-width: 0; overflow-wrap: anywhere; }
.tbm-section > .fold__summary .tbm-count { margin-left: auto; }
.tbm-section--d2 { margin-left: 10px; }
.tbm-section--d3 { margin-left: 20px; }
.tbm-section--d2 > .fold__summary .tb-icon, .tbm-section--d3 > .fold__summary .tb-icon { color: var(--muted); }
.tbm-section > .tbm-post { margin-top: 8px; }

/* Síguelo en el móvil */
.tbm-follow { display: grid; gap: 12px; justify-items: start; padding: 18px 16px 20px; border-radius: var(--radius-pass); background: var(--surface); box-shadow: inset 0 6px 0 var(--senal), var(--shadow); }
.tbm-follow .tbm-block__title { margin: 6px 0 0; }
.tbm-follow p { max-width: 38ch; }
.tbm-follow__code { display: grid; gap: 4px; }
.tbm-follow__code span { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.tbm-follow__qr { width: min(100%, 220px); padding: 4px; border-radius: 12px; background: #fff; }
.tbm-follow__qr svg { display: block; width: 100%; height: auto; }
.tbm-follow__stores { display: grid; gap: 8px; width: 100%; }
.tbm-follow__stores .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; text-align: center; text-decoration: none; }

/* No encontrado */
.tbm-missing { display: grid; gap: 10px; justify-items: start; padding: 24px 0 24px; box-shadow: inset 0 8px 0 var(--bandera), var(--shadow); }
.tbm-missing__mark { display: grid; place-items: center; width: 56px; height: 56px; margin-top: 8px; border-radius: 50%; background: var(--error-bg); color: var(--bandera); }
.tbm-missing__mark .tb-icon { width: 30px; height: 30px; }
.tbm-missing > .tbm-missing__title { margin-top: 0; margin-bottom: 0; font-size: clamp(1.75rem, 8vw, 2.5rem); font-stretch: 62%; font-weight: 800; line-height: 1.05; }
.tbm-missing__text { max-width: 46ch; font-size: 1.0625rem; }

@media (min-width: 641px) {
  .tbm-head { padding: 22px 28px 22px; }
  .tbm-head__id { gap: 20px; }
  .tbm-head__logo { max-width: 140px; max-height: 96px; }
  .tbm-post { padding: 18px 22px 14px 26px; }
  .tbm-post__title { font-size: 1.375rem; }
  .tbm-post__number { min-width: 4.2rem; height: 3.25rem; font-size: 2.125rem; }
  .tbm-section--d2 { margin-left: 18px; }
  .tbm-section--d3 { margin-left: 36px; }
  .tbm-follow { padding: 22px 24px 24px; }
}
@media (min-width: 900px) {
  .tbp { padding-top: 32px; }
  .tbm-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .tbm-head__top { grid-column: 1 / -1; }
  .tbm-head__phase { align-self: end; justify-self: end; }
  .tbm-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
  .tbm-side { position: sticky; top: 16px; }
}

/* Versión para insertar: compacta, con fondo propio (no transparente) */
.page-tablon--embed { background: var(--surface); }
.tbe { width: 100%; max-width: 900px; margin: 0 auto; padding: 12px 12px 16px; }
.tbe-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 4px 0 12px; border-bottom: 3px solid var(--senal); }
.tbe-head__logo { flex: none; max-width: 56px; max-height: 36px; border-radius: 4px; background: #fff; object-fit: contain; }
.tbe-head__name { flex: 1 1 10rem; min-width: 0; font-size: 1.375rem; font-stretch: 62%; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.tbe-head .tbm-head__phase { min-height: 32px; padding: 0 12px; font-size: 0.875rem; }
.tbe-notices { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tbe-notices .tbm-notice { padding: 8px 12px 8px 16px; font-size: 0.9375rem; }
.tbe-notices .tbm-notice strong { display: inline-flex; gap: 6px; align-items: flex-start; }
.tbe-list { margin-top: 4px; }
.tbe-post { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "num main verify"; gap: 4px 12px; align-items: start; min-width: 0; padding: 12px 0; border-bottom: 1.5px solid var(--line); }
.tbe-post .tbm-post__number { grid-area: num; min-width: 3rem; height: 2.375rem; font-size: 1.5rem; }
.tbe-post__main { grid-area: main; display: grid; gap: 2px; min-width: 0; }
.tbe-post .tbm-post__title { font-size: 1.0625rem; font-stretch: 100%; font-weight: 700; }
.tbe-post__when, .tbe-post__sign { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tbe-post .tbm-post__flag { padding: 6px 10px; font-size: 0.875rem; }
.tbe-post .tbe-post__verify { grid-area: verify; min-height: 48px; font-size: 0.9375rem; text-align: center; }
.tbe-post.tbm-post--urgent .tbm-post__number { background: var(--bandera); color: #fff; }
.tbe-post.tbm-post--important .tbm-post__number { background: var(--senal); color: var(--asfalto); }
.tbe-post.tbm-post--superseded .tbm-post__title, .tbe-post.tbm-post--withdrawn .tbm-post__title { color: var(--muted); }
.tbe-post.tbm-post--superseded .tbm-post__number { background: transparent; color: var(--muted); }
.tbe-post.tbm-post--withdrawn .tbm-post__number { background: transparent; color: var(--bandera); }
.tbe-notices .tbm-notice__when { margin-left: 6px; white-space: nowrap; }
@media (max-width: 520px) {
  .tbe-post { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num main" "verify verify"; }
  .tbe-post .tbe-post__verify { justify-self: start; margin-left: calc(3rem + 12px); }
}
.tbe-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 0.875rem; }
.tbe-foot__link { display: inline-flex; align-items: center; min-height: 48px; color: var(--text); font-weight: 700; }
.tbe-foot__code strong { color: var(--text); letter-spacing: 0.05em; }

/* Consola: licencias */
.tb-license { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; }
.tb-license--ok { background: var(--ok-bg); color: var(--ok-text); }
.tb-license--none { background: var(--warn-bg); color: var(--warn-text); }
.tb-nolicense { max-width: 720px; margin-top: 0; }
.tb-licenses { margin-top: 28px; max-width: 1040px; }
.tb-licenses form { margin-top: 18px; }
.tb-license-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.tb-license-row { --lic: var(--input-border); display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "what state" "dates state" "notes notes" "act act"; gap: 2px 12px; align-items: center; min-width: 0; padding: 12px 14px 12px 18px; border-radius: 10px; background: var(--notice-bg); box-shadow: inset 6px 0 0 var(--lic); }
.tb-license-row.is-valid { --lic: var(--ok-text); }
.tb-license-row.is-expired { --lic: var(--senal); }
.tb-license-row.is-cancelled { --lic: var(--bandera); }
.tb-license-row__what { grid-area: what; font-weight: 700; overflow-wrap: anywhere; }
.tb-license-row__dates { grid-area: dates; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.tb-license-row__notes { grid-area: notes; color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.tb-license-row__state { grid-area: state; display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface); font-size: 0.8125rem; font-weight: 700; }
.tb-license-row.is-valid .tb-license-row__state { background: var(--ok-bg); color: var(--ok-text); }
.tb-license-row.is-expired .tb-license-row__state { background: var(--warn-bg); color: var(--warn-text); }
.tb-license-row.is-cancelled .tb-license-row__state { background: var(--error-bg); color: var(--error-text); }
.tb-license-row.is-cancelled .tb-license-row__what { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.tb-license-row form { grid-area: act; margin-top: 4px; }
@media (min-width: 721px) {
  .tb-license-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; grid-template-areas: "what dates state act" "notes notes notes notes"; }
  .tb-license-row form { margin-top: 0; }
}

/* Consola: web pública y fragmento para insertar */
.tb-web { max-width: 1040px; }
.tb-web__sub { margin: 22px 0 0; font-size: 1.0625rem; font-weight: 700; }
.tb-web .panel__text { max-width: 70ch; overflow-wrap: anywhere; }
.tb-web .panel__text a { overflow-wrap: anywhere; }
.tb-web .button--quiet { min-height: 48px; margin-left: 4px; }
.tb-snippet { display: block; max-width: 100%; margin: 12px 0 0; padding: 12px 14px; border-radius: 8px; border-left: 4px solid var(--senal); background: var(--notice-bg); color: var(--text); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.8125rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; user-select: all; }
.tb-web .button--inline { margin-top: 12px; }
.tb-web .field__help code { overflow-wrap: anywhere; word-break: break-all; }
.tb-licenses .kind-pick { margin-bottom: 14px; }
.tb-licenses .form-grid { margin-bottom: 4px; }
.tb-licenses .check { display: flex; gap: 10px; align-items: center; min-height: 48px; margin-top: 8px; }
.tb-licenses .form-actions { margin-top: 12px; }
.tb-license-list + form { margin-top: 24px; padding-top: 20px; border-top: 2px dashed var(--line); }

/* ==========================================================================
   Tablón · zonas y mapa
   Mapa de Leaflet (sin teselas: cuadrícula discreta), zonas, recorridos, celdas de calor, formulario de zona,
   alcance estimado del aviso y página pública de privacidad. Las capas son SVG de Leaflet: los atributos
   stroke/fill los pone Leaflet y aquí se ganan con selectores más específicos.
   ========================================================================== */
.tb-mapwrap { display: grid; gap: 10px; margin: 0 0 18px; min-width: 0; }
.tb-mapwrap > * { margin-top: 0; margin-bottom: 0; }
.tb-noemergency { border-left: 6px solid var(--senal); font-weight: 700; }

/* Contenedor del mapa: alto, pero deja ver el formulario debajo */
.tb-map { position: relative; z-index: 0; width: 100%; height: clamp(320px, 56svh, 640px); border: 2px solid var(--line); border-radius: 12px; background: var(--notice-bg); overflow: hidden; }
.tb-map--small { height: clamp(260px, 42svh, 380px); }
.tb-map.leaflet-container { background-color: var(--notice-bg); color: var(--text); font: inherit; font-size: 0.9375rem; }
.tb-map--plain.leaflet-container {
  background-color: var(--notice-bg);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}
.tb-map:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Capas: recorridos, zonas, zona elegida, lo dibujado */
.tb-map .leaflet-overlay-pane path.tb-map-track { stroke: var(--text); stroke-width: 3px; stroke-opacity: 0.85; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.tb-map .leaflet-overlay-pane path.tb-map-zone { --tb-zl: #9a6b00; stroke: var(--tb-zl); stroke-width: 2.5px; stroke-opacity: 1; fill: var(--senal); fill-opacity: 0.22; }
.tb-map .leaflet-overlay-pane path.tb-map-zone--polygon { stroke-dasharray: none; }
.tb-map .leaflet-overlay-pane path.tb-map-zone--corridor { --tb-zl: var(--muted); stroke-dasharray: none; stroke-opacity: 0.45; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.tb-map .leaflet-overlay-pane path.tb-map-zone--picked { stroke: var(--bandera); stroke-width: 4px; stroke-dasharray: none; fill: var(--bandera); fill-opacity: 0.22; }
.tb-map .leaflet-overlay-pane path.tb-map-zone--corridor.tb-map-zone--picked { stroke: var(--bandera); stroke-opacity: 0.6; fill: none; }
.tb-map .leaflet-overlay-pane path.tb-map-drawn { stroke: var(--text); stroke-width: 3px; stroke-dasharray: 3 6; stroke-linecap: round; fill: var(--text); fill-opacity: 0.12; }
:root[data-theme="dark"] .tb-map .leaflet-overlay-pane path.tb-map-zone { --tb-zl: var(--senal); }
:root[data-theme="dark"] .tb-map .leaflet-overlay-pane path.tb-map-zone--corridor { --tb-zl: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tb-map .leaflet-overlay-pane path.tb-map-zone { --tb-zl: var(--senal); }
  :root:not([data-theme="light"]) .tb-map .leaflet-overlay-pane path.tb-map-zone--corridor { --tb-zl: var(--muted); }
}

/* Celdas de calor: de «pocos» (gris, sin número) a mucha gente (bandera) */
.tb-map .leaflet-overlay-pane path.tb-cell { stroke-width: 1px; stroke-opacity: 0.55; }
.tb-map .leaflet-overlay-pane path.tb-cell--few { stroke: var(--muted); fill: var(--muted); fill-opacity: 0.28; }
.tb-map .leaflet-overlay-pane path.tb-cell--low { stroke: var(--ok-text); fill: var(--ok-text); fill-opacity: 0.32; }
.tb-map .leaflet-overlay-pane path.tb-cell--mid { stroke: #9a6b00; fill: var(--senal); fill-opacity: 0.55; }
.tb-map .leaflet-overlay-pane path.tb-cell--high { stroke: var(--bandera); fill: var(--bandera); fill-opacity: 0.6; }

/* Controles de Leaflet: zonas táctiles de 48 px en móvil */
.tb-map.leaflet-container .leaflet-bar { border: 2px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.tb-map.leaflet-container .leaflet-bar a { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-bottom: 1.5px solid var(--line); border-radius: 0; background-color: var(--surface); color: var(--text); font: 700 1.5rem/1 inherit; text-indent: 0; }
.tb-map.leaflet-container .leaflet-bar a:last-child { border-bottom: 0; }
.tb-map.leaflet-container .leaflet-bar a:hover { background-color: var(--notice-bg); color: var(--text); }
.tb-map.leaflet-container .leaflet-bar a.leaflet-disabled { background-color: var(--notice-bg); color: var(--muted); cursor: default; }
.tb-map.leaflet-container .leaflet-bar a:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.tb-map.leaflet-container .leaflet-control-zoom a span { line-height: 1; }
.tb-map.leaflet-container .leaflet-control-attribution { padding: 3px 8px; border-radius: 8px 0 0 0; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); font-size: 0.75rem; }
.tb-map.leaflet-container .leaflet-control-attribution a { color: var(--text); text-decoration: underline; }
.tb-map.leaflet-container .leaflet-control-attribution a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tb-map.leaflet-container .leaflet-tooltip { padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-size: 0.875rem; font-weight: 700; }
.tb-map.leaflet-container .leaflet-tooltip::before { display: none; }
.tb-map.leaflet-container .leaflet-popup-content-wrapper, .tb-map.leaflet-container .leaflet-popup-tip { background: var(--surface); color: var(--text); }

/* Barra «Ver usuarios en el mapa» */
.tb-cellsbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--notice-bg); }
.tb-cellsbar .check { display: flex; gap: 10px; align-items: center; min-height: 48px; margin: 0; font-weight: 700; }
.tb-cellsbar .field__input { width: auto; min-width: 0; max-width: 100%; }
.tb-cellsbar__note { min-width: 0; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tb-cellsbar__note:empty { display: none; }

/* Dibujar: botones, nombre y estado */
.tb-drawbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.tb-drawbar[hidden], .tb-zonepanel[hidden], .tb-drawbar [hidden] { display: none; }
.tb-drawbar .button { min-height: 48px; margin: 0; }
.tb-drawbar .field__input { flex: 1 1 14rem; width: auto; min-width: 0; }
.tb-drawbar .field__help { flex: 1 1 100%; margin: 0; color: var(--ok-text); font-weight: 600; }

/* Pasillo de un recorrido */
.tb-corridor { margin-top: 8px; padding: 12px; border-left: 4px solid var(--muted); border-radius: 0 10px 10px 0; background: var(--notice-bg); }
.tb-corridor > .field__label { margin-bottom: 8px; padding: 0; }
.tb-corridor .form-grid { margin-bottom: 0; }

/* Zonas y recorridos: lista */
.tb-zones { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.tb-zone { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 12px; padding: 12px; border: 1.5px solid var(--line); border-left: 6px solid var(--senal); border-radius: 10px; background: var(--surface); }
.tb-zone__name { font-size: 1.0625rem; font-weight: 800; overflow-wrap: anywhere; }
.tb-zone__meta { color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.tb-zone .tb-row-actions { flex-wrap: wrap; margin-top: 4px; }
.tb-zone .tb-row-actions .button { min-height: 48px; height: auto; }
.tb-zone:target { border-color: var(--text); }

/* Aviso: parte «Dónde» */
.tb-zonepanel { display: grid; gap: 12px; margin-top: 12px; padding: 12px; border: 2px dashed var(--input-border, var(--line)); border-radius: 12px; }
.tb-zonepanel > * { margin-top: 0; margin-bottom: 0; min-width: 0; }
.tb-zonepanel .tb-drawbar { margin: 0; }
.tb-zonepanel .check { display: flex; gap: 10px; align-items: flex-start; min-height: 48px; padding: 4px 0; }
.tb-zonepanel .check input { flex: none; margin-top: 4px; }
.tb-reach { margin: 0; padding: 12px 14px; border-left: 6px solid var(--senal); border-radius: 10px; background: var(--notice-bg); color: var(--text); font-size: 1.125rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.tb-reach:empty { display: none; }
.tb-reach.is-error { border-left-color: var(--bandera); background: var(--error-bg); color: var(--error-text); }

@media (min-width: 721px) {
  .tb-cellsbar { flex-wrap: nowrap; }
  .tb-cellsbar__note { margin-left: auto; text-align: right; }
  .tb-zone { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 0; align-items: center; }
  .tb-zone__name, .tb-zone__meta { grid-column: 1; }
  .tb-zone .tb-row-actions { grid-row: 1 / span 2; margin: 0 0 0 8px; }
  .tb-map.leaflet-container .leaflet-bar a { width: 40px; height: 40px; }
  .tb-zonepanel { padding: 16px; }
}
@media (max-width: 640px) {
  .tb-map { border-width: 1.5px; border-radius: 10px; }
  .tb-drawbar .button { flex: 1 1 100%; }
}

/* Privacidad pública: texto largo, medida de línea < 80 caracteres */
.tbp-privacy { padding-bottom: 28px; }
.tbp-privacy__head { display: grid; gap: 4px; padding-bottom: 16px; }
.tbp-privacy__head .tbp-lang { margin-top: 12px; }
.tbp-privacy .tbp-card__title { padding: 12px 0 0; color: var(--text); font-size: clamp(1.75rem, 7vw, 2.5rem); font-stretch: 62%; font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.tbp-privacy__updated { margin: 0; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.tbp-privacy__intro { max-width: 66ch; margin: 8px 0 0; font-size: 1.0625rem; line-height: 1.55; }
.tbp-privacy__section { padding-top: 18px; border-top: 2.5px dashed var(--line); }
.tbp-privacy__section + .tbp-privacy__section { margin-top: 22px; }
.tbp-privacy__section h2 { max-width: 66ch; margin: 0 0 10px; font-size: 1.375rem; font-stretch: 75%; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.tbp-privacy__section p, .tbp-privacy__section ul { max-width: 66ch; margin: 0 0 12px; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.tbp-privacy__section ul { padding-left: 1.25rem; }
.tbp-privacy__section li { margin-bottom: 6px; padding-left: 2px; }
.tbp-privacy__section li::marker { color: var(--muted); }
.tbp-privacy__section a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
