/* LA PRESA — app.css (T03 → T22 «Claro y al grano»): the shell and the
   shared components. Themes and the sober register come from tokens.css;
   each screen styles itself in its own sheet. Measures at 375 wide:
   docs/rediseno-a/spec-pantallas.txt. */

* { margin: 0; padding: 0; box-sizing: border-box; }
/* 2.4.11: a focused control scrolls clear of the sticky row 1 (--hdr-alto,
   app.js) and the tab bar (77), 12px of air; the quiet trip screen has neither */
html {
  -webkit-text-size-adjust: 100%; background: var(--bg);
  scroll-padding: calc(var(--hdr-alto, 44px) + 12px) 0 calc(74px + max(15px, env(safe-area-inset-bottom)));
}
@media (min-width: 720px) { html { scroll-padding-bottom: 114px; } }
html:has(#app[data-quieto]) { scroll-padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;            /* base of content (p19) */
  line-height: 1.45;
  min-height: 100svh;
  display: flex;
  justify-content: center;
}
button, input, select, textarea { font-family: inherit; }
/* Links: bold ink, not the brand (p6); underlined inside running text (1.4.1) */
a { color: var(--ink); font-weight: 700; text-decoration: none; }
p a, li a { text-decoration: underline; }

/* Phone canvas: full-bleed on a phone, framed on a wide screen */
#app {
  position: relative;
  width: 100%;
  max-width: 470px;
  min-height: 100svh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
@media (min-width: 720px) {
  html, body { background: var(--frame); }
  body { padding: 24px 0; }
  #app { border-radius: 28px; border: 1px solid var(--line); box-shadow: var(--shadow-2); min-height: calc(100svh - 48px); overflow: clip; } /* clip, not hidden: no scroll box, so #hdr sticks */
}

[data-sober="true"] .vacil { display: none !important; }
/* the ink resolved on the sober element, so text with no colour of its own goes sober too */
[data-sober="true"] { color: var(--ink); }

/* ============ Header (p6: two rows, hairline under the route) ============
   #hdr is row 1 and sticks: SIMULACIÓN never leaves the screen. 44 tall:
   under the creature's tail (43.5). */
#hdr {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  padding: calc(10px + env(safe-area-inset-top)) 20px 4px;
}
/* wraps under ~275px (200% text): the chip goes under LA PRESA, never over it */
.hdr-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 30px; }
/* p6: ring 22px (box 92 units, ring 63.92 -> 31px), the icon's face */
.hdr-creature { width: 31px; height: 31px; margin: -1px -2px; flex: none; --lp-fine: 0; --lp-gesto: 0; --lp-neutra: 1; position: relative; top: 3px; }
.hdr-wordmark {
  flex: auto; min-width: 0; /* auto, not 0%: its width counts for the wrap */
  font-size: 17px; font-weight: 700; line-height: 1.2; white-space: nowrap;
  color: var(--ink);
  letter-spacing: var(--wm-track, 0);
}
.chip-sim {
  position: relative; top: 2.4px; flex: none;
  height: 27px; min-width: 110px; padding: 0 12px 3px; border: 0; border-radius: var(--r-pill);
  background: var(--soft); color: var(--ink); text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 0; line-height: 24px;
  cursor: pointer;
}
/* drawn 110x27, tapped 44 (p19) inside row 1 (0-43.9), not on the route row */
.chip-sim::before { content: ""; position: absolute; inset: -13.9px -4px -3px; }
/* Row 2, in the flow (index.html). p18: the full name, over several lines;
   the chevron on the first one. Text and hairline where p6 draws them. */
.hdr-corridor {
  display: flex; align-items: flex-start; gap: 12px; align-self: stretch;
  min-height: 48px; margin: 1px 20px 0; padding: 10px 0 15px;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: 17px; font-weight: 700; line-height: 1.25;
  text-align: left; cursor: pointer;
}
.hdr-corridor-nombre { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hdr-chevron { flex: none; width: 12px; height: 8px; margin: 8.6px 2px 0 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Screens ============ */
/* Bottom room: the tab bar (77px) + air. overflow-x: hidden makes #screens
   a scroll box that never scrolls: nothing inside it can stick. */
#screens { flex: 1; overflow-x: hidden; padding: 6px 20px calc(100px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { #screens { padding-bottom: 124px; } }
.screen { display: none; animation: fadeUp .22s var(--ease); }
.screen.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* [data-quieto] in a screen's markup (an open trip, p7 #06): header and tab
   bar recede while it is on show (app.js mirrors it on #app). */
#app[data-quieto] #hdr, #app[data-quieto] .hdr-corridor, #app[data-quieto] #tabs { display: none; }
#app[data-quieto] #screens { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ============ Type ============ */
h1, h2 { color: var(--ink-strong); font-weight: 700; line-height: 1.2; }
.pantalla-titulo { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--ink-strong); margin-top: 8px; }
.pantalla-sub { font-size: 15px; color: var(--ink-dim); margin-top: 6px; }
.eyebrow, .card h3, .corr-grupo h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--ink-dim);
}
.card h3 { margin-bottom: 10px; }
.muted { color: var(--ink-dim); }
.tiny { font-size: 13px; color: var(--ink-dim); }
.num { font-variant-numeric: tabular-nums; }

