/* RMA Airlines in the RMA brand (rma/brand GUIDELINES.md 7). Colours, type and chrome come
   from the vendored brand files, in this order: brand/fonts/fonts.css, brand/brand.css,
   brand/rma-ui.css (BRAND_VERSION says which rma/brand commit). Nothing here writes a colour:
   only the brand's variables. Light and dark follow the system.

   The airline's stylesheets, each page loads base.css and one of:
     public.css  the public site (home, booking, boarding pass, status, timetable, tracking)
     crew.css    the crew area (OCC, crew flight, dispatch, logs)
     efb.css     the iPad EFB
   base.css holds the tokens, the page layout (header, nav, main, footer, page head) and the
   components more than one area uses.

   Two scales, and nothing off them:
   - spacing: --space-1..6 = 4, 8, 12, 16, 24, 32 px; one page gutter (--gutter: 24 px, 16 px
     under 640 px) that the header, page heads, cards and footer all start at;
   - type: the brand's steps only (GUIDELINES.md 5), as --rma-text-xs..4xl:
     12, 14, 16, 18, 20, 24, 30, 48 px.
   JetBrains Mono is for codes and figures only (flight numbers, registrations, times, amounts),
   never for words people read as text.

   Two densities. Touch screens (the iPad, phones) take the sizes above: 16 px text, 44 px
   controls. A desktop, a mouse or trackpad ((hover: hover) and (pointer: fine), a Mac at
   1280-1728 px), is denser (owner, 2026-11-15: "on ipad it looks fine ... but on mac it looks
   weird"): the block at the end of this file moves the brand's text steps one notch down
   (body 15, the size of rma-ui.css's own cards and tables; md 16, lg 17, xl 20, H1 24; sm and
   xs stay 14 and 12), controls to 36 px (--ctl), table rows to about 34 px, and cards and the
   gaps between blocks one spacing step tighter. Each area's stylesheet has its own such block. */

:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --gutter: var(--space-5);
  --tap: 44px;
  --ctl: var(--tap); /* a control's height: the touch target, 36 px on a desktop (below) */
  /* What map.js reads for the canvas (resolved colours, no color-mix). */
  --map: var(--rma-ui-inset); --map-line: var(--rma-ui-edge); --map-route: var(--rma-ui-box);
  --ink: var(--rma-ui-strong); --muted: var(--rma-ui-muted); --accent: var(--rma-ui-accent);
  --ok: var(--rma-ui-success); --warn: var(--rma-ui-warning);
}
@media (max-width: 639px) { :root { --gutter: var(--space-4); } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--rma-ui-ground); }
/* The corner wire art of rma-ui.css would sit under the header's text; the home page shows it
   in its own column instead (GUIDELINES.md 13). */
.rma-ground::before { content: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--rma-font-display); color: var(--rma-ui-strong); text-wrap: balance; }
h1 { font-size: var(--rma-text-2xl); line-height: var(--rma-leading-2xl); font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: var(--rma-text-xl); line-height: var(--rma-leading-xl); font-weight: 600; }
h3 { font-size: var(--rma-text-lg); line-height: var(--rma-leading-lg); font-weight: 500; }
p { margin: 0; max-width: var(--rma-measure, 68ch); }
a { color: var(--rma-ui-accent-text); text-underline-offset: 2px; }
/* Codes and figures: JetBrains Mono at the Mono step, tabular. Only on codes and figures. */
code, .mono { font-family: var(--rma-font-mono); font-size: var(--rma-text-sm); font-weight: 400; font-variant-numeric: tabular-nums; }
.muted { color: var(--rma-ui-muted); }
.stack { display: grid; gap: var(--space-4); align-content: start; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: baseline; }
.k { color: var(--rma-ui-muted); }
.label { font: 500 var(--rma-text-xs)/var(--rma-leading-xs) var(--rma-font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--rma-ui-muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--rma-ui-accent); outline-offset: 2px; }

/* ---- Header: the RMA mark and the product name in Lexend 600 (GUIDELINES.md 7, Header) ----
   Full width and one tone with the ground; its content starts and ends on the gutter. */
/* Opaque: the page's text never shows through the sticky header (the brand's rma-glass is translucent). */
.top { position: sticky; top: 0; z-index: 10; margin: 0; border-radius: 0; flex-wrap: nowrap; gap: var(--space-2) var(--space-5); justify-content: space-between;
  padding: var(--space-2) max(var(--gutter), env(safe-area-inset-right, 0px)) var(--space-2) max(var(--gutter), env(safe-area-inset-left, 0px));
  font-size: var(--rma-text-base); }
