/*
 * The web layer's stylesheet: a hand port of the V4 redesign's globals.css and
 * of the style values its screens set inline, from kirlts/traza-ambiental-mvp
 * at commit e883297.
 *
 * Why hand-written CSS and not Tailwind. The V4 screens were written with
 * Tailwind v4 in a Next.js build, but almost everything they draw comes from
 * `style={{...}}` literals, not from utility classes: the login screen uses
 * Tailwind for hover and focus states and little else. Porting those literals
 * into named classes here reproduces the design exactly without adding a
 * Node toolchain to a repository that has none, and without the Tailwind Play
 * CDN, which compiles styles in the visitor's browser at runtime and is not
 * meant for production. The cost is that a new screen ported from V4 has its
 * inline values turned into classes by hand, in this file.
 *
 * What was deliberately left behind from globals.css:
 *   - the shadcn/ui token set (chart, sidebar, popover, the oklch greys) and
 *     the `.dark` theme: no ported screen uses them yet, and V4 itself shipped
 *     its dark mode commented out;
 *   - the demo-mode animations, which belong to a screen not ported, and the
 *     landing page's two: the typing effect cycled through the six priority
 *     products the knowledge base rules out (templates/landing.html says
 *     why), and the floating logo is motion with nothing to say, kept as a
 *     still glow instead;
 *   - the `!important` war on input colours. V4 needed it to override
 *     Tailwind's preflight; here nothing competes, so plain rules suffice.
 *
 * Fonts: Geist and Geist Mono, self-hosted from static/fonts/ since November
 * 2026 (the @font-face rules below), when the landing page's «1b» redesign
 * asked for them. V4 loaded Geist through next/font, which self-hosts it at
 * build time; until then nothing loaded it here, and the stack fell through
 * to Arial, V4's own declared fallback. The two tokens `--font-sans` and
 * `--font-mono` have always named Geist first, so the faces apply to every
 * page, not the landing alone: a second family name for the landing would
 * have kept the rest of the app on the fallback V4 never meant to show.
 * Loading them from Google Fonts, as the design did, was rejected because
 * every page view would hand the visitor's IP address to a third party, a
 * data-protection exposure this project has not decided to take on. The
 * files are the variable fonts of the `geist` npm package 1.9.2 (one file
 * per family covers every weight the pages use), under the SIL Open Font
 * License, whose text is static/fonts/OFL-Geist.txt beside them.
 */

/* `swap`: the text shows at once in the fallback and changes face when the
   file arrives, rather than staying invisible for up to three seconds. */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.f208f1ceee9d.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.6aaa5f578bc1.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* V4's emerald brand scale, as its screens use it inline. */
  --brand-900: #064e3b;
  --brand-700: #047857;
  --brand-600: #059669;
  --brand-500: #10b981;
  --brand-200: #a7f3d0;
  --brand-100: #d1fae5;
  --brand-50: #ecfdf5;

  --text-strong: #111827;
  --text: #374151;
  --text-muted: #4b5563;
  --text-subtle: #6b7280;
  /* Only for an input's placeholder and for text on the dark footer. On a
     white or `--surface-muted` background it measures about 2.5:1, under the
     4.5:1 WCAG 2.1 AA asks of body text, so it is not a colour for anything
     a reader needs: labels, hints, empty states and secondary lines use
     `--text-subtle`, which measures about 4.8:1 on white and 4.6:1 on
     `--surface-muted`. V4 used this grey for those too; the port kept it
     until the UI audit of October 2026 moved every such rule off it. */
  --placeholder: #9ca3af;

  /* The danger button's red: Tailwind's red-700, a red V4's palette already
     carries, 6.5:1 for white text on it; its hover is red-800 (8.3:1). */
  --danger-700: #b91c1c;
  --danger-800: #991b1b;

  /* The flash messages' tones beyond the success green, each a background,
     a border and a text colour that measures at least 6.5:1 on its background
     (warning, the lowest, 6.8:1). */
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1e40af;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --error-border: #fca5a5;

  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --border: #e5e7eb;

  /* Named by role, not by value, so a rule says what a colour is for and a
     later change to one role does not drag the others with it. Two pairs
     share a value today on purpose: `--surface-subtle` and `--divider` are
     both V4's gray-100, one as a pill's or a hover's fill and one as the
     hairline between rows; `--brand-800` and `--success-text` are both
     emerald-800, one as brand ink (a link's hover, a code chip) and one as
     the text of a confirmation. Before October 2026 each was a hex literal
     repeated across the file. What stays literal on purpose: the semáforo's
     and the carrier leg's colour sets (`.status-*`, `.leg-*`), one set per
     state, each written once beside the comment that says why it is that
     colour; the login's gradient, decoration used once; the black of a
     shadow at an alpha, which
     is depth rather than a colour of the palette; and white drawn on a fill
     -- the text of a filled button or of the carrier's current leg filter,
     and the light landing button's focus ring on the green gradient.
     config/tests/test_frame.py pins that list: a literal anywhere else
     fails it. */
  --brand-800: #065f46;
  --surface-subtle: #f3f4f6;
  --surface-hover: #f0fdf4;
  --divider: #f3f4f6;
  --border-strong: #d1d5db;
  --success-bg: #eef9f2;
  --success-text: var(--brand-800);

  --error-bg: #fef2f2;
  --error-text: #991b1b;
  /* The refusal notice's darker red, for a paragraph read on the error
     background rather than a single line. */
  --error-strong: #7f1d1d;

  /* The last literals that were neither here nor on the exempt list above,
     named in November 2026. Each is named for the one role it plays, so a
     later change to it does not drag another rule that shares its value
     today: several do, and that is a coincidence of the palette, not a
     link. */
  /* The text typed into a field: V4's slate-900, a shade darker than
     `--text-strong`, which V4's globals.css sets on every input and on the
     browser's autofill. */
  --input-ink: #0f172a;
  /* The Registro de Movimiento's own red: the folio box and the scan card's
     head, Tailwind's red-600. It is the document's mark, not a state, so it
     follows neither the error tones (`--error-*`) nor the danger button
     (`--danger-700`). */
  --doc-red: #dc2626;
  /* The pill of a refused load still waiting for an alternative destination
     (`.rejection-mark-pending`): a fill a step stronger than `--error-bg`,
     so it reads as a badge beside the semáforo and not as a notice. */
  --pending-refusal-bg: #fee2e2;
  /* A scan's confirmation (`.scan-done`), load or unload alike. Lime, the
     same values as the semáforo's «Entregado» today, but a confirmed load
     is not a delivered one, so the two are not one token. */
  --scan-done-text: #4d7c0f;
  --scan-done-bg: #ecfccb;
  /* The «Formato provisional» pill (`.draft-badge`). Amber, the same values
     as the semáforo's «En tránsito» today, but a provisional format is not
     a load on the road. */
  --draft-text: #b45309;
  --draft-bg: #fef3c7;
  /* The landing page's own greens (the «1b» redesign of November 2026),
     beside the brand scale above rather than in it, because no other page
     uses them: the darkest green of its strip, phone and footer; the light
     green of its accents, ring and chosen pill; Category B's green on the
     ruler of rims; and three translucent greens -- the phone's glow, the
     footer's rule and an unchosen pill's edge -- each named for the one
     thing it draws. */
  --brand-950: #022c22;
  --brand-300: #6ee7b7;
  --rim-b: #16a34a;
  --landing-glow: rgba(110, 231, 183, 0.25);
  --landing-rule-dark: rgba(167, 243, 208, 0.2);
  --landing-pill-border: rgba(167, 243, 208, 0.35);
  /* A chosen pill's fill: the light accent at a tenth, so the choice reads
     as a lit outline and the light fill stays the button's alone. */
  --landing-pill-chosen: rgba(110, 231, 183, 0.12);
  /* A field's error on the landing's dark green (`.landing-form
     .field-error`): red-200, over 7:1 on `--brand-900`, where the app's
     `--error-text` would measure under 2:1. */
  --error-on-dark: #fecaca;
  /* The maps' markers: the dark edge every marker is drawn with, and the
     fills of the lettered carrier and plant markers. The edge is read by
     static/js/heat_map.js too, for the waste points, which Leaflet draws as
     SVG paths whose stroke it sets itself, out of a stylesheet rule's reach. */
  --marker-edge: #1f2937;
  --marker-carrier: #1d4ed8;
  --marker-plant: #6d28d9;

  --radius: 0.625rem;
  --font-sans: "Geist", Arial, Helvetica, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-strong);
  background: var(--surface-muted);
  -webkit-font-smoothing: antialiased;
}

/* The links of the content: the navigation's green ink, so a link in a
   card or a note reads as part of the same system as the header's. Until
   November 2026 there was no rule for `a`, and every link without a class
   of its own («Publica una necesidad», the branch names and «Modo
   privado» on the master's home page, «Indicadores de la red» on «Red»)
   came in the browser's blue, and purple once visited, beside a green
   navigation. Underlined, as the browser draws it, so a link inside a
   sentence is told apart by more than its colour (WCAG 1.4.1); the
   navigation, the buttons and the list rows remove the underline with
   classes of their own. One colour whether visited or not: these are an
   application's links, revisited on every working day, so «visited» says
   nothing worth a colour. The hover is wrapped in `:where()` to keep the
   specificity of a bare `a`: a plain `a:hover` would outrank every
   one-class rule and turn a primary button's white label green. */
a {
  color: var(--brand-700);
  text-underline-offset: 2px;
}

a:where(:hover) {
  color: var(--brand-800);
}

/* Form inputs: V4's globals.css guarantees dark, legible input text on every
   input, including browser autofill, which otherwise paints its own colours. */
input,
textarea,
select {
  font: inherit;
  color: var(--input-ink);
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--input-ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-muted) inset;
}

/* «Saltar al contenido» (base.html): off the page until a keyboard focuses
   it, then over the header's top-left corner, where the Tab key's first
   stop is expected. Moved rather than `.visually-hidden`, which a focused
   element would keep clipped to one pixel. */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--surface);
  border-radius: 8px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* `main` is focused only by the skip link (it is `tabindex="-1"`), and the
   region it would ring is the whole page: the link already said where the
   focus went. */
.app-main:focus {
  outline: none;
}

/* The full pattern: the 1px box with no margin, padding or border, so it
   takes no room; `clip-path` beside the deprecated `clip`. Being absolute,
   it is placed against its nearest positioned ancestor and escapes the clip
   of any `overflow` box between the two: see `.table-scroll`. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   App shell: the header of V4's role sidebars (logo, wordmark, 64px band with
   an emerald hairline), laid out as a top bar. V4's sidebars are fixed 256px
   columns whose content area has a 944px minimum width, which does not fit a
   phone; a top bar does, and the transporter works from a phone. The
   sidebar's navigation is reduced to `.app-nav`: up to twelve links in up
   to three named groups (templates/base.html says which, to whom and why),
   followed by the account: the branch -- its scope, its own pages and the
   way out of it -- and the person signed in, with their buttons.

   All of that after the brand sits in `.app-menu-panel`, a native popover
   opened by «Menú» (`popovertarget`). Mobile first: up to 1024px it is a
   «Menú» button whose panel drops below the band, so nothing scrolls
   sideways and no label is cut; from 1025px «Menú» is hidden and the panel
   is shown as a row beside the brand, where the row fits on one line, and
   «Menú» stays where it does not (the last paragraph of this comment). The
   cut is the header's own: the
   other `max-width: 720px` queries in this file are for the tables, the
   landing page and the forms, and stay where they are.

   Why a popover, and not the <details> it was until November 2026. A
   <details> hears no key, so an open menu could not be put away with
   Escape, and the Tab key walked on from its last button into the page
   under the panel, which stayed open over the controls it reached (WCAG
   2.4.11; measured at 375px on «Movimientos»: «Registrar movimiento», the
   search field and «Buscar» all focused under the 603px panel). Once the
   band was sticky that was every control of every page. The browser
   opens and closes a popover, closes it on Escape and gives the focus
   back to «Menú», and exposes the button's expanded state, all with no
   script. What it does not do is close when the Tab key carries the focus
   out of it: with Escape alone the panel still stayed over the controls
   the focus went on to, wholly at 375px and up to 71% at 1280px. That
   thing is the first job of the frame's only script, static/js/frame.js,
   which says why and what it rejected. Rejected here: keeping the
   <details> and scripting both Escape and the focus leaving, which scripts
   what the popover does natively.
   A browser without popovers (Safari before 17, Chrome before 114) gets
   every control in the band at once, under the brand, and a band that
   scrolls away (the `@supports not` block at the end of this section): a
   taller header on an old phone, but nothing out of reach. It used to get
   the <details> menu.

   The menu closes on Escape, on a tap on «Menú», on following one of its
   links, which loads another page, and on a tap anywhere outside the
   panel. A popover closes on an outside tap by itself, but in Chrome the
   same click then lands on what was under it, a link of the page
   included; in WebKit a touch does not (measured 2026-11-07). So while the
   panel is open, «Menú»'s `::before` is a transparent layer over the whole
   window, under the panel (which the top layer keeps above every layer of
   the page): an outside tap lands on «Menú» itself, which closes its
   popover, and reaches nothing else, in both engines. A tap outside a
   dismissible menu that only dismisses it is the behaviour this header
   had before and keeps. Following a link from the open menu and pressing
   Back brought the page back with the menu closed in Chrome and in WebKit
   (measured 2026-11-07, Pixel 5 and iPhone SE emulation); with the
   <details> a page restored from the back-forward cache could come back
   with it open. **Known gap, left open on purpose:** a browser that keeps a
   popover open across that cache would still show it; closing it on
   `pageshow` takes a script.

   The band is sticky: it stays at the top of the window while the page
   scrolls under it, so the navigation and «Cerrar sesión» are one tap away
   at the foot of a long page («Mapa», «Catastro», a long list). Until
   November 2026 it scrolled away with the page. Sticky rather than fixed
   because a sticky band keeps its place in the flow: nothing under it has
   to reserve its height, which on the desktop row depends on the window.
   Its z-index, 50, is chosen against what the page itself positions: above
   the heat map's full-screen toggle and «Saltar el mapa» (10 each), which
   would otherwise paint over the band as the map scrolls under it, and
   above every isolated Leaflet map; below the frame's «Saltar al
   contenido» (100), which shows itself over the band's corner when
   focused; and below full screen (2000), which lays the heat map over the
   band. The open panels are in the browser's top layer, above all of
   those, full screen included, which is why full screen hides them
   (below). `html`'s `scroll-padding-top` keeps what a jump or the Tab key
   brings into view from landing under the band.

   Why 1024px. The cut used to be 720px, the one this file uses for its
   grids, and from 721px the row was shown and wrapped. Measured in headless
   Chrome on 2026-10-04, the band then stood 136 to 211px tall at 721 to
   1024px, a sixth to a quarter of an upright tablet's screen before any
   content, and «Cerrar sesión» could end up alone on a third line. With
   the menu up to 1024px the band is 64px at every one of those widths, for
   every session, and the page never scrolls sideways.

   The open panel's width. On a phone (up to 720px) it is a column as wide
   as the band. From 721px it is a 360px dropdown hanging from the band's
   right edge, under «Menú», with the same height cap and the same scrolling
   inside it: 360px is the narrowest round width that keeps every fixed
   label on one line, the longest being the scope's «como cuenta delegada ·
   Prevencionista de riesgos», 292px at 13px. Rejected: the phone's
   full-width column on a tablet, at 1024px a sheet more than two thirds
   empty laid over the whole page -- on «Mapa», the whole map. Inside the
   panel the links run in two columns per group, under the group's name,
   filled down the first column before the second: one column of fifteen
   46px rows put «Cerrar sesión» below the panel's fold on a 667px phone,
   and the labels are short enough for two (the widest, «Notas
   operativas», is about 130px at 15px; a column at 320px is 136px). On a
   320x568 phone the panel still scrolls, and a shadow at its foot says so
   (`.app-menu-panel::after`).

   The desktop row. Until November 2026 it held the brand, up to thirteen
   links, the scope and the account's four buttons, and wrapped: 106 to
   167px, two to four lines, on most laptops for a session inside a branch,
   145px at 1280x720 and 1366x768 for a generator's, a carrier's and a
   gestor's branch (a fifth of the screen, kept on it by the sticky band),
   with the brand alone on the first line beside about 1,000px of white.
   Four moves shorten it: «Mapa» and «Catastro» are links of the
   navigation, not bordered buttons; the branch's own pages («Ubicación»,
   «Acreditación», «Notas operativas») and the account's buttons drop from
   a second popover whose button is the scope itself, naming the branch
   over its role alone; the brand stays on the navigation's line, which
   wraps beside it rather than under it; and a 1px rule, not a wider gap,
   separates the groups. Rejected: keeping the
   row and letting only its links stick, the brand's line scrolling away,
   which keeps the three lines at the top of every page and two of them on
   screen, and splits the band in two for no gain. Without the frame's
   script the row is all a browser gets from 1025px, and it is what the
   script reads: measured on 2026-11-07 in Chrome and WebKit, it is two
   lines at most, 68px, for the demo sessions, and one line, 64px, from the
   widths the last paragraph gives (1055 to 1325px). An earlier measurement
   the same day, before the account's button named the role alone, had it
   on one line only from 1100 to 1440px; those figures are superseded. A
   branch holding every profile with a 63-character name measured 96px at
   1025 to 1100px and 68px from 1280px; that one was not measured again.
   No width scrolls sideways.

   The row only where it fits. The second line those figures allow looked
   broken (at 1056x1126 on «Catastro», a master's row): the rule between
   groups is hidden at a line's start, so the wrapped «Reportes» read as
   part of «Trazabilidad», with white space to the account's button. Whether
   the row fits depends on the session's links, the account's label and the
   font, which no media query reads, so static/js/frame.js lays the band out
   as a row, reads whether it wraps, and where it does sets `data-menu` on
   the band. Every rule of the row (the `min-width: 1025px` block) is keyed
   to a band without it, so such a band keeps «Menú» and the 360px dropdown,
   64px tall, as up to 1024px. Measured on 2026-11-07 in Chrome and WebKit,
   the band is 64px at every width from 1025 to 1920px for every demo
   session: the row from 1055px for a delegated generator, 1145px for a
   delegated sistema de gestión, 1175px for a generator's master, 1220px for
   a sistema de gestión's master and 1325px for a carrier and a gestor, and
   «Menú» below. frame.js says what it rejected and why it is not deferred.
   ------------------------------------------------------------------------- */

/* Room for the sticky band whenever the browser scrolls something into view:
   a jump to an anchor (a form's error summary links to its fields) and the
   Tab key reaching a control the band would otherwise cover (WCAG 2.4.11).
   The band's height plus 16px of air, so the target is not flush with it.
   Up to 1024px the band is 64px; the desktop row's own value is with its
   rules, below. Scoped by `:has` to pages that draw the band: the landing,
   the login and their own headers are not sticky. */
html:has(.app-header) {
  scroll-padding-top: 80px;
}

/* Sticky at the top, over the page (the header comment says why sticky and
   why 50). The background is opaque so the page does not show through.
   `anchor-name` lets the account's panel hang from the band's foot, as the
   menu's panel does, whatever the band's height. */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  anchor-name: --app-band;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--brand-100);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
}

/* The frame's ring on the brand, the first stop after the skip link on
   every page, in place of the browser's 1px default, which touched the
   wordmark's last letter. */
.brand:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
  border-radius: 8px;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

/* The wordmark over the branch's name (base.html says why the branch is
   here), both cut with an ellipsis rather than pushing «Menú» off the band.
   Together 41px, inside the logo's 44px. */
.brand-text {
  display: grid;
  min-width: 0;
}

.brand-name,
.brand-scope {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.4;
  color: var(--brand-900);
  letter-spacing: -0.01em;
}

/* Slate Note, the lightest grey for text a reader needs (4.8:1). */
.brand-scope {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-subtle);
}

.app-header form {
  margin: 0;
  flex-shrink: 0;
}

.app-menu {
  flex-shrink: 0;
}

/* «Menú»: 44px tall, a finger's reach, like the panel's rows; in the 64px
   band it is the control a phone taps first and most. The chevron is the
   heat map's «Filtros» one, drawn, and turns when open. */
.app-menu-toggle {
  gap: 6px;
  min-height: 44px;
}

