/* Pulse-Sync: the Pulse design system (E:\Workspace\Pulse\DESIGN.md) applied to a fleet dashboard.
   Monochrome, lit-or-not state, square cells for data, Schibsted Grotesk for real text. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/SchibstedGrotesk-Variable.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #090909;
  --bg-2: #0e0e0e;
  --well: #0f0f0e;
  --on: #f2f2ed;
  --mid: #b3b3ad;
  --text-dim: #8c8c88;
  --ink-dim: #757573;
  --edge-strong: #4a4a47;
  --rule-dotted: #3a3a37;
  --line: #303030;
  --edge: #2a2a28;
  --off: #262626;
  --on-hover: #ffffff;

  /* The one hue, reserved for unhealthy state (down, failing, slow). Never decoration.
     #ff6b63 on #090909 is 7.1:1, readable as text. */
  --alert: #ff6b63;
  --alert-soft: rgba(255, 107, 99, 0.12);
  --alert-line: rgba(255, 107, 99, 0.45);

  --body: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-color: #3a3a38 var(--bg); scrollbar-width: thin; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--mid);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(to bottom, rgba(242, 242, 237, 0.018) 0 1px, transparent 1px 3px);
}
::selection { background: var(--on); color: var(--bg); }
:focus-visible { outline: 2px solid var(--on); outline-offset: 3px; border-radius: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #34342f; border: 3px solid var(--bg); }
img, svg, canvas { display: block; }
a { color: var(--on); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(242, 242, 237, 0.4); }
a:hover { text-decoration-color: var(--on); }
b, strong { color: var(--on); font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; color: var(--on); font-weight: 600; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; background: var(--on); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }
.on { color: var(--on); }

/* ---------------------------------------------------------------- pixel type */
.px { display: block; color: var(--on); line-height: 0; }
.px .px-line { display: block; }
.px .px-line + .px-line { margin-top: calc(var(--dot) * 3); }
.px-brand { --dot: 2.5px; }
.px-h1 { --dot: 6px; }
.px-h2 { --dot: 3px; }
.px-stat { --dot: 3px; }
.px-key { --dot: 2px; }
.px-inline { display: inline-block; vertical-align: middle; }
.px-mid { color: var(--mid); }
.px-dim { color: var(--ink-dim); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px;
  border: 1px solid var(--on); border-radius: 4px;
  font: 600 15px/1 var(--body); letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 120ms var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--on); color: var(--bg); }
.btn-primary:hover { background: var(--on-hover); }
.btn-ghost { background: transparent; color: var(--on); border-color: var(--edge-strong); }
.btn-ghost:hover { border-color: var(--on); background: rgba(242, 242, 237, 0.06); }
.btn-small { --h: 40px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: progress; }

/* ---------------------------------------------------------------- nav */
.nav { position: sticky; top: 0; z-index: 50; background: var(--bg); transition: box-shadow 200ms var(--ease-out); }
.nav.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 10px 24px -12px rgba(0, 0, 0, 0.8); }
.nav-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-tile { width: 32px; height: 32px; border-radius: 7px; background: var(--bg-2); border: 1px solid var(--edge); display: grid; place-items: center; }
.nav-links { display: flex; gap: 2px; list-style: none; margin: 0 auto 0 12px; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  color: var(--mid); font-size: 15px; font-weight: 500; text-decoration: none;
  transition: color 160ms var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--on); }
.nav-links { position: relative; }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--on); }
.nav-links:has(.nav-thumb) a[aria-current="page"] { box-shadow: none; }
.nav-thumb { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--on); pointer-events: none; transition: transform 320ms var(--ease-out), width 320ms var(--ease-out), opacity 200ms; list-style: none; }
@media (prefers-reduced-motion: reduce) { .nav-thumb { transition: none; } }
@media (max-width: 1240px) { .nav-thumb { display: none; } .nav-links:has(.nav-thumb) a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--on); } }
.nav-count { font: 600 11px/1 var(--mono); padding: 3px 5px; border-radius: 2px; background: var(--off); color: var(--on); font-variant-numeric: tabular-nums; }
.nav-count.is-hot { background: var(--alert-soft); color: var(--alert); box-shadow: inset 0 0 0 1px var(--alert-line); }
.nav-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-dim); }
.nav-toggle { display: none; }
@media (max-width: 1240px) {
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; padding: 8px var(--gutter) 16px; background: var(--bg); box-shadow: 0 1px 0 var(--line), 0 18px 30px -18px rgba(0,0,0,.9); margin: 0; }
  .nav-links.is-open { display: flex; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav-meta .updated { display: none; }
}

