/* APP1 — brand direction A, "Libro mayor" (F&B H-41): paper canvas, tinta, one brand colour for the wordmark and the
   single action; IBM Plex Sans at medium, figures in Plex Mono tabular; square paper, 4 px buttons, hairlines only,
   no shadows, no gradients. Pages are always Día.
   APP4 (O-rg, O-rh): re-based on NATIVO design system v3 — one root block, the prototype's of 2 Nov 2026 (light), token for
   token; PEN3's state tokens folded in (R-467 (the semantic layer — each thing defined once)). The three marks have
   their three colours (H-168 (! replaces ? as the atención mark, everywhere)): ✓ cuadrado · ~ estimado · ! falta. The
   prototype's dark tokens are left out (a carry: the pages' own blocks still paint #fff). */
:root {
  --papel: #F6F5F0; --papel-2: #ECEBE4; --tinta: #141A17; --tinta-suave: #5B645F; --taberna: #1F5A43; --sobre-taberna: #F6F5F0;
  --linea: #D9DBD3; --cuadrado: #1F6E47; --estimado: #8A5A12; --falta: #A6382E;
  --cuadrado-fondo: #E4EFE8; --estimado-fondo: #F4ECDC; --falta-fondo: #F6E6E3; --taberna-fondo: #E3EDE8;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--papel); }
/* APP4: the document scrolls (the prototype's .app is a fixed frame; here the page is); the body is the column the
   shell orders — header, the tab's row, the page, the foot, the tabs. */
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--papel); color: var(--tinta);
  font: 400 16px/1.45 var(--sans); font-variant-numeric: tabular-nums lining-nums;
}
a { color: var(--taberna); }
:focus-visible { outline: 2px solid var(--taberna); outline-offset: 2px; }
.mono { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums lining-nums; }
.oculto { display: none !important; }
/* the page's side padding (the prototype's .cuerpo, on <main>); the tab bar sits in the flow after it, so nothing
   is covered on the phone */
main, body > .pie, .seg-app.sub {
  width: 100%; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
main { flex: 1 0 auto; padding-bottom: 28px; }
.sep { color: var(--tinta-suave); }
/* the type scale (v3's sizes, the same roles; the old pages keep their spacing) */
h1 { font-size: 22px; line-height: 1.15; font-weight: 500; letter-spacing: -.01em; margin: 28px 0 12px; text-wrap: balance; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-suave); }
h3 { font-size: 16px; font-weight: 500; }
.nota { font-size: 13px; color: var(--tinta-suave); }
/* DIA1: hoy — the day per locale under its SL; figures in Plex Mono tabular, states in tinta suave. */
.dia { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.pasos { display: flex; gap: 1rem; font-size: .875rem; }
.pasos a, .pasos a:visited { color: var(--taberna); }
.sociedad h2, h2.apartado { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-suave); margin: 28px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--tinta); }
.local { padding: 14px 0 16px; border-bottom: 1px solid var(--linea); }
.local h3 { font-size: 1.0625rem; font-weight: 500; margin: 0 0 6px; }
.local p { margin: 4px 0; }
.cifra { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: .875rem; }
.franjas, .costes { list-style: none; margin: 8px 0; padding: 0; }
.franjas li, .costes li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; padding: 3px 0; border-top: 1px solid var(--linea); font-size: .875rem; }
.por { color: var(--tinta-suave); font-size: .8125rem; }
.resultado { font-weight: 500; font-size: 1rem; margin-top: 8px; }
.estado { color: var(--tinta-suave); font-size: .8125rem; }
.cierres { margin-top: 20px; color: var(--tinta-suave); font-size: .875rem; }
.vacio, .pie { color: var(--tinta-suave); }
.aviso { color: var(--falta); border-left: 2px solid var(--falta); padding-left: 10px; }
.entrar form { display: grid; gap: 14px; max-width: 22rem; }
label { display: grid; gap: 4px; font-size: .875rem; color: var(--tinta-suave); }
input { font: inherit; color: var(--tinta); background: #fff; border: 1px solid var(--linea); border-radius: 0; padding: 8px 10px; }
button { font: inherit; font-weight: 500; color: var(--papel); background: var(--taberna); border: 0; border-radius: 4px; padding: 9px 16px; cursor: pointer; justify-self: start; }
.pie { margin-top: 32px; font-size: .875rem; }
.pie form { margin: 0; }
button.enlace { background: none; color: var(--taberna); padding: 0; border-radius: 0; text-decoration: underline; }
/* SEM1: semana — the nav, the margin's line, seven nights in a row (a list at phone width). */
.respuesta a, .respuesta a:visited { color: var(--taberna); }                                       /* PRE1: *Lo leí en* */
.donde { margin-top: 8px; font-size: .9375rem; }
.donde strong { font-weight: 500; }
.noches { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--linea); }
.noches li { display: grid; gap: 2px; padding: 6px 4px 0 0; font-size: .8125rem; }
.noches .noche { color: var(--tinta-suave); }
.noches a, .noches a:visited { color: var(--tinta); }
@media (max-width: 480px) {
  .franjas li, .costes li { flex-direction: column; }
  .noches { grid-template-columns: 1fr; }
  .noches li { grid-template-columns: 4.5rem 1fr; border-bottom: 1px solid var(--linea); padding: 4px 0; }
}

