/* DEMID identity: navy menu and blocks, RE/MAX blue and red, one family (Schibsted Grotesk, SIL OFL, self-hosted: the CSP
   allows font-src 'self', see lib/fonts). Text colors are contrast-checked (4.5:1 or more on the surface they sit on). */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../lib/fonts/schibsted-grotesk-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #f5f7fb;
  --surface: #fff;
  --surface-2: #e9eef6;
  --surface-sentence: #f8fafd;
  --busy: #e9eef6; /* an occupied sala slot: distinct from the free track and the brand-tinted own booking */
  --busy-text: #33415c;
  --text: #0b1a36;
  --muted: #5b6680;
  --line: #e2e7f0;
  --line-strong: #c9d2e3;
  --control-border: #7d8aa3; /* 3.5:1 on white: inputs, secondary buttons, pending route nodes (non-text contrast â‰¥ 3:1) */
  --brand: #003da5;
  --brand-hover: #002b75;
  --brand-text: #fff;
  --current: #eef3fb; /* The stage the reservation is at: the brand tint of a badge, with brand ink and a brand ring. */
  --brand-tint: #eef3fb; /* the soft brand panel: the stage formula editor and the data-token chips */
  --navy: #071d49;
  --navy-2: #0c2a63;
  --navy-line: #1c3a75;
  --on-header: #fff; /* text and icons on the app shell (--navy): side menu, mobile top bar, sheets, navy headers */
  --menu-text: #c9d4ea;
  --menu-muted: #8fa1c7;
  --accent: #d6192b;
  --signal-alert: #d6192b; /* unread and overdue signals: a fixed alarm, never the agency's brand accent (which may change) */
  --danger: #c4172a;
  --danger-soft: #fbe3e5;
  --ok: #11734f;
  --ok-soft: #dcf1e8;
  --warn: #8a5a00;
  --warn-soft: #fdf1d8;
  --radius-control: 10px;
  --radius-panel: 16px;
  /* radius scale: 10 control, 16 panel (above); the one-off radii (3, 5, 6, 11px) and 2px, 14px, 50% stay literal */
  --radius-sm: 4px;
  --radius-row: 8px;
  --radius-card: 12px;
  --radius-pill: 999px;
  /* elevation: 1 selected segment, 2 cards and tables, 3 select picker, 4 popover, sheet, dialog */
  --shadow-1: 0 1px 2px rgba(7, 29, 73, .12);
  --shadow-2: 0 1px 3px rgba(7, 29, 73, 0.04);
  --shadow-3: 0 14px 30px rgba(7, 29, 73, .15);
  --shadow-4: 0 12px 32px rgba(7, 29, 73, .18);
  --shadow-sheet: 0 -8px 24px rgba(7, 29, 73, .3);
  --shadow-dialog: 0 12px 40px rgba(7, 29, 73, .3);
  /* stacking: base 1, raised 10, sticky and popover 20, sheet 25, tab bar 30, overlay 60, skip link 100 */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 20;
  --z-popover: 20;
  --z-sheet: 25;
  --z-tabbar: 30;
  --z-overlay: 60;
  --z-skip: 100;
  /* text floor: nothing is smaller than 12 px; 11 px is only for dense marks (sala time ruler, booking segments on the phone) */
  --font-floor: .75rem;
  --font-micro: .6875rem;
  /* colors outside the palette: white on the status fills, and the tints of the navy shell */
  --on-status: #fff;
  --danger-on-navy: #ff8a94;
  --route-done: #4f86f0;
  --route-pending: #3d5a92;
  --route-active: #ff5a68;
  --focus: #003da5;
  --tabbar-h: 4.5rem;
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
/* Figures line up (tabular) where numbers are read; on running text the font would widen its punctuation too. */
/* Tabular figures only on pure-digit counters: in this font they also widen '.', ',' and ':' inside amounts, dates and addresses. */
.badge, .navlink .badge, .tab .badge { font-variant-numeric: tabular-nums; }
body { margin: 0; line-height: 1.45; font-size: .9375rem; }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sidemenu, .mobile-top, .sheet, .bare-bar { --focus: var(--on-header); }

.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: var(--z-skip); padding: .6rem 1rem; border-radius: var(--radius-control); background: var(--surface); color: var(--text); }
.skip-link:focus { top: .5rem; }

/* App shell: one column with a navy header and a tab bar on a phone; a navy side menu and the page from 64rem. */
.shell { min-height: 100vh; }
.sidemenu { display: none; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--on-header); font-size: 1.375rem; font-weight: 800; letter-spacing: .04em; text-decoration: none; }
.brand:hover { color: var(--on-header); }
.brand-mark { width: .875rem; height: .875rem; flex: none; background: var(--accent); transform: rotate(45deg); }
.mobile-top { position: sticky; top: var(--support-h, 0px); z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; background: var(--navy); color: var(--on-header); }
.mobile-top .brand { font-size: 1.0625rem; }
.ctx-pill { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; max-width: 60%; padding: 0 .75rem; border: 1px solid var(--navy-line); border-radius: var(--radius-pill); background: var(--navy-2); color: var(--on-header); font-size: .875rem; text-decoration: none; }
.ctx-pill:hover { color: var(--on-header); }
.icon { width: 1.25rem; height: 1.25rem; flex: none; }
.ctx-pill .icon { width: .875rem; height: .875rem; }

.page { padding: 1rem 1rem calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom, 0px)); }
.bare-page { max-width: 64rem; margin: 0 auto; padding-bottom: 2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 1.25rem; margin-bottom: 1rem; }
.narrow { max-width: 26rem; margin-left: auto; margin-right: auto; }
/* the real failure on the error page, only for the DEMID staff: the stack scrolls inside its box, never the page */
.error-detail { margin-top: 1rem; }
.error-detail [data-error-message], .error-detail [data-error-request] { overflow-wrap: anywhere; }
.error-detail pre { margin: 0; padding: .75rem; max-height: 60vh; overflow: auto; font-size: var(--font-floor); line-height: 1.5; white-space: pre; background: var(--surface-sentence); border: 1px solid var(--line); border-radius: var(--radius-control); }
h1 { margin: 0 0 .75rem; font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.25rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
h2 { margin: 0 0 .75rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.req { color: var(--danger); font-weight: 700; text-decoration: none; cursor: help; }

/* The side menu and the "Más" sheet share one body: context, sections, the person's area. */
.ctx { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem; border: 1px solid var(--navy-line); border-radius: var(--radius-control); background: var(--navy-2); color: var(--on-header); text-decoration: none; }
.ctx:hover { color: var(--on-header); border-color: var(--menu-muted); }
.ctx-text { display: grid; gap: 2px; min-width: 0; }
.ctx-name { font-weight: 700; overflow-wrap: anywhere; }
.ctx-detail { color: var(--menu-text); font-size: .8125rem; }
.menu-nav { display: grid; gap: .25rem; }
.menu-nav ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.menu-heading { margin: 0; padding: .75rem .625rem .25rem; color: var(--menu-muted); font-size: .8125rem; }
.navlink { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .625rem; border-radius: var(--radius-row); color: var(--menu-text); text-decoration: none; }
.navlink:hover { background: var(--navy-2); color: var(--on-header); }
.navlink[aria-current="page"] { background: var(--brand); color: var(--brand-text); font-weight: 600; }
.navlabel { flex: 1; }
.menu-user { display: grid; gap: .25rem; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--navy-line); }
.menu-user form { display: block; }
.who { display: flex; align-items: center; gap: .625rem; padding: 0 .5rem .5rem; }
.avatar { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: none; border-radius: 50%; background: var(--navy-line); color: var(--on-header); font-weight: 700; }
.who-name { color: var(--on-header); font-weight: 600; overflow-wrap: anywhere; }
.menu-user .langnav { padding: 0 .5rem; color: var(--menu-text); }
.menu-action { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 2.75rem; padding: .5rem .625rem; border: 0; border-radius: var(--radius-row); background: none; color: var(--menu-text); font: inherit; text-align: left; }
.menu-action:hover, .menu-action[aria-pressed="true"] { background: var(--navy-2); color: var(--on-header); }
.langnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .25rem; font-size: .875rem; }
.langnav button.link { min-width: 2.75rem; min-height: 2.75rem; padding: 0 .5rem; color: inherit; text-decoration: none; }
.langnav .current { font-weight: 700; box-shadow: inset 0 -2px 0 currentColor; }

/* DEMID support mode (D2 extension): a bar that stays on top while a DEMID person works inside an agency. Its height is a variable so the
   sticky header and side menu sit under it; the text is one line, cut with an ellipsis, so the height never changes. */
.has-support { --support-h: 2.75rem; }
.support-banner { position: sticky; top: 0; z-index: var(--z-overlay); display: flex; align-items: center; justify-content: space-between; gap: .75rem; height: var(--support-h); padding: 0 1rem; background: var(--warn-soft); color: var(--warn); border-bottom: 2px solid var(--warn); font-weight: 600; }
.support-banner .support-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.support-banner form { display: block; flex: none; }
.support-banner .link { min-height: 2.75rem; color: var(--warn); font-weight: 700; }

/* Tab bar and "Más" sheet of the phone. */
.tabbar { position: fixed; z-index: var(--z-tabbar); left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px 4px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.tab { position: relative; display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 3.5rem; padding: 4px 0 0; border: 0; border-radius: var(--radius-row); background: none; color: var(--muted); font: inherit; font-size: .75rem; text-decoration: none; cursor: pointer; }
.tab:hover { color: var(--brand); }
.tab .icon { width: 1.5rem; height: 1.5rem; }
.tab[aria-current="page"] { color: var(--brand); font-weight: 700; box-shadow: inset 0 3px 0 var(--brand); }
.tab .badge.unread { position: absolute; top: 2px; left: 54%; }
.tab-more > summary { list-style: none; }
.tab-more > summary::-webkit-details-marker { display: none; }
.tab-more[open] > summary { color: var(--brand); }
.sheet { position: fixed; z-index: var(--z-sheet); left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 1rem; max-height: calc(100vh - var(--tabbar-h) - 5rem); overflow-y: auto; padding: 1rem; border-radius: var(--radius-panel) var(--radius-panel) 0 0; background: var(--navy); color: var(--menu-text); box-shadow: var(--shadow-sheet); }

@media (min-width: 64rem) {
  .shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  .sidemenu { position: sticky; top: var(--support-h, 0px); display: flex; flex-direction: column; gap: 1.25rem; height: calc(100vh - var(--support-h, 0px)); overflow-y: auto; padding: 1.25rem 1rem; background: var(--navy); color: var(--menu-text); }
  .sidemenu .brand { padding: .25rem .5rem; }
  .mobile-top, .tabbar { display: none; }
  .page { width: 100%; max-width: 82rem; margin: 0 auto; padding: 2.25rem 3rem 3rem; }
}

/* Plain pages (context selector, errors): a slim navy bar over the content. */
.bare-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; padding: .5rem 1rem; background: var(--navy); color: var(--menu-text); }
.bare-bar .langnav { margin-left: auto; }
.bare-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.bare-bar a, .bare-bar .link { color: var(--on-header); }

label { display: block; margin: .75rem 0 .25rem; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select {
  width: 100%;
  min-height: 3rem;
  padding: 0 .875rem;
  font: inherit;
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--surface);
}
/* One checkbox for the whole app: a square that fills with the brand and draws its own white check, so it reads the same on every
   surface and the browser's native look never varies. Hidden inputs (segments, switches) keep their own rules. */
input[type=checkbox] {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  appearance: none;
  border: 1.5px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
input[type=checkbox]:checked {
  border-color: var(--brand);
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4 10-10'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
}
input[type=checkbox]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type=checkbox]:disabled { border-color: var(--line-strong); background-color: var(--surface-2); cursor: not-allowed; }
input[type=checkbox]:checked:disabled { border-color: var(--muted); background-color: var(--muted); }
@media (forced-colors: active) { input[type=checkbox] { appearance: auto; } }
input[type=radio] { width: 1.25rem; height: 1.25rem; accent-color: var(--brand); }
button { font: inherit; cursor: pointer; }
button.link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; }
form.inline { display: inline; }
/* Fields the flow editor hides by the choice above them (app.js); an author rule must not undo the attribute. */
[hidden] { display: none !important; }

.alert { padding: .6rem .8rem; border-radius: var(--radius-control); margin: .5rem 0; }
.alert:empty, .alert.validation-summary-valid { display: none; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert ul { margin: 0; padding-left: 1.1rem; }

.ctx-options { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ctx-option:hover { border-color: var(--brand); }
.ctx-option { width: 100%; text-align: left; display: grid; gap: .15rem; min-height: 2.75rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.ctx-option span { color: var(--muted); font-size: .9rem; }

.links { padding-left: 1.1rem; }
.links li { margin: .35rem 0; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius-control); margin: 1rem 0 0; padding: .5rem .75rem; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin: .35rem 0; }
.more { margin: 1rem 0 0; }
.more > summary { display: flex; align-items: center; min-height: 2.75rem; padding: 0 .75rem; cursor: pointer; font-weight: 600; border: 1px dashed var(--line-strong); border-radius: var(--radius-control); }
.more[open] > summary { border-style: solid; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem .625rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { border-bottom-color: var(--line-strong); color: var(--muted); font-size: .875rem; font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; vertical-align: middle; }
td.actions > form, td.actions > a, td.actions > button, td.actions > details { display: inline-flex; align-items: center; vertical-align: middle; margin: 0 .75rem 0 0; }
.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }

.copyrow { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.copyrow input, .copyrow textarea { flex: 1 1 16rem; }

.htmx-request { opacity: .6; }

/* Editable texts (plan 6.9): a text keeps its line breaks; in editing mode every text can be clicked. */
.custom-text { white-space: pre-line; }
.text-edit .custom-text { outline: 1px dashed var(--brand); outline-offset: 2px; cursor: text; }
.text-edit .custom-text.editing { outline: 2px solid var(--brand); background: var(--warn-soft); }
.text-edit .sidemenu .custom-text, .text-edit .sheet .custom-text, .text-edit .bare-bar .custom-text { outline-color: var(--menu-muted); }
.text-edit .sidemenu .custom-text.editing, .text-edit .sheet .custom-text.editing, .text-edit .bare-bar .custom-text.editing { color: var(--text); }
.textedit-bar { display: none; }
.text-edit .textedit-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1rem;
  padding: .5rem 1rem;
  background: var(--warn-soft);
  border-top: 2px solid var(--brand);
}
.textedit-help, .textedit-state { color: var(--muted); }
.textedit-state.failed { color: var(--danger); }
.textedit-key:empty, .textedit-bar [data-text-reset] { display: none; }
.text-editing .textedit-key, .text-editing .textedit-bar [data-text-reset] { display: inline; }
textarea { width: 100%; min-height: 5.5rem; padding: .75rem .875rem; font: inherit; color: var(--text); border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--surface); resize: vertical; }
.searchrow { display: grid; gap: .25rem; max-width: 26rem; }

/* Flow configuration (Flujos). */
form.rename { display: flex; gap: .5rem; align-items: center; }
form.rename input[type=text] { min-width: 10rem; }
.badge { display: inline-block; padding: .125rem .625rem; border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--muted); font-size: .8125rem; font-weight: 600; text-align: center; }
/* The tones of a badge: neutral (the plain badge), ok, warn, danger, brand. `unread` is the notices counter (below). `.small` is
   for dense table rows only. */
.badge.ok { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.badge.warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.badge.danger { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.badge.brand { background: var(--brand-tint); color: var(--brand); font-weight: 700; }
.badge.small { padding: .125rem .5rem; font-size: var(--font-floor); font-weight: 700; }
/* The empty state of a list (`_Empty`). Two shapes: `.empty` (icon and sentence) and `.empty.block` (icon, title, text, action). The icon is
   always grey: green is only for what is done. */
.empty { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--muted); }
.empty .icon { width: 1.25rem; height: 1.25rem; flex: none; color: var(--muted); }
.empty.block { display: grid; justify-items: start; gap: .35rem; color: var(--text); }
.empty.block .icon { width: 1.5rem; height: 1.5rem; }
.empty.block p { margin: 0; }
.empty-title { font-weight: 700; }
.confirm { display: grid; gap: .5rem; }
.stages { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; }
.stage { border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 1rem; background: var(--surface); }
.stage.has-issues { border-color: var(--danger); }
.stage-head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
dl.facts { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: .25rem 1rem; margin: .5rem 0 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
dl.facts dt.facts-group { grid-column: 1 / -1; color: var(--text); font-weight: 600; margin-top: .25rem; }
dl.facts ul { margin: 0; padding-left: 1.1rem; }
ul.issues { margin: .5rem 0 0; padding-left: 1.5rem; }
.stage-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .5rem; }
.icon-action { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0; border: 0; background: none; color: var(--brand); cursor: pointer; text-decoration: none; }
.icon-action .icon { width: 1.1rem; height: 1.1rem; }
.icon-action.remove { color: var(--muted); }
/* The export rows move with two arrows: the down one is the same icon turned around. */
.icon-action.is-down .icon { transform: rotate(180deg); }
.export-row .row-remove { align-self: center; }
.stage-form { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .5rem; }
.row { display: grid; gap: .25rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-control); padding: .5rem; margin: .5rem 0; }
.row label { margin: .25rem 0 0; }
.row input[type=number], .row select, .row textarea { max-width: 100%; }
ul.field-errors { margin: .25rem 0 0; padding-left: 1.1rem; color: var(--danger); }
p.field-warning { margin: .25rem 0 0; color: var(--warn); font-size: .8125rem; font-weight: 600; }

