/* ParkVision P5 — console styles.
 *
 * Designed to be usable by people who are not comfortable with computers and by people
 * with reduced vision, dexterity or colour perception. The specific decisions:
 *
 *   - Root font 18px (112.5%), not the browser default 16. Everything scales from it,
 *     so a user who raises their browser font size scales the whole interface.
 *   - Every interactive target is at least 48x48 CSS px. WCAG 2.2 SC 2.5.8 asks for 24;
 *     48 is what actually works for older hands and for anyone using a phone one-handed.
 *   - Text contrast >= 4.5:1, UI components >= 3:1 (SC 1.4.11). The state colours are
 *     inherited from P4's palette, which already meets this, and re-checked here.
 *   - State is ALWAYS icon + word + colour. Never colour alone (SC 1.4.1) — roughly 1 in
 *     12 men has some colour vision deficiency, and this is an operational tool.
 *   - Line length capped around 70 characters; line-height 1.6.
 *   - No animation beyond a spinner, and that respects prefers-reduced-motion.
 *
 * Self-contained: no external fonts, no CDN, nothing that a strict CSP would block or
 * that would leak a request to a third party.
 *
 * APPEARANCE (2026-09-17). This is an enforcement tool used on a street, not a product
 * anyone chose to install, so it is deliberately plain: square corners throughout, no
 * shadows, no tinted panels, no brand colour used for decoration. The palette is near
 * monochrome — paper, rule-grey, near-black ink — and the only saturated ink left is the
 * state vocabulary itself.
 *
 * Colour was ALREADY redundant here (state is icon + word + colour, SC 1.4.1), which is
 * what makes muting it safe: nothing is carried by hue alone, so desaturating removes
 * decoration without removing meaning. The contrast floors above are unchanged and every
 * value below was re-checked against them; the state inks are darker than before, not
 * lighter, so the margins went up. Target sizes, focus rings and reduced-motion handling
 * are untouched.
 */

:root {
  --bg: #f0f0f0;            /* paper, not a tinted "surface" */
  --surface: #ffffff;
  --surface-2: #e7e7e7;
  --text: #1a1a1a;          /* 15.9:1 on --surface */
  --text-muted: #474747;    /*  9.0:1 on --surface */
  --border: #9b9b9b;        /*  3.1:1 on --surface — a printed rule, meets SC 1.4.11 */
  --brand: #1f3350;         /* 11.7:1 on white. One sober ink for actions and links. */
  --brand-dark: #142235;
  --brand-ink: #ffffff;
  --focus: #1f3350;

  /* The state vocabulary. Darker than the previous palette, and paired with backgrounds
     that are barely off-white: the word and the icon do the work, the ink confirms it. */
  --avail: #1c4a24;         /*  8.4:1 */
  --avail-bg: #eef1ee;
  --limited: #6a4600;       /*  7.4:1 */
  --limited-bg: #f2efe8;
  --full: #7d1620;          /*  9.3:1 */
  --full-bg: #f3eded;
  --stale: #474747;
  --stale-bg: #e7e7e7;

  --radius: 0;              /* square, everywhere */
  --shadow: none;
  --tap: 48px;              /* minimum interactive target — unchanged */
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212; --surface: #1c1c1c; --surface-2: #262626;
    --text: #ededed; --text-muted: #b4b4b4; --border: #5a5a5a;
    --brand: #a8c0dc; --brand-dark: #c3d5e9; --brand-ink: #101820; --focus: #c3d5e9;
    --avail: #9cc9a4; --avail-bg: #1f251f;
    --limited: #d8bd86; --limited-bg: #262218;
    --full: #e6a3a9; --full-bg: #2a1c1d;
    --stale: #b4b4b4; --stale-bg: #262626;
  }
}
@media (prefers-contrast: more) {
  :root { --border: #000; --text-muted: #2b3038; }
}

* { box-sizing: border-box; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .3em; }
h2 { font-size: 1.15rem; line-height: 1.3;  margin: 1.5rem 0 .5rem; }
h3 { font-size: 1.1rem;  margin: 0 0 .4rem; }
p  { margin: 0 0 .9rem; max-width: var(--measure); }

a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--brand-ink);
  padding: 14px 20px; font-weight: 700; border-radius: 0;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px clamp(14px, 4vw, 32px);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none;
         color: var(--text); min-height: var(--tap); }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 0; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); font-weight: 700; font-size: 1.2rem;
}
.brand-mark-lg { width: 60px; height: 60px; font-size: 1.9rem; margin: 0 auto .8rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; }
.brand-tenant { font-size: .8rem; color: var(--text-muted); }

