/* Client Monitor stylesheet, the only one. LLD-13 Section 3 holds the brand tokens (the
   Mac Pros Deep Forest Green system), Section 4 the shell, and Section 9 the charts; the
   component rules below them come from LLD-12 Section 8 where LLD-13 does not replace them.
   scripts/contrast.py reads the color tokens from the three theme blocks below, so keep
   each token on its own line. */

@font-face {
  font-family: "DM Sans";
  src: url("fonts/DMSans-Variable.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Light theme (the default) */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --nav: #0E1410;
  --nav2: #141C15;
  --nav-line: rgba(12, 145, 54, 0.14);
  --nav-text: #7A9980;
  --nav-active: #E8F0EA;
  --brand: #0C9136;
  --bright: #12B347;
  --forest: #0D5C2E;
  --deep: #093D1E;
  --on-brand: #FFFFFF;
  --band-text: #E8F0EA;
  --page: #F3F5F3;
  --panel: #FFFFFF;
  --panel2: #F6F8F6;
  --line: #DDE4DE;
  --line2: #EAEFEA;
  --text: #101510;
  --muted: #5A6B5D;
  --faint: #657467;
  --label: #0D5C2E;
  --accent: #0D5C2E;
  --ok: #1F9A4E;
  --ok-text: #166B37;
  --warn: #D9960F;
  --warn-text: #8A5E00;
  --fail: #D24A3E;
  --fail-text: #A8382E;
  --missing: #7C5CC4;
  --error: #C42A6B;
  --off: #C9D1CA;
  --ok-bg: #E3F4E8;
  --ok-fg: #166B37;
  --warn-bg: #FCF1D6;
  --warn-fg: #8A5E00;
  --fail-bg: #FBE7E5;
  --fail-fg: #A8382E;
  --missing-bg: #EEE9F8;
  --missing-fg: #5B3FA6;
  --error-bg: #F9E4EC;
  --error-fg: #9E1F55;
  --new-bg: #EEF1EE;
  --new-fg: #5A6B5D;
  --unreachable-bg: #E6EAE7;
  --unreachable-fg: #101510;
  --shadow: rgba(8, 20, 10, 0.04);
  --shadow-kpi: rgba(8, 20, 10, 0.08);
}

/* Dark theme, by preference unless the toggle chose light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --nav: #080A08;
    --nav2: #0E1410;
    --nav-line: rgba(12, 145, 54, 0.14);
    --nav-text: #7A9980;
    --nav-active: #E8F0EA;
    --brand: #0C9136;
    --bright: #12B347;
    --forest: #0D5C2E;
    --deep: #093D1E;
    --on-brand: #FFFFFF;
  --band-text: #E8F0EA;
    --page: #080A08;
    --panel: #0E1410;
    --panel2: #141C15;
    --line: rgba(12, 145, 54, 0.14);
    --line2: rgba(12, 145, 54, 0.08);
    --text: #E8F0EA;
    --muted: #7A9980;
    --faint: #728A76;
    --label: #12B347;
    --accent: #12B347;
    --ok: #3DBE6C;
    --ok-text: #3DBE6C;
    --warn: #E8A93A;
    --warn-text: #E8B04A;
    --fail: #F07065;
    --fail-text: #F07065;
    --missing: #A68DE8;
    --error: #EC6FA2;
    --off: #2F3D31;
    --ok-bg: color-mix(in srgb, var(--ok) 16%, var(--panel));
    --ok-fg: var(--ok);
    --warn-bg: color-mix(in srgb, var(--warn) 16%, var(--panel));
    --warn-fg: var(--warn-text);
    --fail-bg: color-mix(in srgb, var(--fail) 16%, var(--panel));
    --fail-fg: var(--fail);
    --missing-bg: color-mix(in srgb, var(--missing) 16%, var(--panel));
    --missing-fg: var(--missing);
    --error-bg: color-mix(in srgb, var(--error) 16%, var(--panel));
    --error-fg: var(--error);
    --new-bg: var(--panel2);
    --new-fg: var(--muted);
    --unreachable-bg: var(--panel2);
    --unreachable-fg: var(--text);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-kpi: rgba(0, 0, 0, 0.35);
  }
}

/* Dark theme, chosen with the toggle */
:root[data-theme="dark"] {
  color-scheme: dark;
  --nav: #080A08;
  --nav2: #0E1410;
  --nav-line: rgba(12, 145, 54, 0.14);
  --nav-text: #7A9980;
  --nav-active: #E8F0EA;
  --brand: #0C9136;
  --bright: #12B347;
  --forest: #0D5C2E;
  --deep: #093D1E;
  --on-brand: #FFFFFF;
  --band-text: #E8F0EA;
  --page: #080A08;
  --panel: #0E1410;
  --panel2: #141C15;
  --line: rgba(12, 145, 54, 0.14);
  --line2: rgba(12, 145, 54, 0.08);
  --text: #E8F0EA;
  --muted: #7A9980;
  --faint: #728A76;
  --label: #12B347;
  --accent: #12B347;
  --ok: #3DBE6C;
  --ok-text: #3DBE6C;
  --warn: #E8A93A;
  --warn-text: #E8B04A;
  --fail: #F07065;
  --fail-text: #F07065;
  --missing: #A68DE8;
  --error: #EC6FA2;
  --off: #2F3D31;
  --ok-bg: color-mix(in srgb, var(--ok) 16%, var(--panel));
  --ok-fg: var(--ok);
  --warn-bg: color-mix(in srgb, var(--warn) 16%, var(--panel));
  --warn-fg: var(--warn-text);
  --fail-bg: color-mix(in srgb, var(--fail) 16%, var(--panel));
  --fail-fg: var(--fail);
  --missing-bg: color-mix(in srgb, var(--missing) 16%, var(--panel));
  --missing-fg: var(--missing);
  --error-bg: color-mix(in srgb, var(--error) 16%, var(--panel));
  --error-fg: var(--error);
  --new-bg: var(--panel2);
  --new-fg: var(--muted);
  --unreachable-bg: var(--panel2);
  --unreachable-fg: var(--text);
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-kpi: rgba(0, 0, 0, 0.35);
}

/* Type, spacing, and shape (LLD-13 Section 3.2 and 3.4) */
:root {
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gradient-band: linear-gradient(135deg, #0D5C2E 0%, #0C9136 55%, #1A7A40 80%, #0A4A22 100%);
  --gradient-btn: linear-gradient(135deg, #0D5C2E, #0C9136);
  --glow-btn: 0 0 0 1px rgba(12, 145, 54, 0.2), 0 4px 12px rgba(12, 145, 54, 0.25);
  --fs-0: 11px;
  --fs-1: 12px;
  --fs-2: 13px;
  --fs-3: 14px;
  --fs-4: 15px;
  --fs-5: 20px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --radius-control: 7px;
  --radius-card: 10px;
  --gutter: 32px;
  --wide: 1400px;
  --narrow: 880px;
  --row: 36px;
  --side: 224px;
}

/* Each state sets --st (its fill color) and the badge pair. */
.st-OK, .state-OK { --st: var(--ok); --st-bg: var(--ok-bg); --st-fg: var(--ok-fg); }
.st-WARN, .state-WARN { --st: var(--warn); --st-bg: var(--warn-bg); --st-fg: var(--warn-fg); }
.st-FAIL, .state-FAIL { --st: var(--fail); --st-bg: var(--fail-bg); --st-fg: var(--fail-fg); }
.st-MISSING, .state-MISSING { --st: var(--missing); --st-bg: var(--missing-bg); --st-fg: var(--missing-fg); }
.st-ERROR, .state-ERROR { --st: var(--error); --st-bg: var(--error-bg); --st-fg: var(--error-fg); }
.st-NEW, .state-NEW, .st-None, .state-None, .st-OFF { --st: var(--faint); --st-bg: var(--new-bg); --st-fg: var(--new-fg); }
.st-UNREACHABLE, .state-UNREACHABLE { --st: var(--text); --st-bg: var(--unreachable-bg); --st-fg: var(--unreachable-fg); }

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: var(--fs-2)/1.45 var(--font);
  color: var(--text);
  background: var(--page);
}
/* Tabular figures only where a cell holds a number: this DM Sans build's tnum feature also
   widens spaces and punctuation, so it is not set on running text. */
.num, .kpi .n, .gbar .fr, .ring-lg b, td.ts, .c-time, .c-days { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
h1 { font: 500 30px/1.15 var(--serif); letter-spacing: -0.01em; }
h2 { font: 500 17px/1.2 var(--serif); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-3); font-weight: 600; }
p { margin: 0 0 var(--sp-2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
code, pre, .mono, .ts { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--fs-1); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.glyph { width: 11px; height: 11px; flex: none; fill: currentColor; vertical-align: -1px; }
[hidden] { display: none !important; }
.label {
  display: block; font-size: 10.5px; font-weight: 600; color: var(--label);
  text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 2px;
}
p > .label { display: inline; margin-right: var(--sp-1); }
.prose { max-width: var(--narrow); font-size: var(--fs-3); }
.prose p { margin-bottom: var(--sp-3); }
ul.plain { list-style: none; margin: var(--sp-1) 0 0; padding: 0; }

/* Page body */
main.narrow { max-width: var(--narrow); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.page-head h1 { margin-right: auto; }
.lede { max-width: var(--narrow); color: var(--muted); font-size: var(--fs-3); margin-bottom: var(--sp-4); }
.breadcrumb { font-size: var(--fs-1); color: var(--muted); margin-bottom: var(--sp-2); }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { color: var(--faint); margin: 0 var(--sp-1); }

/* State badges (LLD-13 Section 3.4): tinted pills, sentence case, the glyph kept */
.st {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 56px; padding: 3px 9px; border-radius: 999px;
  background: var(--st-bg); color: var(--st-fg);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.2; white-space: nowrap;
}
.st .glyph { width: 9px; height: 9px; }
a.st-link:hover { text-decoration: none; }
.count { color: var(--st-fg); font-weight: 600; font-size: var(--fs-1); white-space: nowrap; }
.count.zero { color: var(--faint); font-weight: 400; }
.counts { white-space: nowrap; }
.chips { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Small badges and the "client" pill: muted text on --panel2, 1 px line */
.badge, .pill {
  display: inline-block; margin-left: var(--sp-1); padding: 1px 9px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel2);
  color: var(--muted); font-size: var(--fs-0); line-height: 16px;
  white-space: nowrap; vertical-align: 1px;
}
.pill { margin-left: 0; }

/* Controls (Section 8.4): one primary button style, everything else a quiet text link */
button { font: inherit; cursor: pointer; }
/* The one primary button: the brand gradient with the site's glow (Section 3.4) */
button.primary, .btn-primary {
  display: inline-flex; align-items: center; height: 28px; padding: 0 13px;
  font-size: var(--fs-1); font-weight: 600; white-space: nowrap;
  color: var(--on-brand); background: var(--gradient-btn); box-shadow: var(--glow-btn);
  border: 0; border-radius: var(--radius-control);
}
button.primary:hover, .btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.ghost {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  font-size: var(--fs-1); font-weight: 600; white-space: nowrap;
  color: var(--accent); background: var(--panel); border: 1px solid var(--accent);
  border-radius: var(--radius-control);
}
.ghost:hover { text-decoration: none; background: var(--panel2); }
button.link, .btn, .btn-quiet, summary.link {
  display: inline; height: auto; padding: 0; border: 0; background: none;
  color: var(--accent); font-size: var(--fs-1); font-weight: 400; white-space: nowrap;
}
button.link:hover, .btn:hover, summary.link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.actions form { display: contents; }
form.inline { display: inline; margin: 0; }

/* Forms */
input, select, textarea {
  font: inherit; font-size: var(--fs-2); color: var(--text);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-control); padding: 0 var(--sp-2); height: 32px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--bright); outline-offset: 0; }
textarea { padding: var(--sp-1) var(--sp-2); height: auto; min-height: 72px; width: 100%; }
label { font-size: var(--fs-1); color: var(--muted); }
form.edit {
  display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-2) var(--sp-3);
  align-items: center; max-width: 620px;
}
form.edit input, form.edit select, form.edit textarea { width: 100%; max-width: 420px; }
form.edit .form-end { grid-column: 2; }
.inline-form { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-2) 0; }

/* Lists and rows (Section 8.3): 36 px rows, 1 px separators, no card, no tint */
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: 0 var(--sp-3); height: var(--row);
  border-bottom: 1px solid var(--line2); vertical-align: middle;
}
th { font-size: var(--fs-1); font-weight: 600; color: var(--muted); white-space: nowrap; }
td { overflow-wrap: anywhere; }
td.ts, .c-time, .c-days, .c-last, .c-since, .c-when { font-size: var(--fs-1); color: var(--muted); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
tr.disabled, tbody.disabled { opacity: 0.55; }
/* The stripe: a 3 px left edge in the state color on the state cell. */
tr[class*="state-"] > td:first-child, tbody.row > tr > td:first-child, tr.row > td:first-child {
  box-shadow: inset 3px 0 0 var(--st, transparent);
}
tbody.row > tr.expand > td:first-child { box-shadow: inset 3px 0 0 var(--st, transparent); }
.c-state { width: 88px; }
td.c-summary { color: var(--text); }

table.checks { table-layout: fixed; }
table.checks .c-check { width: 34%; }
table.checks .c-last { width: 96px; }
table.checks .c-since { width: 128px; }
table.checks .c-actions { width: 184px; text-align: right; }
table.checks td.c-summary, table.list td.c-summary {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.checks td.c-check { white-space: nowrap; }
/* The title gives way to its badges, so a cut title never hides "acknowledged" or a baseline badge. */
.cc { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cc > .badge, .cc > .chev-btn { flex: none; }
td.c-actions .actions { justify-content: flex-end; flex-wrap: nowrap; }
table.checks tbody.group-head th {
  font-size: var(--fs-2); font-weight: 600; color: var(--text); padding-top: var(--sp-3);
}
.group-toggle {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  border: 0; background: none; padding: 0; color: var(--text); font-weight: 600; font-size: var(--fs-2);
}
.group-count { margin-left: var(--sp-3); font-weight: 400; }
.chev { color: var(--muted); transition: transform 0.15s ease; transform: rotate(-90deg); }
[aria-expanded="true"] > .chev, details[open] > summary .chev { transform: none; }
.chev-btn { border: 0; background: none; padding: 0 var(--sp-1) 0 0; color: var(--muted); }
tr.expand > td { height: auto; padding: var(--sp-3) var(--sp-3) var(--sp-3) calc(88px + var(--sp-3)); background: var(--panel2); }
tr.expand .prose { font-size: var(--fs-2); }
tr.expand .facts { margin: var(--sp-3) 0 0; }
.facts { font-family: var(--mono); font-size: var(--fs-0); color: var(--faint); }

table.list { table-layout: fixed; }
table.list.manual, table.list.observations, table.list.transitions { table-layout: auto; }
table.list .c-title { width: 32%; }
table.list .c-since { width: 144px; }
table.list .c-change { width: 160px; white-space: nowrap; }
table.list .c-time { width: 120px; }
table.list .c-days { width: 96px; }
table.list .c-owner { width: 160px; }
table.list .c-actions { width: 184px; text-align: right; }
table.list .c-status, table.list .c-age { width: 120px; white-space: nowrap; }
td.c-summary { max-width: 0; }
table.list.manual td, table.list.observations td { padding-top: var(--sp-2); padding-bottom: var(--sp-2); vertical-align: top; }
table.list.transitions td { white-space: normal; }
table.transitions .c-when { width: 168px; }
table.hub .c-client { width: 170px; }
.evidence { font-size: var(--fs-1); font-family: var(--mono); color: var(--muted); }

/* The filter bar (Section 7.2) */
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4);
  background: var(--panel2); border-radius: var(--radius-card);
  padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3);
}
.segmented { display: inline-flex; gap: 2px; }
.segmented a { color: var(--muted); padding: 4px var(--sp-2); border-radius: var(--radius-control); }
.segmented a[aria-current="true"] { color: var(--text); font-weight: 600; background: var(--panel); }
.filters input[type="search"] { width: 240px; }