/* The chevron both popovers' buttons draw. */
.app-chevron {
  flex-shrink: 0;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  .app-chevron {
    transition: none;
  }
}

/* Open, a button says so by more than its hover shade, which on white is
   about 1.02:1 and read as no change at all: the deep-leaf ink, the leaf
   tint, a border in Verde Hoja Ink (5.48:1 on white, past the 3:1 a
   control's state needs) and the chevron turned up. With Escape now
   closing the menu, this is still the button a finger closes it with. */
.app-menu:has(.app-menu-panel:popover-open) .app-menu-toggle,
.app-account:has(.app-account-panel:popover-open) .app-account-toggle {
  color: var(--brand-900);
  background: var(--brand-50);
  border-color: var(--brand-700);
}

.app-menu:has(.app-menu-panel:popover-open) .app-menu-toggle .app-chevron,
.app-account:has(.app-account-panel:popover-open) .app-account-toggle .app-chevron {
  transform: rotate(180deg);
}

/* A tap outside an open panel closes it and reaches nothing else (the
   header comment says why). The layer is the button's own, so a tap on it
   is a tap on the button, which closes its popover. `position: fixed` with
   `inset: 0` covers the window, since no ancestor has a transform or filter
   that would trap it in the band; it is under the panel because the panel
   is in the top layer, and over the page because the band's 50 outbids
   the page. The page still scrolls under it, by wheel or by finger, since
   scrolling passes through a layer that cannot scroll itself. */
.app-menu:has(.app-menu-panel:popover-open) .app-menu-toggle::before,
.app-account:has(.app-account-panel:popover-open) .app-account-toggle::before {
  content: "";
  position: fixed;
  inset: 0;
  cursor: default;
}

/* The phone's panel: a popover in the top layer, placed under the 64px band
   rather than where the browser centres a popover, as wide as the band,
   scrolling down within the viewport when every profile's links do not fit
   the screen's height (from 721px it narrows to 360px, below). Each label
   wraps rather than being cut. `color` and the box properties undo the
   browser's popover defaults (a centred, bordered box in system colours).
   Closed, it is hidden by the query after the desktop row's, not here, so
   the row can show it. */
.app-menu-panel {
  position: fixed;
  inset: 64px 0 auto;
  width: auto;
  height: auto;
  max-height: calc(100vh - 64px);
  /* A phone's browser bar shrinks the viewport `vh` ignores; `dvh` follows
     it where known, and the line above stands where it is not. */
  max-height: calc(100dvh - 64px);
  margin: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  color: inherit;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--brand-100);
  box-shadow: 0 12px 16px -8px rgba(0, 0, 0, 0.12);
}

/* A cue that the panel holds more than it shows: on a 320x568 phone a
   carrier's panel is 581px against 503px, and «Cerrar sesión», the last
   row, was below the fold with nothing to say so. The cue is a shadow cast
   upward from the panel's foot -- a zero-height box held there by
   `position: sticky`, its shadow's lower half clipped by the panel -- so it
   reads as rows passing under an edge. It fades out as the panel scrolls
   to its end, by a scroll-driven animation: where the panel does not
   scroll, its scroll timeline is inactive, the animation applies nothing,
   and the resting `opacity: 0` keeps the cue away. A browser without
   scroll-driven animations shows no cue. Rejected: a gradient fading the
   last row, which this design system keeps to the login and the page
   head; and keeping the account's buttons pinned at the panel's foot,
   which `sticky` cannot do from inside the account's block. */
.app-menu-panel::after {
  content: "";
  position: sticky;
  bottom: -16px;
  flex: none;
  height: 0;
  margin-top: -16px;
  box-shadow: 0 0 16px 10px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .app-menu-panel::after {
    animation: app-panel-more linear both;
    animation-timeline: scroll(nearest);
  }
}

@keyframes app-panel-more {
  from {
    opacity: 1;
  }

  92% {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* A group's links in two columns under its name (the header comment says
   why two), filled down the first column before the second, so a group
   reads top to bottom as the desktop row reads left to right. A grid of
   rows read across, which it was at first, paired links that are no pair
   («Ofertas | Mapa») and left the odd one alone under its row. */
.app-nav-links,
.app-branch-nav {
  column-count: 2;
  column-gap: 16px;
}

/* The group's name: the label style, uppercase 11px in Slate Note, so it
   reads as the name of what follows and not as one more link. */
.app-nav-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

/* 44px rows (46px), a finger's reach, for the links a phone taps. Blocks,
   whole in one column. */
.app-nav a,
.app-branch-nav a {
  display: block;
  break-inside: avoid;
  padding: 11px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-700);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.app-nav a:hover,
.app-branch-nav a:hover {
  color: var(--brand-900);
}

/* The frame's ring on the navigation, the most used links of the product,
   in place of the browser's default (Chrome: 1px, blue), which these links
   showed until November 2026 as a recorded gap. The brand and the links in
   running text still show the default. */
.app-nav a:focus-visible,
.app-branch-nav a:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
  border-radius: 2px;
}

/* The account closes the phone's panel, in its two parts (base.html): the
   branch -- its scope, its own pages and the way out of it -- then the
   person and their buttons, two to a row. The toggle is the desktop row's;
   here the account's popover is simply shown in the panel's flow, never
   opened, so its popover box is undone. */
.app-account {
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}

.app-account-toggle {
  display: none;
}

.app-account-panel {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
}

.app-account-branch {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-account-leave {
  margin-top: 8px;
}

.app-account-panel .session-scope {
  text-align: left;
}

/* The person, then «Seguridad» and «Cerrar sesión» side by side, the
   person's part ruled off from the branch's. */
.app-account-person {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}

/* Who is signed in, as the home page says it: the name in Ink, the e-mail
   address under it in the mono every record-like value takes. */
.app-account-who {
  grid-column: 1 / -1;
  display: grid;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-strong);
}

.app-account-email {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-subtle);
  overflow-wrap: anywhere;
}

/* «Cerrar sesión» weighs less than «Seguridad»: no border, Slate Note
   ink. On a phone it sits under the resting thumb, the panel's last row,
   and one tap signs out with no confirmation; a lighter button there is
   less often pressed by a thumb that meant the one beside it. A
   confirmation was rejected: signing out is undone by signing in, and
   every sign-out would pay for the rare slip. It keeps the 44px target. */
.app-account-logout .btn {
  color: var(--text-subtle);
  border-color: transparent;
}

.app-account-panel .session-scope strong,
.app-account-panel .session-scope span {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 44px rows for the buttons too: `.btn-quiet` alone is 37px. */
.app-account-panel .btn {
  width: 100%;
  min-height: 44px;
}

/* From 721px the open panel is a 360px dropdown hanging from the band's
   right edge, under «Menú», instead of a column across the whole window
   (the header comment gives the measurements and the rejected
   alternative). Its height cap, its own scrolling and its top layer are
   the phone's, above. The left border and the softer, wider shadow mark
   the panel's left edge, which on a phone was the window's. */
@media (min-width: 721px) {
  .app-menu-panel {
    left: auto;
    width: 360px;
    border-left: 1px solid var(--brand-100);
    border-bottom-left-radius: 8px;
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.16);
  }
}

/* Up to the cut a closed panel is hidden. The browser's own rule for a
   closed popover would do it, but every author rule outranks the
   browser's, so the panel's `display: flex` above would show it; this
   puts the browser's rule back where the menu is a button. */
@media (max-width: 1024px) {
  .app-menu-panel:not(:popover-open) {
    display: none;
  }
}

/* The desktop row: the brand, then the navigation's groups in one
   run, then the account's button at the right end. «Menú» is hidden and
   its panel shown, closed, as an ordinary box in the band's flow. The
   group names are kept for a screen reader only; a 1px rule between
   groups is what groups them for the eye.

   Every rule of the row is keyed to a band without `data-menu`, which
   static/js/frame.js sets where the row would not fit on one line; such a
   band keeps the tablet's «Menú» and its 360px dropdown from 1025px too
   (the header comment says why and what it rejected). Each key is wrapped
   in `:where()`, so it adds no specificity and every rule outranks, and is
   outranked by, exactly what it did before the key. Without the script no
   band has the attribute, and the row wraps as it did. */
