/*
 * Lectern · hoja de estilos del panel. Fuente de verdad del diseño: docs/DESIGN.md
 * Registro product: tipografía fija en rem, un solo acento (navy), estados semánticos, 150 ms.
 */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --canvas: #f5f7fa;
  --surface: #ffffff;
  --shelf: #edf1f6;
  --ink: #111a2e;
  --ink-muted: #475569;
  --ink-faint: #5f6b7d;
  --rule: #dde3eb;
  --rule-strong: #c5cdd8;
  --navy: #1e3a8a;
  --navy-hover: #182f73;
  --navy-soft: #e9eef9;
  --navy-text: #1e3a8a;
  --on-navy: #ffffff;       /* texto sobre navy */
  --frame-bg: #ffffff;      /* fondo del contenido SCORM en la vista previa */
  --link: #2563eb;
  --focus: #2563eb;
  --ok: #166534;       --ok-bg: #ebf7ef;     --ok-rule: #b9e2c6;
  --warn: #9a4a06;     --warn-bg: #fff4e5;   --warn-rule: #f3d19e;
  --danger: #b42318;   --danger-bg: #fdeceb; --danger-rule: #f4c3bd;
  --brand-mark: #f97316;

  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --r-panel: 10px;
  --r-control: 6px;
  --sidebar: 232px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);

  /* Capas (de abajo arriba) */
  --z-sticky: 10;
  --z-nav: 20;
  --z-menu: 25;
  --z-toast: 30;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #0c111c;
    --surface: #121a29;
    --shelf: #0f1623;
    --ink: #e7ebf2;
    --ink-muted: #a9b3c3;
    --ink-faint: #8e99ab;
    --rule: #243049;
    --rule-strong: #33415c;
    --navy: #3552b5;
    --navy-hover: #3f5fc6;
    --navy-soft: #1a2542;
    --navy-text: #9db4f5;
    --link: #8fb0ff;
    --focus: #8fb0ff;
    --ok: #6fd394;     --ok-bg: #10261a;     --ok-rule: #1f4a30;
    --warn: #f2b264;   --warn-bg: #2b1d0c;   --warn-rule: #563a14;
    --danger: #ff8f86; --danger-bg: #2e1413; --danger-rule: #5c2723;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.25; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--font-mono); font-size: 0.8125rem; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); font-size: 0.8125rem; }
.prose { max-width: 68ch; }
.nowrap { white-space: nowrap; }
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: var(--z-toast);
  background: var(--navy); color: var(--on-navy); padding: 0.5rem 0.9rem; border-radius: var(--r-control); text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.25rem 0.875rem;
  background: var(--shelf);
  border-right: 1px solid var(--rule);
}
.brand {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.25rem 0.5rem;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.01em;
}
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand small { display: block; font-size: 0.6875rem; font-weight: 500; color: var(--ink-faint); letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 0.625rem;
  min-height: 38px; padding: 0.4rem 0.625rem;
  border-radius: var(--r-control);
  color: var(--ink-muted); text-decoration: none; font-weight: 600;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.nav a .ph { font-size: 1.125rem; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--navy-soft); color: var(--navy-text); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 0.25rem; }
.sidebar-foot .btn { justify-content: flex-start; width: 100%; padding-inline: 0.625rem; font-size: 0.875rem; }
.sidebar-foot .btn[aria-current="page"] { background: var(--navy-soft); color: var(--navy-text); }
.sidebar-foot .faint { padding: 0.25rem 0.625rem 0; }
.sidebar-foot .faint { overflow-wrap: anywhere; }

.main { min-width: 0; padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-head .crumbs { margin-bottom: 0.35rem; font-size: 0.8125rem; color: var(--ink-faint); }
.page-head .crumbs a { color: var(--ink-muted); text-decoration: none; }
.page-head .crumbs a:hover { color: var(--ink); text-decoration: underline; }
.page-head h1 { overflow-wrap: anywhere; }
.page-head .sub { margin-top: 0.35rem; color: var(--ink-muted); }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }

