/* Uplivra brand (Brand System 1.0, branding/brand-tokens.json): Deep #0F2A43,
   Signal #19B5A5, Current #35C2D6, Ice #E9F2F5, Slate #64748B, Graphite
   #111827, Snow #F8FAFC. Status: Healthy #22C55E, Warning #F59E0B, Critical
   #EF4444, Info #3B82F6, Unknown #687280, Maintenance #8B5CF6, Disabled
   #9CA3AF (always with a label or icon, never color alone). Buttons in
   Signal or Current carry Deep text, not white (brand contrast rules).
   Fonts: Manrope (headings), Inter (text), IBM Plex Mono (code and logs).
   The logo lives in mark.svg (symbol) and favicon.svg / favicon.ico /
   apple-touch-icon.png, copied from the brand package. */
:root {
  --font: var(--font-body);
  --mono: var(--font-mono);
  --brand-deep: var(--deep); --brand-signal: var(--signal); --brand-current: var(--current);
  --bg: var(--snow); --panel: var(--white); --text: var(--graphite); --muted: var(--slate); --line: #e1e8ee;
  --accent: var(--deep); --accent-ink: var(--white); --accent-soft: var(--ice);
  --btn: var(--signal); --btn-ink: var(--deep);
  --up: var(--st-healthy-text); --up-bg: #e7f6ec; --warn: var(--st-warning-text); --warn-bg: #fdf4dc;
  --down: var(--st-critical-text); --down-bg: #fdeaea; --unknown: var(--st-unknown-text); --unknown-bg: #eef1f4;
  --info: var(--st-info-text); --maint: var(--st-maint-text);
  --up-fill: var(--st-healthy); --warn-fill: var(--st-warning); --down-fill: var(--st-critical); --unknown-fill: var(--st-unknown);
  --radius: var(--r-btn); --shadow: var(--sh-1);
  color-scheme: light;
}
/* Theme: "auto" follows the computer's setting; people can also pick light or dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #081221; --panel: #0f1d33; --text: var(--ice); --muted: #93a4b8; --line: #1e3350;
  --accent: var(--current); --accent-ink: var(--deep); --accent-soft: #0f3346;
  --btn: var(--current); --btn-ink: var(--deep);
  --up: var(--st-healthy); --up-bg: #0f2e22; --warn: var(--st-warning); --warn-bg: #33270b;
  --down: var(--st-critical); --down-bg: #3a1419; --unknown: #93a4b8; --unknown-bg: #1a2a40;
  --info: var(--st-info); --maint: var(--st-maint);
  --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #081221; --panel: #0f1d33; --text: var(--ice); --muted: #93a4b8; --line: #1e3350;
  --accent: var(--current); --accent-ink: var(--deep); --accent-soft: #0f3346;
  --btn: var(--current); --btn-ink: var(--deep);
  --up: var(--st-healthy); --up-bg: #0f2e22; --warn: var(--st-warning); --warn-bg: #33270b;
  --down: var(--st-critical); --down-bg: #3a1419; --unknown: #93a4b8; --unknown-bg: #1a2a40;
  --info: var(--st-info); --maint: var(--st-maint);
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); font-feature-settings: "cv11"; }
a { color: var(--accent); }
h1, h2, h3, .brand, .tile .n, .stat .v { font-family: var(--font-head); letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: var(--fs-lg); margin: 0 0 .75rem; display: flex; align-items: baseline; gap: .6rem; }
code, .mono, pre { font-family: var(--mono); font-size: .9em; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: .75rem 1rem; overflow-x: auto; white-space: pre; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); font-weight: 400; }
.nowrap { white-space: nowrap; }
.problem { color: var(--down); }

/* header */
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: var(--fs-lg); color: var(--text); text-decoration: none; }
.brand.big { font-size: 1.6rem; justify-content: center; margin-bottom: 1.25rem; }
.logo { width: 26px; height: 26px; background: url(/static/mark.svg) center/contain no-repeat; display: inline-block; }
.brand.big .logo { width: 40px; height: 40px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " ▾"; color: var(--muted); }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary:hover { background: var(--bg); }
.menu.current > summary { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu { position: relative; }
.menu-items { position: absolute; top: 2.3rem; left: 0; z-index: 10; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--sh-pop); padding: .35rem; min-width: 220px; display: grid; }
.menu-items a { padding: .5rem .7rem; border-radius: var(--r-sm); color: var(--text); text-decoration: none; }
.menu-items a:hover { background: var(--bg); }
.who { display: flex; gap: .75rem; align-items: center; color: var(--muted); font-size: var(--fs-sm); }
.role { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 .5rem; font-size: var(--fs-2xs); }

/* layout */
main { max-width: 1320px; width: 100%; margin: 0 auto; padding: 1.5rem 2rem; }
main.bare { max-width: 440px; padding-top: 12vh; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.crumbs { margin: 0 0 .4rem; color: var(--muted); font-size: var(--fs-sm); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 0 0 1rem; box-shadow: var(--shadow); overflow-x: auto; }
.card > p:last-child { margin-bottom: 0; }
.banner { border-radius: var(--radius); padding: .7rem 1rem; margin: 0 0 1rem; border: 1px solid; }
.banner.ok { background: var(--up-bg); border-color: var(--up); }
.banner.err { background: var(--down-bg); border-color: var(--down); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn); }

/* summary tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--unknown-fill, var(--unknown)); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tile .n { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile.down { border-left-color: var(--down-fill, var(--down)); } .tile.warn { border-left-color: var(--warn-fill, var(--warn)); } .tile.up { border-left-color: var(--up-fill, var(--up)); }
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, 1fr); } main { padding: 1rem; } .top { padding: .6rem 1rem; }
  table.devices th:nth-child(3), table.devices td:nth-child(3) { display: none; }
  .pill { min-width: 0; }
}

/* status */
.pill, .chip { display: inline-block; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.pill { padding: .1rem .6rem; min-width: 5.2rem; text-align: center; }
.chip { padding: 0 .5rem; margin: 0 .25rem .15rem 0; font-weight: 500; }
.up { color: var(--up); background: var(--up-bg); }
.warn { color: var(--warn); background: var(--warn-bg); }
.down { color: var(--down); background: var(--down-bg); }
.unknown { color: var(--unknown); background: var(--unknown-bg); }
.pill.down::before { content: "● "; }
.all-good { color: var(--up); font-weight: 600; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: .4rem .6rem; border-bottom: 1px solid var(--line); }
td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
table.devices td { vertical-align: middle; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.alert-list li:last-child { border-bottom: 0; }

/* sparkline */
.spark { display: block; }
.spark-line { stroke: var(--accent); stroke-width: 1.5; }
.spark-fail { fill: var(--down); }

/* forms */
.form { display: grid; gap: .9rem; max-width: 880px; }
/* Wizards use the page's width (they were 640px, bunched up on the left of
   a wide screen); pop-up wizards already fill their dialog. */
form.wizard, form[data-wizard] { max-width: 1040px; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: var(--fs-sm); }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.hint { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }
input:not([type=checkbox]):not([type=radio]), select { font: inherit; font-weight: 400; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: .5rem .65rem; width: 100%; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input.short { max-width: 9rem; }
fieldset { border: 1px dashed var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: grid; gap: .8rem; margin: 0; }
legend { font-weight: 600; color: var(--muted); font-size: var(--fs-sm); padding: 0 .3rem; }
.js fieldset[data-for].hidden, .js [data-for].hidden { display: none; }
.row { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 200px; }
.row > input, .row > select { flex: 1; min-width: 200px; width: auto; }
.actions { display: flex; gap: 1rem; align-items: center; }
button, .button { white-space: nowrap; font: inherit; font-weight: 600; border-radius: var(--r-md); padding: .5rem .9rem; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--muted); }
.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); font-weight: 600; }
.primary:hover { filter: brightness(1.08); border-color: var(--btn); }
button.wide { width: 100%; padding: .65rem; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; }
.danger { color: var(--down); }
button.danger:not(.link) { border-color: var(--down); background: var(--panel); }
.danger-zone { border-color: var(--down-bg); }
form.inline { display: inline; }
.copy-btn { margin-top: -.25rem; }

/* sign-in */
.login .card { display: grid; gap: .9rem; }
.login h1 { font-size: var(--fs-xl); }
.help pre { white-space: pre-wrap; word-break: break-all; }
.steps ol { padding-left: 1.3rem; margin: 0; display: grid; gap: .9rem; }
.refresh-note { text-align: right; }

/* theme switch in the header */

/* compact dashboard */
.compact td { padding: .3rem .6rem; }
.compact .card { padding: .8rem 1rem; }

