/* Sitehop. Cool white surfaces, navy ink, one confident blue. Red, amber and green are kept for status only. */

@font-face { font-family: 'Figtree'; font-weight: 300 900; font-style: normal; font-display: swap; src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2'); }

:root {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --ink: #0e1b30;
  --muted: #53647c;
  --line: #dde4ee;
  --line-strong: #c3cddb;
  --field: #7a8aa1;
  --accent: #2150e0;
  --accent-deep: #1a42bf;
  --accent-wash: #e8eefd;
  --accent-line: #bccbf6;
  --good: #13693a;
  --good-wash: #dff3e6;
  --good-line: #a9d8bc;
  --warn: #7a4a00;
  --warn-wash: #fff0c7;
  --warn-line: #ebcb7c;
  --warn-bar: #d99a00;
  --bad: #b0261c;
  --bad-wash: #fde4e1;
  --bad-line: #f0b3ad;
  --neutral: #33445c;
  --neutral-wash: #e6ebf2;
  --neutral-line: #c9d2e0;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(14, 27, 48, 0.05);
  --shadow-pop: 0 24px 64px rgba(14, 27, 48, 0.28);
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --side: 15.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.012em; }
h1 { font-weight: 750; font-size: 1.75rem; letter-spacing: -0.025em; }
h2 { font-size: 1.06rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.6rem 1rem; z-index: 100; border-radius: var(--radius); }
.skip:focus { left: 0.5rem; top: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 2rem; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* App shell: sidebar on wide screens, a drawer on narrow ones */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: 1.1rem 0.85rem 0.9rem; overflow-y: auto; z-index: 60; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em; line-height: 1; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 2rem; height: 2rem; flex: none; }
.sidebar .brand { padding: 0.25rem 0.5rem 1.2rem; }
.nav { display: grid; gap: 0.15rem; }
.nav-gap { height: 0.9rem; }
.nav a { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem; border-radius: var(--radius); color: var(--neutral); text-decoration: none; font-weight: 600; min-height: 2.5rem; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--accent-wash); color: var(--accent-deep); font-weight: 700; }
.nav-count { margin-left: auto; min-width: 1.4rem; padding: 0.02rem 0.45rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.8rem; font-weight: 700; text-align: center; }
.side-foot { margin-top: auto; padding: 0.9rem 0.5rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.15rem; }
.side-foot .tenant { font-weight: 700; overflow-wrap: anywhere; }
.side-foot .person { color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.side-foot .foot-actions { display: flex; gap: 0.25rem; margin: 0.5rem -0.5rem 0; }

.stage { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 0.75rem; min-height: 3.5rem; padding: 0.6rem 2rem 0; }
.topbar .brand { display: none; }
.topbar .spacer { flex: 1; }
.icon-btn.menu-btn { display: none; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--neutral); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--neutral-wash); color: var(--ink); }
.bell-count { position: absolute; top: 0; right: -0.1rem; min-width: 1.1rem; height: 1.1rem; padding: 0 0.28rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1.1rem; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.scrim { display: none; }

main:focus, main:focus-visible { outline: none; }
main { width: 100%; max-width: 74rem; margin: 0 auto; padding: 2rem 2rem 4rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 1.5rem; }
.page-head .lede { margin-top: 0.35rem; max-width: 42rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.loading { padding: 3rem 0; color: var(--muted); }

/* Buttons and fields */
.btn { font: inherit; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 2.5rem; padding: 0.4rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; box-shadow: var(--shadow); }
.btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--field); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-danger { color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-wash); color: var(--bad); border-color: var(--bad); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent); padding-inline: 0.6rem; box-shadow: none; }
.btn-quiet:hover { background: var(--accent-wash); border-color: transparent; color: var(--accent-deep); }
.btn-sm { min-height: 2.1rem; padding: 0.2rem 0.75rem; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
@media (pointer: coarse) { .btn { min-height: 2.9rem; } .btn-sm { min-height: 2.5rem; } }

label, .label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input, select, textarea { font: inherit; color: var(--ink); width: 100%; min-height: 2.6rem; padding: 0.45rem 0.7rem; border: 1px solid var(--field); border-radius: var(--radius); background: #fff; }
select { padding-right: 0.4rem; }
textarea { min-height: 5rem; resize: vertical; }
input::placeholder { color: #70809a; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
input[type='checkbox'], input[type='radio'] { width: 1.15rem; min-height: 0; height: 1.15rem; accent-color: var(--accent); flex: none; }
input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--bad); border-width: 2px; }
.field-error { color: var(--bad); font-size: 0.9rem; margin-top: 0.2rem; }
.help { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }
.check { display: flex; align-items: center; gap: 0.55rem; font-weight: 500; margin: 0; min-height: 2.5rem; }

/* Asset tag: how an asset is named wherever it appears */
.tag { display: inline-block; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.01em; line-height: 1.2; padding: 0.22rem 0.55rem; background: var(--neutral-wash); color: var(--ink); border: 1px solid var(--neutral-line); border-radius: 8px; white-space: nowrap; vertical-align: middle; }
.tag-lg { font-size: 1.05rem; padding: 0.3rem 0.7rem; border-radius: 10px; }

/* Status badges: always carry words, never colour alone */
.badge { display: inline-block; font-size: 0.82rem; font-weight: 700; padding: 0.1rem 0.6rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; line-height: 1.5; }
.badge-bad { background: var(--bad-wash); color: var(--bad); border-color: var(--bad-line); }
.badge-warn { background: var(--warn-wash); color: var(--warn); border-color: var(--warn-line); }
.badge-good { background: var(--good-wash); color: var(--good); border-color: var(--good-line); }
.badge-neutral { background: var(--neutral-wash); color: var(--neutral); border-color: var(--neutral-line); }
.badge-info { background: var(--accent-wash); color: var(--accent-deep); border-color: var(--accent-line); }

/* Sheets, tables, lists */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.sheet-pad { padding: 1.1rem 1.25rem; }
.sheet + .sheet { margin-top: 1.25rem; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; padding: 1.1rem 1.25rem 0.8rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 650; font-size: 0.88rem; color: var(--muted); padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
tr th:first-child, tr td:first-child { padding-left: 1.25rem; }
tr th:last-child, tr td:last-child { padding-right: 1.25rem; }
td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
th .sort { font: inherit; font-weight: 650; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
th .sort:hover { color: var(--ink); }
th[aria-sort='ascending'] .sort::after { content: ' \25B2'; font-size: 0.7em; }
th[aria-sort='descending'] .sort::after { content: ' \25BC'; font-size: 0.7em; }
.row-link { color: var(--ink); text-decoration: none; font-weight: 650; }
a.row-link:hover { color: var(--accent-deep); text-decoration: underline; }
.empty { padding: 2rem 1.25rem; color: var(--muted); }

.toolbar { display: grid; grid-template-columns: minmax(12rem, 2fr) repeat(5, minmax(8rem, 1fr)); gap: 0.75rem; align-items: end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.toolbar .check-cell { grid-column: 1 / -1; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--line); }

/* The hop: where an asset is going. The one drawn element in the app. */
.hop { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.5rem; font-weight: 650; }
.hop-from { color: var(--muted); }
.hop-arc { width: 2.9rem; height: 1.15rem; flex: none; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hop-arc .end { fill: currentColor; stroke: none; }
.hop-lg { font-size: 1.12rem; }
.hop-lg .hop-arc { width: 3.6rem; height: 1.4rem; }

/* Where a request is up to */
.steps { display: flex; list-style: none; margin: 0; padding: 0; gap: 0; }
.steps li { flex: 1; position: relative; display: grid; gap: 0.15rem; justify-items: start; padding-top: 1.9rem; font-size: 0.88rem; color: var(--muted); min-width: 0; }
.steps li::before { content: ''; position: absolute; top: 0.62rem; left: 1.5rem; right: -0.1rem; height: 2px; background: var(--line-strong); }
.steps li:last-child::before { display: none; }
.steps .dot { position: absolute; top: 0; left: 0; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: #fff; }
.steps .dot .icon { width: 0.85rem; height: 0.85rem; stroke-width: 3; }
.steps b { color: var(--ink); font-weight: 650; }
.steps li.done::before { background: var(--accent); }
.steps li.done .dot { background: var(--accent); border-color: var(--accent); }
.steps li.now .dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.steps li.now b { color: var(--accent-deep); }
.steps li.stop .dot { background: var(--bad); border-color: var(--bad); }
.steps li.stop b { color: var(--bad); }
.steps li.cancel .dot { background: var(--field); border-color: var(--field); }
.steps li:not(.done):not(.now):not(.stop):not(.cancel) b { color: var(--muted); font-weight: 500; }

/* Requests */
.req-list { display: grid; gap: 0.9rem; }
.req { padding: 1.1rem 1.25rem; display: grid; gap: 0.8rem; }
.req.is-waiting { border-left: 4px solid var(--warn-bar); }
.req.is-transit { border-left: 4px solid var(--accent); }
.req-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.req-head h3 { font-size: 1.05rem; }
.req-head .badge { margin-left: auto; }
.req-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 1.25rem; color: var(--muted); font-size: 0.92rem; }
.req-meta b { color: var(--ink); font-weight: 650; }
.req-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.55rem 0.8rem; font-size: 0.95rem; overflow-wrap: anywhere; }
.req-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.wait { font-weight: 700; color: var(--warn); }
.wait.late { color: var(--bad); }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.chip-btn { font: inherit; font-weight: 650; min-height: 2.3rem; padding: 0.2rem 0.9rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--neutral); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.chip-btn:hover { border-color: var(--field); color: var(--ink); }
.chip-btn[aria-current='page'], .chip-btn[aria-pressed='true'] { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent-deep); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.8rem 1.1rem; margin: 1rem 0 0; background: var(--accent-wash); border: 1px solid var(--accent-line); border-radius: var(--radius); color: var(--ink); }
.banner .badge { flex: none; }
.pick-list { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; max-height: 16rem; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line-strong); border-radius: var(--radius); font-weight: 500; margin: 0; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.pick .where { margin-left: auto; color: var(--muted); font-size: 0.9rem; text-align: right; }

/* Notifications */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: grid; grid-template-columns: 0.6rem minmax(0, 1fr) auto; gap: 0.2rem 0.9rem; align-items: start; padding: 0.95rem 1.25rem; border-top: 1px solid var(--line); }
.notif:first-child { border-top: 0; }
.notif .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-top: 0.5rem; background: transparent; }
.notif.unread .dot { background: var(--accent); }
.notif.unread .title { font-weight: 750; }
.notif .title { font-weight: 550; display: block; color: var(--ink); text-decoration: none; }
a.title:hover { text-decoration: underline; }
.notif .when { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }

