/* ============================================================
   OPR8: the road-sign system.
   Machines are guide signs (navy panel, white keyline, orange fleet-number tab).
   State uses the sign families: guide = navy, warning = yellow diamond,
   regulatory = red ring, ok = green. It is never shown by colour alone:
   each state also has a shape, a word and a line form (solid, dashed, struck).
   Dark by default; field screens get a high-contrast version for sunlight;
   a phone can opt into light mode. Signs stay navy in every mode.
   ============================================================ */

@font-face { font-family: "Overpass"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/overpass-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/overpass-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Overpass"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("/fonts/overpass-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Overpass's middle dot sits off-centre ("a ·b"); the app separates details with " · ", so take that one glyph from the system font */
@font-face { font-family: "OPR8 Dot"; src: local("Segoe UI"), local("Helvetica Neue"), local("Roboto"), local("Arial"); unicode-range: U+00B7; }

/* ---------------- tokens ---------------- */
:root {
  font-size: 14px;
  --tap: 52px; --radius: 10px; --radius-lg: 14px;
  /* fixed brand and sign colours: the same in every mode */
  --sign: #14254a; --sign-deep: #0e1b38; --sign-ink: #ffffff; --sign-muted: #c9d3e5; --keyline: #ffffff;
  --orange: #f08a24; --orange-hi: #f7a04a; --on-orange: #0b1220;
  --yellow: #ffcc00; --red: #c8102e; --green: #1e8e4e;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 12.5 5 5L19.5 7'/%3E%3C/svg%3E");
  --font: "OPR8 Dot", "Overpass", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* light mode (a phone switched to light, and printing) */
body {
  --ground: #eef1f6; --surface: #ffffff; --surface-2: #f3f5f9; --field: #ffffff;
  --ink: #0b1220; --muted: #4a5670; --line: #d2d9e4; --line-strong: #8a97ad;
  --ok: #146c37; --ok-bg: #e1f2e7; --bad: #b0141f; --bad-bg: #fde7e6; --warn: #6b4e00; --warn-bg: #fff3c4; --info-bg: #e7ecf6;
  --link-line: var(--orange); --panel-key: rgba(20,37,74,.32);
}
body.theme-dark {
  --ground: #0b1220; --surface: #121c30; --surface-2: #19253d; --field: #0d1628;
  --ink: #f2f5fa; --muted: #a8b3c8; --line: #25324c; --line-strong: #44557a;
  --ok: #4fd68a; --ok-bg: #0f2c1c; --bad: #ff6b6e; --bad-bg: #3a1117; --warn: #ffd43b; --warn-bg: #2c2508; --info-bg: #14254a; --panel-key: rgba(255,255,255,.26);
  color-scheme: dark;
}
/* field screens: outdoors, in sun. Brighter text, stronger lines, solid surfaces. */
body.theme-dark.field { --ink: #ffffff; --muted: #d4dbe8; --line: #3a4a6c; --line-strong: #7d8db0; --surface: #13203a; --panel-key: rgba(255,255,255,.5); }
body.field:not(.theme-dark) { --muted: #36425a; --line: #b5c0d1; --line-strong: #4a5670; }

/* ---------------- base ---------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--ground); color: var(--ink); font: 400 1rem/1.45 var(--font);
  font-feature-settings: "kern"; caret-color: var(--orange); scrollbar-color: var(--line-strong) transparent; }
body.field { font-size: 15px; }
::selection { background: var(--orange); color: var(--on-orange); }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { font-family: var(--font); line-height: 1.15; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; margin: .4rem 0 .9rem; }
h2 { font-size: 1.18rem; font-weight: 800; margin: 1.5rem 0 .55rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 1rem 0 .35rem; }
p { margin: .6rem 0; }
strong { font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.pad { padding: 1rem; }
[hidden] { display: none !important; }

/* icons: drawn line icons from app.js, one stroke weight */
.ico { width: 20px; height: 20px; flex: 0 0 auto; }
.btn .ico, button .ico { width: 20px; height: 20px; }

/* ---------------- top bar: the sign gantry ---------------- */
header#top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .7rem;
  background: var(--sign); color: var(--sign-ink); padding: calc(.5rem + env(safe-area-inset-top)) .9rem .5rem;
  border-bottom: 2px solid var(--keyline); min-height: 60px; }
.brand { color: var(--sign-ink); text-decoration: none; font-weight: 800; font-size: 1.12rem; display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }
.brand #biz { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .wordmark { color: var(--sign-ink); line-height: 0; }
.wordmark-svg { height: 25px; width: auto; display: block; }
img.logo { width: 34px; height: 34px; border-radius: 8px; display: block; }
img.logo.company { width: auto; max-width: 132px; height: 32px; object-fit: contain; background: #fff; padding: 3px 6px; border-radius: 6px; }
@media (max-width: 420px) { img.logo.company { max-width: 96px; } }
.net { font-size: .82rem; font-weight: 800; padding: .25rem .6rem; border-radius: 6px; white-space: nowrap; }
.net.off { background: var(--yellow); color: #0b1220; }
.net.off::before { content: ""; display: inline-block; width: .6rem; height: .6rem; background: #0b1220; transform: rotate(45deg); margin-right: .45rem; vertical-align: .05em; }
.net.pending { background: transparent; color: var(--sign-ink); border: 2px dashed var(--sign-ink); }
.iconbtn { background: none; border: 0; color: var(--sign-ink); font-size: 1.5rem; min-width: 48px; min-height: 48px; cursor: pointer; border-radius: 8px; }
header#top .iconbtn { box-shadow: inset 0 0 0 2px var(--keyline); background: transparent; }
header#top .iconbtn:hover { background: rgba(255,255,255,.08); }
.top-action { min-height: 42px; padding: .35rem .95rem; font-size: .95rem; white-space: nowrap; }
.user-chip { display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .75rem .25rem .3rem; border-radius: 99px;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); color: var(--sign-ink); max-width: 220px; }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .82rem;
  background: var(--sign-ink); color: var(--sign); flex: 0 0 auto; }
.user-chip .who { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.user-chip .who strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: .74rem; color: var(--sign-muted); text-transform: capitalize; }
@media (max-width: 767px) { .top-action, .user-chip .who { display: none !important; } .user-chip { padding: .2rem; } }

/* ---------------- menu: the route list ---------------- */
nav#menu { position: sticky; top: 60px; z-index: 9; background: var(--sign-deep); display: flex; flex-direction: column; padding: .4rem; gap: .2rem;
  border-bottom: 2px solid var(--keyline); }
nav#menu[hidden] { display: none; }
nav#menu a, nav#menu .theme-switch { display: flex; align-items: center; gap: .75rem; color: var(--sign-ink); text-decoration: none; padding: .8rem 1rem;
  border-radius: 10px; min-height: 48px; font-weight: 600; }
nav#menu a:hover, nav#menu .theme-switch:hover { background: rgba(255,255,255,.07); }
nav#menu a.on { font-weight: 800; box-shadow: inset 0 0 0 2px var(--keyline); background: var(--sign); }
nav#menu a.on .ico { color: var(--orange); }
nav#menu .theme-switch { width: 100%; justify-content: flex-start; text-align: left; background: transparent; border: 0; font: 600 .95rem var(--font);
  color: var(--sign-muted); margin-top: .2rem; border-top: 1px solid rgba(255,255,255,.12); border-radius: 0 0 10px 10px; box-shadow: none; }
@media (min-width: 768px) {
  body.staff nav#menu { position: fixed; top: 0; bottom: 0; left: 0; width: 76px; padding: 70px .6rem .8rem; gap: .25rem;
    display: flex !important; overflow-y: auto; border-bottom: 0; border-right: 2px solid var(--keyline); }
  body.staff main { margin-left: 76px; }
  body.staff #menuBtn { display: none; }
  body.staff nav#menu a, body.staff nav#menu .theme-switch { justify-content: center; padding: .7rem 0; min-height: 46px; }
  body.staff nav#menu a span, body.staff nav#menu .theme-switch span { display: none; }
  body.staff nav#menu .ico { width: 22px; height: 22px; }
  body.staff nav#menu .theme-switch { margin-top: auto; border-top: 0; border-radius: 10px; }
  .top-action:not([hidden]) { display: inline-flex !important; }
  .user-chip .who { display: flex !important; }
  .hide-desktop { display: none !important; }
}
@media (min-width: 768px) and (max-width: 899px) { .user-chip .who { display: none !important; } }
@media (min-width: 1200px) {
  body.staff nav#menu { width: 240px; padding: 72px .7rem .8rem; }
  body.staff main { margin-left: 240px; }
  body.staff nav#menu a, body.staff nav#menu .theme-switch { justify-content: flex-start; padding: .65rem .9rem; }
  body.staff nav#menu a span, body.staff nav#menu .theme-switch span { display: inline; }
}