@media (min-width: 1025px) {
  /* A band the script folded into «Menú»: its closed panel is hidden, as
     up to 1024px (above). Inside this query because only here does the
     row's rule show it. */
  :where(.app-header[data-menu]) .app-menu-panel:not(:popover-open) {
    display: none;
  }

  /* The tallest row measured plus the same 16px of air. With the script
     the row is shown only on one line, 64px, and every other band is the
     64px «Menú» band, which keeps the 80px above; 96px is the tallest
     band without it -- three lines, for a branch holding every profile
     with a 63-character name at 1025 to 1100px (the header comment gives
     the figures) -- kept for a browser that does not run the script. So
     on the row a jumped-to target lands 32px lower than it needs to.
     **Known gap, left open on purpose:** without the script, a band
     taller than 96px -- a window near 1025px with a larger default font
     -- may cover the top of a jumped-to target. */
  html:has(.app-header:where(:not([data-menu]))) {
    scroll-padding-top: 112px;
  }

  /* The band grows past 64px only when the navigation wraps, which with
     the script it never does: 8px above and below plus the hairline leave
     47px, so a single line is centred exactly where the fixed 64px band
     centred it. */
  .app-header:where(:not([data-menu])) {
    gap: 24px;
    height: auto;
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* Never narrower than the logo and the wordmark, so no link paints over
     them, and no wider: the row takes the rest. */
  :where(.app-header:not([data-menu])) .brand {
    flex: 0 0 auto;
  }

  /* The account's button names the branch on this row. */
  :where(.app-header:not([data-menu])) .brand-scope {
    display: none;
  }

  :where(.app-header:not([data-menu])) .app-menu {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Two classes, so the rule outranks `.btn`'s `display`, which comes
     later in this file. */
  :where(.app-header:not([data-menu])) .app-menu > .app-menu-toggle {
    display: none;
  }

  :where(.app-header:not([data-menu])) .app-menu-panel {
    position: static;
    inset: auto;
    width: auto;
    max-height: none;
    overflow: visible;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  /* No scroll cue on the row: the panel no longer scrolls, so the cue's
     nearest scroller would be the page itself, and it would sit as a grey
     smudge at the row's end while the page can scroll. */
  :where(.app-header:not([data-menu])) .app-menu-panel::after {
    display: none;
  }

  /* `min-width: 0` lets the run shrink to what the brand and the account
     leave and wrap inside it, rather than push the account off the band. */
  /* Every group draws its rule before it (below), and a rule that starts a
     line -- the first group's, or one the wrap carried to a new line --
     must not show, or the line reads as indented. So the run is moved 17px
     left, the rule and its gap, and the clip hides the run's leftmost 13px:
     a rule at a line's start, never a link, nor the link's focus ring,
     which reaches 4px beyond the link. */
  :where(.app-header:not([data-menu])) .app-nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-left: -17px;
    clip-path: inset(-8px -8px -8px 13px);
  }

  :where(.app-header:not([data-menu])) .app-nav-group {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  /* A 1px rule between groups, in the fields' hairline grey: a wider gap
     alone, 28px against the links' 16px, read as uneven spacing once the
     row wrapped. Drawn before every group, the first too; the run's clip
     hides the one that starts each line. A border, not a background: in
     forced colours (Windows' high contrast) backgrounds are dropped and the
     rules vanished, while a border is redrawn in the system's text colour.
     Each group moves to the next line whole, since a group's width is its
     links' on one line, and wraps inside only when it alone is wider than
     the run. */
  :where(.app-header:not([data-menu])) .app-nav-group::before {
    content: "";
    flex: none;
    width: 0;
    height: 16px;
    border-left: 1px solid var(--border-strong);
  }

  :where(.app-header:not([data-menu])) .app-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    column-count: auto;
  }

  /* `.visually-hidden`'s pattern: read, not drawn. */
  :where(.app-header:not([data-menu])) .app-nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  :where(.app-header:not([data-menu])) .app-nav a {
    padding: 0;
    font-size: 14px;
    white-space: nowrap;
  }

  /* In the account's dropdown the branch's pages keep the phone's 46px
     rows, a pointer's easy target too, in 14px. */
  :where(.app-header:not([data-menu])) .app-branch-nav a {
    font-size: 14px;
  }

  :where(.app-header:not([data-menu])) .app-account {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
  }

  /* The scope as a quiet button: the branch over its role alone (base.html
     says why the role alone), with the chevron that says it opens. Both
     lines are cut with an ellipsis past 300px, which keeps the longest role
     whole («Administrador maestro en esta sucursal») and cuts only a long
     branch name; the panel it opens says both in full. `anchor-name` is
     what the panel hangs from. */
  :where(.app-header:not([data-menu])) .app-account-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 4px 10px;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    text-align: right;
    color: var(--text-subtle);
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    anchor-name: --app-account;
  }

  :where(.app-header:not([data-menu])) .app-account-toggle:hover {
    background: var(--surface-hover);
  }

  :where(.app-header:not([data-menu])) .app-account-toggle:focus-visible {
    outline: 2px solid var(--brand-700);
    outline-offset: 2px;
  }

  /* The branch over the role, as one label beside the chevron. */
  :where(.app-header:not([data-menu])) .app-account-label {
    display: grid;
    min-width: 0;
  }

  :where(.app-header:not([data-menu])) .app-account-name,
  :where(.app-header:not([data-menu])) .app-account-role {
    display: block;
    max-width: 300px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  :where(.app-header:not([data-menu])) .app-account-name {
    font-weight: 600;
    color: var(--text-strong);
  }

  /* The account's panel: a dropdown in the top layer, hanging from the
     band's foot (as «Menú»'s panel does) at its button's right edge, and at
     least as wide as the button, so the role it repeats keeps the one line
     it had there; 340px fits the longest role line (292px) with the
     panel's padding. It used to hang 8px below the button, which put it 2
     to 4px over the foot of a band taller than 64px, and at 280px it broke
     the role in two. Where anchors are not supported the `top`, `right` and
     `width` before the `anchor()` ones stand: under a one-line band's right
     end, 340px wide; on a band that wrapped it then overlaps the band's
     foot, still whole and in reach. */
  :where(.app-header:not([data-menu])) .app-account-panel {
    position: fixed;
    position-anchor: --app-account;
    inset: auto;
    top: 64px;
    top: anchor(--app-band bottom);
    right: 16px;
    right: anchor(right);
    width: 340px;
    width: max(340px, anchor-size(width));
    margin: 0;
    padding: 16px;
    background: var(--surface);
    /* Flush with the band's hairline, as «Menú»'s panel is: no top border,
       corners rounded below only. */
    border: 1px solid var(--brand-100);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.16);
  }

  :where(.app-header:not([data-menu])) .app-account-panel:not(:popover-open) {
    display: none;
  }
}

/* Full screen lays the heat map over the whole window, the band included
   (`.heat-stage.is-full-screen`), but a popover in the top layer is above
   any z-index, so a panel left open -- opened, then the Tab key carried to
   the map's full-screen toggle -- would float over the map. Hidden while
   full screen lasts; the band under it is inert anyway. */
body:has(.heat-stage.is-full-screen) .app-menu-panel,
body:has(.heat-stage.is-full-screen) .app-account-panel {
  display: none;
}

/* A browser without popovers: `popover` and `popovertarget` mean nothing to
   it, and every rule naming `:popover-open` is dropped, so the panels would
   sit fixed under the band with no button to open or close them. Instead
   both buttons go, and the band holds every control in its flow, under the
   brand, and scrolls away with the page rather than sticking at a phone's
   whole height. The header comment says what that costs. */
@supports not selector(:popover-open) {
  .app-header {
    position: relative;
    flex-wrap: wrap;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .app-menu {
    flex-basis: 100%;
  }

  .app-menu > .app-menu-toggle,
  .app-account-toggle {
    display: none;
  }

  .app-menu-panel,
  .app-account-panel {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  /* The panel does not scroll here either (see the desktop row's rule). */
  .app-menu-panel::after {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   The carrier's bar. For a carrier's branch, up to 720px, «Transportes» and
   «Menú» sit side by side in a bar fixed at the window's foot, under the
   thumb, and the menu opens from it upward (templates/base.html says why a
   carrier, why this and what else was weighed). Elsewhere `.app-shortcut`
   is hidden and the frame is the one above. The bar is `.app-menu` itself,
   laid out of the band: «Menú» is the same button at every width, never a
   second one, so frame.js, the open look and the outside-tap layer all
   keep working on it as they are.

   Measured on 2026-11-07 in Chrome and WebKit for the demo carrier's
   branch, from 320 to 720px: the bar is 57px, two 44px targets; the band
   keeps the brand alone at 64px, and gives the branch's name under the
   wordmark the 81px «Menú» took beside it; nothing scrolls sideways.

   The open panel is a sheet standing on the bar, reaching up to the band's
   foot at most, so the branch's name stays on screen above it. Where it is
   taller than that room it scrolls, and it opens scrolled to its foot
   (frame.js does it, and says why not `column-reverse`): «Seguridad» and
   «Cerrar sesión», its last row, are on screen as it opens, just above the
   bar the thumb opened it from, and it is the navigation's top that is out
   of sight, under a shade that says so. Measured: the panel is 623px; at
   320x568 the room is 447px and 177px of the navigation are above, at
   375x667 78px, and from 390x844 it fits whole and shows no shade.
   Rejected: opening it at its top, as the band's panel does, which at
   320x568 left «Cerrar sesión» ending 103px below the window, with only a
   shadow to say it was there -- the complaint that asked for this bar.

   A tap on «Transportes» while the menu is open closes the menu and goes
   nowhere, like any other tap outside the panel: «Menú»'s outside-tap
   layer covers the bar too. A second tap follows the link (measured in
   Chrome and WebKit with touch emulation). Rejected: lifting the shortcut
   over the layer, which would make the bar's two halves answer an open
   menu differently from everything else on the page.

   Costs, known and accepted: the bar takes 57px of every carrier page's
   height on a phone, and the page reserves that much at its foot
   (`.app-main`) and in `scroll-padding-bottom`, so its last rows and a
   control the Tab key reaches are not left under the bar (WCAG 2.4.11;
   measured in Chrome, Tab through «Transportes»: no focused control under
   the bar). The panel's sheet runs the same open look, Escape and the
   focus rules as the band's panel, since it is the same popover.
   **Known gap, left open on purpose:** an iPhone's home indicator. The
   bar's foot adds `env(safe-area-inset-bottom)`, which is 0 unless the page
   opts into `viewport-fit=cover`, and this page does not. Whether Safari
   on an iPhone keeps the bar clear of the indicator and of its own toolbar
   was not verified on a real device, only in WebKit's emulation.

   A browser without popovers gets none of this (the `@supports` around
   it): there the shortcut stays hidden and the band holds every control,
   «Transportes» among them, as above.
   ------------------------------------------------------------------------- */

.app-shortcut {
  display: none;
}

@supports selector(:popover-open) {
  @media (max-width: 720px) {
    /* Room for the bar at the page's foot whenever the browser scrolls
       something into view, as the band's `scroll-padding-top` does at its
       top: the bar's 57px plus the same 16px of air. */
    html:has(.app-shortcut) {
      scroll-padding-bottom: calc(73px + env(safe-area-inset-bottom, 0px));
    }

    /* The page's own padding plus the bar, so its last row is not behind
       it at the foot of the page. */
    body:has(.app-shortcut) .app-main {
      padding-bottom: calc(24px + 57px + env(safe-area-inset-bottom, 0px));
    }

    /* The bar: 6px, a 44px row and 6px, over a 1px hairline, in the band's
       surface, hairline and shadow, cast upward. Two equal halves. Fixed to
       the window, not to the band it sits in: no ancestor has a transform
       that would trap it, and the band's z-index keeps it over the page and
       under full screen, as it keeps the band. */
    .app-menu:has(.app-shortcut) {
      position: fixed;
      inset: auto 0 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px));
      background: var(--surface);
      border-top: 1px solid var(--brand-100);
      box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
    }

    /* «Transportes» drawn as «Menú» is, a quiet bordered button at 44px,
       so the two halves read as one bar; in the navigation's green, since
       it is a link to a page. */
    .app-menu:has(.app-shortcut) > .app-shortcut {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 44px;
      padding: 0 12px;
      font-size: 15px;
      font-weight: 600;
      color: var(--brand-700);
      text-decoration: none;
      border: 1px solid var(--border-strong);
      border-radius: 8px;
    }

    .app-menu:has(.app-shortcut) > .app-shortcut:hover {
      color: var(--brand-900);
      background: var(--surface-hover);
    }

    .app-menu:has(.app-shortcut) > .app-shortcut:focus-visible {
      outline: 2px solid var(--brand-700);
      outline-offset: 2px;
    }

    .app-menu:has(.app-shortcut) > .app-menu-toggle {
      font-size: 15px;
    }

    /* The chevron points where the panel goes: up from the bar, down once
       it is open. */
    .app-menu:has(.app-shortcut) > .app-menu-toggle .app-chevron {
      transform: rotate(180deg);
    }

    .app-menu:has(.app-shortcut):has(.app-menu-panel:popover-open) > .app-menu-toggle .app-chevron {
      transform: none;
    }

    /* The sheet: from the bar's top up to the band's foot at most. The
       hairline and the shadow move to its top edge, which is the one over
       the page. It opens scrolled to its foot, which frame.js does (the
       section's comment says why); without the script it opens at its top,
       as the band's panel does, with the same cue at its foot.

       Its cue that more is above is a shade at its top edge, drawn by the
       background: a 12px shade fixed to the panel's box (`scroll`), under a
       24px cover in the panel's own surface that moves with its rows
       (`local`) and starts at their top. Scrolled to its top, the cover
       hides the shade; any lower, the cover has gone up with the rows and
       the shade shows; a panel that fits never moves its cover. The cover
       is the surface fading to nothing over the surface, so it is never
       seen as a gradient; it is not the fade over the last row the band's
       panel rejected. It is not the foot's scroll-driven fade turned
       around because a background works in every engine that has
       popovers, and the fade only where scroll-driven animations do: an
       iPhone before Safari 26 would show no cue at all. */
    .app-menu:has(.app-shortcut) > .app-menu-panel {
      inset: auto 0 calc(57px + env(safe-area-inset-bottom, 0px));
      max-height: calc(100vh - 64px - 57px - env(safe-area-inset-bottom, 0px));
      max-height: calc(100dvh - 64px - 57px - env(safe-area-inset-bottom, 0px));
      background:
        linear-gradient(var(--surface) 50%, transparent) top / 100% 24px no-repeat local,
        linear-gradient(rgba(0, 0, 0, 0.12), transparent) top / 100% 12px no-repeat scroll,
        var(--surface);
      border-top: 1px solid var(--brand-100);
      border-bottom: 0;
      box-shadow: 0 -12px 16px -8px rgba(0, 0, 0, 0.12);
    }
  }
}

.app-main {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ---------------------------------------------------------------------------
   Card and buttons.
   ------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12);
  padding: 32px 40px;
}

/* One size for every filled button: 14px bold. It used to be 16px semibold
   here and 14px bold on `.btn-inline`, which nearly every primary wore, so
   the few that did not (the home page's two «Entrar», «Buscar» on
   «Catastro», «Aplicar» on «Mapa») stood out larger than any other
   button on the platform. The size moved here rather than onto those four
   buttons, so a new button cannot miss it; the sign-in and second-factor
   buttons follow it too. `.btn-quiet` keeps its own, smaller size; the
   carrier's scan button keeps its own, larger one (`.scan-button`, a single
   action at arm's length). No underline: a button that is a link is still
   a button, and the base rule for `a` would otherwise underline it. */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms;
}

/* A button is as wide as its label; `.btn-block` stretches it across its
   container. V4's login made the primary button full width, and the port
   made that the primary's default, so nearly every other primary on the
   platform had to undo it with `.btn-inline`. Of those that did not,
   «Aplicar» on «Mapa» and «Buscar» on «Catastro» took a whole line of
   their wrapping filter row and pushed «Quitar filtros» onto the next
   (measured in headless Chrome at 1280px); the home page's two «Entrar»,
   in the master's branch table and in the list of other branches, now
   take their label's width too, rather than their table cell's or form's.
   Full width is now asked for where the design wants it: the sign-in and
   second-factor forms and the carrier's scan button, each a single action
   at a phone's width. */
.btn-block {
  width: 100%;
}

/* `--brand-700` since November 2026. On `--brand-600` the 14px bold white
   label measured 3.77:1, under the 4.5:1 WCAG asks of text that size --
   a gap DESIGN.md had recorded as left open because moving it changes
   every screen. It is closed here on every screen at once, one shade down
   the same emerald ladder, at 5.48:1; the hover moves down one more. The
   focus ring is the same green, 2px clear of the button, so the white gap
   between them is what shows it. */
.btn-primary {
  color: #ffffff;
  background: var(--brand-700);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: var(--brand-800);
}

/* The header's buttons: the sidebar's secondary action style, small enough
   that the phone's «Menú» shares a 64px band with the wordmark. Its weight
   is its own because `.btn`'s bold is a filled button's: three quiet
   buttons that also wore `.btn-inline` used to come out 14px bold beside
   some forty at 13px. Until November 2026 its `text-decoration` sat in a
   second `.btn-quiet` block a thousand lines further down; `.btn` now
   carries it. */
.btn-quiet {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
}

.btn-quiet:hover {
  background: var(--surface-hover);
}

/* The one action that cannot be taken back -- withdrawing a published need,
   cancelling an accepted offer -- on the confirmation page that asks for it.
   Before October 2026 it was `.btn-primary`, the same green as «Guardar», so
   the button that destroys read exactly like the one that saves. Kept to
   irreversible actions on a confirmation page: a refusal or a rejection that
   can still be corrected keeps the primary green, or red would stop meaning
   "this is final". */
.btn-danger {
  color: #ffffff;
  background: var(--danger-700);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-danger:hover {
  background: var(--danger-800);
}

/* Doubled class: `.btn:focus-visible`, further down, has the same
   specificity and would otherwise win with the green ring. */
.btn.btn-danger:focus-visible {
  outline-color: var(--danger-700);
}

/* Every keyboard focus ring in the frame is a 2px `outline` in
   `--brand-700` (5.48:1 on white), 2px clear of the control. It used to be a
   2px `box-shadow` in `--brand-500`, 2.54:1 on white and 1.49:1 against a
   primary button's own green, so a focused primary read as a slightly
   thicker green button. An outline also survives Windows' high-contrast mode
   (`forced-colors`), which drops every `box-shadow`: under the old rings no
   button, login field or document field showed its focus there.
   config/tests/test_frame.py pins that no rule takes an outline away
   without one of these in its place. */
.btn:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Login screen: src/app/login/page.tsx without the demo-user panel, the Google
   button and the /register and /demo links, none of which has a flow behind
   it in this repository.
   ------------------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
  background: linear-gradient(to bottom right, #f0fdf4, #ffffff, #eff6ff);
}

.auth-head {
  width: 100%;
  max-width: 448px;
  text-align: center;
}

.auth-head img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
}

.auth-head .wordmark {
  display: block;
  margin-top: 8px;
  font-weight: 700;
  font-size: 28px;
  color: var(--brand-900);
  letter-spacing: -0.02em;
}

.auth-head h1 {
  margin: 16px 0 0;
  font-size: 30px;
  font-weight: 700;
  color: var(--text-strong);
}

.auth-head p {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.auth-body {
  width: 100%;
  max-width: 448px;
  margin-top: 32px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.field-control {
  position: relative;
}

/* The icon draws in `currentColor` (login.html), so its grey is the
   placeholder's token here rather than a `stroke` literal in the markup. */
.field-control svg {
  position: absolute;
  color: var(--placeholder);
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-control input {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  background: var(--surface-muted);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* The 40px on the left is the room the icon takes: 12px in, 20px wide and
   8px of air. Only an input after an icon reserves it. Until November 2026
   every `.field-control` input did, and the second factor's code fields and
   the enrollment's password, which have no icon, began their text 40px in
   from an empty gap. */
.field-control svg + input {
  padding-left: 40px;
}

.field-control input:focus {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
  background: var(--surface);
}

.alert-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--error-text);
  background: var(--error-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.alert-error svg {
  flex-shrink: 0;
}

/* A filter panel's refusals, on the heat map and on «Catastro»: one line per
   refused field and then «Ese filtro no se aplicó.», stacked. In the alert's
   row they stood side by side, the closing line a second column beside the
   field's message. */
.alert-error.filter-panel-note {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.alert-error.filter-panel-note p {
  margin: 0;
}

/* V4's cards keep 40px of side padding; on a phone that leaves the form too
   narrow, so it tightens below the width of a small tablet. */
@media (max-width: 480px) {
  .card {
    padding: 24px 20px;
  }

  .auth-page {
    padding-top: 32px;
  }

  .auth-head h1 {
    font-size: 26px;
  }
}

/* ---------------------------------------------------------------------------
   Public landing page (templates/landing.html): the «1b» option of the
   November 2026 redesign, its inline values as classes. Deep green above
   and below (the hero, the strip, the closing section and the footer),
   white between them.

   **Every grid track is `minmax(0, 1fr)` or a `minmax(min(100%, …), 1fr)`,
   never a bare `1fr`.** A bare `1fr` is `minmax(auto, 1fr)`: the track may
   not shrink below its content's min-content width. The V4 layout's first
   cut used it, and on a phone its one-column panel grew to the width of the
   figures inside it, so the page was 393px wide at a 320, 360 and 390px
   viewport and scrolled sideways. The `min(100%, …)` minimums are the
   design's own `auto-fit` columns, which fall to one column on a phone
   without a media query; the phone rules at the end then shrink what
   cannot wrap.

   The colours are `:root`'s tokens, the landing's own among them
   (`--brand-950`, `--brand-300`, `--rim-b`, the translucent greens), so no
   rule here writes a literal (config/tests/test_frame.py).
   ------------------------------------------------------------------------- */

.landing {
  min-height: 100vh;
  color: var(--text-strong);
  background: var(--surface);
}

.landing-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4.5vw, 56px);
}

.landing-mono {
  font-family: var(--font-mono);
}

/* The header sits on the hero's green and scrolls away with it: the design
   draws no sticky bar, and with three section links and no button there is
   nothing a reader needs to keep on screen. */
.landing-header {
  padding-top: 24px;
  color: var(--brand-50);
  background: var(--brand-900);
}

.landing-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
}

.landing-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.landing-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 14px;
  font-weight: 600;
}

/* Underlined only on hover: these are a menu of sections, set apart as a
   row inside a `<nav>`, not links inside a sentence (WCAG 1.4.1 asks for
   more than colour only there). */
.landing-nav a,
.landing-footer-nav a {
  text-decoration: none;
}

.landing-nav a {
  color: var(--brand-200);
}

.landing-nav a:hover,
.landing-footer-nav a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* «Ir al inicio», the one link out of the page, drawn apart from the
   section links as the design's light pill would be. */
.landing-nav .landing-nav-home {
  color: var(--brand-950);
  padding: 0 10px;
  background: var(--brand-300);
  border-radius: 9999px;
}

/* On the landing's greens, the light green ring, not the app's dark one:
   `--brand-700` on `--brand-900` measures under 2:1, `--brand-300` over
   7:1. Every control of the closing section sits on that green, the email
   field and the button included: their rings are drawn outside them, on
   the section's ground. The error summary and the thank-you take the focus
   as they load, so they ring on `:focus` (`.error-summary` says why). */
.landing-nav a:focus-visible,
.landing-footer-nav a:focus-visible,
.landing-cta:focus-visible,
.landing-pill:has(input:focus-visible),
.landing-consent input:focus-visible,
.landing-email input:focus-visible,
.landing-submit:focus-visible,
.landing-form .error-summary:focus {
  outline: 2px solid var(--brand-300);
  outline-offset: 2px;
}

/* Focused only to be read, never to be acted on: `main` by the skip link,
   as `.app-main` is, and the thank-you as it loads (templates/landing.html
   says why). A ring round either reads as a field, or as the whole page,
   and tells a sighted reader nothing the scroll did not. */
.landing-main:focus,
.landing-sent:focus {
  outline: none;
}

.landing-hero {
  overflow: hidden;
  color: var(--brand-100);
  background: var(--brand-900);
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 48px;
  align-items: end;
  padding-top: 72px;
}

.landing-hero-copy {
  padding-bottom: 80px;
}

/* Side by side, the copy takes the wider share: in two equal halves
   «Trazabilidad de» did not fit one line at 88px, and «de» stood alone
   whatever the wrap balanced. The phone needs only its 300px. */
@media (min-width: 1024px) {
  .landing-hero-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(min(100%, 300px), 0.6fr);
  }
}

/* Balanced, here and in every landing heading: the copy is fixed, so a word
   stranded on a line of its own («de» at 1280px, «A y B» under the
   categories' title) is fixed by the wrap, never by rewording. Paragraphs
   take `pretty`, which keeps a last line from holding one word. */
.landing h1,
.landing h2,
.landing h3 {
  text-wrap: balance;
}

.landing p,
.landing li,
.landing dd {
  text-wrap: pretty;
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.landing-hero h1 span {
  color: var(--brand-300);
}

.landing-lead {
  max-width: 520px;
  margin: 28px 0 0;
  font-size: 20px;
  color: var(--brand-100);
}

/* The way down to the lead form (templates/landing.html says why its words
   are the button's). A link, underlined and in the light green, not a
   second filled button: the page keeps one button, the form's, and this
   points at it. The arrow is drawn at the label's size and moves with it on
   hover, the one motion on the page. */
.landing-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  font-size: 21px;
  font-weight: 700;
  color: var(--brand-300);
  text-underline-offset: 5px;
}

.landing-cta svg {
  flex-shrink: 0;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-cta:hover {
  color: #ffffff;
}

.landing-cta:hover svg {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .landing-cta svg {
    transition: none;
  }
}

/* On the panel's pale green the link takes the panel's own deep ink. */
.landing-cta-panel {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 8px;
  color: var(--brand-800);
}

.landing-cta-panel:hover {
  color: var(--brand-900);
}

.landing-cta-panel:focus-visible {
  outline-color: var(--brand-700);
}

/* The phone (aria-hidden; the template says what it pictures). */
.landing-phone {
  justify-self: center;
  width: 300px;
  max-width: 100%;
  height: 400px;
  padding: 12px 12px 0;
  background: var(--brand-950);
  border-radius: 40px 40px 0 0;
  box-shadow: 0 -10px 60px var(--landing-glow);
}

.landing-phone-screen {
  height: 100%;
  padding: 40px 16px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-strong);
  background: var(--surface-muted);
  border-radius: 30px 30px 0 0;
}

.landing-phone-card {
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.landing-phone-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-900);
}

.landing-phone-head .status {
  padding: 2px 8px;
  font-size: 11px;
}

.landing-phone-folio {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--doc-red);
}

.landing-phone-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.landing-phone-fields > div > span:first-child {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.landing-phone-done {
  margin-top: 12px;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--scan-done-text);
  background: var(--scan-done-bg);
  border-radius: 12px;
}

.landing-phone-done .landing-mono {
  display: block;
  font-weight: 400;
}

/* The scan action, drawn as a tint: on the real screen it is a filled
   Deep Leaf button, but here it is a picture, and filled it read as the
   first screen's call to action while doing nothing. */
.landing-phone-action {
  margin-top: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
}

/* In the body's sans, each figure a label over its value: set in 13px mono
   the strip read as terminal output and dressed labels up as figures. The
   chain's «G → T → G» keeps the mono, as the one code-like mark on it. */
.landing-strip {
  padding: 28px 0;
  font-size: 14px;
  color: var(--brand-200);
  background: var(--brand-950);
}

.landing-strip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.landing-chain {
  margin: 0;
  align-self: center;
}

.landing-chain strong {
  font-family: var(--font-mono);
}

.landing-chain strong,
.landing-figures dt {
  color: #ffffff;
}

.landing-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 0;
}

.landing-figures div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.landing-figures dt {
  font-size: 16px;
  font-weight: 700;
}

.landing-figures dd {
  margin: 0;
}

.landing-section {
  padding: 96px 0;
}

.landing-section-tight {
  padding-top: 0;
}

.landing-section h2 {
  margin: 0;
  max-width: 760px;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.landing-section-lead {
  max-width: 720px;
  margin: 16px 0 0;
  font-size: 18px;
  color: var(--text-muted);
}

/* One column, then the title beside the rows from 1024px. Explicit tracks
   rather than the design's `auto-fit`: between 1024 and about 1140px those
   fitted two tracks, the rows (which spanned two) fell under the title,
   and the title's row held an empty column beside it. */
.landing-features {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px 56px;
}

@media (min-width: 1024px) {
  .landing-features {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  }
}

/* Sticky beside the rows while they scroll, so the section's title holds
   the column that otherwise stood empty for some 1300px. Only where the
   head and the rows sit side by side, from 1024px: stacked, a sticky head
   would ride over the rows under it. */
.landing-features-head {
  max-width: 340px;
}

@media (min-width: 1024px) {
  .landing-features-head {
    position: sticky;
    top: 32px;
    align-self: start;
  }
}

.landing-features-head p {
  margin: 16px 0 0;
  color: var(--text-muted);
}

.landing-rows {
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--border);
}

.landing-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

/* `--brand-700`, 5.48:1 on white: `--brand-600` measured 3.76:1, which
   passes as large text at 28px but not at the phone's 20px. */
.landing-row-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--brand-700);
}

.landing-row h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

/* 56ch, about 70 characters of Geist a line: `ch` is the width of a «0»,
   and the first cut's 68ch still let some 86 through at 1440px. A row's
   capability is in the body's own ink; its limit, under it, is quieter and
   hangs from the panel's dashed rule (templates/landing.html says how the
   rows were split). */
.landing-row p {
  max-width: 56ch;
  margin: 0;
  color: var(--text);
}

.landing-row .landing-row-limit {
  margin-top: 8px;
  padding-left: 12px;
  font-size: 15px;
  color: var(--text-muted);
  border-left: 1px dashed var(--border-strong);
}

/* The semáforo row's legend (_status_legend.html): its meanings are a
   <dd>, not a <p>, so they take the row's muted text here rather than the
   body's ink, and read as the rest of the row does. */
/* The legend's disclosure (templates/landing.html says why it starts
   closed): the row's lead-in sentence is the summary, in the row's text
   with the ink's own marker, underlined as the control it is. */
.landing-legend {
  margin: 0;
}

/* Drawn as the control it is: a bordered chip, «Ver los seis estados»,
   with a drawn chevron in place of the browser's 8px triangle, turned when
   open. 40px tall, a comfortable target. */
.landing-legend summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin-top: 12px;
  padding: 6px 14px 6px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-800);
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
}

.landing-legend summary::-webkit-details-marker {
  display: none;
}

.landing-legend summary svg {
  flex-shrink: 0;
  color: var(--brand-700);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-legend[open] summary svg {
  transform: rotate(90deg);
}

.landing-legend summary:hover {
  color: var(--brand-900);
  background: var(--surface-hover);
  border-color: var(--brand-200);
}

@media (prefers-reduced-motion: reduce) {
  .landing-legend summary svg {
    transition: none;
  }
}

.landing-legend summary:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* Each state as its badge over its meaning, every row alike: side by side,
   a short meaning («Completo», «Retirada») fitted beside the badge and a
   long one wrapped under it, and the six read in two shapes. */
.landing-row .status-legend {
  margin: 12px 0 0;
}

.landing-row .status-legend-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.landing-row .status-legend dd {
  color: var(--text-muted);
}

/* The ruler of rim diameters (aria-hidden; the template says what it
   draws and why each mark is at its diameter over 63). */
.landing-rim {
  position: relative;
  height: 120px;
  margin: 64px 0 0;
}

.landing-rim-name {
  position: absolute;
  top: 6px;
  font-size: 13px;
  font-weight: 700;
}

.landing-rim-name-a {
  left: 0;
  color: var(--text);
}

.landing-rim-name-b {
  right: 0;
  color: var(--brand-700);
}

.landing-rim-bar {
  position: absolute;
  top: 36px;
  height: 28px;
}

.landing-rim-bar-a {
  left: 0;
  width: 90.48%;
  background: var(--text);
  border-radius: 9999px 0 0 9999px;
}

.landing-rim-bar-b {
  left: 90.48%;
  right: 0;
  background: var(--rim-b);
  border-radius: 0 9999px 9999px 0;
}

/* One inch of B, centred on its diameter (1/63 of the bar), never under
   10px wide, standing a little proud of the bar so the exceptions read
   first. */
.landing-rim-segment {
  position: absolute;
  top: 32px;
  width: max(10px, 1.587%);
  height: 36px;
  background: var(--rim-b);
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--surface);
  transform: translateX(-50%);
}