/* live pip and scanner, the only loops */
.pip { width: 6px; height: 6px; background: var(--on); animation: breathe 1.3s ease-in-out infinite; flex: none; }
.pip.is-stale { animation: none; background: var(--alert); opacity: 0.9; }
.widget.is-unhealthy { border-color: var(--alert-line); }
.lc-end.is-hot { background: var(--alert); }
.lc.is-hot .lc-svg path[fill="none"] { stroke: var(--alert); }
.lc.is-hot .lc-svg path[fill-opacity] { fill: var(--alert); }
.chip-slow { color: var(--alert); }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.scanner { display: inline-flex; gap: 2px; }
.scanner i { width: 3px; height: 3px; background: var(--off); animation: scan 1.28s steps(1) infinite; }
.scanner i:nth-child(2) { animation-delay: 0.16s; } .scanner i:nth-child(3) { animation-delay: 0.32s; } .scanner i:nth-child(4) { animation-delay: 0.48s; }
.scanner i:nth-child(5) { animation-delay: 0.64s; } .scanner i:nth-child(6) { animation-delay: 0.8s; } .scanner i:nth-child(7) { animation-delay: 0.96s; } .scanner i:nth-child(8) { animation-delay: 1.12s; }
@keyframes scan { 0% { background: var(--on); } 12.5% { background: rgba(242,242,237,.5); } 25% { background: rgba(242,242,237,.25); } 37.5%, 100% { background: var(--off); } }
@media (prefers-reduced-motion: reduce) {
  .pip { animation: none; opacity: 0.85; }
  .scanner i { animation: none; }
  .scanner i:first-child { background: var(--on); }
  * { transition-duration: 0ms !important; }
}

/* ---------------------------------------------------------------- page */
main { padding: clamp(28px, 4vw, 48px) 0 96px; }
main:focus { outline: none; }
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; align-items: end; margin-bottom: clamp(28px, 3.5vw, 44px); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 13px; color: var(--text-dim); letter-spacing: 0.02em; }
.lede { max-width: 60ch; margin-top: 16px; font-size: 18px; color: var(--mid); text-wrap: pretty; }
.section { margin-top: clamp(48px, 6vw, 80px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.section-head h2 { font-size: 18px; }
.section-head .hint { font-size: 13px; color: var(--text-dim); }
@media (max-width: 760px) { .page-head { grid-template-columns: 1fr; } }

/* stats row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 20px 20px 18px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat .label { margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.stat .stat-sub { margin-top: 2px; font-size: 12px; color: var(--text-dim); }
@media (max-width: 640px) { .stat + .stat { border-left: 0; padding-left: 0; } .stat { border-bottom: 1px solid var(--line); } }

/* ---------------------------------------------------------------- server widget (the signature component) */
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.widget {
  position: relative;
  display: block;
  padding: 18px;
  background: var(--bg);
  border: 1px solid rgba(242, 242, 237, 0.16);
  border-radius: 14px;
  color: var(--on);
  text-decoration: none;
  overflow: hidden;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.6));
  transition: border-color 180ms var(--ease-out);
}
.widget::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(242, 242, 237, 0.02) 0 1px, transparent 1px 3px); }
a.widget:hover { border-color: rgba(242, 242, 237, 0.4); }
.w-head { display: flex; align-items: center; gap: 10px; }
.w-head .px { margin-right: auto; }
.w-sub { margin-top: 6px; font-size: 13px; color: var(--text-dim); }
.dotted { height: 1px; margin: 14px 0; background: repeating-linear-gradient(to right, var(--line) 0 2px, transparent 2px 4px); }
.w-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 70px; align-items: end; gap: 10px; }
.w-row + .w-row { margin-top: 14px; }
.w-row .w-val { text-align: right; }
.w-bar { grid-column: 1 / -1; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { padding: 10px; border: 1px solid var(--line); }
.tile .px + .px { margin-top: 6px; }
.tile .t-sub { margin-top: 6px; font-size: 12px; color: var(--text-dim); }

/* square-cell bar */
.bar { display: flex; gap: 2px; height: 8px; }
.bar i { flex: 1; background: var(--off); }
.bar i.is-on { background: var(--on); }
.bar i.is-part { background: var(--ink-dim); }
.bar.is-hot i.is-on, .bar.is-hot i.is-part { background: var(--alert); }
.bar i.is-blink { animation: blink-off 1s steps(1) infinite; }
@keyframes blink-off { 50% { background: var(--off); } }
@media (prefers-reduced-motion: reduce) { .bar i.is-blink { animation: none; } }
.bar-thin { height: 5px; }

/* sparkline: square columns */
.spark { width: 54px; height: 18px; }

/* uptime strip: one cell per check */
.strip { display: flex; gap: 1px; height: 14px; }
.strip i { width: 4px; background: var(--off); }
.strip i.up { background: var(--on); }
.strip i.slow { background: var(--alert-line); }
.strip i.down { background: var(--alert); }

/* ---------------------------------------------------------------- tables (ruled lists) */
.table-wrap { overflow-x: auto; }
table.ruled { width: 100%; border-collapse: collapse; font-size: 14px; }
.ruled th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-dim); padding: 12px 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ruled td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--mid); }
.ruled td.r, .ruled th.r { text-align: right; }
.ruled tbody tr { transition: background-color 160ms var(--ease-out); }
.ruled tbody tr:hover { background: linear-gradient(to right, rgba(242, 242, 237, 0.05), transparent 70%); }
.ruled .row-link { color: var(--on); text-decoration: none; font-weight: 600; }
.ruled .row-link:hover { text-decoration: underline; }
.ruled .sub { display: block; font-size: 12px; color: var(--text-dim); font-weight: 400; }
.ruled tr.group td { padding-top: 26px; border-bottom-color: var(--edge-strong); }