/* my settings */
.widget-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.widget-list li { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: var(--r-md); padding: .45rem .7rem; }
.widget-list li label.check { flex: 1; }
.widget-list select { width: auto; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: .4rem; }
.options { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* wallboard (a screen on the wall of the office or NOC) */
body.wall { background: var(--bg); }
.wall main { max-width: none; padding: 1.25rem 2rem; }
.wall-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.wall-head h1 { font-size: 2rem; }
.wall .tiles .n { font-size: 3.5rem; }
.wall .tile { padding: 1rem 1.25rem; font-size: var(--fs-xl); }
.wall-problems { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .5rem; }
.wall-problems li { font-size: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-left: 8px solid var(--down); border-radius: var(--radius); padding: .6rem 1rem; display: flex; gap: 1rem; align-items: baseline; }
.wall-problems li.warn { border-left-color: var(--warn); }
.wall-problems .muted { font-size: var(--fs-base); }
.wall-ok { font-size: 2rem; color: var(--up); font-weight: 700; text-align: center; padding: 2rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.5rem; }
.wall-site h2 { font-size: var(--fs-xl); margin: 1rem 0 .5rem; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: .5rem; }
.wall-grid div { border-radius: var(--r-md); padding: .5rem .7rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.steps-list { padding-left: 1.3rem; margin: 0 0 .75rem; display: grid; gap: .6rem; }
pre.wrap { white-space: pre-wrap; word-break: break-all; }

.js [data-for-login].hidden, .js [data-for-dns].hidden, .js [data-for-profile].hidden, .js #check-form label.hidden { display: none; }
textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: .5rem .65rem; width: 100%; }
form.test-mail { gap: .4rem; margin-bottom: .35rem; flex-wrap: nowrap; }
form.test-mail input { min-width: 12rem; }

/* devices and discovery lists */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters input[name=q] { flex: 2; min-width: 14rem; width: auto; }
.filters select { flex: 1; min-width: 9rem; width: auto; }
.bulk { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); display: grid; gap: .75rem; }
.bulk.row { display: flex; }
tr.retired td { opacity: .6; }
.row-actions { display: flex; gap: .75rem; align-items: center; }
.row-actions form { margin: 0; }
button.link[disabled] { color: var(--muted); cursor: default; }
.facts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: .6rem 1.25rem; margin: 0; }
.facts dt { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.facts .notes { white-space: pre-wrap; margin: .8rem 0 0; }
h3.sub { font-size: var(--fs-sm); color: var(--muted); margin: 1rem 0 .4rem; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
ul.plain li { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.tabs-row { justify-content: space-between; margin-bottom: .75rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.tabs a { padding: .35rem .7rem; border-radius: var(--r-md); text-decoration: none; color: var(--text); border: 1px solid var(--line); }
.tabs a[aria-current] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.tabs .count { color: var(--muted); font-size: var(--fs-xs); margin-left: .2rem; }
.clip { max-width: 28rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { flex-wrap: wrap; }
table.device-list td, table.host-list td { vertical-align: middle; }
@media (max-width: 640px) {
  table.device-list th:nth-child(n+5), table.device-list td:nth-child(n+5) { display: none; }
  table.device-list th:last-child, table.device-list td:last-child { display: table-cell; }
  table.host-list th:nth-child(4), table.host-list td:nth-child(4),
  table.host-list th:nth-child(6), table.host-list td:nth-child(6) { display: none; }
  .clip { max-width: 12rem; }
}

.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: .75rem 1.25rem; margin: 0 0 1rem; }
.facts-grid dt { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.facts-grid dd { margin: 0; overflow-wrap: anywhere; }

/* performance charts (colors: validated categorical slots 1 and 2) */
:root { --series-1: #2a78d6; --series-2: #eb6834; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; }
.perf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.perf-head h2 { margin: 0; }
.ranges { display: flex; gap: .25rem; flex-wrap: wrap; }
.ranges a { padding: .2rem .6rem; border: 1px solid var(--line); border-radius: var(--r-pill); text-decoration: none; color: var(--text); font-size: var(--fs-sm); }
.ranges a[aria-current] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat { border: 1px solid var(--line); border-radius: var(--r-md); padding: .5rem .75rem; display: grid; }
.stat .v { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: var(--fs-xs); }
.stat.problem-stat { border-color: var(--warn); background: var(--warn-bg); }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 1rem 1.25rem; }
.chart { margin: 0; position: relative; }
.chart figcaption { display: flex; justify-content: space-between; gap: .75rem; font-size: var(--fs-sm); margin-bottom: .25rem; flex-wrap: wrap; }
.chart .legend { display: flex; gap: .75rem; color: var(--muted); font-size: var(--fs-xs); }
.chart .key::before { content: ""; display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: .3rem; background: var(--series-1); }
.chart .key.s2::before { background: var(--series-2); }
.chart-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font-size: 15px; font-family: var(--font); }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .line.s1 { stroke: var(--series-1); }
.chart-svg .line.s2 { stroke: var(--series-2); }
.chart-svg .threshold { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-svg .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-pop); padding: .4rem .6rem; font-size: var(--fs-xs); z-index: 5; white-space: nowrap; }
.chart-tip .t { color: var(--muted); }
.chart-tip .row { display: flex; gap: .5rem; align-items: center; }
.chart-tip .row strong { font-variant-numeric: tabular-nums; }
.chart-tip .sw { width: 12px; height: 2px; background: var(--series-1); }
.chart-tip .sw.s2 { background: var(--series-2); }
.chart-summary { margin-top: .25rem; }
.chart-summary th, .chart-summary td { padding: .15rem .4rem; font-size: var(--fs-2xs); }
.chart-summary th { text-transform: none; letter-spacing: 0; font-weight: 500; }
.chart-summary tbody th { color: var(--text); font-weight: 600; }
.chart-summary { width: auto; }
.empty-chart { border: 1px dashed var(--line); border-radius: var(--r-md); padding: 1.5rem; text-align: center; }
.table-scroll { overflow-x: auto; }
table.ifaces tr.selected td { background: var(--accent-soft); }
tr.selected td { background: var(--accent-soft); }

/* Test buttons: the result box under a form. */
.test-result { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.test-result.good { border-color: var(--up); background: var(--up-bg); }
.test-result.bad { border-color: var(--down); background: var(--down-bg); }
.test-result p { margin: 4px 0; }
.test-lines { margin: 6px 0 0; padding-left: 18px; max-height: 280px; overflow-y: auto; overflow-wrap: anywhere; }
.field-button { display: flex; align-items: flex-end; }
[hidden] { display: none !important; }

/* Two-step sign-in */
.notice { padding: 10px 12px; border: 1px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius); }
.center { text-align: center; }
ol.steps { padding-left: 20px; margin: 0; }
ol.steps > li { margin-bottom: 18px; }
.qr { margin: 12px 0; }
.qr img { background: #fff; padding: 8px; border-radius: var(--r-md); max-width: 100%; height: auto; }
.setup-key { font-size: var(--fs-lg); letter-spacing: .05em; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.code-input { font-family: var(--mono); font-size: var(--fs-xl); letter-spacing: .15em; max-width: 12rem; }
.recovery-codes { font-size: var(--fs-lg); line-height: 1.8; column-count: 2; max-width: 26rem; }
@media (max-width: 480px) { .recovery-codes { column-count: 1; } }

/* Click a check to open its full result. */
.js tr.panel-row { display: none; }
.js tr.panel-row.open { display: table-row; }
tr.panel-row > td { background: var(--bg); padding: 0; }
.js tr.check-row { cursor: pointer; }
.js tr.check-row:hover > td, tr.check-row.open > td { background: var(--accent-soft); }
tr.check-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.check-msg { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 46rem; }
.js-only { display: none; }
.js .js-only { display: block; }
.check-panel { padding: 12px 16px 16px; max-width: 60rem; }
.check-panel h4 { margin: 14px 0 6px; font-size: var(--fs-sm); }
.check-panel table { width: auto; min-width: 18rem; }
.check-panel .panel-message { margin: 4px 0 8px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 0; }
dl.kv > div { display: contents; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
tr.changed > td { background: var(--warn-bg); font-weight: 600; }
.change-warning { border: 1px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.change-warning p { margin: 4px 0 8px; }
.change-warning table { background: var(--panel); }
.change-banner { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; border: 1px solid var(--warn); background: var(--warn-bg);
  border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.table-scroll { overflow-x: auto; }
table.ports td, table.ports th { white-space: nowrap; }
tr.port-problem > td { background: var(--warn-bg); }
.test-result .check-panel { padding: 8px 0 0; }
.site-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.site-head details.rename summary { cursor: pointer; color: var(--accent); }
.site-head details.rename form { margin-top: 6px; }

/* Maintenance windows */
article.mw { border-top: 1px solid var(--line); padding: 12px 0; }
article.mw:first-of-type { border-top: 0; }
.mw-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.mw-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.mw-actions form.decide input { min-width: 14rem; }
.choice-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 10px; }
#mw-form h2 { margin-top: 18px; }
.device-picker { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 6px 0 10px; }
.picker-tools { align-items: center; margin-bottom: 8px; }
.picker-tools input[type=search] { flex: 1 1 14rem; }
.picker-list { max-height: 320px; overflow-y: auto; display: grid; gap: 2px; }
.picker-list label.pick { display: flex; gap: 8px; align-items: baseline; padding: 3px 4px; border-radius: var(--r-sm); }
.picker-list label.pick:hover { background: var(--accent-soft); }
.js .picker-list label.pick.filtered { display: none; }
.js [data-scope].off, .js [data-system].off, .js [data-approval].off, .js [data-needs-system].off { display: none; }
.wide-login { max-width: 40rem; }

/* Network map */
.map-scroll { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
svg.netmap { display: block; margin: 0 auto; font-family: inherit; }
svg.netmap .node rect { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
svg.netmap a:hover .node rect, svg.netmap a:focus .node rect { stroke: var(--accent); stroke-width: 2; }
svg.netmap .node circle { fill: var(--unknown); }
svg.netmap .vbadge rect { fill: var(--down-bg); stroke: var(--down); stroke-width: 1; }
svg.netmap .vbadge text { fill: var(--down); font-size: 10px; font-weight: 700; }
svg.netmap .vbadge.medium rect, svg.netmap .vbadge.low rect { fill: var(--warn-bg); stroke: var(--warn); }
svg.netmap .vbadge.medium text, svg.netmap .vbadge.low text { fill: var(--warn); }
svg.netmap .vbadge.locked rect { fill: var(--unknown-bg); stroke: var(--unknown); }
svg.netmap .vbadge.locked text { fill: var(--unknown); }
svg.netmap a.vbadge-link:hover .vbadge rect, svg.netmap a.vbadge-link:focus .vbadge rect { stroke-width: 2; }
svg.netmap .node.up circle { fill: var(--up); }
svg.netmap .node.warn circle { fill: var(--warn); }
svg.netmap .node.down circle { fill: var(--down); }
svg.netmap .node.down rect { stroke: var(--down); }
svg.netmap .node.unmonitored rect { stroke-dasharray: 4 3; fill: transparent; }
svg.netmap .node.unmonitored circle { fill: transparent; stroke: var(--muted); }
svg.netmap text.name { font-size: 13px; font-weight: 600; fill: var(--text); }
svg.netmap text.sub { font-size: 11px; fill: var(--muted); font-family: var(--mono); }
svg.netmap text.port { font-size: 10px; fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
line.edge { stroke: var(--muted); stroke-width: 1.6; }
line.edge-mac { stroke-dasharray: 5 4; stroke-width: 1.2; }
line.edge-cross { stroke-opacity: .5; }
line.edge-trace { stroke-dasharray: 2 4; stroke-width: 1.6; stroke-linecap: round; }
/* Routed view: points found by traceroute. */
svg.netmap .node.k-site rect { stroke: var(--accent); stroke-width: 2; fill: var(--accent-soft); }
svg.netmap .node.k-site circle { fill: var(--accent); }
svg.netmap .node.k-inferred rect, svg.netmap .node.k-target rect { stroke-dasharray: 4 3; fill: transparent; }
svg.netmap .node.k-inferred circle, svg.netmap .node.k-target circle { fill: transparent; stroke: var(--muted); }
svg.netmap .node.k-internet rect { rx: 24px; stroke-dasharray: 6 3; fill: var(--unknown-bg); }
svg.netmap .node.k-internet circle { fill: var(--muted); }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; align-items: center; }
.map-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--unknown); vertical-align: middle; }
.map-legend .dot.up { background: var(--up); } .map-legend .dot.warn { background: var(--warn); } .map-legend .dot.down { background: var(--down); }
.map-legend .dot.unmonitored { background: transparent; border: 1px dashed var(--muted); }

/* Charts open larger when clicked. */
figure.chart.zoomable svg { cursor: zoom-in; }
figure.chart .zoom-link { margin-left: 6px; font-weight: 400; }
dialog.chart-dialog { width: min(1100px, 96vw); max-height: 92vh; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.chart-dialog::backdrop { background: rgba(10, 15, 20, .55); }
dialog.chart-dialog .dialog-close { position: absolute; top: 8px; right: 10px; font-size: 1.4rem; line-height: 1; padding: .2rem .55rem; }
.chart-zoom .zoom-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-right: 36px; }
.chart-zoom .zoom-head h2 { margin: 0 0 8px; }
.chart-zoom .ranges { margin-bottom: 8px; }
.chart-zoom .zoom-custom { align-items: flex-end; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.chart-zoom .zoom-custom label { display: grid; gap: 2px; }
.chart-zoom figure.chart { margin: 0; }

/* Traffic flows */
.flow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 0 1.25rem; }
.flow-table { width: 100%; }
.flow-table td.num { text-align: right; white-space: nowrap; vertical-align: top; font-variant-numeric: tabular-nums; }
.flow-table .flow-name { overflow-wrap: anywhere; }
svg.flow-bar { display: block; width: 100%; height: 4px; margin-top: 4px; }
svg.flow-bar rect { fill: var(--series-1); }
svg.flow-bar rect.track { fill: var(--line); }
.if-filter { margin: 6px 0 10px; }
.flow-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Audit log */
.filters .inline-label { display: flex; align-items: center; gap: .35rem; margin: 0; font-weight: 500; white-space: nowrap; }
.filters .inline-label input { width: auto; }
p.ranges { align-items: center; }
table.audit td { vertical-align: top; }
table.audit tr.warn-row td { background: var(--warn-bg); }
ol.tries { margin: .3rem 0 0 1.1rem; padding: 0; }
ol.tries li { margin-bottom: .25rem; }

/* Configuration backups */
.config-grid { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .config-grid { grid-template-columns: 1fr; } }
.config-main { min-width: 0; }
.version-list tr.selected td { background: var(--accent-soft); }
.version-list td { vertical-align: top; }
pre.config-text { max-height: 70vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: .75rem; font-size: var(--fs-xs); line-height: 1.45; white-space: pre; }
pre.config-text .ln { display: inline-block; width: 3.5em; color: var(--muted); user-select: none; text-align: right; padding-right: 1em; }
table.diff { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.diff td { padding: 0 .5rem; white-space: pre-wrap; word-break: break-all; border: 0; line-height: 1.5; }
table.diff td.ln { width: 3.5em; color: var(--muted); text-align: right; user-select: none; }
table.diff tr.add td { background: var(--up-bg); }
table.diff tr.del td { background: var(--down-bg, #fde8e8); }
table.diff tr.gap td { color: var(--muted); text-align: center; background: var(--bg); }
table.diff .sign { display: inline-block; width: 1.2em; user-select: none; }
.add { color: var(--up); font-weight: 600; }
.del { color: var(--down); font-weight: 600; }
.inline-form { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; margin-bottom: .75rem; }
.inline-form label { margin: 0; }

/* IP addresses */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-button { padding: .2rem .6rem; border-radius: var(--r-pill); font-weight: 500; font-size: var(--fs-sm); }
details.card > summary { cursor: pointer; }

/* Logs */
table.logs td { vertical-align: top; }
table.logs td.msg { font-family: var(--mono); font-size: var(--fs-xs); white-space: pre-wrap; word-break: break-word; }
table.logs tr.new td { background: var(--accent-soft); }
table.logs details summary { cursor: pointer; font-family: inherit; }
.filters input.short { flex: 0 1 9rem; min-width: 7rem; width: auto; }

/* Service Desk */
.ticket-grid { display: grid; grid-template-columns: 1fr minmax(15rem, 20rem); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .ticket-grid { grid-template-columns: 1fr; } }
.ticket-text { white-space: pre-wrap; word-break: break-word; }
.comment.internal { border-left: 4px solid var(--warn); background: var(--warn-bg); }
textarea { width: 100%; font: inherit; }

/* Upgrade & Lifecycle */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 1rem; align-items: start; }
.lc-tabs { margin-bottom: 1rem; }
a.stat { text-decoration: none; color: var(--text); }
a.stat:hover { border-color: var(--accent); }
.stage { border-left: 3px solid var(--line); padding-left: .9rem; margin-bottom: 1.25rem; }
.stage.blocked { opacity: .7; }
.stage-head { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.finding-ok { color: var(--up); }
.finding-fail { color: var(--down); font-weight: 600; }
.finding-warn { color: var(--warn); }
.finding-info { color: var(--muted); }
ul.findings { margin: .3rem 0; padding-left: 1.1rem; }
pre.cmd { background: var(--unknown-bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .45rem .6rem; overflow-x: auto; font-size: var(--fs-xs); margin: .25rem 0 .6rem; white-space: pre-wrap; word-break: break-all; }
details.guide summary { cursor: pointer; }
input.tiny { max-width: 4.5rem; }
.danger-zone { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* Public status page */
body.status-public main { max-width: 820px; margin: 2rem auto; padding: 0 1rem; }
.status-banner { padding: .9rem 1rem; border-radius: var(--r-btn); font-weight: 700; margin: 1rem 0; background: var(--up-bg); color: var(--up); }
.status-banner.down { background: var(--down-bg); color: var(--down); }
.status-banner.warn, .status-banner.unknown { background: var(--warn-bg); color: var(--warn); }
.status-banner.maintenance { background: var(--unknown-bg); color: var(--unknown); }
.status-comp { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.status-comp:last-child { border-bottom: 0; }
.status-comp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.status-days { display: flex; gap: 2px; height: 28px; }
.status-days .d { flex: 1; border-radius: 2px; background: var(--unknown-bg); }
.status-days .d.ok { background: var(--up); }
.status-days .d.minor { background: var(--warn); }
.status-days .d.major { background: var(--down); }
.status-foot { display: flex; justify-content: space-between; margin-top: .25rem; }
.ai-text h4 { margin: .8rem 0 .3rem; }
.ai-text p { margin: .4rem 0; }
.ai-text ul, .ai-text ol { margin: .3rem 0 .5rem; }
.run-step { padding: .5rem 0; border-bottom: 1px solid var(--line); } fieldset.step { margin-bottom: 1rem; }
.tenant-chip { border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: .15rem .6rem; text-decoration: none; font-size: var(--fs-sm); margin-right: .5rem; }
.current-row td { background: var(--accent-soft); }
select.short { max-width: 12rem; }

/* ---- App shell: sidebar + top bar (brand UI) ---- */
:root { --side-bg: #ffffff; --side-text: #334155; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --side-bg: #0b1729; --side-text: #b8c6d6; } }
:root[data-theme="dark"] { --side-bg: #0b1729; --side-text: #b8c6d6; }
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.side { width: 236px; flex: none; background: var(--side-bg); border-right: 1px solid var(--line); padding: 1rem .75rem 1.5rem;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.side .brand { font-size: var(--fs-xl); padding: .2rem .6rem 1.1rem; gap: .6rem; }
.side .brand .logo { width: 30px; height: 30px; }
.side nav { display: grid; gap: 2px; }
.side nav a, .side-group > summary { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: var(--r-md);
  color: var(--side-text); text-decoration: none; font-size: var(--fs-md); cursor: pointer; list-style: none; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::after { content: "▾"; margin-left: auto; font-size: var(--fs-2xs); color: var(--muted); }
.side nav a:hover, .side-group > summary:hover { background: var(--bg); color: var(--text); }
.side nav a[aria-current], .side-group > summary.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.side-group > div { display: grid; gap: 1px; margin: .15rem 0 .4rem; }
.side-group > div a { padding: .38rem .7rem .38rem 2.55rem; font-size: var(--fs-sm); }
.side-label { margin: 1rem .7rem .35rem; font-size: var(--fs-2xs); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.side .count { margin-left: auto; background: var(--down); color: var(--white); border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: 700; padding: 0 .45rem; line-height: 1.4rem; min-width: 1.4rem; text-align: center; }
.ico { width: 18px; height: 18px; flex: none; }
.work { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .6rem 2rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: .5rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 0 .8rem; color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { border: 0; background: transparent; flex: 1; padding: .55rem 0; color: var(--text); font: inherit; outline: none; box-shadow: none; min-width: 0; }
.who { margin-left: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-btn); border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; position: relative; padding: 0; }
.icon-btn:hover { background: var(--bg); color: var(--text); border-color: var(--line); }
.icon-btn .ico { width: 20px; height: 20px; }
.bell .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 2px var(--panel); }
.theme-switch { margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important;
  background: linear-gradient(135deg, var(--brand-signal), var(--brand-current)); color: var(--brand-deep); font-weight: 800; font-size: var(--fs-xs); }
.avatar::after { content: none !important; }
.menu-items.right { left: auto; right: 0; top: 2.6rem; }
.menu-head { margin: 0; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.menu-items form { margin: 0; } .menu-items button.link { padding: .5rem .7rem; width: 100%; text-align: left; }
.nav-toggle { display: none; }
@media (max-width: 960px) {
  .side { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.nav-open .side { transform: none; }
  .nav-toggle { display: inline-flex; }
  .top { padding: .5rem 1rem; gap: .5rem; }
  main { padding: 1rem; }
  .tenant-chip { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---- Overview (brand dashboard) ---- */
.tiles { gap: 1rem; }
.tile { border-left: 1px solid var(--line); padding: 1rem 1.15rem; gap: .2rem; border-radius: var(--r-lg); }
.tile .label { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.tile .badge { width: 22px; height: 22px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--unknown-bg); color: var(--unknown); }
.tile .badge .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.tile .n { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; margin-top: .15rem; }
.tile .sub { font-size: var(--fs-xs); color: var(--muted); }
.tile.total .badge { background: var(--accent-soft); color: var(--accent); }
.tile.up .n, .tile.up .sub strong { color: var(--up); } .tile.up .badge { background: var(--up-bg); color: var(--up); }
.tile.warn .n, .tile.warn .sub strong { color: var(--warn); } .tile.warn .badge { background: var(--warn-bg); color: var(--warn); }
.tile.down .n, .tile.down .sub strong { color: var(--down); } .tile.down .badge { background: var(--down-bg); color: var(--down); }
.tile.up, .tile.warn, .tile.down, .tile.unknown { border-left-width: 1px; border-left-color: var(--line); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; margin-bottom: 1rem; }
.dash-grid > .card { margin: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.health-head { display: flex; justify-content: space-between; align-items: baseline; }
.health-now { font-family: var(--font-head); font-weight: 800; font-size: var(--fs-lg); color: var(--up); display: inline-flex; align-items: center; gap: .4rem; }
.health-now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.health-svg { width: 100%; height: auto; display: block; }
.health-svg .grid { stroke: var(--line); stroke-width: 1; }
.health-svg text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.health-svg .line { fill: none; stroke: var(--brand-current); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.health-svg .area { fill: url(#hg); }
.health-svg .dotend { fill: var(--brand-current); stroke: var(--panel); stroke-width: 2; }
.top-alerts { list-style: none; margin: 0; padding: 0; }
.top-alerts li { display: grid; grid-template-columns: 10px minmax(0, 1.1fr) minmax(0, 1.3fr) auto; gap: .75rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.top-alerts li:last-child { border-bottom: 0; }
.top-alerts .sev { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); }
.top-alerts .sev.down { background: var(--down); } .top-alerts .sev.acked { opacity: .45; }
.top-alerts .dev { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-alerts .what { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-alerts .age { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
a.tile { text-decoration: none; color: var(--text); background: var(--panel); transition: border-color .15s, transform .15s; }
a.tile:hover { border-color: var(--accent); }
.tile .label, .tile .sub { text-decoration: none; }
.search input[type=search], .search input[type=search]:focus { border: 0; background: transparent; box-shadow: none; padding-left: 0; }
.top-alerts a, table a { text-decoration: none; font-weight: 500; }
.top-alerts a:hover, table a:hover { text-decoration: underline; }
.top-alerts .dev a { color: var(--text); font-weight: 600; }
.flow-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.75rem; margin-top: 1.25rem; }
@media (max-width: 900px) { .flow-cols { grid-template-columns: 1fr; } }
table.flow-lines td { vertical-align: middle; } table.flow-lines .bar-cell { width: 30%; } table.flow-lines .num { text-align: right; }
table.edit input, table.edit select { width: 100%; min-width: 4rem; padding: .3rem .4rem; font-size: var(--fs-sm); }
table.edit input[type=checkbox] { width: 1rem; min-width: 0; }
input.tiny { max-width: 5rem; } input.short { max-width: 10rem; }
fieldset.cust { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; }
fieldset.cust legend { font-weight: 700; padding: 0 .4rem; }
.sticky-save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 1rem; }
/* Collector status page */
.narrow-page { max-width: 820px; margin: 2rem auto; padding: 0 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.h1-mark { vertical-align: -5px; }

/* Insights reports */
.insight-head { display: flex; align-items: center; gap: .7rem; margin: .2rem 0 .3rem; }
.insight-head h3 { margin: 0; font-size: var(--fs-xl); line-height: 1.35; }
.insight-narrative { border-left: 3px solid var(--accent, var(--line)); padding: .2rem 0 .2rem .9rem; margin: .6rem 0; }
.stat.lvl-down { border-color: var(--down); } .stat.lvl-warn { border-color: var(--warn); background: var(--warn-bg); }
a.stat { color: inherit; text-decoration: none; }
.findings { list-style: none; padding: 0; margin: .3rem 0 .8rem; display: grid; gap: .35rem; }
.findings li { display: flex; gap: .6rem; align-items: baseline; }
.findings .pill { min-width: 5.6rem; flex: none; }
details.incident, details.insight-panel { border: 1px solid var(--line); border-radius: var(--r-md); padding: .5rem .8rem; margin: .7rem 0; }
details.incident.lvl-down { border-left: 4px solid var(--down); } details.incident.lvl-warn { border-left: 4px solid var(--warn); }
details.incident summary, details.insight-panel summary { cursor: pointer; }
details.insight-panel summary h4 { display: inline; margin: 0; }
table.timeline td { padding: .25rem .5rem; vertical-align: top; }
table.timeline tr.lvl-down td:first-child { border-left: 3px solid var(--down); } table.timeline tr.lvl-warn td:first-child { border-left: 3px solid var(--warn); }
table.timeline tr.lvl-up td:first-child { border-left: 3px solid var(--up); }
table.patterns td.num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.chip.sev0, .chip.sev1, .chip.sev2 { background: var(--down-bg, var(--warn-bg)); color: var(--down); }
.chip.sev3 { color: var(--down); } .chip.sev4 { color: var(--warn); }
details.ai-answer.earlier summary { cursor: pointer; }
.insight-foot { margin-top: 1rem; }
details.port-mode { border-top: 1px solid var(--line); padding: .6rem 0; }
details.port-mode summary { cursor: pointer; }
table.port-rules td { vertical-align: top; }

/* Remote access */
.term-bar{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin:0 0 .4rem;flex-wrap:wrap}
.term-bar .term-actions{display:flex;gap:.35rem;flex-wrap:wrap}
body.popout .term-box{height:calc(100vh - 7.5rem);height:calc(100dvh - 7.5rem)}
.term-box{overflow:hidden}
.term-box:fullscreen{height:100%;width:100%;border-radius:0;border:0;padding:6px}
.term-box{height:calc(100vh - 230px);height:calc(100dvh - 230px);min-height:320px;background:#0b1016;padding:8px;border-radius:var(--r-btn);border:1px solid var(--line, #2a3440)}
.remote-req{padding:.6rem 0;border-top:1px solid var(--line, #e3e7ec)}
.remote-req:first-of-type{border-top:0}
.card.attention{border-left:4px solid var(--warn, #d98b00)}
pre.wrap{white-space:pre-wrap;word-break:break-all}
/* Forms laid out in one row on wide screens (collector tests). */
.row-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row-form label { flex: 1 1 12rem; }
.row-form .actions { flex: 0 0 auto; }
input.narrow { max-width: 9rem; }

/* Plain-language log search */
.log-search { flex-direction: column; align-items: stretch; }
.log-search .search-main { display: flex; gap: .5rem; min-width: 0; }
.log-search .search-main input { flex: 1; min-width: 0; width: auto; font-size: 1.05rem; }
.log-search .filter-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; min-width: 0; }
.log-search .filter-row select { flex: 1; min-width: min(9rem, 100%); width: auto; }
.log-search .more-filters { display: contents; }
.log-search .more-filters[open] summary { flex-basis: 100%; }
.log-search .understood { margin: 0; }
.log-search .search-help ul { margin: .4rem 0; }
.log-search .search-help li { margin: .2rem 0; }
.log-search code { font-size: .85em; }

/* People and access */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line, #ddd); }
.tabs a { padding: .45rem .8rem; border-radius: .4rem .4rem 0 0; text-decoration: none; color: inherit; }
.tabs a[aria-current="page"] { background: var(--surface-2, rgba(127,127,127,.12)); font-weight: 600; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: .75rem; }
.perm-area { border: 1px solid var(--line, #ddd); border-radius: .5rem; padding: .5rem .75rem; min-width: 0; margin: 0; }
.perm-area legend, .perm-area h4 { font-weight: 600; padding: 0 .25rem; margin: 0 0 .25rem; font-size: .95rem; }
.perm-area .check { display: block; margin: .3rem 0; }
.perm-area .check.sensitive { font-weight: 500; }
.perm-area .hint { display: block; margin-left: 1.6rem; }
.dir-tree { border: 1px solid var(--line, #ddd); border-radius: .5rem; padding: .5rem; max-height: 26rem; overflow: auto; min-width: 0; }
.dir-tree ul ul { margin-left: 1.1rem; border-left: 1px dashed var(--line, #ccc); padding-left: .5rem; }
.dir-node { padding: .15rem 0; min-width: 0; }
.dir-node .mono { overflow-wrap: anywhere; }
.dir-picked { margin: .5rem 0; }
.choice-list .check { display: block; margin: .4rem 0; }
.wrap-any { overflow-wrap: anywhere; word-break: break-all; }
.banner.ok { border-left: 4px solid var(--st-healthy, #2e7d32); }
@media print { .side, .top, .actions, .nav-toggle { display: none !important; } .work { margin: 0 !important; } .card { break-inside: avoid; } }
.table-scroll { overflow-x: auto; max-width: 100%; }
table.packets td { white-space: nowrap; }
table.packets tr.problem-row td { background: color-mix(in srgb, var(--st-critical, #c62828) 10%, transparent); }

/* Two columns that stack on narrow screens */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; align-items: start; }
.two-col h3 { margin-top: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; }
.choice { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.choice:hover { border-color: var(--current); }
.fwd-actions { align-items: center; gap: .6rem; flex-wrap: wrap; }
.fwd-actions select { width: auto; display: inline-block; }
.inline-label { display: inline-flex; align-items: center; gap: .4rem; }

/* Possible-vulnerability counts next to device names */
.vcount { display: inline-flex; align-items: center; gap: .2em; font-size: .72rem; font-weight: 700; line-height: 1; padding: .22em .5em;
  border-radius: 999px; text-decoration: none; vertical-align: middle; white-space: nowrap;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.vcount.critical, .vcount.high { background: var(--down-bg); color: var(--down); border-color: var(--down); }
.vcount:hover { text-decoration: underline; }
h1 .vcount { font-size: .8rem; }

/* Services and uptime targets */
.slo-budget { display: flex; align-items: center; gap: .5rem; min-width: 9rem; }
.slo-budget svg { width: 6rem; height: .5rem; border-radius: 3px; overflow: hidden; }
.slo-budget .track { fill: var(--unknown-bg); }
.slo-budget .fine { fill: var(--up-fill); } .slo-budget .low { fill: var(--warn-fill); } .slo-budget .gone { fill: var(--down-fill); }
.slo-chart { width: 100%; height: 8rem; display: block; }
.slo-chart rect.ok { fill: var(--up-fill); } .slo-chart rect.miss { fill: var(--down-fill); } .slo-chart rect.nodata { fill: var(--unknown-bg); }
.slo-chart line.target { stroke: var(--text, currentColor); stroke-dasharray: 4 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pick-list { max-height: 24rem; overflow: auto; border: 1px solid var(--line, #ccd); border-radius: 6px; padding: .5rem .75rem; }
.pick-group { padding: .35rem 0; border-bottom: 1px solid var(--line, #eee); }
.pick-group:last-child { border-bottom: 0; }

/* step-by-step forms */
.wizard-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: step; flex-wrap: wrap; }
.wizard-steps li { counter-increment: step; font-size: var(--fs-sm); color: var(--muted); padding: .25rem .7rem; border-radius: var(--r-pill); border: 1px solid var(--line); }
.wizard-steps li::before { content: counter(step) ". "; }
.wizard-steps li.current { color: var(--ink, inherit); border-color: var(--accent, currentColor); font-weight: 600; }
.wizard-steps li.done { color: var(--up); }

/* Insights notices */
.notices { list-style: none; margin: 0; padding: 0; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--info, #3B82F6); border-radius: 8px; padding: .8rem 1rem; margin: 0 0 .8rem; }
.notice.lvl-down { border-left-color: #EF4444; }
.notice.lvl-warn { border-left-color: #F59E0B; }
.notice p { margin: .4rem 0; }
.notice-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.mail-preview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 8px; background: #EEF2F6; }
pre.wrap { white-space: pre-wrap; }
.banner.info { background: var(--accent-soft); border-color: var(--accent); }
.info { color: var(--accent); background: var(--accent-soft); }
.net-if td { vertical-align: top; }
.net-if input, .net-if select { margin-bottom: .25rem; }
.net-if tr.new td { background: var(--accent-soft); }

/* Pop-up wizards (data-popup): the wizard opens over the page. */
dialog.popup-wizard { width: min(760px, 96vw); max-width: 96vw; max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); box-shadow: 0 24px 64px rgba(0,0,0,.35); overflow: hidden; }
dialog.popup-wizard[open] { display: flex; flex-direction: column; }
dialog.popup-wizard::backdrop { background: rgba(8, 20, 33, .6); }
.popup-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
.popup-head h2 { margin: 0; font-size: 1.15rem; }
.popup-body { overflow: auto; padding: 1rem 1.1rem 0; flex: 1; }
.popup-body form.in-popup { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
.popup-body form.in-popup .actions { position: sticky; bottom: 0; background: var(--panel); padding: .8rem 0 1rem; margin: 0; border-top: 1px solid var(--line); z-index: 1; }
.popup-body .wizard-steps { position: sticky; top: -1rem; background: var(--panel); padding: .5rem 0; margin-top: -.5rem; z-index: 1; }
.wizard-steps li[role=button] { cursor: pointer; }
.popup-body fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.popup-body legend { font-weight: 700; font-size: 1.05rem; margin-bottom: .5rem; }
button.secondary { background: var(--panel); color: var(--accent); border-color: var(--line); }
@media (max-width: 600px) { dialog.popup-wizard { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; } }
.form .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .4rem 1rem; align-items: start; }
dialog.popup-wizard { width: min(900px, 96vw); }
.popup-body { min-height: 0; }
.popup-body form[data-wizard] legend { display: none; }
.popup-body .wizard-steps { top: -1rem; }
.pick-list { display: grid; gap: .4rem; max-height: none; }
.pick { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .7rem; cursor: pointer; }
.pick > span { display: flex; flex-direction: column; gap: .15rem; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick.locked { opacity: .6; cursor: not-allowed; }
.row .grow { flex: 1; }
.popup-body form.in-popup { max-width: none; }
.popup-body form.in-popup[data-popup-title] > h2 { display: none; }
.popup-body form[data-popup-include] { margin: 0 0 1rem; }

/* Search results */
.search-hits { list-style: none; margin: 0; padding: 0; }
.search-hits li { padding: .35rem 0; border-top: 1px solid var(--line, #e5e7eb); overflow-wrap: anywhere; }
.search-hits li:first-child { border-top: 0; }
.search-summary .actions { flex-wrap: wrap; }
.warn-text { color: var(--warn, #b45309); }
.indent { margin-left: 1.6rem; }

/* Customer switcher (MSP) */
.tenant-menu > summary.tenant-chip { display: inline-block; }
.tenant-menu > summary::after { content: ""; }
.tenant-pick { min-width: 300px; max-height: 70vh; overflow: auto; gap: .35rem; }
.tenant-pick .tenant-q { width: 100%; }
.tenant-list { display: grid; }
.tenant-list button { text-align: left; background: none; border: 0; padding: .45rem .6rem; border-radius: var(--r-sm); color: var(--text); cursor: pointer; font: inherit; }
.tenant-list button:hover, .tenant-list button.hit { background: var(--bg); }
.tenant-list button[disabled] { color: var(--muted); cursor: default; }
.tenant-list .here { font-weight: 600; color: var(--accent); }
.menu-items.right { left: auto; right: 0; }
@media (max-width: 960px) { .tenant-menu .tenant-chip { display: inline-block; } }

/* Compliance: screenshots saved as evidence */
.evidence-shot { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }
/* Network Pro: rows that need a look (DHCP lease problems, capacity) */
table tr.warn-row td { background: var(--warn-bg); }

/* Forms that hold a table (network interfaces, routes, scopes) use the full
   width, and the table scrolls sideways instead of squeezing its fields. */
.form:has(table) { max-width: none; }
div.table { overflow-x: auto; max-width: 100%; }
.net-if { min-width: 1080px; }
.net-if input:not([type=checkbox]), .net-if select { width: 100%; min-width: 9rem; box-sizing: border-box; }
.net-if input.short { min-width: 7.5rem; max-width: none; }
.net-if td:first-child { min-width: 12rem; }
.net-if td:nth-child(2), .net-if td:nth-child(4), .net-if td:last-child { min-width: 13rem; }
/* Side-by-side comparison (flows, logs): one column per device, rows line up. */
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; align-items: start; }
.compare-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compare-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compare-col { min-width: 0; }
.compare-col + .compare-col { border-left: 1px solid var(--line); padding-left: 1.25rem; }
.compare-col h3 { margin: 0 0 6px; }
.compare-col figure.chart { margin: 0; }
@media (max-width: 900px) {
  .compare-grid { grid-template-columns: minmax(0, 1fr); }
  .compare-col + .compare-col { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
}
.flow-picker summary { cursor: pointer; }
.flow-picker-list { max-height: 320px; overflow: auto; margin-top: 8px; }
.picker-table { max-height: 360px; overflow: auto; margin: 6px 0 12px; }
.status-public h2.status-group { font-size: 1rem; margin: 18px 0 6px; color: var(--muted); }

/* Path tests */
.path-chart { width: 100%; max-width: 900px; height: auto; }
.path-chart .lbl, .path-chart .val { font-size: 11px; fill: var(--text); }
.path-chart .val.loss { fill: var(--down, #b42318); }
.path-chart .bar { fill: #3b82f6; }
.path-chart .bar.seg-lan { fill: #16a34a; }
.path-chart .bar.seg-wan { fill: #9333ea; }
.path-chart .bar.seg-carrier { fill: #ea580c; }
.path-chart .bar.seg-dest { fill: #0f766e; }
.path-chart .range { stroke: var(--text); stroke-width: 1.5; }
.path-chart a:hover .bar { opacity: .75; }
.path-segments { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: .75rem 0 0; }
.path-segments li { padding: .25rem .6rem; border-radius: var(--r-pill); border: 1px solid var(--line); border-left-width: 4px; }
.path-segments .seg-lan { border-left-color: #16a34a; }
.path-segments .seg-wan { border-left-color: #9333ea; }
.path-segments .seg-carrier { border-left-color: #ea580c; }
.path-segments .seg-internet { border-left-color: #3b82f6; }
.path-segments .seg-dest { border-left-color: #0f766e; }
tr:target { background: var(--hl, rgba(59,130,246,.12)); }

/* Checklists (certificate troubleshooting) */
.checklist { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.checklist li { padding: .35rem .5rem; border-left: 3px solid var(--line); margin-bottom: .3rem; }
.checklist li.ok { border-left-color: #16a34a; }
.checklist li.bad { border-left-color: #dc2626; }
.checklist li.info { border-left-color: #3b82f6; }
.quick-links h3 { font-size: var(--fs-sm); margin: .75rem 0 .25rem; }
.quick-links h3:first-of-type { margin-top: 0; }
.desk-sources pre { max-height: 12rem; overflow: auto; margin: .25rem 0 0; background: var(--subtle, rgba(0,0,0,.03)); padding: .4rem .5rem; border-radius: 6px; }

/* Table filter box and sortable headings (app.js) */
.table-filter { max-width: 320px; margin: 0 .5rem .6rem 0; }
.table-count { margin-left: .25rem; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sortable:focus-visible { text-decoration: underline; }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: .7em; }
th[aria-sort="descending"]::after { content: " ▼"; font-size: .7em; }

/* Packet investigation */
.pre-wrap { white-space: pre-wrap; }
ul.tree { list-style: none; padding-left: 0; font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--fs-sm); }
ul.tree ul { list-style: none; padding-left: 1.4rem; border-left: 1px solid var(--line); margin: .2rem 0 .4rem .3rem; }

/* What's new */
.release-head h2 { margin: .2rem 0 .3rem; }
.release-version { margin: 0; }
.release-area h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1rem 0 .3rem; }
.release-area ul { margin: 0; padding-left: 1.2rem; }
.release-area li { margin: .25rem 0; }
.release-current { border-left: 3px solid var(--accent); }
.whats-new-coming { background: var(--accent-soft); }
.card .release + .release { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .5rem; }

/* Port map */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1rem; align-items: start; }
@media (max-width: 1150px) { .pm-layout { grid-template-columns: 1fr; } }
.pm-panel { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.pm-panel h2 { margin: 0; font-size: var(--fs-lg); }
.pm-panel h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1.2rem 0 .4rem; }
.pm-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.pm-panel-head p { margin: .15rem 0 0; }
.pm-empty { text-align: center; padding: 2.5rem 1rem; }
.pm-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; margin: .5rem 0; }
.pm-facts dt { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pm-facts dd { margin: .15rem 0 0; }
.pm-summary { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.pm-sum { display: flex; align-items: baseline; gap: .4rem; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
.pm-sum .v { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.pm-sum .l { color: var(--muted); font-size: var(--fs-sm); }
.pm-sum-warn { border-color: var(--warn); background: var(--warn-bg); }
.pm-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.pm-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--panel); color: var(--text); font-size: var(--fs-sm); cursor: pointer; }
.pm-chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
.pm-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pm-chip[aria-pressed="true"] span { color: var(--accent); }
.portmap { display: grid; gap: 1.2rem; }
.pm-group-name { margin: 0 0 .4rem; color: var(--muted); font-size: var(--fs-sm); font-family: var(--font-mono); }
.pm-faceplate { display: flex; flex-wrap: wrap; gap: 1.1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg), var(--panel)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .04); overflow-x: auto; }
.pm-block { display: flex; gap: .55rem; }
.pm-block.pm-two { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); gap: .55rem; }
.pm-port { position: relative; display: flex; align-items: center; justify-content: center; width: 2.9rem; height: 2.9rem; border-radius: 7px;
  border: 2px solid var(--line); background: var(--panel); color: var(--muted); text-decoration: none; transition: transform .08s, box-shadow .08s; }
.pm-port:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgb(0 0 0 / .12); color: var(--text); }
.pm-port:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pm-num { font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pm-port.pt-up { border-color: var(--up); background: var(--up-bg); color: var(--up); }
.pm-port.pt-down { border-style: dashed; }
.pm-port.pt-off { background: repeating-linear-gradient(135deg, var(--unknown-bg) 0 5px, var(--panel) 5px 10px); border-color: var(--unknown); }
.pm-port.pt-problem { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.pm-port.pm-selected { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 4px 12px rgb(0 0 0 / .18); transform: translateY(-1px); }
.pm-port.pm-dim { opacity: .18; }
.pm-role { position: absolute; top: -.45rem; right: -.45rem; min-width: 1.05rem; height: 1.05rem; padding: 0 .2rem; border-radius: var(--r-pill);
  font-size: .62rem; font-weight: 700; line-height: 1.05rem; text-align: center; background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.pm-role-host { background: var(--panel); color: var(--muted); border-color: var(--line); font-weight: 600; }
.pm-role-uplink { background: var(--text); color: var(--panel); border-color: var(--text); }
.pm-role-server { background: var(--unknown-bg); color: var(--text); }
.pm-poe { position: absolute; bottom: .2rem; left: .25rem; font-size: .6rem; line-height: 1; }
.pm-link { position: absolute; top: .25rem; left: .25rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
.pm-bar { position: absolute; left: .3rem; right: .3rem; bottom: .2rem; height: 3px; border-radius: 2px; background: rgb(0 0 0 / .08); overflow: hidden; }
.pm-poe ~ .pm-bar { left: .9rem; }
.pm-qos { position: absolute; bottom: .15rem; right: .25rem; font-size: .55rem; font-weight: 700; line-height: 1; color: var(--muted); }
.pm-qos.pm-qos-drop { color: var(--warn); }
.pm-qos ~ .pm-bar { right: .9rem; }
.pm-legend .pm-qos { position: static; font-size: .7rem; }
.pm-fill { display: block; height: 100%; background: var(--accent); width: 0; }
.pm-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; list-style: none; padding: .8rem 0 0; margin: 1rem 0 0; border-top: 1px solid var(--line);
  color: var(--muted); font-size: var(--fs-xs); }
.pm-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.pm-legend .pm-role { position: static; }
.pm-legend .pm-link-key { position: static; display: inline-block; }
.pm-legend .pm-bar-key { position: static; display: inline-block; width: 1.4rem; }
.pm-key { display: inline-block; width: .85rem; height: .85rem; border-radius: 3px; border: 2px solid var(--line); background: var(--panel); }
.pm-key.pt-up { border-color: var(--up); background: var(--up-bg); }
.pm-key.pt-down { border-style: dashed; }
.pm-key.pt-off { border-color: var(--unknown); background: var(--unknown-bg); }
.pm-key.pt-problem { border-color: var(--warn); background: var(--warn-bg); }
.pm-fill-0 { width: 0%; }
.pm-fill-10 { width: 10%; }
.pm-fill-20 { width: 20%; }
.pm-fill-30 { width: 30%; }
.pm-fill-40 { width: 40%; }
.pm-fill-50 { width: 50%; }
.pm-fill-60 { width: 60%; }
.pm-fill-70 { width: 70%; }
.pm-fill-80 { width: 80%; }
.pm-fill-90 { width: 90%; }
.pm-fill-100 { width: 100%; }
.pm-fill-90, .pm-fill-100 { background: var(--down); }
.pm-fill-80 { background: var(--warn); }


/* sites and collectors */
details.site-card { padding: 0; }
details.site-card > summary.site-sum { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; }
details.site-card > summary.site-sum::-webkit-details-marker { display: none; }
details.site-card > summary.site-sum::before { content: "▸"; color: var(--muted); margin-right: .2rem; }
details.site-card[open] > summary.site-sum::before { content: "▾"; }
details.site-card > summary .site-name { font-size: var(--fs-lg); font-weight: 600; margin-right: auto; }
details.site-card > summary .site-facts { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-sm); }
details.site-card[open] > summary.site-sum { border-bottom: 1px solid var(--line); }
details.site-card > :not(summary) { margin-left: 1.2rem; margin-right: 1.2rem; }
details.site-card > :last-child { margin-bottom: 1rem; }
.site-actions { margin-top: .7rem; }
details.site-section { border-top: 1px solid var(--line); padding: .6rem 0; margin-top: .7rem; }
details.site-section > summary { cursor: pointer; font-weight: 600; }
details.site-section[open] > summary { margin-bottom: .5rem; }
.pill.accent { color: var(--accent); background: var(--accent-soft); }
.pill.small { min-width: 0; padding: 0 .45rem; }
details.row-menu { display: inline-block; }
details.row-menu > summary { cursor: pointer; color: var(--accent); list-style: none; }
details.row-menu > summary::-webkit-details-marker { display: none; }
details.row-menu > summary::after { content: " ▾"; color: var(--muted); }
.row-menu-body { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; margin-top: .4rem; padding: .6rem .8rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.row-menu-body form { margin: 0; }
.row-menu-body.ports-body { text-align: left; }
.row-menu-body.ports-body fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .2rem; }
table.receive-table td, table.receive-table th { vertical-align: middle; }
table.receive-table td:nth-child(n+2):not(:nth-last-child(-n+2)) { text-align: center; }
.field-error, [aria-invalid="true"] { border-color: var(--down) !important; box-shadow: 0 0 0 2px var(--down-bg); }

.pm-bulk > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-lg); }
.pm-bulk[open] > summary { margin-bottom: .6rem; }

/* ---- Navigation: menu sections, page finder, related links, phone tab bar ---- */
/* Sections inside a menu group: a heading that opens and closes its pages. */
.side-sec { margin: .1rem 0; }
.side-sec > summary.side-sub { list-style: none; display: flex; align-items: center; gap: .4rem; cursor: pointer; margin: .3rem .3rem .1rem 1.9rem;
  padding: .32rem .5rem .32rem .6rem; border-radius: var(--r-sm); border-left: 2px solid var(--line);
  font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--text); font-weight: 700; }
.side-sec > summary.side-sub::-webkit-details-marker { display: none; }
.side-sec > summary.side-sub::before { content: "▸"; font-size: .75em; color: var(--muted); transition: transform .15s; }
.side-sec[open] > summary.side-sub::before { transform: rotate(90deg); }
.side-sec > summary.side-sub:hover { background: var(--bg); border-left-color: var(--accent); }
.side-sec[data-current] > summary.side-sub { border-left-color: var(--accent); color: var(--accent); }
.side-sec-n { margin-left: auto; font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; letter-spacing: 0; }
.side-sec > div { display: grid; gap: 1px; margin: 0 0 .2rem; }
.side-sec > div a { padding: .34rem .7rem .34rem 2.95rem; font-size: var(--fs-sm); }
@media (prefers-reduced-motion: reduce) { .side-sec > summary.side-sub::before { transition: none; } }
.search { position: relative; }
.finder { position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); z-index: 70; margin: 0; padding: .3rem; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 10px 30px rgb(0 0 0 / .14); max-height: 70vh; overflow-y: auto; }
.finder li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .5rem .7rem; border-radius: var(--r-sm);
  color: var(--text); cursor: pointer; font-size: var(--fs-sm); }
.finder li .where { color: var(--muted); font-size: var(--fs-2xs); white-space: nowrap; }
.finder li[aria-selected="true"], .finder li:hover { background: var(--accent-soft); color: var(--accent); }
.finder li.finder-all { border-top: 1px solid var(--line); margin-top: .2rem; color: var(--muted); }
.finder li.finder-head { cursor: default; color: var(--muted); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .08em; padding: .35rem .7rem .15rem; }
.finder li.finder-head:hover { background: none; color: var(--muted); }
.related { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 1rem; font-size: var(--fs-sm); }
.related-label { color: var(--muted); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-right: .2rem; }
.related a { padding: .2rem .65rem; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--panel); color: var(--text); text-decoration: none; white-space: nowrap; }
.related a:hover { border-color: var(--accent); color: var(--accent); }
.tabbar { display: none; }
@media (max-width: 640px) {
  .related { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; -webkit-overflow-scrolling: touch; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--panel); border-top: 1px solid var(--line);
    padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem 0; border: 0; background: none;
    color: var(--muted); font: inherit; font-size: var(--fs-2xs); text-decoration: none; position: relative; cursor: pointer; }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar [aria-current] { color: var(--accent); font-weight: 600; }
  .tab-count { position: absolute; top: .1rem; left: 55%; background: var(--down); color: var(--white); border-radius: var(--r-pill); font-size: .6rem; line-height: 1rem; min-width: 1rem; padding: 0 .25rem; }
  main { padding-bottom: 5rem; }
  .top .search { max-width: none; }
  .sticky-save { bottom: calc(3.6rem + env(safe-area-inset-bottom)); }
  .top .bell, .top .theme-switch { display: none; } /* Alerts is in the tab bar; the theme is under My settings */
  .finder { position: fixed; left: .5rem; right: .5rem; top: 3.4rem; max-height: calc(100vh - 9rem); }
  .side nav a, .side-group > summary { padding: .65rem .7rem; }
  .side-group > div a { padding: .55rem .7rem .55rem 2.55rem; }
}
@media print { .tabbar, .related { display: none !important; } }

/* ---- Command window and windows opened on their own ---- */
body.popout main { padding: 1rem 1.25rem; max-width: none; }
.console-out { background: #0b1729; color: #d7e3f0; border-radius: var(--r-md); padding: .9rem 1rem; min-height: 18rem; max-height: 60vh; overflow: auto;
  font-size: var(--fs-sm); line-height: 1.45; white-space: pre-wrap; margin: 0 0 .75rem; }
body.popout .console-out { max-height: calc(100vh - 16rem); }
.console-out .cmd { color: #7dd3c0; }
.console-out .err { color: #fca5a5; }
.console-in { display: flex; gap: .5rem; align-items: center; }
.console-prompt { flex: 1; display: flex; align-items: center; gap: .5rem; margin: 0; }
.console-prompt span { font-family: var(--font-mono, monospace); color: var(--muted); }
.console-prompt input { flex: 1; }
.console-quick { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 0; }
.console-quick .chip { cursor: pointer; font-family: var(--font-mono, monospace); }

/* ---- Device tabs, pins ---- */
.device-tabs { margin: 0 0 .75rem; flex: none; border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.side nav a.pinned .ico { color: var(--warn); }
.pin-form { margin: 0 0 0 auto; }
.pin-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--panel); color: var(--muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.pin-btn .ico { width: 14px; height: 14px; }
.pin-btn:hover { border-color: var(--accent); color: var(--accent); }
.pin-btn.on { color: var(--warn); border-color: var(--warn); }
@media (max-width: 640px) {
  .device-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .device-tabs a { white-space: nowrap; }
}

/* Requests waiting for this person's approval: top of every page, and a
   box that pops up when a new one arrives (asks.go, app.js). */
.asks { background: var(--warn-bg); border: 1px solid var(--warn); border-left-width: 4px; border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; }
.asks h2 { font-size: 1.05rem; margin: 0 0 .4rem; display: flex; align-items: center; gap: .4rem; }
.asks .ask, dialog.asks-dialog .ask { padding: .55rem 0; border-top: 1px solid var(--line); }
.asks .ask:first-of-type, dialog.asks-dialog .ask:first-of-type { border-top: 0; }
.asks .ask p, dialog.asks-dialog .ask p { margin: 0 0 .35rem; overflow-wrap: anywhere; }
.asks .actions, dialog.asks-dialog .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
dialog.asks-dialog { width: min(620px, 94vw); max-height: 90vh; overflow: auto; border: 1px solid var(--warn); border-top-width: 4px; border-radius: var(--radius);
  background: var(--panel); color: var(--text); padding: 1rem 1.2rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.asks-dialog::backdrop { background: rgba(8, 20, 33, .6); }
dialog.asks-dialog h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
dialog.asks-dialog .asks-later { margin-top: .6rem; }

/* Drop-down sections: a card whose heading line opens and closes it. The
   summary line keeps counts and red/yellow chips visible when closed. */
details.fold { padding: 0; }
details.fold > summary { list-style: none; display: flex; align-items: center; gap: .5rem .75rem; flex-wrap: wrap; padding: .85rem 1.25rem; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--muted); width: .8rem; flex: none; }
details.fold[open] > summary::before { content: "▾"; }
details.fold > summary h2 { margin: 0; font-size: var(--fs-lg, 1.1rem); }
details.fold > summary .fold-facts { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-sm); }
details.fold > summary .fold-end { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
details.fold > .fold-body { padding: .9rem 1.25rem 1.1rem; }
details.fold > .fold-body > :last-child { margin-bottom: 0; }
.card.danger { border-left: 4px solid var(--down); color: inherit; }
@media print { details.fold > summary::before { content: none; } .page-tools { display: none; } }
.page-tools { display: flex; gap: .4rem; justify-content: flex-end; margin: -.4rem 0 .6rem; }
.page-tools button { font-size: var(--fs-sm); }
/* A filter bar above a list: drop-downs and a search box on one line. */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .7rem; }
.filter-bar select, .filter-bar input[type=search] { width: auto; min-width: 9rem; margin: 0; }
.filter-bar input[type=search] { flex: 1 1 14rem; max-width: 22rem; }
/* Long text clipped to two lines; a click shows it all. */
.clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.clamp.clamp-open { display: block; -webkit-line-clamp: unset; overflow: visible; cursor: auto; }
.show-all { margin-top: .5rem; }

/* Traffic flows: headline numbers, application mix, ranked lists */
:root { --mix-1: #2a78d6; --mix-2: #14a38b; --mix-3: #eb6834; --mix-4: #8b5cf6; --mix-5: #d9a514; --mix-6: #9aa6b2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mix-1: #3987e5; --mix-2: #22b8a0; --mix-3: #e0743f; --mix-4: #9d75f7; --mix-5: #e3b42c; --mix-6: #6b7785; } }
:root[data-theme="dark"] { --mix-1: #3987e5; --mix-2: #22b8a0; --mix-3: #e0743f; --mix-4: #9d75f7; --mix-5: #e3b42c; --mix-6: #6b7785; }
.chart-svg .area { fill: url(#area-fill); stroke: none; }
.chart-svg .area-top { stop-color: var(--series-1); stop-opacity: .24; }
.chart-svg .area-bottom { stop-color: var(--series-1); stop-opacity: .02; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart-svg .area-top { stop-opacity: .38; } }
:root[data-theme="dark"] .chart-svg .area-top { stop-opacity: .38; }
.flow-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin: .75rem 0 1rem; }
.flow-kpi { border: 1px solid var(--line); border-radius: var(--r-md); padding: .65rem .85rem; background: var(--bg); display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.flow-kpi .k { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.flow-kpi .v { font-size: 1.35rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-kpi .s { font-size: var(--fs-xs); color: var(--muted); }
.flow-mix { margin: .9rem 0 .25rem; }
svg.flow-mix-bar { display: block; width: 100%; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); }
svg.flow-mix-bar .m1 { fill: var(--mix-1); } svg.flow-mix-bar .m2 { fill: var(--mix-2); } svg.flow-mix-bar .m3 { fill: var(--mix-3); }
svg.flow-mix-bar .m4 { fill: var(--mix-4); } svg.flow-mix-bar .m5 { fill: var(--mix-5); } svg.flow-mix-bar .m6 { fill: var(--mix-6); }
.flow-mix-keys { list-style: none; margin: .55rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: var(--fs-xs); }
.flow-mix-keys li { display: flex; align-items: center; gap: .35rem; }
.flow-mix-keys .sw { width: 10px; height: 10px; border-radius: 3px; }
.m1 { background: var(--mix-1); } .m2 { background: var(--mix-2); } .m3 { background: var(--mix-3); }
.m4 { background: var(--mix-4); } .m5 { background: var(--mix-5); } .m6 { background: var(--mix-6); }
table.flow-lines { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--fs-sm); }
table.flow-lines th { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .35rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
table.flow-lines td { padding: .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.flow-lines tr:last-child td { border-bottom: 0; }
table.flow-lines tbody tr:hover td { background: var(--accent-soft); }
table.flow-lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; width: 5.5rem; }
table.flow-lines th:nth-child(3), table.flow-lines td:nth-child(3) { width: 3.5rem; }
table.flow-lines .bar-col { width: 22%; }
table.flow-lines .flow-name { overflow: hidden; }
table.flow-lines .flow-name .n { display: block; font-weight: 500; }
.flow-cols > div:first-child .bar-col { display: none; } /* the mix bar above already shows each application's share */
table.flow-lines .flow-name .sub { display: block; font-size: var(--fs-2xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.flow-meter { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; }
svg.flow-meter .track { fill: var(--line); } svg.flow-meter .fill { fill: var(--series-1); }
@media (max-width: 640px) { table.flow-lines .bar-col, table.flow-lines th:nth-child(5), table.flow-lines td:nth-child(5) { display: none; } }

/* Connect an AI: setup steps for the provider that's picked */
.ai-howto { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r-md); background: var(--bg); padding: .8rem 1rem .6rem; }
.ai-howto h3 { margin: 0 0 .4rem; font-size: var(--fs-md); }
.ai-howto ol { margin: 0 0 .4rem; padding-left: 1.3rem; display: grid; gap: .35rem; font-size: var(--fs-sm); }
.ai-howto code { font-size: .92em; }

/* Connect an AI: the two choices and the setup steps */
.ai-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 0 0 .75rem; }
.ai-choice { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.ai-choice:hover { border-color: var(--accent); }
.ai-choice span { color: var(--muted); font-size: var(--fs-sm); }
.ai-choice .ai-state { margin-top: auto; align-self: flex-start; padding: .1rem .55rem; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 600; }
.ai-choice .ai-state.on { border-color: var(--up); color: var(--up); }
.ai-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .6rem; }
.ai-opt { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; font-weight: 400; }
.ai-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ai-opt input { margin-top: .2rem; }
.ai-opt span { display: grid; gap: .2rem; }
.ai-opt small { color: var(--muted); font-size: var(--fs-sm); }
/* Only the picked service's steps and fields show (browsers without :has() show them all). */
@supports selector(:has(*)) {
  .ai-wizard [data-show] { display: none; }
  .ai-wizard:has(input[name="provider"][value="off"]:checked) [data-show~="off"],
  .ai-wizard:has(input[name="provider"][value="local"]:checked) [data-show~="local"],
  .ai-wizard:has(input[name="provider"][value="openai"]:checked) [data-show~="openai"],
  .ai-wizard:has(input[name="provider"][value="anthropic"]:checked) [data-show~="anthropic"],
  .ai-wizard:has(input[name="provider"][value="azure"]:checked) [data-show~="azure"],
  .ai-wizard:has(input[name="provider"][value="gemini"]:checked) [data-show~="gemini"] { display: revert; }
  .ai-wizard:has(input[name="provider"][value="local"]:checked) label[data-show~="local"],
  .ai-wizard:has(input[name="provider"][value="openai"]:checked) label[data-show~="openai"],
  .ai-wizard:has(input[name="provider"][value="anthropic"]:checked) label[data-show~="anthropic"],
  .ai-wizard:has(input[name="provider"][value="azure"]:checked) label[data-show~="azure"],
  .ai-wizard:has(input[name="provider"][value="gemini"]:checked) label[data-show~="gemini"] { display: grid; }
  .ai-wizard label.check[data-show] { display: none; }
  .ai-wizard:has(input[name="provider"]:not([value="off"]):checked) label.check[data-show] { display: flex; }
}