.landing-rim-mark {
  position: absolute;
  top: 78px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--brand-700);
  transform: translateX(-50%);
}

/* On a phone the marks 45", 49" and 51" are some 11px apart: 49" drops a
   line there (the phone rules at the end) so no two labels touch. On a
   wider screen all five share one line. */

.landing-rim-mark-zero {
  left: 0;
  color: var(--text-subtle);
  transform: none;
}

.landing-rim-at-45 {
  left: 71.43%;
}

.landing-rim-at-49 {
  left: 77.78%;
}

.landing-rim-at-51 {
  left: 80.95%;
}

.landing-rim-at-57 {
  left: 90.48%;
}

.landing-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 32px;
  margin-top: 40px;
}

.landing-category {
  padding-top: 16px;
  border-top: 3px solid var(--text);
}

.landing-category h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.landing-category p {
  margin: 0;
  color: var(--text-muted);
}

.landing-category-b {
  border-top-color: var(--rim-b);
}

.landing-category-b h3 {
  color: var(--brand-700);
}

.landing-category-none {
  border-top: 3px dashed var(--border-strong);
}

.landing-category-none h3 {
  color: var(--text-muted);
}

.landing-note {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px 32px;
  align-items: baseline;
  margin-top: 48px;
  padding: 24px 28px;
  background: var(--surface-muted);
  border-radius: 16px;
}

.landing-note h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.landing-note p {
  grid-column: span 2;
  max-width: 56ch;
  margin: 0;
  color: var(--text);
}

.landing-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 32px 56px;
  padding: clamp(28px, 5vw, 56px);
  background: var(--brand-50);
  border-radius: 24px;
}

/* The title takes a row of its own, so the two lists sit side by side
   under it: in the design's three `auto-fit` columns the panel's width
   held only two, and the second list fell under the title, alone. */
.landing-panel h2 {
  grid-column: 1 / -1;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--brand-900);
}

.landing-is,
.landing-is-not {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-is li,
.landing-is-not li {
  padding-left: 20px;
}

.landing-is li {
  color: var(--brand-800);
  border-left: 3px solid var(--brand-600);
}

.landing-is-not li {
  color: var(--text);
  border-left: 3px dashed var(--placeholder);
}

.landing-closing {
  padding: 96px 0;
  color: var(--brand-100);
  background: var(--brand-900);
}

/* `start`: aligned to the end, the heading moved down when a refused form
   grew by its errors and summary. */
.landing-closing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 56px;
  align-items: start;
}

.landing-closing h2 {
  margin: 0 0 20px;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.landing-closing-grid > div > p {
  margin: 0;
  font-size: 19px;
}

.landing-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* What the form does, above its fields, in the section's body ink; and
   the note of an earlier send in this session, quieter, with the accent's
   rule. */
.landing-form-lead {
  margin: 0;
  font-size: 15px;
  color: var(--brand-100);
}

.landing-form-note {
  margin: 0;
  padding-left: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-300);
  border-left: 2px solid var(--brand-300);
}

.landing-actors {
  margin: 0;
  padding: 0;
  border: 0;
}

.landing-actors legend,
.landing-email label {
  margin-bottom: 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-200);
}

.landing-email label {
  display: block;
}

.landing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* A radio drawn as a pill: the input stays in the page, focusable and
   announced, only out of view; the label is the click target, and `:has`
   draws the choice and the focus on it. Rejected: buttons that set a hidden
   field, as the design's script did -- the page loads no script. */
.landing-pill {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-100);
  cursor: pointer;
  border: 1px solid var(--landing-pill-border);
  border-radius: 9999px;
}

.landing-pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* Chosen: a 2px light outline on a faint tint, and the padding a pixel
   less so the pill does not grow. A filled pill read as a button beside the
   form's one, and outshone it. */
.landing-pill:has(input:checked) {
  padding: 9px 17px;
  color: #ffffff;
  background: var(--landing-pill-chosen);
  border: 2px solid var(--brand-300);
}

/* The address field, white on the section's green. The button left its
   box for the end of the form (templates/landing.html says why). */
.landing-email input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  background: var(--surface);
  border: 2px solid var(--surface);
  border-radius: 12px;
}

/* A refused field says so by more than the message under it: each pill's
   edge takes the error's light red, and the address field, white on white
   would hide it, takes a ring of it on the section's green -- given way to
   the focus ring while it has the keyboard. */
.landing-actors[aria-describedby] .landing-pill {
  border-color: var(--error-on-dark);
}

.landing-email input[aria-invalid="true"]:not(:focus-visible) {
  outline: 2px solid var(--error-on-dark);
  outline-offset: 2px;
}

/* The light accent's fill and the darkest green's label (9.94:1): the
   section's one filled control, so the eye ends there. It was `--brand-700`
   until the third critique: its white label passed at 5.48:1, but as a
   shape it stood 1.77:1 from the band and sank into it, quieter than the
   chosen pill and the hero's link. (The app's own primary fill moved to
   `--brand-700` in November 2026 for its label's contrast; on this band
   that green is the one that sank.) */
.landing-submit {
  align-self: flex-start;
  padding: 14px 22px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-950);
  cursor: pointer;
  background: var(--brand-300);
  border: 0;
  border-radius: 8px;
}

.landing-submit:hover {
  background: var(--brand-200);
}

.landing-consent label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--brand-100);
  cursor: pointer;
}

.landing-consent input[aria-invalid="true"] {
  outline: 2px solid var(--error-on-dark);
  outline-offset: 2px;
}

.landing-consent input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--brand-300);
}

/* A field's error on the closing section's green: the app's red ink there
   measures under 2:1, so the error takes a light red that measures over
   7:1 on `--brand-900`. */
.landing-form .field-error {
  font-size: 14px;
  font-weight: 600;
  color: var(--error-on-dark);
}

/* The summary's links at 24px tall, the WCAG 2.2 minimum target (2.5.8):
   at the alert's 14px text they measured 18px. */
.landing-form .error-summary li {
  padding: 3px 0;
}

/* The honeypot (LeadForm.nexo): out of view and, with `tabindex="-1"`
   and `aria-hidden` in the template, out of the keyboard's and a screen
   reader's way. Moved off-screen rather than `display: none`, which some
   bots read as "skip this field". */
.landing-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* A status, not a field: a drawn check beside the words on the darkest
   green, the address the visitor sent in the light accent. */
.landing-sent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 20px 22px;
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-100);
  background: var(--brand-950);
  border-radius: 12px;
}

.landing-sent svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand-300);
}

.landing-sent strong {
  font-weight: 700;
  color: var(--brand-300);
  overflow-wrap: anywhere;
}

.landing-footer {
  padding: 48px 0 32px;
  color: var(--brand-200);
  background: var(--brand-950);
}

.landing-footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
}

.landing-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-footer-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.landing-footer-brand strong {
  display: block;
  font-size: 18px;
  color: #ffffff;
}

.landing-footer-brand span {
  font-size: 14px;
}

.landing-footer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
  font-size: 14px;
}

.landing-footer-nav strong {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-300);
}

.landing-footer-nav a {
  color: #ffffff;
}

.landing-footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 40px;
  padding-top: 20px;
  font-size: 13px;
  border-top: 1px solid var(--landing-rule-dark);
}

.landing-footer-legal p {
  margin: 0;
}

/* A phone: the ruler's labels and the section titles come down a size, and
   the feature rows' 64px number column narrows. The rows' `span 2` is
   undone so the one-column grid does not make an implicit second track. */
@media (max-width: 720px) {
  .landing-note p {
    grid-column: auto;
  }

  /* The phone at its content's height: the page's first real section
     started a screen and a half down behind it. */
  .landing-phone {
    width: 270px;
    height: auto;
  }

  .landing-phone-screen {
    height: auto;
    padding: 28px 14px 18px;
  }

  .landing-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .landing-row-num {
    font-size: 20px;
  }

  .landing-section,
  .landing-closing {
    padding: 64px 0;
  }

  .landing-section h2 {
    font-size: 32px;
  }

  .landing-panel h2 {
    font-size: 28px;
  }

  .landing-hero-grid {
    padding-top: 48px;
  }

  .landing-hero-copy {
    padding-bottom: 0;
  }

  .landing-rim-name,
  .landing-rim-mark {
    font-size: 11px;
  }

  .landing-rim-mark.landing-rim-at-49 {
    top: 96px;
  }

  .landing-submit {
    align-self: stretch;
  }
}

/* ---------------------------------------------------------------------------
   Home page.
   ------------------------------------------------------------------------- */

.page-title {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-strong);
}

/* A secondary line under a title or in a card: a company's RUT, its legal
   name and branch, a line of status. */
.meta-line {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.meta-line strong {
  color: var(--text-strong);
}

/* ---------------------------------------------------------------------------
   Branch scope: which branch the session acts for, in the header, and the
   list a user enters a branch from on the home page. In the header it heads
   the account's panel, where `.app-account-panel` lets it wrap; on the
   desktop row it is also the account's button, `.app-account-toggle`, cut
   with an ellipsis at 300px (the header's section says why that width).
   ------------------------------------------------------------------------- */

.session-scope {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  text-align: right;
  color: var(--text-subtle);
}

.session-scope strong,
.session-scope span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.session-scope strong {
  color: var(--text-strong);
}

.card + .card {
  margin-top: 16px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
}

.branch-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.branch-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.branch-list small {
  display: block;
  color: var(--text-subtle);
}

.branch-list form {
  margin: 0;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   The master administrator's corporate view: the consolidated inventory, its
   breakdown per branch, and one branch's lots. V4's «vista maestra» was not
   ported, so these are plain tables in the frame's colours. A real <table>
   rather than the movement list's grid rows because these are figures read
   across columns, and a screen reader needs the header cells to say which.
   The wrapper scrolls sideways on a phone instead of squeezing the numbers.
   ------------------------------------------------------------------------- */

.subsection-title {
  margin: 20px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
}

/* `position: relative` makes the wrapper the containing block of what is
   absolutely positioned inside it, so its scroll clips that too. Without it
   a `.visually-hidden` header cell (the «Acciones» of the master's
   «Desglose por sucursal», templates/home.html) was placed against the
   document, at its static position near the far end of the 596px table,
   outside the wrapper's clip: the master's home page was 718px wide at a
   320px viewport and scrolled sideways over blank space (measured in
   headless Chrome; hiding the wrapper brought it back to 320px). */
.table-scroll {
  position: relative;
  overflow-x: auto;
}

/* Every wrapper is `tabindex="0"` with `role="region"` and a name: a table
   holds nothing focusable, so without it a keyboard could not scroll to the
   columns the wrapper cuts off (WCAG 2.1.1; axe's
   `scrollable-region-focusable`). Where a heading right above already says
   what the table holds, the wrapper is named by it (`aria-labelledby`), so
   the two cannot drift apart; otherwise by an `aria-label` of its own. The
   ring is drawn inside, where the card's own edges cannot cut it.
   config/tests/test_frame.py pins the attributes on every wrapper in the
   templates, and that each `aria-labelledby` points at an id there. */
.table-scroll:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: -2px;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text-strong);
}

.inventory-table th,
.inventory-table td {
  padding: 10px 12px;
  text-align: left;
  border-top: 1px solid var(--border);
  white-space: nowrap;
}

.inventory-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  background: var(--surface-muted);
  border-top: 0;
}

.inventory-table .num {
  text-align: right;
}

.inventory-table tfoot th,
.inventory-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--border);
}

.inventory-table form {
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Navigation and flash messages.
   ------------------------------------------------------------------------- */

/* The open page's link (`current_page`, apps/organizations/templatetags/
   frame.py): the darker ink and an underline, not colour alone, so it reads
   as current to someone who cannot tell the two greens apart. The account's
   buttons, bordered pills, carry the same underline on their label. The
   first cut gave them only a tint, border and ink -- colour alone, and the
   very tint `.btn-quiet:hover` paints, so a current button looked like a
   hovered one. The carrier's bar marks «Transportes» the same way; its
   selector names `.app-menu` so it ties the bar's own ink and underline
   rule, which it follows in this file and so outranks. */
.app-nav a[aria-current="page"],
.app-menu > .app-shortcut[aria-current="page"],
.app-account .btn[aria-current="page"],
.page-subnav .btn[aria-current="page"] {
  color: var(--brand-900);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.app-account .btn[aria-current="page"],
.page-subnav .btn[aria-current="page"] {
  border-color: var(--brand-200);
}

/* A page's own navigation between sibling pages, in its head (a network
   generator's «Movimientos», «Inventario» and «Red»). It wore `.filter-bar`
   until November 2026, and with it a filter bar's box; the box is kept,
   without the filter bar's 24px bottom margin, which inside the head's
   centred row pushed the links up off the centre. */
.page-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* The messages framework's flashes, one tone per level. `base.html` renders
   each as `flash flash-<tags>`; until October 2026 only `.flash` was styled,
   so the 18 `messages.error` calls in the views -- a refused offer, a scope
   that no longer allows the action -- painted in the success green and read
   as confirmations. The green stays the default, for `success` and for any
   level a later view adds without a rule here. */
.flash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
}

.flash {
  margin: 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--success-text);
  background: var(--success-bg);
  border: 1px solid var(--brand-200);
}

.flash-info {
  color: var(--info-text);
  background: var(--info-bg);
  border-color: var(--info-border);
}

.flash-warning {
  color: var(--warning-text);
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.flash-error {
  color: var(--error-text);
  background: var(--error-bg);
  border-color: var(--error-border);
}

/* Notices that stay until someone acts on them, as a list: today a
   convenio's notices (_contract_notice.html), each dismissed with its own
   «Entendido». They wore `.flash-list` and `.flash flash-info` until
   November 2026, though they are not the messages framework's one-time
   flashes, and `.flash-list`, written for the frame's `<div>`, never reset
   the `<ul>`'s 40px left padding. The look is a flash's info tone, written
   apart so a change to the flashes leaves them be. */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.notice-info {
  margin: 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--info-text);
  background: var(--info-bg);
  border: 1px solid var(--info-border);
}

/* ---------------------------------------------------------------------------
   Movements: V4's generator «Movimientos» page, its «Registrar Movimiento»
   and «Ficha» modals, and the carrier's mobile scan screen. Values are the
   ones those screens set inline (src/app/dashboard/generador/movimientos,
   src/components/generador-v3/modales, src/components/transportista-v3).
   ------------------------------------------------------------------------- */

.mono {
  font-family: var(--font-mono);
}

.num {
  text-align: right;
}

.muted,
.empty {
  color: var(--text-subtle);
}

.empty {
  padding: 48px 20px;
  margin: 0;
  text-align: center;
  font-size: 14px;
}

/* `hidden` restored: `.hint`'s `display` outweighed the attribute, and
   «Ubicación»'s hint, served hidden, showed with no script to make it true
   and under a key Google had refused. */
.hint[hidden] {
  display: none;
}

/* 12px, not V4's 11px: a hint is read, not glanced at -- it says what a
   field accepts and why a held field cannot change. */
.hint {
  display: block;
  margin: 6px 0 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-subtle);
}

/* A page action's button keeps its label on one line. It used to also set
   `width: auto`, to undo the full-width primary, and later a 14px bold that
   only the buttons wearing it had; with the primary at its label's width
   (see `.btn-block`) and that size on every `.btn`, neither had anything
   left to do here. Below 481px it may wrap: the query beside
   `.draft-badge` says why. */
.btn-inline {
  white-space: nowrap;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px 24px;
  border-radius: 14px;
  background: linear-gradient(to right, var(--brand-50), var(--brand-100));
  border: 1px solid var(--brand-200);
}

.page-head .page-title {
  margin: 0;
  color: var(--brand-900);
}

.page-lede {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-700);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* A document's own fields: those of a `.rm-field` (_field.html and the
   fields laid out by hand like it) and of a form's lines (`.rm-lines-form`).
   Until November 2026 the selectors were `.rm-doc input`, `select` and
   `textarea`, which reached every control a page put inside a document --
   «Catastro»'s map filters, the accreditation's treatment checkboxes, a
   consent card's box -- and each then had to be undone where it was not
   wanted. Opting fields in rather than other components out means a new
   component inside a document starts from its own rules. A checkbox or a
   radio is never stretched: it keeps the browser's own size. */
.filter-bar input,
.rm-doc .rm-field input:not([type="checkbox"]):not([type="radio"]),
.rm-doc .rm-field select,
.rm-doc .rm-field textarea,
.rm-doc .rm-lines-form input:not([type="checkbox"]):not([type="radio"]),
.rm-doc .rm-lines-form select,
.rm-doc .rm-lines-form textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.filter-bar input {
  flex: 1;
  min-width: 220px;
  width: auto;
}

/* The textarea is listed: the base rule used to take every field's outline
   away and this one gave the focus back only to inputs and selects, so the
   five free-text fields (a refusal's reason, an offer's and a
   counter-offer's note, the carrier's route, the operational notes) showed
   no focus at all. The ring is an outline, not the border's colour alone,
   because a native checkbox paints no border: the accreditation's
   treatments and a line's «Quitar» showed no focus either. */
.filter-bar input:focus,
.rm-doc .rm-field input:focus,
.rm-doc .rm-field select:focus,
.rm-doc .rm-field textarea:focus,
.rm-doc .rm-lines-form input:focus,
.rm-doc .rm-lines-form select:focus,
.rm-doc .rm-lines-form textarea:focus {
  border-color: var(--brand-600);
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* The rule above is `:focus`, which a text field needs (a click into it is
   where typing goes), but a checkbox or radio a mouse clicks takes the focus
   too in Chrome and Firefox, and would keep the dark ring after every click.
   Only a keyboard's focus (`:focus-visible`) rings the box. Inside an
   `.option-card` the box never rings: the card does
   (`.option-card:has(input:focus-visible)`, below), and a second ring
   around the dot inside the first was noise. */
.rm-doc .rm-field input[type="checkbox"]:focus:not(:focus-visible),
.rm-doc .rm-field input[type="radio"]:focus:not(:focus-visible),
.rm-doc .rm-lines-form input[type="checkbox"]:focus:not(:focus-visible),
.rm-doc .rm-lines-form input[type="radio"]:focus:not(:focus-visible),
.option-card input:focus {
  outline: none;
}

/* Positioned so that each cell's visually-hidden label (`.cell-label`, an
   absolute 1px box) is placed against the table and clipped by it, as
   `.table-scroll` does for its own: from 721px a row may overflow its bare
   `fr` tracks, and a label left to the document's containing block at the
   start of a clipped cell would scroll the page sideways.

   The table is the grid and each row a subgrid of it (`.movement-row`,
   below), so the columns are sized once, from every row's cells together,
   and line up from row to row. Until November 2026 each row was its own
   grid: a bare `fr` track's minimum is its content's, so each row sized
   its columns from its own cells, and on «Movimientos» at 1440px «Fecha»
   started anywhere between x 391 and x 401 and «Destino» between x 817 and
   x 856, more the more a row's content differed (a two-line refusal mark
   pushed every column after it). `minmax(0, …fr)` on the row's tracks
   would also line them up, by giving every row the same zero minimum, and
   was rejected because it was tried and reverted: the semáforo pill
   (`.status`, `white-space: nowrap`) is wider than its 1.1fr share, and
   instead of its column growing to fit it, «Entregado sin certificado» and
   «Pagado, certificado retenido» were cut at this box's `overflow: hidden`
   (headless Chrome, 1440px). A subgrid keeps the bare `fr`, whose minimum
   is now the widest pill of the whole list, so the column grows to the
   pill instead. Wrapping the pill was the other way out, rejected because
   a two-line capsule is the very blot the network's refusal mark was.

   The tracks live in `--list-columns`, which a list with other columns
   overrides (`.movement-table-refusals`) and the row's fallback reads too.
   Nothing here scrolls the page sideways: from 721px the table clips its
   own overflow, and below 720px it stops being a grid and the rows stack
   into the one `minmax(0, 1fr)` track of the phone query. */
.movement-table {
  --list-columns: 1.1fr 0.8fr 1.5fr 0.9fr 1.4fr 1.1fr;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--list-columns);
  column-gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* Every child takes the table's full width: a row, to be a subgrid of all
   its tracks, and the empty state (`.empty`), which is one sentence and not
   a row of cells. Without it the empty state would fill the first track
   only. */
.movement-table > * {
  grid-column: 1 / -1;
}

/* «Red»'s refusals waiting for an alternative destination
   (network_index.html): four cells, not the movement lists' six. They used
   to sit in the six tracks, which left the content two thirds of the card
   and the refusal mark in a narrow fourth track, broken over four lines
   inside a capsule. The mark's track is `fit-content(40%)`, as a document
   line's last column is (`.rm-line` says why not `auto`): it takes the
   mark's width on one line while the card has room for it, and never more
   than 40% of the row, though only the pending mark («espera destino
   alternativo», no company name in it) is listed here today. */
.movement-table-refusals {
  --list-columns: 1.2fr 1fr 2fr fit-content(40%);
}

/* `subgrid` comes second so that a browser without it (before Chrome 117,
   Safari 16, Firefox 71) drops that line and keeps the row's own tracks:
   misaligned from row to row, as every row was before November 2026, but
   still in columns. A subgrid may set its own column gap, and `gap` here
   is the table's 12px on purpose: a different one would shift the cells
   off the table's track lines by the difference. It is also the gap of
   the fallback's columns and of the stacked cells on a phone. */
.movement-row {
  display: grid;
  grid-template-columns: var(--list-columns);
  grid-template-columns: subgrid;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--divider);
  transition: background 150ms;
}