/* ---------------- layout ---------------- */
main { max-width: 860px; margin: 0 auto; padding: 1.1rem 1rem 5rem; outline: none; }
main:focus-visible { outline: none; } /* focus moves here on each screen change for screen readers; no ring */
@media (min-width: 900px) { body.staff main { max-width: none; } body.staff main > * { max-width: 1240px; } }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
/* every panel carries the one 2px keyline, inset from its edge. Signs (the machine) get it in full white;
   containers get it at reduced strength so they never compete with a sign. Tiles nested in a panel get none. */
.card { background: var(--surface); border: 0; border-radius: var(--radius-lg); padding: 1.05rem 1.15rem; margin: 0 0 1rem;
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--panel-key); }
a.blocklink { display: block; text-decoration: none; color: inherit; }
a.card.blocklink:hover { box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--line-strong); }

/* ---------------- the machine as a guide sign ---------------- */
.sign { position: relative; background: var(--sign); color: var(--sign-ink); border-radius: var(--radius-lg);
  padding: 1.9rem 1.15rem 1.15rem; margin: 1.2rem 0 1rem;
  box-shadow: inset 0 0 0 4px var(--sign), inset 0 0 0 6px var(--keyline), 0 10px 24px -14px rgba(0,0,0,.6); }
.fleet-tab { position: absolute; top: -.95rem; left: 1rem; background: var(--orange); color: var(--on-orange);
  font: 900 1.65rem/1 var(--font); letter-spacing: .02em; padding: .48rem .75rem .3rem; border-radius: 8px;
  box-shadow: 0 0 0 3px var(--keyline); font-variant-numeric: tabular-nums; }
