:root {
  --ink: #0b2230;
  --sea: #0e3b52;
  --sea-line: #1d5873;
  --fibre: #45c4d6;
  --teal: #0b7a8f;
  --teal-strong: #095f70;
  --paper: #f3f6f8;
  --surface: #ffffff;
  --line: #d3dde3;
  --text: #13232d;
  --muted: #566a76;
  --ok: #13804a;
  --warn: #8f5f00;
  --bad: #b3261e;
  --bad-bg: #fbeceb;
  --focus: #0b7a8f;
  --in: #0b7a8f;
  --out: #b45f00;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1a22;
    --surface: #132430;
    --line: #26404f;
    --text: #e4edf1;
    --muted: #93a8b4;
    --teal: #45c4d6;
    --teal-strong: #7ad8e6;
    --ok: #4cc58a;
    --warn: #e0a93a;
    --bad: #ff8b82;
    --bad-bg: #3a1a1a;
    --focus: #7ad8e6;
    --in: #45c4d6;
    --out: #f0b45a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--paper); }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.35rem; padding: 0.4rem 0.95rem; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); font-weight: 560;
}
.btn:hover { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-strong); border-color: var(--teal-strong); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 1.95rem; padding: 0.15rem 0.65rem; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #06222b; } }

.field { display: grid; gap: 0.3rem; margin-bottom: 1rem; align-content: start; }
.field label { font-weight: 560; font-size: 0.92rem; }
.field input, .field select {
  min-height: 2.5rem; padding: 0.4rem 0.7rem; border-radius: 4px;
  border: 1px solid var(--line); background: var(--surface); width: 100%;
}
.field .hint { font-size: 0.85rem; color: var(--muted); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.error { color: var(--bad); background: var(--bad-bg); border-left: 3px solid var(--bad); padding: 0.55rem 0.75rem; margin-bottom: 1rem; border-radius: 0 4px 4px 0; }
.error:empty { display: none; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art { background: var(--sea); color: #e4f3f7; padding: 3rem 3rem 2rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -0.01em; max-width: 14ch; }
.login-art p { color: #a9cdd8; margin-top: 0.6rem; max-width: 34ch; }
.login-art svg { position: absolute; inset: auto 0 0 0; width: 100%; height: 62%; }
.login-art .path { fill: none; stroke: var(--fibre); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.login-art .path.faint { stroke: var(--sea-line); stroke-width: 2; }
.login-art .node { fill: var(--sea); stroke: var(--fibre); stroke-width: 2.5; }
.login-art .label { fill: #8fc4d2; font: 12px var(--mono); }
.login-art .tick { fill: #3ecf8e; }
.login-art .unk { fill: #f0b429; }
.login-form-wrap { display: grid; place-items: center; padding: 2rem; }
.login-form { width: min(380px, 100%); }
.login-form h2 { font-size: 1.4rem; margin-bottom: 0.3rem; }
.login-form .sub { color: var(--muted); margin-bottom: 1.6rem; }
@media (max-width: 800px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 1.6rem; min-height: 200px; }
  .login-art svg { display: none; }
}

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side { background: var(--sea); color: #d7ebf1; display: flex; flex-direction: column; padding: 1.1rem 0.8rem; gap: 1.2rem; }
.brand { padding: 0 0.5rem; }
.brand b { display: block; font-size: 1.2rem; letter-spacing: 0.01em; color: #fff; }
.brand span { font-size: 0.85rem; color: #9bc3d0; overflow-wrap: anywhere; }
.nav { display: grid; gap: 0.2rem; }
.nav a { color: inherit; text-decoration: none; padding: 0.5rem 0.7rem; border-radius: 4px; border-left: 3px solid transparent; }
.nav a:hover { background: var(--sea-line); }
.nav a[aria-current="page"] { background: var(--sea-line); border-left-color: var(--fibre); color: #fff; font-weight: 600; }
.side .who { margin-top: auto; padding: 0.7rem 0.5rem 0; border-top: 1px solid var(--sea-line); font-size: 0.88rem; }
.side .who .btn { margin-top: 0.6rem; background: transparent; color: #d7ebf1; border-color: var(--sea-line); width: 100%; }
.side .who .btn:hover { border-color: var(--fibre); }
.side .who .muted { color: #9bc3d0; }
.main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 3rem; max-width: 1180px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-head p { color: var(--muted); margin-top: 0.2rem; }
@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand who" "nav nav"; align-items: center; gap: 0.5rem 0.8rem; padding: 0.7rem 0.9rem; }
  .brand { grid-area: brand; padding: 0; display: flex; gap: 0.6rem; align-items: baseline; }
  .side .who { grid-area: who; margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 0.6rem; }
  .side .who > div .muted { display: none; }
  .side .who .btn { width: auto; margin: 0; }
  .nav { grid-area: nav; display: flex; gap: 0.2rem; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .main { padding-top: 1.1rem; }
}

/* ---------- tables ---------- */
td select { min-height: 2rem; padding: 0.15rem 0.5rem; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--surface) 92%, var(--line)); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 0.35rem; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* status: a shape plus a word, never colour alone */
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 560; }
.status::before { content: ""; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--ok); }
.status.off { color: var(--warn); }
.status.off::before { background: var(--warn); border-radius: 2px; }

/* ---------- dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: 6px; padding: 0; width: min(520px, calc(100vw - 2rem)); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(6, 22, 31, 0.55); }
.dlg-head { padding: 1rem 1.2rem 0.4rem; }
.dlg-body { padding: 0.6rem 1.2rem 1.2rem; }
.dlg-body .row.end { margin-top: 0.4rem; }
.dlg-body p + p, .dlg-body .secret + p { margin-top: 0.5rem; }
.secret { display: flex; gap: 0.6rem; align-items: center; justify-content: space-between; background: var(--paper); border: 1px dashed var(--teal); border-radius: 4px; padding: 0.7rem 0.9rem; margin: 0.8rem 0; }
.secret .mono { font-size: 1.2rem; letter-spacing: 0.04em; user-select: all; }
fieldset { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 1rem; padding: 0.7rem 0.9rem 0.2rem; }
legend { padding: 0 0.3rem; font-weight: 560; font-size: 0.92rem; }
.choice { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.7rem; }

/* ---------- overview ---------- */
.roles { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); max-width: 760px; }
.roles > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.roles > div:last-child { border-bottom: 0; }
.roles > div.you { border-left: 3px solid var(--teal); background: color-mix(in srgb, var(--surface) 94%, var(--teal)); }
.note { margin-top: 1.4rem; color: var(--muted); max-width: 62ch; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: border-color 0.12s, background-color 0.12s; }
}

/* ---------- device & link state: a shape plus a word, never colour alone ---------- */
.state { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 560; white-space: nowrap; }
.state::before { content: ""; width: 0.65rem; height: 0.65rem; background: var(--muted); }
.state.up { color: var(--ok); }
.state.up::before { background: var(--ok); border-radius: 50%; }
.state.down { color: var(--bad); }
.state.down::before { background: var(--bad); transform: rotate(45deg) scale(0.9); }
.state.unknown { color: var(--muted); }
.state.unknown::before { border-radius: 2px; }

a.strong { font-weight: 650; color: var(--teal-strong); text-decoration: none; }
a.strong:hover { text-decoration: underline; }
a.btn { text-decoration: none; margin-top: 0.8rem; }
.small { font-size: 0.85rem; }
.notice { border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--surface) 90%, var(--warn)); padding: 0.65rem 0.9rem; margin-bottom: 1rem; border-radius: 0 4px 4px 0; max-width: 70ch; }
h2.section { margin: 2rem 0 0.8rem; }

/* ---------- device page ---------- */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin: 0 0 0.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.meta > div { padding: 0.7rem 0.95rem; border-right: 1px solid var(--line); min-width: 0; }
.meta > div:last-child { border-right: 0; }
.meta dt { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.15rem; }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.picker-tools { margin-bottom: 0.7rem; }
.picker-tools input[type="search"] { min-height: 2.2rem; padding: 0.3rem 0.65rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); min-width: 15rem; }
.picker-tools .choice { margin: 0; }
.table-wrap.picker { max-height: 26rem; overflow: auto; }
.table-wrap.picker th { position: sticky; top: 0; z-index: 1; }
.table-wrap.picker table { min-width: 560px; }
.adv { margin: 0 0 1rem; }
.adv summary { cursor: pointer; font-weight: 560; margin-bottom: 0.7rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 0.8rem; align-items: start; }
.test-result { padding: 0.65rem 0.85rem; border-radius: 4px; margin-bottom: 1rem; border-left: 3px solid var(--muted); background: var(--paper); }
.test-result[hidden] { display: none; }
.test-result.ok { border-left-color: var(--ok); }
.test-result.bad { border-left-color: var(--bad); background: var(--bad-bg); }

/* ---------- graphs ---------- */
.graph-list { display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1320px) { .graph-list.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.graph-card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0.9rem 1rem 1rem; min-width: 0; }
.graph-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.graph-body { min-height: 12rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg-btn { background: transparent; border: 0; border-right: 1px solid var(--line); padding: 0.28rem 0.8rem; cursor: pointer; min-height: 1.9rem; }
.seg-btn:last-child { border-right: 0; }
.seg-btn[aria-pressed="true"] { background: var(--teal); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg-btn[aria-pressed="true"] { color: #06222b; } }
.legend { display: flex; gap: 1.1rem; margin-bottom: 0.2rem; font-size: 0.88rem; }
.key::before { content: ""; display: inline-block; width: 1.4rem; height: 0.22rem; margin-right: 0.4rem; vertical-align: middle; border-radius: 2px; }
.key.in::before { background: var(--in); }
.key.out::before { background: var(--out); }
.chart { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 11px var(--font); }
.chart .line { fill: none; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.in, .chart .dot.in { stroke: var(--in); }
.chart .line.out, .chart .dot.out { stroke: var(--out); }
.chart .area { stroke: none; opacity: 0.13; }
.chart .area.in { fill: var(--in); }
.chart .area.out { fill: var(--out); }
.chart .dot { fill: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; top: 0.2rem; transform: translateX(-50%); background: var(--ink); color: #eaf5f8; padding: 0.4rem 0.6rem; border-radius: 4px; font-size: 0.85rem; pointer-events: none; white-space: nowrap; z-index: 2; }
.chart-tip[hidden] { display: none; }
.tip-time { color: #9bc3d0; margin-bottom: 0.15rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.8rem; margin-top: 0.7rem; }
.stat { padding: 0.55rem 0.8rem; border-left: 4px solid var(--line); background: var(--paper); border-radius: 0 4px 4px 0; }
.stat.in { border-left-color: var(--in); }
.stat.out { border-left-color: var(--out); }
.stat-label { font-size: 0.82rem; color: var(--muted); }
.stat-main { font-size: 1.25rem; font-weight: 650; }

.filter-row { margin-bottom: 0.8rem; gap: 0.6rem; }
.filter-row select { min-height: 2.2rem; padding: 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.site-list { display: grid; gap: 0.1rem; max-height: 14rem; overflow: auto; margin: 0 0 0.8rem 1.4rem; }
.site-list[hidden] { display: none; }

/* ---------- maps ---------- */
.main.wide { max-width: none; }
.state.warn { color: var(--warn); }
.state.warn::before { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.map-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.map-page.editing { grid-template-columns: minmax(0, 1fr) 19.5rem; }
@media (max-width: 1000px) { .map-page.editing { grid-template-columns: minmax(0, 1fr); } }
.map-main { min-width: 0; display: grid; gap: 0.7rem; }
.map-toolbar { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.btn[aria-pressed="true"]:not(.seg-btn) { background: var(--teal); border-color: var(--teal); color: #fff; }
@media (prefers-color-scheme: dark) { .btn[aria-pressed="true"]:not(.seg-btn) { color: #06222b; } }
.map-wrap { position: relative; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #0e4a66; }
.map-wrap.zoomed { overflow: auto; max-height: 78vh; }
.map-svg { display: block; width: 100%; height: auto; user-select: none; }
.map-bg { fill: #0e4a66; }
.map-grid { fill: url(#mapgrid); }
.map-gridline { fill: none; stroke: rgba(255, 255, 255, 0.045); stroke-width: 1; }
.map-svg text { font-family: var(--font); }
.mnode { cursor: pointer; touch-action: none; outline: none; }
.map-svg.editing .mnode { cursor: grab; }
.map-svg.linking .mnode { cursor: crosshair; }
.mnode:focus-visible .mn-bg { stroke: #fff; stroke-width: 3; }
.mn-bg { fill: #0e4a66; stroke: none; }
.mn-ring { fill: none; stroke: #7fa9bb; stroke-width: 2; stroke-dasharray: 4 3; }
.mn-ring.up { stroke: #3ecf8e; stroke-dasharray: none; }
.mn-ring.down { stroke: #ff6b5e; stroke-width: 4; stroke-dasharray: none; }
.mnode.sel .mn-bg { stroke: #fff; stroke-width: 2; stroke-dasharray: 5 3; }
.mnode.from .mn-bg { stroke: #f0b429; stroke-width: 3; }
.ic-body { fill: #1d6f96; stroke: #e6f4f9; stroke-width: 2; }
.ic-line { fill: none; stroke: #e6f4f9; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-fill { fill: #e6f4f9; }
.ic-cloud { fill: #e9f2f6; stroke: none; }
.mn-label { fill: #fff; font-size: 12px; font-weight: 650; text-anchor: middle; paint-order: stroke; stroke: #0e4a66; stroke-width: 3px; }
.chip.ok { fill: #1f9d62; } .chip.bad { fill: #d6453b; } .chip.unk { fill: #b07d00; }
.chip-text { fill: #fff; font-size: 11px; font-weight: 700; text-anchor: middle; }
.lk { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.lk.ok { stroke: #3ecf8e; } .lk.warn { stroke: #f0b429; } .lk.crit { stroke: #ff6b5e; }
.lk.down { stroke: #ff6b5e; stroke-dasharray: 2 9; }
.lk.nodata { stroke: #8fa9b5; }
.lk.plain { stroke: #b9d6e0; stroke-width: 2.5; }
.lk-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; }
.lk-glow { fill: none; stroke: #fff; stroke-width: 10; opacity: 0; stroke-linecap: round; }
.lk-glow.on { opacity: 0.35; }
.lk-bg { fill: none; }   /* no dark box behind the text on a link: the text carries its own thin outline instead */
.lk-label { fill: #fff; font-size: 12px; font-weight: 650; }
.lk-live { fill: #cfe6ee; font-size: 11px; }
.lk-label-g { pointer-events: none; }
.gt-bg { fill: #f4f8fa; stroke: #8fb4c4; }
.gt-title { fill: #102a37; font-size: 11px; font-weight: 650; }
.gt-frame { fill: #fff; stroke: #c7d6dd; }
.gt-line { fill: none; stroke-width: 1.3; stroke-linejoin: round; }
.gt-line.in { stroke: #0b7a8f; } .gt-line.out { stroke: #b45f00; }
.gt-note { fill: #314b59; font-size: 11px; }
.map-tip { transform: none; top: auto; z-index: 3; }
.legend-row { gap: 1.1rem; font-size: 0.86rem; }
.lg::before { content: ""; display: inline-block; width: 1.5rem; height: 0.3rem; margin-right: 0.4rem; vertical-align: middle; border-radius: 2px; background: var(--muted); }
.lg.ok::before { background: #3ecf8e; } .lg.warn::before { background: #f0b429; } .lg.crit::before { background: #ff6b5e; }
.lg.down::before { background: repeating-linear-gradient(90deg, #ff6b5e 0 3px, transparent 3px 7px); }
.lg.nodata::before { background: #8fa9b5; } .lg.plain::before { background: #b9d6e0; height: 0.18rem; }
.summary { gap: 0.5rem; }
.pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.86rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface); }
.pill::before { content: ""; width: 0.6rem; height: 0.6rem; background: var(--muted); }
.pill.ok::before { background: #3ecf8e; border-radius: 50%; }
.pill.warn::before { background: #f0b429; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pill.crit::before { background: #ff6b5e; transform: rotate(45deg) scale(0.9); }
.pill.down::before { background: #ff6b5e; border-radius: 50%; }
.pill.nodata::before { border-radius: 2px; }
.link-table { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); padding: 0.5rem 0.8rem; }
.link-table summary { cursor: pointer; font-weight: 600; }
.link-table .table-wrap { margin-top: 0.6rem; }
.map-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0.9rem 1rem; min-width: 0; }
.map-panel[hidden] { display: none; }
.map-panel h2 { font-size: 1rem; margin: 0 0 0.6rem; }
.map-panel hr { border: 0; border-top: 1px solid var(--line); margin: 0.9rem 0; }
.panel-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 0.5rem; margin-bottom: 0.7rem; align-items: center; }
.panel-add label { grid-column: 1 / -1; font-size: 0.86rem; font-weight: 560; }
.panel-add select, .panel-add input { min-height: 2.1rem; padding: 0.2rem 0.5rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); min-width: 0; }

[hidden] { display: none !important; }
.dlg-body form > p { margin-bottom: 0.8rem; }

/* ---------- alerts & overview ---------- */
h2.section.first { margin-top: 0.4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 4px; padding: 0.7rem 0.9rem; }
.card.up { border-left-color: var(--ok); }
.card.down { border-left-color: var(--bad); }
.card-n { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.card-l { color: var(--muted); font-size: 0.88rem; }
.problems { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.problems li { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); }
.problems li:last-child { border-bottom: 0; }
.ok-line { padding: 0.75rem 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.row.between { justify-content: space-between; align-items: flex-end; }
.panel-form { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1rem 1.1rem; max-width: 46rem; }
.panel-form .row { margin-top: 0.4rem; }
.steps { margin: 0 0 0.5rem 1.1rem; padding: 0; display: grid; gap: 0.35rem; max-width: 46rem; }
.found { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.5rem 0; }
.spacer { height: 0.6rem; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); }
td.actions .small { margin-right: 0.5rem; }

.panel-form > p { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 0.8rem; }
.panel-form .choice { margin-bottom: 0.9rem; }

/* ---------- device page ---------- */
.device-page { display: grid; gap: 1.1rem; }
.dev-id { display: grid; gap: 0.5rem; }
.crumb { color: var(--muted); text-decoration: none; font-size: 0.9rem; width: fit-content; }
.crumb:hover { color: var(--teal-strong); text-decoration: underline; }
.dev-id-row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.pill-state { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.15rem 0.7rem; border-radius: 999px; font-weight: 650; font-size: 0.88rem; border: 1px solid var(--line); background: var(--surface); }
.pill-state::before { content: ""; width: 0.6rem; height: 0.6rem; background: var(--muted); border-radius: 2px; }
.pill-state.up { color: var(--ok); } .pill-state.up::before { background: var(--ok); border-radius: 50%; }
.pill-state.down { color: var(--bad); } .pill-state.down::before { background: var(--bad); transform: rotate(45deg) scale(0.9); border-radius: 0; }
.pill-state.paused { color: var(--warn); } .pill-state.paused::before { background: var(--warn); clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); }
.chip { display: inline-flex; align-items: center; padding: 0.12rem 0.65rem; border-radius: 4px; background: color-mix(in srgb, var(--teal) 14%, var(--surface)); color: var(--teal-strong); font-size: 0.86rem; font-weight: 600; }
.chip.off { background: var(--paper); color: var(--muted); border: 1px dashed var(--line); font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.8rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 1rem; box-shadow: 0 1px 2px rgba(10, 40, 55, 0.05); }
.kpi.up { border-top: 3px solid var(--ok); } .kpi.down { border-top: 3px solid var(--bad); }
.kpi-l { color: var(--muted); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.kpi-v { font-size: 1.6rem; font-weight: 700; line-height: 1.25; }
.kpi-s { color: var(--muted); font-size: 0.86rem; }
.tabs { display: flex; gap: 0.2rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 0.6rem 1rem; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--teal-strong); border-bottom-color: var(--teal); }
.tab-body { display: grid; gap: 1rem; min-width: 0; }
.empty-card { background: var(--surface); border: 1px dashed var(--line); border-radius: 6px; padding: 2.2rem 1.5rem; text-align: center; display: grid; gap: 0.6rem; justify-items: center; }
.empty-card h3 { font-size: 1.1rem; }
.toolbar2 { display: flex; flex-wrap: wrap; gap: 0.6rem 0.9rem; align-items: center; }
.toolbar2 input[type="search"], .toolbar2 select { min-height: 2.2rem; padding: 0.25rem 0.65rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.toolbar2 input[type="search"] { min-width: 15rem; }
.chips-row { display: inline-flex; gap: 0.3rem; }
.chip-btn { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.8rem; cursor: pointer; font-size: 0.88rem; min-height: 2rem; }
.chip-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .chip-btn[aria-pressed="true"] { color: #06222b; } }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th:nth-child(6), th:nth-child(7) { text-align: right; }
.switch-input { appearance: none; -webkit-appearance: none; width: 2.5rem; height: 1.4rem; border-radius: 999px; background: color-mix(in srgb, var(--muted) 45%, var(--surface)); position: relative; cursor: pointer; margin: 0; vertical-align: middle; flex: none; }
.switch-input::before { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.4rem - 6px); height: calc(1.4rem - 6px); border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.switch-input:checked { background: var(--teal); }
.switch-input:checked::before { transform: translateX(1.1rem); }
.switch-input:disabled { opacity: 0.5; cursor: not-allowed; }
@media (prefers-reduced-motion: no-preference) { .switch-input, .switch-input::before { transition: background-color 0.15s, transform 0.15s; } }
.bar-wrap { display: inline-flex; align-items: center; gap: 0.5rem; }
.bar { width: 4.5rem; height: 0.55rem; border-radius: 99px; background: var(--line); overflow: hidden; display: inline-block; }
.bar-fill { display: block; height: 100%; border-radius: 99px; }
.bar-fill.ok { background: #2fb87a; } .bar-fill.warn { background: #e0a000; } .bar-fill.crit { background: #e0483c; }
.bar-n { font-variant-numeric: tabular-nums; font-size: 0.88rem; min-width: 2.6rem; }
.savebar { position: sticky; bottom: 0.8rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.7rem 1rem; background: var(--ink); color: #eaf5f8; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); z-index: 5; }
.savebar[hidden] { display: none; }
.savebar .btn:not(.primary) { background: transparent; color: #eaf5f8; border-color: rgba(255, 255, 255, 0.35); }
.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; background: var(--ink); color: #eaf5f8; padding: 0.7rem 1.1rem; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); z-index: 50; max-width: 22rem; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.2rem; max-width: 46rem; display: grid; gap: 0.7rem; }
.panel-card h3 { font-size: 1rem; }
.panel-card.danger-zone { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.kvs { display: grid; gap: 0; margin: 0; }
.kv { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
/* loading placeholders */
.skeleton-wrap { display: grid; gap: 1rem; }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 50%, var(--surface)) 50%, var(--line) 75%); background-size: 200% 100%; border-radius: 6px; height: 1.6rem; }
.skeleton.w40 { width: 40%; } .skeleton.card { height: 5.2rem; } .skeleton.tall { height: 14rem; }
.skeleton-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.8rem; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.4s linear infinite; } @keyframes shimmer { to { background-position: -200% 0; } } }

.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

.toolbar2 input[type="search"] { min-width: 13rem; flex: 1 1 14rem; max-width: 20rem; }
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .kpi { padding: 0.6rem 0.75rem; } .kpi-v { font-size: 1.3rem; }
  .table-wrap.picker table { min-width: 420px; }
  .picker th:nth-child(3), .picker td:nth-child(3), .picker th:nth-child(5), .picker td:nth-child(5) { display: none; }
  .toolbar2 input[type="search"] { max-width: none; flex-basis: 100%; }
  .dev-id-row { gap: 0.5rem; }
}

/* ---------- interface list: part of the page, not a box inside it ---------- */
@media (min-width: 900px) { .table-wrap.picker { max-height: none; overflow: visible; } .table-wrap.picker th { top: 0; } }
.table-wrap.picker table { min-width: 0; }
.table-wrap.dense th, .table-wrap.dense td { padding: 0.25rem 0.7rem; }
.table-wrap.dense .btn.small { min-height: 1.6rem; padding: 0.05rem 0.55rem; }
.table-wrap.dense .switch-input { width: 2.1rem; height: 1.2rem; }
.table-wrap.dense .switch-input::before { width: calc(1.2rem - 6px); height: calc(1.2rem - 6px); }
.table-wrap.dense .switch-input:checked::before { transform: translateX(0.9rem); }
td.spark-cell { width: 128px; padding-top: 0; padding-bottom: 0; }
.spark { width: 120px; height: 28px; display: block; }
.spark-area { fill: var(--in); opacity: 0.14; stroke: none; }
.spark-line { fill: none; stroke-width: 1.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-line.in { stroke: var(--in); } .spark-line.out { stroke: var(--out); }
.spark-dot.in { fill: var(--in); } .spark-dot.out { fill: var(--out); }
.spark-empty { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
@media (max-width: 640px) { .picker th:nth-child(9), .picker td:nth-child(9) { display: none; } }

/* ---------- tighter interface list ---------- */
.tabs { overflow-y: hidden; }
.picker td, .picker th { white-space: nowrap; }
.picker td:nth-child(3) { white-space: normal; }
.table-wrap.dense th, .table-wrap.dense td { padding: 0.12rem 0.65rem; font-size: 0.9rem; }
.table-wrap.dense .state, .table-wrap.dense .btn.small { font-size: 0.86rem; }
.table-wrap.dense .btn.small { min-height: 1.5rem; }
td.spark-cell { padding-top: 0; padding-bottom: 0; }
.device-page.slim .kpis { gap: 0.5rem; }
.device-page.slim .kpi { padding: 0.4rem 0.8rem; }
.device-page.slim .kpi-v { font-size: 1.15rem; }
.device-page.slim .kpi-s { display: none; }

/* ---------- overview cards and interface detail ---------- */
a.if-link { color: var(--teal-strong); text-decoration: none; font-weight: 600; }
a.if-link:hover { text-decoration: underline; }
.if-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0.8rem; }
.if-card { display: grid; gap: 0.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 0.9rem 0.6rem; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(10, 40, 55, 0.05); min-width: 0; }
.if-card:hover { border-color: var(--teal); box-shadow: 0 2px 8px rgba(10, 40, 55, 0.12); }
.if-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.if-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.if-card-name { font-weight: 700; overflow-wrap: anywhere; }
.if-card-alias { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.if-card-rates { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.rate.in b { color: var(--in); } .rate.out b { color: var(--out); }
.if-card-load { min-height: 1.1rem; }
.if-card-spark .spark { width: 100%; height: 34px; }
.detail-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.detail-title { display: grid; gap: 0.35rem; }
.detail-title h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.detail-alias { margin: 0; font-size: 1.02rem; }
.kpis.slimk { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpis.slimk .kpi-v { font-size: 1.35rem; }

a.btn { color: var(--text); margin-top: 0; }

/* ---------- broadcast ---------- */
.bcast-card, .optics-card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0.9rem 1rem 1rem; min-width: 0; }
.warn-text { color: var(--warn); font-weight: 600; }
th:nth-child(8) { text-align: right; }
.if-card-bc { font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.if-card-bc b { color: var(--text); font-weight: 600; }
.pill-state.lvl-normal { color: var(--ok); } .pill-state.lvl-normal::before { background: var(--ok); border-radius: 50%; }
.pill-state.lvl-elevated { color: var(--warn); } .pill-state.lvl-elevated::before { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.pill-state.lvl-high { color: #b34700; } .pill-state.lvl-high::before { background: #d4631a; clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.pill-state.lvl-storm { color: var(--bad); } .pill-state.lvl-storm::before { background: var(--bad); transform: rotate(45deg) scale(0.9); border-radius: 0; }
.pill-state.lvl-nodata { color: var(--muted); }
.analysis { margin-top: 1rem; padding: 0.9rem 1.1rem; border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 4px; background: var(--paper); display: grid; gap: 0.5rem; }
.analysis.lvl-normal { border-left-color: var(--ok); } .analysis.lvl-elevated { border-left-color: var(--warn); }
.analysis.lvl-high { border-left-color: #d4631a; } .analysis.lvl-storm { border-left-color: var(--bad); }
.analysis-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.analysis-head h3 { font-size: 1rem; }
.analysis-summary { margin: 0; font-weight: 560; }
.analysis h4 { margin: 0.5rem 0 0.3rem; font-size: 0.92rem; }
.analysis-facts, .analysis-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.analysis code { font-family: var(--mono); font-size: 0.88em; background: color-mix(in srgb, var(--line) 55%, var(--surface)); padding: 0.05rem 0.3rem; border-radius: 3px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .picker th:nth-child(9), .picker td:nth-child(9) { display: table-cell; }
  .picker th:nth-child(8), .picker td:nth-child(8), .picker th:nth-child(10), .picker td:nth-child(10) { display: none; }
}

.panel-add.stack select { grid-column: 1 / -1; }
.panel-add.stack .hint { grid-column: 1; font-size: 0.82rem; color: var(--muted); }

/* ---------- Graphs page: sites > switches > graphs ---------- */
.acc-list { display: grid; gap: 0.6rem; }
.acc-h { margin: 0; font-size: inherit; font-weight: inherit; }
.acc-head { width: 100%; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 1rem; cursor: pointer; min-height: 2.8rem; }
.acc-head:hover { border-color: var(--teal); }
.acc-head:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.acc-head-site .acc-title { font-size: 1.05rem; }
.acc-head-device { background: var(--paper); padding: 0.55rem 0.9rem; min-height: 2.4rem; }
.acc-chev { width: 0.7rem; height: 0.7rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: none; margin-right: 0.2rem; }
.acc-head[aria-expanded="true"] .acc-chev { transform: rotate(45deg); }
@media (prefers-reduced-motion: no-preference) { .acc-chev { transition: transform 0.15s; } }
.acc-sum { margin-left: auto; color: var(--muted); font-size: 0.9rem; }
.acc-body[hidden] { display: none; }
.acc-body-site { display: grid; gap: 0.5rem; padding: 0.6rem 0 0.4rem 1.3rem; }
.acc-body-device { padding: 0.7rem 0 0.4rem 0.2rem; }

/* ---------- several ports on one chart ---------- */
dialog.wide { width: min(1120px, 96vw); max-width: none; }
.ports-dialog { display: grid; grid-template-columns: minmax(15rem, 21rem) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 800px) { .ports-dialog { grid-template-columns: 1fr; } }
.ports-pick { display: grid; gap: 0.5rem; min-width: 0; }
.ports-filters { display: grid; gap: 0.4rem; }
.ports-pick input[type="search"] { min-height: 2.1rem; padding: 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.port-list { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); max-height: 15rem; overflow: auto; padding: 0.2rem; }
.port-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.45rem; border-radius: 3px; cursor: pointer; flex-wrap: wrap; }
.port-row:hover { background: var(--paper); }
.port-name { font-weight: 600; }
.port-alias { color: var(--muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.chosen { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.chosen li { display: flex; align-items: center; gap: 0.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0.2rem 0.5rem; font-size: 0.9rem; }
.chosen li span:not(.sw) { flex: 1; overflow-wrap: anywhere; }
.chip-x { background: none; border: 0; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--muted); min-width: 1.8rem; min-height: 1.8rem; }
.chip-x:hover { color: var(--bad); }
.sw { flex: none; vertical-align: middle; }
.compare { display: grid; gap: 0.7rem; min-width: 0; }
.compare-controls { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: space-between; }
.compare-body { display: grid; gap: 0.6rem; min-width: 0; }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; font-size: 0.9rem; }
.chart-legend li { display: flex; align-items: center; gap: 0.4rem; }
.tip-row { display: flex; align-items: center; gap: 0.3rem; }
.compare-stats td.num, .compare-stats th:not(:first-child) { text-align: right; }
.ports-actions { margin-top: 1rem; display: grid; gap: 0.5rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.gt-leg { font-size: 10px; fill: var(--text); }

/* ---------- fibre health ---------- */
.card.warn { border-left-color: var(--warn); }
.pill-state.opt-ok { color: var(--ok); } .pill-state.opt-ok::before { background: var(--ok); border-radius: 50%; }
.pill-state.opt-warn { color: #a85d00; } .pill-state.opt-warn::before { background: #d4891a; clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.pill-state.opt-alarm { color: var(--bad); } .pill-state.opt-alarm::before { background: var(--bad); transform: rotate(45deg) scale(0.9); border-radius: 0; }
.pill-state.opt-nolight { color: var(--bad); } .pill-state.opt-nolight::before { content: "×"; background: none; width: auto; height: auto; line-height: 1; font-weight: 800; color: var(--bad); }
.pill-state.opt-nopower, .pill-state.opt-absent, .pill-state.opt-unknown, .pill-state.opt-norx, .pill-state.opt-laseroff { color: var(--muted); }
.optic-banner { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; padding: 0.55rem 0.9rem; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--muted); margin-bottom: 0.5rem; }
.optic-banner.optic-ok { border-left-color: var(--ok); } .optic-banner.optic-warn { border-left-color: var(--warn); }
.optic-banner.optic-alarm, .optic-banner.optic-nolight { border-left-color: var(--bad); }
.vline { fill: none; stroke-width: 2; stroke-linejoin: round; }
.vline.rx { stroke: var(--in); } .vline.tx { stroke: var(--out); stroke-dasharray: 7 3; }
.vlimit { stroke-width: 1; stroke-dasharray: 4 3; }
.vlimit.warn { stroke: #d4891a; } .vlimit.alarm { stroke: #d6453c; }
.vlimit-label { font-size: 10px; } .vlimit-label.warn { fill: #a85d00; } .vlimit-label.alarm { fill: #b3261e; }
.fibre-page { display: grid; gap: 1rem; }

/* ---------- fibre health v2 ---------- */
.health { display: grid; gap: 0.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1.1rem; box-shadow: 0 1px 2px rgba(10, 40, 55, 0.05); }
.health-bar { display: flex; height: 0.9rem; border-radius: 99px; overflow: hidden; background: var(--line); }
.hseg { height: 100%; min-width: 3px; }
.hseg-alarm { background: #d6453c; } .hseg-warn { background: #e0a000; } .hseg-ok { background: #2fb87a; } .hseg-nodata { background: #9aa9b2; }
.health-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.9rem; align-items: center; }
.hl { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.hl::before { content: ""; width: 0.65rem; height: 0.65rem; border-radius: 2px; }
.hl-alarm::before { background: #d6453c; } .hl-warn::before { background: #e0a000; } .hl-ok::before { background: #2fb87a; } .hl-nodata::before { background: #9aa9b2; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; }
.kpi-btn { display: grid; gap: 0.1rem; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 6px; padding: 0.55rem 0.9rem; cursor: pointer; min-height: 3.4rem; }
.kpi-btn:hover { border-color: var(--teal); }
.kpi-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.kpi-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--teal) 10%, var(--surface)); border-color: var(--teal); border-left-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.kpi-btn.tone-alarm { border-left-color: #d6453c; } .kpi-btn.tone-warn { border-left-color: #e0a000; } .kpi-btn.tone-ok { border-left-color: #2fb87a; } .kpi-btn.tone-nodata { border-left-color: #9aa9b2; } .kpi-btn.tone-attention { border-left-color: #8a5a00; }
.kpi-n { font-size: 1.5rem; font-weight: 700; line-height: 1.1; } .kpi-t { color: var(--muted); font-size: 0.86rem; }
.fibre-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem 0.8rem; align-items: center; }
.fibre-toolbar select, .fibre-toolbar input[type="search"] { min-height: 2.3rem; padding: 0.25rem 0.65rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.fibre-toolbar select[hidden] { display: none; }
.fibre-toolbar input[type="search"] { min-width: 14rem; flex: 1 1 14rem; max-width: 22rem; }
.fgroups { display: grid; gap: 0.7rem; }
.fgroup-head { width: 100%; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem 1rem; cursor: pointer; min-height: 3rem; }
.fgroup-head:hover { border-color: var(--teal); }
.fgroup-head:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fgroup-head[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.fgroup-head[aria-expanded="true"] .acc-chev { transform: rotate(45deg); }
.fgroup-name { font-size: 1.02rem; }
.fgroup-sum { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; }
.fgroup-body { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: var(--surface); }
.fgroup-body[hidden] { display: none; }
.fgroup-body .table-wrap { border: 0; border-radius: 0 0 8px 8px; }
.fibre-table th, .fibre-table td { padding: 0.45rem 0.8rem; white-space: nowrap; }
.fibre-table td.port-cell { white-space: normal; min-width: 14rem; }
.fibre-table th:nth-child(n+3), .fibre-table td.num { text-align: right; }
.fibre-table th:nth-child(3), .fibre-table td.light-cell { text-align: left; }
.fibre-table tbody tr:hover { background: var(--paper); }
.light-cell { min-width: 11rem; } .light-n { display: block; font-variant-numeric: tabular-nums; }
.gauge { width: 120px; height: 12px; display: block; margin-top: 2px; }
.g-bad { fill: #d6453c; opacity: 0.55; } .g-warn { fill: #e0a000; opacity: 0.55; } .g-ok { fill: #2fb87a; opacity: 0.55; }
.g-dot { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.trend { width: 96px; height: 24px; display: block; margin-left: auto; }
.trend-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.trend-line.sev-ok { stroke: var(--teal-strong); } .trend-line.sev-warn { stroke: #c27c00; } .trend-line.sev-alarm { stroke: #d6453c; } .trend-line.sev-nodata { stroke: var(--muted); }
.trend-empty { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.chip.qsfp { margin-left: 0.5rem; font-size: 0.78rem; }
@media (max-width: 820px) {
  .fibre-table th:nth-child(4), .fibre-table td:nth-child(4), .fibre-table th:nth-child(6), .fibre-table td:nth-child(6), .fibre-table th:nth-child(8), .fibre-table td:nth-child(8) { display: none; }
  .fgroup-sum { margin-left: 0; }
}

/* ---------- four-lane modules ---------- */
.lane-dots { display: inline-flex; gap: 3px; margin-top: 3px; }
.light-cell .lane-dots { display: flex; }
.ld { width: 0.9rem; height: 0.55rem; border-radius: 2px; background: var(--muted); }
.ld-ok { background: #2fb87a; } .ld-warn { background: #e0a000; } .ld-alarm, .ld-nolight { background: #d6453c; } .ld-unknown { background: #9aa9b2; }
.module-line { margin: 0 0 0.5rem; }
.lane-table { width: 100%; border-collapse: collapse; }
.lane-table th, .lane-table td { padding: 0.4rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lane-table td.num, .lane-table th:nth-child(n+2):nth-child(-n+4) { text-align: right; }
.lane-table tr.lane-worst { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.lane-table .trend { margin-left: 0; }

/* ---------- port page ---------- */
.pane-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; padding: 0.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; }
.pane-tab { font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 0.4rem 1.1rem; min-height: 2.3rem; cursor: pointer; }
.pane-tab:hover { color: var(--text); }
.pane-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pane-tab[aria-selected="true"] { background: var(--teal); color: #fff; }
.pane { display: grid; gap: 1rem; min-width: 0; }
.pane[hidden] { display: none; }
.detail-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.opt-chip { text-decoration: none; font-weight: 600; }
.opt-chip.opt-ok { color: #0e6b45; background: #e3f5ec; } .opt-chip.opt-warn { color: #8a5a00; background: #fdf1d6; }
.opt-chip.opt-alarm, .opt-chip.opt-nolight { color: #a1261c; background: #fde7e5; }
.light-kpi.opt-warn .kpi-v { color: #8a5a00; } .light-kpi.opt-alarm .kpi-v, .light-kpi.opt-nolight .kpi-v { color: #a1261c; } .light-kpi.opt-ok .kpi-v { color: #0e6b45; }
.graph-body:has(> p.muted:only-child) { min-height: 0; }

/* ---------- audit fixes ---------- */
/* a wide table must scroll inside its own box, never stretch the whole page */
.fibre-page, .fgroups { grid-template-columns: minmax(0, 1fr); }
.fgroup, .fgroup-body, .fibre-page > * { min-width: 0; }
.bot-row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; }
.devlist-bar { margin-bottom: 0.8rem; }
.devlist-bar input[type="search"] { min-height: 2.2rem; padding: 0.25rem 0.65rem; border: 1px solid var(--line); border-radius: 4px; min-width: 14rem; flex: 1 1 14rem; max-width: 22rem; background: var(--surface); }
.devlist-bar .filter-row { margin: 0; }
/* Overview */
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; box-shadow: 0 1px 2px rgba(10, 40, 55, 0.05); min-width: 0; }
.dash-card h2 { font-size: 1.05rem; margin: 0 0 0.7rem; }
.dash-card p { margin: 0.7rem 0 0; }
.health-flat { border: 0; padding: 0; box-shadow: none; background: none; }
.mini-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
details.adv { margin-top: 1.2rem; }
/* tables become cards on a phone */
@media (max-width: 640px) {
  .table-wrap.stack { overflow: visible; border: 0; background: none; }
  .table-wrap.stack table, .table-wrap.stack tbody { display: block; min-width: 0; width: 100%; }
  .table-wrap.stack thead { position: absolute; left: -9999px; }
  .table-wrap.stack tbody tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin: 0 0 0.7rem; padding: 0.35rem 0; }
  .table-wrap.stack td { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.3rem 1rem; border: 0; padding: 0.3rem 0.9rem; text-align: right; white-space: normal; }
  .table-wrap.stack td > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .table-wrap.stack td[data-label=""] { justify-content: flex-start; gap: 0.4rem; text-align: left; }
  .table-wrap.stack td::before { content: attr(data-label); flex: 0 0 38%; text-align: left; font-weight: 600; color: var(--muted); }
  .table-wrap.stack td[data-label=""]::before { content: none; }
  .table-wrap.stack td:empty { display: none; }
  .table-wrap.stack td > * { max-width: 100%; }
  .devlist-bar input[type="search"] { max-width: none; }
  .pane-tabs { border-radius: 14px; width: 100%; }
  .pane-tab { flex: 1 1 auto; text-align: center; }
}

.notice.unsupported ul { margin: 0.4rem 0 0.2rem 1.1rem; padding: 0; } .notice.unsupported p { margin: 0.3rem 0 0; }

.unsupported-note { margin: 0.15rem 0 0.5rem 0; max-width: 60rem; } .notice.unsupported li { margin-bottom: 0.3rem; }

.diag-out { max-height: 26rem; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.7rem 0.9rem; margin-top: 0.7rem; font-size: 0.85rem; white-space: pre-wrap; word-break: break-word; }
#optdiagport { min-width: 18rem; flex: 1 1 18rem; }

/* ================= the page that opens when you click an interface ================= */
/* the device's own title becomes a quiet breadcrumb, and its buttons, tabs and identity bar step aside while one port is open */
body.port-mode .page-head { margin-bottom: 0.2rem; }
body.port-mode .page-head h1 { font-size: 0.92rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
body.port-mode .page-head h1::before { content: "Devices  \203A  "; font-weight: 500; }
body.port-mode .page-head > :nth-child(2) { display: none; }
body.port-mode .dev-id, body.port-mode .device-page > .tabs { display: none; }
.port-page { display: grid; gap: 1rem; min-width: 0; }
.port-page > * { min-width: 0; }

/* header card with a coloured edge: green healthy, amber warning, red down or alarm */
.port-hero { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(10, 40, 55, 0.06), 0 10px 28px rgba(10, 40, 55, 0.05); }
.port-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--line); }
.port-hero.st-ok::before { background: linear-gradient(90deg, #2fb87a, #6fdcae); }
.port-hero.st-warn::before { background: linear-gradient(90deg, #e0a000, #f2c75a); }
.port-hero.st-bad::before { background: linear-gradient(90deg, #d6453c, #ec8780); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: 1.4rem 1.5rem 1.1rem; }
.port-hero .detail-title { min-width: 0; }
.port-hero .detail-title h2 { font-size: 1.75rem; line-height: 1.15; margin: 0; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.port-hero .detail-alias { font-size: 1.02rem; font-weight: 500; margin: 0.3rem 0 0.7rem; color: var(--text); }
.port-hero .detail-title > p.muted { margin: 0.3rem 0 0.7rem; }
.hero-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.hero-actions .btn[hidden] { display: none; }
/* the five figures become one stat bar, divided by hairlines */
.port-hero .kpis.slimk { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border-top: 1px solid var(--line); background: #fbfcfd; margin: 0; }
.port-hero .kpis.slimk .kpi { border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; padding: 0.95rem 1.3rem; min-height: 0; min-width: 0; }
.port-hero .kpis.slimk .kpi:last-child { border-right: 0; }
.port-hero .kpis.slimk .kpi[hidden] { display: none; }
.port-hero .kpi-l { font-size: 0.7rem; letter-spacing: 0.08em; }
.port-hero .kpi-v { font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.port-hero .kpi-s { font-size: 0.82rem; }

/* tabs: underlined, and they stay in view while the section scrolls */
.port-page .pane-tabs { position: sticky; top: 0; z-index: 6; width: 100%; gap: 1.6rem; padding: 0 0.2rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); overflow-x: auto; }
.port-page .pane-tab { border-radius: 0; padding: 0.85rem 0.1rem 0.75rem; min-height: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.port-page .pane-tab:hover { color: var(--text); }
.port-page .pane-tab[aria-selected="true"] { background: none; color: var(--teal-strong); border-bottom-color: var(--teal); }

/* every card in this page shares one look */
.port-page .graph-card, .port-page .optics-card, .port-page .bcast-card, .port-page .panel-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(10, 40, 55, 0.05); padding: 1.1rem 1.3rem 1.3rem; max-width: none; }
.port-page .graph-head { margin-bottom: 0.8rem; }
.port-page .graph-head b { font-size: 1.05rem; }
.detail-panels .panel-card h3 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.chart-skel { display: grid; gap: 0.8rem; }
.chart-skel .skeleton.chart { height: 15rem; }

/* optical: the chart on the left, the module and its limits on the right; a level gauge on every lane */
.optic-grid { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.3rem; align-items: start; margin-top: 0.4rem; }
.optic-main { min-width: 0; }
.optic-side { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; min-width: 0; }
.optic-side h3 { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.optic-side h3:not(:first-child) { margin-top: 1rem; }
.facts { margin: 0; display: grid; gap: 0.45rem; }
.fact { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 0.92rem; }
.fact dt { color: var(--muted); flex: 0 0 auto; }
.fact dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.lane-table .gauge-cell { min-width: 140px; }
.lane-table .gauge { margin: 0; }
.optics-card .optic-banner { border-radius: 10px; }
.optics-card .module-line { margin: 0.1rem 0 0.8rem; }

@media (max-width: 1100px) { .optic-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .port-page .pane-tabs { position: static; } }
@media (max-width: 640px) {
  .hero-top { padding: 1.1rem 1.1rem 0.9rem; }
  .port-hero .detail-title h2 { font-size: 1.45rem; }
  .hero-actions { width: 100%; }
  .port-hero .kpis.slimk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .port-hero .kpis.slimk .kpi { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
  .port-hero .kpis.slimk .kpi:nth-child(2n) { border-right: 0; }
  .port-page .graph-card, .port-page .optics-card, .port-page .bcast-card, .port-page .panel-card { padding: 0.9rem 0.9rem 1rem; border-radius: 12px; }
}

/* the module's temperature and laser current are in the side panel, so the fourth figure is not repeated beside the chart */
.optic-grid .optic-main .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.optic-grid .optic-main .stats .stat:nth-child(4) { display: none; }
.optic-side .facts + h3 + .facts .fact dd { white-space: nowrap; }

body.port-mode .page-head h1 a { color: inherit; text-decoration: none; font-weight: 700; } body.port-mode .page-head h1 a:hover { text-decoration: underline; }

/* Details: the two cards keep their natural height (no stretched, gappy list), and links match the rest of the app */
.detail-panels { align-items: start; }
.detail-panels .kvs { align-content: start; grid-auto-rows: min-content; }
.detail-panels .panel-card a { color: var(--teal-strong); text-underline-offset: 2px; }
.detail-panels .panel-card a:hover { color: var(--teal); }

/* map: link text without a box; a thin dark outline keeps it readable over the lines */
.lk-label, .lk-live { paint-order: stroke fill; stroke: rgba(4, 24, 36, 0.92); stroke-width: 3.4px; stroke-linejoin: round; }
/* map: the red "x N" badge is a link to the exact port that is down */
.chip-link { cursor: pointer; outline: none; }
.chip-link:hover .chip.bad, .chip-link:focus-visible .chip.bad { fill: #f06a60; }
.chip-link:focus-visible .chip { stroke: #fff; stroke-width: 2; }
.down-list { margin: 0 0 0.9rem; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
/* full-page mode (a map link ending in ?view=full): no menu, a slim bar to get back */
body.bare .side { display: none; }
body.bare .shell { grid-template-columns: minmax(0, 1fr); }
body.bare .main { max-width: none; padding-top: 0.7rem; }
.bare-bar { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; padding: 0.2rem 0 0.7rem; margin-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.bare-bar b { font-size: 1rem; letter-spacing: 0.01em; }
.bare-spacer { flex: 1 1 auto; }

/* link quality */
.optic-banner.q-flapping, .optic-banner.q-errors { border-left-color: var(--bad); }
.optic-banner.q-watch { border-left-color: #d4891a; }
.q-h { font-size: 0.95rem; margin: 1.1rem 0 0.3rem; }
.q-events td, .q-events th { padding: 0.45rem 0.7rem; }
.quality-card .stats { margin-top: 0.9rem; }

/* the Link quality table has nine columns: tighter cells and headers that wrap, so it fits without sideways scrolling */
.q-page th, .q-page td { padding: 0.55rem 0.6rem; }
.q-page th { white-space: normal; line-height: 1.2; vertical-align: bottom; }
.q-page td.num { white-space: nowrap; }

/* topology */
.t-page .cb { width: 2rem; }
.t-page .pill-state { margin-right: 0.35rem; }
.t-bar { align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.t-bar #tsel { margin-right: auto; }
.t-how summary { cursor: pointer; font-weight: 600; }
.paste-preview { margin: 0.8rem 0; }
.paste-preview .notice { margin: 0.5rem 0; }
dialog textarea.mono { width: 100%; font-size: 0.85rem; }
.t-page a.mono { color: var(--teal-strong); text-decoration: none; } .t-page a.mono:hover { text-decoration: underline; }
.t-page input[type=search] { min-width: 18rem; flex: 1 1 18rem; }
.t-how { width: 100%; box-sizing: border-box; }

/* weekly report: on screen it is a clean white page; printed, it is the whole page */
.report { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2rem 2.2rem; max-width: 62rem; margin: 0 auto; color: #12202a; }
.rhead { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; border-bottom: 4px solid var(--teal); padding-bottom: 1.1rem; margin-bottom: 1.3rem; }
.rbrand { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-strong); font-weight: 700; }
.rhead h1 { font-size: 1.9rem; margin: 0.2rem 0; letter-spacing: -0.01em; }
.rtenant { font-size: 1.1rem; color: var(--muted); }
.rperiod { text-align: right; font-size: 0.95rem; } .rl { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); } .rgap { margin-top: 0.6rem; }
.rkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.7rem; margin-bottom: 1.4rem; }
.rkpi { border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: 8px; padding: 0.7rem 0.9rem; }
.rkpi.good { border-top-color: #2fb87a; } .rkpi.warn { border-top-color: #e0a000; }
.rkpi-l { font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); } .rkpi-v { font-size: 1.7rem; font-weight: 700; line-height: 1.2; } .rkpi-s { font-size: 0.78rem; color: var(--muted); }
.rsec { margin-top: 1.5rem; break-inside: avoid-page; }
.rsec h2 { font-size: 1.1rem; border-bottom: 1px solid var(--line); padding-bottom: 0.35rem; margin: 0 0 0.6rem; display: flex; align-items: center; gap: 0.55rem; }
.rnum { background: var(--teal); color: #fff; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.rsub { font-size: 0.9rem; margin: 1rem 0 0.3rem; } .report-none { margin: 0.4rem 0; }
.rfoot { margin-top: 2rem; padding-top: 0.8rem; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); display: grid; gap: 0.3rem; }
.report table { font-size: 0.88rem; } .report th { background: #f3f6f8; }
@media (max-width: 640px) { .report { padding: 1.1rem; } .rperiod { text-align: left; } }
@media print {
  @page { size: A4; margin: 13mm; }
  body { background: #fff !important; }
  .side, .bare-bar, .page-head, .no-print, .toast { display: none !important; }
  .shell { display: block !important; } .main { padding: 0 !important; max-width: none !important; }
  .report { border: 0; border-radius: 0; padding: 0; max-width: none; font-size: 10.5pt; }
  .rhead, .rkpi, .rnum, .report th, .pill-state { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report tr, .rkpi { break-inside: avoid; } .report thead { display: table-header-group; }
}

@media print {
  .report .table-wrap { overflow: visible !important; }
  .report table { font-size: 9pt; width: 100%; table-layout: auto; }
  .report th, .report td { padding: 0.3rem 0.45rem; }
  .report th { white-space: normal; }
  .rkpis { grid-template-columns: repeat(3, 1fr); }
}
.rsite { margin-top: 0.35rem; font-size: 1.05rem; font-weight: 700; color: var(--teal-strong); }
.report-bar select { min-width: 14rem; }

/* onboarding */
.code-box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.code-head { padding: 0.5rem 0.8rem; background: #f3f6f8; align-items: center; gap: 0.5rem; }
.code { margin: 0; padding: 0.8rem 1rem; font-size: 0.82rem; line-height: 1.45; overflow: auto; max-height: 26rem; white-space: pre; background: #fff; border-top: 1px solid var(--line); font-family: ui-monospace, Consolas, monospace; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.7rem 1rem; }
.ok-text { color: #0f6b3f; font-weight: 600; }
.only-print { display: none; }
.row-bad td { background: #fdecea; }
@media print { .only-print { display: block; } }

/* system health */
.hbar { height: 0.7rem; background: #e6edf0; border-radius: 99px; overflow: hidden; margin-top: 0.3rem; } .hfill { height: 100%; border-radius: 99px; } .hfill.ok { background: #2fb87a; } .hfill.warn { background: #e0a000; } .hfill.bad { background: #d6453c; }
.hmeter { margin-bottom: 0.9rem; } .hbanner.ok { border-left: 5px solid #2fb87a; } .hbanner.warn { border-left: 5px solid #e0a000; } .hbanner.bad { border-left: 5px solid #d6453c; }
.hrec.act { border-left: 5px solid #d6453c; } .hrec.watch { border-left: 5px solid #e0a000; }

/* wall monitors: the map fills the screen and nothing on it can be clicked, hovered or focused */
body.kiosk { overflow: hidden; background: #0e1a21; }
body.kiosk, body.kiosk * { pointer-events: none !important; cursor: none !important; user-select: none !important; }
body.kiosk .side, body.kiosk .bare-bar, body.kiosk .page-head, body.kiosk .map-panel, body.kiosk .toast { display: none !important; }
body.kiosk .shell { display: block !important; } body.kiosk .main { padding: 0 !important; max-width: none !important; margin: 0 !important; }
body.kiosk .map-main > :not(.map-wrap) { display: none !important; }
body.kiosk .map-page { display: block !important; padding: 0 !important; }
body.kiosk .map-wrap { width: 100vw !important; height: 100vh !important; max-height: none !important; border: 0 !important; border-radius: 0 !important; overflow: hidden !important; }
body.kiosk .map-svg { width: 100% !important; height: 100% !important; }
.kiosk-title { position: fixed; top: 0.7rem; left: 0.9rem; z-index: 5; padding: 0.35rem 0.8rem; border-radius: 6px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 1.15rem; font-weight: 600; white-space: pre; }
.kiosk-badge { position: fixed; top: 0.7rem; right: 0.9rem; z-index: 5; padding: 0.3rem 0.7rem; border-radius: 6px; background: #b26a00; color: #fff; font-weight: 600; }
.kiosk-msg { display: flex; align-items: center; justify-content: center; height: 100vh; color: #fff; font-size: 1.6rem; text-align: center; padding: 2rem; }

/* phones count the address bar as screen: dvh is the part that can really be seen */
body.kiosk, body.kiosk .shell { height: 100vh; height: 100dvh; }
body.kiosk .map-wrap { height: 100vh !important; height: 100dvh !important; }

/* the total of in and out on a port's traffic graph */
.key.total::before { background: #3b4a54; } .chart .line.total { fill: none; stroke: #3b4a54; stroke-width: 2; stroke-dasharray: 6 3; } .chart .dot.total { stroke: #3b4a54; }
.stat.total { border-left-color: #3b4a54; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .key.total::before { background: #c9d4da; } :root:not([data-theme="light"]) .chart .dot.total, :root:not([data-theme="light"]) .chart .line.total { stroke: #c9d4da; } :root:not([data-theme="light"]) .stat.total { border-left-color: #c9d4da; } }
/* phones: the map area follows the height that can really be seen (set in script from the visual viewport), with a small margin at the bottom */
body.kiosk, body.kiosk .shell { height: var(--kh, 100dvh); }
body.kiosk .map-wrap { height: var(--kh, 100dvh) !important; }
@media (max-width: 900px), (max-height: 520px) { body.kiosk .map-wrap { height: calc(var(--kh, 100dvh) - 14px - env(safe-area-inset-bottom, 0px)) !important; } }

.chart .chart-tip .tip-row.total { color: #ffffff !important; font-weight: 700; margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid rgba(255, 255, 255, 0.3); }
/* how full the link is: green, amber, orange, red */
:root { --u-ok: #1f9d68; --u-busy: #e0a000; --u-high: #e8700a; --u-crit: #d6453c; }
.lvl-chip { float: right; padding: 0.05rem 0.55rem; border-radius: 99px; font-size: 0.75rem; font-weight: 700; color: #fff; }
.lvl-chip.lvl-ok { background: var(--u-ok); } .lvl-chip.lvl-busy { background: var(--u-busy); color: #1b1b1b; } .lvl-chip.lvl-high { background: var(--u-high); } .lvl-chip.lvl-crit { background: var(--u-crit); }
.stat.in.lvl-busy, .stat.out.lvl-busy { border-left-color: var(--u-busy); } .stat.in.lvl-high, .stat.out.lvl-high { border-left-color: var(--u-high); } .stat.in.lvl-crit, .stat.out.lvl-crit { border-left-color: var(--u-crit); background: rgba(214, 69, 60, 0.08); }
.util-verdict { border: 1px solid var(--line); border-left-width: 6px; border-radius: 10px; padding: 0.7rem 1rem 0.9rem; margin: 0.5rem 0 0.9rem; }
.util-verdict.lvl-ok { border-left-color: var(--u-ok); } .util-verdict.lvl-busy { border-left-color: var(--u-busy); } .util-verdict.lvl-high { border-left-color: var(--u-high); } .util-verdict.lvl-crit { border-left-color: var(--u-crit); background: rgba(214, 69, 60, 0.07); }
.util-top { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; } .util-pct { font-size: 1.9rem; line-height: 1; } .util-word { font-size: 1.15rem; font-weight: 700; }
.lvl-ok .util-word { color: var(--u-ok); } .lvl-busy .util-word { color: #a87400; } .lvl-high .util-word { color: #c25a00; } .lvl-crit .util-word { color: var(--u-crit); }
.util-note { color: var(--muted); font-size: 0.85rem; }
.util-gauge { position: relative; height: 0.75rem; border-radius: 99px; margin: 0.8rem 0 1.2rem; background: linear-gradient(to right, var(--u-ok) 0 70%, var(--u-busy) 70% 85%, var(--u-high) 85% 90%, var(--u-crit) 90% 100%); }
.util-mark { position: absolute; top: -0.3rem; width: 0.3rem; height: 1.35rem; margin-left: -0.15rem; border-radius: 2px; background: #12202a; box-shadow: 0 0 0 2px #fff; }
.util-tick { position: absolute; top: 0.95rem; transform: translateX(-50%); font-size: 0.7rem; color: var(--muted); }
.util-advice { font-weight: 600; }
.chart .thr { stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.9; } .chart .thr.busy { stroke: var(--u-busy); } .chart .thr.high { stroke: var(--u-high); } .chart .thr.crit { stroke: var(--u-crit); }
.chart .thr-label { font-size: 10px; font-weight: 600; } .chart .thr-label.busy { fill: #a87400; } .chart .thr-label.high { fill: #c25a00; } .chart .thr-label.crit { fill: var(--u-crit); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lvl-busy .util-word, :root:not([data-theme="light"]) .chart .thr-label.busy { color: #f0b429; fill: #f0b429; } :root:not([data-theme="light"]) .lvl-high .util-word, :root:not([data-theme="light"]) .chart .thr-label.high { color: #ff9340; fill: #ff9340; } :root:not([data-theme="light"]) .util-mark { background: #fff; box-shadow: 0 0 0 2px #12202a; } }
.confirm-box { max-width: 34rem; margin: 4rem auto; }

/* the fourth level (orange) on maps and load bars; shapes differ so colour is not the only cue */
.lk.high { stroke: #ff9340; } .lg.high::before { background: #ff9340; } .pill.high::before { background: #ff9340; border-radius: 2px; }
.bar-fill.busy { background: var(--u-busy); } .bar-fill.high { background: var(--u-high); }
.bar-n.lvl-text.lvl-busy { color: #a87400; font-weight: 600; } .bar-n.lvl-text.lvl-high { color: #c25a00; font-weight: 700; } .bar-n.lvl-text.lvl-crit { color: var(--u-crit); font-weight: 700; }
.mini-events .lvl-chip { float: none; display: inline-block; margin-right: 0.3rem; }

/* the map's graph tile looks like the full graph: filled areas, gridlines, a dashed total */
.gt-area.in { fill: #0b7a8f; opacity: 0.2; } .gt-area.out { fill: #b45f00; opacity: 0.25; }
.gt-grid { stroke: #dbe5ea; stroke-width: 1; } .gt-scale { fill: #44545f; font-size: 9px; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.gt-line.total { stroke: #3b4a54; stroke-width: 1.2; stroke-dasharray: 4 3; }
.gt-stat { font-size: 10.5px; } .gt-k { font-weight: 700; } .gt-k.in { fill: #0b7a8f; } .gt-k.out { fill: #b45f00; } .gt-k.total { fill: #3b4a54; }
.gt-line.bcast { stroke: #8a4fb3; stroke-width: 1.2; stroke-dasharray: 2 2; fill: none; } .gt-k.bcast { fill: #8a4fb3; }
.chart .line.bcast { stroke: #8a4fb3; stroke-width: 1.4; stroke-dasharray: 3 3; fill: none; } .key.bcast::before { background: #8a4fb3; } .stat.bcast { border-left-color: #8a4fb3; } .chart .bc-scale { fill: #6a3d8a; font-size: 10px; } .tip-row.bcast { color: #e3c9f5; }
.spark { display: block; } .spark-line { fill: none; stroke: #8a4fb3; stroke-width: 1.4; stroke-linejoin: round; } .bc-filters { align-items: flex-end; gap: 0.7rem; flex-wrap: wrap; } .bc-f { display: grid; gap: 0.2rem; } .bc-f select, .bc-f input { min-width: 9rem; }
.pw-wrap { position: relative; display: grid; } .pw-wrap input { padding-right: 4.6rem; } .pw-toggle { position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #0b7a8f; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; padding: 0.35rem 0.6rem; min-height: 2rem; border-radius: 6px; } .pw-toggle:hover { background: #e3f1f4; } .pw-toggle:focus-visible { outline: 2px solid #0b7a8f; outline-offset: 1px; }
.dp-summary { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.9rem; } .dp-count { font-weight: 600; color: #3b4a54; }
.dp-banner { border-left: 4px solid #c0392b; background: #fdf1ef; border-radius: 6px; padding: 0.7rem 0.9rem; margin-bottom: 1rem; line-height: 1.45; color: #4a2420; }
.dp-wrap { overflow-x: auto; border: 1px solid #dde6ea; border-radius: 8px; margin-bottom: 0.9rem; } .dp-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.dp-table th { text-align: left; font-size: 0.78rem; letter-spacing: 0.03em; text-transform: uppercase; color: #5a6b75; background: #f3f7f9; padding: 0.55rem 0.8rem; white-space: nowrap; } .dp-table td { padding: 0.6rem 0.8rem; border-top: 1px solid #e6edf0; vertical-align: middle; }
.dp-table tbody tr:hover { background: #f8fbfc; } .dp-actions { gap: 0.6rem; margin-top: 0.4rem; }
@media (max-width: 640px) { .dp-wrap { border: 0; } .dp-table thead { display: none; } .dp-table, .dp-table tbody, .dp-table tr, .dp-table td { display: block; width: 100%; } .dp-table tr { border: 1px solid #dde6ea; border-radius: 8px; margin-bottom: 0.6rem; padding: 0.3rem 0; background: #fff; } .dp-table td { border: 0; padding: 0.3rem 0.8rem; display: flex; justify-content: space-between; gap: 1rem; } .dp-table td::before { content: attr(data-label); color: #5a6b75; font-size: 0.8rem; flex: none; } }
dialog.wide:has(.dp-table) { width: min(780px, 96vw); }
.hw-card { background: #fff; border: 1px solid #dde6ea; border-radius: 10px; padding: 0.9rem 1rem; margin-bottom: 1rem; } .hw-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.6rem; } .hw-head h3 { margin: 0; font-size: 1rem; }
.hw-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; } .hw-chips:empty { display: none; } .hw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.8rem; } .hw-cell .strong { font-size: 1.05rem; }
.sl-msg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84rem; word-break: break-word; } .sl-flapchip { margin-right: 0.4rem; } .nowrap { white-space: nowrap; }
.sl-ports { display: flex; flex-wrap: wrap; gap: 0.35rem; } .sl-port { font-size: 0.8rem; } .pill-state.opt-none { color: #5a6b75; background: #f3f7f9; border-color: #dde6ea; } .sl-origin { border-left-color: #b45f00; background: #fff8ee; color: #4a3417; }
.sl-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0.8rem 0; } .sl-dl dt { color: #5a6b75; font-weight: 600; } .sl-dl dd { margin: 0; }
.tr-moved { color: #b45f00; font-weight: 700; }
.sl-what { min-width: 20rem; }
.sl-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.sl-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #9aa6b2; flex: none; }
.sl-dot.tone-ok { background: #1a8a4a; } .sl-dot.tone-warn { background: #d98200; } .sl-dot.tone-bad { background: #c62828; }
.sl-title.tone-bad { color: #a31f1f; } .sl-title.tone-warn { color: #8a5200; }
.sl-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #5b6b7a; border: 1px solid #d5dde5; border-radius: .75rem; padding: .05rem .5rem; }
.sl-text { margin-top: .15rem; }
.sl-facts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.sl-fact { font-size: .78rem; background: #eef2f6; border-radius: .4rem; padding: .1rem .45rem; }
.sl-raw summary { cursor: pointer; margin-top: .3rem; }
.sl-raw pre { white-space: pre-wrap; word-break: break-all; margin: .3rem 0 0; }

/* the log fits the screen: long unbroken text wraps instead of widening the table, so there is no sideways scrolling */
.sl-log .table-wrap { overflow-x: visible; }
.sl-log table { min-width: 0; }
.sl-log td, .sl-what, .sl-text { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
@media (min-width: 900px) {
  .sl-log table { table-layout: fixed; }
  .sl-log th:nth-child(1), .sl-log td:nth-child(1) { width: 10.5rem; }
  .sl-log th:nth-child(2), .sl-log td:nth-child(2) { width: 11rem; }
}
.sl-count { font-size: .75rem; font-weight: 700; background: #e7edf3; border-radius: .75rem; padding: .05rem .5rem; }

/* ---------- fibre health v3: cards, a port grid that fits the screen, and a reason under every flagged port ---------- */
.fibre-page { container-type: inline-size; gap: 1.1rem; }
.fibre-page .health-bar { height: 0.55rem; }
.fibre-page .health-legend { font-size: 0.86rem; color: var(--muted); }
.fibre-page .health-legend b { color: var(--text); }
.fibre-page .kpi-row { grid-template-columns: repeat(auto-fit, minmax(9.6rem, 1fr)); gap: 0.75rem; }
.fibre-page .kpi-btn { padding: 0.85rem 1rem 0.8rem; border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgb(11 34 48 / 6%); transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease; }
.fibre-page .kpi-btn:hover { box-shadow: 0 6px 16px rgb(11 34 48 / 12%); transform: translateY(-1px); }
.fibre-page .kpi-btn.tone-attention { border-top-color: var(--teal); } .fibre-page .kpi-btn.tone-alarm { border-top-color: #d6453c; } .fibre-page .kpi-btn.tone-warn { border-top-color: #e0a000; }
.fibre-page .kpi-btn.tone-ok { border-top-color: #2fb87a; } .fibre-page .kpi-btn.tone-nodata { border-top-color: #9aa9b2; }
.fibre-page .kpi-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--teal); }
.fibre-page .kpi-n { font-size: 2rem; letter-spacing: -0.02em; }
.fibre-page .kpi-t { font-size: 0.84rem; }
.fgroup-head { border-radius: 12px; padding: 0.8rem 1rem; box-shadow: 0 1px 2px rgb(11 34 48 / 5%); }
.fgroup-head[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }
.fgroup-body { border-radius: 0 0 12px 12px; overflow: hidden; }

.fports { font-size: 0.93rem; }
.fports-head, .fport { display: grid; grid-template-columns: 6.6rem minmax(13rem, 1.7fr) minmax(9.5rem, 1fr) 4.8rem 5.6rem 6.4rem 5.8rem 3.8rem; gap: 0.5rem 1rem; align-items: center; padding: 0.7rem 1rem; }
.fports-head { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 60%, var(--surface)); }
.fport { border-top: 1px solid var(--line); box-shadow: inset 3px 0 0 transparent; }
.fports-head + .fport { border-top: 0; }
.fport:hover { background: color-mix(in srgb, var(--surface) 94%, var(--teal)); }
.fport.sev-alarm { box-shadow: inset 3px 0 0 #d6453c; background: color-mix(in srgb, var(--surface) 95%, #d6453c); }
.fport.sev-warn { box-shadow: inset 3px 0 0 #e0a000; }
.fp-main, .fp-nums { display: contents; }
.fports .num { text-align: right; font-variant-numeric: tabular-nums; }
.fp-port { min-width: 0; overflow-wrap: anywhere; }
.fp-alias { margin-top: 0.1rem; }
.fp-why { margin-top: 0.25rem; font-size: 0.86rem; line-height: 1.4; color: var(--muted); }
.fp-why.why-alarm { color: var(--bad); } .fp-why.why-warn { color: var(--warn); }
.fp-rx { min-width: 0; }
.fp-rx .light-n { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.fp-rx svg.gauge { display: block; width: 100%; max-width: 120px; margin-top: 0.25rem; }
.fp-trend svg.trend { display: block; width: 96px; height: 24px; }

@container (max-width: 1060px) {
  .fports-head { display: none; }
  .fport { display: flex; flex-wrap: wrap; gap: 0.5rem 1.3rem; padding: 0.85rem 1rem; }
  .fp-main { display: flex; flex: 1 1 100%; gap: 0.9rem; align-items: flex-start; }
  .fp-status { flex: 0 0 6.6rem; }
  .fp-port { flex: 1 1 auto; }
  .fp-nums { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 0.6rem 1.5rem; padding-left: 7.5rem; }
  .fp-nums > div { min-width: 0; }
  .fp-nums > div::before { content: attr(data-label); display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
  .fports .fp-nums .num { text-align: left; }
}
@container (max-width: 560px) {
  .fp-main { flex-direction: column; gap: 0.4rem; }
  .fp-status { flex: 0 0 auto; }
  .fp-nums { padding-left: 0; }
}

.unreadable { border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--surface) 94%, var(--warn)); }
.unreadable > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; padding: 0.75rem 1rem; cursor: pointer; list-style: none; }
.unreadable > summary::-webkit-details-marker { display: none; }
.unreadable > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 12px; }
.ur-icon { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-grid; place-items: center; background: var(--warn); color: #fff; font-weight: 700; font-size: 0.85rem; flex: none; }
.ur-list { list-style: none; margin: 0; padding: 0 1rem 1rem; display: grid; gap: 0.6rem; }
.ur-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.9rem; display: grid; gap: 0.25rem; min-width: 0; overflow-wrap: anywhere; }
.ur-top { display: flex; flex-wrap: wrap; gap: 0.4rem 0.7rem; align-items: center; }
.ur-fix { font-size: 0.88rem; border-left: 3px solid var(--teal); padding-left: 0.65rem; margin: 0.15rem 0; }
.fibre-help { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0.6rem 1rem; }
.fibre-help > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.fibre-help p { margin: 0.5rem 0 0.1rem; }

.fports-head, .fport { grid-template-columns: 6.6rem minmax(13rem, 1.6fr) minmax(9.5rem, 1fr) 4.8rem 6.6rem 6.4rem 6.2rem 3.8rem; }
.fports-head > .fp-nums > div, .fports-head > .fp-main > div { text-wrap: balance; }
.fp-more { display: block; width: 100%; text-align: left; font: inherit; font-weight: 600; font-size: 0.88rem; color: var(--teal-strong); background: color-mix(in srgb, var(--paper) 55%, var(--surface)); border: 0; border-top: 1px solid var(--line); padding: 0.65rem 1rem; cursor: pointer; }
.fp-more:hover { background: color-mix(in srgb, var(--surface) 90%, var(--teal)); }
.fp-more:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.fp-quiet[hidden] { display: none; }
.ur-show { margin-left: auto; color: var(--teal-strong); font-weight: 600; }
.unreadable[open] .ur-show { display: none; }
@container (max-width: 1060px) { .fports-head, .fport { grid-template-columns: none; } }

/* ---------- map editor: select several, move several, or move everything ---------- */
.map-movebar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.map-movebar[hidden] { display: none; }
.map-movebar .mv-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.map-movebar .mv-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; margin-right: 0.15rem; }
.map-movebar .mv-status { flex: 1 1 16rem; min-width: 0; }
.map-movebar .btn[aria-pressed="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.mnode.grp .mn-bg { stroke: #7fd1ff; stroke-width: 2.5; }
.grp-box { fill: rgb(127 209 255 / 8%); stroke: #7fd1ff; stroke-width: 1.5; stroke-dasharray: 6 4; pointer-events: none; }
.map-rubber { fill: rgb(127 209 255 / 18%); stroke: #7fd1ff; stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.map-svg.moveall, .map-svg.moveall .mnode { cursor: move; }
.map-svg:focus { outline: none; }

/* ---------- map look: new (calmer lines, one clean label, badges only for problems). The classic look above is untouched. ---------- */
.look-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-right: 0.4rem; }
.look-group .mv-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; margin-right: 0.15rem; }
.look-group select[hidden] { display: none; }
.map-svg.look-new .lk { stroke-width: 3; }
.map-svg.look-new .lk.ok { stroke: #46b98a; opacity: 0.8; }
.map-svg.look-new .lk.nodata { stroke: #7f9bab; opacity: 0.85; }
.map-svg.look-new .lk.plain { stroke: #9fc1cf; stroke-width: 2; }
.map-svg.look-new .mn-ring.up { stroke: #46b98a; stroke-width: 1.5; opacity: 0.85; }
.map-svg.look-new .mn-ring.down { stroke-width: 4; }
/* no boxes behind the text, as in the classic look: the letters carry their own thin outline instead */
.map-svg.look-new .mn-label-bg, .map-svg.look-new .lk-bg { fill: none; stroke: none; }
.map-svg.look-new .mn-label { font-size: 11.5px; font-weight: 650; paint-order: stroke; stroke: #0e4a66; stroke-width: 3px; stroke-linejoin: round; }
.map-svg.look-new .lk-label { font-size: 11.5px; font-weight: 650; fill: #fff; }
.map-svg.look-new .lk-cap { font-weight: 700; fill: #fff; }
.map-svg.look-new .lk-rate { font-weight: 600; fill: #a9dcc4; }
.map-svg.look-new .lk-rate.warn { fill: #f0b429; } .map-svg.look-new .lk-rate.high { fill: #ff9a3c; }
.map-svg.look-new .lk-rate.crit, .map-svg.look-new .lk-rate.down { fill: #ff8a7e; } .map-svg.look-new .lk-rate.nodata { fill: #9fb6c1; }
.map-svg.look-new .lk-live { fill: #cfe6ee; font-size: 10.5px; }

/* ---------- map: the two options of the new look, the pin, and the Tidy / Auto-arrange preview ---------- */
.look-opt { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; cursor: pointer; }
.look-opt[hidden] { display: none; }
.map-svg.look-new .mn-addr { fill: #cfe6ee; font-size: 10.5px; font-weight: 500; text-anchor: middle; paint-order: stroke; stroke: #0e4a66; stroke-width: 3px; stroke-linejoin: round; }
.mn-pin circle { fill: #f0b429; stroke: #0e4a66; stroke-width: 2; }
.mn-pin path { fill: none; stroke: #0e4a66; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.map-previewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; padding: 0.55rem 0.8rem; border: 2px solid var(--teal); border-radius: 12px; background: var(--surface); }
.map-previewbar[hidden] { display: none; }
.map-previewbar .mv-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--teal-strong); font-weight: 700; }
.map-previewbar .pv-status { flex: 1 1 16rem; min-width: 0; font-size: 0.88rem; }

.map-svg.look-new .lk-sub { font-size: 10.5px; font-weight: 500; fill: #cfe6ee; }

.map-svg.look-new .lk-leader { stroke: #cfe6ee; stroke-opacity: 0.6; stroke-width: 1; pointer-events: none; }

/* ---------- map: which port is down, under the device ---------- */
.mn-down-head { fill: #ffb3ab; font-size: 10.5px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #0e4a66; stroke-width: 3px; stroke-linejoin: round; }
.mn-down-desc { fill: #ffd9d4; font-size: 10px; font-weight: 500; text-anchor: middle; paint-order: stroke; stroke: #0e4a66; stroke-width: 3px; stroke-linejoin: round; }

/* ---------- the outage and recovery report ---------- */
.ocard { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgb(11 34 48 / 6%); }
.ocard:hover { box-shadow: 0 6px 16px rgb(11 34 48 / 12%); } .ocard-t { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.2rem; } .ocard > div { flex: 1 1 24rem; }
.orpt-bar { flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; } .orpt-bar label { display: inline-flex; align-items: center; gap: 0.35rem; } .orpt-bar a.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.odates[hidden] { display: none; } .odates { gap: 0.6rem; }
.orpt { color: #12202a; } .orpt .rkpis { grid-template-columns: repeat(5, 1fr); } .orpt .rkpi-v { font-size: 1.35rem; } .orpt .rkpi-s { min-height: 1.1em; }
.okpi-head { margin: 1rem 0 0.4rem; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.onotice { margin: 0 0 0.9rem; padding: 0.55rem 0.8rem; border-left: 4px solid #e0a000; background: #fff8e6; border-radius: 4px; font-size: 0.88rem; }
.oempty { margin: 1.1rem 0; padding: 0.9rem 1.1rem; border: 1px solid #b7e4cf; border-left: 5px solid #2fb87a; background: #effaf4; border-radius: 8px; }
.onote { padding: 1.5rem 0; } .nowrap { white-space: nowrap; } .onone { margin: 0.6rem 0 0; line-height: 1.5; }
.otag { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 99px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.otag.warn { background: #fff1d6; color: #8a5a00; border-color: #f0d49a; } .otag.info { background: #e4f0f7; color: #17566f; border-color: #bcd8e6; } .otag.bad { background: #fde6e3; color: #a3281f; border-color: #f2bdb7; } .otag.mute { background: #eef2f4; color: #5b6b75; border-color: #d5dee3; }
.odown { white-space: nowrap; min-width: 7.5rem; } .odown > span:first-child { display: inline-block; min-width: 4.2rem; } .obar { display: inline-block; vertical-align: middle; width: 4.5rem; height: 0.5rem; background: #e6edf0; border-radius: 99px; overflow: hidden; margin-left: 0.4rem; } .obar > span { display: block; height: 100%; background: #d6453c; border-radius: 99px; }
.olegend { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; margin-bottom: 0.3rem; } .olegend .osw, .olegend .opa { width: 0.75rem; height: 0.75rem; border-radius: 2px; display: inline-block; margin-left: 0.6rem; } .olegend .osw { background: #0b6b83; } .olegend .opa { background: #e0a000; }
.ochart { width: 100%; height: auto; display: block; } .ochart .ogrid { stroke: #d5dee3; stroke-width: 1; } .ochart .oaxis { fill: #5b6b75; font-size: 10px; } .ochart .obar-sw { fill: #0b6b83; } .ochart .obar-pa { fill: #e0a000; } .ochart .ohit { fill: transparent; }
.orpt table { width: 100%; } .orpt td, .orpt th { vertical-align: top; }
@media print {
  .orpt .rkpis { grid-template-columns: repeat(5, 1fr); gap: 0.4rem; } .orpt .rkpi { padding: 0.45rem 0.55rem; } .orpt .rkpi-v { font-size: 12pt; } .orpt .rkpi-l { font-size: 6.5pt; }
  .otag, .obar, .obar > span, .onotice, .oempty, .olegend .osw, .olegend .opa, .ochart rect { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .orpt .rsec { break-inside: auto; } .orpt .rsec h2 { break-after: avoid; } .orpt tr { break-inside: avoid; } .orpt thead { display: table-header-group; }
  .orpt table { font-size: 8.5pt; } .orpt .odown { min-width: 0; } .orpt .obar { width: 3rem; }
}

.orpt .rkpi-l { min-height: 2.3em; } .orpt .rkpi-v { white-space: nowrap; }
@media print { .orpt .ochart-sec { break-inside: avoid; } .orpt .rkpi-v { font-size: 10.5pt; } .orpt .rkpi-s { font-size: 7pt; } .orpt .rkpi { padding: 0.4rem 0.5rem; } }

.otag.prot { background: #efe6fb; color: #5a2a96; border-color: #d3bdf0; } .oev { color: var(--muted); margin-top: 0.15rem; line-height: 1.35; max-width: 34rem; } .oshort { margin-left: 0.3rem; font-weight: 600; }
@media print { .otag.prot { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .orpt .oev { max-width: none; } }

/* ---------- the ISP performance report, its set-up and the saved reports ---------- */
.iobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; } .iobs li { display: flex; gap: 0.6rem; align-items: baseline; padding: 0.45rem 0.7rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.iobs-i { font-weight: 700; flex: none; width: 1.1rem; text-align: center; } .iobs-ok { border-left: 4px solid #2fb87a; } .iobs-ok .iobs-i { color: #1a8a58; } .iobs-warn { border-left: 4px solid #e0a000; background: #fff8e6; } .iobs-warn .iobs-i { color: #a06a00; } .iobs-info { border-left: 4px solid #8aa0ab; }
.ihours { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 0.9rem; } .ihour-card { margin: 0; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; break-inside: avoid; } .ihour-card figcaption { margin-bottom: 0.2rem; }
.ihour .ipeak { fill: #fdf0cf; } .ihour .iloss.iok { fill: #2fb87a; } .ihour .iloss.iwarn { fill: #e0a000; } .ihour .iloss.ibad { fill: #d6453c; } .ihour .iloss.inone { fill: #d5dee3; }
.itargets { display: grid; gap: 0.5rem; margin: 0.4rem 0; } .itarget { gap: 0.5rem; flex-wrap: wrap; align-items: center; } .itarget input[type=text] { min-width: 12rem; flex: 1 1 12rem; }
.itest { margin-top: 0.8rem; } .itest-line { padding: 0.45rem 0.7rem; border-radius: 6px; margin-bottom: 0.4rem; border: 1px solid var(--line); } .itest-line.good { background: #effaf4; border-color: #b7e4cf; } .itest-line.bad { background: #fde6e3; border-color: #f2bdb7; }
.ihelp { margin-top: 1rem; padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); } .ihelp pre { overflow-x: auto; padding: 0.6rem; background: #0e2a38; color: #d6eef7; border-radius: 6px; font-size: 0.82rem; }
.notice { padding: 0.8rem 1rem; border-left: 4px solid #e0a000; background: #fff8e6; border-radius: 4px; }
@media print { .ihour-card { border: 1px solid #d5dee3; } .ihours { grid-template-columns: repeat(2, 1fr); } .ihour .ipeak, .ihour .iloss, .iobs li { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .iobs li { break-inside: avoid; } }

/* ---------- the ISP report: verdict, scorecard, issue cards, uplink ---------- */
.iverdict { margin: 0.9rem 0 0.4rem; padding: 0.9rem 1.1rem; border-radius: 10px; border: 1px solid var(--line); border-left: 6px solid #8aa0ab; background: #f3f7f9; break-inside: avoid; }
.iverdict.iv-good { border-left-color: #2fb87a; background: #effaf4; } .iverdict.iv-attention { border-left-color: #e0a000; background: #fff8e6; } .iverdict.iv-problem { border-left-color: #d6453c; background: #fdeceb; }
.iv-head { display: flex; align-items: center; gap: 0.55rem; font-size: 1.25rem; font-weight: 800; } .iv-dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: #8aa0ab; flex: none; } .iv-good .iv-dot { background: #2fb87a; } .iv-attention .iv-dot { background: #e0a000; } .iv-problem .iv-dot { background: #d6453c; }
.iv-text { margin: 0.45rem 0 0.5rem; line-height: 1.5; } .iv-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; } .ichip { padding: 0.12rem 0.65rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 0.8rem; font-weight: 600; } .ichip.esc { background: #d6453c; color: #fff; border-color: #d6453c; }
.inum { display: inline-flex; width: 1.5rem; height: 1.5rem; border-radius: 50%; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 0.8rem; background: #5a7a8a; } .inum.sev-high { background: #d6453c; } .inum.sev-medium { background: #c98a00; } .inum.sev-low { background: #5a7a8a; }
.ioff { margin-left: 0.4rem; } .ispark { width: 7.5rem; height: 1.7rem; } .ispark-l { fill: none; stroke: #0b6b83; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } .ispark-d { fill: #0b6b83; } .ispark.high .ispark-l { stroke: #d6453c; } .ispark.high .ispark-d { fill: #d6453c; } .ispark.medium .ispark-l { stroke: #c98a00; } .ispark.medium .ispark-d { fill: #c98a00; }
.icards { display: grid; gap: 0.8rem; } .icard { border: 1px solid var(--line); border-left: 5px solid #5a7a8a; border-radius: 8px; padding: 0.7rem 0.9rem; background: #fff; break-inside: avoid; } .icard.sev-high { border-left-color: #d6453c; } .icard.sev-medium { border-left-color: #c98a00; }
.icard header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.45rem; } .icard header .ilive { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: #5b6b75; padding: 0.1rem 0.5rem; border-radius: 99px; border: 1px solid var(--line); } .icard header .ilive.on { background: #0b6b83; color: #fff; border-color: #0b6b83; }
.otag.sevtag.high { background: #d6453c; color: #fff; border-color: #d6453c; } .otag.sevtag.medium { background: #c98a00; color: #fff; border-color: #c98a00; } .otag.sevtag.low { background: #5a7a8a; color: #fff; border-color: #5a7a8a; } .otag.good { background: #e3f6ec; color: #17704a; border-color: #b7e4cf; }
.idl { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.25rem 0.8rem; margin: 0; font-size: 0.9rem; } .idl dt { color: #5b6b75; font-size: 0.7rem; letter-spacing: 0.06em; padding-top: 0.15rem; font-weight: 700; } .idl dd { margin: 0; line-height: 1.4; }
.iclear { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; } .iclear li { display: flex; gap: 0.6rem; align-items: baseline; padding: 0.3rem 0.1rem; border-bottom: 1px solid var(--line); line-height: 1.4; } .iclear .iobs-i { color: #1a8a58; font-weight: 700; width: 1.1rem; flex: none; text-align: center; }
.iup { display: grid; grid-template-columns: 11rem 1fr 4rem; gap: 0.15rem 0.8rem; align-items: center; margin: 0.5rem 0; } .iup-l { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .iup.strong-row .iup-l, .iup.strong-row .iup-v { font-weight: 800; }
.iup-bar { position: relative; height: 0.9rem; background: #e6edf0; border-radius: 99px; overflow: hidden; } .iup-bar > span { display: block; height: 100%; background: #2fb87a; border-radius: 99px; } .iup-bar.hot > span { background: #d6453c; } .iup-mark { position: absolute; left: 80%; top: 0; bottom: 0; width: 0; border-left: 2px dotted #12202a; } .iup-v { text-align: right; font-weight: 700; } .iup-t { grid-column: 2 / 4; margin-top: -0.1rem; }
.iports { display: grid; gap: 0.25rem; margin-top: 0.5rem; max-height: 16rem; overflow: auto; }
@media print { .iverdict, .icard, .iup-bar, .iup-bar > span, .inum, .ispark, .otag.sevtag, .ichip.esc, .ilive.on { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .icards { gap: 0.55rem; } .icard { padding: 0.5rem 0.7rem; } .idl { font-size: 8.5pt; } .iv-head { font-size: 14pt; } .ispark { width: 6rem; } .iup { grid-template-columns: 9rem 1fr 3.2rem; } }

@media print { .orpt .rsec > h2 { break-inside: avoid; page-break-inside: avoid; break-after: avoid; page-break-after: avoid; } .orpt .rsec > h2 + p, .orpt .rsec > h2 + .table-wrap { break-before: avoid; } }
@media print { .orpt .rsec.keep { break-inside: avoid; page-break-inside: avoid; } }

/* ---------- the measurement agent: report sections and set-up ---------- */
.igroup { margin: 0.9rem 0 0.4rem; } .igroup-h { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #0b6b83; margin: 0.6rem 0 0.2rem; font-weight: 700; }
.ireach { display: grid; grid-template-columns: 14rem 1fr 4.5rem; gap: 0.1rem 0.8rem; align-items: center; margin: 0.35rem 0; break-inside: avoid; } .ireach .iup-bar > span { background: #0b6b83; } .ireach .iup-bar.hot > span { background: #c98a00; } .iup-v.over { color: #b26b00; font-weight: 800; }
.imatrix td.num, .imatrix th.num { text-align: center; } .imatrix .mx-g { background: #e3f6ec; } .imatrix .mx-y { background: #fff3cf; } .imatrix .mx-r { background: #fde0dd; } .imatrix .mx-none { color: #9aaab3; }
.ipath { margin: 0.8rem 0; break-inside: avoid; }
.iagent { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; background: #fff; } .iagent h2 { margin: 0 0 0.2rem; } .iagent-list { display: grid; gap: 0.4rem; } .iagent-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.itext { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.4; padding: 0.5rem; border: 1px solid var(--line); border-radius: 6px; white-space: pre; overflow: auto; } .icmd { background: #12202a; color: #e8f1f5; padding: 0.7rem 0.9rem; border-radius: 8px; overflow: auto; font-size: 0.8rem; white-space: pre; }
.otag.mute { background: #eef2f4; color: #5b6b75; border-color: #d5dde1; }
@media print { .ireach { grid-template-columns: 10rem 1fr 3.4rem; } .imatrix .mx-g, .imatrix .mx-y, .imatrix .mx-r { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.ireach .iup-l { white-space: normal; overflow: visible; line-height: 1.25; } .ireach .iup-l .small { display: block; } .ireach .iup-v { white-space: nowrap; }
@media print { .ireach { grid-template-columns: 10rem 1fr 4.6rem; } }

.iverdict-line { margin: 0.4rem 0 0.7rem; padding: 0.5rem 0.8rem; border-left: 4px solid #0b6b83; background: #eef6f9; border-radius: 4px; line-height: 1.45; break-inside: avoid; }

/* ---------- the two editions: switch, note, header, and what we ask ---------- */
.oseg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; } .oseg-b { border: 0; background: transparent; padding: 0.38rem 0.85rem; font: inherit; font-size: 0.85rem; cursor: pointer; color: #3a4b55; } .oseg-b + .oseg-b { border-left: 1px solid var(--line); } .oseg-b.on { background: #0b6b83; color: #fff; font-weight: 600; } .oseg-b:focus-visible { outline: 2px solid #0b6b83; outline-offset: -2px; }
.oedition { margin: 0.1rem 0 0.4rem; padding: 0.45rem 0.8rem; font-size: 0.82rem; color: #3a4b55; background: #f1f6f8; border-left: 3px solid #0b6b83; border-radius: 4px; }
.rbrandrow { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; } .rbrandrow .rbrand { margin: 0; } .rmark { width: 1.55rem; height: 1.55rem; border-radius: 6px; background: linear-gradient(135deg, #0b6b83, #12a2bf); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex: none; }
.epill { padding: 0.1rem 0.6rem; border-radius: 99px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid #c9d6dc; color: #4a5c66; background: #f4f8fa; } .epill.isp { background: #e6f4f8; border-color: #9fd2e0; color: #0b6b83; } .epill.mgmt { background: #f0f0f6; border-color: #cfcfe2; color: #4b4b7a; }
.iactions { margin: 0.7rem 0 0.4rem; padding: 0.8rem 1rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; break-inside: avoid; } .iactions h2 { margin: 0 0 0.45rem; font-size: 1.02rem; } .iactions ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.35rem; line-height: 1.4; } .iactions li::marker { font-weight: 700; color: #0b6b83; }
@media print { .rmark, .epill, .oseg-b.on { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .oedition, .oseg { display: none; } }
.iup-l { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.2; }
@media print { .orpt .rsec > p { break-after: avoid; page-break-after: avoid; } .orpt .rsec > p + .ipath, .orpt .rsec > p + .igroup { break-before: avoid; } }

/* ---------- what customers feel, and the change since the previous period ---------- */
.ifeel { margin: 0.9rem 0 0.5rem; } .ifeel h2 { margin: 0 0 0.15rem; font-size: 1.05rem; } .ifeel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.6rem; margin-top: 0.5rem; }
.ifc { border: 1px solid var(--line); border-left: 5px solid #8aa0ab; border-radius: 8px; padding: 0.55rem 0.8rem; background: #fff; break-inside: avoid; } .ifc-good { border-left-color: #2fb87a; } .ifc-ok { border-left-color: #e0a000; } .ifc-poor { border-left-color: #d6453c; }
.ifc-h { display: flex; align-items: center; gap: 0.45rem; } .ifc-dot { width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 0.8rem; font-weight: 800; flex: none; background: #8aa0ab; } .ifc-good .ifc-dot { background: #2fb87a; } .ifc-ok .ifc-dot { background: #e0a000; } .ifc-poor .ifc-dot { background: #d6453c; } .ifc-lv { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: #5b6b75; }
.ifc ul { margin: 0.35rem 0 0.25rem; padding-left: 1.1rem; font-size: 0.86rem; line-height: 1.35; } .ifc-rule { font-size: 0.7rem; line-height: 1.3; }
.ichg { white-space: nowrap; font-weight: 600; } .ichg.better { color: #17704a; } .ichg.worse { color: #b3261e; } .hosttxt { word-break: break-all; font-family: inherit; }
@media print { .ifc-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .ifeel-grid { grid-template-columns: repeat(2, 1fr); } }
@media print { .ifeel { break-inside: avoid; page-break-inside: avoid; } }

/* ---------- Generate, and the speed section's delay under load ---------- */
.igen { border: 1px solid var(--line); border-left: 5px solid #8aa0ab; border-radius: 8px; padding: 0.5rem 0.8rem; background: #f6f9fb; font-size: 0.9rem; } .igen.busy { border-left-color: #1a7fb4; } .igen.good { border-left-color: #2fb87a; background: #f1faf5; } .igen.warn { border-left-color: #e0a000; background: #fff8e6; } .igen.error { border-left-color: #d6453c; background: #fdeeed; }
.igen-speed { display: inline-flex; align-items: center; gap: 0.3rem; } .ilat { margin-top: 0.4rem; } .ilat p { margin: 0.15rem 0; } .ilat-warn { color: #b3261e; }

/* ---------- web pages: do they arrive complete? ---------- */
.iwebg { border: 1px solid var(--line); border-left: 5px solid #8aa0ab; border-radius: 8px; padding: 0.55rem 0.85rem; margin: 0.55rem 0; background: #fff; break-inside: avoid; } .iwebg-good { border-left-color: #2fb87a; } .iwebg-ok { border-left-color: #e0a000; } .iwebg-poor { border-left-color: #d6453c; }
.iwebg ul { margin: 0.3rem 0; padding-left: 1.1rem; font-size: 0.88rem; line-height: 1.4; } .iwebp { background: #f6f9fb; border-radius: 6px; padding: 0.4rem 0.7rem; margin: 0.4rem 0; } .iwebp ul { margin: 0.2rem 0 0; }
.otag.bad { background: #fdeeed; color: #b3261e; border-color: #f3c3bf; }
@media print { .rsec > h2 + p { break-after: avoid; page-break-after: avoid; } .iwebg + .iwebg { margin-top: 0.4rem; } }
@media print { .rsec > h2 { break-after: avoid; page-break-after: avoid; } .rsec > h2 + p { break-inside: avoid; page-break-inside: avoid; } }

.rtaken { font-size: 1.05rem; font-weight: 700; }

/* ---------- the site report ---------- */
.sfinds { display: grid; gap: 0.6rem; } .sfind { border: 1px solid var(--line); border-left: 5px solid #8aa0ab; border-radius: 8px; padding: 0.6rem 0.9rem; background: #fff; break-inside: avoid; } .sfind.sev-high { border-left-color: #d6453c; } .sfind.sev-medium { border-left-color: #e0a000; } .sfind.sev-low { border-left-color: #2fb87a; }
.sfind-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; } .sfind-o { margin-left: auto; } .sfind ul { margin: 0.35rem 0; padding-left: 1.1rem; font-size: 0.9rem; line-height: 1.4; } .sfind-a { margin: 0.3rem 0 0; font-size: 0.9rem; }
.sfeeder { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.9rem; margin: 0.6rem 0; break-inside: avoid; } .sfeeder-h { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.sprofile { width: 100%; max-width: 560px; height: auto; display: block; } .sspark { display: block; } .sp-peak { fill: #1a7fb4; } .sp-off { fill: #b9cdd8; }
.otag.mute { background: #eef2f4; color: #5b6b75; border-color: #d8e0e5; } .stogether h3 { font-size: 0.95rem; margin: 0.6rem 0 0.2rem; } .stogether ul { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; }
.ssetup { margin: 0.6rem 0; } .ssetup .row { gap: 0.8rem; align-items: center; margin-top: 0.5rem; } .ssetup-links { display: grid; gap: 0.15rem; margin: 0.3rem 0 0.2rem 1.4rem; }
@media print { .sfind, .sfeeder, .sp-peak, .sp-off { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .sp-peak { fill: #1a7fb4 !important; } .sp-off { fill: #b9cdd8 !important; } }

.slinks table { table-layout: auto; } .slinks td:first-child, .slinks th:first-child { min-width: 17rem; } .slinks td { vertical-align: top; }

.iverdict.iv-unknown { border-left-color: #6c8fa6; background: #eef4f8; } .iv-unknown .iv-dot { background: #6c8fa6; }

/* ---------- the saved lists, by kind ---------- */
.stabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.4rem; } .stab { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: inherit; background: #fff; font-size: 0.9rem; }
.stab.on { background: #0b6e86; border-color: #0b6e86; color: #fff; font-weight: 700; } .stab-n { font-size: 0.75rem; padding: 0 0.4rem; border-radius: 999px; background: #eef2f4; color: #4a5a64; } .stab.on .stab-n { background: rgba(255,255,255,0.25); color: #fff; }
.sfilters { gap: 1rem; margin: 0.2rem 0 0.5rem; } .spager { margin-top: 0.6rem; align-items: center; } .saved-links { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: 0.3rem 0.2rem; } .saved-links a { font-size: 0.92rem; }

/* ---------- ISP report: since the previous report ---------- */
.isince-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0.4rem 0; } .isince-col h3 { font-size: 0.95rem; margin: 0 0 0.3rem; } .isince-col ul { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; } .isince-col li { margin-bottom: 0.3rem; }
.isince { break-inside: avoid; } .isince-none { margin: 0.4rem 0; }
@media (max-width: 760px) { .isince-grid { grid-template-columns: 1fr; } }

/* the incident summary of the ISP report: what a provider's NOC reads first */
.iincidents { margin: 0.8rem 0 0.4rem; } .iincidents h2 { margin: 0 0 0.45rem; font-size: 1.02rem; }
.iincident { margin: 0 0 0.8rem; padding: 0.85rem 1rem 0.95rem; border: 1px solid var(--line); border-left: 5px solid #c0392b; border-radius: 10px; background: #fff; break-inside: avoid; page-break-inside: avoid; }
.iincident.mine { border-left-color: #b8730b; }
.iincident header { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.iincident .iref { font: 700 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; color: #0b6b83; }
.iincident .istatus { font-size: 0.74rem; font-weight: 700; padding: 0.18rem 0.55rem; border-radius: 999px; } .iincident .istatus.done { background: #e4f4ea; color: #1d6b3a; } .iincident .istatus.live { background: #fdeaea; color: #a52a22; }
.iincident h3 { margin: 0.1rem 0 0.55rem; font-size: 1.12rem; line-height: 1.3; }
.ifacts { margin: 0 0 0.6rem; display: grid; gap: 0.18rem; } .ifact { display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.6rem; font-size: 0.86rem; line-height: 1.35; } .ifact dt { margin: 0; color: #5b6b78; font-weight: 600; } .ifact dd { margin: 0; }
.ichart { margin: 0.2rem 0 0.5rem; } .tchart { display: block; max-width: 100%; height: auto; } .tchart text { font-family: inherit; }
.tchart-key { margin: 0.1rem 0 0; display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; } .k-line, .k-dash, .k-shade { display: inline-block; width: 1.5rem; height: 0; vertical-align: middle; } .k-line { border-top: 2px solid #0b6b83; } .k-dash { border-top: 2px dashed #8794a0; } .k-shade { height: 0.6rem; width: 1rem; background: rgba(214, 69, 65, 0.22); border: 1px solid rgba(214, 69, 65, 0.5); }
.ichart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.5rem 0.8rem; margin: 0.5rem 0 0.2rem; }
.ichecks, .iasks { margin: 0.5rem 0 0; } .ichecks h4, .iasks h4 { margin: 0 0 0.25rem; font-size: 0.9rem; }
.ichecks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; font-size: 0.86rem; line-height: 1.35; } .ichecks li .cm { display: inline-block; width: 1.1rem; font-weight: 700; } .ichecks li.ok .cm { color: #1d8a4a; } .ichecks li.bad .cm { color: #c0392b; }
.iasks ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.2rem; font-size: 0.86rem; line-height: 1.38; } .iasks li::marker { font-weight: 700; color: #0b6b83; }
.tevent h4 { font-family: inherit; }
@media print { .iincident { break-inside: avoid; } .ichart-grid { grid-template-columns: repeat(2, 1fr); } }