a.movement-row:hover {
  background: var(--surface-muted);
}

/* A row that is a link shows a keyboard's focus as a ring inside its own
   edges: `.movement-table` clips its overflow to round its corners, so the
   browser's default ring, drawn outside the row, lost its sides at the
   table's edges and kept only thin lines between rows. */
a.movement-row:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: -2px;
  background: var(--surface-muted);
}

.movement-row small {
  display: block;
  font-size: 11px;
  color: var(--text-subtle);
}

.movement-row .kind {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-700);
}

.movement-row-head {
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  background: var(--surface-muted);
}

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-subtle);
}

.note {
  margin: 24px 0 0;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--success-text);
  background: var(--success-bg);
  border: 1px solid var(--brand-200);
  border-radius: 10px;
}

/* The semáforo: V4's ESTADOS table, one colour set per MovementStatus. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 9999px;
}

/* «Completo»'s check, in place of the dot (_status.html says why): the
   dot's 8px box plus the stroke's reach, drawn in the pill's text colour. */
.status-check {
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: currentColor;
}

.status-published { color: #1e40af; background: #dbeafe; }
.status-published .status-dot { background: #3b82f6; }
.status-in_transit { color: #b45309; background: #fef3c7; }
.status-in_transit .status-dot { background: #d97706; }
.status-delivered { color: #4d7c0f; background: #ecfccb; }
.status-delivered .status-dot { background: #84cc16; }
.status-delivered_settled { color: #b91c1c; background: #fee2e2; }
.status-delivered_settled .status-dot { background: #dc2626; }
.status-complete { color: #15803d; background: #dcfce7; }
.status-complete .status-dot { background: #16a34a; }
/* A withdrawn need (Movement.withdraw()): grey, because V4's ESTADOS table
   has no such state to borrow a colour from -- the sixth state is a
   provisional decision -- and a withdrawn need asks nobody for anything. */
.status-withdrawn { color: #475569; background: #f1f5f9; }
.status-withdrawn .status-dot { background: #94a3b8; }

/* The semáforo's legend (_status_legend.html), shared by the movement list's
   note and the landing's card: each state's badge, then what it means. The
   meaning wraps under the badge on a narrow screen rather than squeezing it,
   because the badge does not wrap (`.status` is nowrap). It sets no colour:
   inside the note it takes the note's; the landing card mutes it with a rule
   of its own, beside `.landing-feature p`. */
.status-legend {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.status-legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.status-legend dt,
.status-legend dd {
  margin: 0;
}

/* The movement list's semáforo note holds a lead-in, the legend and a
   closing line: its paragraphs drop the browser's 1em margin, so the
   legend's own margin is the gap between them and the note's padding the
   only one at its edges. Scoped to this note by its own class, because the
   other notes with several paragraphs (the public profile's outdated
   consent) rely on that margin to separate them. */
.note-legend > p {
  margin: 0;
}

/* The carrier's own leg (CarrierLeg), in place of the semáforo on its pages:
   the same badge, four colour sets. Amber for a load on the road, as the
   semáforo's «En tránsito»; green once delivered, with no further shade,
   because whether a CDF followed is not the carrier's to read; grey for a
   load refused at destination -- the leg is over, and nothing about it is
   the carrier's to act on (the follow-up is the origin's), so it is not the
   red the origin's refusal mark uses while someone must act. */
.leg-pending_load { color: #1e40af; background: #dbeafe; }
.leg-pending_load .status-dot { background: #3b82f6; }
.leg-in_transit { color: #b45309; background: #fef3c7; }
.leg-in_transit .status-dot { background: #d97706; }
.leg-delivered { color: #15803d; background: #dcfce7; }
.leg-delivered .status-dot { background: #16a34a; }
.leg-rejected { color: #374151; background: #e5e7eb; }
.leg-rejected .status-dot { background: #6b7280; }

/* The carrier's leg filters: links, so the list works without JavaScript.
   The current one is white on the dark green, the white of text on a fill
   that `:root` lists as literal on purpose. It was `var(--surface)` until
   November 2026: the same white, but a surface is a background, and a later
   change to the page's surfaces would have recoloured this text with it. */
.leg-filters a[aria-current="page"] {
  color: #ffffff;
  background: var(--brand-700);
}

/* A refused load, beside the semáforo rather than inside it (see
   _rejection_mark.html). Red while it waits for an alternative destination,
   because that is the one state someone must act on; neutral once answered. */
.rejection-mark {
  display: inline-flex;
  margin: 4px 0 0 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-subtle);
  border-radius: 9999px;
}

.rejection-mark-pending {
  color: var(--error-text);
  background: var(--pending-refusal-bg);
}

/* «Movimientos» (movement_list.html), reworked in November 2026 after a
   design critique measured it: every folio broken over two lines, weights
   wrapped, the refusal mark a two-line capsule, rows 88-107px tall and
   four or five of them above the fold at 1024x768. The rules below are
   this list's own; the other grid lists keep the shared ones.

   **The columns size to their content where the content has a known
   width, and share what is left where it does not.** The folio is an
   `auto` track: it takes the folio on one line while the row has room
   for it, and breaks after the folio's head only when it does not. The
   date, the weights and the semáforo are capped (`fit-content`), because
   each has one long cell that would otherwise take the row: «Registrado
   el 08/11/2026» under a need not yet loaded, the weights' uppercase
   head (167px, against 125px for the widest weight under it), and a
   refusal naming the company it was redirected to, which took 286px at
   1440px in the first try at this rule and left the waste and the
   destination their minimum. Under the cap those cells wrap. The
   semáforo's cap is the widest pill, «Pagado, certificado retenido»,
   with a little room: at 15rem the column stood half empty on most rows
   while the destination beside it broke each company's name in two.
   The waste and the destination, free text of any length, share the rest.
   The shared `--list-columns` gave every column a fixed `fr` share
   instead, so at 1440px the folio's 138px broke «76900001-2026-000013» in
   two. A subgrid sizes each track from every row's cells together, so the
   columns still line up from row to row. */
.movement-table-linked {
  --list-columns: auto fit-content(6.5rem) minmax(7rem, 1.2fr) fit-content(8rem)
    minmax(7rem, 1fr) fit-content(12.5rem);
}

/* Each row holds one link, the folio (the template says why), stretched
   over the row by its `::after`, so the whole row stays one click target.
   The row is the stretched box's containing block. */
.movement-table-linked > .movement-row {
  position: relative;
}

.movement-row-link {
  font-weight: 700;
  color: var(--text-strong);
  text-decoration: none;
}

.movement-row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.movement-row-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.movement-table-linked > .movement-row:has(.movement-row-link:hover) {
  background: var(--surface-muted);
}

/* The keyboard's ring is drawn round the row, by the stretched box, inside
   its edges as `a.movement-row:focus-visible` draws it for the other lists
   (the table clips its overflow). The link's own ring, round the folio's
   words alone, would be a second ring inside the first; it is taken away
   here and nowhere else. */
.movement-row-link:focus-visible {
  outline: none;
}

.movement-row-link:focus-visible::after {
  outline: 2px solid var(--brand-700);
  outline-offset: -2px;
}

/* The part of the folio every row of a branch shares, quieter than the
   correlative that tells the rows apart (templatetags/folios.py). Slate
   Note, the lightest grey allowed for text a reader needs. */
.folio-head {
  font-weight: 400;
  color: var(--text-subtle);
}

/* The two weights stacked, the origin's over «→ destination kg», each
   kept whole: a column two figures wide side by side was the widest
   intrinsic column of the six, and at its 113px share it wrapped them
   anyway, at whichever character fitted. Stacked on purpose, they read as
   a subtraction, right-aligned over the difference under them. */
.movement-row .weight {
  display: block;
  white-space: nowrap;
}

/* The semáforo cell: a refusal first, then the state, one under the other.
   The mark's corners are 8px here rather than a pill's: at a width that
   wraps its words it reads as a tag, not as the two-line capsule the
   shared rule comment calls a blot; where the row has room it is one line. */
.movement-cell-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.movement-cell-state .rejection-mark {
  margin: 0;
  border-radius: 8px;
}

/* What a delivered movement still lacks (_missing_fields.html). In the ink
   rather than the row's subtle caption grey: it is the line that answers
   why this row is not green. */
.movement-row .missing-fields {
  color: var(--text);
}

/* The other leg of a redirected load (_folio_chain.html). The link is
   positioned above the row's stretched folio link, or a click on it would
   open this row's ficha instead. At least 24px tall (WCAG 2.5.8): an 11px
   line of text alone would be 15px, and the row around it is a target too.
   The height is a line-height on an inline-block rather than a centred
   inline-flex, which drops the space in «Nº 000008» at the edge of a text
   run. */
.folio-chain-link {
  position: relative;
  z-index: 1;
  display: inline-block;
  line-height: 24px;
  text-decoration: underline;
}

/* «Movimientos»'s filters: «Catastro»'s arrangement of the shared panel
   (`.catastro-search` says why the fields end together), the folio search
   taking whatever the row leaves. */
.movement-filters {
  align-items: flex-end;
  gap: 12px 16px;
}

.movement-filters-query {
  flex: 1 1 200px;
}

.movement-filters-query input {
  width: 100%;
}

.movement-filters [aria-invalid="true"] {
  border-color: var(--danger-700);
}

/* The semáforo as a row of filters (movement_list.html says why links and
   why every state is listed). Each chip is the state's own badge with its
   count beside it, in a bordered pill as tall as a comfortable target. */
.state-filter {
  margin: -8px 0 16px;
}

/* Positioned for `.movement-table`'s reason: each chip's visually hidden
   «movimientos» is an absolute 1px box, and with no positioned ancestor it
   is placed against the document. Where the row scrolls (below 720px) the
   boxes of the chips past its edge sat 780px to the right of a 390px
   page, and the page scrolled sideways by that much. */
.state-filter-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  /* A <button> (the template says why), which draws with the browser's own
     font and, in Safari, a margin; both would change the chip's size. */
  margin: 0;
  padding: 3px 12px 3px 3px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  cursor: pointer;
}

/* «Todos» has no badge to sit flush against the chip's edge. */
.state-chip-all {
  padding-left: 12px;
}

.state-chip:hover {
  background: var(--surface-hover);
  border-color: var(--brand-200);
}

/* The chosen chip: a 2px edge in Verde Hoja Ink, the second pixel drawn
   inside so choosing does not move the row. A thicker edge as well as a
   colour, so the choice is not shown by colour alone. A shadow here is a
   line, not focus: the ring below is an outline (DESIGN.md's
   No-Shadow-Ring Rule). */
.state-chip[aria-current="true"] {
  border-color: var(--brand-700);
  box-shadow: inset 0 0 0 1px var(--brand-700);
}

.state-chip:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

.state-chip-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

/* The legend's disclosure, «Ver los seis estados»: the landing's control
   (`.landing-legend summary`) at the list's 13px, borderless so it does
   not read as one more chip of the row above it. */
.list-legend {
  margin-top: 8px;
}

.list-legend > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-800);
  cursor: pointer;
  list-style: none;
  border-radius: 9999px;
}

.list-legend > summary::-webkit-details-marker {
  display: none;
}

.list-legend > summary svg {
  flex-shrink: 0;
  color: var(--brand-700);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.list-legend[open] > summary svg {
  transform: rotate(90deg);
}

.list-legend > summary:hover {
  background: var(--surface-hover);
}

.list-legend > summary:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .list-legend > summary svg {
    transition: none;
  }
}

.list-legend .note {
  margin-top: 8px;
}

.list-legend .status-legend {
  margin-top: 0;
}

/* What the filters found (a status, movement_list.html). */
.list-count {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-subtle);
}

/* The list's empty states: a bordered box in the table's place, its first
   line in the ink and the next step under it. */
.list-empty {
  padding: 40px 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.list-empty p {
  max-width: 60ch;
  margin: 0 auto;
}

.list-empty p + p {
  margin-top: 6px;
}

.list-empty-title {
  font-weight: 600;
  color: var(--text-strong);
}

.list-empty + .list-legend {
  margin-top: 16px;
}

/* DESIGN.md's 720px. The stacked card is two columns rather than the
   shared rule's one: the semáforo across the top, where a state is looked
   for (it was the last of six blocks, under 300px of the rest), then the
   folio beside the date and the waste beside the weights, short values
   that each left most of a 358px line empty, and the destination across
   the foot, a company's name being the one value that needs the width.
   A card measured 379-435px tall at 390px stacked in one column. The
   filters stack as «Catastro»'s do.

   The state row stays one line and scrolls inside itself: wrapped, its
   seven chips took seven lines at 320px, about 270px between the filters
   and the first row. The chip cut at the edge says there is more; every
   chip is a button, so the Tab key scrolls it into view. The page itself
   never scrolls sideways (DESIGN.md). */
@media (max-width: 720px) {
  .state-filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: thin;
  }

  .state-chip {
    flex-shrink: 0;
  }

  .movement-table-linked > .movement-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    align-items: start;
  }

  .movement-table-linked .movement-cell-state {
    order: -1;
    grid-column: 1 / -1;
  }

  .movement-table-linked .movement-cell-wide {
    grid-column: 1 / -1;
  }

  .movement-filters > .filter-panel-field,
  .movement-filters > fieldset,
  .movement-filters .filter-panel-actions {
    flex: 1 1 100%;
  }

  .movement-filters select {
    width: 100%;
  }
}

/* The refusal on the ficha: the notice the generator receives. */
.rejection-notice {
  margin: 16px 0;
  padding: 14px 18px;
  color: var(--error-strong);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 10px;
}

.rejection-reason {
  margin: 4px 0 12px;
  font-weight: 600;
}

.kind-badge {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-subtle);
  border-radius: 9999px;
}

/* The document itself: header with the issuer and the red folio box, the
   lines in a dark-banded table, the stamp at the foot. */
.rm-doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 32px 28px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18);
}

.rm-eyebrow,
.rm-label,
.rm-doc .rm-field label,
.rm-doc .rm-lines-form label,
.rm-facts dt,
.rm-line-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* On the pages laid out as a document (the ficha, its forms, the two
   confirmations) the eyebrow is the page's `<h1>`: it names the page and
   nothing else on it does, so a screen reader moving by headings had nowhere
   to land. It keeps the eyebrow's look -- the folio box is what the eye
   reads first -- and the font-size above overrides a heading's 2em. Pages
   with a `.page-title` keep the eyebrow as a `<p>` above it. */
.rm-eyebrow {
  margin: 0 0 18px;
  color: var(--brand-700);
}

/* A choice drawn as a card: the radios of a need's and an offer's service,
   and the five single checkboxes -- three consents (the convenio's, the
   catastro's, the public ficha's) and two declarations that are not consents
   (the private mode's switch, a month with no hazardous waste). Named
   `.rm-kind` and `.rm-kind-option` until November 2026, after the movement
   form's kind choice that was the first of them; the checkboxes had borrowed
   the name since. It no longer leans on `.rm-doc label` for its
   type and resets it: that rule now reaches only a field's label, so the
   card's text is its `<strong>` and `<small>`, each styled below. */
.option-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

/* The group's error, on a line of its own under the cards, as a field's
   error sits under its input (_field.html). Every page draws it inside the
   group -- the fieldset of _option_cards.html, each checkbox's `<div>` --
   so it was one more item of the row, beside the last card: «Este campo es
   obligatorio.» to the right of «Ambos» on «Publicar necesidad» at 1280px.
   The full width, with the row allowed to wrap above, is what puts it under.
   Moving it out of the group was rejected: the fieldset is what names it in
   its aria-describedby and turns red with `.has-error`, and the partial and
   the five checkbox pages would each need the same edit. The cards keep one
   line: `flex: 1` sizes them from zero, so they wrap only below their
   words' width, and below 720px they stack anyway. */
.option-cards > .field-errors {
  width: 100%;
}

.option-card {
  flex: 1;
  display: block;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.option-card:has(input:checked) {
  border-color: var(--brand-600);
  background: var(--brand-50);
}

/* The radio inside the card is small and the card is what reads as the
   control, so a keyboard's focus rings the card, not only the dot. */
.option-card:has(input:focus-visible) {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

.option-card input {
  margin: 0 6px 0 0;
}

.option-card strong {
  font-size: 13px;
  color: var(--text-strong);
}

.option-card small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-subtle);
}

.rm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--brand-900);
}

.rm-issuer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rm-issuer strong,
.rm-issuer span,
.rm-issuer small {
  display: block;
}

.rm-issuer strong {
  font-size: 15px;
}

.rm-issuer span {
  font-size: 12px;
  color: var(--text-subtle);
}

.rm-issuer small {
  font-size: 11px;
  color: var(--text-subtle);
}

.rm-folio {
  padding: 10px 16px;
  text-align: center;
  color: var(--doc-red);
  border: 2px solid var(--doc-red);
  border-radius: 8px;
}

.rm-folio small,
.rm-folio span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rm-folio span {
  margin: 6px 0 4px;
  font-size: 11px;
}

.rm-folio strong {
  font-size: 18px;
  font-weight: 800;
}

/* `minmax(0, 1fr)`, not `1fr`, here and in every grid of the document
   layout below: a `<select>`'s min-content is its longest option, a
   company's legal name in «Gestor / destino» or «Destinatario», and a bare
   `fr` track would grow to it and push the page sideways on a phone. */
.rm-grid,
.rm-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 20px;
  margin: 18px 0;
}

.rm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rm-doc .rm-field label,
.rm-doc .rm-lines-form label,
.rm-facts dt {
  color: var(--text-subtle);
}

.rm-facts dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text);
}

.field-error {
  font-size: 12px;
  color: var(--error-text);
}

/* A field's errors in one element, so the widget's aria-describedby can name
   them by a single id (_field.html); stacked as the separate lines they were
   when each was a flex item of `.rm-field` on its own. */
.field-errors {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* A refused field's edge. Until November 2026 only `.has-error input`
   (one class, one element), which every document field's own border --
   `.rm-doc .rm-field input:not([type="checkbox"]):not([type="radio"])`,
   four classes' worth -- outweighed, so no refused document field ever
   turned red. The selectors now match that weight, and the colour is the
   danger red rather than `--error-border` (#fca5a5, 2.0:1 on white): an
   edge that says "refused" is a boundary a reader must see, which WCAG
   1.4.11 asks 3:1 of. The red still comes with the message under the field,
   never alone. */
.has-error input,
.has-error select,
.has-error textarea,
.rm-doc .rm-field.has-error input:not([type="checkbox"]):not([type="radio"]),
.rm-doc .rm-field.has-error select,
.rm-doc .rm-field.has-error textarea {
  border-color: var(--danger-700);
}

.alert-error ul {
  margin: 0;
  padding-left: 18px;
}

/* The summary of a refused form (_form_errors.html): a heading line, then
   one link per error. Its text is a column, so the alert's centring is
   undone. It takes the focus as the page loads, by `autofocus` and not by a
   click or a key, so the ring is drawn on `:focus`: `:focus-visible` would
   leave it to each browser's guess, and the ring is how a sighted keyboard
   user learns where Tab goes next. The links keep the alert's colour,
   underlined, as every link in running text is. */
.error-summary {
  align-items: flex-start;
  margin: 0 0 16px;
}

.error-summary:focus {
  outline: 2px solid var(--error-text);
  outline-offset: 2px;
}

.error-summary-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.error-summary a {
  color: inherit;
  text-decoration: underline;
}

/* The asterisk of a required field (_field.html), and the one in the note
   that states the convention (_required_note.html), in the error tone so
   the two are recognisably the same mark. */
.required-mark {
  color: var(--error-text);
  font-weight: 700;
}

/* Positioned for the same reason as `.movement-table`: the visually-hidden
   label in each cell of a line, and the spoken word beside a «→», is an
   absolute 1px box, placed against this box and clipped by it rather than
   left to the document. */
.rm-lines {
  position: relative;
  overflow: hidden;
  margin: 18px 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* The third track is `fit-content(40%)`, not `auto`. It holds a quantity,
   a «Quitar» checkbox or the CDF's «Destinatario» select, and an `auto`
   track grows to its content's max-content before the `fr` tracks share
   what is left: a select's max-content is its longest option, so with an
   80-character legal name «Destinatario» took the whole row and left
   «Tratamiento aplicado» and «Peso» a few pixels each, at 1440px as at
   320px (headless Chrome). `fit-content(40%)` is as narrow as a checkbox
   needs and no wider than 40% of the row for a select.

   Known gap, left open on purpose: the tracks are fixed at three, and the
   movement form's line has four cells when it offers by-products and edits
   a saved movement, so on a desktop its «Quitar» drops to a second line.
   It does not overflow; below 720px the form's lines stack anyway. */
.rm-line {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) fit-content(40%);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  font-size: 13px;
  border-top: 1px solid var(--divider);
}

.rm-line-head {
  padding: 9px 14px;
  font-size: 10px;
  color: var(--brand-100);
  background: var(--brand-900);
  border-top: 0;
}

.rm-line-foot {
  font-size: 12px;
  color: var(--text-subtle);
  background: var(--surface-muted);
}

.rm-line-errors {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--error-text);
}

/* A need's photographs: a row of thumbnails of one fixed height, each keeping
   its proportions (the img's width and height attributes give the browser the
   ratio) and cropped to a square-ish box at most. Used on the ficha, the offer
   page and each row of the market's list. */
.need-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.need-photos img {
  display: block;
  width: auto;
  height: 72px;
  max-width: 120px;
  object-fit: cover;
  border-radius: 6px;
}

.rm-photos-section .rm-label,
.rm-photos-section .empty,
.rm-photos-section .hint,
.rm-photos-section form,
.rm-photos-section .need-photos {
  padding: 12px 14px 0;
}

.rm-photos-section form {
  padding-bottom: 12px;
}

/* The offers received on a need's ficha: who offers what on the left, the
   answer (or the two buttons that give it) on the right. */
.rm-offers .rm-label,
.rm-offers .hint {
  padding: 12px 14px 0;
}

.rm-offer {
  grid-template-columns: minmax(0, 1fr) auto;
}

.rm-offer small {
  display: block;
  margin-top: 4px;
  color: var(--text-subtle);
}

.inline-form {
  display: inline-block;
  margin: 0 0 0 6px;
}

/* A link button in a row of `.inline-form` buttons, spaced as they are.
   The links wore `.inline-form` until November 2026, which also turned
   their `.btn` flex box into an inline block. */
.inline-action {
  margin: 0 0 0 6px;
}

.offer-answer {
  display: block;
  font-weight: 600;
}

.rm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.rm-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
}

.rm-label {
  margin: 0 0 8px;
  color: var(--text-subtle);
}

.scan-list {
  margin: 0;
  padding: 0;
  font-size: 12px;
  list-style: none;
}

.rm-stamp {
  max-width: 180px;
  text-align: center;
}

.rm-stamp svg {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.rm-stamp small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-subtle);
}

/* Wraps: a row of three buttons, or one with a long label, is wider than
   the ~248px a phone's card leaves for content. */
.rm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}

/* The carrier's phone screen. */
.scan-screen {
  max-width: 420px;
  margin: 0 auto;
}

.scan-card {
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.scan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--doc-red);
  border-bottom: 2px solid var(--brand-900);
}

/* The folio is the screen's heading: the carrier's page has no other, and a
   screen reader navigating by headings lands on it. Sized as the bold line it
   replaced, not as a heading. */
.scan-folio {
  margin: 0;
  font-size: inherit;
  font-weight: 700;
}

.scan-card-body {
  padding: 14px;
}

.scan-waste {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.scan-route {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-subtle);
}

.scan-button {
  padding: 16px;
  font-size: 16px;
  border-radius: 12px;
}

.scan-unload {
  background: var(--brand-900);
}

.scan-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
  text-align: center;
  color: var(--scan-done-text);
  background: var(--scan-done-bg);
  border-radius: 12px;
}

.scan-done small {
  font-size: 12px;
}

/* ---------------------------------------------------------------------------
   The summary card: a bordered box of label and value rows, ported from
   V4's compact «Autorizaciones» card on the gestor dashboard
   (src/components/gestor-v3/secciones/dashboard.tsx) for the gestor plant's
   ficha de acreditación, and since used for what a company page has on
   record (its location, notes, private mode, publication and authorization
   states, its public ficha and indices). Named `.acc-summary`, `.acc-list`,
   `.acc-row` and `.acc-value` until November 2026, after the accreditation:
   eight pages wore the accreditation's names, so a change meant for one of
   them restyled all. The certified codes' emerald chips and the treatment
   checkboxes below stay `acc-*`: only the accreditation draws them. V4 has
   no screen that edits the accreditation; its form below the card reuses
   the movement form's fields.
   ------------------------------------------------------------------------- */

.summary-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* The rows are a description list, each label a `<dt>` and its value a
   `<dd>`, so a screen reader announces the pairs as pairs. Until October
   2026 they were two `<span>`s, read as one run of text in which the
   reader had to guess where a label ended and its value began. The list
   carries the column's gap itself: a summary's other content (the
   operational notes' text) is not in one. */
.summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.summary-row > dt {
  font-size: 12px;
  color: var(--text-subtle);
}

.summary-row > dd {
  margin: 0;
}

.summary-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.acc-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.acc-chip {
  padding: 1px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-800);
  background: var(--brand-100);
  border-radius: 6px;
}

.acc-treatments {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.acc-treatments legend {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.acc-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The treatments are checkboxes in a fieldset, not document fields, so
   they take the frame's ring here: the document's field rule no longer
   reaches them, and until November 2026 it was also what made their
   labels 11px bold capitals. */
.acc-treatments input:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

.acc-treatments label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text);
}

/* The desktop grids stack on a phone rather than scroll sideways. */
@media (max-width: 720px) {
  .movement-row,
  .rm-grid,
  .rm-facts,
  .acc-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .movement-row-head {
    display: none;
  }

  /* The table stops being a grid, so no row is laid against the desktop's
     tracks at a phone's width: each row is a block of its own, stacked into
     the one track above. */
  .movement-table {
    display: block;
  }

  /* With the header row hidden, each stacked cell shows its own label, the
     header's own wording, so «5200,00 → 5150,00» still says it is the scale
     weights. Every cell carries that label as an element (`.cell-label`,
     visually hidden from 721px), because the header row is `aria-hidden`
     at every width: it is a row of spans, not table headers, and read
     aloud it would be one more strip of words. Until October 2026 the
     label was generated here from a `data-label` attribute, so a screen
     reader on a desktop heard each row as a strip of loose values with no
     column named at all; a label written once, in the markup, is heard at
     every width and never twice. Here every piece of `.visually-hidden` is
     undone, by one rule shared with a form's field labels (described
     below); a `.visually-hidden` nested in the label (the spoken «de
     origen a destino» of «O → D») stays hidden. A
     figure aligns left here, under its label, rather than to the right
     edge of a column that no longer exists. */
  .movement-row .cell-label,
  .rm-lines-form .visually-hidden {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }

  .movement-row .cell-label {
    display: block;
    /* A figure's cell is `.mono`; its label is not. */
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subtle);
  }

  .movement-row > .num {
    text-align: left;
  }

  /* A form's lines (`.rm-lines-form`: the movement's waste lines, the
     CDF's outputs, a month's consumption areas) stack too: three fields
     side by side left a select and a number input a few pixels each at a
     320px viewport. With the header row hidden, each field shows the label
     it already has for screen readers, so the stacked line still says
     which select is «Destinatario» and which is «Tratamiento aplicado».
     The real label is shown, undone from `.visually-hidden` by the rule
     a list's `.cell-label` shares above, so a screen reader hears each name
     once, from the one element that is both seen and read. Read-only lines
     (the ficha's) stay in columns: their cells are text and wrap. */
  .rm-lines-form > .rm-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .rm-lines-form > .rm-line-head {
    display: none;
  }

  /* Type and colour come from `.rm-doc .rm-lines-form label`, as for every
     field label of a document form; only the stacking is set here. */
  .rm-lines-form .rm-line > span > .visually-hidden {
    display: block;
    margin-bottom: 4px;
  }

  .rm-lines-form .num {
    text-align: left;
  }

  /* The movement form's «Quitar» cell is a checkbox inside its label: once
     its text shows, the two sit on one row. The checkbox keeps its own
     width at every size (the document's field rule never stretches a
     checkbox), where the old `.rm-doc input`'s 100% had centred it on a
     line of its own above the text. */
  .rm-lines-form .rm-line > span > label:not(.visually-hidden) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .rm-doc {
    padding: 20px 16px;
  }

  .option-cards {
    flex-direction: column;
  }
}

/* ---------------------------------------------------------------------------
   Second factor: the enrollment QR and the sheet of recovery codes.
   ------------------------------------------------------------------------- */

.totp-qr {
  margin: 12px 0 4px;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: 16px;
}

/* ---------------------------------------------------------------------------
   Declarations: V4's generator «Declaraciones» page
   (src/app/dashboard/generador/declaraciones/page.tsx) -- the amber draft
   pill in the header, the amber "you download it, you file it" notice, and
   the card's eyebrow. The pending list reuses the inventory table.
   ------------------------------------------------------------------------- */

.draft-badge {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--draft-text);
  white-space: nowrap;
  background: var(--draft-bg);
  border: 1px solid var(--warning-border);
  border-radius: 9999px;
}

/* Below a small tablet's width the draft pill and the compact buttons may
   break onto a second line. Both keep their label on one line elsewhere,
   but at a 320px viewport a card leaves ~248px for content and several
   labels run to ~370px: the pill's «Formato por confirmar con la
   especialista ambiental» reached x 365px and the network's «Descargar
   matrices de septiembre de 2026 (.zip)» x 389px (headless Chrome), and
   the monthly and annual downloads are as long. The pill's radius drops so
   two lines read as a tag rather than a capsule. */
@media (max-width: 480px) {
  .draft-badge {
    white-space: normal;
    border-radius: 10px;
  }

  .btn-inline {
    white-space: normal;
    text-align: center;
  }
}

/* A standing warning in the page, as opposed to a flash (`.flash-warning`)
   that arrives once after a redirect: the declarations' «you download it,
   you file it», and the notices on the reports, the heat map and the
   catastro publication that something is private, absent or suspended.
   Named `.declaration-notice` until November 2026, after the declarations
   page it was ported for; six pages wore that name. */
.notice-warning {
  margin: 0 0 24px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--warning-text);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 10px;
}