/* Overview (Section 7.1) */
.status-line { font-size: var(--fs-3); margin: 0 0 var(--sp-5); }
.ov { margin-bottom: var(--sp-6); }
.ov > h2 { margin-bottom: var(--sp-1); }
.ov .empty { margin: var(--sp-2) 0 0; }
.ov.everything { margin: 0; }
.more { margin: var(--sp-2) 0 0; font-size: var(--fs-1); }
.empty { color: var(--muted); }

/* Banner */
.banner {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--fail-bg); color: var(--text);
  border-bottom: 1px solid var(--line); padding: var(--sp-2) var(--gutter); font-weight: 500;
}
.banner .glyph { color: var(--fail); }

/* Check page (Section 7.3) */
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding-left: var(--sp-3); box-shadow: inset 3px 0 0 var(--st); margin-bottom: var(--sp-4); }
.title-row .title-action { margin-left: auto; }
.explain { margin-bottom: var(--sp-4); }
.explain .label { margin-top: var(--sp-2); }
.explain p { margin: 0; }
.current-summary { font-size: var(--fs-3); max-width: var(--narrow); }
.strip { display: flex; flex-wrap: wrap; gap: 2px; }
.strip .cell { display: block; width: 8px; height: 14px; border-radius: 1px; background: var(--st); }
.strip .cell.selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.strip-axis { display: flex; justify-content: space-between; font-size: var(--fs-0); color: var(--faint); margin-top: var(--sp-1); }
.strip-box { width: fit-content; max-width: 100%; min-width: 240px; }
.sec { margin-top: var(--sp-6); }
.sec > h2 { margin-bottom: var(--sp-2); }
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); margin: var(--sp-2) 0; }
dl.kv dt { color: var(--faint); font-size: var(--fs-1); }
dl.kv dd { margin: 0; font-family: var(--mono); font-size: var(--fs-1); overflow-wrap: anywhere; }
dl.kv details > summary { cursor: pointer; color: var(--accent); font-family: var(--font); }
details.disclosure { margin-top: var(--sp-3); }
details.disclosure > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-1); }
details.disclosure[open] { background: var(--panel2); border-radius: var(--radius-card); padding: var(--sp-2) var(--sp-3); }
.details-block { margin-top: var(--sp-6); }
.pre-head { display: flex; justify-content: flex-end; }
pre.json {
  margin: var(--sp-1) 0 0; font-size: var(--fs-1); line-height: 1.45;
  max-height: 480px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.change { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
ul.diffs { margin: var(--sp-2) 0; padding-left: var(--sp-5); font-family: var(--mono); font-size: var(--fs-1); }
.baseline-action { margin-top: var(--sp-3); }

/* Help (Section 7.6) */
.help-check { margin: var(--sp-4) 0; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line2); }
.help-check h3 { margin-bottom: var(--sp-2); }
.help-check p { font-size: var(--fs-3); }

/* Cards remain on the hub and the summary page only (Section 8.6) */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--st, var(--line));
  border-radius: var(--radius-card); padding: var(--sp-4);
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.card-title { font-weight: 600; }
.card-group { font-size: var(--fs-1); margin-top: var(--sp-1); }
.card-summary { margin: var(--sp-2) 0; overflow-wrap: anywhere; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); justify-content: space-between; }
.card.plain { border-left-width: 1px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.card h2 { margin-bottom: var(--sp-2); }

/* Hub */
.status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.attention { margin-bottom: var(--sp-6); }
.attention > h2 { margin-bottom: var(--sp-3); }
details.group { margin-bottom: var(--sp-4); }
.section-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3);
  padding: var(--sp-2) 0; cursor: pointer; list-style: none;
}
.section-head::-webkit-details-marker { display: none; }
.section-head .count-text { color: var(--muted); font-size: var(--fs-1); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-6); }
.tile .chips { margin: var(--sp-2) 0; }
.tile-state { margin-left: auto; }
.tile-meta { font-size: var(--fs-1); color: var(--muted); }
.unreachable { margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); background: var(--fail-bg); border-radius: var(--radius-control); font-size: var(--fs-1); }
.notice { margin-bottom: var(--sp-3); }