/* Dashboard */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr); gap: 1.5rem; align-items: start; }
.split > .stack > .sheet + .sheet, .stack > .sheet + .sheet { margin-top: 1.25rem; }
.due-list { list-style: none; margin: 0; padding: 0; }
.due-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.25rem 1rem; align-items: center; padding: 0.8rem 1.25rem; border-top: 1px solid var(--line); border-left: 4px solid transparent; text-decoration: none; color: inherit; }
.due-row:hover { background: var(--surface-2); }
.due-row.band-overdue { border-left-color: var(--bad); }
.due-row.band-soon { border-left-color: var(--warn-bar); }
.due-row.band-upcoming { border-left-color: var(--accent); }
.due-row .what { color: var(--muted); font-size: 0.93rem; }
.due-row .name { font-weight: 650; }
.mini-list { list-style: none; margin: 0; padding: 0 0 0.5rem; }
.mini-list li a { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1.25rem; color: var(--ink); text-decoration: none; }
.mini-list li a:hover { background: var(--surface-2); }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; padding: 0 1.25rem 1.2rem; margin: 0; }
.counts dt { color: var(--muted); font-size: 0.92rem; order: 2; }
.counts dd { margin: 0; font-weight: 750; font-size: 2rem; line-height: 1.1; letter-spacing: -0.03em; order: 1; }
.counts div { display: flex; flex-direction: column; }
.decide { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 1rem; align-items: center; padding: 0.9rem 1.25rem; border-top: 1px solid var(--line); }
.decide .what { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; font-weight: 650; }
.decide .meta { grid-column: 1; color: var(--muted); font-size: 0.92rem; }
.decide .btn { grid-column: 2; grid-row: 1 / span 2; }