/* SEN1: the feed — one señal per row, the largest loss first; opened, the two weeks side by side, then its rows. */
.senales, .filas { list-style: none; margin: 0; padding: 0; }
.senal { padding: 14px 0 16px; border-bottom: 1px solid var(--linea); }
.senal h2 { font-size: 1.0625rem; font-weight: 500; margin: 0 0 6px; }
.senal p { margin: 4px 0; }
.senal a, .senal a:visited { color: var(--taberna); font-size: .875rem; }
.lineas { color: var(--tinta-suave); }
.semanas { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 2rem; }
.senal h3 { font-size: .9375rem; font-weight: 500; margin: 18px 0 6px; }
.filas li { padding: 4px 0; border-top: 1px solid var(--linea); font-size: .8125rem; overflow-wrap: anywhere; }
.filas .cifra { font-size: .8125rem; color: var(--tinta-suave); margin-right: .5rem; }

/* REG1 (F&B H-109): registro — the search, the lines, a line opened. */
.busca { display: flex; gap: .5rem; margin: 14px 0 6px; }
.busca input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--linea); background: var(--papel); color: var(--tinta); }
.busca button { font: inherit; padding: 8px 14px; border: 1px solid var(--taberna); background: var(--taberna); color: var(--papel); }
.movimientos { list-style: none; margin: 0; padding: 0; }
.movimientos .fecha { font-size: .8125rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-suave); margin-top: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--tinta); }
.movimiento a, .movimiento a:visited { display: grid; grid-template-columns: 1fr auto; gap: 2px 1rem; padding: 10px 0; border-bottom: 1px solid var(--linea); color: var(--tinta); text-decoration: none; }
.movimiento .concepto { overflow-wrap: anywhere; }
.movimiento .quien { grid-column: 1; color: var(--tinta-suave); font-size: .8125rem; }
.movimiento .importe { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; white-space: nowrap; }
.abierta { padding: 14px 0 16px; border-bottom: 1px solid var(--tinta); }
.abierta h2 { font-size: 1.0625rem; font-weight: 500; margin: 0 0 4px; overflow-wrap: anywhere; }
.abierta .importe { font-size: 1.125rem; margin: 4px 0 10px; }
.ficha { display: grid; grid-template-columns: max-content 1fr; gap: 4px 1rem; margin: 0; font-size: .875rem; }
.ficha dt { color: var(--tinta-suave); }
.ficha dd { margin: 0; overflow-wrap: anywhere; }
.ficha a, .ficha a:visited, .abierta .pasos a { color: var(--taberna); }