.top.rma-glass { background: var(--rma-ui-ground); border: 0; border-bottom: 1px solid var(--rma-ui-line); }
.brand { display: inline-flex; flex: none; align-items: center; gap: var(--space-3); min-height: var(--ctl); text-decoration: none; color: var(--rma-ui-strong);
  font: 600 var(--rma-text-lg)/1 var(--rma-font-display); }
.brand img { display: block; height: 28px; width: auto; }
.brand .tag { font: 500 var(--rma-text-sm) var(--rma-font-display); color: var(--rma-ui-muted); }
/* The nav: 44 px targets in one row; the links' own padding hangs outside the gutter so their
   text lines up with it. Under 640 px it is its own row under the mark and scrolls sideways. */
.top nav { display: flex; flex-wrap: nowrap; gap: 0; margin-right: calc(-1 * var(--space-3)); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { display: inline-flex; flex: none; align-items: center; min-height: var(--ctl); padding: 0 var(--space-3); border-radius: 8px; white-space: nowrap;
  color: var(--rma-ui-muted); text-decoration: none; transition: background-color .12s, color .12s; }
.top nav a:hover { background: var(--rma-ui-hover); color: var(--rma-ui-strong); }
.top nav a[aria-current="page"] { color: var(--rma-ui-accent-text); background: var(--rma-ui-accent-nav); font-weight: 600; }
.top nav a:focus-visible { outline-offset: -2px; }
/* Under 900 px the nav is a row of tabs under the mark: the text starts on the gutter and the page
   it is on is underlined, under its text only, so nothing starts left of the gutter. */
@media (max-width: 899px) {
  .top { flex-wrap: wrap; row-gap: 0; padding-bottom: 0; }
  .top nav { flex-basis: 100%; margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - var(--space-3)); }
  .top nav a { position: relative; border-radius: 0; }
  .top nav a[aria-current="page"] { background: none; }
  .top nav a[aria-current="page"]::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 0;
    height: 2px; border-radius: 1px; background: var(--rma-ui-accent); }
}

main { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr);
  padding: var(--space-5) max(var(--gutter), env(safe-area-inset-right, 0px)) var(--space-6) max(var(--gutter), env(safe-area-inset-left, 0px)); }
footer { padding: var(--space-5) max(var(--gutter), env(safe-area-inset-right, 0px)) var(--space-6) max(var(--gutter), env(safe-area-inset-left, 0px));
  color: var(--rma-ui-muted); font-size: var(--rma-text-sm); }

/* ---- Page heads: every page opens with its H1 here, on the gutter ---- */
.pagehead { display: grid; gap: var(--space-2); padding: 0; }
.pagehead .rma-subtitle { max-width: 75ch; text-wrap: pretty; }
.pagehead .btns { margin-top: var(--space-2); }
.rma-subtitle b { font-family: var(--rma-font-mono); font-weight: 500; font-size: var(--rma-text-base); }

/* ---- The brand's components on the airline's two scales (rma-ui.css, which is vendored and
   never edited, carries a few in-between sizes: 7, 9, 10, 18, 20 px spacing, 13, 15, 17 px type). */
.rma-topbar { font-size: var(--rma-text-base); }
.rma-subtitle { margin: 0; font-size: var(--rma-text-md); line-height: var(--rma-leading-md); }
.rma-card { padding: var(--space-5); gap: var(--space-3); font-size: var(--rma-text-base); line-height: var(--rma-leading-base); }
.rma-card-head { gap: var(--space-1) var(--space-4); }
.rma-card-note { font-size: var(--rma-text-sm); }
.rma-card-foot { gap: var(--space-2) var(--space-4); padding-top: var(--space-3); font-size: var(--rma-text-sm); }
.rma-card-figure.is-quiet { font-size: var(--rma-text-sm); }
.rma-line { padding: var(--space-2) 0; }
.rma-line small { margin-left: var(--space-2); font-size: var(--rma-text-xs); }
.rma-cards, .rma-cards-col { gap: var(--space-4); }
.rma-section-head { margin: var(--space-2) 0 0; gap: var(--space-2) var(--space-3); font-size: var(--rma-text-base); }
/* In main's grid (24 px between blocks) a section head sits 12 px above its cards and 32 px below
   what came before, so it reads as their heading, not as a block of its own. */
