/* 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);
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0 20px;
}
.subtabs a {
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.subtabs a:hover { color: var(--text); border-color: var(--input-border); }
.subtabs a[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.subtabs__count { font-weight: 400; opacity: 0.75; }

.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; }
}

.subtabs__count--alert { padding: 0 7px; border-radius: 999px; background: var(--senal); color: var(--asfalto); font-weight: 700; opacity: 1; }

/* 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; }

/* Árbol de carpetas */
.task-tree { position: sticky; top: 20px; 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: 6px 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 */
.task__check { position: relative; display: block; width: 24px; height: 24px; margin: 0; padding: 0; border: 2px solid var(--input-border); border-radius: 6px; background: var(--surface); cursor: pointer; }
.task__check:hover { border-color: var(--text); }
.task__check:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.task__check[aria-pressed="true"] { border-color: var(--button-bg); background: var(--button-bg); }
.task__check[aria-pressed="true"]::after { content: ""; position: absolute; left: 6px; top: 1px; width: 6px; height: 12px; border: solid var(--button-text); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.task__check--large { width: 34px; height: 34px; border-radius: 8px; }
.task__check--large[aria-pressed="true"]::after { left: 10px; top: 3px; width: 8px; height: 16px; border-width: 0 3px 3px 0; }
.task__check[disabled] { opacity: 0.6; cursor: progress; }
.task__check--static { cursor: default; }
.task__check--static:hover { border-color: var(--input-border); }
.task__check--static[data-done="false"] { border-style: dashed; opacity: 0.55; }
.task__check--static[data-done="true"] { border-color: var(--button-bg); background: var(--button-bg); }
.task__check--static[data-done="true"]::after { content: ""; position: absolute; left: 6px; top: 1px; width: 6px; height: 12px; border: solid var(--button-text); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.task__check--large.task__check--static[data-done="true"]::after { left: 10px; top: 3px; width: 8px; height: 16px; border-width: 0 3px 3px 0; }

/* 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: 1fr; }
}

@media (max-width: 860px) {
  .tasks-layout { grid-template-columns: 1fr; gap: 16px; }
  .task-tree { 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; }
}