/* ---------------------------------------------------------------------------
   «Inicio» (templates/home.html). Here, after `.rm-facts` and
   `.notice-warning`, because it adjusts both for this page at their own
   specificity.
   ------------------------------------------------------------------------- */

/* The small print a card explains itself with: the columns' definitions,
   between the subtitle and the first table, and the SISREP notice's citation.
   Its top margin is what separates it from a `.meta-line`, which has none:
   the table used to start 0px under the subtitle. 54ch and not the usual 75
   because `ch` is a digit's width, wider than this face's average letter: at
   75ch these lines ran to about 106 characters (measured November 2026). */
.home-note {
  max-width: 54ch;
  margin: 8px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Closing a card, as the SISREP notice's citation does, the card's own
   padding is the only space it needs. */
.home-note:last-child {
  margin-bottom: 0;
}

/* The figure the table is read for carries the weight, as the total's row
   does. Bold rather than a tint: a colour would need a meaning of its own. */
.corporate-available {
  font-weight: 700;
}

/* A pinned name covers the column beside it once the figures have scrolled a
   little, and that column is «Entrar». A control that is still inside the
   scrolling box is not scrolled to when it takes focus, so the keyboard
   landed on a button hidden under the name (measured in Chromium, November
   2026). The padding tells the browser the name's side of the box is not
   available. Half the box and not the name's width, which is 149px on a
   phone but follows the longest name above 720px, where names do not wrap;
   half leaves room for the button at every width the table can outgrow. */
@media (max-width: 1024px) {
  .table-scroll:has(> .corporate-table) {
    scroll-padding-left: 50%;
  }
}

/* On a phone the pinned name must leave room for what it pins. At a single
   line the longest demo branch took 207 of the card's 318px at 390px, so with
   «Entrar» beside it no figure showed and nothing said the table went on.
   Wrapped to 9em, the first figure's edge is in view at rest. */
@media (max-width: 720px) {
  .corporate-table tbody th {
    width: 9em;
    min-width: 9em;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* The company's settings: label, state, link, one row each. */
.company-settings {
  margin: 0;
  font-size: 14px;
}

.company-settings > div {
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr) auto;
  gap: 2px 16px;
  align-items: baseline;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.company-settings dt {
  font-weight: 600;
  color: var(--text-strong);
}

.company-settings dd {
  margin: 0;
  color: var(--text);
}

/* The states were written to follow a colon. In a column of their own they
   start a line, and CSS capitalises them so the words stay the same ones in
   the markup and for a screen reader. */
.company-settings dd::first-letter {
  text-transform: uppercase;
}

/* Waiting on the master, not a setting's state: the words say so, the tone
   says it first. The hairline goes, since the box draws its own edge. */
.company-settings > .company-setting-attention {
  border: 1px solid var(--warning-border);
  border-radius: 10px;
  background: var(--warning-bg);
}

.company-setting-attention dd:first-of-type {
  color: var(--warning-text);
}

/* Below 720px the label stacks over the state and the link keeps the right
   column, 44px tall so it is a target a thumb can hit. */
@media (max-width: 720px) {
  .company-settings > div {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .company-settings dt {
    grid-column: 1;
  }

  .company-settings dd:first-of-type {
    grid-column: 1;
  }

  .company-settings dd:last-child {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .company-settings a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-align: right;
  }
}

/* A convenio line with a proposal to answer ends the card when it has no
   notices under it; `.notice-warning`'s margin would pad the card twice. */
[data-convenios] .notice-warning:last-child {
  margin-bottom: 0;
}

/* A `.meta-line` has no margin, which is right between two lines of text and
   wrong above a box: a company with a proposal to answer, listed after one
   without, had its box touching the line above it. */
[data-convenios] .meta-line + .notice-warning {
  margin-top: 12px;
}

/* The SISREP notice: the days left lead, in the body's size and weight. */
.sisrep-days dd {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
}

/* Past the deadline the same words take the warning tone, as a pill sized
   to them, at the size and weight the days have before it: smaller would make
   the graver state the quieter one. The template says why warning and not
   danger. */
[data-sisrep-overdue] .sisrep-days dd {
  width: fit-content;
  padding: 4px 10px;
  color: var(--warning-text);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 9999px;
}

.card-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

.pending-reasons {
  margin: 0;
  padding-left: 18px;
  white-space: normal;
}

/* A counter-offer under its row in the list of offers sent: the generator's
   terms, and the sender's two answers to them. Spans the whole row, below
   the six columns. */
.offer-counter {
  grid-column: 1 / -1;
  padding-top: 8px;
}

.offer-counter small {
  display: block;
  margin-bottom: 8px;
}

.offer-counter .inline-form:first-of-type {
  margin-left: 0;
}

/* ---------------------------------------------------------------------------
   The heat map («Mapa de residuos»): the map itself, its legend and the
   swatches the legend and the table below it share. On a phone the map's
   height is fixed rather than a share of the viewport so the legend and the
   table stay reachable without scrolling past a full-screen map; from 1024px
   it grows with the window, within bounds (`.heat-view`, below); full screen
   is a mode of its own, below. The legend's text is the page's normal size
   rather than `.hint`'s, because it says what a red point does and does not
   mean.
   ------------------------------------------------------------------------- */

/* Every Leaflet map -- today this one; «Ubicación»'s Google map is isolated
   by `.location-map` for the same reason -- is its own stacking context. Leaflet gives its panes z-index 400 to 700 and its
   controls 1000, and without isolation those numbers compete with the rest
   of the page: the open header menu (`.app-menu-panel`, z-index 10) was
   painted under the map, and its links under the zoom buttons took the taps
   meant for them (measured at 390x844 on «Ubicación», 2026-10-04).
   Isolated, the whole map paints as one layer at the page's own level, under
   anything the page positions above it, while Leaflet's layers keep their
   order inside it.

   Rejected: raising the menu's z-index above 1000. It would have to outbid
   numbers Leaflet chooses, and any version or plugin that raises them again
   brings the bug back, and it would have to stay below full screen's 2000
   (`.heat-stage.is-full-screen`, below) or the header would sit over a
   full-screen map. Isolation does not disturb full screen: the map is
   inside the fixed block whose 2000 lifts it, map and all, over the header.

   The selector is Leaflet's own class rather than this file's map classes,
   so a map added on another page is isolated without anyone remembering
   to; before the script runs there is no class and nothing to isolate. */
.leaflet-container {
  isolation: isolate;
}

/* Every map's text in the site's face. Leaflet's stylesheet sets
   `.leaflet-container` in "Helvetica Neue", Arial, and is linked after this
   one, so a bare `.leaflet-container` here lost to it: the popups, the
   attribution and every marker's hidden name were set in Leaflet's face
   beside Geist Mono figures, and in Arial on Windows (the design critique of
   November 2026). `body` adds the weight that outranks it without
   `!important` and without depending on the order the stylesheets are
   linked in. The zoom buttons keep the face Leaflet gives them by a rule of
   their own. */
body .leaflet-container {
  font-family: var(--font-sans);
}

/* The line over the map saying what it draws (heat_map.html says why). */
.heat-map-status {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text);
}

/* The frame places «Saltar el mapa» over the map's top-left corner when a
   keyboard focuses it, where the Tab key has just arrived; `.skip-link`
   places itself against its nearest positioned ancestor. Over the zoom
   buttons: the map is isolated (`.leaflet-container`), so the link's
   z-index outbids the whole map, buttons included. */
.heat-map-frame {
  position: relative;
}

/* Hidden in place, over the map's corner, rather than moved out as
   `.skip-link` is: moved up by twice its height it stayed invisible over the
   controls above the map and took the clicks meant for «Filtros» (found
   2026-11-07, Playwright reporting the link intercepting the click). Not
   `display: none` or `visibility: hidden`, which would take it out of the
   Tab order. Its z-index is the full-screen toggle's 10, not `.skip-link`'s
   100: the frame does not position `.heat-map-frame` in a layer of its own,
   so 100 would be counted against the sticky band's 50 and a focused link
   would paint over the band once the map scrolled under it. 10 still
   outbids the isolated map. */
.heat-skip {
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: none;
}

.heat-skip:focus {
  opacity: 1;
  pointer-events: auto;
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* Full screen's toggle on the map's top-right corner (heat_map.html says
   why), opaque so the tiles do not show through its label, and above the
   isolated map as the skip link is. */
.heat-full-screen-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: var(--surface);
}

.heat-full-screen-toggle:hover {
  background: var(--surface-hover);
}

/* What follows the map is focused only by «Saltar el mapa» (it is
   `tabindex="-1"`), and its ring would circle the legend and every table:
   the link already said where the focus went, as `.app-main` does. */
.heat-below:focus {
  outline: none;
}

/* What the map box says when there is no map (see heat_map.html). */
.heat-map-fallback {
  margin: 0;
  /* Clear of the full-screen toggle over the box's top-right corner. */
  padding: 56px 16px 16px;
  font-size: 14px;
  color: var(--text);
}

/* The map and its key as one view (heat_map.html says why). On a phone,
   and up to 1024px, the key is the row under the map that the rules above
   draw. From 1024px it is a column beside a map taller than the phone's
   420px: up to 70% of the window, never under 420 or over 680, so the page
   below it is still a scroll away on a laptop. The column is 13rem, wide
   enough for «Planta de valorización» on one line beside its letter. */
@media (min-width: 1024px) {
  .heat-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 13rem;
    gap: 0 24px;
    align-items: start;
    margin-bottom: 16px;
  }

  .heat-view .heat-map,
  .heat-view .heat-map-frame:has(+ .heat-key) .heat-map {
    height: clamp(420px, 70vh, 680px);
    margin-bottom: 0;
  }

  .heat-view .heat-key {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin: 0;
  }

  .heat-view .heat-scale {
    flex-direction: column;
    gap: 8px;
  }

  .heat-view .heat-key-note {
    margin: 0;
  }
}

/* The heat map's tiles in greys. OpenStreetMap's standard style paints
   parks green, roads yellow and orange and motorways pink-red: the hues of
   the five-step scale, so a point sat on a ground of its own colours. In
   greys the only colours on the map are the marks. This map only: on
   «Ubicación» (`.location-map`) a branch places its yard by the streets and
   parks around it, and their colours are what it reads. The attribution and
   the controls are outside the tile pane and keep theirs. */
.heat-map .leaflet-tile-pane {
  filter: grayscale(1) contrast(0.9) brightness(1.04);
}

.heat-map {
  height: 420px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* The map's key (heat_map.html says why it sits inside the block): one
   wrapping row under the map, held to it by an 8px gap instead of the map's
   usual 16px, and with no frame of its own -- nearness alone makes it the
   map's, and a box would make it read as another card. The caveat is pushed
   to the row's end, so it reads as a note on the colours rather than as a
   sixth one, and wraps under them on a phone. */
.heat-map-frame:has(+ .heat-key) .heat-map {
  margin-bottom: 8px;
}

.heat-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
}

.heat-key-note {
  margin: 0 0 0 auto;
  color: var(--text);
}

/* On a phone the caveat always wraps to a line of its own, where pushed to
   the end it hung off the right edge, apart from the colours it qualifies
   (seen at 390px, 2026-11-07). */
@media (max-width: 720px) {
  .heat-key-note {
    margin-left: 0;
  }
}

/* The legend's prose and «Cómo filtran» held to a reading measure: each
   ran the width of its card, about 140 and 200 characters a line on a
   1414px window (measured on beta, 2026-11-07), where a line much past 75
   loses the reader on the way back to its start. */
.heat-legend p {
  max-width: 72ch;
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.heat-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  list-style: none;
}

.heat-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 50%;
}

/* A table whose figures carry their breakdown: each breakdown on its own
   line, and the long folios allowed to wrap at their hyphens instead of
   widening the table. The heat map's tables and «Catastro»'s list; named
   `.heat-points` until November 2026. `.heat-swatch` keeps the map's name
   on «Catastro» on purpose: there it shows the colour the branch takes on
   the map, so a change to the map's swatch must change it too.

   A known gap, left open on purpose: the swatch's colour is an inline
   `style` (heat_map.html and catastro.html); the landing page's twelve
   card colours were inline too, until its November 2026 redesign drew
   every colour from a class. Nothing breaks today, since the site sends no
   Content-Security-Policy; one without `'unsafe-inline'` for styles would
   blank them. The fix then is a class per intensity step
   (`[data-intensity=…]`), whose colours are a closed set the server
   computes. */
.breakdown-table small {
  display: block;
}

/* A point's volume or urgency level, under the figure it is read from. In
   the page's own face rather than the cell's monospace: it is words, not a
   figure, and set in mono it read as one more measurement. */
.heat-level {
  font-family: var(--font-sans);
}

.breakdown-table a,
.breakdown-table [data-need] {
  overflow-wrap: anywhere;
}

/* «Catastro»'s list (catastro.html): a directory of companies, read row by
   row. Two kinds of cell wrap instead of keeping `.inventory-table`'s single
   line: the company (trade name, legal name, RUT) and the place («comuna,
   región»). On one line they made the table 1159px wide with the demo's
   longest legal name and region, against the 912px a desktop's card leaves,
   and the figures went off to the side. The figures keep the single line,
   so a tonnage or a date never breaks.

   A company heads its branches from the top of its group, not its middle:
   the eye runs down the names on the left edge, and a name centred over
   three branches sat lower than a name over one. */
.catastro-table tbody th {
  min-width: 12em;
  white-space: normal;
  vertical-align: top;
}

/* The list's links -- a company's ficha, «Ver la región en el mapa», a
   need's «Ofertar» -- take the frame's 2px focus ring. DESIGN.md records
   that links in running text keep the browser's 1px ring, a gap left open;
   these are a list's controls, read and tabbed through row by row, so they
   ring as the rows of the movement list do. */
.catastro-table a:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* Two classes, to outweigh `.inventory-table td`'s single line. */
.catastro-table .catastro-place {
  min-width: 9em;
  white-space: normal;
}

/* «En tu red», under a generator's name for its sistema de gestión
   (catastro_views says when): a written tag in the movement list's kind
   style («Retroactivo»), uppercase Verde Hoja Ink, so it is read, not told
   by a colour. Above the list's own small grey lines it needs its weight. */
.catastro-table .catastro-network {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-700);
}

