/* isitmyisp web UI.
   No JavaScript, no third-party requests, and it works under a CSP without inline styles:
   charts are stretched SVG with HTML labels, hover readouts are pure CSS.
   Data colours mean "who is responsible" (fine / your side / your ISP / someone else) and come
   from a palette validated for colour-vision deficiency; "fine" is also drawn shorter than the
   problem states, so the strip never relies on red vs green alone. */

@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-600.woff2") format("woff2"); }

:root {
  /* light by default; dark follows the system unless the theme button chose one */
  --bg: #f5f7fb;
  --side: #f8fafd;
  --surface: #ffffff;
  --raised: #ffffff;
  --line: #e4e8f0;
  --line-2: #cdd5e2;
  --ink: #0f172a;
  --ink-2: #525d73;
  --ink-3: #6b7489;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #dce7fd;
  --series: #2563eb;
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --good: #22c55e;
  --good-ink: #15803d;
  --you: #f59e0b;
  --isp: #ef4444;
  --other: #7c8799;
  --track: #edf0f5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 6px rgba(16, 24, 40, .05);
  --tip-shadow: 0 8px 24px rgba(16, 24, 40, .14);
  color-scheme: light;
  --r-lg: 18px;
  --r: 14px;
  --r-sm: 10px;
  --font: "Plex", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1121;
    --side: #0c1527;
    --surface: #0f192d;
    --raised: #16223a;
    --line: #1c2943;
    --line-2: #2a3a57;
    --ink: #e8edf6;
    --ink-2: #9ba8c0;
    --ink-3: #7f8ca5;
    --accent: #2563eb;
    --accent-ink: #ffffff;
    --accent-soft: rgba(37, 99, 235, .18);
    --violet: #a855f7;
    --amber: #f59e0b;
    --good-ink: #4ade80;
    --series: #3b82f6;
    --good: #22c55e;
    --you: #f59e0b;
    --isp: #ef4444;
    --other: #94a3b8;
    --track: #17233a;
    --shadow: none;
    --tip-shadow: 0 10px 28px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1121;
  --side: #0c1527;
  --surface: #0f192d;
  --raised: #16223a;
  --line: #1c2943;
  --line-2: #2a3a57;
  --ink: #e8edf6;
  --ink-2: #9ba8c0;
  --ink-3: #7f8ca5;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: rgba(37, 99, 235, .18);
  --violet: #a855f7;
  --amber: #f59e0b;
  --good-ink: #4ade80;
  --series: #3b82f6;
  --good: #22c55e;
  --you: #f59e0b;
  --isp: #ef4444;
  --other: #94a3b8;
  --track: #17233a;
  --shadow: none;
  --tip-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font);
       -webkit-font-smoothing: antialiased; font-feature-settings: "kern"; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:not(:hover) { text-decoration: none; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
b, strong { font-weight: 600; }
.muted { color: var(--ink-2); }
.small, p.small { font-size: 13px; }
.mono, .ip { font-family: var(--mono); font-size: .86em; }
.num, .num-l, .hop-val, .m-val, .m-pct, .r-val, .tip, .stamp, .yt, .xaxis { font-variant-numeric: tabular-nums; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75;
       stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--raised); padding: 8px 12px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }

/* ---------- shell: sidebar with the sections, the active one filled */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side); border-right: 1px solid var(--line); padding: 26px 16px 18px;
           display: flex; flex-direction: column; gap: 30px; position: sticky; top: 0; height: 100vh; }