/* Stage page: the timeline of the flow and one card per section (Responsable, Plazo, Avisos, Datos, Documentos, Cierres). */
.stage-page > h1 { margin: .25rem 0 1rem; }
.section-label { margin: 1.25rem 0 .5rem; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.card.identity { display: grid; gap: .5rem; }
.seg-field { border: 0; padding: 0; margin: .5rem 0 0; }
.seg-field legend { padding: 0; margin-bottom: .35rem; color: var(--muted); font-weight: 600; }
.seg-control { display: flex; gap: .25rem; padding: .25rem; background: var(--surface-2); border-radius: var(--radius-control); }
label.seg { position: relative; flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 2rem; margin: 0; padding: .5rem .75rem; border-radius: calc(var(--radius-control) - 2px); color: var(--muted); font-weight: 600; text-align: center; cursor: pointer; }
label.seg input { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.seg:has(input:checked) { background: var(--brand); color: var(--brand-text); }
label.seg:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.timeline-label { margin: 0 0 .75rem; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.tl-route { list-style: none; display: flex; align-items: flex-start; margin: 0; padding: 0; }
.tl-node { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.tl-node::before { content: ""; position: absolute; top: .875rem; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.tl-node:first-child::before { content: none; }
.tl-dot { position: relative; z-index: var(--z-base); display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .8125rem; }
.tl-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--font-floor); text-align: center; }
.tl-node.is-current .tl-dot { background: var(--brand); color: var(--brand-text); }
.tl-node.is-current .tl-name { color: var(--brand); font-weight: 700; }
.tl-node.is-new .tl-dot { background: var(--surface); box-shadow: inset 0 0 0 2px var(--brand); color: var(--brand); }
details.card.section { display: block; padding: 0; overflow: hidden; }
/* A fragment link to a section (the stage's "Ver los archivos") must not land under the sticky top bar. */
details.card.section { scroll-margin-top: calc(var(--support-h, 0px) + 4rem); }
.section-head { display: block; padding: 1rem; cursor: pointer; list-style: none; }
.section-head::-webkit-details-marker { display: none; }
.section-head:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.section-row { display: flex; align-items: center; gap: .5rem; }
.section-dot { width: .5rem; height: .5rem; flex: none; border-radius: var(--radius-pill); background: var(--line-strong); }
.section-dot.on { background: var(--brand); }
.section-title { color: var(--text); font-weight: 700; }
.section-chevron { margin-left: auto; color: var(--muted); font-size: 1.25rem; line-height: 1; }
.section-chevron::before { content: "\203A"; }
details[open] > .section-head .section-chevron::before { content: "\2303"; }
.section-body { padding: .25rem 1rem 1rem; border-top: 1px solid var(--line); }
.section-body h4 { margin: 1rem 0 .25rem; }
.section-summary { display: block; margin: .35rem 0 0; color: var(--muted); }
details[open] > .section-head .section-summary { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1rem; }
/* The reservation form and the files card share one column; the card is outside the form (its uploads are forms of their own). */
.form-stack { max-width: 46rem; }
/* Reservation files (P6): one block per file input inside the section body. */
.file-input { margin-top: 1rem; }
.file-input h4 { margin: 0 0 .25rem; }
.file-list { display: grid; gap: .35rem; margin: .5rem 0 .75rem; padding: 0; list-style: none; }
.file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.file-list li.deleted a { text-decoration: line-through; }
.file-upload { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
.file-upload input[type="file"] { flex: 1 1 12rem; }
.link.danger { color: var(--danger); }

/* Sentences inside the stage page (notices, deadline): the controls read as a phrase, with contextual icons. */
.sentence, .sentence-rows > .row { display: flex; flex-direction: column; gap: .5rem; padding: .75rem; margin: .5rem 0; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-sentence); }
.sentence-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.sentence-line > label { margin: 0; }
.sentence-line .icon { width: 1.1rem; height: 1.1rem; flex: none; color: var(--brand); }
.sentence-word { color: var(--text); font-size: .9rem; }
.sentence-label { color: var(--muted); font-size: .8125rem; font-weight: 600; }
.sentence-line .inline { width: auto; min-height: 2.75rem; padding: 0 .5rem; }
.sentence-line .days { width: 3.5rem; min-height: 2.75rem; padding: 0 .5rem; }
.grow { flex: 1 1 8rem; width: auto; min-width: 0; min-height: 2.25rem; }
.inline-field, .day-part { display: inline-flex; align-items: center; gap: .5rem; }
.row-remove { margin-left: auto; color: var(--muted); }
.row-remove .icon { width: 1rem; height: 1rem; color: var(--muted); }
.sentence-hint { display: flex; align-items: flex-start; gap: .5rem; margin: .25rem 0 .5rem; color: var(--muted); font-size: .85rem; }
.sentence-hint .icon { width: 1rem; height: 1rem; flex: none; margin-top: .1rem; }
.link.add-row { display: inline-flex; align-items: center; gap: .35rem; }
.link.add-row .icon { width: 1rem; height: 1rem; }
dl.facts dt .icon { width: .95rem; height: .95rem; margin-right: .35rem; vertical-align: -.15rem; color: var(--brand); }
.switch { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin: .25rem 0 .5rem; cursor: pointer; font-weight: 600; }
.switch input[type=checkbox] { appearance: none; width: 2.5rem; height: 1.4rem; flex: none; margin: 0; border: 0; border-radius: var(--radius-pill); background: var(--line-strong); position: relative; transition: background .15s ease; }
.switch input[type=checkbox]::before { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--surface); transition: transform .15s ease; }
.switch input[type=checkbox]:checked { background: var(--brand); }
.switch input[type=checkbox]:checked::before { transform: translateX(1.1rem); }
.switch input[type=checkbox]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Stacked form fields (the reservation form): the label sits above the control, so every control is the same full width. */
.field { display: grid; gap: .3rem; margin: .75rem 0; }
.field > label, .field > .field-label { margin: 0; font-weight: 600; }
.field .icon { width: 1rem; height: 1rem; margin-right: .35rem; vertical-align: -.15rem; color: var(--brand); }
.field.missing { padding-left: .6rem; border-left: 3px solid var(--warn); }
.field > .field-checks { display: grid; gap: .15rem; }
.field > .type-grid { margin-top: .15rem; }

/* Field editor: the type is a grid of segmented options (icon + text); a list offers one input per option. */
.type-block { display: flex; flex-direction: column; gap: .375rem; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
label.type-seg { position: relative; display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin: 0; padding: .5rem .625rem; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-weight: 600; font-size: .8125rem; cursor: pointer; }
label.type-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.type-seg .icon { width: 1.05rem; height: 1.05rem; flex: none; color: var(--brand); }
label.type-seg:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
label.type-seg:has(input:checked) .icon { color: var(--brand-text); }
label.type-seg:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.option-list { display: flex; flex-direction: column; gap: .375rem; }
.option-rows { display: flex; flex-direction: column; gap: .5rem; }
.option-row { display: flex; align-items: center; gap: .5rem; }

/* Field editor: the "Mostrar sólo si" picker reuses the context picker treatment (.context-select + .pick-select): one native select
   that shows the chosen "datum: value" in its closed button. */
.visibility-block { display: flex; flex-direction: column; gap: .375rem; }
/* A side's block the stage asks for, with its «Pedir sólo si» under the box (odd/tasks/etapa-inputs-condicionales.md). */
.party-requirement { display: flex; flex-direction: column; gap: .375rem; margin-bottom: .75rem; }
.party-requirement .visibility-block { padding-left: 1.5rem; }

/* Reservations (Reservas): mobile first, one column of cards. */
.titlebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .5rem; }
.titlebar h1 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; margin: .75rem 0 1.25rem; }
.filters .field { flex: 1 1 12rem; max-width: 18rem; }
.filters label { margin: 0 0 .25rem; }
.filters .check { flex: 1 1 100%; margin: 0; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.card-row { display: grid; gap: .25rem; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.card-row .row-title { color: var(--text); font-weight: 700; text-align: left; text-decoration: none; }
.card-row a.row-title:hover { color: var(--brand); text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; color: var(--muted); font-size: .9rem; }

/* Reservations home: a grid of cards, one per reservation, harmonized with the dashboard wrapper. */
.res-count { margin: 0 0 .75rem; color: var(--muted); }
.res-filters { padding: 1rem 1.25rem; }
.res-filters .filters { margin: 0; }
.res-filter-fold > summary { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; cursor: pointer; font-weight: 600; list-style: none; }
.res-filter-fold > summary::-webkit-details-marker { display: none; }
.res-filter-fold > summary .icon { width: 1rem; height: 1rem; transition: transform .15s; }
.res-filter-fold[open] > summary .icon { transform: rotate(180deg); }
.res-filter-fold[open] > summary { margin-bottom: .5rem; }
.res-filter-fold[data-wide] > summary { display: none; }
.res-grid { list-style: none; display: grid; gap: 1rem; margin: 0; padding: 0; grid-template-columns: minmax(0, 1fr); }
.res-card { display: flex; flex-direction: column; gap: .75rem; height: 100%; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); color: var(--text); text-decoration: none; }
.res-card:hover { border-color: var(--control-border); }
.res-card:hover .res-card-addr { color: var(--brand); }
.res-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.res-card-id { display: grid; flex: 1 1 auto; gap: .125rem; min-width: 0; }
.res-card-addr { font-size: 1.0625rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.res-card-client { color: var(--muted); font-size: .875rem; }
.res-card-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.res-card-items { display: grid; gap: .25rem; }
.res-item { display: flex; align-items: center; flex-wrap: wrap; gap: .375rem; font-size: .875rem; }
.res-item .icon { width: 1rem; height: 1rem; flex: none; color: var(--muted); }
.res-item-k { color: var(--muted); }
.res-item-v { font-weight: 600; }
.res-card-prog { display: grid; gap: .375rem; }
.res-card-bar { display: flex; height: .375rem; overflow: hidden; border-radius: var(--radius-pill); background: var(--surface-2); }
.res-card-seg { flex: 1 1 0; background: transparent; }
.res-card-seg.on { background: var(--brand); }
.res-card-bar.is-late .res-card-seg.on, .res-card-bar.is-cancelled .res-card-seg.on { background: var(--danger); }
.res-card-bar.is-done .res-card-seg.on { background: var(--ok); }
.res-card-prog-t { color: var(--muted); font-size: .8125rem; }
.res-card-due { display: flex; align-items: center; gap: .625rem; }
.res-card-due-icon { display: grid; place-items: center; color: var(--brand); }
.res-card-due-icon.late { color: var(--danger); }
.res-card-due-icon.ok { color: var(--ok); }
.res-card-due-icon .icon { width: 1.125rem; height: 1.125rem; }
.res-card-due-text { display: grid; gap: 1px; }
.res-card-due-label { color: var(--muted); font-size: var(--font-floor); font-weight: 700; letter-spacing: .04em; }
.res-card-due-value { font-weight: 700; }
.res-card-due-value.late { color: var(--danger); }
.res-card-due-value.ok { color: var(--ok); }
.res-card-foot { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: auto; color: var(--muted); font-size: .8125rem; }

/* Reservations Compact Data Grid (Desktop) */
.res-table-wrap { display: none; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); overflow-x: auto; box-shadow: var(--shadow-2); }
.res-table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; }
.res-table th { padding: .75rem 1rem; background: var(--bg); border-bottom: 2px solid var(--line); font-size: .8125rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.res-table td { padding: .625rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.res-table-row { cursor: pointer; transition: background .12s ease; }
.res-table-row:hover { background: var(--brand-tint); }
.res-table-row:last-child td { border-bottom: none; }
.res-td-prop { min-width: 14rem; }
.res-card-code, .res-table-code { display: block; font-size: .8125rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.op-code { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.op-code.is-new { display: inline-block; margin-left: .25rem; padding: .1rem .5rem; border-radius: var(--radius-control); background: var(--brand-tint); box-shadow: 0 0 0 2px var(--brand); }
.op-code-pending { margin: 0; }
.op-code .icon, .op-code-pending .icon { width: 1rem; height: 1rem; margin-right: .35rem; vertical-align: -.15rem; color: var(--brand); }
.op-code-badge { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.res-table-addr { font-weight: 700; color: var(--text); text-decoration: none; display: block; line-height: 1.3; }
.res-table-row:hover .res-table-addr { color: var(--brand); }
.res-table-client { font-size: .8125rem; color: var(--muted); display: block; margin-top: 2px; }
.res-td-stage { min-width: 13rem; }
.res-table-prog { display: grid; gap: .3rem; }
.res-table-stage-name { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.res-td-due { white-space: nowrap; min-width: 10rem; }
.res-due-tag { display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem; font-weight: 600; color: var(--text); }
.res-due-tag.late { color: var(--danger); }
.res-due-tag.ok { color: var(--ok); }
.res-due-tag .icon { width: 1rem; height: 1rem; flex: none; }
.res-td-agents { min-width: 9rem; font-size: .8125rem; color: var(--text); }
.res-td-action { width: 3rem; text-align: right; }
.res-td-action .button.small { padding: .25rem .5rem; min-height: 2rem; display: inline-flex; align-items: center; justify-content: center; }

@media (min-width: 64rem) {
  .res-cards { display: none; }
  .res-table-wrap { display: block; }
  
  .res-filters { padding: .75rem 1.25rem; margin-bottom: 1rem; }
  .res-filters .filters {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
  }
  .res-filters .filters .field {
    margin: 0;
    flex: 1 1 9rem;
    min-width: 8rem;
  }
  .res-filters .filters label:not(.check) {
    margin: 0 0 .25rem;
    font-size: .8125rem;
    color: var(--muted);
    font-weight: 600;
  }
  .res-filters .filters select,
  .res-filters .filters input[type=text] {
    min-height: 2.25rem;
    height: 2.25rem;
    padding: .25rem .5rem;
    font-size: .875rem;
    border-radius: var(--radius-control);
  }
  .res-filters .filters .check {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding-bottom: .35rem;
    font-size: .875rem;
    white-space: nowrap;
    align-self: flex-end;
  }
  .res-filters .filters button[type=submit] {
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0 1.25rem;
    font-size: .875rem;
    align-self: flex-end;
  }
}

.money { display: grid; grid-template-columns: 1fr 6rem; gap: .5rem; }
/* A currency with nothing to choose is fixed text, never a selector (decision 9): same height as the input beside it, not clickable. */
.currency-fixed { display: flex; align-items: center; min-height: 2.5rem; padding: 0 .25rem; color: var(--muted); font-weight: 700; }
/* The fee declaration (F2): the usual percentage on top, the amount instead only after its button; a chip that tells apart a warning. */
.fee-declare [hidden] { display: none; }
.fee-declare .fee-mode-toggle { justify-self: start; }
/* Administration's fixing screen (F3): one wide dialog; each side a tinted card; the buttons that pick a declared amount sit under their field. */
.fees-fix { margin-top: 1rem; }
.fees-fix .alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.fees-fix-dialog { width: min(40rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.fees-fix-form { display: grid; gap: 1rem; }
.fees-fix-side { display: grid; gap: .5rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-sentence); }
.fees-fix-side p, .fees-fix-side dl { margin: 0; }
.fees-fix-use { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.fees-fix-history ul { margin: .5rem 0 0; padding: 0; list-style: none; display: grid; gap: .625rem; }
.fees-fix-history li { display: grid; gap: .125rem; font-size: .875rem; }
.stage-form + .stage-form { margin-top: .5rem; }
/* Notices (Notificaciones): the badge of the top bar and the inbox. */
.badge.unread { min-width: 1.375rem; padding: 1px 7px; border-color: var(--signal-alert); border-radius: 11px; background: var(--signal-alert); color: var(--on-status); font-size: .8125rem; font-weight: 700; text-align: center; }
.card .badge.unread { border-color: var(--brand); background: var(--brand); }
.tab .badge.unread { min-width: 1.125rem; padding: 0 5px; line-height: 1.125rem; }
.card-row.notice.unread { border-left: .25rem solid var(--signal-alert); }
.filters-inline { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .5rem 0 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.panel-grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
.panel-grid > .card { margin-bottom: 0; }
.chart { width: 100%; min-height: 8rem; }
/* The panel's «Esperando» and «Dinero» (usabilidad V2): rows of a label, its amounts or count and a muted detail; a link only when the reader can open it. */
.overview { display: grid; margin: 0 0 1rem; padding: 0; list-style: none; }
.overview-row { padding: .625rem 0; border-top: 1px solid var(--line); }
.overview-row:first-child { border-top: 0; }
.overview-line { margin: 0 0 .5rem; font-weight: 700; }
.overview-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.overview-what { font-weight: 700; }
.overview-meta { display: block; color: var(--muted); font-size: .8125rem; }
.overview-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.overview-line-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .125rem .75rem; min-height: 2.75rem; color: inherit; text-decoration: none; }
a.overview-line-row:hover .overview-what { color: var(--brand); text-decoration: underline; }
.overview-amounts { display: grid; justify-items: end; text-align: right; }
.overview-line-row .overview-meta { grid-column: 2; text-align: right; }
@media (min-width: 40rem) {
  .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 63.99rem) {
  .text-edit .textedit-bar { bottom: var(--tabbar-h); }
}

/* Buttons: one family. .button is the brand fill (the primary), .secondary outlined, .danger red, .small and .wide the sizes; it has no margin of its own. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: 0 1.25rem; border: 0; border-radius: var(--radius-control); background: var(--brand); color: var(--brand-text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-hover); color: var(--brand-text); }
.button.secondary { border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font-weight: 600; }
.button.secondary:hover { background: var(--surface-2); color: var(--text); }
.button[disabled] { background: var(--line); color: var(--muted); cursor: not-allowed; }
.button .icon { width: 1.125rem; height: 1.125rem; }
/* Layout, not the button: the gap a form gives its closing submit, and a confirmation box its confirm. Zero specificity, so any rule of a container wins.
   A button in an inline form, in a filter row or among the stage actions sits in a row of its own and takes no gap; neither does a small, secondary or wide one. */
:where(:is(form:not(.filters, .inline), .confirm-box) > .button:not(.secondary, .small, .wide):not(.stage-actions *)) { margin-top: 1rem; }
/* A dialog's footer sits one step below what comes before it (zero specificity: a container's own rule wins). */
:where(.action-dialog .dialog-actions) { margin-top: 1rem; }
.eyebrow { margin: 0 0 .25rem; color: var(--muted); }
.navy-block { margin-bottom: 1.25rem; padding: 1.5rem 1.75rem; border-radius: var(--radius-panel); background: var(--navy); color: var(--on-header); }
.navy-block h2 { margin: 0 0 .75rem; color: var(--menu-text); font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; }
.big-figure { display: flex; align-items: baseline; gap: .75rem; margin: 0 0 1rem; color: var(--menu-text); }
.big-figure strong { color: var(--on-header); font-size: 4rem; font-weight: 800; line-height: .9; letter-spacing: -.03em; }
a.on-navy { color: var(--on-header); font-weight: 600; }

/* Inicio: greeting, what is waiting for the person (by urgency), the summary of the office and the latest notices. */
.home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.home-head h1 { margin: 0; }
.home-counters { display: none; }
.home-grid { display: grid; gap: 1.25rem; align-items: start; }
.home-side { display: grid; gap: 1.25rem; }
.home-side > * { margin: 0; }
.todo h2 { margin: 0 0 .25rem; font-size: 1.375rem; font-weight: 700; }
.group-title { display: flex; align-items: center; gap: .5rem; margin: 1.25rem 0 .5rem; font-size: .9375rem; font-weight: 700; }
.group-title .dot { width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: var(--brand); }
.group-title.overdue { color: var(--danger); }
.group-title.overdue .dot { background: var(--signal-alert); }
.group-title.thisweek, .group-title.later { color: var(--muted); }
.group-title.thisweek .dot, .group-title.later .dot { box-sizing: border-box; border: 2px solid var(--muted); background: none; }
.todo-list { margin: 0; padding: 0; list-style: none; }
.todo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem 1rem; padding: .875rem 0; border-top: 1px solid var(--line); }
.todo-title { color: var(--text); font-size: 1rem; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.todo-title:hover { color: var(--brand); text-decoration: underline; }
.todo-sub { grid-column: 1 / -1; color: var(--muted); }
.due { font-weight: 600; }
.due.postponed { color: var(--warn); }
.summary-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; }
.summary-facts dt { color: var(--menu-text); font-size: .8125rem; }
.summary-facts dd { margin: 0; font-size: 1.375rem; font-weight: 700; }
.summary-facts .danger dd { color: var(--danger-on-navy); }
.notices ul { display: grid; gap: .875rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.notices li { display: grid; gap: 2px; }
.notice-title { font-weight: 600; }
.notice-body { color: var(--muted); font-size: .875rem; }
.notices .is-new .notice-title::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .5rem; border-radius: 50%; background: var(--signal-alert); }

/* Agent home (the reserved /app home for the agent role): a header band, the exact counters, the attention by urgency next to
   the notices, the agent's reservations, then the upcoming events, the last two across the full width. */
.ah-header { display: grid; gap: 1rem; }
.ah-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; }
.ah-hello { display: grid; gap: .125rem; }
.ah-eyebrow { margin: 0; color: var(--muted); font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ah-top h1 { margin: 0; font-size: 1.625rem; }
/* The notices bell of the header: only the icon (a button without chrome). Filled with a count badge while there are unread
   notices; an outline, muted, when there are none. It opens the notices <dialog> (`.ah-notices-dialog`). */
.ah-name { display: flex; align-items: center; gap: .75rem; }
.ah-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; padding: 0; border: 0; border-radius: var(--radius-pill); background: none; color: var(--brand); cursor: pointer; }
.ah-bell .icon { width: 1.375rem; height: 1.375rem; }
.ah-bell.is-empty { color: var(--muted); }
.ah-bell .badge { position: absolute; top: -6px; right: -8px; }
.ah-notices-dialog .ah-notice-list { margin-bottom: 1.25rem; }
.ah-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }

/* Office home (admin): the same KPI strip and attention list as the agent home, plus the deadlines card (see below). */
.ah-sublabel { margin: 1rem 0 .25rem; color: var(--muted); font-size: var(--font-floor); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ah-sublabel.spaced { margin-top: 1.25rem; }
.ah-sublabel.danger { color: var(--danger); }
.ah-sublabel.warn { color: var(--warn); }
.ah-deadline { display: grid; gap: .25rem; padding: .625rem 0; border-top: 1px solid var(--line); }
.ah-deadline:first-of-type, .ah-sublabel + .ah-deadline { border-top: 0; }
.ah-deadline-addr { font-weight: 700; overflow-wrap: anywhere; }
.ah-deadline-stage { display: flex; align-items: center; gap: .5rem; font-size: .9375rem; }
.ah-deadline-stage .dot { width: .5rem; height: .5rem; flex: none; border-radius: 50%; }
.ah-deadline-stage .dot.danger { background: var(--signal-alert); }
.ah-deadline-stage .dot.warn { background: var(--warn); }
.ah-deadline-who { display: flex; align-items: center; gap: .375rem; color: var(--muted); font-size: .8125rem; }
.ah-deadline-who .icon { width: .875rem; height: .875rem; flex: none; }
.ah-allday { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .625rem .875rem; border-radius: var(--radius-control); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.ah-allday .icon { width: 1.125rem; height: 1.125rem; flex: none; }

.ah { display: grid; gap: 1.75rem; }
.ah > *, .ah-main > *, .ah-side > * { margin-bottom: 0; min-width: 0; }
/* The two columns of a home (odd/tasks/inicio-admin-dinero-lateral.md): `.ah-main` (the reservations, the chart) and `.ah-side` (the
   money first, then the KPI strip, the deadlines and the events). On a phone they dissolve into the one column of `.ah`, and the order
   keeps the sections as they always read: reservations, money, KPI, deadlines, chart, events, office bookings. */
.ah-main, .ah-side { display: contents; }
/* A slot loaded in place that answered nothing (`#en-espera` with nothing waiting) takes no row and no gap. */
.ah-side > :empty { display: none; }
.ah-chart { order: 1; }
.ah-events, .ah-offices { order: 2; }

.ah { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
.ah-section { display: grid; gap: .875rem; }
.ah-section h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.ah-section-row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.ah-section-row h2 { margin: 0; }
/* The home collapses from each section title: the heading holds a button that hides the body it controls (app.js). The body of a
   section keeps the spacing its grid gave the items; inside a card (the deadlines, the chart) it stays the block flow it had. */
.ah-section-toggle { display: inline-flex; align-items: center; gap: .5rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.ah-section-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--radius-sm); }
.ah-chevron { display: inline-flex; color: var(--muted); transition: transform .15s ease; }
.ah-chevron .icon { width: 1.125rem; height: 1.125rem; }
.ah-section-toggle[aria-expanded="false"] .ah-chevron { transform: rotate(180deg); }
.ah-section-body { display: grid; gap: .875rem; }
.card .ah-section-body { display: block; }
.ah-section-body[hidden] { display: none; }
/* The KPI strip is not inside the "Reservas" section (it sits in the side column), but it collapses and comes back with it. */
.ah:has(.ah-attention > .ah-section-body[hidden]) .ah-kpi { display: none; }
.ah-link { display: inline-flex; align-items: center; gap: .1rem; color: var(--brand); font-weight: 600; text-decoration: none; }
.ah-link:hover { text-decoration: underline; }
.ah-link .icon { width: 1rem; height: 1rem; }
.ah-tasks { display: grid; gap: .5rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.ah-task { display: flex; align-items: flex-start; gap: .75rem; padding: .875rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.ah-task-icon { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none; border-radius: var(--radius-row); background: var(--surface-2); color: var(--muted); }
.ah-task-icon .icon { width: 1rem; height: 1rem; }
.ah-task-body { display: grid; gap: .25rem; min-width: 0; flex: 1 1 auto; }
.ah-task-top { display: flex; align-items: center; gap: .5rem; }
.ah-task-name { color: var(--text); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.ah-task-name:hover { color: var(--brand); text-decoration: underline; }
.ah-task-when { margin-left: auto; color: var(--muted); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.ah-task-when.postponed { color: var(--warn); }
.ah-task-addr { display: flex; align-items: center; gap: .375rem; color: var(--muted); font-size: .8125rem; }
.ah-task-addr .icon { width: .875rem; height: .875rem; flex: none; }

/* The badge zone of a reservation card on the agent home (odd/tasks/inicio-agente-badges.md): the alerts wrap; «Honorarios a entregar»
   (.strong) carries a border, since handing the fees over is mandatory; «Dinero» is a native disclosure with the money detail. */
.ah-task-badges { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .375rem; margin-top: .25rem; }
.ah-task-badges a.badge { text-decoration: none; }
.ah-task-badges a.badge:hover { text-decoration: underline; }
.badge.warn.strong { border-color: var(--warn); }
.ah-money { flex-basis: 100%; }
.ah-money > summary { display: inline-flex; align-items: center; gap: .25rem; cursor: pointer; list-style: none; }
.ah-money > summary::-webkit-details-marker { display: none; }
.ah-money > summary .icon { width: .875rem; height: .875rem; transition: transform .15s; }
.ah-money[open] > summary .icon { transform: rotate(180deg); }
.ah-money-detail { display: grid; gap: .25rem; margin: .5rem 0 0; padding: .5rem .75rem; border-radius: var(--radius-row); background: var(--surface-2); list-style: none; }
.ah-money-detail li { display: grid; gap: .125rem; }
.ah-money-what { font-size: .8125rem; font-weight: 700; }
.ah-money-meta { color: var(--muted); font-size: .8125rem; }

/* The row of badges under the agent's «Reservas»: each opens a modal with the cards of its kind the home does not draw. */
.ah-alerts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.ah-alert { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; padding: 0 .875rem; cursor: pointer; font: inherit; font-size: .8125rem; font-weight: 700; }
.ah-alert-count { font-variant-numeric: tabular-nums; }
.action-dialog.ah-alerts-dialog { width: min(36rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.ah-alerts-more { margin: .75rem 0 0; }
/* «Olvidar este aviso» on a card of the office's «Demoradas» modal (odd/tasks/inicio-admin-badges.md, decision 2). */
.ah-task-forget { margin: .5rem 0 0; }


/* The KPI strip: the pending work as a count per stage, side by side (a scroll strip on a phone). The card of the item fills
   its cell, so every card in the row is as tall as the tallest one. */
.ah-kpi { display: grid; gap: .9375rem; margin: 0; padding: 0; list-style: none; grid-auto-flow: column; grid-auto-columns: minmax(9rem, 1fr); overflow-x: auto; }
.ah-kpi-card { display: grid; }
.ah-kpi-card a { display: grid; gap: .25rem; align-content: start; padding: .875rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--text); text-decoration: none; }
.ah-kpi-card a:hover { border-color: var(--brand); }
.ah-kpi-card strong { font-size: 1.625rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ah-kpi-card span { display: flex; align-items: center; gap: .25rem; color: var(--muted); font-size: .8125rem; }
.ah-kpi-card span .icon { width: .875rem; height: .875rem; flex: none; color: var(--brand); }
.ah-kpi-card a.overdue strong { color: var(--danger); }

/* Office bookings of the home: one card per booking, side by side like the events (the cards share the width, a scroll strip
   when they do not fit). Example data for now. */
.ah-offices-list { display: grid; gap: .9375rem; margin: 0; padding: 0; list-style: none; grid-auto-flow: column; grid-auto-columns: 16rem; overflow-x: auto; }
.ah-office { display: grid; gap: .5rem; align-content: start; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.ah-office-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ah-office-name { font-weight: 700; }
.ah-office-line { display: flex; align-items: center; gap: .375rem; color: var(--muted); font-size: .8125rem; }
.ah-office-line .icon { width: .875rem; height: .875rem; flex: none; color: var(--brand); }


/* Notices: the same list as the generic home, inside a card. */
.ah-notice-list { display: grid; gap: .875rem; margin: 0; padding: 0; list-style: none; }
.ah-notice-list li { display: grid; gap: 2px; }
.ah-notice-list .is-new .notice-title::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .5rem; border-radius: 50%; background: var(--signal-alert); }
.ah-events-list { display: grid; gap: .9375rem; margin: 0; padding: 0; list-style: none; grid-auto-flow: column; grid-auto-columns: 16rem; overflow-x: auto; }
.ah-event { display: grid; gap: .5rem; align-content: start; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.ah-event-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.ah-event-title { font-weight: 700; line-height: 1.25; }
a.ah-event-title { color: var(--text); text-decoration: none; }
a.ah-event-title:hover { color: var(--brand); }
.ah-event-line { display: flex; align-items: center; gap: .375rem; color: var(--muted); font-size: .8125rem; }
.ah-event-line .icon { width: .875rem; height: .875rem; flex: none; color: var(--brand); }
.ah-event-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .625rem; margin-top: .125rem; border-top: 1px solid var(--line); }
.ah-event-foot .link { white-space: nowrap; }
.button.small { min-height: 2.25rem; padding: 0 .875rem; font-size: .875rem; }

/* Reservation detail: the wrapper (above), the current stage, the side blocks and the per-stage history. */
.crumb { margin: 0 0 .75rem; font-weight: 600; }
.crumb a { text-decoration: none; }
.head-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
/* A phone reads the reservation in one column, in this order: stage, guarantee, closing values, data, actions, history. The
   main column is dissolved (contents) so its parts can be ordered among the data; on desktop it becomes the left column. */
.detail { display: flex; flex-direction: column; gap: 1.25rem; }
.detail > * { min-width: 0; margin: 0; }

/* The reservation page: one column on a phone; on a wide screen it is a split screen, the reservation on the left and the money
   panel —full height, not a card— on the right. On a phone the money is one tap away and opens over the page. */
.reservation-page { display: block; }
.current { padding: 1.5rem; }
.current h2 { margin: 0 0 1rem; font-size: 1.625rem; font-weight: 800; letter-spacing: -.01em; }
.hint { display: grid; gap: .375rem; margin: 1rem 0; padding: 1rem 1.125rem; border-radius: var(--radius-card); background: var(--bg); }
.hint span { color: var(--muted); }
.stage-actions { align-items: center; gap: .75rem; margin-top: 1rem; }
/* The deed's start asks first (_ConfirmSubmit): while its question is open it takes the whole row, so it reads at full width on a phone. */
.stage-actions form:has(> .confirm-inline[open]) { flex-basis: 100%; }
.end-note { display: grid; gap: 2px; margin: .5rem 0 0; padding: .625rem .75rem; border-radius: var(--radius-control); background: var(--warn-soft); color: var(--warn); font-size: .9rem; }
.end-note-line { margin: 0; }
.end-note .sentence-label { margin-right: .25rem; }
dl.facts dd.strong { font-weight: 700; }
.route-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: 1.25rem; }
.route-head h2 { margin: 0; }
.reopen-note { margin: .75rem 0 0; font-size: .875rem; }

/* Reservation wrapper: the same context block on the dashboard and on every derived page (the stage action forms). */
.reshead { margin-bottom: 1rem; padding: 1.25rem; }
.reshead-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: .75rem 1.5rem; }
.reshead-id { display: grid; gap: .5rem; min-width: 0; }
.reshead-addr { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.reshead-addr h1 { margin: 0; font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem); line-height: 1.2; overflow-wrap: anywhere; }
.reshead-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.reshead-due { display: flex; align-items: center; gap: .625rem; margin-left: auto; }
.reshead-due-icon { display: grid; place-items: center; color: var(--brand); }
.reshead-due-icon.late { color: var(--danger); }
.reshead-due-icon .icon { width: 1.25rem; height: 1.25rem; }
.reshead-due-text { display: grid; gap: 2px; text-align: right; }
.reshead-due-label { color: var(--muted); font-size: var(--font-floor); font-weight: 700; letter-spacing: .04em; }
.reshead-due-value { color: var(--text); font-weight: 700; }
/* Every action dialog (<action-dialog>, owner decision 2): a native <dialog>, modal, Escape and backdrop come from the element. The head is
   the large title with the X beside it; the footer (.dialog-actions) holds the primary first and the secondary «Cancelar» next to it. */
.action-dialog { width: min(30rem, calc(100vw - 2rem)); padding: 1.25rem; border: 0; border-radius: var(--radius-panel); box-shadow: var(--shadow-dialog); color: var(--text); }
.action-dialog::backdrop { background: rgba(7, 29, 73, .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.dialog-head .icon-action { flex: none; }
.action-dialog .dialog-title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
dl.facts + .dialog-actions { margin-top: .75rem; }
.reshead-due-value.late { color: var(--danger); }
.reshead-line { height: 1px; margin: 1rem 0; background: var(--line); }
.reshead-tl { display: grid; gap: .625rem; }
.reshead-tl .timeline-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin: 0; }
.tl-node.is-done .tl-dot, .tl-node.is-current .tl-dot { background: var(--brand); color: var(--brand-text); }
.tl-node.is-done .tl-name { color: var(--text); }
.tl-node.is-current .tl-name { color: var(--brand); }
/* The stage the reservation is at (its data-current node), pending or in progress: the brand tint of a badge, brand ink and a
   brand ring; done keeps the solid brand and a future stage stays grey. A late or postponed stage keeps its state colour so the
   state is never lost. */
.tl-node[data-current="true"]:not(.is-late, .is-postponed, .is-cancelled, .is-unreachable) .tl-dot { background: var(--current); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.tl-node[data-current="true"]:not(.is-late, .is-postponed, .is-cancelled, .is-unreachable) .tl-name { color: var(--brand); font-weight: 700; }
.tl-node.is-late .tl-dot { background: var(--danger); color: var(--brand-text); }
.tl-node.is-late .tl-name { color: var(--danger); font-weight: 700; }
.tl-node.is-postponed .tl-dot { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 2px var(--warn); }
.tl-node.is-na .tl-dot, .tl-node.is-pending .tl-dot { background: var(--surface-2); color: var(--muted); }
.tl-node.is-cancelled .tl-dot { background: var(--danger); color: var(--brand-text); }
/* A cancelled reservation stops at one stage: the stages after it are out of reach, drawn hollow (the connectors stay). */
.tl-node.is-unreachable .tl-dot { background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); color: var(--muted); }
.tl-node.is-unreachable .tl-name { color: var(--muted); }
.tl-note { color: var(--danger); font-size: var(--font-floor); font-weight: 600; text-align: center; }
.tl-dot .icon { width: .875rem; height: .875rem; }
/* The route drawn vertically inside the modal (the header route, one tap away): one row per stage, dot at the left, the name
   beside it. The connector runs down the dots' centre and the dots' backgrounds mask it. */
.tl-dialog { width: min(34rem, calc(100vw - 2rem)); }
.tl-route.tl-vertical { flex-direction: column; align-items: stretch; }
.tl-route.tl-vertical .tl-node { flex: 1 1 auto; flex-direction: row; align-items: center; justify-content: flex-start; gap: .75rem; min-height: 2.5rem; }
.tl-route.tl-vertical .tl-node::before { top: -50%; left: .875rem; width: 2px; height: 100%; }
.tl-route.tl-vertical .tl-name { max-width: none; overflow: visible; text-align: left; white-space: normal; }
.tl-route.tl-vertical .tl-note { text-align: left; }

/* Per-stage grouped history (replaces "Otras etapas"): one block per stage, its changes newest first, Reopen on a done stage. */
.stage-history .route-head { margin-bottom: 1rem; }
.hist-group { display: grid; gap: .5rem; padding: .875rem 0; border-top: 1px solid var(--line); }
.hist-group:first-of-type { border-top: 0; padding-top: 0; }
.hist-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.history { display: grid; gap: .375rem; margin: 0; padding: 0; list-style: none; }
.history li { padding: .5rem .75rem; border-radius: var(--radius-control); background: var(--surface-sentence); font-size: .875rem; }
.history li strong { font-weight: 700; }

@media (max-width: 63.99rem) {
  .home-head { flex-direction: column; align-items: stretch; margin: -1rem -1rem 1.25rem; padding: 1rem 1.25rem 1.375rem; background: var(--navy); color: var(--on-header); }
  .home-head .eyebrow { color: var(--menu-text); }
  .home-head a:not(.button) { color: var(--on-header); }
  .home-head .button { background: var(--surface); color: var(--brand); }
  .home-counters { display: flex; gap: .625rem; margin: 0; padding: 0; list-style: none; }
  .home-counters li { flex: 1; padding: .625rem .75rem; border-radius: var(--radius-card); background: var(--navy-2); color: var(--menu-text); font-size: .8125rem; }
  .home-counters .later { display: none; }
  .home-counters strong { display: block; color: var(--on-header); font-size: 1.625rem; font-weight: 800; }
  .home-counters .overdue strong { color: var(--danger-on-navy); }
  .todo.card { padding: 0; border: 0; background: none; }
  .todo-row { margin-bottom: .625rem; padding: .875rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .group-title { margin-top: 1rem; }
  .reshead-due-text { text-align: left; }

  /* Header route on a phone: the current stage keeps its dot, its name and a cell wide enough to read the name; the other
     stages are small dots (same glyph) and the route is capped and centred, so the connectors are short and it all fits. The
     single line behind the dots (the nodes no longer draw their own connector here) spans the route. The route opens the modal
     with the vertical route. */
  .reshead-tl .tl-route { position: relative; width: min(100%, 22rem); margin-inline: auto; justify-content: space-between; cursor: pointer; }
  .reshead-tl .tl-route::before { content: ""; position: absolute; top: .875rem; left: 0; right: 0; height: 2px; background: var(--line-strong); }
  .reshead-tl .tl-route:focus-visible { outline: 3px solid var(--focus); outline-offset: .5rem; border-radius: var(--radius-control); }
  .reshead-tl .tl-node { flex: 0 1 auto; min-width: 0; }
  .reshead-tl .tl-node::before { content: none; }
  .reshead-tl .tl-node:not([data-current="true"]) .tl-dot { width: 1.125rem; height: 1.125rem; margin-top: .3125rem; font-size: var(--font-floor); }
  .reshead-tl .tl-node:not([data-current="true"]) .tl-dot .icon { width: .625rem; height: .625rem; }
  .reshead-tl .tl-node:not([data-current="true"]) .tl-name { display: none; }

  /* Agent home on a phone: the whole header is a navy band that bleeds to the page edges. */
  .ah-header { margin: -1rem -1rem 1.5rem; padding: 1.25rem 1.25rem 1.5rem; background: var(--navy); color: var(--on-header); }
  .ah-eyebrow { color: var(--menu-muted); }
  .ah-header .ah-bell { color: var(--on-header); }
  .ah-header .ah-bell.is-empty { color: var(--menu-muted); }
  .ah-top { flex-direction: column; align-items: stretch; gap: .875rem; }
  .ah-header .button { width: 100%; background: var(--surface); color: var(--brand); }
  .ah-allday { background: var(--navy-2); color: var(--menu-text); }
}

/* When the names or the money badges of the header route do not fit (app.js measures the truncation), the route takes the phone
   look at any width: small dots, the name of the current stage only and the money back to dots. It is the same shape the phone
   gets, without the 22rem cap: the route uses the whole header. */
@media (min-width: 64rem) {
  .reshead-tl.is-compact .tl-route { position: relative; justify-content: space-between; }
  /* The connector stays: one line behind the dots, as on the phone. The route's .25rem top padding puts the dot centres at 1rem. */
  .reshead-tl.is-compact .tl-route::before { content: ""; position: absolute; top: 1rem; left: 0; right: 0; height: 2px; background: var(--line-strong); }
  .reshead-tl.is-compact .tl-node { flex: 0 1 auto; min-width: 0; }
  .reshead-tl.is-compact .tl-node::before { content: none; }
  .reshead-tl.is-compact .tl-node:not([data-current="true"]) .tl-dot { width: 1.125rem; height: 1.125rem; margin-top: .1875rem; font-size: var(--font-floor); }
  .reshead-tl.is-compact .tl-node:not([data-current="true"]) .tl-dot .icon { width: .625rem; height: .625rem; }
  .reshead-tl.is-compact .tl-node:not([data-current="true"]) .tl-name { display: none; }
}

@media (min-width: 64rem) {
  .home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.75rem; }
  .todo.card { padding: 1.5rem 1.75rem; }

  /* Reservation Detail - Desktop Density (ERP / Excel-style) */
  .crumb { margin-bottom: .5rem; font-size: .8125rem; }

  .reshead { padding: .875rem 1.25rem; margin-bottom: .875rem; }
  .reshead-top { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; }
  .reshead-id { gap: .25rem; }
  .reshead-addr { gap: .5rem; }
  .reshead-addr h1 { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
  .reshead-addr .badge { padding: .15rem .5rem; }
  .reshead-chips { gap: .35rem; }
  .reshead-chips .badge { padding: .125rem .45rem; }
  
  .reshead-top .head-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
  .reshead-top .head-actions .button,
  .reshead-top .head-actions button { min-height: 2.125rem; height: 2.125rem; padding: 0 .75rem; font-size: .8125rem; font-weight: 600; }
  
  .reshead-due { margin-left: 0; display: flex; align-items: center; gap: .5rem; padding: .25rem .625rem; border-radius: var(--radius-control); background: var(--bg); border: 1px solid var(--line); }
  .reshead-top .head-actions + .reshead-due { margin-left: 0; }
  .reshead-top:not(:has(.head-actions)) .reshead-due { margin-left: auto; }
  .reshead-due-label { font-size: var(--font-floor); letter-spacing: .05em; }
  .reshead-due-value { font-size: .8125rem; }
  .reshead-due-icon .icon { width: 1.1rem; height: 1.1rem; }

  .reshead-line { margin: .5rem 0 .625rem; }
  .reshead-tl { gap: .375rem; }
  .reshead-tl .timeline-label { font-size: .75rem; margin-bottom: .25rem; }
  .reshead-tl .tl-route { padding: .25rem 0; }
  .reshead-tl .tl-dot { width: 1.5rem; height: 1.5rem; font-size: .75rem; }
  .reshead-tl .tl-node::before { top: .75rem; }
  /* At the 12 px floor a long stage name takes two lines instead of being cut (a cut name sends the route to its compact shape). */
  .reshead-tl .tl-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: break-word; line-height: 1.25; font-size: var(--font-floor); }

  /* One column for the reservation; the money is the other column of the page, the same height. */
  .detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
  .reservation-page { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.5rem; align-items: stretch; }
.reservation-page.is-single { grid-template-columns: minmax(0, 1fr); }

  /* Current Stage */
  .current { padding: 1.125rem 1.375rem; }
  .current .eyebrow { font-size: var(--font-floor); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: .2rem; color: var(--muted); }
  .current h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 .5rem; }
  .current .stage-head { gap: .25rem .5rem; }
  .current .stage-head .badge { padding: .15rem .5rem; }
  .current .stage-actions { margin-top: .75rem; gap: .5rem; }
  .current .stage-actions .button,
  .current .stage-actions button { min-height: 2.125rem; height: 2.125rem; padding: 0 .875rem; font-size: .8125rem; }
  .current .hint { margin: .5rem 0; padding: .5rem .75rem; font-size: .8125rem; }

  /* Dense Definition Lists */
  .detail dl.facts { grid-template-columns: 8.5rem 1fr; gap: .25rem .75rem; font-size: .8125rem; line-height: 1.35; margin: .375rem 0 0; }
  .detail dl.facts dt { font-size: .78125rem; color: var(--muted); font-weight: 500; }
  .detail dl.facts dd { font-size: .8125rem; color: var(--text); }
  .detail dl.facts dd.strong { font-size: .9375rem; }

  /* Stage History */
  .stage-history { padding: 1.125rem 1.375rem; }
  .stage-history .route-head { margin-bottom: .5rem; }
  .stage-history .route-head h2 { font-size: 1.0625rem; font-weight: 700; }
  .stage-history .route-head .muted { font-size: .75rem; }
  .hist-group { padding: .35rem 0; gap: .25rem; }
  .hist-head { font-size: .8125rem; gap: .375rem .5rem; }
  .hist-head strong { font-size: .8125rem; }
  .hist-head .badge { padding: .1rem .4rem; }
  .hist-group .empty { font-size: .75rem; margin: 0 0 0 1rem; opacity: .75; }
  .history { gap: .25rem; }
  .history li { padding: .3rem .625rem; font-size: .8125rem; }

  /* Reservation Form - Desktop Multi-Column Density (Nueva / Editar) */
  .stage-live {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .875rem;
    align-items: start;
  }
  .stage-live > .card.identity,
  .stage-live > #flow-timeline,
  .stage-live > .section-label {
    grid-column: 1 / -1;
  }
  .stage-live > .card.identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.25rem;
  }
  .stage-live > .card.identity label {
    margin: 0;
    font-size: .875rem;
    font-weight: 700;
    white-space: nowrap;
  }
  .stage-live > .card.identity select {
    max-width: 24rem;
    min-height: 2.25rem;
    height: 2.25rem;
  }
  .stage-live > details.card.section {
    margin-bottom: 0;
  }
  .section-head {
    padding: .625rem .875rem;
  }
  .section-body {
    padding: .25rem .875rem .75rem;
  }
  .section-body .field {
    margin: .5rem 0;
    gap: .2rem;
  }
  .section-body .field label,
  .section-body .field .field-label {
    font-size: .8125rem;
  }
  .section-body input[type=text],
  .section-body input[type=email],
  .section-body input[type=tel],
  .section-body input[type=number],
  .section-body input[type=date],
  .section-body select {
    min-height: 2.125rem;
    height: 2.125rem;
    padding: .25rem .5rem;
    font-size: .875rem;
    border-radius: var(--radius-control);
  }
  .section-body textarea {
    min-height: 3.5rem;
    padding: .35rem .5rem;
    font-size: .875rem;
  }
  .form-actions {
    display: flex;
    align-items: center;
    gap: .75rem 1rem;
    margin-top: 1.25rem;
    padding-bottom: 2rem;
  }
  .form-actions .button {
    min-height: 2.25rem;
    padding: 0 1.5rem;
    font-size: .875rem;
  }

  /* Agent and office home on a wide screen: the greeting row is a white band across the top (it leaves the page padding behind
     with its negative margins, so the first section is set apart from it). Below it two columns, each stacking on its own so a long
     list in one never leaves a gap in the other: `.ah-main` (the reservations, the chart) and `.ah-side` (the money first, at the
     height of the reservations, then the KPI grid, the deadlines and the events). The office bookings take the full width. A home with
     nothing in the side column gives the whole width to the main one. */
  .ah-header { gap: 1.5rem; margin-bottom: 1.75rem; }
  .ah-top { margin: -2.25rem -3rem 0; padding: 1.125rem 3rem; background: var(--surface); border-bottom: 1px solid var(--line); }
  .ah { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .ah-main, .ah-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-content: start; min-width: 0; }
  .ah-main { grid-column: 1; }
  .ah-side { grid-column: 2; }
  .ah:not(:has(> .ah-side > :not(:empty))) > .ah-main { grid-column: 1 / -1; }
  .ah-kpi { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; overflow: visible; }
  .ah-offices { grid-column: 1 / -1; }
}

.home-counters strong { font-variant-numeric: tabular-nums; }
.guarantee .big-figure strong { font-size: 2.75rem; letter-spacing: -.02em; }

/* Control panel: the summary strip (navy first cell), the two charts, two tables. */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.head-filter { display: grid; gap: .25rem; color: var(--muted); font-size: .875rem; }
.head-filter label { margin: 0; font-weight: 400; }
.head-filter div { display: flex; gap: .5rem; }
.head-filter select { min-width: 12rem; }
.strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 1.25rem; padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.strip li { display: grid; align-content: start; gap: .25rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.strip .strip-label { color: var(--muted); }
.strip .strip-label a:not(.on-navy) { color: var(--muted); }
.strip .num { font-size: 2.25rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.strip .bad .num { color: var(--danger); }
.strip .strip-main { grid-column: 1 / -1; border: 0; background: var(--navy); color: var(--on-header); }
.strip .strip-main .strip-label { color: var(--menu-text); }
.strip .strip-main .num { font-size: 3.5rem; }
.late { color: var(--danger); font-weight: 700; }
.stack-table .row-title { color: var(--text); font-weight: 700; text-decoration: none; }
.stack-table .row-title:hover { color: var(--brand); text-decoration: underline; }
@media (max-width: 39.99rem) {
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .stack-table tr { display: block; padding: .5rem 0; border-top: 1px solid var(--line); }
  .stack-table td { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border: 0; text-align: right; }
  .stack-table td::before { content: attr(data-label); color: var(--muted); text-align: left; }
}
@media (min-width: 64rem) {
  .strip { grid-template-columns: 1.3fr repeat(5, minmax(0, 1fr)); }
  .strip li { border-top: 0; }
  .strip .strip-main { grid-column: auto; }

  /* Control Panel & Data Tables Desktop Density */
  .stack-table th {
    padding: .625rem .875rem;
    background: var(--bg);
    border-bottom: 2px solid var(--line);
    font-size: .8125rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
  }
  .stack-table td {
    padding: .5rem .875rem;
    border-bottom: 1px solid var(--line);
    font-size: .875rem;
    vertical-align: middle;
  }
  .stack-table tr:hover td {
    background: var(--surface-2);
  }
}

/* Login and invitations: the navy brand panel and the form, split from 64rem; on a phone the panel is a short header. */
.split-page { position: relative; min-height: 100vh; }
.split-flash { position: absolute; top: 1rem; left: 50%; z-index: var(--z-raised); width: min(25rem, 92vw); transform: translateX(-50%); }
.auth { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }
.auth-brand { display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem; background: var(--navy); color: var(--on-header); --focus: var(--on-header); }
.auth-claim { display: grid; gap: 1.5rem; max-width: 35rem; }
.claim { margin: 0; font-size: 1.75rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.claim-text, .auth-route { display: none; }
.auth-form { display: grid; align-content: center; justify-items: center; gap: 1.5rem; padding: 2rem 1.25rem 3rem; }
.auth-card { display: grid; gap: 1.125rem; width: 100%; max-width: 25rem; }
.auth-card > div > h1 { margin-bottom: .375rem; }
.auth-card label { margin: 0 0 .375rem; }
.auth-card p { margin: 0; }
.button.wide { width: 100%; min-height: 3.125rem; }
@media (min-width: 64rem) {
  .auth { grid-template-columns: 1.15fr 1fr; grid-template-rows: none; }
  .auth-brand { justify-content: space-between; gap: 2rem; padding: 3.5rem 4.5rem; }
  .auth-brand .brand { font-size: 1.625rem; }
  .claim { font-size: 4rem; line-height: .98; }
  .claim-text { display: block; margin: 0; color: var(--menu-text); font-size: 1.25rem; line-height: 1.45; }
  .auth-route { display: flex; align-items: center; max-width: 32.5rem; margin: 0; padding: 0; list-style: none; }
  .auth-route li { display: flex; flex: 1 1 auto; align-items: center; }
  .auth-route li:last-child { flex: none; }
  .auth-route li::before { content: ""; width: 1.125rem; height: 1.125rem; flex: none; box-sizing: border-box; border: 2px solid var(--route-pending); border-radius: 50%; }
  .auth-route li:not(:last-child)::after { content: ""; flex: 1 1 auto; height: 3px; background: var(--navy-line); }
  .auth-route li.done::before { border-color: var(--route-done); background: var(--route-done); }
  .auth-route li.done::after { background: var(--route-done); }
  .auth-route li.active::before { border: 3px solid var(--route-active); }
}

form.stack { max-width: 46rem; }

/* Stage context and default values (D3): the read-only block shown while completing a stage, and a computed default shown as a
   normal value instead of a grey placeholder. */
/* The context block of a completion: a tinted panel with an overline title (icon + "Contexto") and one datum per column
   (label above a bold value), the row wrapping. Only the data the stage was born to show (earlier stages, the reservation). */
.stage-context { display: grid; gap: .75rem; margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-sentence); }
.stage-context-title { display: flex; align-items: center; gap: .4rem; margin: 0; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.stage-context-title .icon { width: .95rem; height: .95rem; color: var(--brand); }
.context-facts { display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; margin: 0; }
.context-facts dt { color: var(--muted); font-size: .75rem; }
.context-facts dd { margin: .1rem 0 0; font-weight: 700; }
/* The warnings of the completion: a plain list of warn alerts inside the Contexto card. */
.warning-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.warning-list .alert { margin: 0; }
/* The formula help of a computed default: a read-only line with the stage editor's data chips, sitting on the card itself (no
   panel fill, which would blend with the chips). The icon opens the line on its first row. */
.field-calc { margin: .35rem 0 0; color: var(--muted); font-size: .8125rem; line-height: 2; }
.field-calc .icon { width: .95rem; height: .95rem; color: var(--brand); vertical-align: middle; margin-right: .15rem; }
.field-calc-line { color: var(--text); }
.field-calc-missing { color: var(--muted); }
.field-calc-missing::before { content: "· "; }
.is-suggested::placeholder { color: var(--text); opacity: 1; }
/* Formula editor: the default-value formula typed as a sentence, its data tokens drawn as chips (the value still posts as text). */
.formula-editor { display: grid; gap: .75rem; padding: .875rem; border-radius: var(--radius-control); background: var(--brand-tint); }
.formula-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.formula-field { flex: 1 1 14rem; min-width: 0; min-height: 3rem; padding: .5rem .75rem; border: 1px solid var(--brand); border-radius: var(--radius-control); background: var(--surface); font-size: .9375rem; line-height: 2; }
.formula-field:empty::before { content: attr(data-placeholder); color: var(--muted); }
.formula-field:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.formula-token { display: inline-block; vertical-align: middle; margin: 0 .1rem; background: var(--surface-2); color: var(--brand); font-size: .8125rem; font-weight: 600; padding: .15rem .5rem; border-radius: 6px; white-space: nowrap; }
.formula-insert { flex: 0 0 auto; width: 9.5rem; }
.formula-ops { display: flex; flex-wrap: wrap; gap: .25rem; }
.formula-op { min-width: 2.25rem; padding: .3rem .5rem; border: 1px solid var(--control-border); border-radius: var(--radius-row); background: var(--surface); color: var(--text); font-size: .9375rem; font-weight: 600; line-height: 1; }
.formula-op:hover { background: var(--surface-2); }
.formula-result { display: flex; align-items: center; gap: .5rem; margin: 0; }
.default-block { display: flex; flex-direction: column; gap: .5rem; }
.default-block .seg-control { align-self: flex-start; }

/* Grouped picker of the stage editor (the context row and the formula's "Insertar dato"): a native <select>, enhanced with
   customizable-select (appearance: base-select) where supported. Every rule is scoped to .pick-select so no other select of the app
   changes; the picker lives in the top layer, so the card's overflow does not clip it. The closed button shows the source chip + the
   datum; the open menu shows the source groups and, per datum, its icon + label. The chip span and the icon are shared, and each is
   hidden where it does not belong. */
.pick-select { min-height: 2.75rem; padding: 0 .75rem; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--surface); }
.context-select { flex: 1 1 12rem; min-width: 0; }
.context-chip { flex: none; background: var(--surface-2); color: var(--brand); font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: var(--radius-pill); white-space: nowrap; }
.context-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@supports (appearance: base-select) {
  .pick-select,
  .pick-select::picker(select) { appearance: base-select; }

  .pick-select { display: flex; align-items: center; gap: .5rem; }
  .pick-select::picker-icon { color: var(--muted); transition: rotate .2s; }
  .pick-select:open::picker-icon { rotate: 180deg; }
  .context-select:has(option[value=""]:checked) { color: var(--muted); }

  .pick-select::picker(select) { margin-top: .35rem; padding: .35rem; border: 1px solid var(--brand); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-3); }
  .formula-insert::picker(select) { min-width: 17rem; }

  .pick-select optgroup { border: 0; }
  .pick-select optgroup legend { padding: .4rem .6rem .15rem; color: var(--muted); font-size: var(--font-floor); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .pick-select option { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border: 1px solid transparent; border-radius: var(--radius-row); }
  .pick-select option:hover,
  .pick-select option:focus { background: var(--surface-2); }
  .pick-select option:checked { border-color: var(--brand); font-weight: 600; }
  .pick-select option svg.icon { color: var(--muted); }
  .pick-select option::checkmark { display: none; }

  /* The chip belongs to the closed button; the icon belongs to the open menu. */
  .pick-select option .context-chip { display: none; }
  .pick-select selectedcontent svg.icon { display: none; }
}

/* Agenda: a whole month as a calendar. Each day is marked by kind — a plazo (house), an office booking (briefcase) or an event (team). */
.cal-header { display: grid; gap: .25rem; }
.cal-eyebrow { margin: 0; color: var(--muted); font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cal-titlerow { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.cal-titlerow h1 { margin: 0; }
.cal-monthnav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .75rem; }
.cal-month { font-weight: 700; color: var(--text); }
.cal-nav { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-control); color: var(--muted); }
.cal-nav .icon { width: 1.375rem; height: 1.375rem; transform: rotate(90deg); }
.cal-nav-next .icon { transform: rotate(-90deg); }
.cal-nav:hover { background: var(--surface-2); color: var(--brand); }
.cal-legend { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: 0; color: var(--text); font-size: .8125rem; }
.cal-legend li { display: inline-flex; align-items: center; gap: .375rem; }
.cal-legend .icon { width: 1.25rem; height: 1.25rem; }
.is-deadline .icon { color: var(--danger); }
.is-booking .icon { color: var(--brand); }
.is-event .icon { color: var(--ok); }
.cal { display: grid; gap: .375rem; padding: .625rem; }
.cal-weekdays, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; }
.cal-weekdays span { padding: .25rem 0; text-align: center; color: var(--muted); font-size: var(--font-floor); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: .25rem; height: 3.25rem; padding: .25rem .125rem; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text); text-decoration: none; }
.cal-day.is-empty { border-color: transparent; visibility: hidden; }
.cal-day:hover { background: var(--surface-sentence); }
.cal-day.is-selected { background: var(--surface-2); border-color: var(--brand); }
.cal-cell { display: flex; flex-direction: column; align-items: center; gap: .125rem; width: 100%; min-width: 0; }
.cal-track, .cal-time, .cal-agenda { display: none; }
.cal-num { font-size: .8125rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cal-day.is-weekend .cal-num { color: var(--muted); }
.cal-day.is-today .cal-num, .cal-day.is-selected .cal-num { color: var(--brand); font-weight: 800; }
.cal-marks { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .0625rem; max-width: 1.9375rem; line-height: 0; }
.cal-mark { display: inline-flex; }
.cal-mark-text { display: none; }
.cal-marks .icon { width: .8125rem; height: .8125rem; min-width: 0; }
@media (min-width: 64rem) {
  .cal-header { margin-bottom: .25rem; }
  .cal-monthnav { padding: .375rem .75rem; margin-bottom: .75rem; }
  .cal-view {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: .75rem 1rem;
  }
  .cal-style {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    width: 14rem;
  }
  .cal-legend.card {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: .5rem 1rem;
    justify-content: flex-start;
    gap: 1.5rem;
  }
  .cal-body {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
    gap: 1.25rem;
    align-items: start;
  }
  .cal.card { margin-bottom: 0; padding: .75rem; }
  .cal-detail.card {
    position: sticky;
    top: calc(var(--support-h, 0px) + 1.25rem);
    margin-bottom: 0;
    padding: 1.25rem 1.5rem;
  }
  .cal-day { height: auto; min-height: 4.875rem; }
  .cal-cell { align-items: stretch; }
  .cal-marks { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 2px; max-width: none; width: 100%; line-height: normal; }
  .cal-mark { align-items: center; justify-content: flex-start; gap: .25rem; padding: 2px 5px; border-radius: 5px; min-width: 0; }
  .cal-mark .icon { width: .8125rem; height: .8125rem; flex: none; }
  .cal-mark-text { display: block; font-size: var(--font-floor); font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cal-mark.is-deadline { background: var(--danger-soft); color: var(--danger); }
  .cal-mark.is-booking { background: var(--brand-tint); color: var(--brand); }
  .cal-mark.is-event { background: var(--ok-soft); color: var(--ok); }
}
.cal-detail { display: grid; gap: .75rem; }
.cal-detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.cal-detail-head h2 { margin: 0; font-size: 1.0625rem; }
.cal-list { list-style: none; display: grid; gap: .75rem; margin: 0; padding: 0; }
.cal-item { display: flex; align-items: flex-start; gap: .625rem; }
.cal-item > .icon { width: 1.25rem; height: 1.25rem; flex: none; margin-top: .125rem; }
.cal-item-body { display: grid; gap: .125rem; min-width: 0; }
.cal-item-title { font-weight: 700; }
.cal-item-sub { color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }

/* Agenda: two design alternatives of the same month, switched client-side (app.js). "icons" is the default (no script needed). */
.cal-view { display: grid; gap: 1rem; }
.cal-body { display: grid; gap: 1rem; }
.cal-body > .card { margin-bottom: 0; }
.cal-style { max-width: 20rem; }
button.seg { position: relative; flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 2rem; margin: 0; padding: .5rem .75rem; border: 0; border-radius: calc(var(--radius-control) - 2px); background: none; color: var(--muted); font: inherit; font-weight: 600; text-align: center; cursor: pointer; }
button.seg[aria-pressed="true"] { background: var(--brand); color: var(--brand-text); }
button.seg:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cal-view[data-style="icons"] [data-legend="color"], .cal-view[data-style="color"] [data-legend="icons"] { display: none; }
.cal-view[data-style="icons"] .cal-dot { display: none; }
.cal-view[data-style="color"] .cal-marks { display: none; }
.cal-view[data-style="color"] .cal-day { align-items: flex-start; }
.cal-view[data-style="color"] .cal-cell { align-items: flex-start; }
.cal-view[data-style="color"] .cal-num { padding-left: 4px; }
.cal-view[data-style="color"] .cal-day.has-booking .cal-agenda { display: flex; align-items: stretch; gap: .25rem; width: 100%; padding: 2px 4px; border-radius: var(--radius-sm); background: var(--surface-2); }
.cal-view[data-style="color"] .cal-day.has-booking .cal-track { display: block; position: relative; flex: none; width: 3px; border-radius: 2px; background: var(--line-strong); }
.cal-view[data-style="color"] .cal-day.has-booking .cal-track::after { content: ""; position: absolute; left: 0; top: 20%; width: 100%; height: 55%; border-radius: 2px; background: var(--brand); }
.cal-view[data-style="color"] .cal-day.has-booking .cal-time { display: block; align-self: center; font-size: var(--font-floor); font-weight: 700; line-height: 1.2; color: var(--brand); }
/* A phone cell is about 45 px wide: the booking chip gives its room to the 12 px time (the floor) instead of shrinking it. */
@media (max-width: 63.99rem) {
  .cal-view[data-style="color"] .cal-day { padding-left: 1px; padding-right: 1px; }
  .cal-view[data-style="color"] .cal-day.has-booking .cal-agenda { gap: 2px; padding: 2px 1px; }
  .cal-view[data-style="color"] .cal-day.has-booking .cal-time { font-weight: 600; letter-spacing: -.03em; }
}
.cal-view[data-style="color"] .cal-day.has-event { background: var(--ok-soft); }
.cal-view[data-style="color"] .cal-day.has-event.is-selected { background: var(--surface-2); }
.cal-dot { position: absolute; top: .375rem; right: .375rem; width: .625rem; height: .625rem; border: 2px solid var(--danger); border-radius: 50%; background: none; animation: cal-blink 1.6s ease-in-out infinite; }
@keyframes cal-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .cal-dot { animation: none; } }
.cal-track-sample { flex: none; position: relative; width: 4px; height: 15px; border-radius: 2px; background: var(--surface-2); }
.cal-track-sample::after { content: ""; position: absolute; left: 0; top: 25%; width: 100%; height: 45%; border-radius: 2px; background: var(--brand); }
.cal-dot-sample { flex: none; width: .625rem; height: .625rem; border: 2px solid var(--danger); border-radius: 50%; background: none; }
.cal-swatch { flex: none; width: .875rem; height: .875rem; border-radius: var(--radius-sm); border: 1px solid var(--ok); background: var(--ok-soft); }

/* Salas: the agency's edificios and their salas (configuration). */
.sala-page { display: grid; gap: 1rem; }
.sala-head { display: grid; gap: .25rem; margin-bottom: .25rem; }
.sala-overline { margin: 0; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sala-head h1 { margin: 0; }
.sala-head p { margin: 0; }
.sala-building { display: grid; gap: .75rem; }
.sala-building-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sala-building-title { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.sala-building-title .icon { width: 1.25rem; height: 1.25rem; flex: none; color: var(--brand); }
.sala-building-title h2 { margin: 0; font-size: 1.125rem; }
.sala-rows { display: grid; gap: .5rem; }
.sala-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0; border-style: solid; }
.sala-row-name { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.sala-row-name .icon { width: 1rem; height: 1rem; flex: none; color: var(--muted); }
.sala-row-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sala-edit summary, .sala-add-building > summary { list-style: none; cursor: pointer; }
.sala-edit summary::-webkit-details-marker, .sala-add-building > summary::-webkit-details-marker { display: none; }
.sala-edit[open] > summary { color: var(--brand); }
.sala-form { display: grid; gap: .4rem; margin-top: .5rem; }
.sala-form label { margin: 0; }
.sala-form > .button { margin-top: .25rem; justify-self: start; }
.sala-add { border: 0; background: none; padding: 0; margin: 0; }
.sala-add > summary { width: fit-content; }
.sala-add-building { margin-top: .25rem; }
.sala-add-building > summary { width: fit-content; }
.sala-add-building .sala-form { margin-top: .75rem; }

/* Sala booking day: a 08ï¿½20 track per sala. The CSP forbids inline widths, so each stretch spans grid cells. */
.sala-head-text p { margin: 0; }
.sala-daynav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sala-step { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); }
.sala-step .icon { width: 1.1rem; height: 1.1rem; }
.sala-step.prev .icon { transform: rotate(180deg); }
.sala-day { display: inline-flex; align-items: center; gap: .5rem; min-height: 1.8125rem; padding: 0 .625rem; border: 0; border-radius: var(--radius-control); background: var(--surface-sentence); font-size: .75rem; font-weight: 600; }
.sala-day .icon { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.sala-today { display: inline-flex; align-items: center; min-height: 1.8125rem; padding: 0 .5rem; border-radius: var(--radius-control); background: none; color: var(--brand); font-size: .75rem; font-weight: 600; text-decoration: none; }
.sala-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .625rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.sala-toolbar-right { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; }
.sala-filter { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sala-filter select { min-height: 1.8125rem; width: auto; }
.sala-legend { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sala-legend-items { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sala-legend-item { display: inline-flex; align-items: center; gap: .375rem; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.sala-swatch { width: .875rem; height: .875rem; border-radius: 3px; border: 1px solid var(--line); }
.sala-swatch.is-free { background: var(--surface-sentence); }
.sala-swatch.is-busy { background: var(--busy); border-color: var(--busy); }
.sala-swatch.is-event { background: var(--ok-soft); border-color: var(--ok); }
.sala-swatch.is-mine { background: var(--brand-tint); border-color: var(--brand); }
.sala-day-building { display: grid; gap: .75rem; padding: 1rem; }
.sala-hours { font-size: .75rem; font-weight: 600; }
.sala-day-context, .sala-week-context { margin: 0; font-size: 1.25rem; font-weight: 700; }
.sala-ruler { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--font-micro); font-weight: 600; line-height: 1; }
.sala-datepick { position: relative; }
.sala-datepick > summary { display: inline-flex; align-items: center; gap: .375rem; min-height: 1.8125rem; padding: 0 .625rem; border-radius: var(--radius-control); background: var(--brand-tint); color: var(--brand); font-size: .75rem; font-weight: 600; cursor: pointer; list-style: none; }
.sala-datepick > summary::-webkit-details-marker { display: none; }
.sala-datepick > summary .icon { width: 1rem; height: 1rem; }
.sala-calendar { position: absolute; z-index: var(--z-popover); top: calc(100% + .5rem); left: 0; display: grid; gap: .5rem; width: 21.25rem; max-width: calc(100vw - 2rem); padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow-4); }
.sala-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sala-calendar-month { font-weight: 700; }
.sala-calendar .cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .125rem; color: var(--muted); font-size: var(--font-floor); font-weight: 600; text-align: center; text-transform: uppercase; }
.sala-calendar .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .125rem; }
.sala-calendar .cal-day { display: grid; place-items: center; min-height: 2rem; border-radius: var(--radius-row); color: var(--text); font-size: .8125rem; text-decoration: none; }
.sala-calendar .cal-day:hover { background: var(--surface-sentence); }
.sala-calendar .cal-day.is-today { color: var(--brand); font-weight: 700; }
.sala-calendar .cal-day.is-selected { background: var(--brand); color: var(--brand-text); font-weight: 700; }
.sala-calendar .cal-day.is-empty { pointer-events: none; }
.sala-calendar-foot { display: flex; justify-content: flex-end; }
.sala-calendar-foot .link { font-size: .75rem; font-weight: 600; }

/* Sala week: one row per sala with the seven day tracks (desktop); one card per sala (mobile). */
.sala-week { display: grid; gap: .5rem; padding: 1rem; }
.sala-week-head, .sala-week-row { display: grid; grid-template-columns: 11.25rem repeat(7, minmax(0, 1fr)); gap: .25rem; }
.sala-week-head { align-items: end; padding: 0 .25rem .375rem; border-bottom: 1px solid var(--line); }
.sala-week-day { display: grid; justify-items: center; gap: .125rem; padding: .3125rem .25rem; border-radius: var(--radius-row); color: var(--muted); font-size: var(--font-floor); font-weight: 700; text-decoration: none; text-transform: uppercase; }
.sala-week-day.is-today { background: var(--brand-tint); color: var(--brand); }
.sala-week-day.is-selected { box-shadow: inset 0 0 0 1px var(--brand); }
.sala-week-room { display: flex; flex-direction: column; justify-content: center; gap: .125rem; min-width: 0; padding: .25rem .5rem; }
.sala-week-room .muted { font-size: var(--font-floor); }
.sala-week-room strong { overflow: hidden; font-size: .8125rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sala-week-cell { display: block; padding: .125rem; border-radius: var(--radius-row); text-decoration: none; }
.sala-week-cell:hover { background: var(--surface-sentence); }
.sala-week-cell.is-today { background: var(--brand-tint); }
.sala-week-cell.is-selected { box-shadow: inset 0 0 0 1px var(--brand); }
.sala-week-cell .sala-track { height: 3.5rem; }
.sala-week .sala-seg-full { display: none; }
.sala-week .sala-seg-short { display: inline; }
.sala-week-cards { display: none; }
.sala-week-card { display: grid; gap: .5rem; margin: 0; }
.sala-week-card-head { display: flex; flex-direction: column; gap: .125rem; }
.sala-week-card-head .muted { font-size: var(--font-floor); }
.sala-week-card-head strong { font-size: .8125rem; font-weight: 600; }
.sala-week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; }
.sala-week-mini { display: grid; justify-items: center; gap: .125rem; padding: .25rem .125rem; border-radius: var(--radius-row); color: var(--muted); font-size: var(--font-floor); text-decoration: none; }
.sala-week-mini.is-today { background: var(--brand-tint); color: var(--brand); font-weight: 700; }
.sala-week-mini.is-selected { box-shadow: inset 0 0 0 1px var(--brand); }
.sala-week-mini-day { font-weight: 700; text-transform: uppercase; }
.sala-week-mini-num { font-weight: 700; }
.sala-week-mini .sala-track { width: 100%; height: 2.25rem; }
.sala-week-mini .sala-seg-full { display: none; }
.sala-week-mini .sala-seg-short { display: inline; }
@media (max-width: 63.99rem) {
  .sala-week { display: none; }
  .sala-week-cards { display: grid; gap: .75rem; }
}
.sala-room { display: grid; gap: .375rem; padding: 0; border-top: 0; }
.sala-room:first-of-type { border-top: 0; }
.sala-room-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sala-room-name { display: flex; align-items: center; gap: .5rem; min-width: 0; font-weight: 600; }
.sala-room-name .icon { width: 1rem; height: 1rem; flex: none; color: var(--muted); }
.sala-book { border: 0; background: none; padding: .625rem .25rem; color: var(--brand); font: inherit; font-size: .8125rem; font-weight: 700; cursor: pointer; }
.sala-track { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); height: 2rem; border-radius: var(--radius-row); background: var(--surface-sentence); overflow: hidden; }
.sala-seg { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; white-space: nowrap; font-size: var(--font-floor); font-weight: 600; }
.sala-seg.is-busy { background: var(--busy); color: var(--busy-text); }
.sala-seg.is-event { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.sala-seg.is-mine { background: var(--brand-tint); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 700; }
.sala-seg.is-past { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, transparent 4px 8px); cursor: not-allowed; }
.sala-seg.is-free { border: 0; padding: 0; background: transparent; cursor: pointer; }
.sala-seg.is-free:hover { background: var(--brand-tint); }
.sala-seg.is-free:focus-visible { outline-offset: -2px; }
.sala-hint { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .8125rem; }
.sala-hint .icon { width: 1rem; height: 1rem; flex: none; }
.c-1 { grid-column: span 1; }
.c-2 { grid-column: span 2; }
.c-3 { grid-column: span 3; }
.c-4 { grid-column: span 4; }
.c-5 { grid-column: span 5; }
.c-6 { grid-column: span 6; }
.c-7 { grid-column: span 7; }
.c-8 { grid-column: span 8; }
.c-9 { grid-column: span 9; }
.c-10 { grid-column: span 10; }
.c-11 { grid-column: span 11; }
.c-12 { grid-column: span 12; }
.c-13 { grid-column: span 13; }
.c-14 { grid-column: span 14; }
.c-15 { grid-column: span 15; }
.c-16 { grid-column: span 16; }
.c-17 { grid-column: span 17; }
.c-18 { grid-column: span 18; }
.c-19 { grid-column: span 19; }
.c-20 { grid-column: span 20; }
.c-21 { grid-column: span 21; }
.c-22 { grid-column: span 22; }
.c-23 { grid-column: span 23; }
.c-24 { grid-column: span 24; }
.c-25 { grid-column: span 25; }
.c-26 { grid-column: span 26; }
.c-27 { grid-column: span 27; }
.c-28 { grid-column: span 28; }
.c-29 { grid-column: span 29; }
.c-30 { grid-column: span 30; }
.c-31 { grid-column: span 31; }
.c-32 { grid-column: span 32; }
.c-33 { grid-column: span 33; }
.c-34 { grid-column: span 34; }
.c-35 { grid-column: span 35; }
.c-36 { grid-column: span 36; }
.c-37 { grid-column: span 37; }
.c-38 { grid-column: span 38; }
.c-39 { grid-column: span 39; }
.c-40 { grid-column: span 40; }
.c-41 { grid-column: span 41; }
.c-42 { grid-column: span 42; }
.c-43 { grid-column: span 43; }
.c-44 { grid-column: span 44; }
.c-45 { grid-column: span 45; }
.c-46 { grid-column: span 46; }
.c-47 { grid-column: span 47; }
.c-48 { grid-column: span 48; }
@media (max-width: 63.99rem) {
  .sala-track { height: 1.8125rem; }
  .sala-seg { font-size: var(--font-micro); }
}

@media (min-width: 64rem) {
  /* Salas Desktop Density */
  .sala-toolbar { padding: .5rem 1rem; margin-bottom: .75rem; }
  .sala-day-context, .sala-week-context { display: none; }
  .sala-filter { margin-bottom: .75rem; }
  .sala-legend { margin-bottom: .75rem; }

  /* Salas Day View (Gantt Resource Row) */
  .sala-day-building { padding: 1rem 1.25rem; gap: .5rem; margin-bottom: 1rem; }
  .sala-ruler {
    margin-left: 14rem;
    padding: 0 .25rem;
  }
  .sala-room {
    display: grid;
    grid-template-columns: 14rem 1fr;
    align-items: center;
    gap: .75rem 1rem;
    padding: .375rem 0;
    border-top: 1px solid var(--line);
  }
  .sala-room:first-of-type { border-top: none; }
  .sala-room-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding-right: .5rem;
  }
  .sala-room-name { font-size: .875rem; font-weight: 600; }
  .sala-room .sala-book { padding: 0; font-size: .75rem; }
  .sala-room .sala-track { height: 2.25rem; }

  /* Salas Week View (Compact Grid & Clean Gantt Bars) */
  .sala-week { padding: .75rem 1rem; gap: .375rem; }
  .sala-week-cell .sala-track { height: 2.25rem; }
  .sala-week-head, .sala-week-row {
    grid-template-columns: 12rem repeat(7, minmax(0, 1fr));
    gap: .375rem;
  }
  .sala-week-row {
    align-items: center;
    padding: .25rem 0;
    border-bottom: 1px solid var(--line);
  }
  .sala-week-row:last-child { border-bottom: none; }
  .sala-week .sala-seg-short,
  .sala-week .sala-seg-full {
    display: none !important;
  }
  .sala-week .sala-seg {
    border-radius: var(--radius-sm);
    cursor: pointer;
  }
  .sala-week .sala-seg:hover {
    filter: brightness(.9);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  }
}

/* "Tus prï¿½ximas reservas": the caller's upcoming bookings on the booking page. */
.sala-upcoming { display: grid; gap: .5rem; padding: 1rem; }
.sala-upcoming-title { margin: 0; font-size: .875rem; font-weight: 700; }
.sala-upcoming-body { display: grid; gap: .5rem; }
.sala-upcoming-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-sentence); }
.sala-upcoming-when { display: grid; gap: .125rem; min-width: 7rem; }
.sala-upcoming-day { font-weight: 700; }
.sala-upcoming-where { display: grid; gap: .125rem; min-width: 0; flex: 1 1 auto; }
.sala-upcoming-where > span:first-child { font-weight: 600; }
.sala-upcoming-actions { display: flex; align-items: center; gap: .75rem; }
.sala-upcoming-cancel { margin: 0; }
.sala-cancel { border: 0; background: none; padding: .625rem .25rem; color: var(--danger); font: inherit; font-size: .8125rem; font-weight: 700; cursor: pointer; }
.sala-cancel-form { margin-top: .5rem; text-align: center; }
.confirm-inline > summary { list-style: none; cursor: pointer; }
.confirm-inline > summary::-webkit-details-marker { display: none; }
.confirm-inline > summary.button { display: inline-flex; }
.confirm-box { display: grid; gap: .5rem; justify-items: start; margin-top: .5rem; padding: .75rem; border: 1px solid var(--danger); border-radius: var(--radius-control); background: var(--danger-soft); text-align: left; }
.confirm-box p { margin: 0; font-weight: 600; }
.report-folded { margin-top: 1rem; }
.report-folded > summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.confirm-box.calm { border-color: var(--brand); background: var(--brand-tint); }
.confirm-box p.confirm-note { font-weight: 400; }
.confirm-box p.confirm-note.warn { color: var(--warn); font-weight: 600; }
.sala-upcoming-actions { flex-wrap: wrap; }
.sala-upcoming-cancel:has(details[open]) { flex-basis: 100%; }
@media (max-width: 63.99rem) {
  .sala-upcoming-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem .75rem; }
  .sala-upcoming-when { grid-column: 1; grid-row: 1; min-width: 0; }
  .sala-upcoming-actions { grid-column: 1 / -1; grid-row: 3; justify-content: space-between; padding-top: .5rem; border-top: 1px solid var(--line); }
  .sala-upcoming-where { grid-column: 1 / -1; grid-row: 2; }
}

/* "Reserva de salas" (supervision): the Lista/Dï¿½a switch, the list filters, the table and its mobile cards. */
.sala-view-switch { width: fit-content; }
.sala-list-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.sala-list-filters label { display: grid; gap: .25rem; margin: 0; color: var(--text); font-size: .8125rem; font-weight: 600; }
.sala-list-filters input[type=date], .sala-list-filters select { min-height: 2.75rem; }
.sala-list-filters .check { display: flex; align-items: center; gap: .5rem; }
.sala-sup-table { margin-bottom: 1rem; }
.sala-sup-table th { text-align: left; }
.sala-sup-table td { vertical-align: middle; }
.sala-sup-when { display: block; font-weight: 700; }
.sala-sup-cancelled { color: var(--muted); }
.sala-sup-actions { text-align: right; white-space: nowrap; }
.sala-sup-actions form { display: inline; margin: 0; }
.sala-sup-cards { display: none; }
.sala-sup-card { display: grid; gap: .35rem; }
.sala-sup-card p { margin: 0; }
.sala-sup-card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sala-sup-card-when { font-size: .8125rem; font-weight: 700; }
.sala-sup-card-room { font-weight: 600; }
.sala-sup-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; margin-top: .25rem; }
.sala-sup-card-actions form { margin: 0; }
.sala-seg { border: 0; font-family: inherit; }
.sala-seg[data-dialog-open] { cursor: pointer; }
.sala-seg-short { display: none; }
@media (max-width: 63.99rem) {
  .sala-sup-table { display: none; }
  .sala-sup-cards { display: grid; gap: .75rem; }
  .sala-list-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .sala-list-filters .check, .sala-list-filters .button { grid-column: 1 / -1; }
  .sala-seg-full { display: none; }
  .sala-seg-short { display: inline; }
}

/* Eventos */
.event-badges { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: .375rem; margin-top: .25rem; }
.event-badges .badge { align-self: flex-start; white-space: nowrap; }
.event-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.event-head h1 { margin: 0; }
.event-section { display: grid; gap: .75rem; margin-top: 1.25rem; }
.event-section-title { margin: 0; font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.event-card {
  display: grid;
  grid-template-columns: 6rem 1px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.event-card.is-cancelled { opacity: .72; }
.event-when { display: flex; flex-direction: column; gap: .125rem; }
.event-weekday { font-size: var(--font-floor); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.event-day { font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.event-month { font-size: .75rem; font-weight: 600; color: var(--muted); }
.event-time { font-size: .75rem; color: var(--muted); }
.event-rule { width: 1px; align-self: stretch; background: var(--line); }
.event-body { display: grid; gap: .25rem; min-width: 0; }
.event-title { font-size: 1rem; font-weight: 700; color: var(--text); text-decoration: none; }
.event-title:hover { color: var(--brand); }
.event-place { font-size: .8125rem; color: var(--muted); }

.event-answer { display: flex; flex-wrap: wrap; gap: .5rem; }
.event-answer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  min-height: 2.75rem;
  padding: 0 .875rem;
  border: 0;
  border-radius: var(--radius-card);
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.event-answer-button .icon { width: 1.125rem; height: 1.125rem; }
.event-answer-button.is-yes { background: var(--ok-soft); color: var(--ok); }
.event-answer-button.is-no { background: var(--danger-soft); color: var(--danger); }
.event-answer-button.is-yes.is-on { background: var(--ok); color: var(--on-status); }
.event-answer-button.is-no.is-on { background: var(--danger); color: var(--on-status); }
.event-answer-button:hover { filter: brightness(.97); }
.event-chevron { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; color: var(--muted); }
.event-chevron .icon { width: 1.125rem; height: 1.125rem; }

.event-week { grid-column: 1 / -1; margin-top: .25rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.event-week-summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; list-style: none; cursor: pointer; font-size: .75rem; font-weight: 600; color: var(--muted); }
.event-week-summary::-webkit-details-marker { display: none; }
.event-week-summary .icon { width: 1rem; height: 1rem; }
.event-week[open] .event-week-summary .icon { transform: rotate(180deg); }
.event-week-body { display: grid; gap: .5rem; padding-top: .75rem; }
.event-week-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .75rem; color: var(--muted); }
.event-week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.event-week-day { position: relative; min-height: 3.5rem; border-radius: var(--radius-row); background: var(--surface-sentence); }
.event-week-day.is-tinted { background: var(--surface-2); }
.event-week-num { position: absolute; top: .375rem; left: .5rem; font-size: .75rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.event-week-icon { position: absolute; display: inline-flex; }
.event-week-icon .icon { width: .75rem; height: .75rem; }
.event-week-icon.is-deadline { top: .375rem; right: .5rem; }
.event-week-icon.is-booking { bottom: .375rem; left: .5rem; }
.event-week-icon.is-event { bottom: .375rem; right: .5rem; }
.event-week-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: var(--font-floor); color: var(--muted); }
.event-week-legend > span { display: inline-flex; align-items: center; gap: .375rem; }
.event-week-legend .icon { width: .75rem; height: .75rem; }

.event-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.event-detail-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.event-detail-fact { display: grid; gap: .125rem; }
.event-detail-description { margin: 0; line-height: 1.55; }
.event-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.event-detail-actions form { margin: 0; }
.event-attendance h2 { margin: 0 0 .5rem; font-size: 1rem; }
.event-attendance-list { list-style: none; display: grid; gap: .5rem; margin: 0; padding: 0; }
.event-attendance-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .875rem; }
.event-attendance-list li:first-child { padding-top: 0; border-top: 0; }
.event-attendance-answer { color: var(--muted); font-size: .8125rem; }
.event-form { display: grid; gap: 1rem; }
.event-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.button.danger { background: var(--danger); color: var(--on-status); }

@media (max-width: 63.99rem) {
  .event-card { grid-template-columns: minmax(0, 1fr) auto; gap: .75rem 1rem; }
  .event-when { grid-column: 1; grid-row: 1; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: .375rem; }
  .event-rule { display: none; }
  .event-body { grid-column: 1; grid-row: 2; }
  .event-card .event-answer { grid-column: 2; grid-row: 2; align-self: center; }
  .event-chevron { grid-column: 2; grid-row: 1; }
  .event-week { grid-column: 1 / -1; grid-row: 3; }
}

@media (max-width: 40rem) {
  .event-form-row { grid-template-columns: 1fr; }
}

/* Agenda: the four corners of a day in the "Iconos" style (number top left, deadline top right, room bottom left, event bottom right) */
.cal-view[data-style="icons"] .cal-day { position: relative; }
.cal-view[data-style="icons"] .cal-cell { position: absolute; inset: 0; display: block; }
.cal-view[data-style="icons"] .cal-num { position: absolute; top: .25rem; left: .375rem; }
.cal-view[data-style="icons"] .cal-marks { position: absolute; inset: 0; display: block; max-width: none; line-height: normal; }
.cal-view[data-style="icons"] .cal-mark { position: absolute; padding: 0; background: none; }
.cal-view[data-style="icons"] .cal-mark.is-deadline { top: .25rem; right: .375rem; }
.cal-view[data-style="icons"] .cal-mark.is-booking { bottom: .25rem; left: .375rem; }
.cal-view[data-style="icons"] .cal-mark.is-event { bottom: .25rem; right: .375rem; }
.cal-view[data-style="icons"] .cal-mark-text { display: none; }
.cal-view[data-style="icons"] .cal-mark .icon { width: .875rem; height: .875rem; }

/* Home shortcuts and section links */
.ah-shortcuts { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.ah-shortcut { display: inline-flex; align-items: center; gap: .375rem; padding: .4375rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font-size: .8125rem; font-weight: 600; text-decoration: none; }
.ah-shortcut:hover { border-color: var(--brand); color: var(--brand); }
.ah-shortcut .icon { width: 1rem; height: 1rem; flex: none; color: var(--brand); }
.ah-section-links { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }

/* Agenda day actions */
.cal-detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.sala-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }

/* Reservation wizard: the data the agency configured, one group per datum, in the configured order. */
.wizard-page { max-width: 46rem; margin: 0 auto; }
.wizard-head { display: grid; gap: .5rem; }
.wizard-head-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.wizard-head h1 { margin: 0; }
.wizard-progress { display: flex; gap: .375rem; margin-top: .25rem; }
.wizard-progress > span { flex: 1 1 0; height: .375rem; border-radius: var(--radius-pill); background: var(--surface-2); }
.wizard-progress > span.is-on { background: var(--brand); }
.wizard-form { display: grid; gap: 1rem; }
.wizard-group { margin-bottom: 0; }
.wizard-group .section-head { padding: 1rem; }
.wizard-group-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; min-width: 0; }
.wizard-num { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; flex: none; border-radius: var(--radius-pill); background: var(--brand); color: var(--brand-text); font-size: .75rem; font-weight: 700; }
.wizard-group-title { font-weight: 700; }
.wizard-group-summary { flex: 1 1 10rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .8125rem; }
.wizard-group[open] .wizard-group-summary { display: none; }
.wizard-group-hint, .wizard-lock { display: none; color: var(--muted); font-size: .75rem; }
.wizard-group[data-locked="true"] .wizard-group-hint,
.wizard-group[data-locked="true"] .wizard-lock { display: inline-flex; align-items: center; }
.wizard-group[data-locked="true"] .wizard-group-summary,
.wizard-group[data-locked="true"] .section-chevron { display: none; }
.wizard-group[data-locked="true"] .section-head { cursor: default; }
.wizard-group[data-locked="true"] .wizard-num { background: var(--surface-2); color: var(--muted); }
.wizard-group.has-errors { border-color: var(--danger); }
.wizard-group.has-errors .wizard-group-title { color: var(--danger); }
.wizard-choices { display: grid; gap: .5rem; }
.wizard-choice { position: relative; display: flex; gap: .75rem; align-items: flex-start; min-height: 4rem; padding: .875rem; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; }
.wizard-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wizard-choice-mark { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; flex: none; margin-top: .1rem; border: 1px solid var(--control-border); border-radius: var(--radius-pill); background: var(--surface); }
.wizard-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.wizard-choice:has(input:checked) .wizard-choice-mark { border-color: var(--brand); background: var(--brand); }
.wizard-choice:has(input:checked) .wizard-choice-mark::after { content: ""; width: .5rem; height: .5rem; border-radius: var(--radius-pill); background: var(--brand-text); }
.wizard-choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.wizard-choice-text { display: grid; gap: .1rem; min-width: 0; }
.wizard-choice-text strong { font-size: .9375rem; }
.wizard-choice-text span { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.wizard-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.wizard-chip { position: relative; display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem .875rem; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-size: .8125rem; font-weight: 600; cursor: pointer; }
.wizard-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wizard-chip:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.wizard-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.wizard-seg label.seg { min-height: 2.75rem; }
.wizard-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.wizard-status { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.wizard-status-dot { width: .5rem; height: .5rem; flex: none; border-radius: var(--radius-pill); background: var(--muted); }
.wizard-status.is-ok .wizard-status-dot { background: var(--ok); }
.wizard-status.is-warn .wizard-status-dot { background: var(--warn); }
.wizard-status.is-danger .wizard-status-dot { background: var(--danger); }
.wizard-bar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .75rem; }
.wizard-bar-actions a { color: var(--brand); font-weight: 600; }
.wizard-hint { margin: 0; color: var(--muted); font-size: .8125rem; }
@media (min-width: 40rem) {
  .wizard-choices { grid-template-columns: 1fr 1fr; }
}
.money-row { padding: .65rem 0; border-top: 1px solid var(--line); }
.money-row:first-of-type { border-top: 0; }
.money-row-path { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: 0; font-size: .8125rem; }
.money-row-path .icon { width: 1rem; height: 1rem; color: var(--muted); }
.money-row-title { color: var(--text); font-weight: 700; }
.money-row-amount { margin: .2rem 0 0; color: var(--text); font-size: 1.125rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.money-row-meta { margin: .15rem 0 0; color: var(--muted); font-size: .75rem; }
.money-form { display: grid; gap: .5rem; margin-top: .5rem; }
/* One person, several currencies: each currency reads as its own little block, never as another person's row. */
.dinero-currency { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; }
.dinero-currency + .dinero-currency { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--line); }
.money-form .dialog-error { margin: 0; color: var(--danger); font-size: .875rem; font-weight: 600; }
.money-form .dialog-error:empty { display: none; }
.action-dialog .dialog-error { margin: 0 0 .5rem; color: var(--danger); font-size: .875rem; font-weight: 600; }
.action-dialog .dialog-error:empty { display: none; }
.money-form label { margin: 0; }
.money-form input[type="text"], .money-form select { min-height: 2.5rem; }
.money-form button { justify-self: start; }

/* Places where the agency keeps money (/admin/tesoreria): a tree with the balance of each place read from the ledger. */
.place-tree { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.place-node > .place-tree { margin: .5rem 0 0 1.25rem; padding-left: .75rem; border-left: 1px dashed var(--line-strong); }
.place-row { display: grid; gap: .35rem; padding: .75rem .875rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-sentence); }
.place-name { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.place-name .icon { width: 1rem; height: 1rem; color: var(--brand); }
.place-balance { margin: 0; }
.place-row .sala-edit summary { display: inline-flex; align-items: center; gap: .35rem; }

/* The access of one place: who sees it, the readers it inherits from inside and the form of a new grant. */
.acceso-dialog { width: min(36rem, calc(100vw - 2rem)); }
.acceso-lugar { margin: 0 0 .25rem; font-size: 1.05rem; }
.acceso-dialog h4 { margin: 1rem 0 .25rem; }
.acceso-table { min-width: 0; }
.acceso-table td.actions { white-space: nowrap; text-align: right; }
.acceso-heredado { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.acceso-heredado ul { margin: .25rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .875rem; }

/* Corrections of the ledger (/admin/tesoreria/movimientos): the same three-line movement rows as the money panel, on white. */
.movement-list { display: grid; gap: .75rem; }
.movement-card { margin: 0; }
.movement-fixes { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.movement-fix { flex: 1 1 14rem; }
.movement-fix summary { cursor: pointer; font-weight: 600; }
.movement-fix .money-form { max-width: 26rem; }
.movement-pager { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }

/* The money desk: reservations with their money on the left, the Fondo Común on the right. On a phone the fund is one tap away and
   opens over the page, reusing the same overlay the reservation's money panel uses (html.money-overlay). */
.dinero-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; align-content: start; }

/* The three tabs of the desk: a rounded track with the active one in brand, the colour sliding from one side to the other. */
.dinero-switch { display: inline-flex; gap: .125rem; padding: .1875rem; border-radius: var(--radius-control); background: var(--surface-2); }
.dinero-switch a { padding: .45rem .9rem; border-radius: var(--radius-row); color: var(--muted); font-size: .8125rem; font-weight: 600; text-decoration: none; }
.dinero-switch a:hover { color: var(--text); }
.dinero-switch a.is-on { background: var(--brand); color: var(--brand-text); }

/* Caja: the figures of the whole agency, then the list of where the money is. */
.dinero-caja-totales { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.dinero-caja-total { display: grid; gap: .125rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-control); }
.dinero-caja-total strong { font-size: 1.25rem; }
.dinero-caja-total p { margin: 0; font-size: .8125rem; }
.dinero-caja-table td:last-child { font-weight: 700; white-space: nowrap; }
.dinero-caja-lines { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.dinero-caja-lines li { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; font-size: .75rem; }
.dinero-caja-lines .link { font-size: .75rem; }
.dinero-caja-table tr.is-owner td:first-child { color: var(--muted); }
.dinero-sobres-card .muted { margin: .75rem 0 0; font-size: .8125rem; }

/* Arqueo: the figures of the agency, the bars by root and the places with what each one keeps. */
.arqueo { display: grid; gap: 1rem; }
.arqueo-resumen { display: grid; gap: .75rem; }
.arqueo-barra { display: grid; grid-template-columns: 10rem minmax(0, 1fr) auto; gap: .5rem; align-items: center; margin: .35rem 0; }
.arqueo-barra-nombre { font-weight: 600; }
.arqueo-barra-track { width: 100%; accent-color: var(--brand); }
.arqueo-sub td:first-child { padding-left: 1.5rem; color: var(--muted); }
.arqueo .dinero-table { min-width: 0; }
.dinero-count { margin: 0; padding: 0 1rem .75rem; color: var(--muted); font-size: .8125rem; }
.dinero-table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: .78125rem; text-align: left; }
.dinero-table th { padding: .5rem; background: var(--surface-sentence); border-bottom: 2px solid var(--line); color: var(--muted); font-size: var(--font-floor); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.dinero-table td { padding: .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.dinero-table tr:last-child td { border-bottom: 0; }
.dinero-amount { font-weight: 700; white-space: nowrap; }
.dinero-action { white-space: nowrap; }
/* A card of the home's «Dinero» is the reservation card (`.ah-task`): the title and its state badge wrap in the narrow side column,
   and the answers go under the text. */
.dinero-inbox .ah-task-top { flex-wrap: wrap; }
.dinero-inbox .ah-task-top .badge { white-space: nowrap; }
/* «Dinero esperando a administración» in the side column (odd/tasks/inicio-admin-dinero-lateral.md, L7): one reservation card per group
   of the Bandeja, its count as the badge at the end of the row; the notes (the fees to fix, the oldest wait) in the muted small type. */
.ah-espera .ah-task { align-items: center; }
.ah-espera .ah-section-row .ah-link { flex: none; white-space: nowrap; }
.ah-espera .ah-task-top .badge { margin-left: auto; font-variant-numeric: tabular-nums; }
/* A muted note line of a home section (the fees to fix apart, the oldest wait, what was handed over apart). */
.ah-note { display: flex; align-items: center; gap: .375rem; margin: 0; color: var(--muted); font-size: .8125rem; }
.ah-note .icon { width: .875rem; height: .875rem; flex: none; }
.dinero-inbox-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .375rem; }
.dinero-inbox-actions input[type="text"] { min-height: 2rem; width: 9rem; }

.fondo-panel { margin: 0; }
.fondo-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.fondo-head h2 { margin: 0; font-size: 1.125rem; }
.fondo-moneda { margin-top: .75rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-sentence); }
.fondo-figures { display: grid; gap: .15rem; margin: .25rem 0 0; }
.fondo-figures div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.fondo-figures dt { color: var(--muted); font-size: .75rem; }
.fondo-figures dd { margin: 0; font-weight: 700; white-space: nowrap; }
.fondo-figures dd { font-size: 1rem; }
.fondo-figures .is-short dt,
.fondo-figures .is-short dd { color: var(--danger); }
.fondo-deposit { margin: .25rem 0 0; }
.fondo-actions { display: flex; flex-wrap: nowrap; align-items: stretch; gap: .5rem; margin: .75rem 0; }
.fondo-actions .button { flex: 1 1 0; min-width: 0; height: auto; white-space: nowrap; }
.fondo-actions .button .custom-text { white-space: nowrap; }
.fondo-custody-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px dashed var(--line-strong); }
.fondo-custody-row:last-of-type { border-bottom: 0; }
.fondo-custody-amount { text-align: right; }
.fondo-custody-amount strong { display: block; }
.fondo-pending { margin-top: .5rem; padding: .75rem .9rem; border-radius: var(--radius-card); background: var(--warn-soft); color: var(--warn); }
.fondo-pending p { margin: 0 0 .25rem; }
.fondo-pending-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.fondo-pending-actions input[type="text"] { min-height: 2rem; width: 9rem; }

/* The split screen needs the table's 40rem plus the fund's 18rem and the gap: below 84rem the table takes the row and the fund opens
   over the page with the button under the filters. Only the tab that shows the fund splits: the others keep the whole row, or the
   table would lose a column to an empty space and cut its last one. */
@media (min-width: 84rem) {
    .dinero-page:has(> .fondo-panel) { grid-template-columns: minmax(0, 1fr) minmax(18rem, 20rem); gap: 1.5rem; }
    .fondo-panel { position: sticky; top: 1rem; }
}

@media (max-width: 83.99rem) {
    .fondo-panel { display: none; }
}

/* «Te toca ahora» (odd/tasks/navegacion-movil.md, N1–N2): the reader's next steps across the stage and the money, then the progress of
   both flows. The first step is the call to action; the rest are links to where each is done. */
.next-steps { display: flex; flex-direction: column; gap: .875rem; border: 2px solid var(--brand); }
.next-steps-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.next-steps .eyebrow { margin: 0; color: var(--brand); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.next-step-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.next-step-list button { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.next-step-list :is(a, button) { display: flex; flex-direction: column; justify-content: center; gap: .125rem; min-height: 2.75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 600; text-decoration: none; }
.next-step-list li:last-child :is(a, button) { border-bottom: 0; }
.next-step-list :is(a, button):hover > span:first-child { color: var(--brand); text-decoration: underline; }
.next-step-list .muted { font-size: .8125rem; font-weight: 400; }
.flow-progress { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .5rem .875rem; margin: 0; padding-top: .75rem; border-top: 1px solid var(--line); }
.flow-progress dt { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.flow-progress dd { display: flex; flex-direction: column; gap: .375rem; min-width: 0; margin: 0; }
.flow-progress dd.flow-chips { flex-direction: row; flex-wrap: wrap; }

/* The stage's card: the agenda first, then its summary, then one button (odd/tasks/reserva-un-solo-boton.md). A row the completion form
   performs is not a link: it reads as a line with its detail. */
.stage-summary { padding-top: .875rem; border-top: 1px solid var(--line); }
.next-steps > .stage-summary:first-child { padding-top: 0; border-top: 0; }
.next-step-list .next-step-row { display: flex; flex-direction: column; gap: .125rem; min-height: 2.75rem; justify-content: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.next-step-list .next-step-row > span:first-child { font-weight: 600; }
.next-step-list li:last-child .next-step-row { border-bottom: 0; }

/* The reservation's tabs (N3, and on the desktop too since odd/tasks/reserva-agente-orden.md O4): only while the script runs them;
   without script every panel shows. */
.reservation-tabs { margin: 0 0 1.25rem; }
.reservation-tabs button.seg { min-height: 2.75rem; }
.reservation-tabs button.seg[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.tab-panel:empty { display: none; }
.has-tabs .tab-panel:not(.is-active) { display: none; }
/* Printed, the reservation shows every section, without the bar. */
@media print {
  .has-tabs .tab-panel:not(.is-active) { display: block; }
  .reservation-tabs { display: none; }
  details.later > .later-body { display: block; }
}
@media (max-width: 63.99rem) {
}

/* What comes later (O2): a folded block at the end of a tab, its summary naming each item and the stage that asks for it. The cards inside
   keep their own look; opening a dialog inside opens the block first (app.js). */
details.later { margin: 0 0 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-panel); background: var(--surface-sentence); }
details.later > summary.later-head { display: flex; flex-direction: column; gap: .25rem; min-height: 2.75rem; padding: .875rem 1.25rem; cursor: pointer; list-style: none; }
details.later > summary.later-head::-webkit-details-marker { display: none; }
.later-title { display: flex; align-items: center; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.later-title::after { content: "\203A"; margin-left: auto; font-size: 1.25rem; line-height: 1; }
details.later[open] .later-title::after { content: "\2303"; }
.later-item { color: var(--text); }
.later-body { padding: 0 .75rem .25rem; }
.later-due { margin-top: 0; }
.later-operation { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin: 0 0 .5rem; color: var(--muted); }

/* «Tenés … en mano» on the agent home (N5): the money the agent holds, in the warning tone until administration confirms it. Each row
   links to the card where it is handed over. */
.in-hand { display: grid; gap: .5rem; padding: .875rem 1rem; border-radius: var(--radius-panel); background: var(--warn-soft); color: var(--text); }
.in-hand h2 { margin: 0; color: var(--warn); font-size: 1rem; font-weight: 800; }
.in-hand-waiting { margin: 0; color: var(--muted); font-size: .875rem; }
.in-hand ul { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.in-hand a { display: grid; gap: .25rem; justify-items: start; min-height: 2.75rem; padding: .5rem 0; border-top: 1px solid var(--line-strong); color: var(--text); text-decoration: none; }
.in-hand li:first-child a { border-top: 0; }
.in-hand-what { font-weight: 700; }
.in-hand a:hover .in-hand-what { color: var(--brand); text-decoration: underline; }
.in-hand-meta { color: var(--muted); font-size: .8125rem; }
.in-hand a.in-hand-line { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }

/* Administration's Bandeja (odd/tasks/navegacion-movil.md, N7): the queue on the left, the chosen row's card on the right (stacked
   on a phone). Filter chips are links, the current one filled. */
.bandeja { display: grid; gap: 1.25rem; }
.bandeja-head { display: grid; gap: .25rem; }
.bandeja-head h1, .bandeja-head p { margin: 0; }
.bandeja-body { display: grid; gap: 1.25rem; align-items: start; }
.bandeja-list { display: grid; gap: 1rem; min-width: 0; }
.bandeja-table-card { padding: 0; }
.bandeja-table td { vertical-align: middle; }
.bandeja-table .num { text-align: right; white-space: nowrap; }
.bandeja-table .badge { white-space: nowrap; }
.bandeja-what { display: grid; gap: .125rem; justify-items: start; min-width: 12rem; }
.bandeja-since { white-space: nowrap; }
.bandeja-table td:last-child { width: 1%; white-space: nowrap; }
/* On a phone each row is a block (what, amount and date, then the action): the four columns do not fit beside each other. */
@media (max-width: 41.99rem) {
  .bandeja-table, .bandeja-table tbody { display: block; }
  .bandeja-table thead { display: none; }
  .bandeja-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem .75rem; padding: .875rem 1rem; border-bottom: 1px solid var(--line); }
  .bandeja-table tbody tr:last-child { border-bottom: 0; }
  .bandeja-table td { display: block; padding: 0; border: 0; }
  .bandeja-table td.bandeja-what { display: grid; grid-column: 1 / -1; min-width: 0; }
  .bandeja-table td.num { text-align: left; font-weight: 700; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  .bandeja-table td.bandeja-since { text-align: right; color: var(--muted); font-size: .8125rem; }
  .bandeja-table td:last-child { grid-column: 1 / -1; width: auto; }
}
.bandeja-detail { min-width: 0; }
.bandeja-detail > .card > p.muted { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-current="page"], .chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: var(--brand-text); }
/* Side by side where the compact table (what, amount, since, action) fits beside the card; below it the card follows the list. */
@media (min-width: 90rem) {
  .bandeja-body { grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); }
  .bandeja-detail { position: sticky; top: 1rem; }
}

/* «Mi dinero» (N8): the money in the agent's hands, then their own current account and its latest entries. */
/* «Mi dinero» drawn like the homes (odd/tasks/inicio-admin-dinero-lateral.md, L8): `.ah` with the money in hand in `.ah-main` and the
   current account in `.ah-side`; each piece an `.ah-task` card. The account opens with its balance in a card, then its latest entries
   as cards with the amount at the end of the row. */
.my-money { display: grid; gap: 1.25rem; }
.my-money h1 { margin: 0; }
.ah-en-mano .ah-task-name { font-weight: 700; }
.my-account-summary { display: grid; gap: .5rem; margin: 0; }
.my-account-summary p { margin: 0; }
.my-account .section-label { margin: 0; }
.my-account-balance { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: 1.5rem; }
.my-account-balance .is-negative, .my-account-amount.is-negative { color: var(--danger); }
.my-account-entries .ah-task-top { align-items: baseline; }
.my-account-entries .ah-task-name:hover { color: var(--text); text-decoration: none; }
.my-account-amount { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* The notices bell in the phone's top bar, for the agents whose tab bar gives Avisos's place to «Mi dinero» (owner decision 4). */
.top-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; margin-left: auto; border-radius: var(--radius-pill); color: var(--brand-text); }
.top-bell .icon { width: 1.375rem; height: 1.375rem; }
.top-bell .badge.unread { position: absolute; top: .125rem; right: .125rem; min-width: 1.125rem; padding: 0 4px; line-height: 1.125rem; }
.top-bell[aria-current="page"] { background: var(--navy-2); }

/* The menu's configuration folds away (N9): its heading is the summary, with a chevron that turns when it is open. */
.menu-config > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; border-radius: var(--radius-control); }
.menu-config > summary::-webkit-details-marker { display: none; }
.menu-config > summary:hover { color: var(--menu-text); }
.menu-config > summary .icon { width: 1rem; height: 1rem; transition: transform .15s ease; }
.menu-config[open] > summary .icon { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .menu-config > summary .icon { transition: none; } }

/* «Apariencia» (N10): three color pickers and a small piece of the app painted with them. */
.appearance { display: grid; gap: 1rem; max-width: 48rem; }
.appearance h1, .appearance > p { margin: 0; }
.appearance-form { display: grid; gap: 1.25rem; }
.appearance-fields { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.appearance-fields input[type="color"] { width: 100%; min-height: 2.75rem; padding: .25rem; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--surface); }
.theme-preview { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--bg); }
.theme-preview-bar { display: flex; align-items: center; gap: .625rem; padding: .875rem 1rem; background: var(--navy); color: var(--on-header); font-weight: 800; }
.theme-preview-menu { margin-left: auto; padding: .375rem .75rem; border-radius: var(--radius-row); background: var(--brand); color: var(--brand-text); font-weight: 600; }
.theme-preview-body { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem; }
.theme-preview-link { color: var(--brand); font-weight: 600; text-decoration: underline; }
.theme-preview-chip { padding: .25rem .75rem; border: 1px solid var(--brand); border-radius: var(--radius-pill); color: var(--brand); font-weight: 600; }

/* The money steps a stage waits for (decision 44), in the flow editor: a plain group of checks under its legend. */
.money-steps { display: grid; gap: .25rem; margin: .75rem 0; padding: 0; border: 0; }
.money-steps legend { margin-bottom: .25rem; padding: 0; color: var(--muted); font-weight: 600; }

/* A secondary action that asks for its reason only when it is opened (cancelling a delivery that is waiting). */
.inline-cancel { display: inline-block; }
.inline-cancel summary { cursor: pointer; font-size: .875rem; }
.inline-cancel form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .35rem; }

/* Movements of the ledger: a compact table from 64rem, one card per line below it. */
.mov-table-wrap { display: none; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); overflow-x: auto; }
.mov-table { width: 100%; border-collapse: collapse; font-size: .8125rem; text-align: left; }
.mov-table th { padding: .5rem .75rem; background: var(--bg); border-bottom: 2px solid var(--line); color: var(--muted); font-size: var(--font-floor); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.mov-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.mov-table tr:last-child td { border-bottom: 0; }
.mov-table td .muted { display: block; }
.mov-table td strong + .muted, .mov-table td strong + .badge { margin-left: .25rem; }
.mov-date, .mov-amount { white-space: nowrap; }
.mov-amount { font-weight: 700; }
.mov-table .movement-fixes { margin: 0; padding: 0; border: 0; flex-direction: column; gap: .25rem; }
.mov-table .movement-fix { flex: none; }
@media (min-width: 64rem) {
  .mov-table-wrap { display: block; }
  .movement-list { display: none; }
}

/* «Para dejarla operable»: the steps an agency still lacks, numbered when they are required, each with its state and the way to do it. */
.setup-steps { display: grid; gap: .5rem; margin: .5rem 0 1rem; padding: 0; list-style: none; counter-reset: setup; }
.setup-step { display: grid; grid-template-columns: auto 1fr; gap: .125rem .75rem; align-items: start; padding: .625rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.setup-step-state { grid-row: span 2; min-width: 4.5rem; }
.setup-step-title { font-weight: 600; }
ol.setup-steps > .setup-step .setup-step-title::before { counter-increment: setup; content: counter(setup) ". "; color: var(--muted); }
.setup-step-hint { margin: 0; font-size: .875rem; }
.setup-step a { font-size: .875rem; font-weight: 600; }
#proximo-paso a { margin-left: .75rem; }

/* Photo drop area (_PhotoDrop): a dashed target with a camera icon in place of the browser's file input, a preview of what was chosen
   and, in the guarantee card, the photos already stored. Long file names are cut with an ellipsis, never overflow a 390 px screen. */
.photo-drop { display: grid; gap: .5rem; min-width: 0; }
.photo-drop-area { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 7rem; padding: 1rem .75rem; border: 2px dashed var(--control-border); border-radius: var(--radius-panel); background: var(--surface-sentence); color: var(--text); text-align: center; cursor: pointer; }
.photo-drop-area .icon { width: 2rem; height: 2rem; color: var(--brand); }
.photo-drop-title { font-weight: 700; }
.photo-drop-hint { color: var(--muted); font-size: .85rem; }
.photo-drop-area:hover, .photo-drop.dragging .photo-drop-area { border-color: var(--brand); background: var(--brand-tint); }
.photo-drop-input:focus-visible + .photo-drop-area { outline: 2px solid var(--focus); outline-offset: 2px; }
.photo-drop-list, .photo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.photo-drop-list[hidden] { display: none; }
.photo-item { display: flex; align-items: center; gap: .625rem; min-width: 0; padding: .375rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.photo-thumb { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; overflow: hidden; border-radius: var(--radius-control); background: var(--surface-2); color: var(--muted); object-fit: cover; }
.photo-thumb .icon { width: 1.25rem; height: 1.25rem; }
.photo-meta { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.photo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.photo-size { color: var(--muted); font-size: .8125rem; }
.photo-item .check { flex: none; }
.photo-item .row-remove { flex: none; margin-left: 0; display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; background: none; border: 0; cursor: pointer; }
.photo-list { margin-bottom: .75rem; }
.garantia-historia { margin-top: .75rem; }
.garantia-historia summary { cursor: pointer; font-weight: 700; }
.garantia-historia ol { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.garantia-historia li { padding: .5rem .625rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-sentence); overflow-wrap: anywhere; }
.garantia-historia .cambio { display: block; color: var(--muted); font-size: .875rem; }

/* An amount that may come in several currencies (decision 32): one row as always; «Agregar otra moneda» adds a row with its own currency. */
.amount-rows { display: grid; gap: .5rem; min-width: 0; }
.amount-rows .field { margin: 0; }
.amount-extra { display: grid; gap: .25rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.amount-extra [data-amount-remove] { justify-self: start; min-height: 2.75rem; }
.amount-add { margin: 0; }
.amount-add [data-amount-add] { min-height: 2.75rem; }
.return-currency { display: grid; gap: .5rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.return-currency:first-of-type { border-top: 0; padding-top: 0; }
.return-currency .field { margin: 0; }

/* Classifying the guarantee (decisions 22 to 26): the envelopes are a list that grows; the fund is computed and read-only. */
.envelope-rows { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.envelope-row { display: grid; gap: .5rem; padding: .75rem .875rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-sentence); min-width: 0; }
.envelope-row .field { margin: 0; }
.envelope-row [data-envelope-remove] { justify-self: start; min-height: 2.75rem; }
.envelope-fund { margin: .75rem 0 .25rem; font-weight: 700; }
.envelope-over-text { margin: 0 0 .5rem; color: var(--danger); font-size: .8125rem; font-weight: 600; }
.envelope-over .envelope-fund { color: var(--danger); }
.reinforcement-item { flex-wrap: wrap; }
.reinforcement-item .dialog-actions { margin: 0; }

/* A reservation whose guarantee was not received (decision 27): a red warning on the home, from the first day. It uses the danger tokens. */
.unreceived { display: grid; gap: .5rem; padding: .875rem 1rem; border-radius: var(--radius-panel); border: 1px solid var(--danger); }
.unreceived h2 { margin: 0; color: var(--danger); font-size: 1rem; font-weight: 800; }
.unreceived ul { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.unreceived a { display: grid; gap: .15rem; justify-items: start; min-height: 2.75rem; padding: .5rem 0; border-top: 1px solid var(--danger); color: var(--text); text-decoration: none; }
.unreceived li:first-child a { border-top: 0; }
.unreceived-what { font-weight: 700; overflow-wrap: anywhere; }
.unreceived-meta { color: var(--muted); font-size: .8125rem; }
.unreceived.pending-fees { border-color: var(--warn); }
.unreceived.pending-fees h2, .unreceived.pending-fees .unreceived-go { color: var(--warn); }
.unreceived.pending-fees a { border-top-color: var(--warn); }
.unreceived .hands-item { display: grid; gap: .25rem; justify-items: start; border-top: 1px solid var(--warn); }
.unreceived .hands-item:first-child { border-top: 0; }
.unreceived .hands-item a { border-top: 0; }
.unreceived .hands-item form { margin: 0 0 .5rem; }
.hands-agent { margin: 1rem 0 .25rem; font-size: 1rem; }
.unreceived-go { color: var(--danger); font-size: .8125rem; font-weight: 700; text-decoration: underline; }