/* ============ Back link of a sub-screen («← Ahora», LP.ui.volverHtml) ============ */
.volver {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 12px 0 0; margin: 0 0 2px;
  font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none;
}
.volver:hover { text-decoration: underline; }

/* ============ Cards ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  margin-top: 12px;
}
.card-soft { background: var(--soft); border-color: transparent; }

/* ============ Chips: provenance (p17) and the mood pill (p6) ============ */
.sello {
  display: inline-flex; align-items: center; min-height: 25px;
  padding: 3px 12px; border-radius: var(--r-pill);
  background: var(--soft); color: var(--ink);
  font-size: 11px; font-weight: 700; text-transform: uppercase; line-height: 1.2;
}
.pill-animo {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px;
  padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--soft); color: var(--ink);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ============ Shared by Ahora, ¿Salgo ya? and Avisá (the curve, the avisos) ============ */
.spark-wrap { margin-top: 4px; }
.spark { width: 100%; height: 88px; display: block; }
.spark-caption { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

.inc-item { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.inc-item:first-of-type { border-top: 0; }
.inc-kind {
  flex: none; font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 10px; margin-top: 2px;
  background: var(--soft); color: var(--ink);
}
.inc-kind.sev3 { background: var(--sobrio-soft); color: var(--sobrio-ink); }
.inc-body { flex: 1; font-size: 15px; }
.inc-meta { font-size: 13px; color: var(--ink-dim); margin-top: 3px; }
.inc-credit { color: var(--accent); font-weight: 700; }

.next-parte { text-align: center; font-size: 13px; color: var(--ink-dim); padding: 14px 0 4px; }

/* ============ Chips, the range, key-value rows ============ */
.pill {
  border: 1px solid transparent; background: var(--soft); color: var(--ink);
  min-height: 44px; padding: 10px 14px; border-radius: var(--r-full);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
/* the chosen chip: a ring in --accent too (the night --brand fill is 2.5:1 on its card) */
.pill.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); font-weight: 700; box-shadow: inset 0 0 0 2px var(--accent); }

input[type="range"] { flex: 1; accent-color: var(--brand); height: 28px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv:first-of-type { border-top: 0; }
.kv b { font-variant-numeric: tabular-nums; }

/* ============ Tab bar (p5/p6) ============ */
#tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 470px; z-index: 40;
  display: flex; justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px 0 max(15px, env(safe-area-inset-bottom)); /* p6: four equal columns */
}
@media (min-width: 720px) {
  #tabs { bottom: 24px; border-radius: 0 0 28px 28px; border: 1px solid var(--line); }
  /* the strip under the tab bar (QA #20) */
  #tabs::after {
    content: ""; position: absolute; left: -1px; right: -1px; top: 100%;
    height: 25px; background: var(--frame);
  }
}
.tab {
  flex: 0 1 64px; width: 64px; min-width: min-content; height: 55px; /* under 256px the four give way (200% text), none narrower than its label (T24: «Reporte») */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding-top: 2px; padding-inline: 3px; background: none; border: 0; border-radius: 12px; cursor: pointer;
  color: var(--ink-dim); font-size: 13px; font-weight: 400; line-height: 1.1;
}
.tab-ico { width: 24px; height: 24px; flex: none; }
.tab-lbl { white-space: nowrap; }
.tab.on { background: var(--soft); color: var(--ink); font-weight: 700; }

/* ============ Buttons (p19: 48 / 56) ============ */
.btn {
  font-size: 16px; font-weight: 700; line-height: 1.25;
  border-radius: var(--r-btn); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  padding: 11px 16px; cursor: pointer; min-height: 48px;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); min-height: 56px; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-danger { background: var(--surface); border-color: var(--peligro); color: var(--peligro); }