main > .rma-section-head { margin: var(--space-2) 0 calc(var(--space-3) - var(--space-5)); }
.rma-empty { padding: var(--space-6) var(--space-5); }
.rma-empty p { margin: 0 auto var(--space-4); }
.rma-field { font-size: var(--rma-text-base); padding: var(--space-2) var(--space-3); }
.rma-btn { padding: var(--space-2) var(--space-3); }
.rma-btn-lg { font-size: var(--rma-text-base); padding: var(--space-2) var(--space-4); }
.rma-chip { padding: var(--space-1) var(--space-3); }
@media (max-width: 639px) { .rma-card { padding: var(--space-4); } }

/* A title with its meta: when the meta wraps it starts on the title's edge, not 8 px in. */
.rma-card-title:has(> .rma-card-meta) { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); }
.rma-card-title > .rma-card-meta { margin-left: 0; }
/* Status in a card's head sits on the right of the title's line, like rma-card-state. */
.rma-card-head > .st, .rma-card-head > .rma-card-meta { grid-column: 2; grid-row: 1; }

/* ---- Cards (rma-ui.css) and the airline's few additions ---- */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.narrow { max-width: 560px; width: 100%; }
a.rma-card { text-decoration: none; color: var(--rma-ui-ink); }
a.rma-card:hover { border-color: var(--rma-ui-box); }
a.rma-card .rma-card-title { color: var(--rma-ui-accent-text); }
/* The map card: the canvas runs to the card's edges, the head keeps the card's padding. */
.map-card { padding: 0; overflow: hidden; gap: 0; }
.map-card .rma-card-head { padding: var(--space-5) var(--space-5) var(--space-4); }
@media (max-width: 639px) { .map-card .rma-card-head { padding: var(--space-4) var(--space-4) var(--space-3); } }
/* Title left, meta right while both fit; a long meta ("5 aircraft (1 position pending), 13:50 UTC") goes
   whole onto a second line under the title, never squeezing the title into a column. */
.map-card .rma-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
.map-card .rma-card-head > .rma-card-title { flex: 0 1 auto; }
.map { width: 100%; aspect-ratio: 16 / 11; display: block; background: var(--map); }

/* ---- Tables inside one card (the brand's exception for long lists). The first and last
   columns sit on the card's padding, so a table's text lines up with the card's title. ---- */
.rma-card.rma-panel-table { padding: var(--space-2) var(--space-5) var(--space-3); }
.rma-panel-table .rma-card-head { padding: var(--space-4) 0 var(--space-2); }
@media (max-width: 639px) {
  .rma-card.rma-panel-table { padding: var(--space-1) var(--space-4) var(--space-2); }
  .rma-panel-table .rma-card-head { padding: var(--space-3) 0 var(--space-2); }
}
.rma-table { font-size: var(--rma-text-sm); }
.rma-table th { padding: var(--space-3) var(--space-3) var(--space-2); font-size: var(--rma-text-sm); white-space: nowrap; }
.rma-table td { padding: var(--space-2) var(--space-3); vertical-align: top; }
.rma-table :is(th, td):first-child { padding-left: 0; }
.rma-table :is(th, td):last-child { padding-right: 0; }
.rma-table .m { font-family: var(--rma-font-mono); font-size: var(--rma-text-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rma-table .num { text-align: right; }
.scroll { overflow-x: auto; }
.t { min-width: 560px; }

/* The departures board (macros.board): the public home and the OCC. */
.board-wrap { overflow: auto; max-height: 560px; }
.board { min-width: 520px; }
.board th { position: sticky; top: 0; background: var(--rma-ui-panel); }
.board tr[data-id] { cursor: pointer; }
.board tr.sel td { background: var(--rma-ui-accent-sel); }
.board a { color: var(--rma-ui-strong); text-decoration: none; font-weight: 600; }
.flown { margin-left: var(--space-2); font: 400 var(--rma-text-xs) var(--rma-font-text); color: var(--rma-ui-accent-text); }
.late { color: var(--rma-ui-warning); font-weight: 600; }

/* Lines of figures: label left, figure right (rma-card-lines). Where there are many, two fixed
   columns from 640 px, so every row lines up across the card; one column on phones. */
.lines-2 { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--space-6); }
.lines-2 .rma-line:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 640px) {
  .lines-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lines-2 .rma-line:nth-child(2) { border-top: 0; padding-top: 0; }
}

/* Status: a 7 px dot and a word, neutral by default; only the exception takes colour. */
.st { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; font-size: var(--rma-text-sm); color: var(--rma-ui-muted);
  text-transform: lowercase; --dot: var(--rma-ui-box); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); flex: none; }