/* PEN1 (F&B H-109): pendientes — four sections, one line per thing waiting. */
.pendientes { margin-top: 18px; }
.pendientes h2 { font-size: .8125rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-suave); margin: 0 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--tinta); }
.pendientes ol { list-style: none; margin: 0; padding: 0; }
.pendiente a, .pendiente a:visited, .pendiente span { display: block; padding: 10px 0; border-bottom: 1px solid var(--linea); color: var(--tinta); text-decoration: none; overflow-wrap: anywhere; }
.pendiente a { color: var(--taberna); }
/* CONS1: the locales side by side — the table scrolls in its own box, never the page */
.consolidado { overflow-x: auto; margin: 16px 0 8px; }
.consolidado table { border-collapse: collapse; min-width: 100%; font-size: .875rem; }
.consolidado th, .consolidado td { padding: 8px 6px; border-bottom: 1px solid var(--linea); text-align: right; white-space: nowrap; }
.consolidado th[scope="row"] { text-align: left; font-weight: 400; color: var(--tinta-suave); }
.consolidado thead th { font-weight: 500; }
.consolidado .grupo-col { border-right: 1px solid var(--linea); font-weight: 500; }   /* CONS1b, H-162 (1): first, not pinned */
.consolidado th[scope="row"], .consolidado thead th:first-child { position: sticky; left: 0; background: var(--papel); white-space: normal; min-width: 5rem; max-width: 7.5rem; }
.consolidado tr.resultado td, .consolidado tr.resultado th { font-weight: 500; color: var(--tinta); }
/* CARD1 (H-171): the card, as the site draws it — one block, 360 px wide, the page and the WhatsApp image alike. */
.pc { max-width: 360px; margin: 28px 0; border: 1px solid var(--linea); background: #fff; font-size: 13px; line-height: 1.35; }
.pc-top { display: flex; justify-content: space-between; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--linea); }
.pc-name { color: var(--taberna); font-weight: 500; }
.pc-meta { color: var(--tinta-suave); }
.pc-hero { display: flex; flex-direction: column; padding: 12px 16px; }
.pc-big { font: 500 28px/1.2 "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.pc-partes, .pc-clave, .pc-t small { color: var(--tinta-suave); }
.pc-t { width: 100%; border-collapse: collapse; }
.pc-t th, .pc-t td { padding: 4px 16px 4px 0; text-align: right; font-weight: 400; vertical-align: top; }
.pc-t th[scope=row], .pc-t thead th:first-child { text-align: left; padding-left: 16px; }
.pc-t td { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-t small { display: block; font-size: 11px; }
.pc-t tr.total th, .pc-t tr.total td { font-weight: 500; border-top: 1px solid var(--linea); }
.pc-pct { display: block; font-size: 11px; color: var(--tinta-suave); }
.pc-m { display: inline-block; width: 14px; }
.pc-clave { padding: 6px 16px; font-size: 12px; }
.pc-avisos { padding: 8px 16px 6px; border-top: 1px solid var(--linea); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.pc-ley { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 16px; border-top: 1px solid var(--linea); font-size: 11px; color: var(--tinta-suave); }
.pc-brand { margin-left: auto; color: var(--taberna); letter-spacing: .08em; }
.pc-ok { color: var(--taberna); } .pc-falta { color: var(--falta); }

/* PEN3 (O-rb, O-rc): the gate's bar, sheet, chips, summary — from the prototype */
/* The prototype's #albaran-21 (2 Nov 2026), token for token on the v3 names; its container query is a @media here.
   APP4 folded its tokens into the one root block and moved its buttons, chips and .nota to the component layer (one
   definition each). No script: two checkboxes (#corrigiendo, #rechazando) open the sheets and the editable rows. */
.cab-detalle { display: flex; align-items: center; gap: 12px; padding: 14px 0 8px; font-size: 14px; color: var(--tinta-suave); }
.cab-detalle a { color: var(--taberna); text-decoration: none; font-weight: 500; }
.cab-detalle .paso { margin-left: auto; }
.conmuta { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* buttons: in the component layer (APP4); a <label> that toggles looks like a button there too */

/* the page: on the phone the bar comes last on screen (order) and sticks to the bottom edge */
.puerta { display: flex; flex-direction: column; gap: 0; }
.puerta > .gate { order: 1; }
.puerta > .acciones { order: 3; }
.acciones { position: sticky; bottom: 0; z-index: 10; display: flex; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--linea); background: var(--papel); }
.acciones-marco { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; align-items: center; width: 100%; }
.acciones .boton { font-size: 14px; padding: 11px 8px; }
#corrigiendo:checked ~ .acciones, #rechazando:checked ~ .acciones { display: none; }

/* the sheets: Rechazar asks its motivo; Corregir holds Guardar la corrección */
.hoja { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 1040px; margin: 0 auto; flex-direction: column; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--tinta); background: var(--papel); }
#rechazando:checked ~ .hoja-rechazar, #corrigiendo:checked ~ .hoja-corregir { display: flex; }
#rechazando:checked ~ .hoja-corregir { display: none; }
.hoja h3 { font-size: 15px; font-weight: 500; margin: 0; }
.hoja p { margin: 0; }
.hoja input[type=text] { border-radius: 4px; width: 100%; }
.hoja .botones { display: flex; gap: 8px; }
.hoja .botones .boton { flex: 1; }
#corrigiendo:checked ~ .gate { padding-bottom: 180px; }

/* the paper: its summary, the total loud, the faults as the reason for the verb */
.gate { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 4px; }
.gate > *, .puerta > * { min-width: 0; }
details.lineas { overflow-x: auto; }
.ficha-papel { display: grid; gap: 4px; }
.ficha-papel .proveedor { font-size: 22px; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.ficha-papel .datos { font-size: 14px; color: var(--tinta-suave); }
.total-papel { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.total-papel .cifra { font-size: 26px; font-weight: 600; white-space: nowrap; }
.avisos-papel { display: grid; gap: 8px; }
.aviso-papel { display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding: 10px 12px; border-radius: 4px; background: var(--falta-fondo); font-size: 14px; line-height: 1.4; }
.aviso-papel .marca { color: var(--falta); font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 600; font-size: 16px; }
.aviso-papel.ok { background: var(--cuadrado-fondo); }
.aviso-papel.ok .marca { color: var(--cuadrado); }
.aviso-papel.bloquea { background: var(--falta-fondo); outline: 1px solid var(--falta); }
.aviso-papel b { font-weight: 600; }
.foto-mini { display: flex; gap: 12px; align-items: center; }
.foto-mini img { width: 72px; height: 96px; object-fit: cover; object-position: top; border: 1px solid var(--linea); background: #fff; }
.foto-mini object { width: 72px; height: 96px; border: 1px solid var(--linea); background: #fff; }
.foto-mini .nota { flex: 1; min-width: 0; }
.decidido { display: grid; gap: 6px; padding: 14px; border-radius: 4px; background: var(--cuadrado-fondo); font-size: 15px; }
.decidido.rech { background: var(--falta-fondo); }
.decidido b { font-weight: 600; }
.quien-decide { font-size: 13px; color: var(--tinta-suave); }

/* the lines, folded; a flagged line marked; Corregir shows the inputs in place of what was read */
details.lineas { border-top: 1px solid var(--tinta); }
details.lineas summary { cursor: pointer; padding: 10px 0; font-weight: 500; list-style: none; display: flex; gap: 10px; align-items: baseline; }
details.lineas summary::-webkit-details-marker { display: none; }
details.lineas summary::after { content: "▸"; margin-left: auto; color: var(--tinta-suave); }
details.lineas[open] summary::after { content: "▾"; }
details.lineas summary .nota { font-weight: 400; }
.t-lineas { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px; }
.t-lineas th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-suave); padding: 4px 6px 6px 0; border-bottom: 1px solid var(--linea); }
.t-lineas td { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--linea); vertical-align: top; }
.t-lineas td.cifra, .t-lineas th.num { text-align: right; padding-right: 0; white-space: nowrap; }
.t-lineas tr.con-aviso td { background: var(--falta-fondo); }
.t-lineas tr.con-aviso td:first-child { border-left: 3px solid var(--falta); padding-left: 6px; }
.t-lineas .n { color: var(--tinta-suave); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; width: 2ch; padding-right: 8px; }
.t-lineas input { width: 100%; min-width: 4ch; border-radius: 4px; padding: 4px 6px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 14px; }
.t-lineas td.cifra input { text-align: right; }
.gate .editable { display: none; }
.editable.campos { gap: 8px; }
#corrigiendo:checked ~ .gate .editable { display: revert; }
#corrigiendo:checked ~ .gate .editable.campos { display: grid; }
#corrigiendo:checked ~ .gate .leido { display: none; }
#corrigiendo:checked ~ .gate details.lineas::details-content { content-visibility: visible; block-size: auto; }

/* the laptop: the bar under the header, the sheet over it */
@media (min-width: 760px) {
  .puerta > .acciones { order: 0; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--linea); }
  .acciones-marco { display: flex; gap: 8px; }
  .acciones .boton { font-size: 15px; padding: 10px 16px; }
  .hoja { top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--tinta); }
  #corrigiendo:checked ~ .gate { padding-bottom: 0; padding-top: 140px; }
  .gate { grid-template-columns: 200px minmax(0, 1fr); gap: 18px 32px; align-items: start; }
  .gate > .foto-mini { grid-column: 1; grid-row: 1 / span 4; position: sticky; top: 72px; display: block; }
  .gate > .foto-mini img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
  .gate > .foto-mini object { width: 100%; height: 60vh; }
  .gate > .foto-mini .nota { display: block; margin-top: 8px; }
  .gate > :not(.foto-mini) { grid-column: 2; }
  .gate > details.lineas { grid-column: 1 / -1; }
}

/* APP4 — the component layer (App cut §5), from the prototype 2 Nov 2026 */
/* Token for token, in the prototype's order. The prototype's `.app.detalle` is `body.detalle` here and its
   `@container app` queries are `@media` (as PEN3's); the tab bar sticks to the bottom edge on the phone (the
   prototype's frame keeps it there; here the page scrolls). A class no page uses yet is still the spec. */
.barra-app { display: flex; align-items: baseline; gap: 10px; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); font-size: 14px; color: var(--tinta-suave); }
.barra-app .marca { color: var(--taberna); font-weight: 600; letter-spacing: .1em; font-size: 13px; }
.barra-app .grupo { color: var(--tinta); font-weight: 500; }
.barra-app .quien { margin-left: auto; }