.btn-block { display: block; width: 100%; margin-top: 12px; }
a.btn-block { text-align: center; }
.btn-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  color: var(--ink); font-size: 15px; font-weight: 700; text-align: left;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: default; }

/* ============ Modo Director (LP.app.abrirDirector()) ============ */
#director {
  position: fixed; z-index: 46; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 470px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-2);
  max-height: 72svh; overflow-y: auto;
}
@media (min-width: 720px) { #director { bottom: 24px; border-radius: 22px; } }
#director.hidden, #tour-overlay.hidden, #modal-backdrop.hidden, .hidden { display: none; }
.dir-head { display: flex; align-items: center; gap: 8px; }
.dir-head .dir-hint { font-size: 13px; color: var(--ink-dim); flex: 1; }
#dir-close { background: none; border: 0; color: var(--ink); font-size: 16px; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: 12px; }
.dir-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.dir-row.dir-label { font-size: 13px; font-weight: 700; color: var(--ink-dim); margin-bottom: -4px; }
.dir-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 20px; min-width: 120px; }
#dir-scrub { width: 100%; height: 44px; margin-top: 8px; } /* the whole day under the thumb; 44 tall (p19) */
.dir-daybtns { display: flex; gap: 4px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
.dir-daybtns button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; font-size: 12px; font-weight: 700; padding: 6px 8px; min-height: 44px; min-width: 44px; cursor: pointer;
}
.dir-daybtns button.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.dir-fixtures { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.dir-fixtures button {
  text-align: left; font-size: 12px; color: var(--ink-dim);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 9px; cursor: pointer; line-height: 1.3;
}
.dir-fixtures button b { color: var(--ink); display: block; font-size: 11px; }

/* ============ Tour ============ */
/* «Saltar» over the caption, both 10px over the tab bar: the header (QA #19),
   the creature and the step's subject (app.js scrolls to it) stay clear */
#tour-overlay {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding-bottom: calc(72px + max(15px, env(safe-area-inset-bottom)));
}
@media (min-width: 720px) { #tour-overlay { padding-bottom: 111px; } }
#tour-caption {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 18px; max-width: 420px; width: calc(100% - 40px);
  font-size: 16px; text-align: center; box-shadow: var(--shadow-2);
}
#tour-skip {
  pointer-events: auto; order: -1; align-self: flex-end; margin: 0 max(20px, calc(50% - 210px)) 8px 0;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--r-full); padding: 8px 16px; min-height: 44px; font-size: 14px; font-weight: 700; cursor: pointer;
}

/* ============ Sheets (the modal) ============ */
#modal-backdrop {
  position: fixed; inset: 0; z-index: 70; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
#modal {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg);
  max-width: 430px; width: 100%; max-height: 82svh; overflow-y: auto; padding: 20px;
  box-shadow: var(--shadow-2);
  /* T16: a control reached with Tab clears the pinned «Listo»:
     20px padding + 48px button + 32px fade + 4px focus ring. */
  scroll-padding-bottom: 104px;
}
#modal:focus { outline: none; } /* focused on open, not a control */
#modal h2 { font-size: 22px; margin-bottom: 10px; }
#modal p { font-size: 15px; color: var(--ink-dim); margin-top: 8px; line-height: 1.55; }
#modal ul { margin: 8px 0 0 18px; color: var(--ink-dim); font-size: 15px; line-height: 1.55; }
#modal-close {
  width: 100%; margin-top: 16px;
  /* T16: pinned to the bottom of the sheet. The shadow is a mask in the
     sheet's colour: the 20px padding under it and 8px above it (inside the
     16px margin). Its 20px spread is the padding of #modal. */
  position: sticky; bottom: 0; z-index: 1;
  box-shadow: 0 12px 0 20px var(--surface);
}
/* «Entendido» (p17): primary, same size, so the mask holds */
#modal-close.cerrar-primario { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
/* T16: the mask takes the tap — this box covers it (offsets = the mask's +
   the 1px border), so a tap on the mask is a tap on «Listo». */
#modal-close::before {
  content: ""; position: absolute;
  top: -9px; right: -21px; bottom: -21px; left: -21px;
}
/* T16: more below — the text fades over the 24px above the mask, as strong
   as app.js says (--lp-mas 0..1); it lets the tap through. */