/* state chips: brightness only */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px; border-radius: 2px; font: 600 11.5px/1 var(--mono); letter-spacing: 0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip-hot { background: var(--alert-soft); color: var(--alert); box-shadow: inset 0 0 0 1px var(--alert-line); }
.chip-warn { box-shadow: inset 0 0 0 1px var(--on); color: var(--on); }
.chip-ok { color: var(--mid); background: var(--off); }
.chip-dim { color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--edge); }

/* ---------------------------------------------------------------- issues */
.issues { list-style: none; margin: 0; padding: 0; }
.issue { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.issue .i-title { color: var(--on); font-weight: 600; }
.issue .i-detail { display: block; font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.issue .i-scope { font-size: 13px; }
.issue.is-notice .i-title { color: var(--mid); font-weight: 500; }
@media (max-width: 640px) { .issue { grid-template-columns: 1fr; gap: 6px; } }

/* Segmented control (Pulse spec): outlined track, sliding Phosphor thumb, Steel Grey labels.
   Without JS the active segment is still filled; with JS the thumb carries the fill and slides. */
.filters {
  position: relative; display: inline-flex; gap: 3px; padding: 3px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 0 13px; border: 0; border-radius: 3px; background: transparent;
  color: var(--mid); font: 600 13px/1 var(--body); white-space: nowrap; cursor: pointer;
  transition: color 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.filters button:hover:not([aria-pressed="true"]) { color: var(--on); background: rgba(242, 242, 237, 0.05); }
.filters button[aria-pressed="true"] { background: var(--on); color: var(--bg); }
.filters.seg button[aria-pressed="true"] { background: transparent; }
.filters button:focus-visible { outline: 2px solid var(--on); outline-offset: 2px; }
.filters button:active { transform: translateY(1px); }
.seg-thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 3px;
  background: var(--on); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 4px 12px -6px rgba(0, 0, 0, 0.8);
  transition: transform 300ms var(--ease-out), width 300ms var(--ease-out);
  pointer-events: none;
}
.seg-thumb.is-still { transition: none; }
.seg-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 2px;
  font: 600 11px/1 var(--mono); font-variant-numeric: tabular-nums; background: var(--off); color: var(--mid);
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.filters button[aria-pressed="true"] .seg-count { background: rgba(9, 9, 9, 0.14); color: var(--bg); }
.seg-count.is-hot { background: var(--alert-soft); color: var(--alert); }
.filters button[aria-pressed="true"] .seg-count.is-hot { background: rgba(176, 0, 32, 0.16); color: #8a1712; }
@media (prefers-reduced-motion: reduce) { .seg-thumb { transition: none; } .filters button:active { transform: none; } }

/* key-value list (server detail) */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; color: var(--on); text-align: right; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .cols-2 { grid-template-columns: 1fr; } }

/* well, empty and error states */
.well { padding: 14px 16px; background: var(--well); border: 1px solid var(--edge); border-radius: 6px; font: 13px/1.6 var(--mono); color: var(--on); overflow-x: auto; }
.empty { padding: 32px 0; color: var(--text-dim); font-size: 15px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 24px; border: 1px solid var(--on); border-radius: 6px; color: var(--on); font-size: 14px; }

/* chart */
.chart { width: 100%; height: 120px; }
.chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.chart-box .label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }

/* ---------------------------------------------------------------- attention panel (leads the overview) */
.attention { border: 1px solid var(--on); border-radius: 8px; padding: 6px 20px 4px; margin-bottom: clamp(32px, 4vw, 48px); }
.attention.is-critical { border-color: var(--alert-line); background: linear-gradient(to bottom, rgba(255, 107, 99, 0.05), transparent 160px); }
.issue.is-critical .i-title { color: var(--alert); }
.eyebrow .alert-pip { width: 6px; height: 6px; background: var(--alert); }
.attention.is-calm { border-color: var(--line); }
.attention .issue:last-child { border-bottom: 0; }
.attention-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 10px; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--line); }