/* The company stays in view while the figures scroll under it, so a volume
   is never read without the name it belongs to. Pinned at every width: the
   table outgrows its card below 1025px, and on a desktop too once a session
   that offers adds «Necesidades publicadas»: 924px against the 912px a
   desktop's card leaves with no need listed, 950px with one, a folio being
   184px of monospace that cannot break (measured November 2026). Until a
   table overflows, a sticky cell sits where it would anyway. The
   alternative the design system uses for lists, stacking each row's cells
   below 720px, was rejected here: these are real table rows grouped per
   company (one `<tbody>` each, headed by a `rowgroup` cell), and a table
   whose cells are re-displayed as blocks has lost its table semantics in
   Safari, which is exactly what the row-group headers exist to give a
   screen reader. One layer up is enough for both pinned cells: the head
   does not stick vertically, so a body cell never meets the head's, and
   each pinned cell only has its own row's cells pass under it. «Inicio»'s
   two tables (`.corporate-table`) pin their name for the same reasons, and
   their total's label with it. */
.catastro-table thead th:first-child,
.catastro-table tbody th,
.corporate-table thead th:first-child,
.corporate-table tbody th,
.corporate-table tfoot th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}

.catastro-table thead th:first-child,
.corporate-table thead th:first-child {
  background: var(--surface-muted);
}

/* The rule at the pinned column's edge, where the table can outgrow its card
   and the figures pass under the name. An inset shadow, not a border: in
   the collapsed border model the border belongs to the table's grid, and
   does not travel with a sticky cell. Not drawn on a desktop, where the
   table fits unless a session adds the needs, and the line would divide a
   list that does not scroll. */
@media (max-width: 1024px) {
  .catastro-table thead th:first-child,
  .catastro-table tbody th,
  .corporate-table thead th:first-child,
  .corporate-table tbody th,
  .corporate-table tfoot th {
    box-shadow: inset -1px 0 var(--border);
  }
}

/* The search in force over the list (catastro_views.search_summary) echoes
   what was typed, up to the field's 128 characters. A query with no space in
   it was one unbreakable word: at 320px it made the page 886px wide. */
.catastro-search-summary {
  overflow-wrap: anywhere;
}

/* On a phone the pinned column takes about 150px of the card's 318px, so
   the figures keep the rest; at 12em it took 180px. */
@media (max-width: 720px) {
  .catastro-table tbody th {
    min-width: 9em;
    width: 9em;
  }
}

/* The heat map's popup (static/js/heat_map.js): its paragraphs and its
   list, side by side. Until November 2026 the list's rule sat two hundred
   lines further down, after the full-screen rules. */
/* Scoped under Leaflet's `.leaflet-popup-content`, whose own
   `.leaflet-popup-content p { margin: 17px 0 }` has the same weight as a bare
   `.heat-popup p` and comes later (Leaflet's stylesheet is linked after this
   one), so it won: every line of the popup stood 17px from the next, and a
   waste point's popup outgrew the 420px map (seen 2026-11-07, when the two
   levels added two lines). One class more outweighs it without `!important`
   and without depending on the order the stylesheets are linked in. */
.leaflet-popup-content .heat-popup p {
  margin: 0 0 4px;
}

.leaflet-popup-content .heat-popup ul {
  margin: 0 0 4px;
  padding-left: 16px;
}

/* A waste point's popup: two levels and the scale they add up to
   (heat_map.js's `popup` says why that shape). Built of `div`s and `span`s
   rather than the paragraphs above, so Leaflet's paragraph margin never
   reaches it. Every colour is a token; the scale's five fills are the only
   ones the script sets, from the server's `heat-map-scale` block.

   Leaflet's content box around it is a size container, so the narrow rules
   at the end of this block follow the popup's own width rather than the
   window's: full screen widens the map without widening the window. The
   content box rather than the popup itself, so those rules can reach the
   popup's own gap. Only a waste point's (`:has`): a size container offers
   Leaflet no width of its own to measure, which is why heat_map.js pins
   this popup's minimum width to its maximum (`pointPopupOptions`). That
   minimum is not redundant: without it the popup collapses to Leaflet's
   50px. The places' popups, which Leaflet sizes to their text, stay out. */
.leaflet-popup-content:has(> .heat-popup--point) {
  container-type: inline-size;
}

/* The 3px padding is the room an outline needs at the popup's edge: the
   current step's (2px, 1px clear) at either end of the scale, and a focused
   folio link's at the right. A popup that scrolls (heat_map.js) clips to its
   box, and both rings were cut off along that edge (seen 2026-11-07). */
.heat-popup--point {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 3px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-strong);
}

/* Kept clear of Leaflet's close button, in the popup's top-right corner. */
.heat-popup-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 12px;
}

.heat-popup-head strong {
  font-size: 15px;
  line-height: 1.3;
}

.heat-popup-where,
.heat-popup-muted,
.heat-popup-bound,
.heat-popup-detail {
  color: var(--text-subtle);
}

.heat-popup-where,
.heat-popup-detail,
.heat-popup-verdict,
.heat-popup-extra {
  font-size: 12px;
}

/* The two levels on one grid, each level a subgrid of it, so the first
   column is as wide as the wider title («ANTIGÜEDAD») in whatever face and
   size it is set, and both meters and both details start where it ends.
   Until the code review of November 2026 it was a fixed 78px title and an
   86px indent repeating that width by hand, which a wider fallback face or
   a reader's larger text would have outgrown, and the two meters would
   have stopped lining up. Every cell names its row and column so the narrow
   rules below can move them. The name's track is `minmax(0, 1fr)`, as every
   `fr` track here is (config/tests/test_phone_overflow.py), so a long bound
   wraps instead of widening the popup past the map. */
.heat-popup-levels {
  display: grid;
  grid-template-columns: max-content auto minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 14px;
}

.heat-popup-level {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  row-gap: 2px;
}

.heat-popup-level-title {
  grid-area: 1 / 1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-subtle);
}

.heat-popup-meter {
  grid-area: 1 / 2;
  display: flex;
  gap: 3px;
}

.heat-popup-meter > span {
  width: 18px;
  height: 6px;
  border-radius: 2px;
  background: var(--border);
}

.heat-popup-meter > .is-on {
  background: var(--text-strong);
}

.heat-popup-level-name {
  grid-area: 1 / 3;
  margin-left: 4px;
  font-weight: 600;
}

/* The level's bound («desde 2 t»), under its name: heat_map.VOLUME_BOUNDS
   says why the popup prints it. */
.heat-popup-bound {
  grid-area: 2 / 3 / auto / -1;
  margin-left: 4px;
  font-size: 11px;
}

.heat-popup-figure {
  font-family: var(--font-mono);
}

.heat-popup-detail .heat-popup-figure {
  color: var(--text);
}

.heat-popup-amount {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
}

.heat-popup-level > .heat-popup-amount {
  grid-area: 1 / 4;
}

.heat-popup-detail {
  grid-area: 3 / 2 / auto / -1;
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

/* The categories are a list for a screen reader (heat_map.js says why) and
   lines like the rest of the detail for the eye. As heavy as the popup's own
   list rule above and later, so it wins without `!important`. */
.leaflet-popup-content .heat-popup-detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The scale and the colour it lands on, set off from the two levels. The
   point's own step stands twice as tall as the others and outlined, so it
   is told from them by its shape, not by its colour alone. */
.heat-popup-sum,
.heat-popup-extra {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.heat-popup-scale {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.heat-popup-scale > span {
  flex: 1;
  height: 8px;
  border-radius: 2px;
}

.heat-popup-scale > .is-current {
  height: 16px;
  outline: 2px solid var(--text-strong);
  outline-offset: 1px;
}

.heat-popup-pair {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.heat-popup-pair .heat-popup-amount {
  font-size: 13px;
}

/* The colour and the sentence under it. The colour's line is plain text, not
   a flex row: a flex row trims the spaces round the middle dot. */
.heat-popup-note {
  font-size: 12px;
  color: var(--text-subtle);
}

/* A folio is read whole: broken at its hyphen it read as two numbers. */
.heat-popup-folios {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.heat-popup-folios > * {
  white-space: nowrap;
}

/* A popup taller than the map scrolls inside itself, and is then a stop of
   its own for the keyboard (heat_map.js's `popupopen` says why), so it takes
   the ring every focusable thing here takes. Inset, because the popup's
   wrapper clips what lies outside its rounded edge. */
.leaflet-popup-content.leaflet-popup-scrolled:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: -2px;
}

/* A popup narrower than the design's 300px -- 248px on a 390px phone, 200px
   on a 320px one. Title, meter, name, bound and figure no longer fit one
   row, so the title and the figure share the first and the meter, the name
   and the bound the second, the bound beside the name where the wider rows
   set it under. The first column is then the meter's, because a title
   spanning three columns does not size the first. The detail starts under
   the title instead of the meter, since aligned to the meter it wrapped
   every line twice, and the gaps between the popup's parts close up.

   From 290px, not from a narrower width: with the title, meter and name on
   one row and the figure at its end, a 248px row had room for «Medio» only
   while the figure was short, and «345,250 t» printed over the name
   («Medi345,250 t», the design critique of November 2026). Every popup this
   narrow takes the stacked arrangement, whatever its figures measure. */
@container (max-width: 290px) {
  .heat-popup--point {
    gap: 10px;
  }

  .heat-popup-levels {
    row-gap: 10px;
  }

  .heat-popup-sum,
  .heat-popup-extra {
    padding-top: 8px;
  }

  .heat-popup-level-title {
    grid-area: 1 / 1 / auto / 4;
  }

  .heat-popup-level > .heat-popup-amount {
    grid-area: 1 / 4;
  }

  .heat-popup-meter {
    grid-area: 2 / 1;
  }

  .heat-popup-level-name {
    grid-area: 2 / 2;
  }

  .heat-popup-bound {
    grid-area: 2 / 3 / auto / -1;
  }

  .heat-popup-detail {
    grid-column: 1 / -1;
  }
}

/* 240px and under, down to the 200px floor (a 320px phone): a little tighter
   still. Every row counts here; even scrolling, a popup that shows its whole
   self is read at a glance. */
@container (max-width: 240px) {
  .heat-popup--point {
    gap: 8px;
    line-height: 1.3;
  }

  .heat-popup-levels {
    row-gap: 8px;
  }

  /* A label and its values one above the other: beside «Necesidades
     publicadas» a 20-character folio had no room left on its line. */
  .heat-popup-pair {
    flex-direction: column;
    gap: 2px;
  }

  .heat-popup-folios {
    justify-content: flex-start;
  }
}

/* Windows' high-contrast mode (`forced-colors`) replaces every background
   with its own, so the meters' filled and empty segments, told apart by
   background alone, and the scale's five fills would all come out alike:
   the sum the popup is built to show would be gone, leaving loose words.
   The segments opt out of that replacement and are drawn in the mode's own
   colours instead, filled in its text colour, empty in its background, each
   edged; the scale keeps the server's five fills, which are its content,
   edged the same, and the current step's outline takes the text colour. */
@media (forced-colors: active) {
  .heat-popup-meter > span,
  .heat-popup-scale > span {
    forced-color-adjust: none;
    border: 1px solid CanvasText;
  }

  .heat-popup-meter > span {
    background: Canvas;
  }

  .heat-popup-meter > .is-on {
    background: CanvasText;
  }

  .heat-popup-scale > .is-current {
    outline-color: CanvasText;
  }
}

/* The filter panel: the heat map's filters and layer switches, which sit
   with the map in one block (`.heat-stage`) so full screen keeps them at
   hand, and «Catastro»'s search, which filters the same inventory by the
   same categories. Named `.heat-filters`, `.heat-region`,
   `.heat-filter-actions` and `.heat-filter-note` until November 2026, when
   «Catastro» wore the map's names: its «Nombre o R.U.T.» search was a
   `.heat-region`. `.filter-panel-field` is a labelled control of the
   panel, its label's text above it. The 24px under it is the design
   system's gap from a filter bar to its list; it was 12px until November
   2026, and it only shows on «Catastro»: in the heat map's fold
   `.heat-filter-fold > .filter-panel` sets the margin itself. */
.filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 12px 16px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-panel fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-panel legend,
.filter-panel-field {
  font-weight: 600;
  color: var(--text-strong);
}

/* The browser's 2px either side of a legend put «Categoría» 2px right of
   the field labels beside and under it. */
.filter-panel legend {
  padding: 0;
}

/* Each checkbox row at least 24px tall, its box centred in it: a 13px box
   in a 20.8px row, the rows stacked with no gap, had each box's 24px circle
   overlapping the next one's, so it met neither of WCAG 2.5.8's two ways
   through (a 24x24 target, or one spaced so its 24px circle touches no
   other target); axe counted 324 such boxes on the heat map. Spaced
   rather than enlarged: the platform's checkboxes are the browser's own
   size everywhere else, and a 24px box here would be the only one. The
   label stays the click target for the whole row, as before. The same
   panel serves «Catastro»'s category filter. */
.filter-panel fieldset label {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  font-weight: 400;
}

/* Flush with the legend and the field labels: the browser's 4px left
   margin set every box in from the column's edge. */
.filter-panel fieldset input[type="checkbox"] {
  margin-left: 0;
}

/* The panel's text field and selects: «Catastro»'s «Nombre o R.U.T.»,
   «Región» and «Ordenar por», and the heat map's «Región». DESIGN.md's
   field (white fill, 8px corners, 11px sides, 14px ink) at 40px, the
   height `.filter-panel-actions` gives the buttons, so a row of fields and
   buttons shares one bottom edge. The edge is `--text-subtle`, 4.83:1 on
   white, not the token's `--border-strong`: that one measures 1.47:1,
   under the 3:1 WCAG 1.4.11 asks of a field's boundary (DESIGN.md records
   the deviation and the fields it leaves as they are). Until November
   2026 this rule set only padding and a margin, so the browser drew the
   rest: the search a 37px box with a 2px inset bevel and square corners,
   beside 33px selects with rounded ones, under 46px buttons (the design
   critique of November 2026 measured the three). Before that the search
   took `.rm-doc input`'s full-width document field. */
.filter-panel-field input,
.filter-panel-field select {
  display: block;
  box-sizing: border-box;
  height: 40px;
  margin-top: 4px;
  padding: 0 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--input-ink);
  background: var(--surface);
  border: 1px solid var(--text-subtle);
  border-radius: 8px;
}

/* The panel's controls ring with the frame's focus colour. They used to
   on «Catastro» only, through the document rule that reached them there,
   and drew the browser's own ring on the heat map. The heat map's layer
   switches are listed by name: since November 2026 they stand outside the
   folded `.filter-panel`, and without their own selector they went back to
   the browser's ring. A field's border turns Verde Hoja under the ring, as
   a document field's does (DESIGN.md, "Focus"); a checkbox paints no
   border, so the ring alone shows it. */
.filter-panel input:focus-visible,
.filter-panel select:focus-visible,
.heat-layers input:focus-visible {
  border-color: var(--brand-600);
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* At the end of their line, so they sit on the bottom edge of the field
   beside them -- the heat map's «Región», «Catastro»'s «Ordenar por».
   Centred, as they were until November 2026, they were centred on the
   field's label and control together and stood 13px above its edge. */
.filter-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-end;
}

/* The heat map's «Región» and its buttons, one flex item of the panel
   holding a row of its own whose items end together. Loose in the panel,
   the buttons ended with the tallest item of whatever line they wrapped
   onto: at 800px the «Antigüedad» fieldset shared it, and they hung 28px
   under the select (the design critique of November 2026). */
.filter-panel-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 24px;
}

/* The panel's buttons at the fields' 40px, their type and side padding
   still DESIGN.md's (the One Button Size Rule is about the label, 14px
   bold or the quiet 13px, not the box). At their own padding «Buscar» was
   46px and «Quitar filtros» 37px, so neither met the fields' edge. */
.filter-panel-actions .btn {
  min-height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}

.filter-panel-note {
  flex-basis: 100%;
  margin: 0;
}

/* «Catastro»'s search (catastro.html says what is in it and in which
   order). Every field is a label line over a 40px control, so with the
   items aligned to the end the controls and the buttons share one bottom
   edge and the labels one top line, which the panel's top alignment and
   centred buttons did not give: the controls' bottoms sat 4px and 13px
   apart. The name or RUT, the field a directory is searched by, takes
   whatever the row leaves, never under 200px; it was a fixed 178px, half
   the row on a phone. 200px and the 16px gaps are what fit the whole
   search, both buttons included, on one row of the frame's 1024px column
   with «Todas las regiones» chosen (measured: 951 of 958px); a longer
   region's name wraps the buttons to a line of their own. */
.catastro-search {
  align-items: flex-end;
  gap: 12px 16px;
}

.catastro-search-query {
  flex: 1 1 200px;
}

/* Room for both buttons whether or not «Quitar filtros» shows, so the
   first search does not move the fields: with the slot sized to «Buscar»
   alone, the name field shrank 113px and every field after it slid left
   the moment the link appeared. 200px is the two buttons and their gap
   (80 + 8 + 105, measured), rounded up. A phone stacks them anyway. */
.catastro-search .filter-panel-actions {
  min-width: 200px;
}

/* A refused field's edge, as DESIGN.md draws one: `danger-700`, with its
   line in the refusal above the form. It stays red under the focus ring,
   as a document field's `.has-error` edge does, so focusing the field does
   not make the refusal look withdrawn. */
.catastro-search [aria-invalid="true"]:not([type="checkbox"]) {
  border-color: var(--danger-700);
}

/* A checkbox paints no border to turn red, so a refused category marks
   its legend instead, in the same `danger-700` (6.47:1 on white), the
   group being described by its refusal's line. Never the colour alone:
   that line names the refused value above the form. */
.catastro-search fieldset[aria-describedby~="catastro-error-categoria"] legend {
  color: var(--danger-700);
}

.catastro-search-query input {
  width: 100%;
}

/* The two category boxes side by side at the controls' 40px, rather than
   stacked under their legend: two short choices read as one control, and
   stacked they made the fieldset the row's tallest item. */
.filter-panel-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
  min-height: 40px;
  margin-top: 4px;
}

/* DESIGN.md's 720px: the form stacks, each field the column's width, and
   the buttons on their own line under them. Without it a phone got three
   uneven rows -- the search alone, then «Región» beside the categories,
   then «Ordenar por» beside the buttons. */
@media (max-width: 720px) {
  .catastro-search > .filter-panel-field,
  .catastro-search > fieldset,
  .catastro-search .filter-panel-actions {
    flex: 1 1 100%;
  }

  .catastro-search select {
    width: 100%;
  }
}

/* The heat map's controls (heat_map.html says why in two tiers): the layers
   in a row that is always in view, then «Filtros» folded.
   The filters keep `.filter-panel`'s look, shared with «Catastro», inside
   the fold. */
.heat-controls {
  margin-bottom: 12px;
}

.heat-layers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
  border: 0;
}