#modal-close::after {
  content: ""; position: absolute;
  left: -21px; right: -21px; bottom: calc(100% + 1px); height: 32px;
  background: linear-gradient(to bottom, transparent, var(--surface) 24px);
  pointer-events: none; opacity: var(--lp-mas, 0);
}

/* ---- The route picker (app.js): grouped list, then «¿Hacia dónde?» ---- */
.corr-buscar { margin-bottom: 4px; }
.corr-grupo h3 { margin: 16px 0 2px; }
.corr-op {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 48px; margin-top: 8px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-btn);
  color: var(--ink); font-size: 16px; font-weight: 600; text-align: left; cursor: pointer;
}
.corr-op[aria-current="true"] { background: var(--soft); border-color: var(--soft); font-weight: 700; }
.corr-op[aria-current="true"]::after { content: "✓"; flex: none; color: var(--accent); font-weight: 700; }
.sentido-ruta { font-size: 15px; color: var(--ink-dim); margin-top: 2px; }
.sentido-op {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 64px; margin-top: 12px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--ink); font-size: 18px; font-weight: 700; text-align: left; cursor: pointer;
}
.sentido-op::after { content: "→"; margin-left: auto; color: var(--accent); }
/* the choice in use: a ring and ✓ (the --soft fill alone is 1.2:1 on the sheet); Llego's wizard too */
.sentido-op[aria-current="true"] { background: var(--soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sentido-op[aria-current="true"]::after { content: "✓"; }

/* ---- A sheet as a page (app.modal(…, { pagina: true }), p17): in the
   shell, header and tab bar in view, on the app's ground ---- */
#modal-backdrop[data-pagina] { background: none; padding: 0; }
#modal-backdrop[data-pagina] #modal {
  position: fixed; top: var(--hoja-arriba, 0px); bottom: calc(62px + max(15px, env(safe-area-inset-bottom)));
  left: 50%; transform: translateX(-50%); max-width: 468px; max-height: none;
  background: var(--bg); border: 0; border-radius: 0; box-shadow: none; padding: 0 20px 20px;
}
@media (min-width: 720px) { #modal-backdrop[data-pagina] #modal { bottom: 102px; } }
#modal-backdrop[data-pagina] #modal-close { box-shadow: 0 12px 0 20px var(--bg); }
#modal-backdrop[data-pagina] #modal-close::after { background: linear-gradient(to bottom, transparent, var(--bg) 24px); }
/* p19, a short screen (200% text): the text gets the page, «Entendido» follows it */
@media (max-height: 460px) {
  #modal-backdrop[data-pagina] #modal-close { position: static; box-shadow: none; }
  #modal-backdrop[data-pagina] #modal-close::before, #modal-backdrop[data-pagina] #modal-close::after { display: none; }
}
/* The provenance page (SIMULACIÓN chip): p17's measures */
#modal .proc-titulo { font-size: 27px; margin: 12.8px 0 21px; }
#modal .proc-lead { font-size: 19px; color: var(--ink); line-height: 1.42; margin-top: 0; }
.proc-card {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 14px 21.5px; margin-top: 14.3px;
}
.proc-lead + .proc-card { margin-top: 60px; }
#modal .proc-card p { margin-top: 7.9px; font-size: 14px; line-height: 20.3px; }
#modal .proc-nota { font-size: 14px; margin-top: 12px; }
@media (max-height: 700px) { .proc-lead + .proc-card { margin-top: 24px; } } /* p18: the explanation compacts */

/* ============ Chat ============ */
/* 30px: the icon's neutral face, no fine detail (p5); grey under a grave incident (creatureState) */
.chat-creature { width: 30px; height: 30px; flex: none; --lp-fine: 0; --lp-gesto: 0; --lp-neutra: 1; }
.chat-log { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; min-height: 30vh; }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; color: var(--ink); }
.msg.user { align-self: flex-end; background: var(--soft); border: 1px solid var(--soft); }
.msg.presa { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.msg.presa.sober { border-color: var(--line-sobria); }
.chat-chips { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 10px; }
/* In the flow (nothing sticks inside #screens). Up to 700px tall the log
   gives way and the 44px chips take one row that scrolls sideways, so the
   field stays above the tab bar at 360x640 and 320x568. */
.chat-inputrow { display: flex; gap: 8px; padding: 8px 0; }
.chat-inputrow input {
  flex: 1; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-campo); border-radius: var(--r-full);
  padding: 11px 16px; min-height: 48px;
  min-width: 0; /* 320px: the field gives way */
}
@media (max-height: 700px) { .chat-log { min-height: 14vh; } .chat-chips { flex-wrap: nowrap; overflow-x: auto; } .chat-chips .pill { flex: none; } }
.chat-inputrow input:focus { outline: 2px solid var(--mood-text); border-color: transparent; }

/* ============ Forms ============ */
label.fld { display: block; margin-top: 14px; font-size: 14px; color: var(--ink); font-weight: 700; }
label.fld input, label.fld select, label.fld textarea, .campo {
  display: block; width: 100%; margin-top: 6px; font-size: 16px; font-weight: 400;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-campo);
  border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
textarea { resize: vertical; }
::placeholder { color: var(--ink-dim); opacity: 1; } /* not the browser's #757575 (3.6:1 at night) */

/* ============ Focus visibility (a11y) ============ */
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--mood-text); outline-offset: 2px;
}
a:focus-visible, summary:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--mood-text); outline-offset: 2px;
}