/* ---------- Fichas (paneles) ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-panel); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--rule);
}
.panel-head h2 { font-size: 0.9375rem; }
.panel-body { padding: 1.125rem; }
.panel-body > * + * { margin-top: 0.875rem; }
.panel-foot { padding: 0.75rem 1.125rem; border-top: 1px solid var(--rule); background: var(--shelf); border-radius: 0 0 var(--r-panel) var(--r-panel); }

/* Lista de datos (definiciones) */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.5rem 1rem; margin: 0; }
.facts dt { color: var(--ink-faint); font-size: 0.8125rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Resumen del panel: una línea de cifras, no tarjetas de métrica */
.summary { display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; padding: 1rem 1.125rem; }
.summary div { display: flex; align-items: baseline; gap: 0.4rem; }
.summary strong { font-size: 1.125rem; font-weight: 700; }
.summary span { color: var(--ink-muted); }

/* ---------- Tejuelo (código) ---------- */
.tag {
  display: inline-block;
  padding: 0.0625rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  background: var(--shelf);
  color: var(--ink);
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; line-height: 1.5;
  white-space: nowrap; text-decoration: none;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
a.tag:hover { border-color: var(--navy); background: var(--navy-soft); color: var(--navy-text); }
.tag-retired { color: var(--ink-faint); text-decoration: line-through; }

/* Insignias de estado (texto + color, nunca solo color) */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.0625rem 0.5rem; border-radius: var(--r-control);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--rule); background: var(--shelf); color: var(--ink-muted);
}
.badge-ok { background: var(--ok-bg); border-color: var(--ok-rule); color: var(--ok); }
.badge-warn { background: var(--warn-bg); border-color: var(--warn-rule); color: var(--warn); }
.badge-navy { background: var(--navy-soft); border-color: transparent; color: var(--navy-text); }
.badge-danger { background: var(--danger-bg); border-color: var(--danger-rule); color: var(--danger); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 36px; padding: 0.4rem 0.875rem;
  border: 1px solid var(--rule-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}
.btn .ph { font-size: 1.0625rem; }
.btn:hover { background: var(--shelf); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.btn-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger-rule); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: var(--on-navy); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-muted); }
.btn-quiet:hover { background: var(--shelf); color: var(--ink); }
.btn-sm { min-height: 30px; padding: 0.25rem 0.6rem; font-size: 0.8125rem; }
.btn-icon { padding: 0; width: 32px; min-height: 32px; }
.btn.is-busy { pointer-events: none; opacity: 0.75; }
.inline-form { display: inline; margin: 0; }
.btn-block { width: 100%; }
.h-card { font-size: 1.125rem; }
.break { overflow-wrap: anywhere; }