/* tabs: bottom on the phone, top on the laptop */
.pestanas { display: flex; border-top: 1px solid var(--linea); background: var(--papel); padding-bottom: env(safe-area-inset-bottom, 0px); position: sticky; bottom: 0; z-index: 15; }
.pestanas a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 8px 4px 9px; text-decoration: none; color: var(--tinta-suave); font-size: 11px; font-weight: 500; letter-spacing: .02em; position: relative; }
.pestanas a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pestanas a[aria-current="page"] { color: var(--taberna); }
.pestanas .globo { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--falta); color: #fff; font: 600 11px/18px var(--mono); text-align: center; }
body.detalle .pestanas { display: none; }

.cab-pagina { display: grid; gap: 6px; padding-top: 6px; }
.cab-pagina .fecha { font-size: 14px; color: var(--tinta-suave); }

/* the segmented control (locales, periods); APP4's row of the tab's routes is the same control, as links */
.seg-app { display: flex; gap: 0; border: 1px solid var(--linea); border-radius: 4px; overflow: hidden; width: fit-content; max-width: 100%; }
.seg-app button { flex: 1; background: transparent; border: 0; padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--tinta-suave); white-space: nowrap; }
.seg-app button[aria-pressed="true"] { background: var(--papel-2); color: var(--tinta); }
.seg-app a { flex: 1; padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--tinta-suave); white-space: nowrap; text-decoration: none; text-align: center; }
.seg-app a[aria-current="page"] { background: var(--papel-2); color: var(--tinta); }
.seg-app.sub { border: 0; border-radius: 0; overflow-x: auto; gap: 6px; padding-top: 2px; padding-bottom: 4px; }
.seg-app.sub a { flex: none; border: 1px solid var(--linea); border-radius: 4px; }
.chips-filtro { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips-filtro button { flex: none; border: 1px solid var(--linea); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--tinta-suave); }
.chips-filtro button[aria-pressed="true"] { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }
.chips-filtro .n { font-family: var(--mono); margin-left: 4px; }