/* ============ Share preview ============ */
/* T16: the preview gives way so «Descargar PNG» (56px) stays whole above
   «Listo» (48px); 320px = the rest of the sheet, title on two lines. */
.share-thumb {
  width: auto; max-width: 100%; max-height: calc(82svh - 320px); margin: 0 auto;
  border-radius: var(--r-md); border: 1px solid var(--line); display: block;
}

/* ============ Paso a emergencias (registro sobrio) ============ */
/* B's incident signage (p10, p20): white card, slate edge, the warning sign in ink */
.emergencia-callout {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line-sobria);
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.emergencia-callout:not(:has(.em-titulo)) { display: flex; } /* the line hangs beside the sign */
.em-titulo { margin-bottom: 8px; font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--ink-strong); }
.em-aviso { width: 20px; height: 20px; margin-right: 8px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.em-aviso circle { fill: currentColor; stroke: none; }

/* ============ Escalera de multas (pilar emergencias) ============ */
.escalon { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.escalon:first-of-type { border-top: 0; }
.escalon-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--soft); border: 0;
  color: var(--ink); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.escalon-body { flex: 1; min-width: 0; }
.escalon-que { font-size: 16px; font-weight: 600; } /* the law's own words: base size (p19) */
.escalon-monto { font-size: 18px; font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; margin: 3px 0 4px; }
.escalon-monto .tiny { font-weight: 400; color: var(--ink-dim); }

/* ============ El Reporte (parte.css styles the rest) ============ */
.parte-lines p { margin: 6px 0; font-size: 16px; line-height: 1.5; }
/* an archive is a white card like any other, told by its note, never by dimming (AA) */
.archival-note { font-size: 13px; color: var(--ink-dim); margin-bottom: 8px; }
details summary { cursor: pointer; }
details summary::-webkit-details-marker { color: var(--ink-dim); }

/* ============ Stat tiles (Mi Presa / La Voz) ============ */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.tile .t-big { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.tile .t-lbl { font-size: 13px; color: var(--ink-dim); margin-top: 3px; line-height: 1.35; }
.tile.wide { grid-column: 1 / -1; }
.tiles-sobrias .t-big { color: var(--ink-strong); }
.tiles-sobrias .tile { border-color: var(--line-sobria); }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-top: 10px; }
.bars .bar { flex: 1; border-radius: 6px 6px 2px 2px; background: var(--line); position: relative; }
.bars .bar i { display: block; position: absolute; bottom: -18px; width: 100%; text-align: center; font-style: normal; font-size: 11px; color: var(--ink-dim); }

/* ============ Motion: optional (p19) ============ */
/* No transitions at all: a .01ms one still runs one frame in which layout
   reports the old value (Llego measured a margin mid-change). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition: none !important; scroll-behavior: auto !important;
  }
  .screen { animation: none; }
}

/* ============ Print (carta para tu jefe) ============ */
/* NX-02: only the letter, full width, black on white, one page — the rest is
   gone (not hidden: hidden kept its room), its ancestors drop the column */
@media print {
  :root { color-scheme: light !important; } /* the page margin too, in the night theme */
  html, body { background: #fff !important; }
  body.print-carta *:not(:has(#carta-text)):not(#carta-text) { display: none !important; }
  body.print-carta :has(#carta-text) {
    display: block !important; position: static !important; max-width: none !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important;
  }
  body.print-carta #carta-text { color: #000; background: #fff; border: 0; border-radius: 0; padding: 0; margin: 0; font-size: 12pt; }
}