/* Menú desplegable de acciones (Publicar en Moodle): capa flotante, no una ficha dentro de otra. */
details.inline-form { position: relative; display: inline-block; }
.menu {
  position: absolute; right: 0; top: calc(100% + 0.375rem); z-index: var(--z-menu);
  width: min(300px, 86vw); padding: 0.875rem;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-panel);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 10%, transparent);
  text-align: left; white-space: normal;
}
.menu .field + .field { margin-top: 0.75rem; }
.menu .form-actions { margin-top: 0.75rem; }
.menu-sep { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); }
.menu-sep .help { margin-top: 0.35rem; }
.search-pop { margin-top: 0.5rem; }
.search-wide { max-width: none; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; width: 100%; }
.filters .select { width: auto; flex: 1 1 180px; }
.filters .input { flex: 2 1 200px; width: auto; }
.fieldset { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field + .field { margin-top: 1rem; }
.field label, .label { font-weight: 600; font-size: 0.8125rem; }
.field .help { color: var(--ink-faint); font-size: 0.8125rem; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 0.45rem 0.65rem;
  border: 1px solid var(--rule-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.textarea { min-height: 88px; resize: vertical; }
.input::placeholder { color: var(--ink-faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input-code { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.01em; }
.form-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; }
.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 1.25rem; }
.search { display: flex; gap: 0.5rem; max-width: 420px; flex: 1 1 260px; }
.field .search { flex: none; }  /* dentro de un .field (columna) el flex-basis haría la fila altísima */

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0.4rem; max-height: 280px; overflow: auto; padding: 0.25rem; }
.check {
  display: flex; align-items: flex-start; gap: 0.55rem;
  padding: 0.5rem 0.625rem; border: 1px solid var(--rule); border-radius: var(--r-control);
  cursor: pointer; transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.check:hover { border-color: var(--rule-strong); }
.check:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.check input { margin-top: 0.2rem; accent-color: var(--navy); }
.check span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Avisos ---------- */
.notice {
  display: flex; gap: 0.625rem; align-items: flex-start;
  padding: 0.75rem 0.875rem; border: 1px solid var(--rule); border-radius: var(--r-control);
  background: var(--shelf);
}
.notice .ph { font-size: 1.125rem; margin-top: 0.05rem; flex: none; }
.notice-success { background: var(--ok-bg); border-color: var(--ok-rule); color: var(--ok); }
.notice-error { background: var(--danger-bg); border-color: var(--danger-rule); color: var(--danger); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-rule); color: var(--warn); }
.notice-info { background: var(--navy-soft); border-color: transparent; color: var(--navy-text); }
.notice p + p { margin-top: 0.25rem; }
.flashes { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }

/* ---------- Tablas ---------- */
.table-wrap { width: 100%; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.625rem 1.125rem; text-align: left; vertical-align: middle; }
.table thead th {
  background: var(--shelf); color: var(--ink-muted);
  font-size: 0.75rem; font-weight: 600;
  border-bottom: 1px solid var(--rule);
}
.table thead th:first-child { border-top-left-radius: var(--r-panel); }
.table thead th:last-child { border-top-right-radius: var(--r-panel); }
.table tbody tr + tr td { border-top: 1px solid var(--rule); }
.table tbody tr { transition: background-color 150ms var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--shelf) 60%, transparent); }
.table .num { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .title-cell { min-width: 12rem; }
.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--navy-text); text-decoration: underline; }
.table .group-start td { border-top: 1px solid var(--rule-strong); }

/* ---------- Listas simples ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; padding: 0.625rem 1.125rem; }
.list li + li { border-top: 1px solid var(--rule); }
.list .grow { min-width: 0; flex: 1; overflow-wrap: anywhere; }

/* ---------- Vacíos ---------- */
.empty { padding: 2rem 1.25rem; text-align: center; color: var(--ink-muted); }
.empty .ph { font-size: 1.75rem; color: var(--ink-faint); }
.empty h3 { margin: 0.5rem 0 0.25rem; color: var(--ink); }
.empty .btn { margin-top: 0.875rem; }
.empty .prose { margin-inline: auto; }

/* ---------- Importar: zona de subida ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 220px; padding: 2rem 1.25rem; text-align: center;
  border: 1.5px dashed var(--rule-strong); border-radius: var(--r-panel);
  background: var(--surface); cursor: pointer;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.dropzone .ph { font-size: 2rem; color: var(--navy-text); }
.dropzone strong { font-size: 1rem; }
.dropzone:hover, .dropzone.is-over { border-color: var(--navy); background: var(--navy-soft); }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.progress { margin-top: 1rem; }
.progress-track { height: 6px; border-radius: 3px; background: var(--shelf); overflow: hidden; }
.progress-bar { height: 100%; background: var(--navy); transform-origin: left; transform: scaleX(0); transition: transform 150ms linear; }
.progress-label { display: flex; justify-content: space-between; margin-top: 0.4rem; font-size: 0.8125rem; color: var(--ink-muted); }

/* Revisión de la importación: SCO numerados en su orden real */
.sco-list { list-style: none; margin: 0; padding: 0; counter-reset: sco; }
.sco-list li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.25rem 0.75rem; padding: 0.625rem 1.125rem; }
.sco-list li + li { border-top: 1px solid var(--rule); }
.sco-list li::before { counter-increment: sco; content: counter(sco); color: var(--ink-faint); font-family: var(--font-mono); font-size: 0.8125rem; padding-top: 0.1rem; }
.sco-list .href { grid-column: 2; color: var(--ink-faint); font-family: var(--font-mono); font-size: 0.75rem; overflow-wrap: anywhere; }