.mainnav { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.mainnav a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  padding: 0 16px; border-radius: 0; text-decoration: none;
  color: var(--text); font-weight: 600;
}
.mainnav a:hover { background: var(--surface-2); }
.mainnav a[aria-current="page"] {
  background: var(--brand); color: var(--brand-ink);
}
.signout { margin: 0; }

/* ---------------------------------------------------------------- layout */
.page { max-width: 1180px; margin: 0 auto; padding: clamp(18px, 4vw, 36px); }
.page:focus { outline: none; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 1.4rem;
}
.lede { color: var(--text-muted); }
.form-narrow { max-width: 34rem; }
.stack > * + * { margin-top: 1.3rem; }

.crumbs { color: var(--text-muted); font-size: .9rem; margin-bottom: .8rem; }
.crumbs a { color: var(--text-muted); }


/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 22px;
  font: inherit; font-weight: 700; text-decoration: none;
  border-radius: 0; border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); color: var(--brand-ink); }
.btn-secondary {
  background: var(--surface); color: var(--brand); border-color: var(--brand);
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--full); border-color: var(--full); }
.btn-danger:hover { background: var(--full-bg); }
.btn-block { width: 100%; }
.btn-small { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- forms */
.field { margin: 0; }
.field label, .field legend {
  display: block; font-weight: 700; margin-bottom: .35rem; font-size: 1rem;
}
.optional { font-weight: 400; color: var(--text-muted); }
.hint { color: var(--text-muted); font-size: .92rem; margin: 0 0 .5rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field select {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  font: inherit; color: var(--text);
  background: var(--surface); border: 2px solid var(--border); border-radius: 0;
}
.field input:focus-visible { border-color: var(--brand); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-check { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: start; }
.field-check input { width: 28px; height: 28px; margin-top: .3rem; }
.field-check .hint { grid-column: 2; }
fieldset { border: 0; padding: 0; margin: 0; }

.input-code {
  font-size: 1.7rem; letter-spacing: .35em; text-align: center;
  font-variant-numeric: tabular-nums; max-width: 9ch;
}
.reveal {
  margin-top: .5rem; min-height: 40px; padding: 0 12px;
  background: none; border: 1px solid var(--border); border-radius: 0;
  font: inherit; font-size: .9rem; color: var(--text-muted); cursor: pointer;
}
.inline-form { margin-top: 1.2rem; display: grid; gap: 1rem; max-width: 34rem; }

/* ---------------------------------------------------------------- messages */
.error-summary {
  border: 3px solid var(--full); border-radius: 0;
  background: var(--full-bg); padding: 16px 20px; margin-bottom: 1.5rem;
}
.error-summary h2 { margin: 0 0 .4rem; font-size: 1.1rem; color: var(--full); }
.error-summary a { color: var(--full); font-weight: 700; }

.callout {
  border-left: 6px solid var(--brand); background: var(--surface);
  border-radius: 0; padding: 16px 20px; margin: 1.4rem 0;
  box-shadow: none;
}
.callout h2 { margin-top: 0; font-size: 1.05rem; }
.callout-warn { border-left-color: var(--limited); background: var(--limited-bg); }
.callout-warn h2 { color: var(--limited); }
/* A decision the device refused: the console and the street disagree about whether a
   notice was served and whether a photograph still exists. Loudest thing on the board. */
.callout-stalled { border-left-color: var(--full); background: var(--full-bg); }
.callout-stalled h2 { color: var(--full); }
.stalled-list { margin: 0.6rem 0 0; padding-left: 1.2rem; }
/* The live view with its map (staff): the picture and the car park's bays side by side on a
   wide screen, so the cars and the colours can be watched together; stacked when narrow. */
.live-pair { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1100px) { .live-pair { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.live-pair > * { min-width: 0; }
.live-pair .live-frame { display: block; width: 100%; max-width: 100%; height: auto; }
.live-pair .cm-svg { height: 52vh; min-height: 320px; }
/* A camera box's bay map awaiting a person (base.html): on every admin/operator page. */
.review-banner { margin-top: 0; }
.review-list { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.review-list li { margin: 0.25rem 0; }
.stalled-list li { margin: 0.3rem 0; }


/* ---------------------------------------------------------------- tiles */
.tiles {
  display: grid; gap: 10px; margin-bottom: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0; padding: 14px 16px;
}
.tile-attention { border-color: var(--limited); border-width: 2px; }
.tile-label { color: var(--text-muted); font-size: .95rem; margin: 0 0 .2rem; }
.tile-value {
  font-size: 2rem; font-weight: 700; line-height: 1; margin: 0 0 .2rem;
  font-variant-numeric: tabular-nums;
}
.tile-note { color: var(--text-muted); font-size: .9rem; margin: 0; }

/* ---------------------------------------------------------------- cards */
.card-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0; padding: 14px 16px;
}
.card-lg { max-width: 30rem; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: .6rem;
}
.card-head h3 { margin: 0; }
.big-number {
  margin: .2rem 0 .4rem; display: flex; align-items: baseline; gap: .5rem;
  font-variant-numeric: tabular-nums;
}
.big-number .free { font-size: 2.1rem; font-weight: 700; line-height: 1; }
.big-number .of { color: var(--text-muted); font-size: 1rem; font-weight: 600; }
.card-meta { color: var(--text-muted); font-size: .9rem; margin: 0 0 .7rem; }

.meter { height: 12px; border-radius: 0; background: var(--surface-2); overflow: hidden; }
/* Empty until occupancy.js sets the width through the CSSOM — an inline style="" here is
   refused by the CSP (style-src 'self'), which is why the default lives in the sheet. */
.meter-fill { width: 0; height: 100%; background: var(--text-muted); }

/* State: colour AND icon AND word. */
.status {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font-weight: 700; font-size: .9rem; padding: 6px 12px;
  border-radius: 0; border: 2px solid transparent;
}
.status[data-state="available"] { color: var(--avail); background: var(--avail-bg); border-color: var(--avail); }
.status[data-state="limited"]   { color: var(--limited); background: var(--limited-bg); border-color: var(--limited); }
.status[data-state="full"]      { color: var(--full); background: var(--full-bg); border-color: var(--full); }
.status[data-state="stale"],
.status[data-state="unknown"]   { color: var(--stale); background: var(--stale-bg); border-color: var(--stale); }

.status-badge {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 0; font-size: 1.15rem; font-weight: 700;
}
.status-ok { background: var(--avail-bg); color: var(--avail); border: 2px solid var(--avail); }

.live-pill {
  margin: 0; font-size: .9rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface-2); padding: 8px 14px; border-radius: 0;
}
.live-pill[data-live="yes"] { background: var(--avail-bg); color: var(--avail); }
.live-pill[data-live="degraded"] { background: var(--limited-bg); color: var(--limited); }

/* ---------------------------------------------------------------- tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: 0;
  overflow: hidden; min-width: 40rem;
}
.data-table th, .data-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table thead th { background: var(--surface-2); font-size: .9rem; }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }
.tag {
  display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px;
  border-radius: 0; background: var(--stale-bg); color: var(--stale);
}
.tag-current { background: var(--avail-bg); color: var(--avail); }

.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.5rem; margin: 0 0 2rem; }
.detail-list dt { font-weight: 700; }
.detail-list dd { margin: 0; }
.plain-list { padding-left: 1.2rem; }

/* ---------------------------------------------------------------- wizard */
.wizard-steps {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px;
  margin: 0 0 1.6rem; padding: 0; font-size: .95rem;
}
.wizard-steps li {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px;
  border-radius: 0; background: var(--surface-2); color: var(--text-muted);
}
.wizard-steps li[aria-current="step"] {
  background: var(--brand); color: var(--brand-ink); font-weight: 700;
}
.wizard-steps li.done { background: var(--avail-bg); color: var(--avail); font-weight: 600; }
.wizard-num {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 0; background: rgba(255, 255, 255, .35); font-weight: 700; font-size: .85rem;
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.5rem 0; }
.steps > li {
  position: relative; padding: 0 0 1.6rem 3.2rem; margin: 0;
  border-left: 3px solid var(--border); padding-top: .1rem;
}
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -1.05rem; top: 0;
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
  border-radius: 0; background: var(--brand); color: var(--brand-ink); font-weight: 700;
}
.steps h2 { margin-top: 0; font-size: 1.05rem; }

/* ---------------------------------------------------------------- secrets */
.secret-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.secret {
  flex: 1 1 20rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem; word-break: break-all; background: var(--surface-2);
  border: 2px dashed var(--border); border-radius: 0; padding: 14px 16px;
}
.secret-lg { font-size: 1.1rem; }

.codeblock-wrap { position: relative; margin: 1rem 0 1.4rem; display: grid; gap: 10px; }
.codeblock {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  background: #10151c; color: #e7edf5; border-radius: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92rem; line-height: 1.5;
}
.code-grid {
  list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.code-grid code {
  display: block; text-align: center; padding: 12px; border-radius: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 1.05rem; letter-spacing: .06em;
}
.qr { max-width: 220px; margin: 1rem 0; background: #fff; padding: 12px; border-radius: 0; }
.qr svg { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- live panel */
.live-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0; padding: 16px; margin-bottom: 1.4rem;
}
.waiting-title { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.spinner {
  width: 22px; height: 22px; flex: none; border-radius: 0;
  border: 3px solid var(--border); border-top-color: var(--brand);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.connected-banner {
  display: flex; align-items: center; gap: 14px; font-size: 1.15rem;
  background: var(--avail-bg); color: var(--avail);
  border: 2px solid var(--avail); border-radius: 0; padding: 14px 18px;
  max-width: none;
}
.diagnostics {
  margin: 1.2rem 0; padding: 14px 18px; border-radius: 0;
  background: var(--limited-bg); border: 1px solid var(--limited);
}
.diagnostics h3 { color: var(--limited); }

.detail-block { margin: 1.2rem 0; }
.detail-block summary, .recovery summary {
  cursor: pointer; font-weight: 700; padding: 12px 0; min-height: var(--tap);
  display: flex; align-items: center; color: var(--brand);
}
.recovery { margin-top: 1.5rem; border-top: 1px solid var(--border); }

.empty-state {
  background: var(--surface); border: 2px dashed var(--border);
  border-radius: 0; padding: 20px; text-align: center;
}
.empty-state p { margin-left: auto; margin-right: auto; }

/* ---------------------------------------------------------------- auth pages */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card {
  width: 100%; max-width: 30rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 0;
  padding: clamp(20px, 4vw, 28px);
}
.auth-card-wide { max-width: 44rem; }
.auth-brand { text-align: center; margin-bottom: 1.6rem; }
.auth-brand h1 { font-size: 1.5rem; }
.signout-link { margin-top: 1.4rem; text-align: center; }

/* ---------------------------------------------------------------- timeout dialog */
.timeout-dialog {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(10, 14, 20, .6); padding: 20px;
}
.timeout-dialog[hidden] { display: none; }
.timeout-box {
  background: var(--surface); border-radius: 0; padding: 28px;
  max-width: 28rem; box-shadow: none;
}
.timeout-box h2 { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition: none !important; }
}

@media (max-width: 640px) {
  html { font-size: 106%; }
  .topbar-inner { gap: 10px; }
  .mainnav { order: 3; width: 100%; }
  .mainnav a { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
  .field-pair { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
}

/* --------------------------------------------------------------------------- */
/* Officer dispatch.                                                            */
/*                                                                              */
/* Read at arm's length, outdoors, one-handed, in a hurry — so the job list is  */
/* cards rather than a table (a table forces a horizontal scroll on a phone and */
/* puts the least important column first), every target keeps the 48px minimum, */
/* and state is always a word as well as a colour.                              */
/* --------------------------------------------------------------------------- */
.job-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.job-card {
  background: var(--surface); border: 1px solid var(--border); border-left-width: 6px;
  border-radius: 0; padding: 12px 14px;
}
.job-card[data-state="new"] { border-left-color: var(--limited); }
.job-card[data-state="assigned"] { border-left-color: var(--brand); }
.job-card[data-state="accepted"],
.job-card[data-state="on_scene"] { border-left-color: var(--avail); }
.job-what {
  display: block; font-size: 1.15rem; font-weight: 600; line-height: 1.35;
  min-height: var(--tap); text-decoration: none; color: var(--text);
}
.job-what:hover { text-decoration: underline; }
.job-where { margin: .4rem 0 .2rem; display: flex; flex-wrap: wrap; gap: 0 10px; }
.job-area { color: var(--text-muted); }
.job-site { font-weight: 600; }
.job-bay { font-weight: 700; color: var(--text); }
.job-detail { color: var(--text-muted); flex-basis: 100%; }
.job-meta { margin: .3rem 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.job-age { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.job-detail-head h1 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.job-facts { margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0 18px; }

.code-chip {
  display: inline-block; padding: 2px 8px; border-radius: 0; font-size: .95rem;
  font-weight: 700; background: var(--surface-2); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 0; font-size: .85rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.pill-state { text-transform: capitalize; }
.pill-warn { background: var(--limited-bg); border-color: var(--limited); color: var(--limited); }

.back-link { display: inline-block; min-height: var(--tap); line-height: var(--tap); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }
/* A qualifier under its value, not run on to the end of it: "Needs an officer's
   judgement" followed inline by a rule name read as one sentence. */
.facts .hint { display: block; }
.where-line { margin: 0 0 .2rem; font-size: 1.1rem; }
.where-bay { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.where-detail { margin: .2rem 0 .6rem; font-size: 1.05rem; }

.radio { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: start;
         min-height: var(--tap); padding: .35rem 0; }
.radio input { width: 26px; height: 26px; margin-top: .35rem; }
.btn-lg { min-height: 56px; font-size: 1.1rem; width: 100%; }
.release-form { margin-top: 1.2rem; display: flex; gap: 10px; flex-wrap: wrap;
                align-items: center; }
.row-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0; }
.row-form input, .row-form select {
  min-height: var(--tap); padding: 0 10px; border: 1px solid var(--border);
  border-radius: 0; font: inherit; background: var(--surface); flex: 1 1 12rem;
}
.field-inline { font-weight: 600; }
.two-col { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.board tr[data-overdue="1"] th, .board tr[data-overdue="1"] td { background: var(--limited-bg); }

@media (max-width: 640px) {
  .job-what { font-size: 1.05rem; }
  .facts { grid-template-columns: 1fr; gap: .1rem .5rem; }
  .facts dd { margin-bottom: .5rem; }
}

/* ================================================================ parking insights
 * /console/insights — the council map and its figures.
 *
 * DATA colours only; the console's chrome stays as it is. Every value below was checked with
 * the data-viz validator (validate_palette.js), not chosen by eye:
 *   --dur-*   an ORDINAL one-hue ramp for "how long parked" (<5 min … >3 h): lightness strictly
 *             monotone, adjacent steps >= 0.06 L apart, lightest step >= 2:1 on the surface it
 *             sits on (light 2.22:1 on white; dark 2.90:1 on #1c1c1c, 2.44:1 on a dark bay).
 *             The dark ramp flips its anchor: the shortest stay sits nearest the surface.
 *   --util-*  a SEQUENTIAL ramp (utilisation, turnover, the week heatmap): the reference
 *             palette's documented blue steps. Near-zero is allowed to recede into the surface.
 * Colour never carries a value alone: free is a RING, not visible a DASHED ring, occupied a
 * filled dot; every chart has words or a table beside it, and every mark a title.
 */
:root {
  --dur-0: #f39946; --dur-1: #e1712d; --dur-2: #c65029; --dur-3: #a63a2a; --dur-4: #822c27;
  --util-0: #b7d3f6; --util-1: #6da7ec; --util-2: #2a78d6; --util-3: #1c5cab; --util-4: #0d366b;
  --dur-free: var(--avail);
  --dur-unknown: #9b9b9b;
  --dur-timeless: #5c5c5c;
  --occ-ink: #3a3a3a;
  --plan-ground: #f1efea;
  --bay-fill: #ffffff;
  --bay-line: #8f8f8f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --dur-0: #a64736; --dur-1: #ca592e; --dur-2: #e57431; --dur-3: #f59749; --dur-4: #febb71;
    --util-0: #184f95; --util-1: #256abf; --util-2: #3987e5; --util-3: #6da7ec; --util-4: #b7d3f6;
    --dur-unknown: #6a6a6a;
    --dur-timeless: #a8a8a8;
    --occ-ink: #d6d6d6;
    --plan-ground: #202020;
    --bay-fill: #2a2a2a;
    --bay-line: #6a6a6a;
  }
}
@media (prefers-contrast: more) {
  :root { --bay-line: #000; --dur-unknown: #555; }
}

.page-wide { max-width: 1600px; }
.h3 { font-size: 1.1rem; line-height: 1.3; margin: 0; }
.section-head { margin-top: 2rem; }

/* -- filters: one row above everything they filter ------------------------- */
.insights-filters {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border); padding: 10px 14px;
  margin: 0 0 1rem;
}
.insights-filters .filter { display: flex; flex-direction: column; gap: 4px; }
.insights-filters label { font-weight: 600; font-size: .9rem; }
.insights-filters select {
  min-height: var(--tap); padding: 0 10px; border: 1px solid var(--border); border-radius: 0;
  font: inherit; background: var(--surface); color: var(--text);
}
.filter-menu { position: relative; }
.filter-menu summary {
  min-height: var(--tap); display: flex; align-items: center; gap: 6px; padding: 0 12px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600;
}
.filter-menu fieldset {
  position: absolute; z-index: 6; margin: 4px 0 0; padding: 8px 12px; min-width: 17rem;
  display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border);
}
.check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 400; }
.check input { width: 22px; height: 22px; }

/* -- layout: the map beside its cards, stacked on a narrow screen ----------- */
.insights-layout {
  display: grid; gap: 14px; align-items: start;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
}
.insights-side { display: grid; gap: 14px; }
.insights-grid {
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.card-wide { grid-column: 1 / -1; }
/* The console's tables are 40rem wide at least; the small tables in a grid card are not. */
.insights-grid .card:not(.card-wide) .data-table { min-width: 0; }
@media (max-width: 1000px) { .insights-layout { grid-template-columns: 1fr; } }

/* -- the map ---------------------------------------------------------------- */
.map-card .card-head { align-items: center; }
.map-tools { display: flex; gap: 6px; }
.btn-icon { min-width: var(--tap); min-height: var(--tap); padding: 0; font-size: 1.2rem; }
.plan-wrap { background: var(--plan-ground); border: 1px solid var(--border); overflow: hidden; }
.site-plan {
  display: block; width: 100%; height: auto; max-height: 72vh; cursor: grab;
  touch-action: none; user-select: none;
}
.site-plan.dragging { cursor: grabbing; }
.map-card:fullscreen { background: var(--bg); padding: 16px; overflow: auto; }
.map-card:fullscreen .site-plan { height: calc(100vh - 170px); }
.bay-shape { fill: var(--bay-fill); stroke: var(--bay-line); stroke-width: .08; }
.bay-nonsupply .bay-shape { fill: url(#hatch); }
.hatch-line { stroke: var(--bay-line); stroke-width: .16; }
.bay-dot { stroke: var(--bay-fill); stroke-width: .08; }
.bay-num { fill: var(--text); font-weight: 600; pointer-events: none; }
.bay[data-cls="d0"] .bay-dot { fill: var(--dur-0); }
.bay[data-cls="d1"] .bay-dot { fill: var(--dur-1); }
.bay[data-cls="d2"] .bay-dot { fill: var(--dur-2); }
.bay[data-cls="d3"] .bay-dot { fill: var(--dur-3); }
.bay[data-cls="d4"] .bay-dot { fill: var(--dur-4); }
.bay[data-cls="time_unknown"] .bay-dot { fill: var(--dur-timeless); }
.bay[data-cls="free"] .bay-dot { fill: none; stroke: var(--dur-free); stroke-width: .22; }
.bay[data-cls="unknown"] .bay-dot,
.bay[data-cls="u-none"] .bay-dot {
  fill: none; stroke: var(--dur-unknown); stroke-width: .16; stroke-dasharray: .22 .18;
}
.bay[data-cls="u0"] .bay-dot { fill: var(--util-0); }
.bay[data-cls="u1"] .bay-dot { fill: var(--util-1); }
.bay[data-cls="u2"] .bay-dot { fill: var(--util-2); }
.bay[data-cls="u3"] .bay-dot { fill: var(--util-3); }
.bay[data-cls="u4"] .bay-dot { fill: var(--util-4); }
.bay[data-dim="1"] { opacity: .2; }
.plan-sector { fill: var(--text); font-size: 1.3px; font-weight: 800; }
.plan-camera { fill: var(--text-muted); font-size: 1px; font-weight: 600; }

/* -- legends and swatches ----------------------------------------------------- */
.legend {
  list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap;
  gap: 4px 16px; font-size: .88rem; color: var(--text-muted);
}
.legend li { display: flex; align-items: center; }
.swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px;
  flex: none; box-sizing: border-box;
}
.sw-d0 { background: var(--dur-0); } .sw-d1 { background: var(--dur-1); }
.sw-d2 { background: var(--dur-2); } .sw-d3 { background: var(--dur-3); }
.sw-d4 { background: var(--dur-4); }
.sw-free { border: 3px solid var(--dur-free); }
.sw-unknown, .sw-u-none, .sw-h-none { border: 2px dashed var(--dur-unknown); }
.sw-time_unknown { background: var(--dur-timeless); }
.sw-u0, .sw-h0 { background: var(--util-0); } .sw-u1, .sw-h1 { background: var(--util-1); }
.sw-u2, .sw-h2 { background: var(--util-2); } .sw-u3, .sw-h3 { background: var(--util-3); }
.sw-u4, .sw-h4 { background: var(--util-4); }
.sw-occupied { background: var(--occ-ink); border-radius: 0; }
.legend .sw-free, .legend .sw-unknown { border-radius: 50%; }

/* -- the cards ---------------------------------------------------------------- */
.side-card .card-head, .insights-grid .card-head { align-items: center; }
.big-figure {
  font-size: 2.2rem; font-weight: 700; line-height: 1.1; margin: .2rem 0 .4rem;
}
.occ-row {
  display: grid; grid-template-columns: minmax(140px, 1fr) auto; gap: 12px; align-items: center;
}
.occ-counts { display: grid; gap: 2px; margin: 0; }
.occ-counts div { display: flex; justify-content: space-between; gap: 18px; }
.occ-counts dt { color: var(--text-muted); }
.occ-counts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar-label { margin: .6rem 0 .25rem; font-weight: 700; }
.hbar { display: block; width: 100%; height: 14px; }
.hb-track { fill: var(--surface-2); }
.hb-occupied { fill: var(--occ-ink); }
.hb-free { fill: var(--dur-free); }
.hb-unknown { fill: var(--dur-unknown); }
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 11rem; }
.bar-cell .hbar { flex: 1; min-width: 6rem; }
.sector-name {
  min-height: var(--tap); width: 100%; max-width: 22rem; padding: 0 10px; font: inherit;
  border: 1px solid var(--border); border-radius: 0; background: var(--surface); color: var(--text);
}
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: .8rem 0; }
.mini-stats dt { color: var(--text-muted); font-size: .85rem; }
.mini-stats dd { margin: 0; font-weight: 700; }

/* -- charts: marks in data colours, chrome recessive --------------------------- */
.gauge { width: 100%; max-width: 220px; }
.gauge-bg, .gauge-fg { fill: none; stroke-width: 24; }
.gauge-bg { stroke: var(--surface-2); }
.gauge-fg { stroke: var(--occ-ink); }
.gauge-pct { fill: var(--text); font-size: 26px; font-weight: 700; }
.gauge-sub { fill: var(--text-muted); font-size: 12px; }
.vbars, .line24, .heatmap { display: block; width: 100%; height: auto; }
.heatmap { min-width: 520px; }
.axis-grid { stroke: var(--surface-2); stroke-width: 1; }
.axis-base { stroke: var(--border); stroke-width: 1; }
.axis-label { fill: var(--text-muted); font-size: 11px; }
.bar-value { fill: var(--text); font-size: 11px; font-weight: 600; }
.bar-free { fill: var(--dur-free); }
.bar-d0 { fill: var(--dur-0); } .bar-d1 { fill: var(--dur-1); } .bar-d2 { fill: var(--dur-2); }
.bar-d3 { fill: var(--dur-3); } .bar-d4 { fill: var(--dur-4); }
.bar-time_unknown { fill: var(--dur-timeless); }
.bar-arr { fill: var(--util-2); }
.line { fill: none; stroke: var(--util-2); stroke-width: 2; }
.line-point { fill: var(--util-2); stroke: var(--surface); stroke-width: 2; }
.threshold { stroke: var(--full); stroke-width: 1.5; stroke-dasharray: 5 4; }
.threshold-label { fill: var(--full); font-size: 11px; font-weight: 600; }
.heat { stroke: var(--surface); stroke-width: 1; }
.heat.h0 { fill: var(--util-0); } .heat.h1 { fill: var(--util-1); } .heat.h2 { fill: var(--util-2); }
.heat.h3 { fill: var(--util-3); } .heat.h4 { fill: var(--util-4); }
.heat.h-none { fill: var(--surface-2); }