/* Asset page */
.asset-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 0.5rem; }
.crumb { margin-bottom: 0.75rem; font-size: 0.95rem; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line-strong); margin: 1.25rem 0 1.25rem; overflow-x: auto; }
.tabs a { padding: 0.65rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current='page'] { color: var(--accent-deep); border-bottom-color: var(--accent); font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem 1.5rem; margin: 0; padding: 1.1rem 1.25rem 1.25rem; }
.facts dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }
.timeline { list-style: none; margin: 0; padding: 0 1.25rem 1rem; }
.timeline li { padding: 0.7rem 0 0.7rem 1rem; border-left: 3px solid var(--line); }
.timeline li.open { border-left-color: var(--accent); }
.inline-form { display: grid; grid-template-columns: minmax(12rem, 2fr) minmax(9rem, 1fr) auto; gap: 0.75rem; align-items: end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.asset-head ~ .actions { margin-top: 0.9rem; }
.asset-head ~ .chips { margin-top: 0.8rem; }

/* Categories */
.cat { padding: 0; overflow: hidden; }
.cat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 1rem 1.25rem; }
.cat-head h2 { font-size: 1.1rem; }
.cat-head .actions { margin-left: auto; }
.cat-body { border-top: 1px solid var(--line); }

/* Dialogs */
dialog { width: min(36rem, calc(100% - 1.5rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
dialog form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.dlg-scroll { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
dialog::backdrop { background: rgba(14, 27, 48, 0.5); }
.dlg-head { padding: 1.3rem 1.5rem 0.4rem; display: grid; gap: 0.3rem; }
.dlg-head h2 { font-size: 1.25rem; letter-spacing: -0.02em; }
.dlg-body { padding: 0.75rem 1.5rem 0.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; }
.dlg-body .wide { grid-column: 1 / -1; }
.dlg-head, .dlg-foot { flex: none; }
.dlg-foot { border-top: 1px solid var(--line); display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem 1.5rem 1.1rem; background: var(--surface-2); }
.form-error { grid-column: 1 / -1; background: var(--bad-wash); color: var(--bad); border: 1px solid var(--bad-line); border-radius: var(--radius); padding: 0.6rem 0.8rem; font-weight: 600; }
.checks { display: grid; gap: 0.1rem; }

.only-narrow { display: none; }
.col-wide-only { margin-top: 0.35rem; }
.name-cell { overflow-wrap: anywhere; }

/* Driver view */
.mine { display: grid; gap: 1rem; }
.mine-card { padding: 1.1rem 1.25rem; display: grid; gap: 0.6rem; }
.mine-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Sign-in, invite and the operator console */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-panel { background: var(--accent-deep); color: #fff; padding: 3rem 3.25rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.auth-panel .brand { color: #fff; }
.auth-panel h2 { font-size: 2rem; line-height: 1.15; letter-spacing: -0.03em; font-weight: 750; max-width: 22rem; }
.auth-panel p { max-width: 24rem; color: #dbe5ff; margin-top: 0.9rem; }
.auth-panel .steps { margin-top: 2.5rem; max-width: 26rem; }
.auth-panel .steps li { color: #c3d3ff; }
.auth-panel .steps b { color: #fff; }
.auth-panel .steps li::before { background: rgba(255, 255, 255, 0.35); }
.auth-panel .steps .dot { background: var(--accent-deep); border-color: rgba(255, 255, 255, 0.55); }
.auth-panel .steps li.done::before { background: #fff; }
.auth-panel .steps li.done .dot { background: #fff; border-color: #fff; color: var(--accent-deep); }
.auth-panel .steps li.now .dot { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2); }
.auth-panel .steps li.now b { color: #fff; }
.auth-panel .steps li:not(.done):not(.now) b { color: #dbe5ff; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login { width: 100%; max-width: 26rem; }
.login .brand { display: none; }
.login h1 { margin: 0 0 0.4rem; }
.demo-users { display: grid; gap: 0.5rem; margin-top: 1.25rem; }
.demo-users .btn { justify-content: space-between; text-align: left; width: 100%; }
.login-form { display: grid; gap: 0.9rem; margin-top: 1.1rem; }
.login-form .btn { justify-self: start; min-width: 8rem; }
.login-form .form-error { margin: 0; }
.login-demo { display: grid; justify-items: start; gap: 0.5rem; margin-top: 1.75rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.op-tag { font-size: 0.82rem; font-weight: 700; color: var(--accent-deep); background: var(--accent-wash); border: 1px solid var(--accent-line); border-radius: 999px; padding: 0.1rem 0.6rem; }
.topbar-plain { display: flex; align-items: center; gap: 1rem; min-height: 3.5rem; padding: 0 2rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-plain .brand { display: inline-flex; }
.topbar-plain .who { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }

.demo-banner { background: var(--accent-wash); color: var(--ink); border-bottom: 1px solid var(--accent-line); padding: 0.5rem 2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem 1.25rem; font-size: 0.95rem; }
.demo-role { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 600; }
.demo-role select { width: auto; min-height: 2.2rem; padding-block: 0.15rem; }
.secret-row { display: flex; gap: 0.5rem; }
.secret-row input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; }
.row-actions { justify-content: flex-end; flex-wrap: nowrap; gap: 0.1rem; }

/* Pre-starts, faults and forms */
.banner-bad { background: var(--bad-wash); border-color: var(--bad-line); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.filter-bar .filter-row { margin: 0; }
.fb-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.fb-dates > div { min-width: 9.5rem; }
tr.row-critical td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.thumb { padding: 0; width: 6rem; height: 6rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; cursor: pointer; display: inline-grid; place-items: center; }
.thumb:hover { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.missing { cursor: default; font-size: 0.8rem; color: var(--muted); text-align: center; padding: 0.4rem; }
.sig { height: 5rem; max-width: 14rem; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0.25rem; }
dialog.photo-dlg { width: min(60rem, calc(100% - 1.5rem)); }
.photo-wrap { overflow: auto; background: var(--ink); display: grid; place-items: center; min-height: 12rem; }
.photo-wrap img { max-width: 100%; max-height: calc(100vh - 10rem); display: block; }
.ans-wrap { margin-top: 1.25rem; display: grid; gap: 1.25rem; }
.ans-wrap .sheet + .sheet { margin-top: 0; }
.ans-list { margin: 0; padding: 0 0 0.5rem; }
.ans-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0.25rem 1.5rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--line); }
.ans-row dt { font-weight: 600; }
.ans-row dd { margin: 0; overflow-wrap: anywhere; }
.ans-note { margin: 0.4rem 0 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.45rem 0.7rem; overflow-wrap: anywhere; }
.ans-val { font-weight: 650; }
.sheet-pad .after-sheet { margin-top: 0.8rem; }

.block { display: block; }
.timeline p { margin: 0.15rem 0; overflow-wrap: anywhere; }
.fault-list { list-style: none; margin: 0; padding: 0 0 0.5rem; }
.fault-row { display: grid; gap: 0.25rem; padding: 0.6rem 1.25rem; color: var(--ink); text-decoration: none; }
.fault-row:hover { background: var(--surface-2); }
.fault-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fault-title { font-weight: 600; overflow-wrap: anywhere; }

/* The form builder */
.fb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1.5rem; align-items: start; margin-top: 1rem; }
.fb-main { display: grid; gap: 1.25rem; min-width: 0; }
.fb-main .sheet + .sheet { margin-top: 0; }
.fb-side { position: sticky; top: 1rem; }
.fb-status { min-height: 0; }
.fb-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 0.9rem 1rem; margin-top: 0.8rem; }
.fb-grid .wide { grid-column: 1 / -1; }
.fb-targets { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.1rem; }
.fb-targets fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.9rem 0.8rem; margin: 0; min-width: 0; }
.fb-targets legend { font-weight: 650; padding: 0 0.3rem; }
.fb-section { padding: 0; overflow: hidden; }
.fb-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.9rem 1.25rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.fb-section-title { flex: 1 1 14rem; min-width: 0; }
.fb-section-title input { font-weight: 700; }
.fb-tools { display: flex; gap: 0.1rem; flex: none; }
.fb-items { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.fb-item { padding: 0.9rem 1.25rem 1rem; border-top: 1px solid var(--line); }
.fb-item:first-child { border-top: 0; }
.fb-item-top { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: 0.5rem 0.7rem; align-items: center; }
.fb-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--neutral-wash); color: var(--neutral); font-size: 0.85rem; font-weight: 700; display: grid; place-items: center; }
.fb-item-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.6rem 1rem; margin: 0.7rem 0 0 2.3rem; align-items: end; }
.fb-item-body .c3 { grid-column: span 3; }
.fb-item-body .c4 { grid-column: span 4; }
.fb-item-body .c5 { grid-column: span 5; }
.fb-item-body .c6 { grid-column: span 6; }
.fb-item-body .c8 { grid-column: span 8; }
.fb-item-body .wide, .fb-flags { grid-column: 1 / -1; }
.fb-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem; }
.fb-flags .check { min-height: 2.2rem; }
.fb-versions h2 { margin-bottom: 0.4rem; }
.fb-item[data-type='check'] { border-left: 4px solid var(--accent-line); }
.fb-add { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.8rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.fb-add select { width: auto; min-height: 2.1rem; }
.fb-foot { margin-top: 1.25rem; display: flex; justify-content: flex-start; }
.fb-vlist { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.6rem; }

/* QR labels */
.qr-label { margin: 0; display: grid; justify-items: center; gap: 0.5rem; padding: 0.9rem; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: #000; width: 15rem; text-align: center; break-inside: avoid; }
.qr-label .qr { width: 11rem; height: 11rem; display: block; }
.qr-label figcaption { display: grid; gap: 0.1rem; line-height: 1.25; }
.qr-label figcaption b { font-size: 1.35rem; letter-spacing: 0.01em; }
.qr-label .qr-hint { font-size: 0.8rem; color: #333; margin-top: 0.2rem; }
.qr-preview { display: grid; justify-items: center; padding: 0.5rem 0; }
.label-grid { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.25rem; }
@media print {
  @page { margin: 10mm; }
  body { background: #fff; }
  body > *:not(dialog):not(#app), #toasts, .skip { display: none !important; }
  .sidebar, .topbar, .demo-banner, .scrim, .no-print { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  dialog[open] { position: static; width: auto; max-height: none; box-shadow: none; display: block; }
  dialog .dlg-head, dialog .dlg-foot { display: none; }
  body:has(dialog[open]) .shell { display: none; }
  .label-grid { gap: 6mm; margin-top: 0; }
  .qr-label { width: 62mm; border-width: 1.5px; padding: 3mm; gap: 2mm; page-break-inside: avoid; }
  .qr-label .qr { width: 44mm; height: 44mm; }
  .qr-label figcaption b { font-size: 14pt; }
}

/* Toasts */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; display: grid; gap: 0.5rem; z-index: 200; width: min(28rem, calc(100% - 2rem)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 0.75rem 1rem; border-radius: var(--radius); font-weight: 600; box-shadow: var(--shadow-pop); }
.toast.error { background: var(--bad); }

/* Developer docs */
.docs { max-width: 62rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.docs h1 { margin-bottom: 0.5rem; }
.docs h2 { margin: 2.2rem 0 0.6rem; font-size: 1.4rem; }
.docs p { margin: 0.5rem 0; max-width: 46rem; }
.docs code, .docs pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; }
.docs code { background: var(--neutral-wash); padding: 0.05rem 0.35rem; border-radius: 6px; }
.docs pre { background: var(--ink); color: #eef2fb; padding: 0.9rem 1rem; border-radius: var(--radius); overflow-x: auto; margin: 0.6rem 0; line-height: 1.45; }
.docs pre code { background: none; padding: 0; }
.endpoint { margin-top: 1rem; padding: 1rem 1.25rem; }
.endpoint-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.endpoint-head code { font-size: 1rem; background: none; padding: 0; font-weight: 700; }
.method { font-weight: 800; font-size: 0.82rem; letter-spacing: 0.03em; padding: 0.15rem 0.6rem; border-radius: 6px; color: #fff; background: var(--muted); }
.method-GET { background: var(--accent); }
.method-POST { background: var(--good); }
.method-PATCH { background: var(--warn); }
.method-DELETE { background: var(--bad); }
.docs table { margin: 0.5rem 0; }
.docs td, .docs th { padding: 0.4rem 0.6rem; vertical-align: top; }
.who-end { margin-left: auto; }
.after-sheet { margin-top: 1rem; }

/* The sign-in panel draws its steps in once, then stays still */
@keyframes step-in { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }
.auth-panel .steps li { animation: step-in 0.5s ease both; }
.auth-panel .steps li:nth-child(2) { animation-delay: 0.25s; }
.auth-panel .steps li:nth-child(3) { animation-delay: 0.5s; }

@media (max-width: 1000px) {
  .shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(18rem, 86vw); transform: translateX(-102%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; box-shadow: var(--shadow-pop); }
  .shell.nav-open .sidebar { transform: none; visibility: visible; transition: transform 0.2s ease; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(14, 27, 48, 0.45); z-index: 50; }
  .icon-btn.menu-btn { display: inline-flex; margin-left: -0.5rem; }
  .topbar { position: sticky; top: 0; z-index: 40; padding: 0 1rem; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line); }
  .topbar .brand { display: inline-flex; }
  main { padding: 1.25rem 1rem 4rem; }
  .demo-banner { padding: 0.5rem 1rem; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-panel { display: none; }
  .login .brand { display: inline-flex; margin-bottom: 1.5rem; }
  .topbar-plain { padding: 0 1rem; }
}
@media (max-width: 900px) {
  .fb-layout { grid-template-columns: minmax(0, 1fr); }
  .fb-side { position: static; order: -1; }
  .fb-targets { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .fb-grid { grid-template-columns: minmax(0, 1fr); }
  .fb-item-body { grid-template-columns: minmax(0, 1fr); margin-left: 0; }
  .fb-item-body .c3, .fb-item-body .c4, .fb-item-body .c5, .fb-item-body .c6, .fb-item-body .c8 { grid-column: 1 / -1; }
  .fb-item-top { grid-template-columns: 1.6rem minmax(0, 1fr); }
  .fb-item-top .fb-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .ans-row { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 1.5rem; }
  .col-opt { display: none; }
  .only-narrow { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
  .col-wide-only { display: none; }
  .dlg-body { grid-template-columns: 1fr; }
  .dlg-head { padding-inline: 1.1rem; }
  .dlg-body { padding-inline: 1.1rem; }
  .dlg-foot { padding-inline: 1.1rem; }
  .inline-form { grid-template-columns: 1fr; }
  .due-row { grid-template-columns: minmax(0, 1fr) auto; }
  .due-row .tag { grid-row: 1; }
  .due-row .main { grid-column: 1 / -1; grid-row: 2; }
  .counts dd { font-size: 1.7rem; }
  .decide { grid-template-columns: minmax(0, 1fr); }
  .decide .btn { grid-column: 1; grid-row: auto; justify-self: start; }
  .steps li { font-size: 0.8rem; }
  .req-head .badge { margin-left: 0; }
  .notif { grid-template-columns: 0.6rem minmax(0, 1fr); }
  .notif .when { grid-column: 2; }
  .page-head .actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