/* ---------- Zona peligrosa ---------- */
.danger-zone { border-color: var(--danger-rule); }
.danger-zone .panel-head { border-bottom-color: var(--danger-rule); }
.danger-zone h2 { color: var(--danger); }
details.reveal > summary { cursor: pointer; list-style: none; }
details.reveal > summary::-webkit-details-marker { display: none; }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card-wide { max-width: 460px; margin-inline: auto; }
.auth-card .brand { margin-bottom: 1.5rem; padding: 0; }
.auth-card .panel-body { padding: 1.5rem; }

/* ---------- Verificación pública de certificados ---------- */
.verify { min-height: 100dvh; display: grid; place-items: start center; padding: clamp(1.5rem, 6vw, 4rem) 1rem; }
.verify-card { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 1.25rem; }
.verify-card .brand { padding: 0; }
.verify-status { display: flex; gap: 0.875rem; align-items: flex-start; padding: 1.125rem; border-bottom: 1px solid var(--rule); border-radius: var(--r-panel) var(--r-panel) 0 0; }
.verify-status .ph { font-size: 2rem; flex: none; }
.verify-status h1 { font-size: 1.25rem; }
.verify-status p { margin-top: 0.2rem; color: var(--ink-muted); }
.verify-status.is-valid { background: var(--ok-bg); }
.verify-status.is-valid .ph, .verify-status.is-valid h1 { color: var(--ok); }
.verify-status.is-revoked { background: var(--danger-bg); }
.verify-status.is-revoked .ph, .verify-status.is-revoked h1 { color: var(--danger); }
.input-color { padding: 0.2rem; width: 4.5rem; cursor: pointer; }
.panel-body > .check + .field, .panel-body > .field + .check { margin-top: 1rem; }

/* ---------- Vista previa ---------- */
.player { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
.player-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; flex-wrap: wrap; padding: 0.625rem 1rem; border-bottom: 1px solid var(--rule); background: var(--surface); }
.player-side { overflow: auto; border-right: 1px solid var(--rule); background: var(--shelf); display: flex; flex-direction: column; }
.player-side nav a { display: block; padding: 0.6rem 1rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.player-side nav a:hover { background: var(--surface); }
.player-side nav a[aria-current="true"] { background: var(--navy-soft); color: var(--navy-text); font-weight: 600; }
.player-side nav .tag { margin-bottom: 0.2rem; }
.player-log { margin-top: auto; border-top: 1px solid var(--rule); padding: 0.75rem 1rem; }
.player-log ol { list-style: none; margin: 0.5rem 0 0; padding: 0; max-height: 220px; overflow: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-muted); }
.player-log li { padding: 0.15rem 0; overflow-wrap: anywhere; }
.player-frame { width: 100%; height: 100%; border: 0; background: var(--frame-bg); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: 64px; }
  .sidebar {
    position: sticky; top: 0; z-index: var(--z-sticky); height: auto;
    flex-direction: row; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem;
    border-right: 0; border-bottom: 1px solid var(--rule);
  }
  .brand small { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--rule);
  }
  .nav a { flex: 1; flex-direction: column; gap: 0.1rem; min-height: 48px; padding: 0.3rem 0.1rem; font-size: 0.6875rem; justify-content: center; text-align: center; }
  .nav a .ph { font-size: 1.25rem; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0; }
  .sidebar-foot .faint { display: none; }
  .main { padding: 1.25rem 1rem 2rem; }
  .form-row { grid-template-columns: minmax(0, 1fr); }

  /* Tablas → fichas apiladas */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { padding: 0.75rem 1rem; }
  .table tbody tr + tr { border-top: 1px solid var(--rule); }
  .table tbody tr + tr td { border-top: 0; }
  .table td { padding: 0.15rem 0; text-align: left; }
  .table td[data-label]::before { content: attr(data-label) " "; color: var(--ink-faint); font-size: 0.75rem; }
  .table .num, .table .actions { text-align: left; }
  .table .actions { padding-top: 0.5rem; }
  .table .group-start td { border-top: 0; }

  .player { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .player-side { max-height: 32dvh; border-right: 0; border-bottom: 1px solid var(--rule); }
  .player-log { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