/* the hero figure */
.heroe { display: grid; gap: 4px; padding: 18px 0 16px; border-top: 1px solid var(--tinta); border-bottom: 1px solid var(--linea); }
.heroe .titulo { font-size: 14px; color: var(--tinta-suave); }
.heroe .grande { font: 600 36px/1 var(--mono); letter-spacing: -.01em; display: flex; align-items: baseline; gap: 8px; }
.heroe .grande .marca { font-size: 24px; }
.heroe .linea2 { font-size: 14px; color: var(--tinta-suave); }
.heroe .linea2 .cifra { color: var(--tinta); }
.marca { font-family: var(--mono); font-weight: 600; }
.ok { color: var(--cuadrado); } .est { color: var(--estimado); } .falta { color: var(--falta); }
.delta-ok { color: var(--cuadrado); } .delta-falta { color: var(--falta); }

/* sections and rows */
.seccion { display: grid; gap: 8px; }
.seccion-cab { display: flex; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--tinta); }
.seccion-cab .n { font-family: var(--mono); font-weight: 600; color: var(--tinta); }
.seccion-cab a { margin-left: auto; font-size: 13px; text-decoration: none; font-weight: 500; }
.filas { list-style: none; margin: 0; padding: 0; }
.fila { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--linea); }
.fila .que { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.fila .meta { grid-column: 1; font-size: 13px; color: var(--tinta-suave); min-width: 0; }
.fila .cuanto { grid-column: 2; grid-row: 1 / span 2; text-align: right; white-space: nowrap; }
.fila .cuanto .cifra { display: block; font-size: 15px; }
.fila .cuanto .nota { display: block; }
.fila.enlace { cursor: pointer; }
.fila a.todo { position: absolute; inset: 0; }
.fila .verbo { grid-column: 2; grid-row: 1 / span 2; }
.fila.abajo { grid-template-columns: minmax(0,1fr); }
.fila.abajo .cuanto { grid-column: 1; grid-row: auto; text-align: left; margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 640px) { .fila.abajo { grid-template-columns: minmax(0,1fr) auto; } .fila.abajo .cuanto { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; justify-content: flex-end; } }
.estado { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
p.estado { display: block; }                 /* the old pages' state paragraphs keep their line until their threads */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 4px; font-size: 13px; line-height: 1.3; background: var(--papel-2); }
.chip .marca { font-size: 13px; }
.chip.falta { background: var(--falta-fondo); color: var(--tinta); }
.chip.est { background: var(--estimado-fondo); color: var(--tinta); }
.chip.ok { background: var(--cuadrado-fondo); color: var(--tinta); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* buttons (PEN3's rule merged: one definition; a <label> that toggles is a button too) */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--taberna); background: var(--taberna); color: var(--sobre-taberna); border-radius: 4px; padding: 10px 16px; font-weight: 600; font-size: 15px; line-height: 1.2; white-space: nowrap; text-decoration: none; }
label.boton, button.boton { cursor: pointer; }
.boton.secundario { background: transparent; color: var(--tinta); border-color: var(--linea); }
.boton.pequeno { padding: 6px 12px; font-size: 13px; }
.boton.peligro { background: transparent; color: var(--falta); border-color: var(--linea); }
.boton:disabled { opacity: .45; cursor: default; }
.enlace-btn { background: none; border: 0; padding: 0; color: var(--taberna); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }

/* the proposal card — the product (H-187): evidence · euros against doing nothing · the action · sí / no / luego */
.propuesta { display: grid; gap: 10px; padding: 14px 14px 12px; border: 1px solid var(--linea); border-left: 3px solid var(--taberna); border-radius: 0 4px 4px 0; background: var(--papel); }
.propuesta .titulo { font-weight: 500; font-size: 16px; }
.propuesta .evidencia { font-size: 14px; color: var(--tinta-suave); }
.propuesta .si { font-size: 15px; }
.propuesta .euros { font-family: var(--mono); font-weight: 600; font-size: 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.propuesta .euros .num { white-space: nowrap; }
.propuesta .euros small { font: 400 13px/1.3 var(--sans); color: var(--tinta-suave); }
.propuesta .botones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.propuesta .botones .enlace-btn { margin-left: auto; font-size: 13px; }
.propuesta.contestada { border-left-color: var(--cuadrado); }
.propuesta .respuesta { font-size: 14px; color: var(--cuadrado); font-weight: 500; }

/* tu caja */
.caja { display: grid; gap: 6px; font-size: 15px; }
.caja .l { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: baseline; }
.caja .l .cifra { text-align: right; }
.caja .l.total { border-top: 1px solid var(--linea); padding-top: 6px; font-weight: 500; }

/* the P&L table — three columns that survive the phone: the label on its own line, the three figures under it */
.pyg { display: grid; gap: 0; }
.pyg .cab, .pyg .r { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; }
.pyg .cab { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-suave); padding: 8px 0 6px; border-bottom: 1px solid var(--tinta); position: sticky; top: 0; background: var(--papel); }
.pyg .cab small { display: block; font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 11px; }
.pyg .etq { grid-column: 1 / -1; padding-top: 10px; font-size: 14px; font-weight: 500; }
.pyg .etq small { font-weight: 400; color: var(--tinta-suave); font-size: 12px; margin-left: 6px; }
.pyg .r { padding: 2px 0 10px; border-bottom: 1px solid var(--linea); }
.pyg .r .cifra { font-size: 15px; white-space: nowrap; }
.pyg .r .cifra small { display: block; font: 400 12px/1.3 var(--sans); color: var(--tinta-suave); }
.pyg .r.total .cifra { font-weight: 600; }
.pyg .vacio-col { color: var(--tinta-suave); font-family: var(--sans); font-size: 13px; }
@media (min-width: 640px) {
  .pyg .cab, .pyg .r { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .pyg .etq { grid-column: 1; padding-top: 0; display: flex; flex-direction: column; }
  .pyg .r { align-items: center; padding: 8px 0; }
  .pyg .cab::before { content: ""; }
}

/* toast — CSS only: nothing shows it yet (HOY2 / PEN4 render it server-side) */
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 32px); background: var(--tinta); color: var(--papel); padding: 10px 14px; border-radius: 4px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.toast.visible { opacity: 1; }
body { position: relative; }

/* empty states */
.vacio { display: grid; gap: 6px; padding: 18px 14px; border: 1px dashed var(--linea); border-radius: 4px; color: var(--tinta-suave); font-size: 14px; }
.vacio b { color: var(--tinta); font-weight: 500; }
p.vacio, span.vacio, td.vacio { display: revert; gap: 0; padding: 0; border: 0; border-radius: 0; font-size: inherit; }   /* the old pages' words, until their threads */

/* ——— the laptop: the tabs under the wordmark, the page centred at 1040 px ——— */
@media (min-width: 760px) {
  .barra-app { order: -2; }
  .pestanas { order: -1; position: static; border-top: 0; border-bottom: 1px solid var(--linea); padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); justify-content: flex-start; gap: 4px; }
  .pestanas { padding-left: max(12px, calc((100% - 1040px) / 2 + 12px)); }   /* APP4: under the wordmark (the prototype starts at the frame's edge) */
  .pestanas a { flex: none; grid-auto-flow: column; align-items: center; gap: 8px; padding: 12px 12px 10px; font-size: 14px; border-bottom: 2px solid transparent; }
  .pestanas a[aria-current="page"] { border-bottom-color: var(--taberna); }
  .pestanas a svg { width: 18px; height: 18px; }
  .pestanas .globo { position: static; margin-left: 2px; }
  body.detalle .pestanas { display: flex; }
  main, body > .pie, .seg-app.sub { max-width: 1040px; width: 100%; margin-left: auto; margin-right: auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
  .barra-app { max-width: 1040px; width: 100%; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
  .heroe .grande { font-size: 44px; }
  .toast { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* HOY2 — the owner's morning (the prototype's #hoy): one column on the phone, Tu caja beside Te espera on the laptop */
.hoy-pagina { display: grid; gap: 22px; align-content: start; }
@media (min-width: 760px) { .dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; align-items: start; } }
@media (max-width: 759px) { .dos-col { display: grid; gap: 22px; } }

/* PEN4 — Te espera as the prototype's #espera: the chips are links (no script, O-rk open), the toast stays in view
   on a page that scrolls (APP4's .toast is absolute over the body), the row's verb is a one-button form, Otro… opens
   the key's full form under its row */
.chips-filtro a { flex: none; border: 1px solid var(--linea); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--tinta-suave); text-decoration: none; }
.chips-filtro a:first-child { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }
.cab-pagina .volver { font-size: 14px; text-decoration: none; color: var(--tinta-suave); }
.toast { position: fixed; }
.fila form.en-fila { display: inline; margin: 0; }
.fila.abajo details.otro { flex-basis: 100%; }
.fila.abajo details.otro summary { display: inline-block; list-style: none; cursor: pointer; }
.fila.abajo details.otro summary::-webkit-details-marker { display: none; }
.fila.abajo details.otro form { display: grid; gap: 8px; margin-top: 8px; }