/* Renewals, reviews, observations, Dropbox links */
.days-past { color: var(--fail); font-weight: 600; }
.never { color: var(--warn); font-weight: 600; }
dl.fields { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-2) var(--sp-3); margin: var(--sp-2) 0 var(--sp-3); max-width: var(--narrow); }
dl.fields dt { color: var(--faint); font-size: var(--fs-1); }
dl.fields dd { margin: 0; font-size: var(--fs-3); }
details.obs > summary { cursor: pointer; }
details.how summary, details.closed > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-1); }
details.closed { margin-top: var(--sp-5); }
details.closed > summary { font-size: var(--fs-3); margin-bottom: var(--sp-2); }
details.record > summary { list-style: none; cursor: pointer; }
details.record > summary::-webkit-details-marker { display: none; }
details.record[open] > summary { margin-bottom: var(--sp-2); }
details.record form { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.sub { font-size: var(--fs-1); color: var(--muted); margin-top: 2px; }
.group-title { margin: var(--sp-5) 0 var(--sp-1); }
.stats { margin-bottom: var(--sp-3); }
.stat { display: inline-flex; align-items: baseline; gap: var(--sp-1); color: var(--muted); font-size: var(--fs-1); margin-right: var(--sp-3); }
.stat b { color: var(--text); font-size: var(--fs-2); }
table.manual .c-record { width: 1%; white-space: nowrap; }
details.record[open] { white-space: normal; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4);
  background: var(--panel2); border-radius: var(--radius-card);
  padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3);
}
.toolbar label { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--text); }
.section { margin-top: var(--sp-6); }
.section > h2 { margin-bottom: var(--sp-3); }