.s-air { color: var(--rma-ui-strong); --dot: var(--rma-ui-chart-a); }
.s-board { color: var(--rma-ui-ink); --dot: var(--rma-ui-accent); }
.s-ok { --dot: var(--rma-ui-success); }
.s-late { color: var(--rma-ui-warning); font-weight: 600; --dot: var(--rma-ui-warning); }
.s-bad { color: var(--rma-ui-danger); font-weight: 600; --dot: var(--rma-ui-danger); }
.st.live { text-transform: none; }

/* Feedback where the change happened: a line of text, no box, no stripe. */
.note, .err, .ok-note { margin: 0; font-size: var(--rma-text-base); }
.note { color: var(--rma-ui-ink); }
.err { color: var(--rma-ui-danger); font-weight: 600; }
.ok-note { color: var(--rma-ui-success); }

/* ACARS and route strings, as the aircraft prints them: monospace text, never a box. */
.acars { margin: 0; font: 400 var(--rma-text-sm)/1.6 var(--rma-font-mono); color: var(--rma-ui-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
progress { width: 100%; height: 6px; border: 0; border-radius: 99px; background: var(--rma-ui-inset); overflow: hidden; -webkit-appearance: none; appearance: none; }
progress::-webkit-progress-bar { background: var(--rma-ui-inset); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--rma-ui-accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--rma-ui-accent); border-radius: 99px; }

/* ---- Forms: rma-field, rma-check, rma-btn ---- */
form.f { display: grid; gap: var(--space-4); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: var(--space-3) var(--space-4); align-items: end; }
label { display: grid; gap: var(--space-1); font-size: var(--rma-text-sm); color: var(--rma-ui-muted); }
label.check { display: flex; gap: var(--space-3); align-items: center; color: var(--rma-ui-ink); font-size: var(--rma-text-base); }
.rma-field { width: 100%; min-width: 0; min-height: 40px; }
@media (pointer: coarse) { .rma-field { min-height: var(--tap); } }
.btns { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.btns form { display: contents; }
.rma-btn { justify-content: center; }
fieldset { border: 0; border-top: 1px solid var(--rma-ui-line); padding: var(--space-4) 0 0; margin: 0; min-width: 0; display: grid; gap: var(--space-3); }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { padding: 0 0 var(--space-2); font: 500 var(--rma-text-base) var(--rma-font-display); color: var(--rma-ui-strong); float: left; width: 100%; }

/* ---- Desktop density (see the head of this file). Touch screens never match this. ---- */
@media (hover: hover) and (pointer: fine) {
  :root { --ctl: 36px;
    --rma-text-base: .9375rem; --rma-text-md: 1rem; --rma-text-lg: 1.0625rem; --rma-text-xl: 1.25rem; --rma-text-2xl: 1.5rem; }
  body, .rma-ground { font-size: var(--rma-text-base); }
  .brand img { height: 24px; }
  .top nav a { font-size: var(--rma-text-sm); }
  main { gap: var(--space-4); padding-top: var(--space-4); }
  /* The section head: 8 px above its cards, 24 px below what came before (main's gap is 16 here). */
  main > .rma-section-head { margin: var(--space-2) 0 calc(var(--space-2) - var(--space-4)); }
  footer { padding-top: var(--space-4); }
  .rma-card { padding: var(--space-4); line-height: 1.5; }
  /* A line of figures: 6 px above and below (the brand's own 7 px, on the half step of the scale). */
  .rma-line { padding: calc(var(--space-1) * 1.5) 0; }
  .map-card { padding: 0; }
  .map-card .rma-card-head { padding: var(--space-4) var(--space-4) var(--space-3); }
  .rma-card.rma-panel-table { padding: var(--space-1) var(--space-4) var(--space-2); }
  .rma-panel-table .rma-card-head { padding: var(--space-3) 0 var(--space-1); }
  .rma-cards, .rma-cards-col, .grid2, .stack { gap: var(--space-3); }
  .rma-table th { padding: var(--space-2) var(--space-3); line-height: 1.3; }
  .rma-table td { line-height: 1.25; }
  .rma-empty { padding: var(--space-5) var(--space-4); }
  .rma-field { min-height: var(--ctl); padding: var(--space-1) var(--space-3); }
  .rma-btn { min-height: var(--ctl); padding: var(--space-1) var(--space-3); }
  .rma-btn-lg { padding: var(--space-1) var(--space-4); }
  form.f { gap: var(--space-3); }
  .fields { gap: var(--space-3); }
  fieldset { padding-top: var(--space-3); gap: var(--space-2); }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