.sign.oos .fleet-tab { background: var(--red); color: #fff; }
.sign-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.sign-id { min-width: 0; }
.sign-name { font: 900 1.8rem/1.08 var(--font); letter-spacing: -.01em; margin: 0; color: var(--sign-ink); }
.sign-sub { color: var(--sign-muted); font-weight: 600; margin-top: .2rem; }
.sign-read { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; margin-top: 1rem; padding-top: .8rem; border-top: 2px solid rgba(255,255,255,.3); }
.sign-read span { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--sign-muted); }
.sign-read strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.sign-due { margin-top: .85rem; }
.due-bar { position: relative; height: 12px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
.due-bar i { display: block; height: 100%; background: var(--sign-ink); border-radius: 3px 0 0 3px; }
.sign-due.due_soon .due-bar i { background: var(--yellow); }
.sign-due.overdue .due-bar i { background: var(--yellow); }
.sign-due.blocked .due-bar i { background: #ff5a5f; }
/* past the end of the interval: worksite hazard stripes, and a white post where the interval ended */
.due-bar s { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, var(--yellow) 0 6px, #0b1220 6px 12px); }
.sign-due.blocked .due-bar s { background: repeating-linear-gradient(-45deg, #ff5a5f 0 6px, #0b1220 6px 12px); }
.due-bar b { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: #fff; }
.sign-due p { margin: .5rem 0 0; font-size: .92rem; color: #dde4f0; }
.sign-due p strong { color: #fff; }
.sign-state { display: flex; align-items: center; gap: .45em; font-weight: 800; color: #fff; margin-top: .3rem; }
.sign-state::before { content: ""; width: 1em; height: 1em; flex: 0 0 auto; box-sizing: border-box; }
.sign-state.ok::before { background: #4fd68a; -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat; }
.sign-state.bad::before { border-radius: 50%; border: .22em solid #ff5a5f; background: #fff; }
.sign-caption { margin: .2rem 0 0; font-weight: 700; }
.machine-hero { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: .4rem; display: block; border: 2px solid var(--line); }

/* ---------------- buttons: guide panels and the orange action ---------------- */
button, .btn { font: 700 1rem/1.2 var(--font); min-height: var(--tap); padding: .6rem 1.1rem; border-radius: var(--radius); border: 0; cursor: pointer;
  background: var(--sign); color: var(--sign-ink); box-shadow: inset 0 0 0 2px var(--keyline);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: background-color .15s ease-out, transform .1s ease-out, box-shadow .15s ease-out; }
body:not(.theme-dark) button, body:not(.theme-dark) .btn { box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 4px #fff; }
button:hover, .btn:hover { background: #1b3060; }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--orange); color: var(--on-orange); font-weight: 800; box-shadow: inset 0 0 0 2px var(--orange), inset 0 0 0 4px var(--on-orange); }
button.primary:hover, .btn.primary:hover { background: var(--orange-hi); }
button.big, .btn.big { width: 100%; min-height: 62px; font-size: 1.15rem; font-weight: 800; border-radius: 12px; }
/* links that take you somewhere read as direction signs: arrow square first, text left-aligned */
a.btn.big { justify-content: flex-start; padding-left: .7rem; gap: .85rem; }
a.btn.big:not(:has(.ico))::before { content: ""; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 6px; background: var(--sign-ink) center / 24px no-repeat
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314254a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
a.btn.big.primary:not(:has(.ico))::before { background-color: var(--on-orange);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f08a24' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
a.btn.big .ico { width: 38px; height: 38px; padding: 7px; border-radius: 6px; background: var(--sign-ink); color: var(--sign); stroke-width: 2.4; }
a.btn.big.primary .ico { background: var(--on-orange); color: var(--orange); }
button.danger, .btn.danger { background: var(--surface); color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }
button.danger:hover { background: var(--bad-bg); }
button.danger.primary { background: var(--red); color: #fff; box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 4px #fff; }
button.slim, .btn.slim { min-height: 40px; padding: .3rem .75rem; font-size: .9rem; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
button.primary:focus-visible, .btn.primary:focus-visible { outline-color: var(--sign-ink); }
body:not(.theme-dark) button.primary:focus-visible, body:not(.theme-dark) .btn.primary:focus-visible { outline-color: var(--sign); }

/* ---------------- forms ---------------- */
label { display: block; font-weight: 700; margin: .8rem 0 .3rem; }
input, select, textarea { font: 400 16px/1.3 var(--font); width: 100%; min-height: var(--tap); padding: .55rem .75rem; color: var(--ink);
  background: var(--field); border: 2px solid var(--line-strong); border-radius: var(--radius); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; }
select option { background: var(--surface); color: var(--ink); }
textarea { min-height: 96px; }
body.theme-dark.field input, body.theme-dark.field select, body.theme-dark.field textarea { border-color: #8d9cc0; background: #0a1324; }
input[type=checkbox] { width: 26px; height: 26px; min-height: 0; padding: 0; vertical-align: middle; accent-color: var(--orange); flex: 0 0 auto; }
input[type=radio] { width: 24px; height: 24px; min-height: 0; padding: 0; flex: 0 0 auto; accent-color: var(--orange); vertical-align: middle; }
input[type=file] { padding: .5rem; min-height: 0; border-style: dashed; color: var(--muted); font-size: .95rem; }
input[type=file]::file-selector-button { font: 800 .95rem var(--font); min-height: 40px; padding: .3rem .9rem; margin-right: .8rem; border: 0; border-radius: 8px;
  background: var(--sign); color: #fff; box-shadow: inset 0 0 0 2px #fff; cursor: pointer; }
.check { display: flex; gap: .65rem; align-items: center; font-weight: 600; margin: .8rem 0; }
.tabs { display: flex; gap: .45rem; margin-bottom: .9rem; flex-wrap: wrap; }
.tabs button { flex: 1; min-height: 46px; font-size: .95rem; }
.tabs button.on { background: var(--sign-ink); color: var(--sign); font-weight: 800; box-shadow: inset 0 0 0 2px var(--sign-ink); }
body:not(.theme-dark) .tabs button.on { background: var(--sign); color: #fff; box-shadow: inset 0 0 0 2px var(--orange); }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }

/* ---------------- status marks: shape + word, never colour alone ---------------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem .1rem; border-radius: 6px; font-size: .84rem; font-weight: 800;
  white-space: nowrap; border: 1.5px solid currentColor; line-height: 1.3; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.neutral { background: var(--surface-2); color: var(--muted); border-style: dashed; }
.crit { color: var(--bad); font-size: .8rem; font-weight: 900; letter-spacing: .04em; }

/* banners are signs too: regulatory (red ring), warning (yellow diamond), done (green), waiting (dashed navy) */
.banner { position: relative; border-radius: 12px; padding: 1rem 1rem 1rem 3.7rem; margin-bottom: 1rem; border: 2px solid; font-weight: 600; min-height: 3.6rem; }
.banner::before { content: ""; position: absolute; left: .95rem; top: 1rem; width: 1.9rem; height: 1.9rem; background: center / contain no-repeat; }
.banner h2 { margin: .1rem 0 .4rem; font-size: 1.25rem; font-weight: 900; }
.banner p { margin: .4rem 0; }
.banner a { color: inherit; }
.banner.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--ink); }
.banner.bad::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='15' fill='%23c8102e'/%3E%3Ccircle cx='16' cy='16' r='15' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3Crect x='7' y='13' width='18' height='6' rx='1' fill='%23fff'/%3E%3C/svg%3E"); }
.banner.warn { background: var(--warn-bg); border-color: var(--yellow); color: var(--ink); }
.banner.warn.waiting { border-style: dashed; }
.banner.warn::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='5.5' y='5.5' width='21' height='21' rx='2.5' transform='rotate(45 16 16)' fill='%23ffcc00' stroke='%230b1220' stroke-width='1.6'/%3E%3Cpath d='M16 9.5v8' stroke='%230b1220' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='22' r='1.8' fill='%230b1220'/%3E%3C/svg%3E"); }
.banner.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ink); }
.banner.ok::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='15' fill='%231e8e4e'/%3E%3Cpath d='m9 16.5 4.5 4.5L23 11' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.banner.info { background: var(--info-bg); border-color: var(--line-strong); border-style: dashed; color: var(--ink); }
body.theme-dark .banner.info { border-color: #fff; color: #fff; }
.banner.info::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='1.5' y='1.5' width='29' height='29' rx='5' fill='%2314254a' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='16' cy='9.5' r='2.2' fill='%23fff'/%3E%3Cpath d='M16 14v10' stroke='%23fff' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
body.field .banner { border-width: 3px; }
body.theme-dark.field .banner.bad { background: #4a0d16; border-color: #ff5a5f; }
body.theme-dark.field .banner.warn { background: #3a3000; }
body.theme-dark.field .banner.ok { background: #0b3a22; }
a.banner.blocklink { display: block; }
a.banner.blocklink:hover { filter: brightness(1.08); }

/* ---------------- pre-start checklist ---------------- */
.item { border-bottom: 1px solid var(--line); padding: .95rem 0; }
.item:last-child { border-bottom: 0; }
.item .prompt { font-weight: 700; margin-bottom: .55rem; }
.pfn { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.pfn button { min-height: 58px; background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-strong); font-size: 1.02rem; }
.pfn button:hover { background: var(--surface); }
.pfn button.sel-pass { background: var(--green); color: #fff; box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px #fff; }
.pfn button.sel-fail { background: var(--red); color: #fff; box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 4px #fff; }
.pfn button.sel-na { background: #56627a; color: #fff; box-shadow: inset 0 0 0 2px #56627a, inset 0 0 0 4px #fff; }
.failbox { margin-top: .65rem; padding: .7rem; background: var(--bad-bg); border: 2px solid var(--bad); border-radius: var(--radius); }
.thumbs { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); }
.fuelpick { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; }
.fuelpick button { min-height: 58px; font-size: 1.25rem; font-weight: 900; }
.fuelpick button.on { background: var(--orange); color: var(--on-orange); box-shadow: inset 0 0 0 2px var(--orange), inset 0 0 0 4px var(--on-orange); }

/* ---------------- tables and lists ---------------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); color: var(--ink); font-size: .93rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .6rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr.click { cursor: pointer; }
tr.click:hover { background: var(--surface-2); }
tr.voided td { color: var(--muted); }
tr.voided td strong { text-decoration: line-through; text-decoration-thickness: 2px; }
.tablewrap { overflow-x: auto; border: 0; border-radius: var(--radius-lg); margin-bottom: 1rem; background: var(--surface); padding: 6px;
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--panel-key); }
.tablewrap > table { background: transparent; }
.tablewrap th:first-child { border-top-left-radius: 8px; } .tablewrap th:last-child { border-top-right-radius: 8px; }
@media (max-width: 640px) { .tablewrap > table { min-width: 620px; } }
.code-cell { display: inline-flex; align-items: center; gap: .6rem; }
.code-cell strong { background: var(--orange); color: var(--on-orange); font-weight: 900; padding: .12rem .45rem 0; border-radius: 5px; letter-spacing: .02em; }
.list a.li, .list div.li { display: flex; justify-content: space-between; gap: .7rem; align-items: center; padding: .8rem 1rem; background: var(--surface);
  border: 0; border-radius: var(--radius); margin-bottom: .5rem; text-decoration: none; color: inherit; min-height: var(--tap);
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--panel-key); }
.list a.li:hover { box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--line-strong); }
.stat { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .87rem; margin: .4rem 0 .8rem; }

/* competency matrix: valid solid, waiting dashed, expired struck */
.matrix th, .matrix td { text-align: center; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix th:first-child { background: var(--surface-2); }
.cell { display: inline-block; min-width: 2.3rem; padding: .15rem .4rem .05rem; border-radius: 6px; font-weight: 900; font-size: .86rem; border: 1.5px solid currentColor; }
.cell.valid { background: var(--ok-bg); color: var(--ok); }
.cell.expiring { background: var(--warn-bg); color: var(--warn); }
.cell.expired, .cell.rejected { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 2px; }
.cell.pending { background: var(--info-bg); color: var(--ink); border-style: dashed; }
.cell.none { color: var(--muted); font-weight: 400; border-color: transparent; }
.ticketimg { max-width: 100%; max-height: 360px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }

/* ---------------- scanner ---------------- */
#scanner { position: relative; background: #000; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 3/4; max-height: 70vh; margin: 0 auto 1rem; }
#scanner video { width: 100%; height: 100%; object-fit: cover; }
#scanner .frame { position: absolute; inset: 18%; border-radius: 14px; box-shadow: 0 0 0 999px rgba(5,10,20,.5), inset 0 0 0 4px var(--orange), 0 0 0 3px #fff; }

/* ---------------- toast ---------------- */
#toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--sign); color: #fff;
  padding: .85rem 1.15rem; border-radius: 12px; max-width: 92vw; display: none; z-index: 50; font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 4px #fff, 0 12px 30px -8px rgba(0,0,0,.5); }
#toast.show { display: block; }
#toast.err { background: var(--red); box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 4px #fff, 0 12px 30px -8px rgba(0,0,0,.5); }

.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2rem; letter-spacing: .25em; font-weight: 800; background: var(--surface-2);
  color: var(--ink); padding: .4rem .8rem; border-radius: 8px; display: inline-block; border: 2px dashed var(--line-strong); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

/* ---------------- dashboard ---------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin-bottom: .15rem; }
.kpis { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.kpis > .kpi { flex: 1 1 170px; }
.kpi { margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.kpi-head { display: flex; align-items: center; gap: .6rem; }
.kpi-label { color: var(--muted); font-weight: 700; font-size: .92rem; }
.kpi-value { font-size: 2.1rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: .95rem; font-weight: 600; color: var(--muted); }
.kpi-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .87rem; color: var(--muted); }
/* chips are small signs: guide (navy), regulatory (red), warning (yellow), waiting (dashed) */
.chip { width: 36px; height: 36px; border-radius: 8px; display: inline-grid; place-items: center; flex: 0 0 auto;
  background: var(--sign); color: #fff; box-shadow: inset 0 0 0 1.5px var(--keyline); }
.chip .ico { width: 19px; height: 19px; }
.chip.bad { background: var(--red); }
.chip.warn { background: var(--yellow); color: #0b1220; box-shadow: inset 0 0 0 1.5px #0b1220; }
.chip.info { background: var(--sign); box-shadow: none; outline: 1.5px dashed var(--keyline); outline-offset: -3px; }
body:not(.theme-dark) .chip.info { outline-color: #fff; }
.badge { display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .45rem 0; border-radius: 5px; font-size: .8rem; font-weight: 800;
  background: var(--surface-2); color: var(--muted); border: 1.5px solid currentColor; }
.badge.up { background: var(--ok-bg); color: var(--ok); }
.badge.down { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--ink); border-style: dashed; }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-bottom: .8rem; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
.panel { margin: 0; }
.panel h2 { margin-top: 0; font-size: 1.08rem; }
.panel .list a.li:last-child { margin-bottom: 0; }
.fleet-body { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.radar { width: 230px; height: 230px; flex: 0 0 auto; max-width: 100%; color: var(--ink); }
.rface { fill: var(--surface-2); }
.rring { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.raxis { stroke: var(--line); stroke-width: 1; }
.rsweep { color: var(--ink); }
.rdot { stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.rdot.ok { fill: var(--ok); } .rdot.idle { fill: var(--ink); } .rdot.bad { fill: var(--bad); }
.rnum { font-size: 30px; font-weight: 900; fill: currentColor; } .rof { font-size: 15px; font-weight: 700; fill: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .rsweep { transform-origin: 110px 110px; animation: sweep 10s linear infinite; } }
@keyframes sweep { to { transform: rotate(360deg); } }
.legend-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; min-width: 200px; flex: 1; }
.legend-list li { display: flex; align-items: center; gap: .6rem; }
.legend-list strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend-inline { display: inline-flex; gap: .8rem; flex-wrap: wrap; color: var(--muted); }
.legend-inline > span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); border-radius: 2px; transform: rotate(45deg); } .dot.idle { background: var(--ink); }
.bars { display: grid; gap: .95rem; margin: .4rem 0 .6rem; }
.bar-row { display: flex; justify-content: space-between; font-weight: 700; font-size: .93rem; margin-bottom: .35rem; }
.bar-track { height: 10px; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px 0 0 3px; }
.bar-fill.bad { background: var(--bad); } .bar-fill.warn { background: var(--yellow); } .bar-fill.minor { background: var(--muted); }
.insights h2 { font-size: 1.08rem; }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .8rem; margin-bottom: .8rem; }
a.insight, .insight { margin: 0; display: flex; align-items: center; gap: .8rem; }
.insight-body { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.insight-body .small { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chev { color: var(--muted); }
@media (max-width: 520px) {
  .kpis { gap: .6rem; }
  .kpis > .kpi { flex-basis: 140px; padding: .85rem; }
  .kpi-value { font-size: 1.75rem; }
  .kpi-label { font-size: .86rem; }
  .chip { width: 32px; height: 32px; }
  .page-head .btn { width: 100%; }
}

/* ---------------- fuel ---------------- */
.fuel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .6rem; }
.fuel-item { display: flex; flex-direction: column; gap: .35rem; padding: .75rem .85rem; border-radius: 12px; text-decoration: none; color: inherit;
  border: 0; background: var(--surface-2); }
.fuel-item:hover { box-shadow: inset 0 0 0 2px var(--line-strong); }
.fuel-row { display: flex; flex-direction: column; gap: .3rem; }
.fuel-bar { position: relative; height: 14px; border-radius: 3px; background: var(--ground); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.fuel-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface-2); z-index: 1; }
.fuel-fill { height: 100%; background: var(--ink); }
.fuel-bar.low .fuel-fill { background: var(--bad); }
.fuel-bar.mid .fuel-fill { background: var(--yellow); }
.fuel-bar.ok .fuel-fill { background: var(--ok); }
.fuel-meta .stale { color: var(--warn); font-weight: 700; }

/* ---------------- machine photos ---------------- */
.athumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; display: inline-block; background: var(--surface-2); border: 1px solid var(--line); }
.athumb.none { background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a97ad' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17h11V9H8l-3 4H3z'/%3E%3Cpath d='M14 11h4l3 3v3h-7'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E") center / 60% no-repeat; }
.athumb.big { width: 84px; height: 84px; border-radius: 12px; }
.asset-head { display: flex; align-items: center; gap: .9rem; }
.asset-head-photo { flex: 0 0 auto; line-height: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.gallery figure.main { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery figcaption { padding: .5rem .6rem .6rem; display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; }
.gallery figcaption .row { gap: .4rem; }

/* ---------------- company logo ---------------- */
.sticker-logo { display: block; max-height: 56px; max-width: 70%; object-fit: contain; margin-bottom: .5rem; background: #fff; padding: 6px 8px; border-radius: 8px; }
.label-logo { display: block; max-height: 12mm; max-width: 80%; object-fit: contain; margin: 0 auto 1mm; }
.logo-previews { display: flex; gap: .8rem; flex-wrap: wrap; margin: .4rem 0 .8rem; }
.lp { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .8rem 1rem; border-radius: 12px; min-width: 180px; }
.lp img { max-height: 48px; max-width: 200px; object-fit: contain; }
.lp span { font-size: .8rem; }
.lp.dark { background: var(--sign); box-shadow: inset 0 0 0 2px #fff; color: var(--sign-muted); }
.lp.dark img { background: #fff; padding: 4px 8px; border-radius: 6px; }
.lp.light { background: #fff; border: 1px solid #d2d9e4; color: #4a5670; }

/* ---------------- printable QR sheet: 3 x 4 labels on A4 ---------------- */
.labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; }
.label { border: 1px dashed #999; border-radius: 4mm; padding: 4mm; text-align: center; break-inside: avoid; background: #fff; color: #0b1220; }
.label img { width: 42mm; height: 42mm; }
.label .code { font-size: 20pt; font-weight: 900; margin-top: 1mm; }
.label .nm { font-size: 9pt; }
.label .hint { font-size: 8pt; margin-top: 1mm; }
@media print {
  @page { size: A4; margin: 10mm; }
  body, body.theme-dark { --ground: #fff; --surface: #fff; --surface-2: #f3f5f9; --ink: #0b1220; --muted: #4a5670; --line: #d2d9e4; --line-strong: #8a97ad;
    --ok: #146c37; --ok-bg: #e1f2e7; --bad: #b0141f; --bad-bg: #fde7e6; --warn: #6b4e00; --warn-bg: #fff3c4; --info-bg: #e7ecf6;
    background: #fff !important; color: #0b1220; }
  header#top, nav#menu, body.staff nav#menu, .noprint, #toast { display: none !important; }
  main, body.staff main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .card, .tablewrap { box-shadow: none; }
}

/* ---------------- drawn status marks: the sign families at small size ----------------
   ok = tick, regulatory = ring, warning = diamond, waiting = dashed, minor = dot. Each sits beside a word. */
.pill::before { content: ""; width: .95em; height: .95em; flex: 0 0 auto; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.pill.ok { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 12.5 5 5L19.5 7'/%3E%3C/svg%3E"); }
.pill.bad { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.6'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3C/svg%3E"); }
.pill.warn { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5 22.5 12 12 22.5 1.5 12z'/%3E%3C/svg%3E"); }
.pill.neutral { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3C/svg%3E"); }
.crit { display: inline-flex; align-items: center; gap: .3em; }
.crit::before { content: ""; width: .85em; height: .85em; border-radius: 50%; border: .2em solid currentColor; box-sizing: border-box; }
/* severity: critical = red ring, major = yellow diamond, minor = dot */
.sev-mark { display: inline-block; width: .9em; height: .9em; margin-right: .45em; vertical-align: -.08em; box-sizing: border-box; }
.sev-mark.bad { border-radius: 50%; border: .22em solid var(--bad); }
.sev-mark.warn { background: var(--yellow); transform: rotate(45deg) scale(.82); border-radius: 2px; box-shadow: 0 0 0 1.5px #0b1220; }
.sev-mark.minor { border-radius: 50%; background: var(--muted); transform: scale(.6); }
/* chips: guide (navy square), regulatory (red ring), warning (yellow diamond), waiting (dashed) */
.chip.bad { border-radius: 50%; background: var(--red); box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 4px #fff; }
.chip.warn { width: 40px; height: 40px; border-radius: 0; box-shadow: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.chip.warn .ico { width: 16px; height: 16px; }
/* dashboard legend and radar: out of service is a ring, not a diamond */
.dot.bad { background: transparent; border: 3px solid var(--bad); border-radius: 50%; transform: none; width: 12px; height: 12px; }
.rdot.bad { fill: var(--surface); stroke: var(--bad); stroke-width: 3; }
/* trend badges carry their direction as a drawn arrow */
.badge.trend::before { content: ""; width: .8em; height: .8em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V5M6 11l6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V5M6 11l6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.badge.trend.down::before { transform: rotate(180deg); }
/* competency matrix marks */
.cell .mk { width: 15px; height: 15px; display: block; margin: 1px auto 2px; }
.legend .cell { vertical-align: middle; }

/* ---------------- alerts: the bell and the Notifications list ---------------- */
.bell { position: relative; display: inline-grid; place-items: center; min-width: 48px; min-height: 48px; border-radius: 8px; color: var(--sign-ink);
  box-shadow: inset 0 0 0 2px var(--keyline); text-decoration: none; flex: 0 0 auto; }
.bell:hover { background: rgba(255,255,255,.08); }
.bell .ico { width: 22px; height: 22px; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; display: grid; place-items: center;
  background: var(--orange); color: var(--on-orange); font: 900 .78rem/1 var(--font); box-shadow: 0 0 0 2px var(--sign); font-variant-numeric: tabular-nums; }
.list a.li.alert-item.unread { box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--orange); }
.alert-item .small { line-height: 1.45; }
.push-card button.big { max-width: 440px; }

/* ---------------- tickets: date obtained, expiry date and the expiry quick picks ---------------- */
.quickpick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
.quickpick[hidden] { display: none; }
.quickpick .small { margin-right: .15rem; }
.quickpick button[aria-pressed="true"] { background: var(--orange); color: var(--on-orange); box-shadow: none; }
/* phones (gloved thumbs): full tap height, the label on its own line, the four picks in an even row */
@media (max-width: 767px) {
  .quickpick { display: grid; grid-template-columns: repeat(4, 1fr); }
  .quickpick[hidden] { display: none; }
  .quickpick .small { grid-column: 1 / -1; margin: 0; }
  .quickpick button.slim { min-height: var(--tap); padding: .4rem .3rem; font-size: 1rem; }
}
form.tdates { margin: 0 0 .6rem; }

/* ---------------- banners above every screen: support session, suspended account ---------------- */
#sysbanner { max-width: 860px; margin: 0 auto; padding: .9rem 1rem 0; }
#sysbanner .banner { margin-bottom: 0; }
#sysbanner .banner + .banner { margin-top: .6rem; }
@media (min-width: 768px) { body.staff #sysbanner { margin-left: 76px; max-width: none; } }
@media (min-width: 1200px) { body.staff #sysbanner { margin-left: 240px; } }
@media (min-width: 900px) { body.staff #sysbanner > * { max-width: 1240px; } }

/* ---------------- platform console ---------------- */
.biz-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.biz-table td.actions { white-space: nowrap; text-align: right; }
.biz-table td.actions button + button { margin-left: .4rem; }
.biz-table .act-row td { background: var(--surface-2); }
.act-form { display: grid; gap: .5rem; }
.act-form label { margin: 0; }
.totp-qr { display: flex; justify-content: center; }
.totp-qr img { background: #fff; padding: 10px; border-radius: 8px; }
.totp-key { font-size: 1rem; letter-spacing: .06em; word-break: break-all; }
ol.steps { padding-left: 1.3rem; margin: 0 0 .6rem; }
ol.steps li { margin: .35rem 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .8rem 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 700; word-break: break-all; }

/* ---------------- motion ----------------
   Quick and once per screen: blocks settle top-down as a screen opens, lists arrive as lists, and the
   machine sign goes up (mounts, tab revealed, service bar filled to its exact reading, overrun past the
   due mark). Re-draws after a save don't replay it (app.js adds .enter only when the screen changes).
   Only transform, opacity and clip-path move. Reduced motion: short fades, the bar drawn as it is. */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
@keyframes arrive-row { from { opacity: 0; transform: translateY(6px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sign-mount { from { opacity: 0; transform: translateY(14px); } }
@keyframes wipe-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* the fleet tab's wipe leaves room for its 3px keyline and rounded corners, and drops the clip when it ends */
@keyframes tab-wipe { from { clip-path: inset(-4px calc(100% + 4px) -4px -4px round 8px); } to { clip-path: inset(-4px -4px -4px -4px round 8px); } }
@keyframes bar-fill { from { transform: scaleX(0); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { transform: translate(-50%, 0); } }
@keyframes bump { 40% { transform: scale(1.35); } }

@media (prefers-reduced-motion: no-preference) {
  /* a screen opens: its blocks settle in from the top (stagger capped at .18s) */
  #app.enter > * { animation: arrive .3s var(--ease-out) backwards; }
  #app.enter > :nth-child(2) { animation-delay: .045s; }
  #app.enter > :nth-child(3) { animation-delay: .09s; }
  #app.enter > :nth-child(4) { animation-delay: .135s; }
  #app.enter > :nth-child(n+5) { animation-delay: .18s; }

  /* lists, tables and dashboard tiles arrive as lists: one after another, capped at 8 steps */
  #app.enter .list > *, #app.enter tbody > tr, #app.enter .kpis > * { animation: arrive-row .26s var(--ease-out) backwards; animation-delay: calc(.06s + var(--i, 0) * .03s); }
  :is(.list, tbody, .kpis) > :nth-child(2) { --i: 1; } :is(.list, tbody, .kpis) > :nth-child(3) { --i: 2; }
  :is(.list, tbody, .kpis) > :nth-child(4) { --i: 3; } :is(.list, tbody, .kpis) > :nth-child(5) { --i: 4; }
  :is(.list, tbody, .kpis) > :nth-child(6) { --i: 5; } :is(.list, tbody, .kpis) > :nth-child(7) { --i: 6; }
  :is(.list, tbody, .kpis) > :nth-child(n+8) { --i: 7; }

  /* the machine sign goes up: panel mounts, fleet tab revealed, the service bar fills to its reading,
     and an overrun's hazard stripes run on past the due mark */
  #app.enter .sign { animation: sign-mount .42s var(--ease-out) backwards; }
  #app.enter .fleet-tab { animation: tab-wipe .3s .14s var(--ease-out) backwards; }
  #app.enter .due-bar i { transform-origin: left center; animation: bar-fill .45s .16s var(--ease-out) backwards; }
  #app.enter .due-bar s { animation: wipe-in .24s .5s ease-out backwards; }
  #app.enter .due-bar b { animation: fade .18s .46s ease-out backwards; }

  /* things that open where you tapped them */
  nav#menu:not([hidden]) { animation: drop .2s var(--ease-out); }
  :is(form.tdates, #nb, .quickpick):not([hidden]), .act-row:not([hidden]) .act-form, #created .created { animation: drop .22s var(--ease-out); }

  /* a new banner drops in; one already showing stays still */
  #sysbanner.arrive .banner { animation: drop .28s var(--ease-out) backwards; }
  #sysbanner.arrive .banner + .banner { animation-delay: .05s; }

  /* feedback */
  #toast.show { animation: toast-in .24s var(--ease-out); }
  .bell-count.bump { animation: bump .34s var(--ease-out); }
  a.btn.big::before, a.btn.big .ico { transition: transform .15s ease-out; }
  @media (hover: hover) { a.btn.big:hover::before, a.btn.big:hover .ico { transform: translateX(3px); } }
}

@media (prefers-reduced-motion: reduce) {
  #app.enter > *, #sysbanner.arrive .banner, #toast.show { animation: fade .16s ease-out backwards; }
}

/* invite and reset links shown once to pass on */
code.linkbox { display: block; padding: .7rem .8rem; border-radius: 8px; background: var(--surface-2); word-break: break-all; font-size: .9rem; user-select: all; }
/* a made-up PIN shown once to pass on: large, spaced, in the fleet-number face */
.pin-once { font: 900 2.4rem/1 var(--font); letter-spacing: .3em; font-variant-numeric: tabular-nums; margin: .6rem 0 1rem; user-select: all; }