/* Summary page */
.summary-head { margin-bottom: var(--sp-5); }
.summary-head .when { color: var(--muted); }
.summary-status { font-size: var(--fs-4); margin-bottom: var(--sp-5); }
.summary-cards { display: grid; gap: var(--sp-3); }
.summary-cards .card-head h2, .summary-cards .card-head h3 { margin-right: auto; font-size: var(--fs-4); }
.card ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); }
.card li + li { margin-top: var(--sp-1); }
.why { color: var(--muted); font-size: var(--fs-2); margin-top: 2px; }
.item-list { list-style: none; padding: 0 !important; }
.item-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.item-list .glyph { color: var(--st); }
.section-first > h2 { margin-bottom: var(--sp-3); }
h3.system { margin: var(--sp-4) 0 var(--sp-2); color: var(--muted); }
dl.consider { margin: 0; }
dl.consider dt { font-weight: 600; margin-top: var(--sp-3); }
dl.consider dd { margin: 2px 0 0; font-size: var(--fs-3); }
.summary-foot { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-1); }

/* Sign-in and error pages */
main.center { max-width: none; }
.center { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-4); }
.center .card { width: 100%; max-width: 400px; text-align: center; padding: var(--sp-6) var(--sp-5); }
.center h1 { font-size: var(--fs-5); margin-bottom: var(--sp-1); }
.center .code { font-size: var(--fs-5); font-weight: 700; font-family: var(--mono); }
.center .btn { display: inline-flex; height: 36px; padding: 0 var(--sp-4); font-size: var(--fs-3); margin: var(--sp-4) 0; }

/* Narrow screens: wrap the header, one column, and rows stack (LLD-09 Section 4) */
@media (max-width: 960px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td, table.stack th { display: block; width: auto !important; height: auto; }
  table.stack thead { display: none; }
  table.stack tr { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line2); }
  table.stack td { padding: 2px 0; border: 0; max-width: none; white-space: normal !important; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-family: var(--font); }
  table.stack td:empty { display: none; }
  table.stack tr > td:first-child { box-shadow: none !important; }
  table.stack tbody.row > tr:first-child, table.stack tr[class*="state-"] { box-shadow: inset 3px 0 0 var(--st, transparent); }
  table.checks.stack tbody.row > tr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); }
  table.checks.stack .c-check { flex: 1 1 60%; min-width: 0; }
  table.checks.stack .c-summary, table.checks.stack .c-actions { flex: 1 1 100%; }
  table.checks.stack td.c-actions .actions { justify-content: flex-start; }
  tr.expand > td { padding-left: var(--sp-3); }
  dl.fields, form.edit { grid-template-columns: minmax(0, 1fr); }
  form.edit .form-end { grid-column: 1; }
  .filters input[type="search"] { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .chev { transition: none; }
}