.heat-layers-label {
  font-weight: 600;
  color: var(--text-strong);
}

/* 24px tall, as the panel's rows are (`.filter-panel fieldset label`). */
.heat-layers label {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
}

.heat-filter-fold > summary {
  list-style: none;
}

.heat-filter-fold > summary::-webkit-details-marker {
  display: none;
}

.heat-filter-fold-chevron {
  flex-shrink: 0;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.heat-filter-fold[open] .heat-filter-fold-chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .heat-filter-fold-chevron {
    transition: none;
  }
}

.heat-filter-fold > .filter-panel {
  margin: 8px 0 0;
}

/* «Cómo filtran»: the rules behind a filter panel's search, on the heat map
   and on «Catastro». Named `.heat-how` until November 2026, when «Catastro»
   folded its own rules the same way. A quiet disclosure under the actions,
   the browser's own triangle kept -- it is a note to open when a result
   surprises, not a control to look for. `list-item`, the display a
   summary's triangle is drawn for: as `inline-flex` it lost the triangle,
   leaving only the colour to say the words open something. `fit-content`
   keeps the click target to the words rather than the panel's whole width,
   and the 24px line keeps the row WCAG 2.5.8's height. */
.filter-panel-how summary {
  display: list-item;
  width: fit-content;
  min-height: 24px;
  line-height: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
  cursor: pointer;
}

.filter-panel-how summary:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

.filter-panel-how p {
  max-width: 72ch;
  margin: 4px 0 0;
}

/* The missing branches' notices as one list (heat_map.html says why); the
   list spaces them, so each loses the notice's own margin. */
.heat-absences > li {
  margin: 0;
}

/* The buttons that enter each named branch to record its point, on a row of
   their own under the notice's text (heat_map.html says why); each form
   loses `.inline-form`'s left margin, which only spaces buttons in a line of
   text and pushed a wrapped button out of line with the one above it. */
.heat-absence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.heat-absence-actions .inline-form {
  margin: 0;
}

/* Carriers and plants: a lettered marker rather than a coloured one, so the
   two layers are told apart from the waste points, and from each other,
   without telling colours apart. */
.heat-place {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  border: 1px solid var(--marker-edge);
  border-radius: 3px;
}

/* A waste point: a numbered disk, its fill the point's colour (set by
   static/js/heat_map.js, which says why the number is there) and its number
   in the ink the server measured against that fill
   (`heat_map.INTENSITY_INK`). The key's disks are the same component, so
   the key shows exactly what the map draws. The edge is the lettered
   markers', so the three layers read as one set of marks. */
.heat-point {
  border: 1px solid var(--marker-edge);
  border-radius: 50%;
}

/* The key's disks carry `.heat-point` too, so these two rules reach them
   without naming `.heat-key-disk`. */
.heat-point > span:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-strong);
  border-radius: 50%;
}

.heat-point--light > span:first-child {
  color: #ffffff;
}

/* The key's disk: the map's, at the size of the key's 13px line. */
.heat-key-disk {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: middle;
}

/* `:first-child` for the weight of the map's rule above, which it follows:
   as a bare `.heat-key-disk > span` it weighed less and the key's numbers
   kept the map's 12px. */
.heat-key-disk > span:first-child {
  font-size: 11px;
}

/* Every marker is a button (Leaflet's), and drew the browser's own ring, or
   on some browsers none, on a map of greys. The frame's focus colour, as
   the filter panel's controls have. */
.heat-point:focus-visible,
.heat-place:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

.heat-place--carrier {
  background: var(--marker-carrier);
}

.heat-place--plant {
  background: var(--marker-plant);
}

.heat-places {
  margin-top: 8px;
}

/* Full screen: the block of filters and map laid over the whole window. The
   same rule serves the browser's own full screen and the fallback without it
   (or without JavaScript), so both look alike. Above Leaflet's panes and
   controls, whose z-index reaches 1000 -- isolated inside the map now (see
   `.leaflet-container`), so 2000 is what lifts the block over the header,
   its open menu included. */
.heat-stage.is-full-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: auto;
  background: var(--surface-muted);
}

/* In full screen the frame takes the window's height and passes it to the
   map, and the link to jump past the map is not offered: what follows the
   map is inert under the block. */
.heat-stage.is-full-screen .heat-map-frame {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 320px;
}

.heat-stage.is-full-screen .heat-skip {
  display: none;
}

.heat-stage.is-full-screen .heat-map {
  flex: 1 1 auto;
  min-height: 320px;
  height: auto;
  margin-bottom: 0;
}

/* The key keeps its height and the map takes what is left of the window:
   under it in a column on a phone, beside it in the grid from 1024px. */
.heat-stage.is-full-screen .heat-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 320px;
}

.heat-stage.is-full-screen .heat-key {
  flex: none;
  margin: 8px 0 0;
}

@media (min-width: 1024px) {
  .heat-stage.is-full-screen .heat-view {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    margin-bottom: 0;
  }

  .heat-stage.is-full-screen .heat-key {
    margin: 0;
  }
}

body:has(.heat-stage.is-full-screen) {
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   «Ubicación»: the small map where a branch places its point. Small on
   purpose -- it locates one yard, not a region -- and fixed in height so the
   fields under it stay in reach on a phone.
   ------------------------------------------------------------------------- */

/* Google's map, not Leaflet's (branch_location.js says why), so
   `.leaflet-container`'s isolation above does not reach it: it is isolated
   here, for the same reason -- Google stacks its own layers and controls
   with z-indexes of its own choosing, which must not compete with the open
   header menu. `overflow: hidden` keeps Google's square layers inside the
   rounded corners. */
.location-map {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 280px;
  margin: 24px 0 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* Under the slot that reports on it, the map closes up to it. */
.location-guide + .location-map {
  margin-top: 8px;
}

/* The map is a keyboard stop on which Enter places the point at its centre
   (branch_location.js says why). The stop is Google's own element inside
   the box, so the ring goes on the box while that element has keyboard
   focus: the frame's ring (`.btn:focus-visible`), outside the rounded
   border, so the map reads as the control it is. Not `:focus-within`,
   which would also ring the box while a mouse drags the marker. */
.location-map:has([role="region"]:focus-visible) {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* The point: a disk, as DESIGN.md has every map marker, in the brand's
   green with a white rim and the markers' dark edge, so it reads on the
   streets and on satellite alike. Google anchors a marker's content by its
   bottom edge's middle; moved down by half its height, the disk's centre
   is what sits on the point. */
.location-marker {
  width: 18px;
  height: 18px;
  background: var(--brand-700);
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--marker-edge);
  transform: translateY(50%);
}

/* Where a search landed: a hollow ring, so it cannot be read as the point,
   which is the filled disk. Nothing to press, so every pointer goes through
   it to the map under it, and a click on the place itself marks the point
   there. Anchored as the disk is. */
.location-found {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 2px solid var(--brand-700);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px var(--surface),
    inset 0 0 0 1px var(--surface);
  transform: translateY(50%);
  pointer-events: none;
}

/* What Enter places the point under: a cross at the map's centre, over the
   map and its marker, shown only while a keyboard is on the map. Drawn in
   the markers' dark edge (`--marker-edge`) with a white rim so it reads on
   any tile. The box is isolated, so this z-index competes only with
   Google's layers inside it, all of which it must sit above; it lets every
   pointer through to them. */
.location-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1000000;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  pointer-events: none;
  opacity: 0;
}

.location-crosshair::before,
.location-crosshair::after {
  position: absolute;
  content: "";
  background: var(--marker-edge);
  outline: 1px solid var(--surface);
}

.location-crosshair::before {
  top: 13px;
  left: 0;
  width: 28px;
  height: 2px;
}

.location-crosshair::after {
  top: 0;
  left: 13px;
  width: 2px;
  height: 28px;
}

/* `is-keyboard` is set by branch_location.js, which says why it is not
   `:focus-visible`. */
.location-map.is-keyboard .location-crosshair {
  opacity: 1;
}

/* «Usar mi ubicación actual»: a quiet button, because the green fill is the
   save's, and the save is still the one action that writes. 24px clear of
   the note above, as a note stands clear of what precedes it. 44px tall
   where the pointer is a finger (the media query below). */
.location-locate {
  margin-top: 24px;
}

/* `.btn`'s `display: inline-flex` outweighs the `hidden` attribute the
   button is served with until the script knows it can work. */
.location-locate[hidden] {
  display: none;
}

/* Where the pointer is a finger, the device's reading is the best input
   the visitor has -- they are usually standing in the yard -- so the
   button takes the full width and the thumb, while staying quiet: the
   green fill is the save's. */
@media (pointer: coarse) {
  .location-locate {
    width: 100%;
    min-height: 44px;
  }
}

/* The address search (branch_location.js): Google's input under a label
   set like a field's. 24px clear of what precedes it, as the locate button
   is, and 16px under the button when both show. Google draws the input
   itself; its width is the column's. */
.location-search {
  margin-top: 24px;
}

.location-locate:not([hidden]) + .location-search {
  margin-top: 16px;
}

.location-search-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

/* `color-scheme: light` because Google's element declares `light dark` and
   the product has no dark theme: on a machine set to dark it drew a black
   bar and a black list on the page's white, heavier than the title and the
   save (seen on beta in November 2026). Inherited into its shadow root, so
   it reaches the list too. The edge, corners and ring are the page's
   fields'; what is inside the closed shadow root is Google's. */
.location-search-box {
  display: block;
  width: 100%;
  color-scheme: light;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.location-search-box:focus-within {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* How to place the point and what the map just did, one over the other in
   the same cell (the template says why they share it). The hint keeps its
   place while a status stands over it, `visibility` and not `display`, so
   the cell does not change height and the map under it does not move, and
   a reference to a hidden element still describes the map to a screen
   reader. 75ch keeps the hint's measure; the status's box takes the
   column. */
/* The heights are a two-line status's on the desktop column and a
   four-line one's on a phone, its usual lengths (measured): the hint alone
   was 7px shorter, enough to move the map on the first click. */
.location-guide {
  display: grid;
  min-height: 62px;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .location-guide {
    min-height: 102px;
  }
}

.location-guide > * {
  grid-area: 1 / 1;
  margin: 0;
}

.location-guide > .hint {
  max-width: 75ch;
}

.location-guide:has(.location-status:not(:empty)) > .hint {
  visibility: hidden;
}

/* What is recorded on one line, with the way to remove it at the line's
   end: this card was as tall as the search and the slot together, and put
   the map at the fold. */
.location-summary {
  flex-flow: row wrap;
  align-items: center;
  gap: 4px 24px;
  margin: 14px 0 0;
  padding: 10px 16px;
}

.location-summary .summary-list {
  flex-flow: row wrap;
  gap: 4px 24px;
}

.location-summary .summary-row {
  justify-content: flex-start;
  gap: 8px;
}

.location-summary .location-remove {
  align-self: center;
  margin-left: auto;
}

/* Whether the map places the branch by this point: text under the record
   it is about, not a box of its own beside it. */
.location-note {
  margin: 8px 0 0;
  padding: 0;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 0;
}

/* The fields under the map, 16px clear of it. */
.location-form {
  margin-top: 16px;
}

/* A read-only account's page when nothing is recorded: who records the
   point, where the map would be. */
.location-absent {
  margin: 24px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* The error summary under the page's meta line, as clear of it as the
   summary card is (`.summary-card`'s 18px), not the 8px the line leaves. */
.meta-line + .error-summary {
  margin-top: 18px;
}

/* What the map just did, said in words (branch_location.js), in the slot
   above the map (`.location-guide`). In the info
   tone rather than a hint's grey, because it is news about the form, not
   a standing explanation; the warning tone when the map asked for a second
   look (a click from too far, a wide device reading, a refused reading).
   Collapsed while empty, but never `display: none`, which would take the
   live region out of the page and its first message out of the screen
   reader's hearing. */
.location-status {
  font-size: 13px;
  line-height: 1.5;
  color: var(--info-text);
}

.location-status:not(:empty) {
  padding: 10px 14px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: 10px;
}

.location-status[data-tone="warning"]:not(:empty) {
  color: var(--warning-text);
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

/* The line over the two buttons that says whether the save would change
   anything, and offers the way back. A whole row of the actions, its height
   reserved so that nothing appearing in it moves the save: beside the
   buttons, in a narrow column, the pill wrapped them and pushed the save
   49px down. Two lines' worth where the longer pill and the way back no
   longer fit on one. */
.location-changes {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  min-height: 30px;
}

@media (max-width: 720px) {
  .location-changes {
    min-height: 62px;
  }
}

/* A button that reads as the card's link beside it, because it is the same
   quiet kind of thing: the fills are the save's and Cancelar's. 24px tall
   for WCAG 2.5.8. `display` outweighs the `hidden` attribute, hence the
   second rule. */
.location-restore {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0;
  font-size: 13px;
  color: var(--brand-700);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  border: 0;
}

.location-restore[hidden] {
  display: none;
}

.location-restore:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* «Cambios sin guardar», or after a search that no mark followed, «Aún sin
   marcar»: a pill in the warning tone, like the other states. In the actions
   row, which nothing on the map depends on, so its appearing moves nothing
   the visitor is aiming at (on the summary card it pushed the map 40px down
   between two clicks). */
.location-pending {
  margin: 0;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warning-text);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 9999px;
}

/* The way to remove the recorded point, on the card that shows it: a link
   to its confirmation page (BranchLocationRemove), quiet because removing
   is the rare case and the page it opens is where the red is. 24px tall
   for WCAG 2.5.8. */
.location-remove {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  align-self: flex-start;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* «Sin registrar» is an absence, not a figure: in the page's text rather
   than the bold mono of a recorded coordinate. */
.summary-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* The private-mode page: what the mode hides and what it does not, as two
   short lists, so neither reads as a footnote of the other. */
.private-mode-scope {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* A generator's operational notes, on its own page and on the sistema de
   gestión's network screens: free text typed by the company, so a long word
   or a pasted URL wraps instead of widening the page past a phone's screen. */
.operational-notes {
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* The printable ficha (templates/traceability/movement_print.html): the
   bar above the document, and the route as a numbered list of legs, each
   leg's facts one per line. A refused leg is marked as the ficha's notice
   is, in red, so the refusal stands out on paper as it does on screen. */
.rm-print-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  max-width: 720px;
  margin: 0 auto 16px;
}

.rm-route ol {
  margin: 0;
  padding-left: 22px;
  font-size: 13px;
}

.rm-route li {
  margin-bottom: 12px;
}

.rm-route li > strong,
.rm-route li > span {
  display: block;
}

.rm-route-rejection {
  color: var(--error-strong);
}

/* ---------------------------------------------------------------------------
   Printing. The monthly bulletin (templates/reporting/bulletin.html) is
   printed by the browser -- its «Imprimir» is how it becomes a PDF, since no
   PDF is generated on the server -- so a printed page drops what only works
   on screen: the app's header with its navigation, and anything marked
   ``no-print`` (the month selector, the download link). Cards lose their
   shadow and padding so the tables use the paper's width, and a scrolling
   table is printed whole rather than clipped. Written for every page rather
   than for the bulletin's alone: no printed page needs the navigation. The
   movement's printable ficha (templates/traceability/movement_print.html)
   is printed the same way.
   ------------------------------------------------------------------------- */

@media print {
  body {
    background: var(--surface);
  }

  /* No `!important`: this query is the last rule for both selectors, and
     every element marked `no-print` (bulletin.html) is styled by one class
     at most, so the later rule of equal or higher specificity wins without
     it. A `no-print` on something a more specific rule displays would need
     it back, and test_frame.py fails if the marked elements change. */
  .app-header,
  .no-print {
    display: none;
  }

  .card {
    box-shadow: none;
    padding: 0;
    break-inside: avoid;
  }

  .card + .card {
    margin-top: 24px;
  }

  .table-scroll {
    overflow: visible;
  }

  .bulletin-table tr {
    break-inside: avoid;
  }

  /* The printable ficha uses the paper's width, and no leg of its route or
     line of its CDF is split across two pages. */
  .rm-print {
    max-width: none;
    padding: 0;
    box-shadow: none;
  }

  .rm-route li,
  .rm-line {
    break-inside: avoid;
  }
}