/* calmer server card: three meters and one line of facts */
.w-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.w-facts b { color: var(--mid); font-weight: 600; }

/* range control: one row above everything it scopes */
.toolbar h2 { font-size: 18px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* small multiples: a row per metric, a column per server */
.multiples { display: grid; grid-template-columns: 96px repeat(var(--cols, 3), minmax(0, 1fr)); gap: 0 24px; }
.multiples .m-head { padding-bottom: 10px; font-size: 13px; color: var(--text-dim); }
.multiples .m-head strong { display: block; color: var(--on); font-size: 15px; }
.multiples .m-row { align-self: center; font-size: 13px; color: var(--text-dim); }
.multiples .m-row strong { display: block; color: var(--on); font-size: 14px; }
.multiples .m-cell { padding: 14px 0; border-top: 1px solid var(--line); }
.multiples .m-label { grid-column: 1; padding: 14px 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .multiples { grid-template-columns: 1fr; }
  .multiples .m-head, .multiples .m-corner { display: none; }
  .multiples .m-cell::before { content: attr(data-caption); display: block; margin-bottom: 8px; font-size: 13px; color: var(--text-dim); }
  .multiples .m-label { padding-bottom: 0; border-top: 0; margin-top: 18px; }
}

/* line chart */
figure.lc { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 8px; margin: 0; outline-offset: 4px; }
.lc-plot { position: relative; }
.lc-svg { width: 100%; height: 110px; overflow: visible; }
.lc-y { display: flex; flex-direction: column; justify-content: space-between; height: 110px; padding: 1px 0; text-align: right; }
.lc-y span, .lc-x span { font: 11px/1 var(--mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.lc-y span:first-child { transform: translateY(1px); }
.lc-x { grid-column: 2; display: flex; justify-content: space-between; padding-top: 8px; }
/* 8px square end marker with a 2px surface ring */
.lc-end { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--on); box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.lc-hit { cursor: crosshair; }
.lc-tip {
  --x: 50%;
  position: absolute; top: -6px; left: var(--x); transform: translate(-50%, -100%);
  display: grid; gap: 1px; padding: 7px 10px; white-space: nowrap; pointer-events: none;
  background: #181817; border: 1px solid var(--rule-dotted); border-radius: 6px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.9); font-size: 12px; color: var(--text-dim); z-index: 5;
}
.lc-tip strong { color: var(--on); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ranked bars */
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) 72px; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rank .rk-label a { color: var(--on); font-weight: 600; text-decoration: none; }
.rank .rk-label a:hover { text-decoration: underline; }
.rank .rk-label .sub { display: block; font-size: 12px; color: var(--text-dim); }
.rk-track { height: 10px; background: var(--off); }
.rk-bar { display: block; height: 10px; width: 0; background: var(--on); transition: width 450ms var(--ease-out); }
.rk-val { text-align: right; color: var(--on); }
@media (max-width: 520px) { .rank li { grid-template-columns: 1fr 64px; } .rk-track { grid-column: 1 / -1; grid-row: 2; } }

.days { width: 96px; height: 22px; }
.panels { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .panels { grid-template-columns: 1fr; } }
.tally { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tally > div { padding: 18px 16px 16px 0; }
.tally > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.tally .label { margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.note { margin-top: 14px; font-size: 13px; color: var(--text-dim); max-width: 52ch; }
.is-refreshing .lc-svg, .is-refreshing .rank { opacity: 0.55; transition: opacity 200ms var(--ease-out); }

/* ---------------------------------------------------------------- live motion
   Small, ambient, and all of it off under reduced motion. Nothing loops
   except the countdown line, the live pip and failure blinks. */

/* countdown to the next refresh: a hairline that fills under the nav */
.live-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: transparent; overflow: hidden; }
.live-line::after { content: ""; position: absolute; inset: 0; background: rgba(242, 242, 237, 0.35); transform-origin: left; transform: scaleX(0); }
.live-line.is-running::after { animation: live-fill 30s linear forwards; }
@keyframes live-fill { to { transform: scaleX(1); } }

/* a value that changed since the last refresh brightens, then settles */
.is-fresh { animation: fresh 900ms var(--ease-out); }
@keyframes fresh { 0% { filter: brightness(1.9); text-shadow: 0 0 12px rgba(242, 242, 237, 0.5); } 100% { filter: none; text-shadow: none; } }

/* the newest point on every chart breathes, like the widget's live pip */
.lc-end::after { content: ""; position: absolute; inset: -4px; box-shadow: 0 0 0 1px rgba(242, 242, 237, 0.5); animation: ping 2.4s var(--ease-out) infinite; }
.lc-end.is-hot::after { box-shadow: 0 0 0 1px var(--alert-line); }
@keyframes ping { 0% { opacity: 0.9; transform: scale(0.6); } 70%, 100% { opacity: 0; transform: scale(1.8); } }

/* failure markers blink slowly so a down state reads as current, not historical */
.chip-hot::before { content: ""; width: 5px; height: 5px; background: currentColor; animation: alert-blink 1.6s steps(1) infinite; }
@keyframes alert-blink { 50% { opacity: 0.25; } }

/* page entry: content eases in on navigation (not on the 30 s refresh) */
main.is-entering > * { animation: rise 420ms var(--ease-out) both; }
main.is-entering > *:nth-child(2) { animation-delay: 50ms; }
main.is-entering > *:nth-child(3) { animation-delay: 100ms; }
main.is-entering > *:nth-child(4) { animation-delay: 150ms; }
main.is-entering > *:nth-child(n + 5) { animation-delay: 200ms; }
main.is-entering .widget { animation: rise 480ms var(--ease-out) both; }
main.is-entering .widget:nth-child(2) { animation-delay: 70ms; }
main.is-entering .widget:nth-child(3) { animation-delay: 140ms; }
main.is-entering .ruled tbody tr:nth-child(-n + 16), main.is-entering .issue, main.is-entering .rank li { animation: fade-in 360ms var(--ease-out) both; }
main.is-entering .ruled tbody tr:nth-child(2), main.is-entering .issue:nth-child(2), main.is-entering .rank li:nth-child(2) { animation-delay: 30ms; }
main.is-entering .ruled tbody tr:nth-child(3), main.is-entering .issue:nth-child(3), main.is-entering .rank li:nth-child(3) { animation-delay: 60ms; }
main.is-entering .ruled tbody tr:nth-child(4), main.is-entering .issue:nth-child(4), main.is-entering .rank li:nth-child(4) { animation-delay: 90ms; }
main.is-entering .ruled tbody tr:nth-child(n + 5):nth-child(-n + 16), main.is-entering .issue:nth-child(n + 5), main.is-entering .rank li:nth-child(n + 5) { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* cards answer the pointer */
a.widget { transition: border-color 180ms var(--ease-out), transform 180ms var(--ease-out); }
a.widget:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .live-line.is-running::after, .is-fresh, .lc-end::after, .chip-hot::before,
  main.is-entering > *, main.is-entering .widget, main.is-entering .ruled tbody tr, main.is-entering .issue, main.is-entering .rank li { animation: none !important; }
  .lc-end::after { display: none; }
  a.widget:hover { transform: none; }
}

/* ---------------------------------------------------------------- dev page */
.alert-text { color: var(--alert); }
.rk-bar.is-hot { background: var(--alert); }
.section-sm { margin-top: 24px; }
table.errors td { vertical-align: top; }
.err-msg { display: block; max-width: 70ch; color: var(--on); font: 12.5px/1.55 var(--mono); word-break: break-word; }
.mini-track { display: block; width: 56px; height: 4px; margin: 8px 0 0 auto; background: var(--off); }
.mini-track .rk-bar { height: 4px; background: var(--alert); }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 56px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-dim); }
.meter-row .num { text-align: right; color: var(--on); }

/* ---------------------------------------------------------------- gallery cards */
.scope-tabs button { min-width: 84px; }
.toolbar-right { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px;
  background: var(--bg); border: 1px solid rgba(242, 242, 237, 0.14); border-radius: 12px;
  color: var(--mid); text-decoration: none; overflow: hidden;
  transition: border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(242, 242, 237, 0.02) 0 1px, transparent 1px 3px); }
.card:hover { border-color: rgba(242, 242, 237, 0.4); transform: translateY(-2px); }
.card.is-unhealthy { border-color: var(--alert-line); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { color: var(--on); font-weight: 600; font-size: 16px; }
.card-sub { margin-top: -6px; font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-health { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card-health > span { display: grid; gap: 6px; justify-items: start; align-content: start; }
.card-health i { font-style: normal; font-size: 11px; color: var(--text-dim); }
.card-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card-kpis div { display: grid; gap: 2px; }
.card-kpis b { color: var(--on); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.card-kpis span { font-size: 11.5px; color: var(--text-dim); line-height: 1.3; }
.card-spark .spark { width: 100%; height: 26px; }
.card-foot, .card-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-dim); }
.card-line span:last-child { color: var(--mid); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main.is-entering .card { animation: rise 480ms var(--ease-out) both; }
main.is-entering .card:nth-child(2) { animation-delay: 40ms; } main.is-entering .card:nth-child(3) { animation-delay: 80ms; }
main.is-entering .card:nth-child(4) { animation-delay: 120ms; } main.is-entering .card:nth-child(n + 5) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } main.is-entering .card { animation: none !important; } }

/* ---------------------------------------------------------------- account menu */
.menu-wrap { position: relative; }
.me { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; padding: 6px;
  background: rgba(24, 24, 23, 0.98); border: 1px solid var(--rule-dotted); border-radius: 8px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.9);
}
.menu-head { display: grid; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-dim); }
.menu-head strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button {
  display: flex; align-items: center; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 4px;
  background: transparent; color: var(--on); font: 500 14px var(--body); text-decoration: none; cursor: pointer; text-align: left;
}
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--on); color: var(--bg); outline: none; }
.nav-links a { font-size: 14px; padding: 0 9px; }