/* The shell (LLD-13 Section 4): a 224 px sidebar and the content column */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.col { min-width: 0; display: flex; flex-direction: column; }
.side {
  background: var(--nav); color: var(--nav-text); border-right: 1px solid var(--nav-line);
  display: flex; flex-direction: column; min-height: 100vh;
}
.side a:hover { text-decoration: none; }
.side-brand { height: 60px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--nav-line); }
.side-home { display: flex; align-items: center; gap: 10px; color: var(--nav-active); font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap; }
.side-home img { height: 28px; width: 28px; }
.side-home small { display: block; font-weight: 400; font-size: 11px; color: var(--nav-text); }
.drawer-close { display: none; margin-left: auto; color: var(--nav-text); }
.drawer-close svg { width: 20px; height: 20px; }
.switch {
  margin: 14px 12px 8px; background: var(--nav2); border: 1px solid var(--nav-line); border-radius: 8px;
  padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--nav-active);
}
.switch small { display: block; color: var(--nav-text); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 3px; }
.switch-name { display: block; overflow-wrap: anywhere; }
.switch a { color: var(--nav-text); display: flex; }
.switch svg { width: 12px; height: 12px; }
.side-nav { padding: 6px 0; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 18px; margin: 1px 0;
  color: var(--nav-text); font-size: 13px; border-left: 2px solid transparent;
}
.side-nav a svg { width: 16px; height: 16px; flex: none; }
.side-nav a:hover { color: var(--nav-active); }
.side-nav a.active { color: var(--nav-active); background: linear-gradient(90deg, rgba(12, 145, 54, 0.18), transparent); border-left-color: var(--bright); }
.side-sec { padding: 18px 18px 4px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nav-text); }
.side-foot { margin-top: auto; padding: 14px 18px; font: 11px/1.5 var(--mono); color: var(--nav-text); border-top: 1px solid var(--nav-line); overflow-wrap: anywhere; }
.side-user { display: block; margin-bottom: 8px; font: 12px/1.4 var(--sans, inherit); color: var(--nav-text-strong, var(--nav-text)); }
.side-role { display: block; font: 11px/1.4 var(--mono); opacity: .75; }
.hd .tabs { margin-left: auto; margin-right: 8px; }
.stack.activity td:last-child { text-align: left; }
.activity-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* The band (Section 4.3): the one expensive element on every page */
.band {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--gradient-band); color: #E8F0EA; padding: 22px var(--gutter) 24px;
}
.band::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("img/topology.webp") right center / 60% auto no-repeat; opacity: 0.28; mix-blend-mode: screen;
}
.band::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 80% at 85% 50%, rgba(18, 179, 71, 0.25), transparent 70%);
}
.band.has-kpis { padding-bottom: 70px; }
.band a { color: #FFFFFF; }
.bandtop { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: rgba(232, 240, 234, 0.85); }
.crumb b { color: #FFFFFF; font-weight: 600; }
.menu { display: none; color: #FFFFFF; }
.menu svg { width: 22px; height: 22px; display: block; }
.search {
  margin: 0 0 0 auto; width: 240px; height: 32px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 7px;
  background: rgba(8, 10, 8, 0.25); display: flex; align-items: center; padding: 0 10px; gap: 8px; color: rgba(232, 240, 234, 0.75);
}
.search svg { width: 14px; height: 14px; flex: none; }
.search input { flex: 1; min-width: 0; height: 30px; border: 0; background: transparent; color: #FFFFFF; padding: 0; font-size: 12px; }
.search input::placeholder { color: rgba(232, 240, 234, 0.75); }
.search input:focus-visible { outline: 0; }
.search:focus-within { border-color: var(--bright); box-shadow: 0 0 0 1px var(--bright); }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0;
  color: rgba(232, 240, 234, 0.85); font-size: 12px;
}
.theme-toggle:hover, .theme-toggle[aria-pressed="true"] { color: #FFFFFF; }
.user { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.user a { color: rgba(232, 240, 234, 0.85); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; color: var(--forest); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.band-title { color: #FFFFFF; margin-top: 22px; }
.band .label, .eyebrow { color: #9FE3B4; }

/* Page body: 32 px padded, 1400 px at most */
main { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); padding: var(--sp-6) var(--gutter) 36px; }
main.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
main.ov-main { padding-top: 0; display: grid; gap: 18px; position: relative; z-index: 1; }

/* Panels (Section 4.4) */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 1px 2px var(--shadow); display: flex; flex-direction: column; min-width: 0;
}
.panel .hd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 14px 18px 10px; }
.panel .hd h2 { margin: 0; }
.panel .hd .q { color: var(--faint); font-size: 12px; }
.panel .hd > a { margin-left: auto; font-size: 12px; font-weight: 500; }
.panel .bd { padding: 4px 18px 16px; }
.panel .empty { color: var(--muted); margin: 6px 0 0; }
.panel table td { height: auto; padding: 10px 8px; border-bottom: 1px solid var(--line2); }
.panel table tr:last-child td { border-bottom: 0; }
.panel table td:first-child { padding-left: 0; }
.panel table td:last-child { padding-right: 0; text-align: right; }
.prow { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }

/* Overview hero (Section 5.1) */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; margin-top: 26px; }
.eyebrow { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.hero h1 { color: #FFFFFF; margin: 0 0 10px; max-width: 640px; }
.hero p { margin: 0; font-size: 13.5px; color: rgba(232, 240, 234, 0.88); max-width: 560px; }
.ring { display: flex; align-items: center; gap: 18px; }
.ring-svg.on-band { filter: drop-shadow(0 0 18px rgba(18, 179, 71, 0.35)); }
.ring-svg .ring-pct { font: 500 10.5px var(--serif); }
.ring-svg .ring-sub { font: 3px var(--font); letter-spacing: 0.3px; }
.on-band .ring-track { stroke: rgba(255, 255, 255, 0.18); }
.on-band .ring-pct { fill: #FFFFFF; }
.on-band .ring-sub { fill: rgba(232, 240, 234, 0.8); }
.on-band .seg-ok, .ring-lg .seg-ok { stroke: #B9F5CC; background: #B9F5CC; }
.on-band .seg-warn, .ring-lg .seg-warn { stroke: #F3C654; background: #F3C654; }
.on-band .seg-bad, .ring-lg .seg-bad { stroke: #FF8A7A; background: #FF8A7A; }
.on-band .seg-new, .ring-lg .seg-new { stroke: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.6); }
.on-band .seg-off, .ring-lg .seg-off { stroke: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.35); }
.on-panel .ring-track { stroke: var(--line2); }
.on-panel .ring-pct { fill: var(--text); }
.on-panel .ring-sub { fill: var(--muted); }
.on-panel .seg-ok { stroke: var(--ok); }
.on-panel .seg-warn { stroke: var(--warn); }
.on-panel .seg-bad { stroke: var(--fail); }
.on-panel .seg-new { stroke: var(--faint); }
.on-panel .seg-off { stroke: var(--off); }
.ring-lg { display: grid; gap: 5px; font-size: 12px; color: rgba(232, 240, 234, 0.88); }
.ring-lg span, .ring-lg a { display: flex; align-items: center; gap: 8px; }
.ring-lg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ring-lg b { color: #FFFFFF; margin-left: auto; padding-left: 14px; font-weight: 600; }

/* The waiting banner, at the foot of the band, and the KPI tiles (Section 5.2), which
   overlap the band by 46 px */
.waitbar {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; width: fit-content; max-width: 100%;
  margin-top: 20px; padding: 6px 14px; border-radius: 999px; font-size: 12.5px;
  background: rgba(8, 10, 8, 0.28); border: 1px solid rgba(255, 255, 255, 0.18);
}
.waitbar a { color: #FFFFFF; font-weight: 500; }
.waitbar span { color: rgba(232, 240, 234, 0.7); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: -46px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 16px 18px 14px; box-shadow: 0 10px 30px var(--shadow-kpi), 0 1px 2px var(--shadow);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start;
}
.kpi .l { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); font-weight: 600; }
.kpi .n { font: 500 30px/1 var(--serif); margin: 8px 0 6px; letter-spacing: -0.01em; }
.kpi .n.fail { color: var(--fail-text); }
.kpi .n.warn { color: var(--warn-text); }
.kpi .n small { font: 400 13px var(--font); color: var(--faint); margin-left: 4px; }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi .d.up { color: var(--ok-text); }
.kpi .d.down { color: var(--fail-text); }
.kpi .spark { align-self: end; }

/* Chart fills (Section 9) */
.fill-ok { fill: url(#g-ok); }
.fill-warn { fill: var(--warn); }
.fill-bad, .fill-fail { fill: var(--fail); }
.fill-new { fill: var(--faint); }
.fill-off { fill: var(--off); }
.fill-forest { fill: var(--forest); }
.line-warn { stroke: var(--warn); }
.line-ok { stroke: var(--ok); }
.line-faint { stroke: var(--faint); }
.spark circle.fill-ok { fill: var(--ok); }

/* Status by group: stacked bars */
.gbars { display: grid; gap: 10px; padding-top: 6px; }
.gbar { display: grid; grid-template-columns: 140px minmax(0, 1fr) 52px; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text); }
.gbar:hover { text-decoration: none; }
.gbar:hover .nm { color: var(--accent); }
.gbar .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar { display: block; background: var(--line2); clip-path: inset(0 round 999px); }
.gbar .fr { color: var(--muted); text-align: right; font-size: 12px; white-space: nowrap; }
.gbar .fr.warn { color: var(--warn-text); font-weight: 600; }
.gbar .fr.bad { color: var(--fail-text); font-weight: 600; }

/* Open alerts, last 30 days: columns */
.cols { display: block; margin-top: 8px; overflow: visible; }
.col-bar { fill: #E3C27A; }
.col-now { fill: url(#g-now); }
.col-zero { fill: var(--line); }
.col-label { font-size: 10px; fill: var(--faint); }

/* Open alerts and due dates */
.panel td.t { text-align: left; }
.panel td.t a { color: var(--text); font-weight: 500; }
.panel td.t a:hover { color: var(--accent); text-decoration: none; }
.panel td.v { color: var(--muted); }
.panel td.v b { color: var(--text); font-weight: 600; }
.panel td.age { color: var(--faint); font-size: 12px; white-space: nowrap; }
.panel td.badge-cell { width: 76px; }
.panel td.act { white-space: nowrap; }
.panel td.act .actions { justify-content: flex-end; flex-wrap: nowrap; }

/* Recent changes: the timeline */
.tl { display: grid; padding-top: 4px; }
.tl .it { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; position: relative; padding: 0 0 14px; }
.tl .it::before { content: ""; position: absolute; left: 8px; top: 14px; bottom: -2px; width: 1px; background: var(--line); }
.tl .it:last-child::before { display: none; }
.tl .dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); display: grid; place-items: center; margin-top: 1px; background: var(--st); color: #FFFFFF; position: relative; }
.tl .dot .glyph { width: 9px; height: 9px; }
.tl .w { font-size: 12px; color: var(--faint); }
.tl .t, .tl .t a { font-weight: 500; color: var(--text); }
.tl .t a:hover { color: var(--accent); text-decoration: none; }
.tl .s { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sw { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; color: var(--st-fg); }

/* Proportion bars (Section 9.4): the brand gradient, never colored by direction */
.pb { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pb-trk { display: block; clip-path: inset(0 round 999px); }
.pb-bg { fill: var(--line2); }
.pb-fill { fill: url(#g-brand); }
.pb span { font-size: 12px; color: var(--muted); }

/* Date strips */
.dstrip { display: block; margin-top: 6px; overflow: visible; }
.dstrip .axis, .dstrip .tick { fill: var(--line); }
.dstrip .tick-label { font-size: 10.5px; fill: var(--faint); }
.dstrip .mk circle { fill: var(--forest); stroke: var(--panel); stroke-width: 2; }
.dstrip .mk-warn circle { fill: var(--warn); }
.dstrip .mk-fail circle { fill: var(--fail); }
.dstrip .mk-title { font-size: 11.5px; font-weight: 600; fill: var(--text); }
.dstrip .mk-sub { font-size: 11px; fill: var(--muted); }
.strip-pad { padding: 0 28px; }

/* Session B pages (LLD-13 Sections 6 to 8): the band's page hero, then a column of panels */
main.stack-main { display: grid; gap: 18px; align-content: start; }
main.stack-main.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.page-hero { margin-top: 22px; }
.page-hero h1 { color: #FFFFFF; margin: 0; }
.page-hero p, .check-now { margin: 10px 0 0; font-size: 13.5px; color: rgba(232, 240, 234, 0.88); max-width: 680px; }
.check-now span { color: rgba(232, 240, 234, 0.7); }
.check-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 22px; }
.check-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; }
.check-title h1 { color: #FFFFFF; margin: 0; }
.check-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.check-hero .title-action { margin-left: auto; }
.band button.link, .band .actions button.link { color: #FFFFFF; font-weight: 500; }
.panel .hd .badge { margin: 0; }
.panel .hd h3 { margin: 0; font: 500 17px/1.25 var(--serif); }

/* Check page: About this check in two columns, the run strip, and the metric line */
.about { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.about .label { margin-top: 6px; }
.about p { margin: 2px 0 10px; font-size: 13.5px; max-width: 72ch; }
.metric { margin: 18px 0 0; }
.metric-chart { min-height: 220px; }
.metric-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.metric-key span[class^="k-"]::before { content: ""; display: inline-block; width: 18px; margin-right: 6px; vertical-align: middle; border-top: 2px solid var(--forest); }
.metric-key .k-warn::before { border-top: 2px dashed var(--warn) !important; }
.metric-key .k-fail::before { border-top: 2px dashed var(--fail) !important; }
.metric-hover { margin-left: auto; color: var(--text); }
.metric-table { margin-top: 10px; }
.details-block { margin-top: 0; }

/* Hub (Section 6): one ring per client in the band, client panels three across */
.hub-rings { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: flex-end; }
.hub-ring { display: grid; justify-items: center; gap: 6px; color: #FFFFFF; font-size: 12px; text-align: center; max-width: 110px; }
.hub-ring:hover { text-decoration: none; }
.hub-ring:hover span { text-decoration: underline; }
.ring-svg .ring-none { font-size: 6px; }
.ring-svg.ring-sm .ring-pct { font-size: 8.5px; }
.panel table.transitions td:last-child { text-align: left; }
.on-panel .ring-none { fill: var(--faint); }
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.client-sum { display: flex; align-items: center; gap: 18px; }
.client-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; flex: 1; }
.client-counts dt { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); font-weight: 600; }
.client-counts dd { margin: 2px 0 0; font: 500 18px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.client-meta { font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.sbar-none { font-size: 12px; color: var(--faint); }

/* Renewals and reviews strips */
.dstrip .shade { fill: rgba(12, 145, 54, 0.08); }
.strip-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* Observations (Section 8): one panel per observation */
.sys-title { margin: 8px 0 -6px; }
.obs-hd h3 { font: 500 15px/1.3 var(--serif); margin: 0; }
.obs-hd .obs-bar { margin-left: auto; }
.obs-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.obs-cols dl.fields { grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0 0 12px; }
.obs-cols dl.fields dd { margin-bottom: 10px; font-size: 13.5px; }
.obs-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; border-top: 1px solid var(--line2); padding-top: 12px; }
.obs-status .inline-form { margin: 0; }
.obs-status > a { margin-left: auto; }
details.obs-panel > summary { cursor: pointer; list-style: none; padding-bottom: 14px; }
details.obs-panel > summary::-webkit-details-marker { display: none; }
details.obs-panel[open] > summary { padding-bottom: 10px; }
.closed-group > summary { cursor: pointer; list-style: none; margin-bottom: 18px; }
.closed-group > summary::-webkit-details-marker { display: none; }
.closed-group > summary h2::after { content: " ›"; color: var(--faint); }
.closed-group > .panel + .panel { margin-top: 12px; }

/* Client summary (Section 8) */
.summary-hero h1 { color: #FFFFFF; margin: 0; }
.band .summary-status { color: #FFFFFF; font-size: 15px; margin: 10px 0 0; }
.prepared { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(232, 240, 234, 0.85) !important; margin-top: 14px !important; }
.prepared img { height: 16px; width: auto; }
.group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.group-sum { display: flex; align-items: center; gap: 12px; }
.group-sum p { margin: 0; }
ul.notok { margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; }
ul.notok li + li { margin-top: 6px; }
.group-panel .item-list { margin: 12px 0 0; font-size: 12.5px; }
.summary-foot { margin-top: 0; }
.help-check:last-child { border-bottom: 0; padding-bottom: 0; }
.help-check:first-child { margin-top: 4px; }

/* Narrow screens (Section 4.1): an icon rail below 900 px, a drawer below 640 px */
@media (max-width: 1100px) {
  .prow { grid-template-columns: minmax(0, 1fr); }
  .client-grid, .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-rings { justify-content: flex-start; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 900px) {
  :root { --side: 56px; }
  .about, .obs-cols { grid-template-columns: minmax(0, 1fr); }
  .side-home span, .switch, .side-sec, .side-foot, .side-nav a span { display: none; }
  .side-brand { padding: 0; justify-content: center; }
  .side-nav a { justify-content: center; padding: 11px 0; }
  .search { width: 180px; }
  .user-email { display: none; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --side: 0px; }
  .app { display: block; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 260px; height: 100vh; transform: translateX(-100%); transition: transform 0.15s ease; }
  .side:target { transform: none; box-shadow: 0 0 0 100vmax rgba(8, 10, 8, 0.5); }
  .side-home span, .switch, .side-sec, .side-foot, .side-nav a span { display: revert; }
  .switch { display: flex; }
  .side-foot { display: block; }
  .side-brand { padding: 0 18px; justify-content: flex-start; }
  .side-nav a { justify-content: flex-start; padding: 9px 18px; }
  .drawer-close { display: flex; }
  .menu { display: block; }
  .band { padding: 18px var(--gutter) 24px; }
  .band.has-kpis { padding-bottom: 60px; }
  .search { order: 5; width: 100%; margin: 0; }
  .gbar { grid-template-columns: 96px minmax(0, 1fr) 56px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { grid-template-columns: minmax(0, 1fr); }
  .panel table.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .panel table.stack tr:last-child { border-bottom: 0; }
  .panel table.stack td { border: 0; padding: 0; text-align: left; }
  .panel table.stack td.t { flex: 1 1 60%; }
  .strip-pad { padding: 0 6px; }
  .client-grid, .group-grid { grid-template-columns: minmax(0, 1fr); }
  .check-hero .title-action { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chev, .side { transition: none; }
}

/* Print: the summary and help pages on paper. No sidebar; the band is a flat forest block. */
@media print {
  :root, :root[data-theme] {
    color-scheme: light;
    --page: #FFFFFF;
    --panel: #FFFFFF;
    --panel2: #FFFFFF;
    --text: #101510;
    --muted: #5A6B5D;
    --faint: #657467;
    --line: #DDE4DE;
    --line2: #EAEFEA;
    --accent: #101510;
    --shadow: transparent;
    --shadow-kpi: transparent;
  }
  body { background: #FFFFFF; }
  .app { display: block; }
  .side, .search, .theme-toggle, .user, .menu, .banner { display: none !important; }
  .band { background: #0D5C2E; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .band::before, .band::after { display: none; }
  main { padding-top: var(--sp-4); max-width: none; }
  .panel, .card, .help-check { break-inside: avoid; }
  .ring-svg.on-band { filter: none; }
  main.stack-main { gap: 12px; }
  .group-grid, .consider-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-foot { break-inside: avoid; }
  /* LLD-14 Section 8.3: one column at 880 px, the band a flat forest block, no controls. */
  .col { max-width: 880px; }
  .band { background: var(--forest, #0D5C2E); }
  .range, .owner-form, .inline-form, .ghost, .tip { display: none !important; }
  .side { position: static; }
}

/* LLD-14 Section 2: the sidebar brand, footnotes, and the filter chips */
.side-home { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12px; font-weight: 600; }
/* The sidebar is as tall as the window and sticky, so the column behind it carries its color
   down the whole page. */
.app { background: linear-gradient(to right, var(--nav) var(--side), transparent var(--side)); }
.side-brand { height: auto; padding: 14px 18px; }
.note { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel2); }
.chip a { color: var(--muted); }
td.empty, p.empty { color: var(--muted); }
.sys-sub { font-size: 13px; color: var(--muted); margin: 4px 0 8px; font-weight: 600; }
.owner-client { color: var(--accent); }
.owner-form .segmented button { border: 0; background: none; color: var(--muted); padding: 4px 8px; border-radius: var(--radius-control); cursor: pointer; font: inherit; font-size: 12px; }
.owner-form .segmented button[aria-current="true"] { color: var(--text); font-weight: 600; background: var(--panel2); }
.range { margin-left: auto; font-size: 11.5px; }
.range a { padding: 2px 7px; }

/* LLD-14 Section 4: a group with nothing reporting */
.gbar.quiet .nm { color: var(--muted); }
.gbar.quiet .sbar-none { display: block; height: 10px; line-height: 10px; border-radius: 3px; background: var(--line2); color: var(--muted); font-size: 10.5px; padding-left: 6px; overflow: hidden; }
.gbar .fr.off { color: var(--faint); }

/* LLD-14 Section 3.2: hover and focus. Everything that counts is a link. */
a.kpi { color: inherit; text-decoration: none; cursor: pointer; transition: background-color 150ms ease; }
a.kpi:hover { background: var(--panel2); text-decoration: none; }
.gbar, .tl a.it, table.stack tbody tr { transition: background-color 150ms ease; }
.gbar:hover, .tl a.it:hover, table.stack tbody tr:hover { background: var(--panel2); }
.gbar { border-radius: 6px; padding: 2px 4px; margin: 0 -4px; }
.tl a.it { color: inherit; text-decoration: none; border-radius: 6px; }
.tl a.it .t { display: block; }
.tl a.it:hover .t { color: var(--accent); }
.tl a.it .w, .tl a.it .s { display: block; }
table a, .panel .bd a { text-decoration: none; }
table a:hover, .panel .bd a:hover { text-decoration: underline; }
svg a { cursor: pointer; }
svg a:hover .col, svg a:hover circle, svg a:focus .col { opacity: 0.8; }
.cols .hit { fill: transparent; }
.ring-lg a { color: inherit; text-decoration: none; border-radius: 4px; padding: 1px 4px; }
.ring-lg a:hover { background: rgba(255, 255, 255, 0.12); }
.tip { position: fixed; z-index: 50; pointer-events: none; padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--page); font-size: 11.5px; white-space: nowrap; box-shadow: 0 4px 14px var(--shadow); }

/* The ring draws in once on first paint (Section 3.2). */
@keyframes ring-draw { from { stroke-dasharray: 0 999; } }
.ring-svg .ring-seg { animation: ring-draw 600ms ease-out; }

/* LLD-14 Section 3.3: the sidebar stays put; the band's first row stays as a 48 px bar. */
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; min-height: 0; }
.bandtop { min-height: 24px; }
body.band-gone .bandtop {
  position: fixed; top: 0; left: var(--side); right: 0; z-index: 20; height: 48px;
  background: var(--gradient-band); padding: 0 var(--gutter); box-shadow: 0 2px 10px var(--shadow);
}
@media (max-width: 900px) { body.band-gone .bandtop { left: 0; } }

/* LLD-14 Section 8.3: the summary uses the whole column; observations two across. */
.consider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }

@media (prefers-reduced-motion: reduce) {
  .ring-svg .ring-seg { animation: none; }
  a.kpi, .gbar, .tl a.it, table.stack tbody tr { transition: none; }
}

/* LLD-14 Section 5.3: the cycle mark. The dot pulses once on each refresh and turns the WARN
   color when nothing has refreshed for five minutes. */
.live-mark { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.live-mark .pulse { width: 7px; height: 7px; border-radius: 50%; background: #B9F5CC; }
.live-mark .pulse.beat { animation: beat 0.8s ease-out 1; }
.live-mark.stale .pulse { background: #F3C654; }
.live-mark.stale .live-text { color: #F3C654; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(185, 245, 204, 0.8); } 100% { box-shadow: 0 0 0 8px rgba(185, 245, 204, 0); } }
@media (prefers-reduced-motion: reduce) { .live-mark .pulse.beat { animation: none; } }

/* LLD-14 Section 5.4: clocks in the band's first row and under the client's name. */
.clocks { display: inline-flex; gap: 12px; font-size: 12px; white-space: nowrap; }
.clock b { font-weight: 600; }
.switch-clock { display: block; font-size: 11px; color: var(--nav-text); margin-top: 2px; }
@media (max-width: 1100px) { .bandtop .clocks { display: none; } }

/* LLD-14 Section 6: the setup slide-out, over the content at the right. */
.slide { position: fixed; top: 0; right: 0; z-index: 40; width: 420px; max-width: 100vw; height: 100vh; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(8, 10, 8, 0.18); padding: 20px 22px 28px; }
.slide-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.slide-hd h2 { margin: 2px 0 0; font-size: 18px; }
.slide-group { margin: 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.slide-x { display: flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 6px; color: var(--muted); }
.slide-x:hover { background: var(--panel2); }
.slide-x svg { width: 16px; height: 16px; }
.slide-facts { margin: 10px 0 14px; font-weight: 600; }
.slide-sec { border-top: 1px solid var(--line2); padding: 12px 0; }
.slide-sec .label { margin: 0 0 6px; }
.slide-ft { border-top: 1px solid var(--line2); padding-top: 12px; }
.md p, .md ul, .md ol { margin: 0 0 8px; }
.md ul, .md ol { padding-left: 20px; }
.md code, .kv code { font-size: 12px; background: var(--panel2); padding: 1px 4px; border-radius: 3px; word-break: break-all; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
pre.token { white-space: pre-wrap; word-break: break-all; background: var(--panel2); padding: 8px; border-radius: 6px; font-size: 12px; }
.token-once { font-weight: 600; margin: 0 0 6px; }
.setup-link { font-size: 12.5px; margin-right: 10px; }
.actions { display: inline-flex; align-items: center; }

/* LLD-14 Section 7: operator edits and feedback. */
.txt { position: relative; }
.txt > p { margin: 0 0 6px; }
.txt .blank { margin: 0 0 6px; }
.txt-meta { font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.badge-warn { color: var(--warn-fg, #7A5300); background: var(--warn-bg, #FFF2CC); border-color: transparent; }
.txt-edit > summary, .txt-diff > summary, .fb > summary { display: inline-block; cursor: pointer; font-size: 12px; color: var(--accent); list-style: none; }
.txt-edit > summary::-webkit-details-marker, .txt-diff > summary::-webkit-details-marker, .fb > summary::-webkit-details-marker { display: none; }
.txt-edit > summary:hover, .fb > summary:hover { text-decoration: underline; }
.txt-edit form, .fb form { display: grid; gap: 6px; margin: 6px 0 8px; }
.txt-edit textarea, .fb textarea { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-control, 6px); background: var(--panel); color: var(--text); }
.txt-edit button, .fb button { justify-self: start; }
.diff { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12.5px; margin: 6px 0; }
.diff dt { color: var(--muted); }
.diff dd { margin: 0; white-space: pre-wrap; }
form.inline { display: inline; }
.hd .fb { margin-left: 10px; }
.hd .fb[open] { position: absolute; right: 16px; top: 44px; z-index: 5; width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; box-shadow: 0 8px 24px rgba(8, 10, 8, 0.16); }
.panel { position: relative; }
.fb-on { margin: 0; font-size: 11px; color: var(--muted); word-break: break-all; }
.bandtop .fb > summary { color: inherit; }
.bandtop .fb[open] form { position: absolute; z-index: 45; right: 16px; width: 300px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; box-shadow: 0 8px 24px rgba(8, 10, 8, 0.16); }
a.fb { font-size: 12px; color: var(--muted); margin-left: 10px; }
a.fb:hover { color: var(--accent); }
.bandtop a.fb { color: inherit; margin: 0; }
.fb-form { display: grid; gap: 10px; }
.fb-form textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-control, 6px); background: var(--panel); color: var(--text); }
.fb-form button { justify-self: start; }
@media print { a.fb, .txt-edit, .txt-diff { display: none; } }
.slide-ft a.fb { margin-left: 0; }
table.feedback td.empty { text-align: left; }
/* The panel's Feedback link sits at the right, beside the panel's own link or range. */
.hd a.fb { margin-left: auto; }
.hd a.fb + a, .hd a.fb + .range { margin-left: 14px; }
/* The band's first row holds one line at laptop widths once the clocks are in it. */
@media (max-width: 1500px) {
  .bandtop .user-email, .bandtop .avatar, .bandtop .theme-toggle span { display: none; }
  .bandtop { column-gap: 9px; }
  .bandtop .search { width: 140px; }
  .bandtop .clocks { gap: 9px; }
}

/* Assets (LLD-15 Section 6) */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); }
table.assets { width: 100%; border-collapse: collapse; }
table.assets th, table.assets td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: var(--fs-1); }
table.assets td:first-child .glyph { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; color: var(--faint); }
table.assets tr.depth-1 td:first-child { padding-left: 28px; }
table.assets tr.depth-2 td:first-child { padding-left: 48px; }
table.assets tr.depth-3 td:first-child { padding-left: 68px; }
.asset-hero { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.asset-hero > .glyph { width: 22px; height: 22px; color: #FFFFFF; }
.asset-hero .btn { margin-left: auto; }
.asset-search { margin-top: 10px; max-width: 320px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 4px 0; overflow-wrap: anywhere; }
details.procedure { border-top: 1px solid var(--line); padding: 8px 0; }
details.procedure > summary { cursor: pointer; }
table.history { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
table.history th, table.history td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.group-asset { margin-left: 8px; font-size: var(--fs-0); }
.asset-matches { margin: 0 0 var(--sp-3); }

/* The pack console (LLD-15 Sections 7 and 8) */
.side-reload { display: block; margin-top: 4px; }
.side-reload button.link { font: inherit; color: inherit; padding: 0; margin-left: 6px; }
pre.patch { font: 12px/1.5 var(--mono, ui-monospace, Menlo, monospace); overflow-x: auto; margin: 0; padding: var(--sp-3, 12px); background: var(--panel2); border-radius: 6px; }
pre.patch span { display: block; white-space: pre; }
pre.patch .add { background: var(--ok-bg); color: var(--ok-fg); }
pre.patch .del { background: var(--fail-bg); color: var(--fail-fg); }
pre.patch .hunk { color: var(--muted); }
.actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3, 12px); }
.inline-form { display: inline; margin: 0; }
form.edit .field { display: flex; flex-direction: column; gap: 2px; }
.remove-form { margin-top: var(--sp-4, 16px); }
.reload-errors ul, .preview-errors ul, .commit-errors ul, .form-errors ul { margin: 4px 0 0; padding-left: 18px; }
.dry-run .st { margin-right: 8px; }
ul.choose { columns: 2; padding-left: 18px; }
button[disabled] { opacity: .5; cursor: not-allowed; }
