@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/static/fonts/manrope-var.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: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/static/fonts/manrope-var-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/plex-sans-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/static/fonts/plex-sans-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/plex-sans-600.woff2) format("woff2"); }
/* Quadcore — Quadrant Asset Management.
   Corporate light theme in Quadrant's brand; the Hub page (body.hud) keeps the dark command-centre look.
   Status colours only ever mean something. */
:root {
  /* Quadrant — graphite neutrals, one action blue, Quadrant leaf green for healthy/live. Status colour only ever means something. */
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #f7f8f9;
  --ink: #141a21;
  --ink-2: #47515d;
  --ink-3: #727c88;
  --line: #e1e4e8;
  --line-2: #eceef1;
  --bus: #111417;
  --bus-ink: #9ba4ae;
  --bus-hi: #ffffff;
  --brand: #1f6fe5;
  --brand-ink: #ffffff;
  --brand-soft: #e8f0fd;
  --link: #1a63d1;
  --navy: #141a21;
  --sun: #1f6fe5;
  --gold: #b7791f;
  --cyan: #1f6a8f;
  --leaf: #5a9e3a;
  --green: #2f8a46; --green-bg: #e5f3e8;
  --red: #c83a32;   --red-bg: #fbe9e7;
  --amber: #a86a00; --amber-bg: #fcf0dc;
  --blue: #2a63a8;  --blue-bg: #e7eef8;
  --violet: #6a55b5; --violet-bg: #efebfa;
  --grey: #5f6a76;  --grey-bg: #eff1f3;
  --focus: #1f6fe5;
  --radius: 8px;
  --row-hover: #f8f9fa; --input-bg: #ffffff; --input-line: #d3d8de; --seg-on: #141a21; --col-bg: #f0f2f4;
  --brand-hover: #1a60c8;
  --shadow: none;
  --glow: 0 0 0 3px rgba(31,111,229,.18);
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hud: var(--font);
  --mono: var(--font);
  color-scheme: light;
}
/* The Quadcore hub keeps the dark HUD look */
body.hud {
  --bg: #030c1c;
  --panel: rgba(8, 28, 58, .72);
  --panel-2: rgba(14, 42, 84, .65);
  --ink: #e6f4ff;
  --ink-2: #a9c8e6;
  --ink-3: #6a8bb0;
  --line: rgba(80, 170, 255, .28);
  --line-2: rgba(80, 170, 255, .14);
  --bus: rgba(2, 10, 24, .92);
  --bus-ink: #7fa6cf;
  --bus-hi: #ffffff;
  --brand: #31c8ff;
  --brand-ink: #02111f;
  --brand-soft: rgba(49, 200, 255, .14);
  --sun: #ffc94a;
  --gold: #ffc94a;
  --cyan: #31c8ff;
  --green: #3cf0a0; --green-bg: rgba(60,240,160,.12);
  --red: #ff4d5e;   --red-bg: rgba(255,77,94,.15);
  --amber: #ffc94a; --amber-bg: rgba(255,201,74,.13);
  --blue: #5ab8ff;  --blue-bg: rgba(90,184,255,.14);
  --violet: #b49bff; --violet-bg: rgba(180,155,255,.15);
  --grey: #8fa9c6;  --grey-bg: rgba(143,169,198,.12);
  --focus: #31c8ff;
  --radius: 6px;
  --shadow: none;
  --glow: 0 0 0 1px rgba(49,200,255,.55), 0 0 22px rgba(49,200,255,.28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --link: #31c8ff;
  --navy: #ffffff;
  --hud: var(--font);
  --mono: var(--font);
  color-scheme: dark;
}


* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num, td.n, .tab { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide-sm { }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- shell: sidebar + top bar */
:root { --nav-w: 236px; }
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--bus) var(--nav-w), transparent var(--nav-w)); }
.bus { background: var(--bus); color: var(--bus-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--bus-hi); }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.bus > .brand { padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.bus > .brand .brand-logo { display: block; width: 168px; height: auto; }
.bus > .brand .logo-tile { width: 38px; height: 38px; border-radius: 9px; background: #fff; display: grid; place-items: center; flex: none; }
.bus > .brand .wm { display: block; font-size: 14px; font-weight: 800; letter-spacing: .2em; color: #fff; line-height: 1.1; }
.bus > .brand .am { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; color: #5aa7ff; text-transform: uppercase; margin-top: 3px; }
.nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav .nav-h { font-size: 11px; font-weight: 600; color: #7f90a8; padding: 14px 12px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px; color: var(--bus-ink); font-weight: 500; font-size: 14px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #5aa7ff; }
.nav a.on svg { color: #5aa7ff; }
.nav svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav .count { margin-left: auto; font-size: 11px; background: var(--red); color: #fff; padding: 1px 7px; border-radius: 10px; font-weight: 700; }
.nav .count.info { background: rgba(255,255,255,.16); }
.nav .count.info.hot { background: var(--red); }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 12px; }
.bus-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 8px; color: var(--bus-ink); }
.me:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.me .who { min-width: 0; }
.me .who b { display: block; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { display: block; font-size: 11.5px; color: #8b9ab0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #5aa7ff; color: #0d2342; font-size: 12px; font-weight: 700; flex: none; }
.bus-foot form button { width: 34px; height: 34px; padding: 0; justify-content: center; background: transparent; border: 1px solid rgba(255,255,255,.14); color: var(--bus-ink); border-radius: 7px; }
.bus-foot form button:hover { background: rgba(255,255,255,.08); color: #fff; }
.bus-foot form button svg { width: 16px; height: 16px; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 28px; height: 60px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.topbar .page-title { font-size: 15px; font-weight: 650; color: var(--ink); }
.topbar form { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.topbar form svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.topbar input[type=search] { width: 100%; background: var(--panel-2); border-color: var(--line); height: 38px; padding-left: 34px; border-radius: 8px; }
.sys { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; background: var(--green-bg); border: 1px solid transparent; font-size: 12.5px; font-weight: 600; color: var(--green); white-space: nowrap; }
.sys:hover { text-decoration: none; filter: brightness(.97); }
.sys i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sys.warn { background: var(--amber-bg); color: var(--amber); }
.sys.warn i { background: var(--amber); }
.sys.alarm { background: var(--red-bg); color: var(--red); }
.sys.alarm i { background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.clock { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; white-space: nowrap; text-align: right; line-height: 1.2; }
.clock small { display: block; color: var(--ink-3); font-size: 11px; }
.menu-btn { display: none; }
.content { padding: 26px 28px 64px; max-width: 1440px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); margin-top: 4px; }
.crumbs { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- controls */
button, .btn { font: inherit; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; line-height: 1.3; white-space: nowrap; }
button:hover, .btn:hover { background: var(--panel-2); text-decoration: none; }
.btn.primary, button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover, button.primary:hover { filter: brightness(1.08); }
.btn.danger, button.danger { color: var(--red); }
.btn.danger:hover, button.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.sm, button.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.ghost, button.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover, button.ghost:hover { background: var(--panel-2); }
button.link { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button.link.danger { color: var(--red); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; width: 100%; min-height: 36px; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); }
label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 5px; }
.help { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.err { color: var(--red); font-size: 12px; margin-top: 4px; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--red); }
.inline-form { display: inline; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 2px; }
.seg a { padding: 5px 12px; border-radius: 6px; color: var(--ink-2); font-weight: 550; font-size: 13px; }
.seg a:hover { text-decoration: none; background: var(--panel-2); }
.seg a.on { background: var(--ink); color: var(--panel); }

/* ---------------------------------------------------------------- panels & tables */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.panel-head .muted { font-weight: 400; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 4px 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.g-main > div { min-width: 0; }
.stack > * + * { margin-top: 16px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
th.n, td.n { text-align: right; }
.table-wrap { overflow-x: auto; }
.panel > .table-wrap > table th:first-child, .panel > .table-wrap > table td:first-child { padding-left: 16px; }
.panel > .table-wrap > table th:last-child, .panel > .table-wrap > table td:last-child { padding-right: 16px; }
td .title { font-weight: 600; color: var(--ink); }
td .title:hover { color: var(--brand); }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; margin: 0; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.prewrap { white-space: pre-wrap; }

/* ---------------------------------------------------------------- status */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 8px; border-radius: 20px; white-space: nowrap; background: var(--grey-bg); color: var(--grey); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.badge.plain::before { display: none; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); }

/* ---------------------------------------------------------------- dashboard readouts */
.readouts { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.readout { padding: 16px 18px; border-left: 1px solid var(--line-2); }
.readout:first-child { border-left: 0; }
.readout .v { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.readout .v small { font-size: 14px; font-weight: 550; color: var(--ink-3); margin-left: 3px; }
.readout .k { color: var(--ink-2); font-weight: 550; margin-top: 2px; }
.readout .d { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; }
.readout .d .bad { color: var(--red); font-weight: 600; }

/* single-line-diagram priority bus */
.prio-bus { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; padding-top: 10px; }
.prio-bus::before { content: ""; position: absolute; top: 10px; left: 12.5%; right: 12.5%; height: 3px; background: var(--ink); border-radius: 2px; }
.prio-bus a { position: relative; text-align: center; padding-top: 22px; color: var(--ink); }
.prio-bus a::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 22px; background: var(--ink); transform: translateX(-50%); }
.prio-bus a:hover { text-decoration: none; }
.prio-bus .node { display: inline-grid; place-items: center; min-width: 52px; height: 52px; padding: 0 8px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prio-bus a.p1 .node { border-color: var(--red); color: var(--red); }
.prio-bus a.p1.live .node { background: var(--red); color: #fff; }
.prio-bus a.p2 .node { border-color: var(--amber); color: var(--amber); }
.prio-bus a.p3 .node { border-color: var(--blue); color: var(--blue); }
.prio-bus a.p4 .node { border-color: var(--grey); color: var(--grey); }
.prio-bus .lbl { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 550; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { color: var(--ink-3); font-size: 12.5px; }
.empty { padding: 22px 16px; color: var(--ink-3); text-align: center; }
.empty .btn { margin-top: 10px; }

/* ---------------------------------------------------------------- activity timeline */
.timeline { list-style: none; margin: 0; padding: 4px 16px 8px; }
.timeline li { position: relative; padding: 10px 0 10px 22px; border-left: 2px solid var(--line-2); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--ink-3); }
.timeline li.k-Call::before { border-color: var(--green); }
.timeline li.k-Email::before { border-color: var(--blue); }
.timeline li.k-Meeting::before { border-color: var(--violet); }
.timeline li.k-Site\ visit::before { border-color: var(--sun); }
.timeline .meta { color: var(--ink-3); font-size: 12px; }
.timeline .body { margin-top: 3px; color: var(--ink-2); white-space: pre-wrap; }
.composer { padding: 12px 16px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; }
.composer .row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.composer textarea { min-height: 60px; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .count { color: var(--ink-3); font-weight: 500; margin-left: 4px; }

/* ---------------------------------------------------------------- pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(205px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.col-head { padding: 11px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.col-head .muted { font-size: 12px; }
.col-body { padding: 8px; display: grid; gap: 8px; align-content: start; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; color: var(--ink); }
.card:hover { border-color: var(--ink-3); text-decoration: none; }
.card b { display: block; font-weight: 600; line-height: 1.35; }
.card .meta { color: var(--ink-3); font-size: 12px; margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }
.card .due { color: var(--amber); font-weight: 600; }
.card .due.late { color: var(--red); }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .check { display: flex; align-items: center; gap: 8px; padding-top: 24px; }
.form-grid .check label { margin: 0; }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 16px; border-top: 1px solid var(--line-2); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.narrow { max-width: 820px; }
.invite-grid { grid-template-columns: 1fr 1.3fr 1fr 1.2fr auto; align-items: end; }

/* ---------------------------------------------------------------- flash */
.flash { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 550; border: 1px solid; }
.flash.ok { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.flash.error { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.flash.warn { background: var(--amber-bg); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }

/* ---------------------------------------------------------------- auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-art { background: var(--bus); color: var(--bus-ink); padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .brand { padding: 0; }
.auth-art svg.sld { position: absolute; right: -40px; bottom: 60px; width: 520px; max-width: 110%; opacity: .55; }
.auth-art .line { max-width: 360px; color: #fff; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; position: relative; }
.auth-art .line span { display: block; color: var(--bus-ink); font-size: 14px; font-weight: 400; letter-spacing: 0; margin-top: 10px; line-height: 1.5; }
.auth-art .fine { font-size: 12px; opacity: .6; position: relative; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--panel); }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { margin-bottom: 6px; }
.auth-box .lead { color: var(--ink-2); margin-bottom: 22px; }
.auth-box .field { margin-bottom: 14px; }
.auth-box button.primary { width: 100%; justify-content: center; padding: 10px; margin-top: 6px; }
.auth-box .alt { margin-top: 18px; color: var(--ink-3); font-size: 12.5px; }
.code-input { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; font-family: var(--mono); padding: 10px; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; width: 196px; height: 196px; margin: 4px 0 12px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-family: var(--mono); font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; user-select: all; word-break: break-all; }
.steps { padding-left: 18px; color: var(--ink-2); margin: 0 0 16px; }
.steps li { margin-bottom: 6px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: var(--mono); font-size: 15px; background: var(--panel-2); border: 1px dashed var(--line); border-radius: 8px; padding: 14px; margin: 14px 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: var(--mono); font-size: 12.5px; }

/* ---------------------------------------------------------------- misc */
.kv-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); }
.kv-inline b { color: var(--ink); font-weight: 600; }
.warn-strip { background: var(--amber-bg); color: var(--amber); padding: 9px 16px; border-bottom: 1px solid var(--line-2); font-weight: 550; font-size: 13px; }
details.more summary { cursor: pointer; color: var(--brand); font-weight: 550; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.loading { padding: 18px 16px; color: var(--ink-3); }
.file-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.scrim { display: none; }

/* ---------------------------------------------------------------- command-centre component tuning */
body.hud .panel { background: var(--panel); border-color: var(--line-2); }
body.hud .panel-head { border-bottom-color: var(--line-2); padding: 12px 16px; }
body.hud .panel-head h2 { font-size: 14px; font-weight: 600; color: var(--ink); }
body.hud th { background: transparent; color: var(--ink-3); font-weight: 500; border-bottom-color: var(--line-2); }
body.hud tbody tr:hover td { background: rgba(255,255,255,.025); }
body.hud input, body.hud select, body.hud textarea { background: #121519; border-color: var(--line); }
body.hud input::placeholder, body.hud textarea::placeholder { color: #5f6773; }
body.hud button, body.hud .btn { background: var(--panel-2); border-color: var(--line); }
body.hud button:hover, body.hud .btn:hover { background: #272c34; }
body.hud .btn.primary, body.hud button.primary { box-shadow: 0 0 14px rgba(59,140,255,.25); }
body.hud .seg { background: var(--panel); border-color: var(--line); }
body.hud .seg a.on { background: var(--brand); color: #fff; }
body.hud .tabs { border-bottom-color: var(--line-2); }
body.hud .tabs a.on { border-bottom-color: var(--brand); }
body.hud .tag { background: var(--panel-2); border-color: var(--line); }
body.hud .avatar { background: #262b33; }

body.hud .readouts { background: transparent; border: 0; gap: 12px; overflow: visible; }
body.hud .readout { position: relative; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px 15px; overflow: hidden; }
body.hud .readout:first-child { border-left: 1px solid var(--line-2); }
body.hud .readout::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--tone, var(--brand)); opacity: .9; }
body.hud .readout.t-green { --tone: var(--green); } body.hud .readout.t-amber { --tone: var(--amber); } body.hud .readout.t-red { --tone: var(--red); } body.hud .readout.t-violet { --tone: var(--violet); }
body.hud .readout .v { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
body.hud .readout .k { color: var(--ink-3); font-weight: 500; font-size: 13px; }

body.hud .prio-bus::before { background: var(--line); }
body.hud .prio-bus a::before { background: var(--line); }
body.hud .prio-bus .node { background: var(--bg); border-width: 2px; }
body.hud .prio-bus a.p1.live .node { background: var(--red); color: #fff; box-shadow: 0 0 22px rgba(255,90,82,.55); border-color: var(--red); }
body.hud .prio-bus a.p2.live .node { box-shadow: 0 0 16px rgba(245,179,60,.35); }

body.hud .col { background: var(--panel); border-color: var(--line-2); }
body.hud .col-head { border-bottom-color: var(--line-2); }
body.hud .card { background: var(--panel-2); border-color: var(--line); }
body.hud .card:hover { border-color: var(--brand); box-shadow: var(--glow); }
body.hud .list li { border-bottom-color: var(--line-2); }
body.hud .timeline li { border-left-color: var(--line); }
body.hud .composer { border-bottom-color: var(--line-2); }
body.hud .form-foot { background: var(--panel-2); border-top-color: var(--line-2); }
body.hud .qr { background: #fff; }
body.hud .secret, body.hud .codes { background: #121519; }
body.hud .auth-main { background: var(--bg); }
body.hud .auth-art { background: radial-gradient(ellipse at 20% 0%, #14284a 0%, var(--bus) 60%); border-right: 1px solid var(--line-2); }
body.hud .auth-art svg.sld { stroke: #3b4a63; opacity: .9; }
body.hud .empty { color: var(--ink-3); }
body.hud ::selection { background: rgba(59,140,255,.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2f37; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- hub map */
.content.wide { padding: 0; max-width: none; }
.content.wide > .flash { margin: 12px 16px 0; }
.hub { position: relative; height: calc(100vh - 58px); min-height: 520px; }
.map { background: #0b0d10; }
.hub-map { position: absolute; inset: 0; }
.site-map { height: 460px; border-radius: var(--radius); }
.map-panel { overflow: hidden; }
.map-note { padding: 10px 16px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line-2); }
.hub-strip { position: absolute; top: 14px; left: 60px; right: 400px; z-index: 500; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.chip { pointer-events: auto; display: flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 10px; background: rgba(24,27,32,.92); border: 1px solid var(--line); backdrop-filter: blur(8px); font-size: 12.5px; color: var(--ink-3); }
.chip b { color: var(--ink); font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chip.alarm { border-color: rgba(255,90,82,.6); background: rgba(58,20,20,.92); }
.chip.alarm b { color: var(--red); }
.hub-side { position: absolute; top: 14px; right: 14px; bottom: 14px; width: 370px; z-index: 500; display: flex; flex-direction: column; background: rgba(24,27,32,.96); backdrop-filter: blur(8px); }
.hub-side-body { overflow-y: auto; flex: 1; }
.hub-side-foot { padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; }
.side-h { padding: 12px 16px 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-top: 1px solid var(--line-2); }
.site-row { cursor: pointer; }
.site-row:hover { background: rgba(255,255,255,.03); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--grey); }
.dot.green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.red { background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse 1.6s ease-in-out infinite; }
.dot.violet { background: var(--violet); }

/* markers */
.qc-site { position: relative; }
.qc-site .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--green); background: rgba(60,207,122,.15); box-shadow: 0 0 18px rgba(60,207,122,.45); }
.qc-site.warn .ring { border-color: var(--amber); background: rgba(245,179,60,.15); box-shadow: 0 0 18px rgba(245,179,60,.45); }
.qc-site.alarm .ring { border-color: var(--red); background: rgba(255,90,82,.2); box-shadow: 0 0 24px rgba(255,90,82,.7); animation: pulse 1.6s ease-in-out infinite; }
.qc-site .qc-core { position: absolute; inset: 0; display: grid; place-items: center; font: 700 10px/1 var(--font); color: #fff; letter-spacing: .02em; }
.qc-site .ppl { position: absolute; right: -8px; top: -8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font: 700 10.5px/18px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.qc-asset { border-radius: 3px; background: var(--green); border: 1px solid rgba(0,0,0,.6); box-shadow: 0 0 6px rgba(60,207,122,.8); }
.qc-asset.blue { background: var(--blue); box-shadow: 0 0 6px rgba(90,162,255,.8); }
.qc-asset.amber { background: var(--amber); box-shadow: 0 0 8px rgba(245,179,60,.9); }
.qc-asset.red { background: var(--red); box-shadow: 0 0 10px rgba(255,90,82,1); animation: pulse 1.6s ease-in-out infinite; }
.qc-asset span { position: absolute; left: 17px; top: -2px; white-space: nowrap; font: 600 10.5px/1 var(--font); color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.qc-person { border-radius: 50%; background: var(--brand); border: 2px solid #fff; display: grid; place-items: center; box-shadow: 0 0 12px rgba(59,140,255,.8); }
.qc-person span { font: 700 10.5px/1 var(--font); color: #fff; }
.qc-person.visitor { background: var(--violet); box-shadow: 0 0 12px rgba(164,139,255,.8); }
.qc-person.overdue { background: var(--red); box-shadow: 0 0 16px rgba(255,90,82,1); animation: pulse 1.2s ease-in-out infinite; }

/* leaflet dark chrome */
.leaflet-container { font: 13px/1.4 var(--font); background: #0b0d10; }
.leaflet-bar a, .leaflet-control-layers { background: var(--panel); color: var(--ink); border-color: var(--line) !important; }
.leaflet-bar a:hover { background: var(--panel-2); }
.leaflet-control-layers-expanded { color: var(--ink); padding: 8px 10px; }
.leaflet-control-attribution { background: rgba(15,17,20,.75) !important; color: var(--ink-3); }
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-control-scale-line { background: rgba(15,17,20,.7); color: var(--ink-2); border-color: var(--ink-3); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-popup-content div + div { margin-top: 6px; }
.leaflet-tooltip.qc-tip { background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.leaflet-tooltip.qc-tip::before { border-top-color: var(--line); }

/* ---------------------------------------------------------------- mobile sign-in pages */
.mobile { max-width: 520px; margin: 0 auto; min-height: 100vh; }
.mobile-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.mobile-head .brand b { font-size: 14px; }
.mobile-body { padding: 16px; }
.mobile-body > * + * { margin-top: 14px; }
.site-hero h1 { font-size: 26px; margin: 2px 0 4px; }
.stack-form { display: grid; gap: 14px; }
.field-row label { margin-bottom: 6px; }
.mobile input, .mobile select { font-size: 16px; } /* stops iOS zooming into fields */
.block { width: 100%; justify-content: center; }
.big { padding: 13px 16px; font-size: 15.5px; border-radius: 10px; }
.danger-solid { background: var(--red); border-color: var(--red); color: #fff; margin-top: 10px; }
.danger-solid:hover { background: #e2453e; }
.ack { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; padding: 12px; border: 1px solid rgba(245,179,60,.4); background: var(--amber-bg); border-radius: 10px; }
.ack input { margin-top: 2px; flex: none; }
.geo { min-height: 1em; }
.hazards { border-color: rgba(245,179,60,.4); }
.hazard-list { margin: 0; padding: 10px 16px 12px 34px; }
.hazard-list li { padding: 4px 0; }
.emergency { border-color: rgba(255,90,82,.4); }
.emergency .panel-head h2 { color: var(--red); }
.status-card .state { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 4px; }
.status-card .state i { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-bg), 0 0 12px var(--green); }
.status-card .btn.block { margin-top: 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.center { text-align: center; }
.fine { margin-top: 18px !important; }

/* ---------------------------------------------------------------- printable QR poster */
.poster-tools { display: flex; gap: 8px; align-items: center; padding: 12px 16px; flex-wrap: wrap; }
.poster { width: 190mm; min-height: 270mm; margin: 0 auto 30px; background: #fff; color: #111; padding: 16mm; border-radius: 4px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.poster header .brand { color: #111; gap: 10px; }
.poster header .brand b { font-size: 18px; letter-spacing: 0; }
.poster h1 { font-size: 40px; margin: 14mm 0 4mm; letter-spacing: -0.02em; }
.poster .lead { font-size: 20px; color: #333; }
.poster-qr { width: 110mm; height: 110mm; margin: 6mm 0 2mm; }
.poster-qr svg { width: 100%; height: 100%; }
.poster .url { font: 12px var(--mono); color: #555; word-break: break-all; }
.poster-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; text-align: left; width: 100%; margin-top: 8mm; }
.poster-cols h2 { font-size: 15px; color: #111; border-bottom: 2px solid #111; padding-bottom: 4px; margin-bottom: 6px; }
.poster-cols ul { margin: 0; padding-left: 18px; font-size: 13px; color: #222; }
.poster-cols p { font-size: 13px; color: #222; }
.poster footer { margin-top: auto; padding-top: 8mm; font-size: 12px; color: #555; }
@media print {
  body { background: #fff; }
  .poster-tools { display: none !important; }
  .poster { margin: 0; padding: 10mm; width: auto; min-height: 0; border-radius: 0; }
  @page { size: A4; margin: 8mm; }
}

/* ================================================================ HUD skin */
html { background: var(--bg); }
body.hud {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 35%, rgba(20, 90, 190, .35), transparent 70%),
    linear-gradient(rgba(49,200,255,.045) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(49,200,255,.045) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(ellipse at 50% 120%, #06224a, var(--bg) 60%);
  background-attachment: fixed;
}
body.hud h1, body.hud h2, body.hud h3, body.hud .brand b, body.hud .readout .v, body.hud .readout .k, body.hud .nav a, body.hud th, body.hud .tabs a, body.hud .seg a, body.hud .chip, body.hud .badge, body.hud button, body.hud .btn, body.hud label, body.hud .side-h, body.hud .col-head h3 {
  font-family: var(--hud);
}
body.hud h1 { font-size: 30px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 0 18px rgba(49,200,255,.35); }
body.hud h2 { font-size: 15px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
body.hud h3 { font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
body.hud .page-head .sub, body.hud .crumbs { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
body.hud a { color: var(--cyan); }
body.hud .muted { color: var(--ink-3); }
body.hud .mono, body.hud .meta, body.hud .clock, body.hud .help { font-family: var(--mono); }
body.hud .meta, body.hud .help { font-size: 11.5px; }

/* panels: translucent glass with HUD corner brackets */
body.hud .panel, body.hud .readout, body.hud .col, body.hud .chip {
  background: var(--panel);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(6px);
  position: relative;
}
body.hud .panel::before, body.hud .readout::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(var(--cyan), var(--cyan)) top left / 14px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top left / 2px 14px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 14px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 2px 14px no-repeat;
  opacity: .8; filter: drop-shadow(0 0 4px rgba(49,200,255,.8));
}
body.hud .panel-head { border-bottom: 1px solid var(--line-2); background: linear-gradient(90deg, rgba(49,200,255,.08), transparent 60%); }
body.hud .panel-head h2::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 9px; vertical-align: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); transform: rotate(45deg); }
body.hud th { color: var(--cyan); font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
body.hud td { border-bottom-color: var(--line-2); }
body.hud tbody tr:hover td { background: rgba(49,200,255,.05); }
body.hud td .title, body.hud .title { color: var(--ink); }
body.hud .readout::after { height: 1px; background: linear-gradient(90deg, transparent, var(--tone, var(--cyan)), transparent); box-shadow: 0 0 12px var(--tone, var(--cyan)); }
body.hud .readout .v { font-size: 38px; font-weight: 600; letter-spacing: .02em; color: #fff; text-shadow: 0 0 20px rgba(49,200,255,.45); }
body.hud .readout .k { font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
body.hud .readout .d { font-family: var(--mono); font-size: 11.5px; }

/* controls */
body.hud button, body.hud .btn { font-size: 15px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: rgba(49,200,255,.06); border-color: var(--line); color: var(--ink); border-radius: 4px; }
body.hud button:hover, body.hud .btn:hover { background: rgba(49,200,255,.14); box-shadow: var(--glow); }
body.hud .btn.primary, body.hud button.primary { background: linear-gradient(180deg, rgba(49,200,255,.95), rgba(20,140,220,.95)); color: #02111f; border-color: var(--cyan); box-shadow: 0 0 18px rgba(49,200,255,.45); }
body.hud .btn.danger, body.hud button.danger { color: var(--red); border-color: rgba(255,77,94,.4); }
body.hud .btn.sm, body.hud button.sm { font-size: 13px; }
body.hud button.link { font-family: var(--font); text-transform: none; letter-spacing: 0; background: none; box-shadow: none; font-size: inherit; }
body.hud input, body.hud select, body.hud textarea { background: rgba(2, 14, 32, .75); border-color: var(--line); color: var(--ink); border-radius: 4px; }
body.hud input:focus, body.hud select:focus, body.hud textarea:focus { box-shadow: var(--glow); }
body.hud label { letter-spacing: .06em; text-transform: uppercase; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
body.hud .badge { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 3px; border: 1px solid currentColor; background: transparent; }
body.hud .badge::before { box-shadow: 0 0 6px currentColor; }
body.hud .tag { font-family: var(--mono); border-radius: 3px; background: rgba(49,200,255,.08); border-color: var(--line); color: var(--cyan); }
body.hud .seg { border-radius: 4px; background: rgba(2,14,32,.6); }
body.hud .seg a { font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-radius: 3px; }
body.hud .seg a.on { background: var(--cyan); color: #02111f; box-shadow: 0 0 14px rgba(49,200,255,.5); }
body.hud .tabs a { font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
body.hud .tabs a.on { color: #fff; border-bottom-color: var(--cyan); text-shadow: 0 0 10px rgba(49,200,255,.7); }
body.hud .flash { font-family: var(--mono); font-size: 12.5px; border-radius: 4px; }

/* shell */
body.hud .shell { background: linear-gradient(to right, #071630 var(--nav-w), transparent var(--nav-w)); }
body.hud .bus { background: #071630; border-right: 1px solid var(--line); }
body.hud .nav a.on svg { color: #5aa7ff; }
body.hud .topbar { background: rgba(2, 10, 24, .7); border-bottom-color: var(--line); }
body.hud .topbar .brand b { font-size: 20px; font-weight: 700; letter-spacing: .32em; color: #fff; text-shadow: 0 0 14px rgba(49,200,255,.8); }
body.hud .topbar .brand .co { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
body.hud .sys { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; background: rgba(2,14,32,.7); border-radius: 3px; }
body.hud .clock span { font-family: var(--hud); font-size: 22px; font-weight: 600; letter-spacing: .06em; color: #fff; text-shadow: 0 0 12px rgba(49,200,255,.6); }
body.hud .clock small { letter-spacing: .08em; text-transform: uppercase; }
body.hud .avatar { background: rgba(49,200,255,.12); border-color: var(--cyan); color: var(--cyan); font-family: var(--hud); }
body.hud .prio-bus::before, body.hud .prio-bus a::before { background: var(--line); box-shadow: 0 0 6px rgba(49,200,255,.4); }
body.hud .prio-bus .node { font-family: var(--hud); background: rgba(2,14,32,.85); }
body.hud .timeline li::before { background: var(--bg); }
body.hud .card { background: rgba(2,14,32,.6); border-color: var(--line-2); }
body.hud .auth-main { background: transparent; }
body.hud .auth-art { background: radial-gradient(ellipse at 30% 10%, rgba(30,110,220,.45), transparent 60%), rgba(2,10,24,.85); }
body.hud .auth-art .line { font-family: var(--hud); font-size: 32px; letter-spacing: .02em; text-transform: uppercase; }
body.hud .auth-art .line span { font-family: var(--mono); font-size: 12.5px; text-transform: none; }
body.hud .auth-art svg.sld { stroke: rgba(49,200,255,.55); filter: drop-shadow(0 0 6px rgba(49,200,255,.5)); }
body.hud .auth-box { background: var(--panel); border: 1px solid var(--line-2); padding: 28px; border-radius: 6px; box-shadow: 0 0 60px rgba(20,90,190,.25); }
body.hud .qr { background: #fff; }
body.hud .leaflet-container { background: #020a18; }
body.hud .qc-site .ring { border-color: var(--cyan); background: rgba(49,200,255,.15); box-shadow: 0 0 22px rgba(49,200,255,.6); }
body.hud .qc-person { background: var(--cyan); }
body.hud .qc-person span { color: #02111f; }

/* ================================================================ the core (overview) */
.core { position: relative; display: grid; grid-template-columns: 270px minmax(0, 1fr) 290px; gap: 28px; min-height: calc(100vh - 58px - 44px); margin: -6px 0 22px; }
.core-left, .core-right { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.hud-head { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 8px; }
.hud-big { font-family: var(--hud); font-weight: 600; font-size: 42px; line-height: 1; color: #fff; text-shadow: 0 0 18px rgba(49,200,255,.6); letter-spacing: .03em; }
.hud-sub { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }
.checks { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .05em; }
.checks li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line-2); text-transform: uppercase; color: var(--ink-2); }
.checks li i { width: 8px; height: 8px; transform: rotate(45deg); background: var(--green); box-shadow: 0 0 8px var(--green); }
.checks li.warn i { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.checks li.alarm i { background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse 1.4s infinite; }
.checks li.off i { background: var(--grey); box-shadow: none; }
.checks li b { color: #fff; font-weight: 500; }
.feed { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 11px; line-height: 1.45; color: var(--ink-2); max-height: 320px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.feed li { padding: 5px 0; border-bottom: 1px dashed var(--line-2); }
.feed time { color: var(--cyan); margin-right: 6px; }

.core-stage { position: relative; min-height: 620px; }
.core-stage svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wires path { fill: none; stroke: rgba(49,200,255,.45); stroke-width: 1.4; filter: drop-shadow(0 0 4px rgba(49,200,255,.9)); }
.wires path.flow { stroke: rgba(160,235,255,.95); stroke-width: 2; stroke-dasharray: 3 90; animation: flow 3.2s linear infinite; }
.wires path.alarm { stroke: rgba(255,77,94,.7); filter: drop-shadow(0 0 5px rgba(255,77,94,1)); }
.wires path.flow.alarm { stroke: #ff9aa4; }
.wires circle.ring { fill: none; stroke: rgba(49,200,255,.25); stroke-width: 1; stroke-dasharray: 2 6; }
@keyframes flow { to { stroke-dashoffset: -93; } }
.orb { position: absolute; left: 50%; top: 47%; width: 300px; height: 300px; transform: translate(-50%, -50%); border-radius: 50%; }
.orb canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.orb::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 3px solid #bfe6ff; box-shadow: 0 0 30px rgba(120,200,255,.7), inset 0 0 30px rgba(120,200,255,.35); }
.orb.warn::before { border-color: var(--gold); box-shadow: 0 0 30px rgba(255,201,74,.75), inset 0 0 30px rgba(255,201,74,.4); }
.orb::after { content: ""; position: absolute; inset: -34px; border-radius: 50%; border: 1px dashed rgba(49,200,255,.45); animation: spin 60s linear infinite; }
.orb.alarm::before { border-color: var(--red); box-shadow: 0 0 40px rgba(255,77,94,.9), inset 0 0 30px rgba(255,77,94,.5); animation: pulse 1.6s infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.orb-label { position: absolute; left: 50%; top: calc(47% + 200px); transform: translateX(-50%); text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .3em; color: var(--cyan); text-transform: uppercase; white-space: nowrap; }
.orb-label b { display: block; font-family: var(--hud); font-size: 18px; letter-spacing: .28em; color: #fff; text-shadow: 0 0 12px rgba(49,200,255,.8); }
.node { position: absolute; transform: translate(-11px, -50%); display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; z-index: 2; }
.node:hover { text-decoration: none; }
.node .pip { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cyan); background: rgba(3,12,28,.9); box-shadow: 0 0 14px rgba(49,200,255,.85), inset 0 0 6px rgba(49,200,255,.7); flex: none; transition: transform .15s; }
.node.gold .pip { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,201,74,.85), inset 0 0 6px rgba(255,201,74,.6); }
.node.alarm .pip { border-color: var(--red); background: rgba(255,77,94,.35); box-shadow: 0 0 18px rgba(255,77,94,1); animation: pulse 1.4s infinite; }
.node.warn .pip { border-color: var(--amber); box-shadow: 0 0 14px rgba(255,201,74,.9); }
.node:hover .pip, .node:focus-visible .pip { transform: scale(1.25); }
.node .lbl { font-family: var(--hud); font-size: 19px; font-weight: 600; letter-spacing: .04em; text-shadow: 0 0 10px rgba(49,200,255,.55); line-height: 1.05; }
.node .lbl small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: .06em; color: var(--ink-3); text-shadow: none; text-transform: uppercase; }
.node.alarm .lbl small { color: var(--red); }
.node.warn .lbl small { color: var(--amber); }
.node.left { flex-direction: row-reverse; text-align: right; transform: translate(calc(-100% + 11px), -50%); }
.cmd { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: min(560px, 92%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wave { display: flex; gap: 3px; align-items: center; height: 26px; }
.wave i { width: 3px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); animation: wave 1.2s ease-in-out infinite; }
@keyframes wave { 0%, 100% { height: 4px; opacity: .5; } 50% { height: 22px; opacity: 1; } }
.cmd form { width: 100%; display: flex; gap: 8px; }
.cmd input { flex: 1; height: 42px; border-radius: 21px; padding: 0 18px; font-family: var(--mono); font-size: 13px; border-color: rgba(49,200,255,.5); box-shadow: 0 0 18px rgba(49,200,255,.2); }
.cmd button { border-radius: 21px; padding: 0 18px; }
.radar { display: block; position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); background: radial-gradient(circle, rgba(49,200,255,.08), transparent 70%), repeating-radial-gradient(circle, transparent 0 22%, rgba(49,200,255,.18) 22% calc(22% + 1px)); overflow: hidden; }
.radar::before { content: ""; position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(49,200,255,.45), transparent 22%); border-radius: 50%; animation: spin 4s linear infinite; }
.radar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-2); box-shadow: 0 0 0 0 transparent; }
.radar .blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--green); box-shadow: 0 0 10px var(--green); }
.radar .blip.warn { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.radar .blip.alarm { background: var(--red); box-shadow: 0 0 12px var(--red); animation: pulse 1.2s infinite; }
.radar .blip span { position: absolute; left: 10px; top: -5px; font-family: var(--mono); font-size: 9.5px; color: var(--ink-2); white-space: nowrap; }
.detail-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--cyan); text-transform: uppercase; }
.detail-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

@media (max-width: 1250px) {
  .core { grid-template-columns: minmax(0, 1fr); }
  .core-left, .core-right { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
  .core-right .radar { max-width: 320px; margin: 0 auto; }
  .core-left { order: 2; } .core-right { order: 3; }
}
@media (max-width: 820px) {
  .core-stage { min-height: 0; }
  .core-stage svg.wires, .orb::after { display: none; }
  .orb { position: relative; left: auto; top: auto; transform: none; width: 200px; height: 200px; margin: 30px auto 10px; }
  .orb-label { position: static; transform: none; margin-bottom: 18px; }
  .nodes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .node, .node.left { position: static; transform: none; flex-direction: row; text-align: left; white-space: normal; min-width: 0; }
  .node .lbl { font-size: 16px; }
  .cmd { position: static; transform: none; margin: 18px auto 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wires path.flow, .orb::after, .radar::before, .wave i { animation: none !important; }
}

/* the hub side panel floats over the map */
.hub-side.panel { position: absolute; background: rgba(4, 18, 40, .92); border: 1px solid var(--line-2); backdrop-filter: blur(6px); }

/* ================================================================ hub: people in the field + alerts */
.people, .alerts { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.people .who { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  color: #02111f; background: var(--cyan); box-shadow: 0 0 12px rgba(49,200,255,.6); }
.people .who.visitor { background: var(--violet); box-shadow: 0 0 12px rgba(180,155,255,.6); }
.people li.late .who { background: var(--red); color: #fff; box-shadow: 0 0 14px rgba(255,77,94,.9); animation: pulse 1.4s infinite; }
.people b { color: #fff; font-weight: 600; }
.people .meta a { color: var(--ink-2); }
.alerts li { border-bottom: 1px dashed var(--line-2); }
.alerts a { display: grid; gap: 1px; padding: 9px 0 9px 14px; color: var(--ink); position: relative; text-decoration: none; }
.alerts a:hover { background: rgba(49,200,255,.05); }
.alerts a::before { content: ""; position: absolute; left: 0; top: 13px; width: 7px; height: 7px; transform: rotate(45deg); background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.alerts li.alarm a::before { background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse 1.4s infinite; }
.alerts li.warn a::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.alerts .kind { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.alerts li.alarm .kind { color: var(--red); }
.alerts li.warn .kind { color: var(--amber); }
.alerts b { font-weight: 600; line-height: 1.3; }
.quiet { color: var(--ink-3); font-size: 13px; padding: 10px 0; }
.quiet.ok { color: var(--green); }
.more-link { display: inline-block; margin-top: 8px; font-size: 12.5px; }
.core-left, .core-right { max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin; }
.hub.hub-framed { height: 640px; min-height: 0; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.hub-framed .hub-side.panel { top: 12px; right: 12px; bottom: 12px; }

/* ================================================================ corporate components (all pages except the hub) */
body:not(.hud) h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
body:not(.hud) .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
body:not(.hud) .panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
body:not(.hud) .panel-head h2 { font-size: 14.5px; font-weight: 650; color: var(--ink); }
body:not(.hud) .panel-body { padding: 16px 18px; }
body:not(.hud) th { background: var(--panel-2); color: var(--ink-3); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
body:not(.hud) td { border-bottom: 1px solid var(--line-2); }
body:not(.hud) tbody tr:hover td { background: var(--row-hover); }
body:not(.hud) td .title, body:not(.hud) .title { color: var(--ink); }
body:not(.hud) td .title:hover, body:not(.hud) .title:hover { color: var(--link); }
body:not(.hud) .btn, body:not(.hud) button { border-radius: 8px; border-color: var(--line); background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 1px rgba(13,35,66,.04); }
body:not(.hud) .btn:hover, body:not(.hud) button:hover { background: var(--panel-2); }
body:not(.hud) .btn.primary, body:not(.hud) button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
body:not(.hud) .btn.primary:hover, body:not(.hud) button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
body:not(.hud) button.link { background: none; border: 0; box-shadow: none; color: var(--link); font-weight: 500; }
body:not(.hud) button.link.danger { color: var(--red); }
body:not(.hud) input, body:not(.hud) select, body:not(.hud) textarea { border-radius: 8px; border-color: var(--input-line); background: var(--input-bg); color: var(--ink); }
body:not(.hud) input:focus, body:not(.hud) select:focus, body:not(.hud) textarea:focus { border-color: var(--link); box-shadow: var(--glow); }
body:not(.hud) .badge { border-radius: 6px; font-weight: 600; }
body:not(.hud) .seg { border-radius: 8px; background: var(--panel); }
body:not(.hud) .seg a.on { background: var(--seg-on); color: #fff; }
body:not(.hud) .tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
body:not(.hud) .tag { background: var(--panel-2); border-color: var(--line); color: var(--ink-2); }
/* KPI cards */
body:not(.hud) .readouts { background: transparent; border: 0; box-shadow: none; gap: 14px; overflow: visible; }
body:not(.hud) .readout { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); border-left: 1px solid var(--line); position: relative; overflow: hidden; }
body:not(.hud) .readout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone, var(--brand)); }
body:not(.hud) .readout.t-green { --tone: var(--green); } body:not(.hud) .readout.t-amber { --tone: var(--amber); }
body:not(.hud) .readout.t-red { --tone: var(--red); } body:not(.hud) .readout.t-violet { --tone: var(--navy); }
body:not(.hud) .readout .v { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
body:not(.hud) .readout .k { color: var(--ink-3); font-size: 13px; font-weight: 600; }
/* pipeline board */
body:not(.hud) .col { background: var(--col-bg); border-color: var(--line); }
body:not(.hud) .card { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
body:not(.hud) .card:hover { border-color: var(--brand); }
/* auth screens */
body:not(.hud) .auth-art { background: var(--navy); }
body:not(.hud) .auth-art svg.sld { stroke: rgba(143,192,98,.55); opacity: .9; }
body:not(.hud) .auth-main { background: var(--bg); }
body:not(.hud) .auth-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 30px; box-shadow: 0 10px 30px rgba(13,35,66,.08); }
body:not(.hud) .flash.ok { background: var(--green-bg); }
/* leaflet controls on light pages */
body:not(.hud) .leaflet-bar a, body:not(.hud) .leaflet-control-layers { background: var(--panel); color: var(--ink); }
body:not(.hud) .hub-side.panel { background: var(--panel); }

/* ================================================================ normal typography (system font, sentence case) */
h1, h2, h3, th, label, button, .btn, .badge, .seg a, .tabs a, .nav a, .readout .k, .hud-head, .hud-sub, .checks li,
.node .lbl small, .orb-label, .orb-label b, .detail-head, .topbar .brand .co, .sys, .clock small, .auth-art .line,
.page-head .sub, .crumbs, .meta, .help, .flash, .tag, .feed, .cmd input, .chip {
  text-transform: none; letter-spacing: normal;
}
h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 650; color: var(--ink); }
h3 { font-size: 14px; font-weight: 650; }
th { font-size: 12.5px; font-weight: 600; }
label { font-size: 13px; font-weight: 600; }
button, .btn { font-size: 14px; font-weight: 600; }
.btn.sm, button.sm { font-size: 12.5px; }
.badge { font-size: 12px; font-weight: 600; }
.seg a, .tabs a { font-size: 14px; }
.nav a { font-size: 11px; font-weight: 500; }
.readout .v { font-size: 32px; font-weight: 650; letter-spacing: -0.02em; }
.readout .k { font-size: 13.5px; font-weight: 600; }
.page-head .sub, .crumbs { font-size: 13px; }
.meta, .help { font-size: 12px; }
.flash, .feed { font-size: 13px; }
.mono { font-size: 13px; font-variant-numeric: tabular-nums; }
.topbar .brand b { font-size: 17px; font-weight: 700; letter-spacing: .18em; }
.topbar .brand .co { font-size: 13px; }
.sys { font-size: 12.5px; font-weight: 600; }
.clock span { font-size: 18px; font-weight: 600; letter-spacing: 0; }
.clock small { font-size: 11.5px; }
.hud-head { font-size: 12.5px; font-weight: 600; }
.hud-big { font-size: 40px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.hud-sub { font-size: 12.5px; }
.checks { font-size: 12.5px; }
.node .lbl { font-size: 16.5px; font-weight: 650; letter-spacing: 0; }
.node .lbl small { font-size: 12px; font-weight: 500; margin-top: 2px; }
.orb-label { font-size: 12.5px; }
.orb-label b { font-size: 17px; font-weight: 650; }
.detail-head { font-size: 13px; font-weight: 600; }
.auth-art .line { font-size: 28px; font-weight: 650; }
.auth-art .line span { font-size: 14px; }
.cmd input { font-size: 14px; }
.chip b { font-size: 17px; }
.radar .blip span { font-size: 10.5px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .readouts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .hub, .hub.hub-framed { height: auto; min-height: 0; }
  .core-left, .core-right { max-height: none; overflow: visible; }
  .hub-map { position: relative; height: 62vh; }
  .hub-strip { position: static; padding: 10px 12px; }
  .hub-side, .hub-side.panel { position: static; width: auto; margin: 0 12px 16px; }
  .hub-framed .hub-side.panel { margin: 12px; }
  .poster-cols { grid-template-columns: minmax(0, 1fr); }
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .table-wrap table { min-width: 620px; }
  .bus { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .bus { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
  .menu-btn { display: inline-flex; }
  .topbar { gap: 10px; }
  .topbar .brand .co, .clock, .sys span { display: none; }
  .readouts { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 48px; }
  .g2, .g3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .check { padding-top: 0; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .hide-sm { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .composer .row { grid-template-columns: minmax(0, 1fr); }
  .prio-bus .node { min-width: 44px; height: 44px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .bus, .topbar, .actions, .composer { display: none !important; } .shell { display: block; } }

/* ---------------------------------------------------------------- brand assets */
.mark { display: inline-block; height: auto; flex: none; }
.auth-art .brand-logo { width: 230px; height: auto; display: block; position: relative; z-index: 1; }
.auth-art .swoosh { position: absolute; left: -10%; right: -10%; bottom: -2px; width: 120%; height: 46%; pointer-events: none; }
.auth-art .line, .auth-art .fine { z-index: 1; }
.auth-art .fine { color: #fff; opacity: .8; }
.m-brand img { height: 30px; width: auto; display: block; }
.poster-logo { height: 64px; width: auto; display: block; }
.nodes .node .lbl small { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- contract tracker */
.ref-chip { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; vertical-align: middle; margin-left: 6px; letter-spacing: 0; }
.sep-dot { color: var(--ink-3); }
.sep-dot::before { content: "·"; margin: 0 8px; color: var(--line); }
.tab-count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 700; background: var(--panel-2); color: var(--ink-2); text-align: center; }
.tab-count.bad { background: var(--red); color: #fff; }
.readouts.r5 { grid-template-columns: repeat(5, 1fr); }
.readout .d .good { color: var(--green); font-weight: 600; }
.meter { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.bars { width: 100%; height: auto; display: block; }
.bars .grid-l { stroke: var(--line-2); stroke-width: 1; }
.bars .ax { font-size: 10.5px; fill: var(--ink-3); }
.bars .b-rev { fill: var(--navy); } .bars .b-rev.future { fill: color-mix(in srgb, var(--navy) 25%, transparent); }
.bars .b-cost { fill: #5aa7ff; }
.bars .b-bud { stroke: var(--amber); stroke-width: 2.5; stroke-dasharray: 4 3; }
.bars .now { stroke: var(--red); stroke-width: 1; stroke-dasharray: 2 3; }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .k-rev { background: var(--navy); } .legend .k-cost { background: #5aa7ff; } .legend .k-bud { background: var(--amber); height: 3px; vertical-align: 3px; }
.tight-dl { grid-template-columns: 140px 1fr; gap: 6px 10px; }
.n-dd { text-align: right; font-variant-numeric: tabular-nums; }
.callout { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border-left: 3px solid var(--navy); }
.callout.bad { border-left-color: var(--red); background: var(--red-bg); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .grow { flex: 1; min-width: 0; }
.plain-list .strong { font-weight: 600; font-size: 13.5px; }
.plain-list .when { width: 40px; text-align: center; line-height: 1.1; flex: none; }
.plain-list .when b { display: block; font-size: 17px; }
.plain-list .when span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; }
.bulkbar { position: sticky; top: 60px; z-index: 3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.bulkbar input[type=date] { width: auto; }
.bulkbar label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.sched-sec + .sched-sec { margin-top: 14px; }
table.sched tr.is-done td { color: var(--ink-3); }
.yr { font-size: 10.5px; font-weight: 700; color: var(--navy); background: var(--panel-2); border-radius: 4px; padding: 0 4px; }
.import-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.import-form input[type=file] { width: auto; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.sched-tools { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.num-in { text-align: right; font-variant-numeric: tabular-nums; max-width: 130px; }
table.budget td { vertical-align: middle; }
table.budget tfoot th, table.claims tfoot th { background: var(--panel-2); color: var(--ink); font-size: 13px; }
table.budget input[name=name] { min-width: 260px; }
.new-row input::placeholder { color: var(--ink-3); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fgrid .wide { grid-column: 1 / -1; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
table.rates td { padding: 6px 0; border: 0; vertical-align: middle; }
table.claims td { vertical-align: middle; padding: 8px 6px; }
table.claims input, table.claims select { min-height: 32px; padding: 5px 7px; font-size: 13px; }
table.claims input[type=date] { width: 130px; }
table.claims .num-in { width: 108px; }
table.pnl { font-size: 12.5px; }
table.pnl th, table.pnl td { padding: 7px 9px; white-space: nowrap; }
table.pnl td:first-child { position: sticky; left: 0; background: var(--panel); font-weight: 500; min-width: 170px; }
table.pnl th.cur { color: var(--navy); box-shadow: inset 0 -2px 0 var(--brand); }
table.pnl th.fut, table.pnl .fut { color: var(--ink-3); }
table.pnl .tot { background: var(--panel-2); font-weight: 650; }
table.pnl tr.sub-h td { background: var(--panel-2); font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
table.pnl tr.sum td { font-weight: 650; border-top: 1px solid var(--line); }
table.pnl tr.gp td { color: var(--navy); }
table.pnl tr.muted-row td { color: var(--ink-3); }
@media (max-width: 1100px) { .readouts.r5 { grid-template-columns: repeat(2, 1fr); } .fgrid { grid-template-columns: minmax(0, 1fr); } }
table.claims select { min-width: 112px; }
table.claims input[type=date] { width: 128px; }
table.budget input[name=name] { min-width: 320px; }
.cost-table td:nth-child(2) { min-width: 260px; } .cost-table td:nth-child(4) { min-width: 150px; }

/* ---------------------------------------------------------------- health & safety */
.hs-form .panel + .panel, .hs-form > .panel { margin-bottom: 14px; }
.hs-form .panel + .panel { margin-top: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 6px 0 30px; }
.hz-table td { vertical-align: top; padding: 6px 8px; }
.hz-table textarea { min-height: 54px; font-size: 13px; }
label.check.ack { margin-top: 14px; padding: 12px; background: var(--brand-soft); border-radius: 8px; align-items: flex-start; font-weight: 550; }
label.check.ack input { margin-top: 2px; }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(13,35,66,.14); padding: 6px; }
.menu-pop a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.menu-pop a:hover { background: var(--panel-2); text-decoration: none; }
a.plain { color: inherit; }
.risk { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 10px; }
.risk.r-low { background: var(--green-bg); color: var(--green); }
.risk.r-medium { background: var(--amber-bg); color: var(--amber); }
.risk.r-high { background: var(--red-bg); color: var(--red); }
.risk.r-extreme { background: var(--red); color: #fff; }
ul.crew { list-style: none; margin: 0; padding: 8px 16px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
ul.crew li { display: flex; align-items: center; gap: 10px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; background: var(--brand-soft); color: var(--brand); }
ul.files { list-style: none; margin: 0; padding: 0; }
ul.files li { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
ul.files img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
ul.files .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ficon { width: 52px; height: 52px; border-radius: 6px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; flex: none; }
.upload-row { display: flex; gap: 10px; align-items: center; }
.upload-row input[type=file] { flex: 1; }
@media print { .bus, .topbar, .actions, .upload-row, form[action$="/close"] { display: none !important; } .shell { display: block; background: none; } }

/* ---------------------------------------------------------------- client portal */
.portal-chip { font-size: 12.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 6px 12px; border-radius: 20px; white-space: nowrap; }
.topbar .grow { flex: 1; }
.portal-card + .portal-card { margin-top: 16px; }
.portal-card .panel-head h2 a { color: var(--ink); }
.readouts.flat { border: 0; border-radius: 0; box-shadow: none; margin: 0; border-top: 1px solid var(--line-2); }
.sched-month + .sched-month { margin-top: 14px; }

/* ---------------------------------------------------------------- plant & prestarts */
.chk-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.chk-item { font-weight: 550; }
.chk-note { grid-column: 1 / -1; min-height: 32px; font-size: 13px; padding: 5px 9px; }
.tri, .safe-q { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.safe-q { margin-top: 16px; gap: 10px; }
.tri label, .safe-q label { margin: 0; cursor: pointer; }
.tri input, .safe-q input { position: absolute; opacity: 0; pointer-events: none; }
.tri span, .safe-q span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; font-weight: 650; font-size: 13px; background: var(--panel); min-width: 62px; text-align: center; }
.tri .t-ok input:checked + span, .safe-q .t-ok input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.tri .t-defect input:checked + span, .safe-q .t-defect input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.tri .t-na input:checked + span { background: var(--grey); border-color: var(--grey); color: #fff; }
.tri input:focus-visible + span, .safe-q input:focus-visible + span { box-shadow: var(--glow); }
.sticker { width: 62mm; margin: 10mm auto; padding: 5mm; border: 1px dashed var(--line); border-radius: 4mm; text-align: center; background: #fff; color: #0d2342; }
.sticker .st-logo { width: 42mm; display: block; margin: 0 auto 2mm; }
.sticker .st-qr svg { width: 46mm; height: 46mm; }
.sticker .st-no { font-size: 20px; font-weight: 800; letter-spacing: .04em; }
.sticker .st-name { font-size: 11px; margin-top: 1mm; }
.sticker .st-cta { font-size: 9.5px; margin-top: 2mm; color: #3f5270; }
@media print { .no-print { display: none !important; } .sticker { border: 0; margin: 0 auto; } body { background: #fff; } }
@media (max-width: 640px) { .chk-row { grid-template-columns: minmax(0, 1fr); } }

/* plant register (master–detail) */
table.reg td { vertical-align: middle; padding-top: 9px; padding-bottom: 9px; }
table.reg tbody tr[data-href] { cursor: pointer; }
table.reg tr.sel td { background: var(--brand-soft) !important; }
table.reg tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: 1px; }
.sdot.warn { background: var(--amber); } .sdot.bad { background: var(--red); }
td.att.bad { color: var(--red); } td.att.warn { color: var(--amber); } td.att.ok { color: var(--ink-3); }
.plant-panel { margin-top: 18px; padding: 18px 20px 20px; scroll-margin-top: 76px; }
.pp-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.pp-kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.pp-head h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pp-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--panel); min-width: 0; }
.pp-card.wide { grid-column: 1 / -1; }
.pp-card h3 { font-size: 13.5px; font-weight: 700; margin: 0 0 10px; }
table.mini { width: 100%; font-size: 13px; }
table.mini th { background: none; padding: 6px 6px; font-size: 11.5px; border-bottom: 1px solid var(--line); }
table.mini td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.mini tr.now td { background: var(--brand-soft); font-weight: 600; }
table.mini tr.fut td { color: var(--ink-3); }
.pp-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.pp-add select, .pp-add input { width: auto; min-height: 34px; padding: 5px 9px; font-size: 13px; flex: 1 1 120px; }
.pp-add input[type=date] { flex: 0 1 150px; }
.pp-add .grow-in { flex: 3 1 200px; }
.pp-add button { flex: none; }
.pp-add-svc + p { margin: 8px 0 0; }
.qr-row { display: flex; gap: 14px; align-items: flex-start; }
.qr-box { flex: none; width: 116px; height: 116px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-row p { margin: 0 0 10px; }
.checklist-sum { margin: 12px 0 0; line-height: 1.55; }
.pp-foot { margin-top: 12px; text-align: right; }
.crit { font-size: 10.5px; font-weight: 700; color: var(--red); background: var(--red-bg); border-radius: 8px; padding: 1px 7px; margin-left: 4px; text-transform: uppercase; letter-spacing: .04em; vertical-align: 1px; }
.status-card.bad .state i { background: var(--red); box-shadow: 0 0 0 4px var(--red-bg), 0 0 12px var(--red); }
.status-card.bad { border-color: var(--red); }
@media (max-width: 1000px) { .pp-grid { grid-template-columns: minmax(0, 1fr); } }


/* ================================================================ dark navy theme (default) — everything except the hub, which has its own */
body.theme-dark:not(.hud) {
  --bg: #101316;
  --panel: #161a1f;
  --panel-2: #1b2026;
  --ink: #e6e9ed;
  --ink-2: #a6afb9;
  --ink-3: #717c88;
  --line: #262c33;
  --line-2: #1f242a;
  --bus: #0c0f12;
  --bus-ink: #939ca6;
  --brand: #2f7cf6;
  --brand-hover: #4a8ff8;
  --brand-soft: rgba(47,124,246,.14);
  --link: #6ea6ff;
  --navy: #e6e9ed;
  --focus: #5b9bff;
  --leaf: #79c257;
  --green: #5fc27a; --green-bg: rgba(95,194,122,.13);
  --red: #f2645f;   --red-bg: rgba(242,100,95,.14);
  --amber: #e9a640; --amber-bg: rgba(233,166,64,.14);
  --blue: #6ea6ff;  --blue-bg: rgba(110,166,255,.13);
  --violet: #a594ff; --violet-bg: rgba(165,148,255,.14);
  --grey: #8f99a4;  --grey-bg: rgba(143,153,164,.13);
  --row-hover: #1a1f25; --input-bg: #111418; --input-line: #2d343c; --seg-on: #2f7cf6; --col-bg: #13171b;
  --shadow: none;
  --glow: 0 0 0 3px rgba(91,155,255,.22);
  color-scheme: dark;
  background: var(--bg); color: var(--ink);
}
body.theme-dark:not(.hud) .shell { background: linear-gradient(to right, var(--bus) var(--nav-w), transparent var(--nav-w)); }
body.theme-dark:not(.hud) .bus { border-right: 1px solid var(--line-2); }
body.theme-dark:not(.hud) .topbar { background: var(--bg); border-bottom-color: var(--line-2); }
body.theme-dark:not(.hud) .topbar input[type=search] { background: var(--input-bg); }
body.theme-dark:not(.hud) .flash { border-color: var(--line); }
body.theme-dark:not(.hud) .auth-main { background: var(--bg); }
body.theme-dark:not(.hud) .auth-box { box-shadow: 0 10px 40px rgba(0,0,0,.35); }
body.theme-dark:not(.hud) .mobile-head { background: var(--panel); border-bottom-color: var(--line-2); }
body.theme-dark:not(.hud) .m-brand img, body.theme-dark:not(.hud) .mobile-head img { content: url(/static/brand/logo-white.png); }
body.theme-dark:not(.hud) .qr-box, body.theme-dark:not(.hud) .qr { background: #fff; }
body.theme-dark:not(.hud) .tri span, body.theme-dark:not(.hud) .safe-q span { background: var(--input-bg); color: var(--ink); }
body.theme-dark:not(.hud) .sticker, body.theme-dark:not(.hud) .poster { color: #0d2342; }
body.theme-dark:not(.hud) .leaflet-container { background: #15191d; }
body.theme-dark:not(.hud) input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8); }
body.theme-dark:not(.hud) .portal-chip { background: var(--brand-soft); color: var(--link); }
body.theme-dark:not(.hud) table.pnl td:first-child { background: var(--panel); }
body.theme-dark:not(.hud) .bars .b-rev { fill: #9cc2ff; } body.theme-dark:not(.hud) .bars .b-rev.future { fill: rgba(156,194,255,.25); }
body.theme-dark:not(.hud) .legend .k-rev { background: #9cc2ff; }
body.theme-dark:not(.hud) .risk.r-extreme { color: #fff; }
.theme-toggle { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); background: var(--panel); flex: none; }
.theme-toggle:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
@media print { body.theme-dark:not(.hud) { --bg: #fff; --panel: #fff; --panel-2: #f6f8fa; --ink: #0d2342; --ink-2: #3f5270; --ink-3: #6b7b91; --line: #dde3ea; --line-2: #e8ecf1; background: #fff; color: #0d2342; } }
body.theme-dark:not(.hud) .auth-art { background: radial-gradient(ellipse at 20% 0%, #1d2731 0%, #0c0f12 65%); border-right: 1px solid var(--line-2); }
body.theme-dark:not(.hud) .readout.t-violet { --tone: var(--brand); }
body.theme-dark:not(.hud) .callout { border-left-color: var(--brand); }

/* ---------------------------------------------------------------- operations overview (hub) */
.readouts.r6 { grid-template-columns: repeat(6, 1fr); }
a.readout { color: inherit; display: block; }
a.readout:hover { text-decoration: none; border-color: var(--brand) !important; }
.ops-top { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; margin-bottom: 16px; }
.map-card { overflow: hidden; }
.map-card .hub.hub-framed { height: 712px; margin: 0; border: 0; border-radius: 0; }
.ops-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ops-grid.three { grid-template-columns: 1.1fr 1fr 1fr; }
.ops-grid .panel + .panel, .ops-top .panel + .panel { margin-top: 0; }
.ops-alerts { list-style: none; margin: 0; padding: 4px 0; }
.ops-alerts li a { display: block; padding: 9px 16px 9px 30px; position: relative; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.ops-alerts li:last-child a { border-bottom: 0; }
.ops-alerts li a:hover { background: var(--row-hover); text-decoration: none; }
.ops-alerts li a::before { content: ""; position: absolute; left: 14px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.ops-alerts li.alarm a::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.ops-alerts li.warn a::before { background: var(--amber); }
.ops-alerts .kind { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.ops-alerts li.alarm .kind { color: var(--red); } .ops-alerts li.warn .kind { color: var(--amber); }
.ops-alerts b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.avatar.sm.late { background: var(--red); color: #fff; }
@media (max-width: 1280px) { .readouts.r6 { grid-template-columns: repeat(3, 1fr); } .ops-grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1000px) { .ops-top, .ops-grid, .ops-grid.three { grid-template-columns: minmax(0, 1fr); } .map-card .hub.hub-framed { height: 440px; } }
.map-card .hub-side.panel { width: 290px; top: 12px; right: 12px; bottom: auto; max-height: calc(100% - 24px); display: flex; flex-direction: column; }
.map-card .hub-side-body { overflow-y: auto; }
body.theme-dark:not(.hud) .map-card .hub-side.panel { background: rgba(22,26,31,.95); backdrop-filter: blur(4px); }
.geo-box { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.geo-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.geo-map { height: 340px; }

/* ---------------------------------------------------------------- installable app */
.install-btn { flex: none; }
.ios-hint { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1000; background: var(--panel); color: var(--ink); border: 1px solid var(--brand); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 14px; }
.ios-hint .share-ico { display: inline-block; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; }
.offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 1001; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; background: var(--amber); color: #1b1300; text-align: center; font-size: 13px; font-weight: 650; }
.is-app .topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
.is-app .bus { padding-top: env(safe-area-inset-top); }
.is-app .mobile-head { padding-top: calc(14px + env(safe-area-inset-top)); }
.is-app .content, .is-app .mobile-body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.draft-note button { margin-left: 6px; }

/* ---------------------------------------------------------------- projects portal (Jarvis-style) */
.pj-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; padding: 18px 20px; margin-bottom: 16px; }
.pj-hero h1 { margin: 0 0 4px; }
.pj-hero-main > p { margin: 0 0 14px; max-width: 760px; font-size: 13px; }
.pj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pj-card { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--panel-2); color: var(--ink); }
.pj-card:hover { border-color: var(--brand); text-decoration: none; }
.pj-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill { font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green); } .pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.bad { background: var(--red-bg); color: var(--red); }
.pj-bar { position: relative; height: 6px; background: var(--line-2); border-radius: 3px; margin: 12px 0; }
.pj-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 3px; }
.pj-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-3); }
.pj-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.pj-mini span, .pj-figs span { display: block; font-size: 11.5px; color: var(--ink-3); }
.pj-mini b { font-size: 15px; }
.pj-map-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); }
.pj-kicker { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.pj-map { height: 210px; border-radius: 8px; overflow: hidden; }
.pj-pin { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(246,182,62,.25); }
.pj-pin.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(60,207,122,.25); } .pj-pin.bad { background: var(--amber); }
.pj-pin-l { position: absolute; left: 16px; top: -3px; white-space: nowrap; font: 600 11.5px/1 var(--font); color: var(--ink); text-shadow: 0 1px 3px #000; }
.pj-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pj-money { padding: 16px 20px; }
.pj-money-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.pj-money-head b { font-size: 15px; margin-right: 8px; }
.pj-figs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.pj-figs b { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pj-figs b.good { color: var(--green); }
.pj-figs small { display: block; color: var(--link); font-size: 12px; margin-top: 2px; }
.pj-finish { margin: 12px 0 4px; }
.pj-band { width: 100%; height: 56px; display: block; margin-top: 8px; }
.pj-band .track { fill: var(--line-2); } .pj-band .spent { fill: var(--brand); }
.pj-band .band { fill: rgba(60,207,122,.35); } .pj-band .band.amber { fill: rgba(246,182,62,.35); } .pj-band .band.over { fill: rgba(255,97,112,.35); }
.pj-band .mid { stroke: var(--green); stroke-width: 3; } .pj-band .bud { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 4 3; }
.pj-band .rev { stroke: var(--red); stroke-width: 2.5; }
.pj-band-labels { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; margin-top: 2px; }
.pj-band-labels span::before { content: ""; display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: 3px; }
.l-spent::before { background: var(--brand); } .l-mid::before { background: var(--green); } .l-bud::before { background: var(--ink-3); } .l-rev::before { background: var(--red); }
.pj-note { margin: 12px 0 0; line-height: 1.5; }
.warn-t { color: var(--amber); }
.pj-strip { display: flex; align-items: baseline; gap: 10px; padding: 12px 18px; background: var(--panel-2); border-bottom: 1px solid var(--line-2); }
.pj-strip b { font-size: 26px; font-weight: 700; }
.pj-strip span { color: var(--ink-2); font-size: 13px; flex: 1; }
.pj-pbar { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.pj-pbar .meter { margin: 0; height: 7px; }
.pj-tasks .meter i { background: var(--green); }
@media (max-width: 1200px) { .pj-figs { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .pj-hero, .pj-body { grid-template-columns: minmax(0, 1fr); } .pj-figs { grid-template-columns: 1fr 1fr; } }
.readouts.r6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .readouts.r6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .readouts.r6 { grid-template-columns: 1fr 1fr; } }
.sdot { flex: none; }
.nw { white-space: nowrap; }

/* ---------------------------------------------------------------- solar monitoring */
.mon-grid > .panel { margin: 0; }
.mon-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .mon-grid { grid-template-columns: minmax(0, 1fr); } }
.mon-alerts { list-style: none; margin: 0; padding: 0; }
.mon-alerts li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line-2); border-left: 3px solid transparent; }
.mon-alerts li:last-child { border-bottom: 0; }
.mon-alerts li.fault { border-left-color: var(--red); } .mon-alerts li.warn { border-left-color: var(--amber); }
.mon-alerts li.closed { border-left-color: var(--line); opacity: .72; }
.mon-alerts li.focus { background: var(--panel-2); }
.mon-a-main { flex: 1; min-width: 0; }
.mon-a-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mon-a-title { margin: 4px 0 3px; font-weight: 550; }
.mon-a-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 270px; }
.mon-a-act form { margin: 0; }
.steps-list { margin: 0 0 14px; padding-left: 20px; line-height: 1.6; }
.chk { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; white-space: nowrap; }
.mon-site { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }
.mon-site b { font-size: 20px; }
.pill:not(.ok):not(.warn):not(.bad) { background: var(--panel-2); color: var(--ink-2); }


/* ================================================================ v3 — calm, precise operations UI (all pages except body.hud)
   Hairline panels, no drop shadows, one status rail for KPIs, colour only for status and actions. */
body:not(.hud) { font-family: var(--font); font-size: 14px; line-height: 1.5; font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
body:not(.hud) h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.012em; }
body:not(.hud) h2 { font-weight: 600; }
body:not(.hud) .page-head { margin-bottom: 20px; }
body:not(.hud) .page-head .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
body:not(.hud) .content:not(.wide) { padding: 24px 28px 48px; }

/* sidebar */
body:not(.hud) .nav { padding: 4px 10px; gap: 1px; }
body:not(.hud) .nav .nav-h { font-size: 12px; font-weight: 500; color: #5f6872; padding: 16px 10px 6px; }
body:not(.hud) .nav a { padding: 7px 10px; gap: 10px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--bus-ink); }
body:not(.hud) .nav a:hover { background: rgba(255,255,255,.045); color: #e9edf1; }
body:not(.hud) .nav a.on { background: rgba(255,255,255,.07); color: #fff; }
body:not(.hud) .nav a.on::before { left: -10px; top: 7px; bottom: 7px; width: 2px; background: var(--leaf); }
body:not(.hud) .nav a.on svg { color: var(--leaf); }
body:not(.hud) .nav svg { width: 17px; height: 17px; opacity: .85; }
body:not(.hud) .nav .count { font-size: 11px; padding: 0 6px; border-radius: 4px; line-height: 17px; font-weight: 600; }
body:not(.hud) .nav .count.info { background: rgba(255,255,255,.1); color: #cfd5db; }
body:not(.hud) .bus > .brand { padding: 20px 18px 18px; border-bottom-color: rgba(255,255,255,.06); }
body:not(.hud) .bus > .brand .brand-logo { width: 150px; }
body:not(.hud) .bus-foot { border-top-color: rgba(255,255,255,.06); }
body:not(.hud) .avatar { background: #2a3139; color: #e6e9ed; font-weight: 600; }

/* top bar */
body:not(.hud) .topbar { height: 52px; padding: 0 28px; background: var(--bg); border-bottom: 1px solid var(--line-2); }
body:not(.hud) .topbar .page-title { font-size: 14px; font-weight: 600; }
body:not(.hud) .topbar input[type=search] { height: 34px; border-radius: 6px; font-size: 13.5px; }
body:not(.hud) .sys { padding: 4px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
body:not(.hud) .sys i { width: 7px; height: 7px; }
body:not(.hud) .sys.warn { border-color: rgba(233,166,64,.35); color: var(--amber); background: transparent; }
body:not(.hud) .sys.alarm { border-color: rgba(242,100,95,.4); color: var(--red); background: var(--red-bg); }
body:not(.hud) .clock span { font-size: 15px; font-weight: 500; }
body:not(.hud) .install-btn, body:not(.hud) .theme-toggle { border-radius: 6px; }

/* panels, tables, controls */
body:not(.hud) .panel { border-radius: 8px; box-shadow: none; }
body:not(.hud) .panel-head { padding: 12px 16px; min-height: 48px; }
body:not(.hud) .panel-head h2 { font-size: 14px; font-weight: 600; }
body:not(.hud) .panel-body { padding: 14px 16px; }
body:not(.hud) th { background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 500; padding-top: 10px; padding-bottom: 10px; }
body:not(.hud) td { padding-top: 11px; padding-bottom: 11px; }
body:not(.hud) .btn, body:not(.hud) button { border-radius: 6px; font-weight: 500; box-shadow: none; padding: 6px 12px; }
body:not(.hud) .btn.sm, body:not(.hud) button.sm { padding: 3px 9px; }
body:not(.hud) .btn.primary, body:not(.hud) button.primary { font-weight: 500; }
body:not(.hud) input, body:not(.hud) select, body:not(.hud) textarea { border-radius: 6px; }
body:not(.hud) .badge { border-radius: 4px; font-weight: 500; padding: 1px 8px 1px 7px; }
body:not(.hud) .pill { border-radius: 4px; font-weight: 500; }
body:not(.hud) .seg { border-radius: 6px; }
body:not(.hud) .seg a { border-radius: 4px; font-weight: 500; }
body:not(.hud) .empty { color: var(--ink-3); padding: 28px 16px; }
body:not(.hud) .flash { border-radius: 6px; }

/* KPIs: one status rail with hairline dividers instead of separate striped cards */
body:not(.hud) .readouts { display: grid; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
body:not(.hud) .readout { background: transparent; border: 0; border-left: 1px solid var(--line-2); border-radius: 0; box-shadow: none; padding: 14px 18px 15px; overflow: visible; }
body:not(.hud) .readout:first-child { border-left: 0; }
body:not(.hud) .readout::before { content: none; }
body:not(.hud) a.readout:hover { background: var(--panel-2); text-decoration: none; }
body:not(.hud) .readout .k { order: -1; color: var(--ink-3); font-size: 12.5px; font-weight: 500; margin: 0 0 4px; display: flex; align-items: center; gap: 7px; }
body:not(.hud) .readout { display: flex; flex-direction: column; }
body:not(.hud) .readout .v { font-size: 24px; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); line-height: 1.2; }
body:not(.hud) .readout .v small { font-size: 13px; font-weight: 400; }
body:not(.hud) .readout .d { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
body:not(.hud) .readout .d .bad { color: var(--red); font-weight: 500; }
body:not(.hud) .readout .k::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: none; }
body:not(.hud) .readout.t-green .k::before { background: var(--green); }
body:not(.hud) .readout.t-amber .k::before { background: var(--amber); }
body:not(.hud) .readout.t-red .k::before { background: var(--red); }
body:not(.hud) .readout.t-violet .k::before { background: var(--brand); }
body:not(.hud) .readouts.flat { border: 0; border-radius: 0; border-top: 1px solid var(--line-2); }
@media (max-width: 1200px) { body:not(.hud) .readouts.r6 { grid-template-columns: repeat(3, 1fr); }
  body:not(.hud) .readouts.r6 .readout:nth-child(4) { border-left: 0; }
  body:not(.hud) .readouts.r6 .readout:nth-child(n+4) { border-top: 1px solid var(--line-2); } }
@media (max-width: 700px) { body:not(.hud) .readouts, body:not(.hud) .readouts.r6, body:not(.hud) .readouts.r5 { grid-template-columns: 1fr 1fr; }
  body:not(.hud) .readout:nth-child(odd) { border-left: 0; } body:not(.hud) .readout:nth-child(even) { border-left: 1px solid var(--line-2); }
  body:not(.hud) .readout:nth-child(n+3) { border-top: 1px solid var(--line-2); } }

/* hub: fleet status line */
.fleet { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.fleet-line { display: flex; gap: 12px; align-items: baseline; }
.fleet-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; position: relative; top: -2px; box-shadow: 0 0 0 4px var(--green-bg); }
.fleet-dot.warn { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }
.fleet-dot.alarm { background: var(--red); box-shadow: 0 0 0 4px var(--red-bg); }
.fleet h1 { font-size: 21px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; max-width: 860px; }
.fleet h1 span { color: var(--ink-2); }
.fleet .sub { color: var(--ink-3); font-size: 13px; margin: 4px 0 0 22px; }
.fleet .actions { flex: none; }
.hub-rail { margin-bottom: 16px; }
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li a { display: grid; grid-template-columns: 8px 1fr; column-gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.att-list li:last-child a { border-bottom: 0; }
.att-list li a:hover { background: var(--row-hover); text-decoration: none; }
.att-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-top: 7px; grid-row: span 2; }
.att-list li.alarm i { background: var(--red); } .att-list li.warn i { background: var(--amber); }
.att-list b { font-weight: 500; line-height: 1.35; }
.att-list small { color: var(--ink-3); font-size: 12.5px; }
.att-list .kind { color: var(--ink-3); }
.att-list li.alarm .kind { color: var(--red); } .att-list li.warn .kind { color: var(--amber); }
.att-ok { display: flex; gap: 10px; align-items: center; padding: 18px 16px; color: var(--ink-2); }
.att-ok i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
body:not(.hud) .map-card .hub.hub-framed { height: 560px; }
body:not(.hud) .hub-framed .hub-side.panel { top: 12px; right: 12px; bottom: auto; max-height: calc(100% - 24px); width: 300px; border-radius: 8px; }
body:not(.hud) .qc-site .qc-core { font-family: var(--font); font-weight: 600; }

/* map: calmer site markers, OSM fallback dimmed for the dark theme */
body:not(.hud) .qc-site .ring { box-shadow: none; background: rgba(95,194,122,.16); border-width: 2px; }
body:not(.hud) .qc-site.warn .ring { box-shadow: none; background: rgba(233,166,64,.16); }
body:not(.hud) .qc-site.alarm .ring { box-shadow: 0 0 0 6px rgba(242,100,95,.15); background: rgba(242,100,95,.2); }
.osm-dim .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.4); }
.att-more summary { padding: 10px 16px; color: var(--link); font-size: 13px; cursor: pointer; border-top: 1px solid var(--line-2); list-style: none; }
.att-more summary::-webkit-details-marker { display: none; }
.att-more[open] summary { color: var(--ink-3); }
body:not(.hud) .leaflet-container { background: #e9ecef; }
body.theme-dark:not(.hud) .leaflet-container { background: #15191d; }
body:not(.hud) .bus-foot form button { background: transparent; border-color: rgba(255,255,255,.12); color: var(--bus-ink); }
body:not(.hud) .bus-foot form button:hover { background: rgba(255,255,255,.06); color: #fff; }

/* ---------------------------------------------------------------- live single-line diagram */
.sld-rail { margin-bottom: 16px; }
.sld-panel { margin-bottom: 16px; }
.sld-wrap { padding: 8px 12px 12px; overflow-x: auto; background:
  radial-gradient(circle, var(--line-2) 1px, transparent 1.2px) 0 0 / 22px 22px; }
.sld { width: 100%; min-width: 900px; display: block; font-family: var(--font); }
.sld-node rect { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.sld-node.inv rect { stroke: var(--ink-3); }
.sld-node.fault rect { stroke: var(--red); stroke-width: 1.5; }
.sld-node.pv rect { fill: var(--panel-2); }
.sld-node.meter rect, .sld-grid rect { fill: var(--panel-2); }
.sld-t { font-size: 13.5px; font-weight: 600; fill: var(--ink); }
.sld-s { font-size: 11.5px; fill: var(--ink-3); }
.sld-k { font-size: 12px; fill: var(--ink-3); }
.sld-v { font-size: 12.5px; fill: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.sld-v.hi { fill: var(--leaf); font-weight: 600; }
.sld-ph { font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.sld-wire { fill: none; stroke: var(--line); stroke-width: 2; }
.sld-wire.live { stroke: var(--leaf); stroke-dasharray: 6 8; animation: sld-flow 1.1s linear infinite; }
.sld-wire.live.still { animation: none; stroke-dasharray: none; }
@keyframes sld-flow { to { stroke-dashoffset: -14; } }
.sld-bus { stroke: var(--ink-2); stroke-width: 4; stroke-linecap: round; }
.sld-dot { fill: var(--ink-2); }
.sld-pylon { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; }
.sld-empty { font-size: 14px; fill: var(--ink-3); }
.sld-dev { border-top: 1px solid var(--line-2); }
.sld-dev:first-child { border-top: 0; }
.sld-dev summary { padding: 12px 16px; cursor: pointer; list-style: none; }
.sld-dev summary::-webkit-details-marker { display: none; }
.sld-grid-tbl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 24px; padding: 0 16px 14px; }
.sld-grid-tbl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.sld-grid-tbl span { color: var(--ink-3); }
.sld-grid-tbl b { font-weight: 500; font-variant-numeric: tabular-nums; }
pre.raw { margin: 0; max-height: 70vh; overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); }
.agent-h { font-size: 13px; font-weight: 600; margin: 14px 0 4px; }
.agent-ul { margin: 0; padding-left: 18px; line-height: 1.55; }
.agent-form { display: grid; gap: 12px; }
.agent-form label { display: grid; gap: 4px; margin: 0; }
.agent-form button { justify-self: start; }

/* ---------------------------------------------------------------- interactive site map */
.smap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 28px 14px; }
.smap-head h1 { margin: 0; }
.smap-head .sub { color: var(--ink-3); font-size: 13px; }
.smap-permit { margin: 0 28px 12px; padding: 10px 14px; border: 1px solid rgba(233,166,64,.4); background: var(--amber-bg); border-radius: 6px; font-size: 13.5px; }
.smap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - 150px); min-height: 520px; border-top: 1px solid var(--line-2); }
.smap-map { height: 100%; background: #f4f4f2 !important; }
body.theme-dark:not(.hud) .smap-map { background: #2a2e33 !important; }
.smap-side { border-left: 1px solid var(--line-2); background: var(--panel); overflow-y: auto; display: flex; flex-direction: column; }
.smap-tools { padding: 12px 14px; border-bottom: 1px solid var(--line-2); display: grid; gap: 10px; }
.smap-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px !important; font-size: 12px !important; border-radius: 4px !important; }
.kchip i { width: 8px; height: 8px; border-radius: 50%; }
.kchip span { color: var(--ink-3); }
.kchip.off { opacity: .45; }
.smap-panel { border-bottom: 1px solid var(--line-2); }
.iso-card { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.iso-card:last-child { border-bottom: 0; }
.iso-card.sel { background: var(--brand-soft); }
.iso-card-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iso-dot { width: 9px; height: 9px; border-radius: 50%; }
.iso-label { margin: 4px 0 8px; color: var(--ink-2); font-size: 13px; }
.iso-sec { margin-top: 8px; font-size: 13px; line-height: 1.5; }
.iso-sec span { display: block; color: var(--ink-3); font-size: 12px; }
.iso-lock { margin-top: 4px; font-size: 13px; }
.iso-acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.smap-tray { padding: 0 16px 14px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; background: var(--panel-2); }
.smap-tray .panel-head { padding: 12px 0 4px; border: 0; min-height: 0; }
.smap-tray label, .iso-form label { display: grid; gap: 4px; margin: 0; font-size: 13px; }
.iso-tray-list { font-size: 13px; color: var(--ink-2); }
.iso-form { padding: 0 16px 14px; display: grid; gap: 10px; }
.iso-form .panel-head { padding: 12px 0 0; border: 0; min-height: 0; }
.iso-ll { list-style: none; margin: 0; padding: 0 16px 12px; }
.iso-ll li { padding: 5px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.iso-mk { }
.iso-mk i { display: block; width: 100%; height: 100%; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.55); box-sizing: border-box; }
.iso-mk.big i { border-radius: 3px; border-width: 2px; }
.iso-mk span { position: absolute; left: 13px; top: -3px; font: 600 10.5px/1 var(--font); color: #1b1f24; background: rgba(255,255,255,.85); padding: 1px 3px; border-radius: 2px; white-space: nowrap; display: none; pointer-events: none; }
.iso-mk.big span { display: block; left: 19px; top: 0; font-size: 11.5px; }
.z-labels .iso-mk span { display: block; }
.iso-mk.locked i { box-shadow: 0 0 0 3px #e0423a, 0 0 0 6px rgba(224,66,58,.35); }
.iso-mk.sel i { box-shadow: 0 0 0 3px var(--brand), 0 0 0 6px rgba(47,124,246,.3); }
.iso-mk.approx i { border-style: dashed; }
.editing .iso-mk { cursor: move; }
@media (max-width: 900px) { .smap { grid-template-columns: minmax(0, 1fr); height: auto; } .smap-map { height: 60vh; } .smap-side { border-left: 0; } }
.iso-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line-2); }
.iso-add select { flex: 1; min-width: 220px; }
.inline-form { display: flex; gap: 4px; align-items: center; }
tr.muted td { color: var(--ink-3); }
.drw-up { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.drw-up input[name=title] { flex: 1; min-width: 160px; }
.agent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 14px 16px; }
.agent-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--ink); }
.agent-card:hover { border-color: var(--brand); text-decoration: none; }
.agent-card-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.smap-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 8px; }
.smap.smap-embed { height: calc(100vh - 290px); min-height: 520px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

/* permit isolation picker */
.isop { border-top: 1px solid var(--line-2); }
.isop-work { padding: 14px 16px; display: grid; gap: 6px; }
.isop-work label { font-weight: 600; font-size: 13px; margin: 0; }
.isop-row { display: flex; gap: 8px; }
.isop-row input { flex: 1; }
.isop-notes { font-size: 13px; padding: 10px 12px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); line-height: 1.5; }
.isop-notes ul { margin: 6px 0; padding-left: 18px; }
.isop-tabs { display: flex; gap: 8px; align-items: center; padding: 0 16px 10px; }
.isop-filter { flex: 1; max-width: 260px; height: 32px; }
.isop-list { max-height: 380px; overflow-y: auto; border-top: 1px solid var(--line-2); }
.isop-g { border-bottom: 1px solid var(--line-2); }
.isop-g summary { display: flex; justify-content: space-between; gap: 8px; padding: 10px 16px; cursor: pointer; list-style: none; }
.isop-g summary::-webkit-details-marker { display: none; }
.isop-item { display: flex; gap: 10px; align-items: center; padding: 8px 16px 8px 22px; margin: 0; font-weight: 400; cursor: pointer; border-top: 1px solid var(--line-2); min-height: 44px; }
.isop-item.on { background: var(--brand-soft); }
.isop-item.done { opacity: .7; cursor: default; }
.isop-item input { width: 18px; height: 18px; flex: none; }
.isop-map { height: 420px; border-top: 1px solid var(--line-2); background: #f4f4f2; }
body.theme-dark:not(.hud) .isop-map { background: #2a2e33; }
.isop-sel { border-top: 1px solid var(--line-2); }
.isop-sel:empty { display: none; }
.isop-sel-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 4px; }
.isop-sel-row { display: flex; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.isop-sel-row input[data-lock] { width: 100px; }
.isop-sel-f { display: flex; gap: 12px; align-items: center; padding: 12px 16px 14px; flex-wrap: wrap; }
@media (max-width: 700px) { .isop-row { flex-direction: column; } .isop-sel-row .grow { flex-basis: 100%; } }

/* dark drawings: invert the layout in the dark theme (hue-rotate keeps reds red and greens green) */
body.theme-dark:not(.hud) .smap-map, body.theme-dark:not(.hud) .isop-map { background: #111417 !important; }
body.theme-dark:not(.hud) .dark-drawing .leaflet-image-layer { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92) saturate(1.15); }
body.theme-dark:not(.hud) .dark-drawing .iso-mk span { background: rgba(17,20,23,.88); color: #e6e9ed; }
body.theme-dark:not(.hud) .dark-drawing .iso-mk i { border-color: rgba(255,255,255,.7); }
.smap-tools .drw-toggle { justify-self: start; }
/* narrower windows: wrap page actions; stack the map panel under the map */
body:not(.hud) .page-head { flex-wrap: wrap; }
body:not(.hud) .page-head .actions { flex-wrap: wrap; }
@media (max-width: 1100px) { .smap.smap-embed { grid-template-columns: minmax(0, 1fr); height: auto; }
  .smap.smap-embed .smap-map { height: 62vh; min-height: 460px; }
  .smap.smap-embed .smap-side { border-left: 0; border-top: 1px solid var(--line-2); max-height: none; } }
@media (max-width: 1100px) { .smap { grid-template-columns: minmax(0, 1fr); height: auto; } .smap-map { height: 62vh; } .smap-side { border-left: 0; } }

/* ---------------------------------------------------------------- hub hero: fleet output + agent briefing */
.hub-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin-bottom: 16px; }
.hub-hero > .panel { margin: 0; }
.hero-chart { display: flex; flex-direction: column; min-height: 400px; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, rgba(121,194,87,.07), transparent 60%), var(--panel); }
.hero-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px 0; }
.hero-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.hero-legend { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.hero-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-left: 8px; }
.lg-a { background: var(--leaf); } .lg-e { border-top: 2px dashed var(--ink-3); height: 0 !important; }
.hero-nums { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; padding: 12px 18px 4px; align-items: end; }
.hero-nums b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero-nums .hn-main b { font-size: 44px; font-weight: 500; letter-spacing: -0.03em; color: var(--ink); }
.hero-nums span { font-size: 12.5px; color: var(--ink-3); }
.hero-svg { position: relative; flex: 1; min-height: 240px; padding: 0 8px 8px; }
#fleet-chart { width: 100%; height: 100%; display: block; position: absolute; inset: 0; }
.hero-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: var(--ink-3); font-size: 13.5px; padding: 20px; text-align: center; }
.fc-grid { stroke: var(--line-2); stroke-width: 1; }
.fc-ax { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.fc-a { fill: none; stroke: var(--leaf); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(121,194,87,.45)); }
.fc-e { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .8; }
.fc-eband { fill: var(--ink-3); opacity: .06; }
.fc-now { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 4; }
.fc-nowl { fill: var(--ink-2); }
.fc-dot { fill: var(--leaf); stroke: var(--panel); stroke-width: 2; }
.fc-pulse { fill: var(--leaf); opacity: .3; transform-box: fill-box; transform-origin: center; animation: fc-pulse 2.2s ease-out infinite; }
@keyframes fc-pulse { 0% { transform: scale(.6); opacity: .45; } 100% { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fc-pulse { animation: none; } }
.fc-hover { stroke: var(--ink-2); stroke-width: 1; }
.fc-tip { fill: var(--panel-2); stroke: var(--line); }
.fc-tipt { fill: var(--ink); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.hero-brief { display: flex; flex-direction: column; }
.brief-body { padding: 10px 18px 6px; font-size: 13.5px; line-height: 1.55; flex: 1; }
.brief-body p { margin: 0 0 10px; color: var(--ink-2); }
.brief-body .brief-h { font-size: 16px; line-height: 1.4; color: var(--ink); font-weight: 500; }
.brief-body span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.brief-att ol { margin: 0; padding-left: 18px; color: var(--ink); }
.brief-att li { margin-bottom: 4px; }
.brief-skel { height: 12px; border-radius: 4px; background: var(--panel-2); margin: 10px 0; }
.brief-skel.short { width: 60%; }
.brief-refresh { margin: 0 18px 14px; justify-self: start; align-self: flex-start; }
/* rankings */
.rank { list-style: none; margin: 0; padding: 4px 0; }
.rank a { display: grid; grid-template-columns: 22px 1fr auto 10px; gap: 10px; align-items: center; padding: 9px 16px; color: var(--ink); }
.rank a:hover { background: var(--row-hover); text-decoration: none; }
.rk-n { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.rk-site b { display: block; font-weight: 500; font-size: 13.5px; }
.rk-bar { display: block; height: 4px; border-radius: 2px; background: var(--line-2); margin-top: 5px; overflow: hidden; }
.rk-bar i { display: block; height: 100%; border-radius: 2px; }
.rk-v { text-align: right; }
.rk-v b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rk-v small { font-size: 11.5px; color: var(--ink-3); }
.rk-al { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.rk-al.off { background: var(--ink-3); box-shadow: none; }
.rk-other { padding: 6px 16px 12px; }
/* map: performance markers + legend */
.qc-site.perf .qc-pct { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px); font: 600 10.5px/1 var(--font);
  color: #fff; background: rgba(12,15,18,.82); padding: 2px 5px; border-radius: 3px; white-space: nowrap; }
.perf-legend { background: rgba(14,17,20,.86); color: #d8dde2; padding: 10px 12px; border-radius: 8px; font: 11.5px/1.4 var(--font);
  border: 1px solid rgba(255,255,255,.08); min-width: 170px; }
.perf-legend b { display: block; font-weight: 600; margin: 2px 0 5px; color: #fff; }
.pl-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, hsl(0,72%,52%), hsl(40,72%,52%), hsl(75,72%,52%), hsl(130,72%,52%)); }
.pl-ticks { display: flex; justify-content: space-between; color: #9aa4ae; margin: 3px 0 8px; }
.pl-sizes { display: flex; align-items: center; gap: 6px; color: #9aa4ae; }
.pl-sizes i { display: inline-block; border-radius: 50%; border: 2px solid #7fc35e; background: rgba(127,195,94,.2); }
.pl-note { color: #9aa4ae; margin-top: 6px; }
body:not(.hud) .map-card .hub.hub-framed { height: 600px; }
@media (max-width: 1150px) { .hub-hero { grid-template-columns: minmax(0, 1fr); } .hero-nums { grid-template-columns: 1fr 1fr; } }

/* ---- review pass: stop grid children and long rows forcing sideways scroll on phones ---- */
.shell > *, .main, main, .panel, .hub-hero > *, .mon-grid > *, .ops-grid > *, .ops-top > * { min-width: 0; }
.panel { max-width: 100%; }
.panel-head { flex-wrap: wrap; gap: 6px 12px; }
.mon-alerts li { flex-wrap: wrap; }
.mon-a-act { flex-wrap: wrap; }
.fleet { flex-wrap: wrap; gap: 12px; }
.fleet .actions { flex-wrap: wrap; }
@media (max-width: 640px) {
  .hero-nums .hn-main b { font-size: 36px; }
  .hero-nums b { font-size: 20px; }
  .mon-a-act { width: 100%; }
  .hero-chart { min-height: 340px; }
  .fleet .actions { width: 100%; }
}

.hero-note { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 13px; color: var(--ink-2); }

/* ================================================================ v4 — premium pass
   One typeface (Manrope), graphite surfaces, colour reserved for meaning. Primary actions are monochrome like an
   instrument; Quadrant's leaf green is kept for anything live (output, online, now). Loaded last, so it wins. */
:root {
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f3f4f5; --panel: #ffffff; --panel-2: #f6f7f8;
  --ink: #0f1317; --ink-2: #4a545f; --ink-3: #78828e;
  --line: #e3e6e9; --line-2: #edeff1;
  --bus: #0f1317; --bus-ink: #9aa4ae;
  --radius: 12px;
  --leaf: #5c9c3e;
  --shadow: 0 1px 2px rgba(15,19,23,.04);
  --row-hover: #f8f9fa;
  --btn-ink-bg: #0f1317; --btn-ink-fg: #ffffff; --btn-ink-hover: #262c33;
}
body.theme-dark:not(.hud) {
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #0d1013; --panel: #13171b; --panel-2: #181d22;
  --ink: #eceff2; --ink-2: #a4adb6; --ink-3: #6f7985;
  --line: rgba(255,255,255,.075); --line-2: rgba(255,255,255,.05);
  --bus: #0a0c0f; --bus-ink: #8e98a3;
  --leaf: #86c95f;
  --row-hover: #171c21; --input-bg: #0f1317; --input-line: rgba(255,255,255,.12); --col-bg: #101417;
  --shadow: none;
  --btn-ink-bg: #eceff2; --btn-ink-fg: #0d1013; --btn-ink-hover: #ffffff;
  background: var(--bg);
}
body { font-size: 13.5px; font-weight: 400; letter-spacing: 0; font-feature-settings: "tnum" 0; }
h1, h2, h3 { letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; }
.page-head { margin-bottom: 22px; }
.page-head .sub { font-size: 13.5px; color: var(--ink-3); }
.panel-head { padding: 14px 18px; }
.panel-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
/* sidebar: quiet, monochrome, a white marker for where you are */
.nav a { font-size: 13.5px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav a.on { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on::before { background: #fff; width: 2px; }
.nav a.on svg { color: #fff; }
.nav .nav-h { font-size: 11.5px; font-weight: 600; color: #5f6a76; letter-spacing: 0; }
.nav .count.info { background: rgba(255,255,255,.1); font-weight: 600; }
.bus > .brand { border-bottom-color: rgba(255,255,255,.06); }
.topbar { background: var(--bg); border-bottom: 1px solid var(--line); height: 58px; }
.topbar input[type=search] { border-radius: 10px; background: var(--panel); }
/* controls: 8px radius, ink-filled primary, hairline everything else */
button, .btn { border-radius: 8px; font-weight: 500; padding: 7px 13px; min-height: 34px; }
body:not(.hud) .btn.primary, body:not(.hud) button.primary {
  background: var(--btn-ink-bg); border-color: var(--btn-ink-bg); color: var(--btn-ink-fg); font-weight: 600; }
body:not(.hud) .btn.primary:hover, body:not(.hud) button.primary:hover { background: var(--btn-ink-hover); border-color: var(--btn-ink-hover); filter: none; }
input, select, textarea { border-radius: 8px; }
.seg { border-radius: 9px; }
.seg a { border-radius: 7px; font-weight: 500; }
/* panels & tables: fewer boxes, hairlines carry the structure */
.panel { border-radius: var(--radius); }
th { background: transparent; font-weight: 500; font-size: 12.5px; padding: 10px 14px; letter-spacing: 0; }
td { padding: 11px 14px; font-size: 13.5px; }
td .title { font-weight: 600; letter-spacing: -0.005em; }
.badge { font-weight: 600; font-size: 11.5px; padding: 2px 9px 2px 8px; }
.tag { border-radius: 5px; font-weight: 500; }
/* readouts: the number is the design */
.readouts { border-radius: var(--radius); }
.readout { padding: 16px 20px 15px; }
.readout .v { font-size: 28px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.readout .v small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-left: 4px; }
.readout .k { font-size: 12.5px; font-weight: 500; }
.readout .d { font-size: 12.5px; }
/* hub hero */
.fleet-line { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.hero-nums .hn-main b { font-size: 52px; font-weight: 500; letter-spacing: -0.04em; }
.hero-nums b { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; }
.hero-nums span { font-size: 12.5px; }
.hero-head h2 { font-size: 14px; font-weight: 600; }
.brief-body .brief-h { font-size: 16.5px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; }
.rank a { padding: 10px 18px; }
.rk-v b { font-weight: 600; letter-spacing: -0.02em; }
.hero-chart { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--leaf) 7%, transparent), transparent 60%), var(--panel); }
/* auth */
.auth-box h1 { font-size: 24px; }
/* focus: visible, neutral */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 640px) { h1 { font-size: 22px; } .readout .v { font-size: 24px; } .hero-nums .hn-main b { font-size: 40px; } }
/* login: the product's own signature, a day's output curve, instead of a decorative wave */
.auth-art { background: radial-gradient(90% 60% at 100% 100%, rgba(134,201,95,.08), transparent 60%), var(--bus); }
.auth-art .daycurve { position: absolute; left: 0; right: 0; bottom: 34px; width: 100%; height: 36%; pointer-events: none; }
.auth-art .line { font-size: 30px; font-weight: 600; letter-spacing: -0.025em; max-width: 400px; }
.auth-art .line span { font-size: 14px; max-width: 380px; }
.auth-art .fine { color: var(--bus-ink); opacity: .9; }
body.theme-light .auth-main { background: var(--bg); }
.auth-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; max-width: 400px; box-shadow: var(--shadow); }
/* map markers: a solid core so the site code reads on light tiles too */
.qc-site .qc-core { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
body.theme-light .qc-site .ring { background: rgba(15,19,23,.72); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
body.theme-light .qc-site.perf .ring { background: color-mix(in srgb, currentColor 18%, rgba(15,19,23,.78)); }
body.theme-light .qc-site .ppl { box-shadow: 0 0 0 2px #fff; }

/* ---------------------------------------------------------------- client portal (white-label) */
.client-brand { display: block; padding: 18px 18px 14px; }
.client-brand .client-logo { display: block; max-width: 170px; max-height: 44px; height: auto; }
.client-brand .client-word { display: block; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.client-brand .operated { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 10.5px; color: #6f7985; }
.client-brand .operated img { height: 14px; width: auto; opacity: .85; }
body.portal .nav a.on::before { background: var(--client, #fff); }
body.portal .nav a.on svg { color: var(--client, #fff); }
body.portal .portal-chip { background: color-mix(in srgb, var(--client, var(--ink)) 12%, transparent); color: var(--ink-2); }
body.portal .meter i { background: var(--client, var(--leaf)); }
.portal-site { margin-bottom: 24px; }
.portal-site-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.portal-site-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.portal-site-head h2 a { color: var(--ink); }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; }
.portal-grid > .panel { margin: 0; min-width: 0; }
.portal-hero { min-height: 380px; }
.portal-side .readouts.r2 { grid-template-columns: 1fr 1fr; border: 0; margin: 0; border-radius: 0; }
.portal-side .readouts.r2 .readout { border-left: 0; border-top: 1px solid var(--line-2); }
.portal-side .readouts.r2 .readout:nth-child(-n+2) { border-top: 0; }
.portal-side .readouts.r2 .readout:nth-child(even) { border-left: 1px solid var(--line-2); }
.brand-panel { display: grid; gap: 12px; }
.brand-preview { display: flex; align-items: center; gap: 14px; background: #0f1317; border-radius: 10px; padding: 18px 20px; }
.brand-preview img { max-height: 44px; max-width: 200px; }
.brand-preview .brand-word { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-preview .brand-swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--client, #fff); margin-left: auto; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.brand-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.brand-form input[type=file] { width: auto; min-height: 0; padding: 4px; }
@media (max-width: 1000px) { .portal-grid { grid-template-columns: minmax(0, 1fr); } }
.client-brand .operated { font-size: 11px; color: #7a8591; margin-top: 8px; letter-spacing: 0; }
/* a client's accent is often a deep corporate colour: lift it on dark so it still reads */
body.portal.theme-dark { --client-on: color-mix(in srgb, var(--client, #fff) 55%, #fff); }
body.portal.theme-light { --client-on: var(--client, var(--ink)); }
body.portal .nav a.on::before { background: var(--client-on); }
body.portal .nav a.on svg { color: var(--client-on); }
body.portal .meter i { background: var(--client-on); }
@media (max-width: 640px) {
  .portal-chip { display: none; }
  .hero-legend { display: none; }
  .hero-nums { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .hero-nums .hn-main { grid-column: 1 / -1; }
  .hero-nums .hn-main b { font-size: 44px; white-space: nowrap; }
  .hero-nums b { font-size: 21px; white-space: nowrap; }
  .portal-hero { min-height: 0; }
  .portal-hero .hero-svg { min-height: 220px; }
  .portal-site-head h2 { font-size: 18px; }
}
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 28px 0; padding: 10px 14px;
  border: 1px solid var(--amber); background: var(--amber-bg); color: var(--ink); border-radius: 10px; font-size: 13px; }
@media (max-width: 640px) { .preview-bar { margin: 12px 16px 0; } }

/* ---------------------------------------------------------------- defects */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 14px 16px 4px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.photo-grid figcaption { font-size: 12.5px; margin-top: 6px; display: grid; gap: 2px; }
.photo-form, .rates-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.photo-form input[type=file] { width: auto; min-height: 0; padding: 4px; }
.photo-form input[name=caption] { width: auto; flex: 1; min-width: 160px; }
.rates-form label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rates-form input { width: 110px; }
.rates-form small { color: var(--ink-3); }
.row-alarm td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.stack { display: grid; gap: 8px; }

/* ---------------------------------------------------------------- site map: block status + defect pins */
.st-halo { cursor: pointer; }
.def-mk { position: relative; }
.def-mk i { position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 0 10px currentColor; }
.def-mk.sev-critical i { animation: pulse 1.4s ease-in-out infinite; }
.def-mk span { position: absolute; left: 18px; top: -2px; font: 600 10.5px/1.2 var(--font); color: #fff; background: rgba(12,15,18,.85); padding: 2px 5px; border-radius: 3px; white-space: nowrap; display: none; }
.z-labels .def-mk span { display: block; }
.st-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.st-dot.st-red, .st-red { --c: #f2645f; } .st-dot.st-amber { --c: #e9a640; } .st-dot.st-green { --c: #79c257; } .st-dot.st-none { --c: var(--ink-3); }
.st-dot { background: var(--c, var(--ink-3)); }
.def-row { display: block; padding: 6px 0; border-top: 1px solid var(--line-2); color: var(--ink); font-size: 13px; }
.def-row:first-of-type { border-top: 0; }
.def-row i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); margin: 0 8px 0 2px; }
.def-row span { display: block; padding-left: 20px; }
.def-row.hi { background: var(--panel-2); margin: 0 -8px; padding: 6px 8px; border-radius: 6px; }
.grp-card { border-left: 3px solid var(--c, var(--line)); }
.smap-legend { background: rgba(14,17,20,.86); color: #d8dde2; padding: 8px 10px; border-radius: 8px; font: 12px/1.5 var(--font); border: 1px solid rgba(255,255,255,.08); display: grid; gap: 4px; }
.smap-legend label { display: flex; align-items: center; gap: 6px; }
.smap-legend input { width: auto; min-height: 0; margin: 0; }
.smap-legend .lgk { display: flex; align-items: center; gap: 4px; color: #9aa4ae; font-size: 11px; margin-left: 20px; }
.smap-legend .lgk i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.smap-legend .lgk i:first-child { margin-left: 0; }
.smap-legend button { margin-top: 4px; justify-self: start; }
#smap.pinning { cursor: crosshair; }
body.theme-light .smap-legend { background: rgba(255,255,255,.94); color: var(--ink); border-color: var(--line); }
body.theme-light .smap-legend .lgk { color: var(--ink-3); }

/* ---------------------------------------------------------------- control room: full-bleed imagery with floating rails */
body.room .content { padding: 0; max-width: none; }
body.room .content > .flash { position: absolute; z-index: 700; left: 50%; transform: translateX(-50%); top: 70px; }
.room { height: calc(100vh - 58px); min-height: 600px; overflow: hidden; background: #06090c; }
.room .hub-map { position: absolute; inset: 0; }
.room .leaflet-container { background: #06090c; }
.room .leaflet-control-attribution { background: rgba(6,9,12,.6); color: #7a8591; font-size: 10px; }
.room .leaflet-control-attribution a { color: #9aa4ae; }
.room-top { position: absolute; top: 14px; left: 338px; right: 414px; z-index: 600; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
.room-top > * { pointer-events: auto; }
.room-title { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #eef1f3; background: rgba(10,13,16,.72); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 8px 14px; }
.room-title b { font-weight: 600; }
.room-top-acts { display: flex; align-items: center; gap: 10px; }
.room-clock { font-size: 13px; color: #c7ced5; font-variant-numeric: tabular-nums; background: rgba(10,13,16,.72); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 8px 12px; }
.room-rail { position: absolute; top: 14px; bottom: 14px; z-index: 600; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-width: thin; }
.room-rail.left { left: 14px; width: 310px; }
.room-rail.right { right: 14px; width: 386px; }
.room-card { background: rgba(14,17,21,.80); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 14px 16px; color: #e6eaee; flex: 0 0 auto; }
.room-card .panel-head { padding: 0 0 8px; }
.room-card .panel-head h2 { color: #eef1f3; }
.room-h { font-size: 12.5px; font-weight: 600; color: #9aa4ae; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.room-big { font-size: 15px; color: #c7ced5; }
.room-big b { font-size: 30px; font-weight: 500; letter-spacing: -0.03em; color: #fff; margin-right: 4px; }
.room-tech { list-style: none; margin: 10px 0 0; padding: 0; }
.room-tech li { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.07); font-size: 13px; }
.room-tech li span { color: #c7ced5; }
.room-tech li b { font-weight: 600; text-align: right; }
.room-tech li small { grid-column: 2; text-align: right; color: #7a8591; font-size: 11.5px; }
.room-status { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.room-status a { display: block; padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); color: #e6eaee; }
.room-status a small { display: block; font-size: 11.5px; color: #9aa4ae; margin-bottom: 2px; }
.room-status a b { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.room-status a.ok small { color: #86c95f; } .room-status a.warn small { color: #e9a640; } .room-status a.bad small { color: #f2645f; } .room-status a.dim { opacity: .7; }
.room-sites { position: static; width: auto; flex: 1 1 200px; min-height: 180px; background: rgba(14,17,21,.80); border: 1px solid rgba(255,255,255,.08); }
.room-sites .hub-side-body { overflow-y: auto; }
.room-output { padding-bottom: 12px; }
.room-output .hero-head { padding: 0 0 4px; }
.room-output .hero-nums { padding: 6px 0 2px; gap: 8px; }
.room-output .hero-nums .hn-main b { font-size: 36px; }
.room-output .hero-nums b { font-size: 18px; color: #eef1f3; }
.room-output .hero-nums span { font-size: 11.5px; }
.room-output .hero-svg { height: 150px; min-height: 150px; flex: none; padding: 0; margin: 4px -6px 0; }
.room-output .fc-ax { fill: #7a8591; }
.room-brief { padding: 0; font-size: 12.5px; line-height: 1.5; }
.room-brief .brief-h { font-size: 14px; color: #eef1f3; }
.room-brief p { color: #b4bcc4; margin-bottom: 6px; }
.room-brief span { color: #7a8591; }
.room-alarms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.room-alarms a { display: block; padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); color: #e6eaee; }
.room-alarms a small { display: block; font-size: 11.5px; color: #9aa4ae; }
.room-alarms a b { font-size: 22px; font-weight: 500; }
.room-alarms a.fault.on { background: rgba(242,100,95,.14); border-color: rgba(242,100,95,.5); } .room-alarms a.fault.on small { color: #f2645f; }
.room-alarms a.warn.on { background: rgba(233,166,64,.12); border-color: rgba(233,166,64,.5); } .room-alarms a.warn.on small { color: #e9a640; }
.room-alarms a.info.on { background: rgba(110,166,255,.1); border-color: rgba(110,166,255,.4); } .room-alarms a.info.on small { color: #6ea6ff; }
.room-att { max-height: 220px; overflow-y: auto; }
.room-att li a { color: #e6eaee; } .room-att li small { color: #9aa4ae; }
.room .rank a { color: #e6eaee; padding: 8px 0; } .room .rank a:hover { background: rgba(255,255,255,.04); }
.room .rk-site b { color: #eef1f3; } .room .rk-v small, .room .rk-n { color: #9aa4ae; }
.room .rk-bar { background: rgba(255,255,255,.08); }
.room .qc-site.perf .qc-pct { background: rgba(6,9,12,.85); }
@media (max-width: 1100px) {
  .room { height: auto; min-height: 0; overflow: visible; }
  .room .hub-map { position: relative; height: 60vh; }
  .room-rail { position: static; width: auto; padding: 12px 14px 0; overflow: visible; }
  .room-top { position: static; padding: 12px 14px 0; }
  .room-rail.right { padding-bottom: 20px; }
}
.room-rail, .room-card { text-align: left; }
.room-output .hero-nums { grid-template-columns: repeat(3, 1fr); }
.room-output .hero-nums .hn-main { grid-column: 1 / -1; }
.room-output .hero-nums .hn-main b { font-size: 40px; white-space: nowrap; }
.room-output .hero-svg { height: 170px; min-height: 170px; margin-bottom: 12px; }
.room .leaflet-bottom.leaflet-right { margin-right: 400px; margin-bottom: 4px; }
.room .leaflet-bottom.leaflet-left .leaflet-control-scale { margin-left: 14px; }
@media (max-width: 1100px) { .room .leaflet-bottom.leaflet-right { margin-right: 0; } .room .leaflet-bottom.leaflet-left .leaflet-control-scale { margin-left: 0; } }

/* ---------------------------------------------------------------- simulated (demo) monitoring labels */
.sim-tag { vertical-align: middle; font-size: 11px; }
.sim-note { color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; margin-right: 6px; }
.sim-mini { font-style: normal; font-size: 10px; font-weight: 600; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
@media (max-width: 640px) { .hero-legend { display: flex; } .hero-legend > :not(.sim-note) { display: none; } }

/* ================================================================ LOOK: EDGE
   Black surfaces, one signal green, square edges, no glow. Switchable: body.look-edge is on unless the qc_look cookie
   says "classic" (/look?set=classic). Colour rules: green = live / primary action; red = fault or safety only;
   amber = due or degraded; everything else is neutral. */
body.look-edge { --sig: #76b900; --sig-hi: #8fd61a; --radius: 2px; --leaf: #76b900; --shadow: none; --glow: none; }
body.look-edge.theme-dark:not(.hud) {
  --bg: #000000; --panel: #0c0c0c; --panel-2: #141414; --col-bg: #080808;
  --ink: #f4f4f4; --ink-2: #b0b0b0; --ink-3: #737373;
  --line: #262626; --line-2: #1b1b1b;
  --bus: #000000; --bus-ink: #9a9a9a;
  --row-hover: #121212; --input-bg: #050505; --input-line: #333333;
  --green: #8fd61a; --green-bg: rgba(118,185,0,.13); --leaf: #8fd61a;
  --red: #ff5347; --red-bg: rgba(255,83,71,.12); --amber: #f5b301; --amber-bg: rgba(245,179,1,.11);
  --blue: #5aa9ff; --blue-bg: rgba(90,169,255,.11); --grey: #a3a3a3; --grey-bg: rgba(255,255,255,.07);
  --link: #8fd61a; --brand: #76b900; --brand-hover: #8fd61a; --brand-soft: rgba(118,185,0,.13); --focus: #8fd61a;
  --btn-ink-bg: #76b900; --btn-ink-fg: #000000; --btn-ink-hover: #8fd61a;
  background: #000;
}
body.look-edge.theme-light:not(.hud) {
  --bg: #f5f5f5; --panel: #ffffff; --panel-2: #f2f2f2;
  --ink: #0a0a0a; --ink-2: #454545; --ink-3: #757575;
  --line: #dcdcdc; --line-2: #ebebeb;
  --bus: #000000; --bus-ink: #9a9a9a; --row-hover: #f7f7f7;
  --green: #4a7a00; --green-bg: #eef6dc; --leaf: #5c9400; --link: #3d6a00; --brand: #5c9400; --brand-hover: #4a7a00; --brand-soft: #eef6dc; --focus: #5c9400;
  --btn-ink-bg: #76b900; --btn-ink-fg: #000000; --btn-ink-hover: #8fd61a;
}
/* square everything that was rounded (circles stay circles) */
body.look-edge :is(.panel, .btn, button, input, select, textarea, .badge, .tag, .readouts, .readout, .seg, .seg a, .nav a, .count,
  .room-card, .room-title, .room-status a, .room-alarms a, .flash, .hero-note, .brief-skel, .sys, .portal-chip, .iso-card, .smap-legend,
  .perf-legend, .leaflet-bar, .leaflet-bar a, .leaflet-control-layers, .auth-box, .preview-bar, .photo-grid img, .rk-bar, .rk-bar i, .meter, .meter i,
  .sim-note, .sim-mini, .tabs a, .theme-toggle, .clock, .brand-preview, .def-row.hi, .qc-pct, .table-wrap, .sld-dev, .sld-node, .att-list li, .hub-side,
  .filters, .empty, details, .steps-list li, .when, .fc-tip) { border-radius: 2px; }
/* type: tighter, heavier headings; numerals do the talking */
body.look-edge h1 { font-weight: 700; letter-spacing: -0.03em; }
body.look-edge .panel-head h2, body.look-edge .hero-head h2 { font-weight: 700; letter-spacing: 0; display: flex; align-items: center; gap: 9px; }
body.look-edge .panel-head h2::before, body.look-edge .hero-head h2::before { content: ""; width: 3px; height: 13px; background: var(--sig); flex: none; }
body.look-edge .readout .v, body.look-edge .hero-nums b { font-weight: 600; }
body.look-edge .hero-nums .hn-main b { font-weight: 700; letter-spacing: -0.045em; }
/* shell */
body.look-edge .shell { background: linear-gradient(to right, #000 var(--nav-w), transparent var(--nav-w)); }
body.look-edge .bus { border-right: 1px solid #1f1f1f; }
body.look-edge .topbar { background: var(--bg); }
body.look-edge .nav a { border-radius: 0; padding: 8px 14px; color: #a8a8a8; }
body.look-edge .nav a:hover { background: #111; color: #fff; }
body.look-edge .nav a.on { background: #131313; color: #fff; }
body.look-edge .nav a.on::before { background: var(--sig); width: 3px; left: 0; top: 0; bottom: 0; border-radius: 0; }
body.look-edge .nav a.on svg { color: var(--sig-hi); }
body.look-edge .nav .nav-h { color: #5c5c5c; }
/* counts: quiet by default; red only when it is genuinely hot */
body.look-edge .nav .count { background: transparent; color: #8a8a8a; border: 1px solid #2e2e2e; font-weight: 600; min-width: 20px; text-align: center; }
body.look-edge .nav .count.hot, body.look-edge .nav [data-p1-count], body.look-edge .nav [data-mon-count] { color: #ff5347; border-color: rgba(255,83,71,.55); }
body.look-edge .look-switch, .look-switch { display: block; padding: 8px 18px; font-size: 11.5px; color: #6a6a6a; }
.look-switch:hover { color: #fff; text-decoration: none; }
/* surfaces: flat, hairline, no shadow */
body.look-edge .panel, body.look-edge .readouts { box-shadow: none; }
body.look-edge .panel-head { border-bottom: 1px solid var(--line-2); padding: 12px 16px; }
body.look-edge .hero-chart { background: var(--panel); border-top: 2px solid var(--sig); }
body.look-edge .readout { padding: 14px 18px 13px; }
body.look-edge .readout.t-green { box-shadow: inset 0 2px 0 var(--sig); } body.look-edge .readout.t-red { box-shadow: inset 0 2px 0 var(--red); } body.look-edge .readout.t-amber { box-shadow: inset 0 2px 0 var(--amber); }
/* controls */
body.look-edge button, body.look-edge .btn { font-weight: 600; border-color: var(--input-line, var(--line)); }
body.look-edge:not(.hud) .btn.primary, body.look-edge:not(.hud) button.primary { background: var(--sig); border-color: var(--sig); color: #000; font-weight: 700; }
body.look-edge:not(.hud) .btn.primary:hover, body.look-edge:not(.hud) button.primary:hover { background: var(--sig-hi); border-color: var(--sig-hi); }
body.look-edge input:focus, body.look-edge select:focus, body.look-edge textarea:focus { border-color: var(--sig); box-shadow: 0 0 0 1px var(--sig); outline: none; }
body.look-edge .seg a.on { background: var(--sig); color: #000; }
body.look-edge .tabs a.on { box-shadow: inset 0 -2px 0 var(--sig); color: var(--ink); }
/* tables: denser, ruled */
body.look-edge th { font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 8px 14px; border-bottom: 1px solid var(--line); }
body.look-edge td { padding: 8px 14px; font-size: 13px; }
body.look-edge tbody tr:hover { background: var(--row-hover); }
/* status: text + small square, not pills */
body.look-edge .badge { background: transparent; padding: 0; font-weight: 600; font-size: 12px; gap: 7px; }
body.look-edge .badge::before { width: 7px; height: 7px; border-radius: 0; }
body.look-edge .tag { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
body.look-edge .sys { background: transparent; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
body.look-edge .sys i { border-radius: 0; background: var(--sig); }
body.look-edge .sys.warn { border-color: color-mix(in srgb, var(--amber) 50%, transparent); color: var(--amber); } body.look-edge .sys.warn i { background: var(--amber); }
body.look-edge .sys.alarm, body.look-edge .sys.bad { border-color: color-mix(in srgb, var(--red) 55%, transparent); color: var(--red); background: transparent; } body.look-edge .sys.alarm i, body.look-edge .sys.bad i { background: var(--red); }
/* no glow, no pulse: one live indicator only (the chart's "now" dot) */
body.look-edge .fc-a { filter: none; stroke: var(--sig-hi); stroke-width: 2; }
body.look-edge .fc-dot { fill: var(--sig-hi); }
body.look-edge .fleet-dot, body.look-edge .def-mk.sev-critical i, body.look-edge .qc-site, body.look-edge .qc-site .ring { animation: none !important; }
body.look-edge .qc-site .ring { box-shadow: none !important; }
body.look-edge .rk-al { box-shadow: none; border-radius: 0; }
body.look-edge .att-list li i, body.look-edge .st-dot { border-radius: 0; }
/* control room */
body.look-edge .room-card, body.look-edge .room-title, body.look-edge .room-sites { background: rgba(0,0,0,.86); border-color: #2a2a2a; backdrop-filter: none; }
body.look-edge .room-card.room-output { border-top: 2px solid var(--sig); }
body.look-edge .room-status a.ok small { color: var(--sig-hi); }
/* login */
body.look-edge .auth-art { background: #000; }
body.look-edge .auth-box { border-top: 2px solid var(--sig); }
/* client portal keeps the client's accent for its markers; primary buttons stay signal green */
body.look-edge.portal .nav a.on::before { background: var(--client-on, var(--sig)); }
/* edge: links inside tables and lists stay neutral; green is for action and live state, not navigation */
body.look-edge td a:not(.btn), body.look-edge .plain-list a:not(.btn), body.look-edge .att-list a, body.look-edge .crumbs a { color: var(--ink); }
body.look-edge td a:not(.btn):hover, body.look-edge .plain-list a:not(.btn):hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
body.look-edge .room-output .hero-legend > :not(.sim-note) { display: none; }
body.look-edge .room-output .hero-head h2, .room-output .hero-head h2 { white-space: nowrap; }
body.look-edge .sim-note { border-radius: 2px; white-space: nowrap; }
body.look-edge .auth-art { background: #000 !important; border-right: 1px solid #1f1f1f; }
body.look-edge .auth-art .daycurve { bottom: 72px; height: 34%; }
body.look-edge .auth-main { background: #000; }
body.look-edge.theme-light .auth-main { background: #f5f5f5; }
body.look-edge svg rect[rx] { rx: 2px; }

/* ---------------------------------------------------------------- compliance */
.person-cell { vertical-align: top; border-right: 1px solid var(--line-2); }
.done-pop { display: inline-block; position: relative; text-align: left; }
.done-pop summary { list-style: none; cursor: pointer; display: inline-flex; }
.done-pop summary::-webkit-details-marker { display: none; }
.done-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 260px; display: grid; gap: 8px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.done-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-3); }
.permit-check { margin-bottom: 16px; }
.permit-check ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------- control room, grid-operator style:
   navy glass over satellite imagery, ringed markers, blue bars. Applies in the classic look (Edge keeps its own). */
body.room:not(.look-edge) .content, body.room:not(.look-edge) .topbar { background: #070c16; }
body.room:not(.look-edge) .topbar { border-bottom-color: rgba(120,160,255,.12); }
body:not(.look-edge) .room { background: #050a14; --rm-glass: rgba(9,16,30,.78); --rm-line: rgba(120,160,255,.16); --rm-blue: #3d8bff; --rm-ink: #e8eefc; --rm-dim: #8a9ab8; }
body:not(.look-edge) .room .leaflet-container { background: #050a14; }
body:not(.look-edge) .room .hub-map .leaflet-tile-pane { filter: saturate(.8) brightness(.72) contrast(1.08); }
body:not(.look-edge) .room-card, body:not(.look-edge) .room-title, body:not(.look-edge) .room-sites {
  background: var(--rm-glass); border: 1px solid var(--rm-line); border-radius: 14px; backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04); color: var(--rm-ink); }
body:not(.look-edge) .room .room-h { color: var(--rm-ink); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
body:not(.look-edge) .room .room-h .muted, body:not(.look-edge) .room .muted { color: var(--rm-dim); }
body:not(.look-edge) .room-big { color: var(--rm-dim); } body:not(.look-edge) .room-big b { font-size: 34px; font-weight: 600; }
body:not(.look-edge) .room-tech li { border-top-color: rgba(120,160,255,.1); }
body:not(.look-edge) .room-status a, body:not(.look-edge) .room-alarms a { background: rgba(4,9,20,.6); border: 1px solid rgba(120,160,255,.1); border-radius: 10px; text-align: center; padding: 12px 10px; }
body:not(.look-edge) .room-status a b { font-size: 17px; font-weight: 600; }
body:not(.look-edge) .room-status a small { margin-bottom: 4px; }
body:not(.look-edge) .room-status a.ok small { color: #5fe38a; }
.room-chip { font-size: 11.5px; font-weight: 500; color: #b8c6e4; border: 1px solid rgba(120,160,255,.25); border-radius: 7px; padding: 3px 9px; }
.room-chip.on { background: rgba(61,139,255,.16); border-color: rgba(61,139,255,.6); color: #cfe0ff; }
/* watch list: name + % with a blue bar underneath, each in its own tile */
.room-watch .rank { padding: 0; display: grid; gap: 8px; }
.room-watch .rank a { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name pct" "bar bar"; gap: 8px 10px; padding: 11px 12px; background: rgba(4,9,20,.6);
  border: 1px solid rgba(120,160,255,.1); border-radius: 10px; }
.room-watch .rk-n, .room-watch .rk-al, .room-watch .rk-v small { display: none; }
.room-watch .rk-site { display: contents; }
.room-watch .rk-site b { grid-area: name; font-weight: 500; font-size: 13px; color: #dbe5fa; }
.room-watch .rk-v { grid-area: pct; }
.room-watch .rk-v b { font-size: 14px; font-weight: 700; color: #fff !important; }
.room-watch .rk-bar { grid-area: bar; height: 6px; border-radius: 3px; background: rgba(120,160,255,.14); margin: 0; }
.room-watch .rk-bar i { border-radius: 3px; background: linear-gradient(90deg, #2f6fe0, #58a6ff) !important; }
.room-watch .rk-other { padding: 8px 2px 0; }
/* energy status */
.room-bar { position: relative; height: 12px; border-radius: 6px; background: rgba(120,160,255,.14); overflow: visible; }
.room-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #f08c1a, #ffb648); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.room-bar em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #e8eefc; border-radius: 1px; opacity: .8; }
.room-energy-nums { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 10px; }
.room-energy-nums small { display: block; font-size: 11.5px; color: #8a9ab8; }
.room-energy-nums b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.room-energy-nums .mid { text-align: center; } .room-energy-nums .end { text-align: right; }
/* performance card */
body:not(.look-edge) .room-output { background: var(--rm-glass); border-top: 1px solid var(--rm-line); }
body:not(.look-edge) .room-output .hero-head h2 { font-size: 18px; font-weight: 600; }
body:not(.look-edge) .room-output .hero-legend > :not(.sim-note) { display: none; }
body:not(.look-edge) .room-output .fc-grid { stroke: rgba(120,160,255,.12); }
body:not(.look-edge) .room-output .fc-ax { fill: #8a9ab8; }
body:not(.look-edge) .room-output .fc-e { stroke: #ffb648; stroke-dasharray: none; opacity: .9; stroke-width: 1.4; }
body:not(.look-edge) .room-output .fc-eband { fill: #ffb648; opacity: .08; }
body:not(.look-edge) .room-brief p { color: #b8c6e4; } body:not(.look-edge) .room-brief span { color: #8a9ab8; }
/* alarm tiles */
body:not(.look-edge) .room-alarms a { text-align: left; }
body:not(.look-edge) .room-alarms a b { font-size: 20px; }
body:not(.look-edge) .room-att li a { color: #dbe5fa; } body:not(.look-edge) .room-att li { border-top-color: rgba(120,160,255,.1); }
/* markers: a solid core with expanding rings, like a beacon */
body:not(.look-edge) .room .qc-site .ring { background: radial-gradient(circle, currentColor 0 58%, transparent 60%); border: 0 !important; opacity: .95;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 30%, transparent), 0 0 0 11px color-mix(in srgb, currentColor 14%, transparent), 0 0 26px color-mix(in srgb, currentColor 70%, transparent) !important;
  background-color: transparent !important; animation: room-beacon 2.6s ease-out infinite; }
body:not(.look-edge) .room .qc-site { color: #3ddc6f; }
body:not(.look-edge) .room .qc-site.warn { color: #ffb648; } body:not(.look-edge) .room .qc-site.alarm { color: #ff5f57; }
body:not(.look-edge) .room .qc-site .qc-core { color: #04140a; font-weight: 800; text-shadow: none; font-size: 11px; }
body:not(.look-edge) .room .qc-site.alarm .qc-core { color: #fff; }
@keyframes room-beacon { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 40%, transparent), 0 0 0 6px color-mix(in srgb, currentColor 20%, transparent), 0 0 22px color-mix(in srgb, currentColor 70%, transparent); }
  100% { box-shadow: 0 0 0 9px color-mix(in srgb, currentColor 14%, transparent), 0 0 0 18px transparent, 0 0 30px color-mix(in srgb, currentColor 45%, transparent); } }
@media (prefers-reduced-motion: reduce) { body:not(.look-edge) .room .qc-site .ring { animation: none; } }
body:not(.look-edge) .room .leaflet-bar a, body:not(.look-edge) .room .leaflet-control-layers { background: rgba(9,16,30,.85); color: #e8eefc; border-color: rgba(120,160,255,.2); }
body:not(.look-edge) .room-output .hero-head { flex-wrap: nowrap; gap: 8px; justify-content: flex-start; }
body:not(.look-edge) .room-output .hero-legend { font-size: 0; margin-left: auto; }
body:not(.look-edge) .room-output .hero-legend .sim-note { font-size: 11px; white-space: nowrap; margin: 0; }
body.look-edge .room-status a b { font-size: 18px; }
.remember { display: block; margin: 4px 0 14px; font-size: 13.5px; }
.remember .help { display: block; margin: 2px 0 0 24px; font-size: 12px; color: var(--ink-3); }
.remembered { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-2); }
.shift-form { display: grid; gap: 8px; max-width: 560px; }
.shift-form input[type=date] { width: auto; margin-left: 8px; }


/* ---------------------------------------------------------------- slim menu + map focus */
.nav-toggle { display: inline-flex; width: 34px; height: 34px; padding: 0; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-3); flex: none; }
.nav-toggle:hover { color: var(--ink); background: var(--panel-2); }
.nav-toggle svg { width: 17px; height: 17px; flex: none; }
body .nav-toggle { padding: 0 !important; min-height: 34px; }
.brand-mark { display: none; }
@media (max-width: 820px) { .nav-toggle { display: none; } }
@media (min-width: 821px) {
  body.nav-slim { --nav-w: 64px; }
  body.nav-slim .bus > .brand { padding: 16px 0 14px; justify-content: center; }
  body.nav-slim .bus > .brand .brand-logo { display: none; }
  body.nav-slim .bus > .brand .brand-mark { display: block; width: 34px; height: 34px; border-radius: 8px; }
  body.nav-slim .nav { padding: 4px 8px; }
  body.nav-slim .nav .nav-h { height: 1px; padding: 0; margin: 8px 10px; background: rgba(255,255,255,.1); font-size: 0; overflow: hidden; }
  body.nav-slim .nav a { font-size: 0; justify-content: center; gap: 0; padding: 11px 0; }
  body.nav-slim .nav a.on::before { left: -8px; }
  body.nav-slim .nav svg { width: 20px; height: 20px; }
  body.nav-slim .nav .count { position: absolute; top: 3px; right: 4px; margin: 0; font-size: 9px; padding: 0 5px; min-width: 15px; line-height: 15px; text-align: center; }
  body.nav-slim .look-switch { display: none; }
  body.nav-slim .bus-foot { flex-direction: column; padding: 10px 0; gap: 8px; }
  body.nav-slim .me { flex: none; padding: 0; }
  body.nav-slim .me .who { display: none; }
}
/* site map page: use the whole width, and a Focus mode that gives the map the whole screen */
body.smap-page .content { max-width: none; }
body.smap-page .smap.smap-embed { height: calc(100vh - 232px); min-height: 520px; }
body.smap-focus .shell { grid-template-columns: minmax(0, 1fr); background: none; }
body.smap-focus .bus, body.smap-focus .topbar, body.smap-focus .page-head, body.smap-focus .tabs { display: none; }
body.smap-focus .content { padding: 10px 14px 14px; }
body.smap-focus .smap.smap-embed { height: calc(100vh - 64px); }

/* map: tools in a row above, details float over the map's right edge, so the map has the full width */
.smap.smap-top { display: flex; flex-direction: column; grid-template-columns: none; }
.smap-top .smap-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 7px 12px; border-bottom: 1px solid var(--line-2); }
.smap-top .smap-tools input[type=search] { width: 190px; flex: none; height: 34px; }
.smap-top .smap-kinds { flex: 1; min-width: 200px; }
.smap-top .smap-tools .drw-toggle { justify-self: auto; }
.smap-stage { position: relative; flex: 1; min-height: 0; }
.smap-top .smap-map { position: absolute; inset: 0; height: auto; isolation: isolate; }
.smap-float { position: absolute; top: 10px; right: 10px; width: 340px; max-height: calc(100% - 20px); z-index: 5; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 10px 34px rgba(0,0,0,.4); }
.smap-top.smap-float-hidden .smap-float { display: none; }
@media (max-width: 1100px) {
  .smap.smap-top { height: auto; }
  .smap-top .smap-stage { flex: none; }
  .smap-top .smap-map { position: relative; inset: auto; height: 62vh; min-height: 420px; }
  .smap-float { position: static; width: auto; max-height: none; border-width: 1px 0 0; border-radius: 0; box-shadow: none; }
}
.smap-top .smap-locked { border-bottom: 1px solid var(--line-2); }
.smap-top .smap-locked .panel-head { padding: 10px 16px 6px; border: 0; min-height: 0; }
.iso-permit { padding: 8px 16px 12px; border-top: 1px solid var(--line-2); }
.iso-permit-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.iso-permit-h span { color: var(--ink-2); font-size: 13px; }
.iso-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.iso-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid rgba(224,66,58,.5); background: rgba(224,66,58,.1); border-radius: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.iso-chip:hover { background: rgba(224,66,58,.2); text-decoration: none; }
.iso-chip i { width: 8px; height: 8px; border-radius: 50%; }
.iso-chip span, .iso-chip em { font-weight: 400; color: var(--ink-3); font-style: normal; font-size: 11.5px; }
.smap-tools [data-iso-now].hot { border-color: rgba(224,66,58,.55); color: #ff7f77; }
.smap-top .smap-kinds { gap: 5px; }
.smap-top .kchip { padding: 1px 7px !important; font-size: 11.5px !important; gap: 5px; }
.smap-top .smap-tools .sm { padding: 4px 10px; min-height: 30px; }
.str-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; margin-top: 6px; }
.str-b { display: grid; place-items: center; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
a.str-b:hover { border-color: var(--brand); color: var(--ink); text-decoration: none; }
.str-b.bad { border-color: rgba(224,66,58,.65); background: rgba(224,66,58,.16); color: #ff8a82; }

/* control room: the map runs behind the left-hand tiles; the tiles become clear so only the words sit on the imagery */
.room-rail.left { left: 0; width: 340px; padding: 14px 0 14px 14px; box-sizing: border-box;
  background: linear-gradient(90deg, rgba(4,8,12,.55) 0%, rgba(4,8,12,.28) 70%, rgba(4,8,12,0) 100%); }
.room-rail.left .room-card, .room-rail.left .room-sites { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; padding-left: 6px; padding-right: 10px; }
.room-rail.left, .room-rail.left .room-card, .room-rail.left .room-card * { text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 10px rgba(0,0,0,.6); }
.room-rail.left .room-status a { background: rgba(8,12,16,.32); border-color: rgba(255,255,255,.14); }
.room-rail.left .room-tech li { border-top-color: rgba(255,255,255,.16); }
.room-rail.left .room-chip, .room-rail.left button { text-shadow: none; }
@media (max-width: 1100px) { .room-rail.left { background: none; padding: 12px 14px 0; width: auto; } }

/* control room: the main menu is see-through too, with the map running underneath it (desktop only) */
@media (min-width: 1101px) {
  body.room .shell { display: block; background: none; }
  body.room .bus { position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-w); z-index: 800; background: linear-gradient(90deg, rgba(4,8,12,.62), rgba(4,8,12,.34)) !important; backdrop-filter: none; border-right-color: rgba(255,255,255,.08); text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 10px rgba(0,0,0,.6); }
  body.room .topbar { padding-left: calc(var(--nav-w) + 24px); }
  body.room .room-rail.left { left: var(--nav-w); }
  body.room .room-top { left: calc(var(--nav-w) + 340px); }
  body.room .room .leaflet-bottom.leaflet-left .leaflet-control-scale, body.room .leaflet-bottom.leaflet-left .leaflet-control-scale { margin-left: calc(var(--nav-w) + 14px); }
}

/* control room carries the whole hub: readouts, field, maintenance, work orders, contracts in the left rail */
.room-today .readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.room-today .readout { padding: 10px 12px; border-radius: 9px; background: rgba(8,12,16,.32); border: 1px solid rgba(255,255,255,.14); color: #e6eaee; display: block; }
.room-today .readout .v { font-size: 22px; font-weight: 500; }
.room-today .readout .k { font-size: 11.5px; color: #c7ced5; }
.room-today .readout .d { font-size: 11.5px; color: #9aa4ae; margin-top: 2px; }
.room-ops { display: flex; flex-direction: column; gap: 10px; }
.room-rail.left .panel-head { padding: 0 0 8px; border: 0; }
.room-rail.left .plain-list { margin: 0; padding: 0; list-style: none; }
.room-rail.left .plain-list li { padding: 7px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: 10px; }
.room-rail.left .plain-list a { color: #eef1f3; }
.room-rail.left .room-card .muted { color: #aab3bb; }

/* control room: left tiles and menu use the same frosted panels as the right-hand side, so text stays easy to read */
.room-rail.left { background: none; padding: 0; width: 310px; left: calc(var(--nav-w) + 14px); }
.room-rail.left, .room-rail.left .room-card, .room-rail.left .room-card *, body.room .bus { text-shadow: none; }
.room-rail.left .room-card, .room-rail.left .room-sites { background: rgba(14,17,21,.80); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 14px 16px; }
.room-rail.left .room-sites { padding: 0 0 6px; }
@media (min-width: 1101px) {
  body.room .bus { background: rgba(14,17,21,.82) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  body.room .room-rail.left { left: calc(var(--nav-w) + 14px); }
  body.room .room-top { left: calc(var(--nav-w) + 340px); }
}
@media (max-width: 1100px) { .room-rail.left { left: auto; width: auto; padding: 12px 14px 0; } }

/* ---------------------------------------------------------------- company calendar */
.cal-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--ink-3); flex: none; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.cal-dow { padding: 6px 8px; font-size: 11.5px; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.cal-day { min-height: 104px; padding: 4px 5px 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n+14) { border-right: 0; }
.cal-day.out { opacity: .45; }
.cal-day.today { background: color-mix(in srgb, var(--sig, #76b900) 10%, transparent); }
.cal-num { font-size: 12px; color: var(--ink-2); padding: 0 2px; }
.cal-day.today .cal-num { color: var(--ink); font-weight: 700; }
.cal-ev { display: block; font-size: 11.5px; line-height: 1.25; padding: 2px 6px; border-radius: 4px; border-left: 3px solid var(--ink-3); background: color-mix(in srgb, var(--ink-3) 14%, transparent); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.late { background: color-mix(in srgb, #f2645f 18%, transparent); }
.cal-more summary { font-size: 11.5px; color: var(--ink-3); cursor: pointer; padding: 0 4px; }
.cal-more { display: flex; flex-direction: column; gap: 3px; }
.k-maint { border-left-color: #6ea6ff; } .cal-dot.k-maint { background: #6ea6ff; }
.k-wo { border-left-color: #b388ff; } .cal-dot.k-wo { background: #b388ff; }
.k-defect { border-left-color: #f2645f; } .cal-dot.k-defect { background: #f2645f; }
.k-comp { border-left-color: #e9a640; } .cal-dot.k-comp { background: #e9a640; }
.k-ticket { border-left-color: #e9d35a; } .cal-dot.k-ticket { background: #e9d35a; }
.k-plant { border-left-color: #8d9aa6; } .cal-dot.k-plant { background: #8d9aa6; }
.k-claim { border-left-color: #76b900; } .cal-dot.k-claim { background: #76b900; }
.k-tender { border-left-color: #3fc1c9; } .cal-dot.k-tender { background: #3fc1c9; }
.k-contract { border-left-color: #ff8fb1; } .cal-dot.k-contract { background: #ff8fb1; }
.cal-agenda { max-height: calc(100vh - 150px); overflow-y: auto; }
.cal-over { margin: 0 14px 10px; padding: 10px 12px; border: 1px solid rgba(242,100,95,.5); background: rgba(242,100,95,.1); border-radius: 8px; }
.cal-over-h { font-size: 11.5px; color: #f2645f; font-weight: 600; margin-bottom: 4px; }
.cal-over a { display: block; font-size: 13px; color: var(--ink); } .cal-over small { display: block; color: var(--ink-3); }
.cal-ag-day { padding: 8px 14px; border-top: 1px solid var(--line-2); }
.cal-ag-date { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; } .cal-ag-date.today { color: var(--ink); }
.cal-ag-ev { display: flex; align-items: baseline; padding: 3px 0; font-size: 13px; color: var(--ink); }
.cal-ag-ev span { min-width: 0; } .cal-ag-ev small { display: block; color: var(--ink-3); font-size: 11.5px; }
@media (max-width: 1000px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } .cal-day { min-height: 70px; } .cal-ev { font-size: 10.5px; } }


/* permit lock-out: one small form per planned point, lock photos as thumbnails */
.lock-todo { display: grid; gap: 10px; padding: 0 16px 14px; }
.lock-form { display: grid; grid-template-columns: minmax(140px, 1.2fr) 1fr 1.4fr auto; gap: 10px 14px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.lock-form .lock-pt { display: flex; flex-direction: column; gap: 2px; align-self: center; }
.lock-form label { font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; margin: 0; }
.lock-form label.check { flex-direction: row; align-items: center; gap: 8px; grid-column: 1 / 4; color: var(--ink); font-size: 13px; }
.lock-form button { grid-column: 4; grid-row: 1 / 3; align-self: center; }
.lock-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }
.lock-file { max-width: 150px; font-size: 11.5px; }
@media (max-width: 760px) { .lock-form { grid-template-columns: 1fr; } .lock-form label.check, .lock-form button { grid-column: 1; grid-row: auto; } }
@media print { .lock-todo { display: none; } }

.smap-note { position: sticky; top: 6px; z-index: 3; margin: 8px 12px; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; line-height: 1.4; border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); background: #10261a; color: #7fd69a; }
.smap-note.bad { border-color: rgba(242,100,95,.55); background: #2a1414; color: #f58a86; }
.smap-tray[hidden], .smap-note[hidden] { display: none !important; }


/* isolations get their own colour (pink), so a locked-out point never reads as an overdue / critical block (red) */
:root { --iso: #ff3d9a; }
.iso-mk.locked i { box-shadow: 0 0 0 3px var(--iso), 0 0 0 7px rgba(255,61,154,.35); }
.iso-mk.locked.sel i { box-shadow: 0 0 0 3px var(--brand), 0 0 0 6px var(--iso); }
.iso-chip { border-color: rgba(255,61,154,.55); background: rgba(255,61,154,.12); }
.iso-chip:hover { background: rgba(255,61,154,.22); }
.smap-tools [data-iso-now].hot { border-color: rgba(255,61,154,.6); color: #ff7ab8; }
.iso-lock .pill.bad { background: rgba(255,61,154,.16); color: #ff7ab8; border-color: rgba(255,61,154,.5); }
.smap-legend .lgk.iso i { background: transparent; box-shadow: 0 0 0 2px var(--iso); }

.permit-map { display: block; width: 100%; height: auto; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--radius) var(--radius); background: #fff; }
.permit-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 8px; border: 2px solid; }
.permit-key .k-locked { border-color: #ff3d9a; } .permit-key .k-planned { border-color: #2f7cf6; } .permit-key .k-released { border-color: #737373; }

.room-alarms a.live.on { background: rgba(121,194,87,.12); border-color: rgba(121,194,87,.45); } .room-alarms a.live.on small { color: #86c95f; }
.room-att li.ok i { background: #86c95f; }

/* a site and its project share one tab bar; thin dividers group the money tabs */
.site-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
.site-tabs .tab-sep { width: 1px; align-self: center; height: 16px; background: var(--line); margin: 0 6px; }

/* personal locks on a permit */
.plock-form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px 14px; align-items: end; padding: 12px 16px 14px; }
.plock-form label { font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; margin: 0; }
@media (max-width: 640px) { .plock-form { grid-template-columns: 1fr; } }