/* ---------------------------------------------------------------- triage */
.stat-hot .px { color: var(--alert); }
.stat .label a { color: inherit; text-decoration-color: rgba(140, 140, 136, 0.5); }
.tri-line { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.tri b { color: var(--mid); font-weight: 600; }
.issue.is-muted { opacity: 0.6; }
.issue.is-acked .chip-hot::before { animation: none; }
.tri-open { display: flex; width: fit-content; margin-top: 10px; --h: 32px; font-size: 13px; }
.tri-panel { margin-top: 12px; padding: 14px; border: 1px solid var(--edge); border-radius: 8px; background: var(--well); }
.tri-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.tri-field { display: grid; gap: 6px; font-size: 12px; color: var(--text-dim); }
.tri-field select, .field-select {
  height: 36px; padding: 0 10px; border: 1px solid var(--edge-strong); border-radius: 6px;
  background: var(--bg); color: var(--on); font: 400 14px var(--body);
}
.tri-notes { margin-top: 14px; display: grid; gap: 10px; font-size: 14px; }
.note-row p { margin-top: 2px; color: var(--mid); white-space: pre-wrap; }
.tri-note { display: flex; gap: 10px; align-items: end; margin-top: 12px; }
.tri-note textarea {
  flex: 1; min-height: 44px; padding: 10px 12px; border: 1px solid var(--edge-strong); border-radius: 6px;
  background: var(--bg); color: var(--on); font: 400 14px/1.5 var(--body); resize: vertical;
}
.tri-panel .form-error { margin: 8px 0 0; min-height: 0; }

/* ---------------------------------------------------------------- incidents, changes, reports */
.row-hot td:first-child { box-shadow: inset 2px 0 0 var(--alert); }
.row-muted td { opacity: 0.55; }
.sub-head { margin: 22px 0 6px; font-size: 14px; color: var(--mid); }
.dtc { display: flex; align-items: end; gap: 3px; height: 120px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.dtc-col { flex: 1; height: 100%; display: flex; align-items: end; position: relative; }
.dtc-col:not(.is-down)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--off); }
.dtc-bar { display: block; width: 100%; height: 0; background: var(--alert); transition: height 450ms var(--ease-out); }
.dtc-axis { display: flex; justify-content: space-between; padding-top: 8px; font: 11px var(--mono); color: var(--text-dim); }
.timeline { margin-top: 34px; }
.tl-day { font-size: 14px; color: var(--mid); font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tl { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tl-item::before { content: ""; position: absolute; left: 0; top: 19px; width: 6px; height: 6px; background: var(--mid); }
.tl-item.is-hot::before { background: var(--alert); }
.tl-time { color: var(--text-dim); font-size: 13px; }
.tl-body { display: grid; gap: 2px; }
.report-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.up-cell { display: grid; grid-template-columns: 64px 140px; gap: 12px; align-items: center; }
.upbar { position: relative; display: block; height: 8px; background: var(--off); }
.upbar-fill { display: block; height: 8px; width: 0; background: var(--on); transition: width 450ms var(--ease-out); }
.upbar-fill.is-hot { background: var(--alert); }
.upbar-target { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--mid); }
@media (max-width: 640px) { .up-cell { grid-template-columns: 1fr; } .tri-note { flex-direction: column; align-items: stretch; } }

/* reports print as a clean document */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; color: #111; }
  body::before, .nav, .report-tools, .live-line, .skip, .eyebrow .scanner { display: none !important; }
  main { padding: 0; }
  .px, h1, h2, .on, .row-link, .stat .px, strong { color: #111 !important; }
  .dim, .sub, .label, .hint, .note, .stat-sub, .ruled th, .ruled td { color: #444 !important; }
  .ruled td, .ruled th, .stats, .stat + .stat, .section-head { border-color: #ccc !important; }
  .upbar { background: #e5e5e5; } .upbar-fill { background: #111; } .upbar-fill.is-hot, .alert-text, .stat-hot .px { color: #b00020 !important; background-color: #b00020; }
  .alert-text { background: none; }
  .chip { box-shadow: inset 0 0 0 1px #999; background: none; color: #111; }
  a { text-decoration: none; }
  main.is-entering > * { animation: none !important; }
}

/* inline filter and the add-URL form */
.field-inline {
  width: min(100%, 260px); height: 44px; padding: 0 14px; border: 1px solid var(--edge-strong); border-radius: 6px;
  background: var(--well); color: var(--on); font: 400 15px var(--body);
}
.field-inline:focus { outline: 2px solid var(--on); outline-offset: 1px; }
.add-url { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 0 16px; align-items: end; padding-top: 16px; }
.add-url .field { margin-bottom: 0; }
.add-url .form-error { grid-column: 1 / -1; order: 5; margin: 10px 0 0; }
.add-url .field input { height: 40px; padding: 0 12px; border: 1px solid var(--edge-strong); border-radius: 6px; background: var(--well); color: var(--on); font: 400 15px var(--body); }
@media (max-width: 760px) { .add-url { grid-template-columns: 1fr; gap: 12px; } }

/* ---------------------------------------------------------------- login */
.login-body {
  /* the Pulse desktop: ordered-dither wallpaper with a soft top light */
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(242, 242, 237, 0.06), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23ffffff' fill-opacity='.05'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23ffffff' fill-opacity='.05'/%3E%3C/svg%3E"),
    var(--bg);
}
/* sign-in hero: the Pulse marketing layout over a live ASCII field */
.ascii-field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
/* darken behind the copy and the card so text never fights the field */
.login-body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(48% 42% at 28% 44%, rgba(9, 9, 9, 0.8), rgba(9, 9, 9, 0.2) 70%, transparent),
    radial-gradient(26% 46% at 78% 50%, rgba(9, 9, 9, 0.75), transparent 80%);
}
.login-nav { position: relative; z-index: 2; background: transparent; }
.login-nav .nav-meta { margin-left: auto; }
.login-nav .brand .scanner { margin-left: 4px; }
.login-hero {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 400px); gap: clamp(32px, 6vw, 96px);
  align-items: center; min-height: calc(100vh - 68px); padding: clamp(24px, 4vw, 48px) 0 clamp(48px, 8vw, 96px);
}
.hero-title { margin: 0; }
.px-hero { --dot: 12px; }
.assembling rect { opacity: 0; animation: dot-in 420ms var(--ease-out) forwards; }
@keyframes dot-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
.login-copy .lede { max-width: 34ch; margin-top: clamp(22px, 3vw, 32px); font-size: clamp(19px, 2vw, 23px); line-height: 1.45; }
.login-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; font-size: 15px; color: var(--mid); }
.login-points li { display: flex; align-items: center; gap: 12px; }
.login-points .pt { width: 6px; height: 6px; background: var(--on); flex: none; }
.login-title { font-size: 20px; margin: 0 0 22px; }
@media (max-width: 860px) {
  .login-hero { grid-template-columns: 1fr; align-items: start; min-height: 0; }
  .login-points { display: none; }
  .login-body::after { background: rgba(9, 9, 9, 0.78); }
}
.login-card {
  position: relative;
  padding: 32px;
  background: var(--bg);
  border: 1px solid rgba(242, 242, 237, 0.16);
  border-radius: 14px;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.7));
  overflow: hidden;
}
.login-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(242, 242, 237, 0.02) 0 1px, transparent 1px 3px); }
.login-card .eyebrow { margin-bottom: 14px; }
.login-help { margin-top: 18px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.form-alert { display: flex; gap: 10px; align-items: baseline; margin: 0 0 18px; padding: 11px 14px; border-radius: 6px; background: var(--alert-soft); box-shadow: inset 0 0 0 1px var(--alert-line); color: var(--alert); font-size: 14px; line-height: 1.45; }
.form-alert::before { content: ""; flex: none; width: 6px; height: 6px; background: var(--alert); transform: translateY(-1px); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.caps { font-size: 12px; color: var(--alert); }
.pw { position: relative; }
.pw input { width: 100%; padding-right: 72px; }
.pw-toggle {
  position: absolute; top: 6px; right: 6px; bottom: 6px; min-width: 56px; padding: 0 10px;
  border: 1px solid var(--edge); border-radius: 4px; background: transparent; color: var(--mid);
  font: 600 13px/1 var(--body); cursor: pointer; transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--on); border-color: var(--edge-strong); }
.field input[aria-invalid="true"] { border-color: var(--alert-line); }
.field input[aria-invalid="true"]:focus { outline-color: var(--alert); }
/* keep browser autofill on the dark well instead of a bright box */
.field input:-webkit-autofill, .field input:-webkit-autofill:hover, .field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--on);
  caret-color: var(--on);
  box-shadow: 0 0 0 1000px var(--well) inset;
  transition: background-color 9999s ease-out;
}
.field input::placeholder { color: #5f5f5c; }
.login .footer-note { margin-top: 18px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 13px; color: var(--text-dim); }
.field input {
  height: 48px; padding: 0 14px; border: 1px solid var(--edge-strong); border-radius: 6px;
  background: var(--well); color: var(--on); font: 400 16px var(--body);
}
.field input:focus { outline: 2px solid var(--on); outline-offset: 1px; border-color: var(--on); }
.form-error { min-height: 22px; margin: -6px 0 12px; font-size: 14px; color: var(--alert); }
.form-error.is-ok { color: var(--mid); }
.login-card .btn { width: 100%; }
.footer-note { margin-top: 22px; font-size: 12px; color: var(--text-dim); text-align: center; }