.brand { display: inline-flex; align-items: center; gap: 11px; padding: 0 10px; color: var(--ink);
         font-weight: 600; font-size: 21px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.mark { width: 38px; height: 38px; flex: none; color: var(--ink); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { color: var(--ink-2); padding: 13px 16px; border-radius: 14px; display: flex; gap: 14px;
         align-items: center; font-weight: 500; font-size: 15.5px; transition: background-color .15s, color .15s; }
.nav a .ico { width: 20px; height: 20px; }
.nav a:hover { background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
:root:not([data-theme="dark"]) .nav a.active { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav a.active {
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); } }
/* the bottom of the sidebar: a quiet status line, then the account menu */
.side-end { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sys { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; padding: 0 12px; font-size: 13px;
       color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sys .live { flex: none; }
.sys-when { color: var(--ink-3); }
.sys.stale .live { background: var(--you); }
.acct { position: relative; }
.acct > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 8px 10px;
                  border-radius: 12px; border: 1px solid transparent; transition: background-color .15s, border-color .15s; }
.acct > summary::-webkit-details-marker { display: none; }
.acct > summary:hover { background: var(--accent-soft); }
.acct[open] > summary { background: var(--surface); border-color: var(--line-2); }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
          background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }
.avatar .ico { width: 17px; height: 17px; }
.acct-who { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.acct-who b { font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who small { font-size: 12.5px; color: var(--ink-3); }
.acct .caret { flex: none; width: 7px; height: 7px; margin-right: 4px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
               transform: translateY(2px) rotate(-135deg); transition: transform .15s; }
.acct[open] .caret { transform: translateY(-2px) rotate(45deg); }
.acct-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 30; padding: 8px;
             background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 30px rgb(0 0 0 / .18); }
.acct-h { margin: 4px 6px 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.acct .lang { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg); }
.acct .lang a { text-align: center; padding: 6px 8px; border-radius: 7px; font-size: 13.5px; color: var(--ink-2); text-decoration: none; }
.acct .lang a:hover { color: var(--ink); }
.acct .lang a[aria-current] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.acct form { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.acct-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border: 0; border-radius: 8px;
             background: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; }
.acct-item:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.acct-item .ico { width: 16px; height: 16px; color: var(--ink-3); }
.acct-ver { margin: 8px 6px 2px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.linkish { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.linkish:hover { color: var(--ink); text-decoration: underline; }
.main { padding: 26px 34px 56px; min-width: 0; width: 100%; max-width: 1640px; margin-inline: auto; }

/* ---------- hero: the verdict and the path it was drawn from */
.where { --blame: var(--other); }
.where.g-you { --blame: var(--you); } .where.g-isp { --blame: var(--isp); } .where.g-good { --blame: var(--good); }
.hero { --blame: var(--other); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
        padding: 30px 34px 26px; position: relative; }
.hero.g-you { --blame: var(--you); }
.hero.g-isp { --blame: var(--isp); }
.hero.g-good { --blame: var(--good); }
.stamp { position: absolute; top: 26px; right: 30px; color: var(--ink-3); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.live.stale { background: var(--ink-3); }
.headline { font-size: 3rem; line-height: 1.05; letter-spacing: -.028em; margin: 0 0 10px; padding-right: 230px; }
.hero .sub { color: var(--ink-2); font-size: 17px; max-width: 62ch; }

.path { list-style: none; margin: 32px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* first node on the left edge, middle one centred, last on the right edge: the path spans the hero */
.hop { position: relative; padding: 32px 0 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hop::before, .hop::after { content: ""; position: absolute; top: 9px; height: 2px; background: var(--line-2); border-radius: 2px; }
.hop:first-child::before, .hop:last-child::after { display: none; }
.hop:first-child::after { left: 22px; right: 0; }
.hop:nth-child(2) { align-items: center; text-align: center; }
.hop:nth-child(2)::before { left: 0; right: calc(50% + 12px); }
.hop:nth-child(2)::after { left: calc(50% + 12px); right: 0; }
.hop:nth-child(2) .node { left: 50%; transform: translateX(-50%); }
.hop:last-child { align-items: flex-end; text-align: right; }
.hop:last-child::before { left: 0; right: 22px; }
.hop:last-child .node { left: auto; right: 0; }
.hop .hop-id { max-width: 100%; }
.node { position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%;
        background: var(--surface); border: 2px solid var(--line-2); }
.s-good .node { border-color: var(--good); background: color-mix(in srgb, var(--good) 22%, var(--surface)); }
.s-warn .node { border-color: var(--you); background: color-mix(in srgb, var(--you) 22%, var(--surface)); }
.s-bad .node { border-color: var(--isp); background: var(--isp); }
.blamed .node { border-color: var(--blame); background: var(--blame); box-shadow: 0 0 0 5px color-mix(in srgb, var(--blame) 26%, transparent); }
.hop-name { font-weight: 600; font-size: 17px; }
.hop-id { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hop-id.ip { color: var(--ink-3); font-size: 12.5px; }
.hop-val { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.hop-val b { color: var(--ink); font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.hop-val .sep { color: var(--ink-3); padding: 0 4px; }
.here { align-self: auto; margin-top: 10px; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 999px;
        background: color-mix(in srgb, var(--blame) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blame) 55%, transparent); }

.advice { display: flex; gap: 12px; margin-top: 22px; padding: 14px 16px; border-radius: var(--r);
          background: color-mix(in srgb, var(--blame) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--blame) 35%, var(--line)); }
.advice .ico { margin-top: 2px; color: var(--ink-2); }
.advice p { max-width: 75ch; }
.evidence { margin-top: 14px; font-size: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.evidence ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.day { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 16px 28px;
       align-items: center; justify-content: space-between; flex-wrap: wrap; }
.day p { color: var(--ink-2); max-width: 70ch; }

/* ---------- panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin-top: 18px; min-width: 0; box-shadow: var(--shadow); }
.panel h2 { margin: 0; font-size: 17px; }
.panel h3 { margin: 0 0 6px; font-size: 15px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.icon-link { color: var(--ink-2); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); }
.icon-link:hover { background: var(--raised); color: var(--ink); }
.pair { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
.pair .panel { margin-top: 18px; }

.key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; color: var(--ink-2); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -.5px; background: var(--track); }
.sw.g-good { background: var(--good); } .sw.g-you { background: var(--you); } .sw.g-isp { background: var(--isp); }
.sw.g-other { background: var(--other); } .sw.g-none { background: var(--track); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- timeline: aligned rows sharing one time axis and one hover layer */
.tl { margin: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr);
      grid-template-rows: 30px 92px 92px 22px; column-gap: 14px; row-gap: 10px; position: relative; }
.tl-name { grid-column: 1; align-self: center; font-size: 13.5px; color: var(--ink-2); }
.tl-plot { grid-column: 2; position: relative; min-width: 0; }
.tl-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.r1 { grid-row: 1; } .r2 { grid-row: 2; } .r3 { grid-row: 3; } .r4 { grid-row: 4; }
.strip svg { border-radius: 4px; }
.strip .track { fill: var(--track); }
.strip .g-good { fill: var(--good); } .strip .g-you { fill: var(--you); } .strip .g-isp { fill: var(--isp); }
.strip .g-other { fill: var(--other); } .strip .g-none { fill: var(--track); }
.line .gl { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.line .base { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.line .thr { stroke: var(--you); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.line .ln { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.line .area { fill: var(--series); opacity: .1; }
.yt { position: absolute; left: 6px; font-size: 12px; line-height: 1; color: var(--ink-3); padding: 2px 4px; border-radius: 4px;
      background: color-mix(in srgb, var(--surface) 82%, transparent); pointer-events: none; }
.yt.top { top: 2px; } .yt.mid { top: 50%; transform: translateY(-50%); }
.no-plot { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 6px; }
.xaxis { grid-column: 2; position: relative; font-size: 12px; color: var(--ink-3); }
.xaxis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.x1 { left: 16.667%; } .x2 { left: 33.333%; } .x3 { left: 50%; } .x4 { left: 66.667%; } .x5 { left: 83.333%; }

.hv { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: relative; z-index: 2; }
.hv.rows-1 { grid-row: 1; }
.hv .c { position: relative; }
.hv .c:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.hv .c:hover::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--ink-2); }
.tip { display: none; position: absolute; top: -6px; left: calc(100% + 10px); z-index: 3; min-width: 168px;
       background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--tip-shadow);
       padding: 9px 12px; font-size: 13px; line-height: 1.45; color: var(--ink-2); white-space: nowrap; pointer-events: none; }
.tip b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.tip span { display: block; }
.hv .c:hover .tip { display: block; }
.hv .c.flip .tip { left: auto; right: calc(100% + 10px); }

.tl.small { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 110px 22px; margin-top: 22px; }
.tl.small figcaption { grid-row: 1; font-size: 13.5px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tl.small .r1 { grid-row: 2; } .tl.small .r2 { grid-row: 3; }
.tl.small .tl-plot, .tl.small .xaxis, .tl.small .hv { grid-column: 1; }
.tl.small .hv.rows-1 { grid-row: 2; }
.thr-key i { display: inline-block; width: 16px; height: 0; border-top: 2px dashed var(--you); margin-right: 7px; vertical-align: 3px; }

.table-view { margin-top: 16px; max-width: 100%; overflow-x: auto; }   /* a narrow card scrolls the table, never spills it */
.table-view summary, .measures summary { cursor: pointer; color: var(--ink-2); font-size: 14px; width: fit-content; padding: 4px 0; }
.table-view summary:hover, .measures summary:hover { color: var(--ink); }
.table-view table { margin-top: 10px; }
.brief { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.brief table { margin-top: 10px; }
.measures summary { list-style-position: inside; }
.measures summary h2 { display: inline; font-size: 15px; font-weight: 500; color: inherit; }
.measures[open] summary { margin-bottom: 12px; }

/* ---------- your network, point by point: one card per measured target */
.net-state { margin-top: 26px; }
.panel-head.bare { margin-bottom: 12px; align-items: baseline; justify-content: flex-start; gap: 6px 14px; }
.net-state h2 { margin: 0; font-size: 17px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 14px;
         display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tcard header { display: flex; flex-direction: column; gap: 3px; }
.t-role { font-weight: 600; font-size: 14.5px; }
.t-state { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); }
.t-state .ico { width: 16px; height: 16px; }
.tcard.s-good .t-state .ico { color: var(--good); }
.tcard.s-warn .t-state .ico { color: var(--you); }
.tcard.s-bad .t-state .ico { color: var(--isp); }
.tcard.s-bad { border-color: color-mix(in srgb, var(--isp) 45%, var(--line)); }
.tcard.s-bad .t-state { color: var(--ink); font-weight: 500; }
.tcard .ip { color: var(--ink-3); margin: 6px 0 0; }
.t-val { margin-top: 8px; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.t-val b { font-size: 28px; font-weight: 500; color: var(--ink); letter-spacing: -.02em; }
.spark { position: relative; height: 52px; margin-top: 8px; }
.spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spark .base { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark .ln { fill: none; stroke: var(--series); stroke-width: 1.75; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark .area { fill: var(--series); opacity: .1; }
.spark .yt { left: 0; padding-left: 0; }
.t-tcp { font-size: 12.5px; color: var(--ink-3); margin-left: 4px; }
.tcard .ip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-foot { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- latest incidents */
.panel-head > a { font-size: 14px; }
.recent tr.now td { color: var(--ink); }
.recent td .small { margin-left: 4px; }

/* ---------- failover: on the backup link */
.backup-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; color: var(--ink); font-size: 15px; max-width: 80ch; }
.backup-note .ico { color: var(--ink-2); margin-top: 2px; }
.backup-note a { margin-left: 6px; font-size: 14px; }
.here.alt { background: color-mix(in srgb, var(--other) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--other) 60%, transparent); }
.tl.fo { grid-template-rows: 18px 30px 92px 92px 22px; }
.tl.calls { grid-template-rows: 30px 92px 92px 72px 22px; }
.tl.fo.calls { grid-template-rows: 18px 30px 92px 92px 72px 22px; }
.row-1 { grid-row: 1; } .row-2 { grid-row: 2; } .row-3 { grid-row: 3; } .row-4 { grid-row: 4; } .row-5 { grid-row: 5; } .row-6 { grid-row: 6; }
.hv.upto-4 { grid-row: 1 / 4; } .hv.upto-5 { grid-row: 1 / 5; } .hv.upto-6 { grid-row: 1 / 6; }
.strip .backup { fill: var(--other); }
table.kv { width: auto; margin: 8px 0 4px; }
table.kv th { width: 150px; color: var(--ink-2); font-weight: 500; padding-left: 0; }
table.kv td, table.kv th { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
table.kv .badge { margin-left: 8px; }

/* ---------- call quality (E-model estimate) */
.calls { --band: var(--good); }
.calls.b-fair { --band: var(--you); } .calls.b-poor, .calls.b-bad { --band: var(--isp); }
.calls .panel-head { margin-bottom: 10px; }
.calls-body { display: grid; gap: 6px; }
.calls-now { font-size: 22px; font-weight: 500; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mos-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--band); flex: none; }
.mos { font-size: 15px; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mos b { color: var(--ink); font-weight: 600; }
.calls-day { color: var(--ink-2); max-width: 75ch; }

/* ---------- speed test: what it does and why it's risky, always visible */
.speed-state { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 4px 0 12px; color: var(--ink-2); }
.risk { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); margin: 6px 0 14px;
        background: color-mix(in srgb, var(--you) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--you) 40%, var(--line)); }
.risk .ico { color: var(--ink-2); margin-top: 2px; }
.risk p + p { margin-top: 8px; }
.risk ul { margin: 6px 0 8px; padding-left: 18px; display: grid; gap: 4px; max-width: 80ch; }
.run-now { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.run-now label.check { margin: 0; }

.speed { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.speed h3 { margin-bottom: 12px; }
.speed .meter.low .bar-fill { fill: var(--you); }
.speed-meta { color: var(--ink-2); font-size: 14px; margin-top: 12px; max-width: 75ch; }
.speed-warn { margin-top: 8px; font-size: 14px; padding: 8px 12px; border-radius: var(--r-sm);
              background: color-mix(in srgb, var(--you) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--you) 40%, var(--line)); }
.speed .muted.small { margin-top: 8px; }
.speed-where { margin-top: 12px; font-size: 14px; max-width: 640px; }
.speed-where td:first-child { overflow-wrap: anywhere; }
.speed-where-says { margin-top: 8px; font-size: 14px; max-width: 75ch; }
.speed-where-says.bad { padding: 8px 12px; border-radius: var(--r-sm);
                        background: color-mix(in srgb, var(--isp) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--isp) 40%, var(--line)); }

/* ---------- demo mode */
.demo-banner { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--r); font-size: 14px; color: var(--ink-2);
               background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; }
.demo-banner > .ico { color: var(--accent); margin-top: 1px; }
.demo-banner b { color: var(--ink); }
.demo-banner b { margin-right: 6px; }
.demo-switch { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 8px; font-size: 13.5px; }
.demo-switch span { color: var(--ink-2); margin-right: 4px; }
.demo-switch a { padding: 3px 10px; border-radius: 999px; color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.demo-switch a:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--accent); }
.demo-switch a[aria-current] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.demo-switch a.demo-docs { margin-left: auto; background: none; box-shadow: none; color: var(--accent); font-weight: 500; }

/* ---------- users and invitations */
table.users td { vertical-align: middle; }
.inline-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.invite-box p + p { margin-top: 8px; }
.invite-box .token { color: var(--ink); }

/* ---------- TV mode: always dark, large type, nothing to click */
html.tv { --bg: #0a1121; --side: #0c1527; --surface: #0f192d; --raised: #16223a; --line: #1c2943; --line-2: #2a3a57;
          --ink: #e8edf6; --ink-2: #9ba8c0; --ink-3: #7f8ca5; --accent: #2563eb; --accent-ink: #ffffff; --series: #3b82f6;
          --good: #22c55e; --good-ink: #4ade80; --you: #f59e0b; --isp: #ef4444; --other: #94a3b8; --track: #17233a;
          --violet: #a855f7; --amber: #f59e0b; --shadow: none; color-scheme: dark; }
.tv-page { min-height: 100vh; }
.tv-main { --blame: var(--other); max-width: 1500px; margin: 0 auto; padding: 4vh 5vw; }
.tv-main.g-you { --blame: var(--you); } .tv-main.g-isp { --blame: var(--isp); } .tv-main.g-good { --blame: var(--good); }
.tv-top { display: flex; justify-content: space-between; align-items: center; color: var(--ink-2); font-size: 1.4rem; }
.tv-brand { display: inline-flex; gap: 14px; align-items: center; font-weight: 600; color: var(--ink); }
.tv-stamp { display: inline-flex; gap: 10px; align-items: center; }
.tv-headline { font-size: clamp(3rem, 7vw, 7rem); line-height: 1.02; letter-spacing: -.03em; margin: 6vh 0 2vh; }
.tv-sub { font-size: clamp(1.2rem, 2vw, 2rem); color: var(--ink-2); max-width: 60ch; }
.tv-path { margin-top: 7vh; }
.tv-path .hop-name { font-size: clamp(1.3rem, 2vw, 2.2rem); }
.tv-path .hop-id { font-size: clamp(1rem, 1.4vw, 1.5rem); }
.tv-path .hop-val, .tv-path .hop-val b { font-size: clamp(1.2rem, 1.8vw, 2rem); }
.tv-path .node { width: 30px; height: 30px; }
.tv-path .hop { padding-top: 48px; }
.tv-path .hop::before, .tv-path .hop::after { top: 14px; height: 3px; }
.tv-path .here { font-size: clamp(1rem, 1.3vw, 1.4rem); }
.tv-facts { margin-top: 7vh; display: grid; gap: 1.6vh; font-size: clamp(1.2rem, 1.8vw, 2rem); color: var(--ink-2); }
.tv-facts .mos-dot { display: inline-block; margin-right: 14px; vertical-align: .1em; width: 16px; height: 16px; border-radius: 50%; background: var(--good); }
.tv-facts .mos-dot.b-fair { background: var(--you); } .tv-facts .mos-dot.b-poor, .tv-facts .mos-dot.b-bad { background: var(--isp); }
.tv-alert { color: var(--ink); font-weight: 500; }

/* ---------- wall screen (TV): every size on the board is in rem, and the root size follows the tighter
   of width and height, so it fills the window exactly with no scrolling (the board itself is .tvb) */
html.tv-board { font-size: min(1.111vw, 1.975vh); overflow: hidden; height: 100%; }
html.tv-board body { overflow: hidden; height: 100%; font-size: 1rem; }

/* ---------- service presets */
.presets { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.presets summary { cursor: pointer; font-weight: 600; padding: 4px 0; width: fit-content; }
.preset-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px 24px; margin-top: 10px; }
.presets fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.presets legend { font-size: 13.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }
label.check.preset { align-items: flex-start; margin: 8px 0; }
label.check.preset input { margin-top: 3px; }
label.check.preset > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
label.check.preset .mono { color: var(--ink-3); overflow-wrap: anywhere; }
label.check.preset .badge { align-self: flex-start; margin: 2px 0; }

/* ---------- link meters */
.meters { display: grid; gap: 14px; }
.meter { display: grid; grid-template-columns: 92px 7.5rem minmax(60px, 1fr) 11rem; align-items: center; gap: 4px 16px; }
.m-label { color: var(--ink-2); font-size: 14px; }
.m-val { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.m-val b { font-size: 22px; font-weight: 500; color: var(--ink); letter-spacing: -.01em; }
.m-pct { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.bar { width: 100%; height: 12px; display: block; }
.bar-track { fill: var(--track); }
.bar-fill { fill: var(--series); }
.meter.full .bar-fill { fill: var(--you); }
.bar-mark { fill: var(--ink-2); }
.meter.cpu { grid-template-columns: 92px 7.5rem; }

/* ---------- services & tunnels */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 2px 14px; align-items: center;
       padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 2px; }
.row .st { color: var(--ink-3); }
.row.s-good .st { color: var(--good); }
.row.s-bad .st { color: var(--isp); }
.r-main { display: flex; flex-direction: column; min-width: 0; }
.r-name { font-weight: 500; }
.r-sub { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-val { color: var(--ink-2); font-size: 14px; }
.r-state { color: var(--ink-2); font-size: 13.5px; text-align: right; }
.row.s-bad .r-state { color: var(--ink); font-weight: 500; }
.r-note { grid-column: 2 / -1; color: var(--ink-2); font-size: 13.5px; max-width: 70ch; margin-top: 4px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-sm);
       border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); font: inherit; font-weight: 500;
       font-size: 14.5px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn.quiet { background: transparent; }
.btn.danger { color: var(--isp); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
form .actions, .card .actions { margin-top: 16px; }
form.inline { display: inline; margin: 0; }

/* ---------- shared components used by the other pages */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 1.75rem; letter-spacing: -.02em; }
.topbar .right { display: flex; gap: 10px; align-items: center; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; min-width: 0; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 8px; font-size: 16px; }
.card h3 { margin: 0 0 12px; font-size: 17px; }
.card h4 { margin: 22px 0 4px; font-size: 14.5px; }
.card p + p { margin-top: 8px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-title h2 { margin: 0; font-size: 17px; }
.mt-16 { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px;
        background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.dot.ok, .ok .dot { background: var(--good); }
.dot.warn, .warn .dot { background: var(--you); }
.dot.bad, .bad .dot { background: var(--isp); }
.dot.info, .info .dot { background: var(--other); }
.badge { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; color: var(--ink);
         background: color-mix(in srgb, var(--good) 18%, transparent); }
.badge.warn { background: color-mix(in srgb, var(--you) 22%, transparent); }
.badge.bad { background: color-mix(in srgb, var(--isp) 24%, transparent); }
.badge.muted, .badge.info { background: color-mix(in srgb, var(--other) 20%, transparent); }
.target .role { color: var(--ink-2); font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.target .value { font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.target .value.sm { font-size: 19px; }
.hero .verdict { font-size: 2rem; font-weight: 600; display: flex; align-items: center; gap: 12px; }

.ruled-box { margin-top: 12px; font-size: 13.5px; display: grid; gap: 4px; }
.ruled-h { color: var(--ink-2); font-weight: 600; margin-top: 8px; }
.ruled, .notruled { display: flex; gap: 8px; align-items: flex-start; }
.ruled .ico { color: var(--good); width: 16px; height: 16px; margin-top: 2px; }
.notruled .ico { color: var(--you); width: 16px; height: 16px; margin-top: 2px; }

/* ---------- tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-weight: 500; font-size: 13px; }
td:first-child, th:first-child { padding-left: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.num-l { white-space: nowrap; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }

/* ---------- forms */
label { display: block; color: var(--ink-2); font-size: 13.5px; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=email], input[type=url], select, textarea {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 9px 11px; font: inherit; font-size: 14.5px; }
textarea { min-height: 88px; font-family: var(--mono); font-size: 13px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
label.check { display: flex; align-items: center; gap: 9px; color: var(--ink); margin: 12px 0; }
label.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.flash { padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: color-mix(in srgb, var(--good) 10%, var(--surface)); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.flash.err { background: color-mix(in srgb, var(--isp) 10%, var(--surface)); border-color: color-mix(in srgb, var(--isp) 50%, var(--line)); }
.token { word-break: break-all; padding: 10px 12px; background: var(--bg); border: 1px dashed var(--line-2); border-radius: var(--r-sm); }

/* ---------- sign-in pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth { width: 100%; max-width: 400px; }
.auth .brand { margin: 0 auto 20px; display: flex; justify-content: center; font-size: 18px; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 960px) {
  .grid.cols-2 { grid-template-columns: 1fr; }
  .main { padding: 24px 22px 48px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 7px 9px; font-size: 14px; gap: 7px; }
  .side-end { margin: 0 0 0 auto; }
  .acct > summary { padding: 4px; gap: 6px; }
  .acct-who { display: none; }
  .acct-menu { left: auto; right: 0; bottom: auto; top: calc(100% + 6px); width: 220px; }
  .acct .caret { transform: translateY(-2px) rotate(45deg); }   /* opens downward here */
  .acct[open] .caret { transform: translateY(2px) rotate(-135deg); }
  .main { padding: 16px 16px 40px; }
  .hero { padding: 22px 20px 20px; border-radius: var(--r); }
  .stamp { position: static; margin-bottom: 10px; }
  .headline { font-size: 2.25rem; padding-right: 0; }
  .hero .sub { font-size: 16px; }
  .path { grid-template-columns: minmax(0, 1fr); margin-top: 22px; }
  .hop, .hop:nth-child(2), .hop:last-child { padding: 0 0 18px 36px; align-items: flex-start; text-align: left; }
  .hop::before, .hop:nth-child(2)::before, .hop:last-child::before { display: none; }
  .hop::after, .hop:first-child::after, .hop:nth-child(2)::after { top: 24px; bottom: 0; left: 9px; right: auto; width: 2px; height: auto; }
  .hop:last-child::after { display: none; }
  .node, .hop:nth-child(2) .node, .hop:last-child .node { top: 1px; left: 0; right: auto; transform: none; }
  .panel { padding: 18px 16px; }
  .tl { grid-template-columns: 58px minmax(0, 1fr); column-gap: 10px; }
  .tl-name { font-size: 12.5px; }
  .x2, .x4 { display: none; }
  .meter { grid-template-columns: 76px 6.5rem 1fr; }
  .meter.cpu { grid-template-columns: 76px 6.5rem; }
  .meter .m-pct { grid-column: 2 / -1; }
  .row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .row .r-val { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .recent thead { display: none; }
  .recent tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .recent tr:last-child { border-bottom: 0; }
  .recent td { border: 0; padding: 0; }
  .recent td:nth-child(2), .recent td:nth-child(3) { grid-column: 1 / -1; }
  .recent td:nth-child(4) { grid-row: 1; grid-column: 2; }
  .tcard { padding: 12px 12px 10px; }
  .t-val b { font-size: 22px; }
  .spark { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* first-run wizard */
.wiz-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 18px; counter-reset: none; }
.wiz-steps a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; }
.wiz-steps .wiz-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--line); color: var(--ink); font-size: .8rem; font-weight: 600; }
.wiz-steps li.past .wiz-n { background: color-mix(in srgb, var(--good) 30%, var(--surface)); }
.wiz-steps li.now a { border-color: var(--ink-2); color: var(--ink); background: var(--surface); }
.wiz-steps li.now .wiz-n { background: var(--ink); color: var(--bg); }
.card.wiz { max-width: 920px; }
.wiz-found { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 24px; margin: 0 0 18px; }
.wiz-found dt { color: var(--ink-2); font-size: .85rem; } .wiz-found dd { margin: 2px 0 0; }
.wiz-actions .ghost { margin-left: auto; }
.wiz-summary, .wiz-more { padding-left: 0; list-style: none; } .wiz-summary li, .wiz-more li { padding: 4px 0; }
.wiz-summary li::before { content: "✓"; display: inline-block; width: 1.4em; color: var(--good); font-weight: 700; }
.wiz-summary li.todo::before { content: "–"; color: var(--ink-2); }
.wiz-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; padding: 14px 18px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); }
.wiz-banner p { margin: 0; flex: 1 1 320px; }

.demo-switch .demo-docs { margin-left: auto; font-weight: 500; }

/* opening hours: one row per weekday, up to two shifts */
.hours { display: grid; gap: 4px; margin: 12px 0 6px; }
.hours-head, .hours-day { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.hours-head { color: var(--ink-3); font-size: 12.5px; }
.hours-head span:first-child, .hours-day legend { width: 96px; }
.hours-head span:not(:first-child) { width: 200px; }
.hours-day { border: 0; margin: 0; padding: 4px 0; min-width: 0; border-top: 1px solid var(--line); }
.hours-day legend { float: left; padding: 0; font-weight: 500; }
.hours-shift { display: inline-flex; align-items: center; gap: 8px; width: 200px; }
.hours-shift input { width: 84px; margin: 0; text-align: center; font-variant-numeric: tabular-nums; }
.hours-to { color: var(--ink-3); font-size: 13px; }
@media (max-width: 640px) { .hours-head { display: none; } .hours-day legend { width: 100%; } }

/* ---------- dashboard: status line, verdict and figures, then cards */
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.status-pill { --c: var(--other); display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 9px 15px; border-radius: 999px;
               font-weight: 600; font-size: 15px; color: color-mix(in srgb, var(--c) 62%, var(--ink));
               background: color-mix(in srgb, var(--c) 16%, var(--bg)); }
.status-pill.g-good { color: var(--good-ink); }
.status-pill .dot { width: 11px; height: 11px; background: var(--c); }
.range-chip { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 12px; font-size: 14.5px;
              color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); white-space: nowrap; }
.range-chip .ico { color: var(--ink-2); }
.g-good { --c: var(--good); } .g-you { --c: var(--you); } .g-isp { --c: var(--isp); } .g-other { --c: var(--other); } .g-none { --c: var(--ink-3); }
.dash-tools { display: flex; align-items: center; gap: 12px; }
.dash-tools .stamp { position: static; font-size: 13px; color: var(--ink-3); }
.theme-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink);
             background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.theme-btn:hover { border-color: var(--line-2); }
.theme-btn .ico { width: 20px; height: 20px; }
.theme-btn.to-light { display: none; }
:root[data-theme="dark"] .theme-btn.to-light { display: inline-grid; } :root[data-theme="dark"] .theme-btn.to-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn.to-light { display: inline-grid; }
  :root:not([data-theme="light"]) .theme-btn.to-dark { display: none; } }

.dash-row { display: grid; gap: 18px; margin-top: 18px; }
.dash-row.first { margin-top: 0; grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 1fr)); }
.dash-row.mid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; }
.dash-row.low { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
/* the link card (with the speed test) is the tall one: calls and services stack beside it */
.dash-row.low > .linkc { grid-column: 1; grid-row: 1 / 3; }
.dash-row.low > .calls { grid-column: 2; grid-row: 1; }
.dash-row.low > .svc { grid-column: 2; grid-row: 2; }
/* every card in a row is as tall as the tallest one */
.dash-row.mid > .card, .dash-row.low > .card { display: flex; flex-direction: column; }
.dash-row.first { align-items: stretch; }
.where .brief { margin-top: 20px; }
.dash-row > .card, .dash-row > section { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.card-head h2 { min-width: 0; }
.see-all { flex: none; white-space: nowrap; }
.card-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.card-head h2 .ico, .kpi-name .ico { width: 22px; height: 22px; stroke-width: 2.2; }
.hi-blue { color: var(--series); } .hi-violet { color: var(--violet); } .hi-amber { color: var(--amber); }
.see-all { color: var(--series); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.see-all .ico { width: 16px; height: 16px; }

/* the verdict sits on the page itself, not in a card */
.verdict { display: flex; align-items: center; gap: 22px; padding: 6px 8px 6px 0; }
.verdict-ico { flex: none; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: #fff;
               background: var(--c); box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 20%, transparent); }
.verdict-ico .ico { width: 40px; height: 40px; stroke-width: 2.8; }
.verdict .headline { font-size: 1.75rem; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; padding: 0; font-weight: 700; }
.verdict .sub { color: var(--ink-2); font-size: 15px; }

.kpi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 12px; padding: 18px 20px; }
.kpi-name { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }

.kpi-val { grid-column: 1; align-self: end; margin-top: 16px; font-size: 2.15rem; font-weight: 700; letter-spacing: -.03em; line-height: 1;
           font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-val small { font-size: .55em; font-weight: 500; color: var(--ink-2); margin-left: 2px; letter-spacing: 0; }

.kpi-delta { grid-column: 1 / -1; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums;
             display: flex; align-items: center; gap: 5px; }
.kpi-delta .ico { width: 13px; height: 13px; fill: currentColor; stroke-width: 1.5; }
.kpi-delta.up { color: var(--good); }
:root:not([data-theme="dark"]) .kpi-delta.up { color: var(--good-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi-delta.up { color: var(--good); } } .kpi-delta.down { color: var(--isp); }
.kpi-delta span { color: var(--ink-3); font-weight: 400; }
.kpi-spark { grid-column: 2; grid-row: 2; position: relative; min-height: 52px; align-self: end; }
/* "without outages": the last 24 h as a strip under the figure, full width (a long figure never meets it) */
.kpi-strip { grid-column: 1 / -1; display: block; margin-top: 14px; text-decoration: none; }
.kpi-strip svg { display: block; width: 100%; height: 14px; border-radius: 4px; }
.kpi-strip-x { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.kpi-strip:hover .kpi-strip-x { color: var(--ink-2); }
.kpi-spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kpi-spark .ln { fill: none; stroke: var(--sc); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.kpi-spark .area { fill: var(--sc); opacity: .16; }
.kpi-spark.s-good { --sc: var(--good); } .kpi-spark.s-blue { --sc: var(--series); } .kpi-spark.s-violet { --sc: var(--violet); }
.kpi-spark .area { opacity: .2; }

.where { margin-top: 18px; }
/* availability day by day, the last 30 days (#63) */
.month { margin-top: 18px; }
.month .card-head { flex-wrap: wrap; }
.month-since { margin: 0; font-size: 13px; color: var(--ink-3); }
.month-figs { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 4px 0 14px; }
.month-figs p { margin: 0; display: flex; flex-direction: column; }
.month-figs span { font-size: 13px; color: var(--ink-2); }
.month-figs b { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; }
.days li { height: 30px; border-radius: 3px; background: var(--c, var(--track)); }
.days li.g-none { background: var(--track); box-shadow: inset 0 0 0 1px var(--line-2); }
.days li.g-before { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.days li.partial { background: repeating-linear-gradient(135deg, var(--c) 0 3px, color-mix(in srgb, var(--c) 45%, transparent) 3px 6px); }
.days-x { display: flex; justify-content: space-between; margin: 4px 0 0; font-size: 11.5px; color: var(--ink-3); }
.month-hint { margin: 10px 0 0; font-size: 13px; }
@media (max-width: 640px) { .days { gap: 2px; } .days li { height: 22px; border-radius: 2px; } }
.dash-row .card .meter { grid-template-columns: 70px 6.5rem minmax(60px, 1fr); }
.dash-row .card .meter .m-pct { grid-column: 2 / -1; margin-top: -4px; }
.dash-row .card .meter.cpu { grid-template-columns: 70px 6.5rem; }
.where .path { margin-top: 10px; }
.where .advice { background: color-mix(in srgb, var(--blame) 9%, var(--surface)); }

/* monitored destinations: one line each, with its last 6 hours */
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tlist li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 56px; gap: 12px; align-items: center; padding: 10px 0; }
.ring { --rc: var(--good); width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--rc); background: var(--rc); }
.tlist .s-warn .ring { --rc: var(--you); } .tlist .s-bad .ring { --rc: var(--isp); }
:root[data-theme="dark"] .ring { background: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ring { background: none; } }
.tl-main { display: flex; flex-direction: column; min-width: 0; }
.tl-n { font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tl-t { font-weight: 400; color: var(--ink-2); }
.tl-ms { font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.tl-ms b { display: block; font-size: 12px; color: var(--isp); font-weight: 600; }
.kpi-val.bad { color: var(--isp); }
.tl-spark { position: relative; height: 26px; }
.tl-spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tl-spark .ln { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* latest events: a vertical timeline */
.ev-list { list-style: none; margin: 0; padding: 0; }
.ev-list li { position: relative; padding: 0 0 18px 28px; }
.ev-list li:last-child { padding-bottom: 0; }
.ev-list li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.ev-list li:last-child::before { display: none; }
.ev-dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--other));
          box-shadow: 0 0 0 3px var(--surface); }
.ev-t { font-weight: 500; font-size: 14.5px; }
.ev-w { font-size: 13px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ev-int { color: var(--ink-2); font-weight: 500; }
.ev-sum { margin: 0 0 4px; color: var(--ink); }
.ev-list li.now .ev-t { color: var(--ink); font-weight: 600; }

/* three columns only when the 24-hour chart (and its table) gets real width: on a 1366 or 1440 laptop
   the chart takes the whole row and destinations + events share the next one */
@media (max-width: 1800px) {
  .dash-row.mid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-row.mid > .chart { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {   /* sidebar + two columns leaves each card too narrow for its meters */
  .dash-row.mid, .dash-row.low { grid-template-columns: minmax(0, 1fr); }
  /* one column: drop the two-column placement, or column 2 comes back as an implicit, zero-width track */
  .dash-row.low > .linkc, .dash-row.low > .calls, .dash-row.low > .svc { grid-column: auto; grid-row: auto; }
}
@media (max-width: 1400px) {
  .dash-row.first { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-row.first > .verdict { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .dash-row.first, .dash-row.mid, .dash-row.low { grid-template-columns: minmax(0, 1fr); }
  .dash-row > * { grid-column: auto !important; grid-row: auto !important; }
  .verdict { padding: 18px; gap: 14px; } .verdict-ico { width: 56px; height: 56px; } .verdict-ico .ico { width: 28px; height: 28px; }
  .verdict .headline { font-size: 1.35rem; }
  .dash-tools .stamp { display: none; }
  .sys { display: none; }
}

/* ---------- the other pages, in the dashboard's language */
.topbar { margin-bottom: 22px; }
.topbar h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.topbar .right { flex-wrap: wrap; justify-content: flex-end; }
.topbar .btn .ico { width: 18px; height: 18px; }
.grid { gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.stack > * + * { margin-top: 18px; }
.card h3 { font-size: 17px; letter-spacing: -.01em; }
.card table.kv th { width: 46%; }
/* wide tables scroll inside their card instead of pushing the page sideways */
.stack > .card, .grid > .card, main > .card, main > .panel { overflow-x: auto; }
.badge { border-radius: 999px; padding: 3px 10px; font-weight: 500; }
.badge.ok { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good-ink); }
.flash { border-radius: var(--r-sm); }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=email], input[type=url], select, textarea {
  background: var(--surface); border-radius: var(--r-sm); }
/* sign-in, first admin, invitations: one card on the page */
.auth .card { padding: 26px 28px; }
.auth .brand { font-size: 22px; }

/* a pending step, not an error */
.note { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; padding: 11px 14px; border-radius: var(--r-sm);
        background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.note .ico { color: var(--series); margin-top: 1px; }
.note a { color: var(--series); font-weight: 500; }

/* pairing a wall screen: a big code, readable across the room */
.tv-pair { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
           padding: 5vh 6vw; gap: 2.5vh; }
.tv-pair .tv-brand { display: inline-flex; align-items: center; gap: 14px; font-size: clamp(1.3rem, 2.2vw, 2rem); font-weight: 600; color: var(--ink); }
.tv-pair h1 { margin: 0; font-size: clamp(2rem, 4.5vw, 4rem); letter-spacing: -.02em; }
.tv-pair-code { margin: 1vh 0; padding: 2vh 4vw; border-radius: 24px; background: var(--surface); border: 2px solid var(--line-2);
                font-family: var(--mono); font-weight: 700; font-size: clamp(3rem, 11vw, 9rem); letter-spacing: .08em; color: var(--ink); }
.tv-pair-steps { margin: 0; padding-left: 1.4em; text-align: left; font-size: clamp(1.1rem, 2vw, 1.8rem); color: var(--ink-2); line-height: 1.6; }
.tv-pair-note { color: var(--ink-3); font-size: clamp(.95rem, 1.4vw, 1.3rem); }

/* ---------- TV board, in the dashboard's design: fills the window exactly, no scrolling, no JavaScript.
   Everything is in rem and html.tv-board sets the root size from the tighter of width and height. */
/* rows: header, [alarm], verdict + figures, 24 h + events, destinations + services. The alarm row is a class
   from the template (no :has(), which many TV browsers don't support). */
.tvb { height: 100vh; display: grid; grid-template-rows: auto 8.6rem minmax(11rem, 1fr) 13rem; gap: .9rem;
       padding: 1.1rem 1.4rem 1.2rem; overflow: hidden; }
.tvb.has-alarm { grid-template-rows: auto auto 8.6rem minmax(11rem, 1fr) 13rem; }
.tvb-head { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.tvb-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.45rem; letter-spacing: -.02em; color: var(--ink); }
.tvb-brand .mark { width: 2.2rem; height: 2.2rem; }
.tvb-sub { color: var(--ink-2); font-size: 1rem; padding-left: 1.1rem; border-left: 1px solid var(--line-2); white-space: nowrap;
           overflow: hidden; text-overflow: ellipsis; }
.tvb-clock { margin-left: auto; display: inline-flex; align-items: center; gap: .55rem; color: var(--ink-2); font-size: 1rem;
             font-variant-numeric: tabular-nums; white-space: nowrap; }
.tvb-alarm { display: flex; align-items: center; gap: .7rem; margin: 0; padding: .55rem 1rem; border-radius: .9rem; font-size: 1.05rem;
             color: var(--ink); background: color-mix(in srgb, var(--isp) 20%, var(--surface)); border: 1px solid var(--isp); overflow: hidden; }
.tvb-alarm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvb-alarm .ico { width: 1.3rem; height: 1.3rem; color: var(--isp); stroke-width: 3; flex: none; }
.tvb-row { display: grid; gap: .9rem; min-height: 0; }
.tvb-row.first { grid-template-columns: minmax(0, 1.75fr) repeat(3, minmax(0, 1fr)); }
.tvb-row.mid { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
.tvb-row.low { grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr); }
.tvb-card { background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; padding: .85rem 1.05rem;
            min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.tvb-card.alarm { border-color: var(--isp); box-shadow: inset 0 0 0 1px var(--isp); }
.tvb-card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .6rem; flex: none; }
.tvb-card-head h2 { margin: 0; display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.tvb-card-head .ico { width: 1.25rem; height: 1.25rem; stroke-width: 2.2; }
.tvb-rot { color: var(--ink-3); font-size: .75rem; white-space: nowrap; margin-top: auto; padding-top: .35rem; }
.tvb-card-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* the verdict, big */
.tvb-verdict { flex-direction: row; align-items: center; gap: 1.2rem;
               background: color-mix(in srgb, var(--c) 9%, var(--surface)); border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.tvb-verdict .verdict-ico { width: 5.2rem; height: 5.2rem; box-shadow: 0 0 0 .5rem color-mix(in srgb, var(--c) 20%, transparent); }
.tvb-verdict .verdict-ico .ico { width: 2.6rem; height: 2.6rem; }
.tvb-verdict h1 { margin: 0 0 .3rem; font-size: 2.05rem; line-height: 1.1; letter-spacing: -.025em; }
.tvb-verdict p { margin: 0; color: var(--ink-2); font-size: 1rem; }
/* the three figures, at board scale */
.tvb .kpi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: .6rem; }
.tvb .kpi-name { font-size: .95rem; gap: .5rem; } .tvb .kpi-name .ico { width: 1.2rem; height: 1.2rem; }
.tvb .kpi-val { font-size: 2.1rem; margin-top: .5rem; }
.tvb .kpi-val.bad { font-size: 1.9rem; }
.tvb .kpi-delta { font-size: .9rem; margin-top: .3rem; } .tvb .kpi-delta .ico { width: .8rem; height: .8rem; }
.tvb .kpi-spark { min-height: 2.6rem; }
.tvb .status-pill { font-size: .85rem; padding: .3rem .8rem .3rem .65rem; gap: .45rem; }
.tvb .status-pill .dot { width: .6rem; height: .6rem; }
/* 24 h: the timeline grows into the card */
.tvb-tl { flex: 1; min-height: 0; grid-template-columns: 5.2rem minmax(0, 1fr); column-gap: .8rem; row-gap: .45rem;
          grid-template-rows: 1.15rem minmax(1.5rem, 1fr) minmax(1.5rem, 1fr) 1rem; }
.tvb-tl.fo { grid-template-rows: .8rem 1.15rem minmax(1.5rem, 1fr) minmax(1.5rem, 1fr) 1rem; }
.tvb-tl .tl-name { font-size: .82rem; } .tvb-tl .xaxis { font-size: .75rem; } .tvb .yt { font-size: .7rem; }
/* latest events */
/* an event that does not fit whole wraps into a hidden second column instead of showing cut in half */
.tvb-events .ev-list { flex: 1 1 0; min-height: 0; display: flex; flex-flow: column wrap; align-content: flex-start; column-gap: 2rem; overflow: hidden; }
.tvb-events .ev-list > li { width: 100%; flex: none; }
.tvb-events .ev-list li { padding-bottom: .75rem; padding-left: 1.6rem; }
.tvb-events .ev-dot { width: .8rem; height: .8rem; top: .25rem; }
.tvb-events .ev-list li::before { left: .34rem; top: 1.15rem; }
.tvb-events .ev-t { font-size: .95rem; line-height: 1.3; } .tvb-events .ev-w { font-size: .78rem; }
/* monitored destinations: one tile each */
.tvb-tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .7rem; }
.tvb-tile { position: relative; display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding: .6rem .7rem;
            border-radius: .7rem; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.tvb-tile.s-bad { border-color: var(--isp); }
.tvb-tile-name { display: flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvb-tile-ip { color: var(--ink-3); font-family: var(--mono); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvb-tile-ms { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: .2rem; }
.tvb-tile-ip b { font-family: var(--font); color: var(--isp); font-weight: 600; }
.tvb-tile-spark { position: absolute; right: .6rem; bottom: .55rem; width: 38%; height: 1.5rem; }
.tvb-tile-spark svg { width: 100%; height: 100%; overflow: visible; }
.tvb-tile-spark .ln { fill: none; stroke: var(--series); stroke-width: 2; vector-effect: non-scaling-stroke; }
.tvb .ring { width: .8rem; height: .8rem; border-width: .18rem; flex: none; }
.tvb .tvb-tile.s-warn .ring, .tvb-conn-list .s-none .ring { --rc: var(--you); }
.tvb .tvb-tile.s-bad .ring, .tvb-conn-list .s-bad .ring { --rc: var(--isp); }
.tvb-conn-list .s-none .ring { --rc: var(--ink-3); }
/* services, devices and tunnels */
.tvb-conn-list { list-style: none; margin: 0; padding: 0; overflow: hidden; flex: none; }
.tvb-conn-list li { display: grid; grid-template-columns: .8rem minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .22rem 0;
                    font-size: .88rem; border-bottom: 1px solid var(--line); }
.tvb-conn-list li:last-child { border-bottom: 0; }
.tvb-conn-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvb-conn-state { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tvb-conn-list .s-bad { background: color-mix(in srgb, var(--isp) 14%, transparent); }
.tvb-conn-list .s-bad .tvb-conn-name { font-weight: 600; }
.tvb-conn-list .s-bad .tvb-conn-state b { color: var(--ink); }

.tvb-open { display: flex; gap: .4rem; margin: 0 0 0 auto; font-size: .95rem; color: var(--ink-3); }
.tvb-open dt { margin: 0; } .tvb-open dd { margin: 0; color: var(--ink); font-weight: 600; }
.tvb-open + .status-pill { margin-left: .8rem; }
/* the rows the board adds only when it has their data: 30 days, the doctor's grade, speed, calls */
.tvb.has-month { grid-template-rows: auto 8.6rem 4.6rem minmax(9rem, 1fr) 13rem; }
.tvb.has-alarm.has-month { grid-template-rows: auto auto 8.6rem 4.6rem minmax(9rem, 1fr) 13rem; }
.tvb-month { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; column-gap: 2.2rem; padding: .6rem 1.05rem; }
.tvb-month-label h2 { margin: 0; display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; white-space: nowrap; }
.tvb-month-label .ico { width: 1.25rem; height: 1.25rem; stroke-width: 2.2; }
.tvb-month-label p { margin: .25rem 0 0; color: var(--ink-3); font-size: .8rem; white-space: nowrap; }
.tvb-month-figs { display: flex; gap: 1.6rem; margin: 0; line-height: 1.2; }
.tvb-month-figs div { display: flex; flex-direction: column; }
.tvb-month-figs dt { color: var(--ink-2); font-size: .8rem; white-space: nowrap; }
.tvb-month-figs dd { margin: 0; font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.tvb-month .days { gap: .2rem; }
.tvb-month .days li { height: 1.6rem; border-radius: .2rem; }
.tvb-month .days-x { font-size: .7rem; line-height: 1.2; margin-top: .25rem; }
.tvb-grade-body { flex: 1; display: flex; align-items: center; gap: 1rem; min-height: 0; margin-top: .5rem; }
.tvb .doctor-grade { font-size: 2.7rem; width: 4.3rem; height: 4.3rem; border-radius: .75rem; color: var(--good); }
.tvb .doctor-grade.g-b, .tvb .doctor-grade.g-c { color: var(--you); }
.tvb .doctor-grade.g-d, .tvb .doctor-grade.g-f { color: var(--isp); }
.tvb-grade-text { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.3; overflow: hidden;
                  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tvb-grade-text.bad { color: var(--ink); font-weight: 600; }
.tvb-row.mid.has-speed { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr) minmax(0, .8fr); }
.tvb-meters { display: grid; gap: .75rem; }
.tvb-meter-top { display: flex; justify-content: space-between; align-items: baseline; margin: 0; color: var(--ink-2); font-size: .9rem; }
.tvb-meter-top b { color: var(--ink); font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tvb-meter .bar { height: .75rem; margin: .25rem 0 .1rem; }
.tvb-meter.low .bar-fill { fill: var(--you); }
.tvb-meter-pct { margin: 0; color: var(--ink-3); font-size: .78rem; }
.tvb-speed-where { margin: .7rem 0 0; color: var(--ink-2); font-size: .85rem; line-height: 1.3; }
.tvb-speed-where.bad, .tvb-speed-where.warn { color: var(--ink); padding: .4rem .6rem; border-radius: .5rem;
                                              background: color-mix(in srgb, var(--isp) 16%, transparent); }
.tvb-speed-where.warn { background: color-mix(in srgb, var(--you) 16%, transparent); }
.tvb-calls { --band: var(--good); flex: none; display: flex; align-items: center; gap: .55rem; margin: .4rem 0 0; padding-top: .55rem;
             border-top: 1px solid var(--line); font-size: .9rem; white-space: nowrap; overflow: hidden; }
.tvb-calls.b-fair { --band: var(--you); } .tvb-calls.b-poor, .tvb-calls.b-bad { --band: var(--isp); }
.tvb-calls .mos-dot { width: .7rem; height: .7rem; }
.tvb-calls b { font-weight: 600; }
.tvb-calls span:last-child { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }

/* the public demo's way out of the wall screen (only on the static demo) */
.tv-demo { position: fixed; top: .85rem; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: .5rem; }
.tv-demo a { background: #2563eb; color: #fff; text-decoration: none; font: 600 13px/1 "Plex", system-ui, sans-serif;
             padding: 8px 13px; border-radius: 999px; box-shadow: 0 4px 14px rgb(0 0 0 / .35); }
.tv-demo a + a { background: #1e293b; }

/* ---------- the chart, enlarged (/chart): zoom and move with plain links */
.card-head .card-link { margin-left: auto; font-size: 13.5px; font-weight: 500; color: var(--accent); text-decoration: none; white-space: nowrap; }
.card-head .card-link:hover { text-decoration: underline; }
.chart-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.seg a { padding: 8px 14px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--line-2); }
.seg a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.seg a[aria-current] { background: var(--accent); color: #fff; }
.chart-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.chart-nav .btn { padding: 7px 13px; font-size: 14px; text-decoration: none; }
.btn.off { opacity: .4; cursor: default; }
.chart.big .tl { grid-template-rows: 34px 150px 150px 26px; }
.chart.big .tl.fo { grid-template-rows: 20px 34px 150px 150px 26px; }
.chart.big .tl.calls { grid-template-rows: 34px 150px 150px 100px 26px; }
.chart.big .tl.fo.calls { grid-template-rows: 20px 34px 150px 150px 100px 26px; }
.hv a.c { display: block; cursor: zoom-in; }
.tip .tip-zoom { margin-top: 4px; color: var(--accent); font-weight: 500; }
.chart-hint { margin: 14px 0 0; }
tr.bad-row td { background: color-mix(in srgb, var(--isp) 7%, transparent); }
@media (max-width: 760px) { .chart.big .tl { grid-template-rows: 30px 110px 110px 22px; } }

/* destinations: each row opens that destination's chart */
.tlist li { display: block; padding: 0; }
.tlist .tl-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 56px; gap: 12px; align-items: center;
                 padding: 10px 8px; margin: 0 -8px; border-radius: 8px; color: inherit; text-decoration: none; }
.tlist .tl-row:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.h1-sub { font-weight: 500; color: var(--ink-3); font-size: .7em; }
/* the range menu: a <details>, so it opens with no JavaScript */
.range-menu { position: relative; }
.range-menu > summary { list-style: none; cursor: pointer; }
.range-menu > summary::-webkit-details-marker { display: none; }
.range-menu .caret { font-size: 11px; color: var(--ink-3); margin-left: -2px; }
.range-menu[open] > summary { border-color: var(--accent); }

/* drag to zoom (chart.js; without it, the links do the same) */
.zoomable { position: relative; }
.drag-sel { position: absolute; z-index: 4; pointer-events: none; border-radius: 4px;
            background: color-mix(in srgb, var(--accent) 22%, transparent);
            border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); }
.js-only { display: none; }
.js .js-only { display: inline; }
.js .zoomable .hv { cursor: crosshair; touch-action: pan-y; }
.js .zoomable .hv a.c { cursor: crosshair; }
.js .zoomable .tip-zoom { display: none; }
.zoomable.dragging { user-select: none; }
.zoomable.dragging .tip { display: none !important; }
/* the range picker */
.range-menu .rp { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid;
                  grid-template-columns: minmax(220px, auto) minmax(180px, auto); gap: 0; padding: 0;
                  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
                  box-shadow: 0 12px 30px rgb(0 0 0 / .25); }
.range-menu .rp-h { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.range-menu .rp-abs { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-right: 1px solid var(--line); }
.range-menu .rp-abs label { font-size: 13.5px; color: var(--ink-2); }
.range-menu .rp-abs input { padding: 7px 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--raised);
                            color: var(--ink); font: inherit; font-size: 14px; color-scheme: light dark; }
.range-menu .rp-abs .btn { margin-top: 8px; justify-content: center; }
.range-menu .rp-quick { padding: 14px 8px 8px; }
.range-menu .rp-quick .rp-h { padding: 0 8px; }
.range-menu .rp-quick ul { list-style: none; margin: 0; padding: 0; }
.range-menu .rp-quick a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap; }
.range-menu .rp-quick a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.range-menu .rp-quick a[aria-current] { color: var(--accent); font-weight: 600; }
.chart-key { margin: -4px 0 12px; }
@media (max-width: 640px) { .range-menu .rp { grid-template-columns: minmax(0, 1fr); right: auto; left: 0; }
                            .range-menu .rp-abs { border-right: 0; border-bottom: 1px solid var(--line); } }
.js .zoomable .hv a.c { -webkit-user-drag: none; user-select: none; }

/* network check (isitmyisp doctor) */
.lead-narrow { max-width: 70ch; }
.doctor-sum { display: flex; gap: 20px; align-items: center; }
.doctor-sum p { margin: 2px 0; }
.doctor-grade { font-size: 44px; font-weight: 700; line-height: 1; margin: 0; width: 72px; height: 72px; flex: none;
                display: grid; place-items: center; border-radius: var(--r);
                background: color-mix(in srgb, var(--good) 18%, transparent); }
.doctor-grade.g-b, .doctor-grade.g-c { background: color-mix(in srgb, var(--you) 22%, transparent); }
.doctor-grade.g-d, .doctor-grade.g-f { background: color-mix(in srgb, var(--isp) 24%, transparent); }
.doctor-list { list-style: none; margin: 0; padding: 0; }
.doctor-list li { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.doctor-list li:first-child { border-top: 0; padding-top: 0; }
.doctor-list .badge { justify-self: start; align-self: start; }
.doctor-list p { margin: 0 0 4px; }
.doctor-list .doctor-name { font-weight: 600; }
.doctor-list .st-skip p { color: var(--ink-2); }
.doctor-todo { color: var(--ink-2); }
@media (max-width: 560px) { .doctor-list li { grid-template-columns: 1fr; gap: 6px; } }
/* check from this device (check.js) */
.dev-run { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
html:not(.js) .dev-run { display: none; }
.dev-run progress { flex: 1 1 200px; height: 8px; accent-color: var(--accent); }
.dev-run #dev-step { margin: 0; flex-basis: 100%; }
.dev-run #dev-step:empty { display: none; }
.dev-head { display: flex; gap: 12px; align-items: baseline; font-weight: 600; margin: 8px 0; }
.dev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; margin: 16px 0 8px; }
.dev-facts dt { color: var(--ink-2); font-size: 13px; }
.dev-facts dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }

/* Settings: tabs (sub-pages) and features that fold to one line when off. No JS: <a> and <details>. */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin: 4px 0 10px; overflow-x: auto;
  overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-sub { margin: 0 0 16px; }
details.fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3 { margin: 0; }
details.fold .fold-cta { margin-left: auto; font-size: 13px; color: var(--accent); }
details.fold[open] .fold-cta { display: none; }
details.fold[open] > summary { margin-bottom: 12px; }
details.chan { border-top: 1px solid var(--line); padding: 10px 0; }
details.chan > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; }
details.risk-fold { margin: 6px 0 14px; }
details.risk-fold > summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
