/* Material 3 Expressive, hand-rolled. */

:root {
  color-scheme: light dark;
  --shadow: light-dark(oklch(0.2 0.02 280 / 0.14), oklch(0 0 0 / 0.5));

  /* Status colours always ship with an icon and a label. */
  --ok: light-dark(#1b7a33, #8edb9b);
  --ok-c: light-dark(#c6f2c3, #12401c);
  --on-ok-c: light-dark(#002107, #c6f2c3);
  --ok-shape: light-dark(#1f9d3f, #4cc66a);
  --warn-c: light-dark(#ffdbcb, #5a2511);
  --on-warn-c: light-dark(#3a0d00, #ffdbcb);
  --warn-shape: light-dark(#f07a4a, #ff9c70);
  --on-warn-shape: #3a0d00;
  --err: light-dark(#ba1a1a, #ffb4ab);
  --err-c: light-dark(#ffdad6, #5e0c0c);
  --on-err-c: light-dark(#410002, #ffdad6);
  --err-shape: light-dark(#d93a3a, #ff6b63);
  --bar-ok: light-dark(#22a447, #4cc66a);
  --bar-minor: #f2b300;
  --bar-partial: #f08a4b;
  --bar-major: light-dark(#dc3b3b, #ff6b63);
  --fail-band: light-dark(#f6c9c9, #5e2228);

  --font: "Roboto Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SF Mono", monospace;

  /* Corners must not overshoot: from 999px an overshoot lands below zero and
     flashes square corners. Size and scale may spring. */
  --shape-ease: cubic-bezier(0.2, 0, 0, 1);
  --spring: cubic-bezier(0.3, 1.6, 0.5, 1);
  /* A damped spring: 20% overshoot, then a 4% dip back. */
  --bounce: linear(0, 0.012 1.3%, 0.056 2.8%, 0.139 4.5%, 0.279 6.8%, 0.745 13.3%, 0.9 15.8%, 1.014 18%, 1.1 20.3%, 1.159 22.5%, 1.196 25%, 1.205 27.8%, 1.183 31.3%, 1.093 37.8%, 1.01 44%, 0.97 49.3%, 0.958 55.3%, 1.006 76.8%, 1);
  --press: border-radius 320ms var(--shape-ease), padding 500ms var(--spring), transform 500ms var(--spring), background-color 200ms, color 200ms;
}

/* Swatches in the theme menu set data-palette on themselves, so palettes
   must not be scoped to :root. Palettes after the default come from
   material-color-utilities at the default's tones: SchemeTonalSpot for teal,
   SchemeContent for yellow and red (TonalSpot dulls them to olive and brick),
   SchemeMonochrome for gray. */
:root, [data-palette="violet"] {
  --bg: light-dark(#fdf7ff, #141218);
  --surface-low: light-dark(#f7f2fa, #1b1920);
  --surface: light-dark(#f2ecf6, #211f26);
  --surface-high: light-dark(#ece6f0, #2b2930);
  --surface-highest: light-dark(#e4ddeb, #36343b);
  --on: light-dark(#1d1b20, #e6e0e9);
  --on-var: light-dark(#49454f, #cac4d0);
  --outline: light-dark(#79747e, #938f99);
  --outline-var: light-dark(#cac4d0, #49454f);
  --primary: light-dark(#65558f, #cfbcff);
  --on-primary: light-dark(#fff, #381e72);
  --primary-c: light-dark(#e9ddff, #4f378a);
  --on-primary-c: light-dark(#22005d, #e9ddff);
  --bar-none: light-dark(#e2dce8, #3a3641);
}
[data-palette="teal"] {
  --bg: light-dark(#f4fbfa, #0e1514);
  --surface-low: light-dark(#eff5f4, #161d1d);
  --surface: light-dark(#e9efee, #1a2121);
  --surface-high: light-dark(#e3e9e9, #252b2b);
  --surface-highest: light-dark(#dde4e3, #2f3636);
  --on: light-dark(#161d1d, #dde4e3);
  --on-var: light-dark(#3f4948, #bec9c8);
  --outline: light-dark(#6f7979, #889392);
  --outline-var: light-dark(#bec9c8, #3f4948);
  --primary: light-dark(#006a6a, #80d5d4);
  --on-primary: light-dark(#fff, #003737);
  --primary-c: light-dark(#9cf1f0, #004f4f);
  --on-primary-c: light-dark(#002020, #9cf1f0);
  --bar-none: light-dark(#d7e2e1, #313b3b);
}
[data-palette="yellow"] {
  --bg: light-dark(#fff8f0, #17130a);
  --surface-low: light-dark(#fcf3e2, #1f1b11);
  --surface: light-dark(#f6eddc, #231f15);
  --surface-high: light-dark(#f0e7d7, #2e2a1f);
  --surface-highest: light-dark(#ebe1d1, #393429);
  --on: light-dark(#1f1b11, #ebe1d1);
  --on-var: light-dark(#4e4633, #d1c5ac);
  --outline: light-dark(#7f7660, #9a9079);
  --outline-var: light-dark(#d1c5ac, #4e4633);
  --primary: light-dark(#735c00, #efc11c);
  --on-primary: light-dark(#fff, #3c2f00);
  --primary-c: light-dark(#ffe088, #574500);
  --on-primary-c: light-dark(#241a00, #ffe088);
  --bar-none: light-dark(#ebdfc4, #403926);
}
[data-palette="red"] {
  --bg: light-dark(#fff8f7, #1d100e);
  --surface-low: light-dark(#fff0ee, #261816);
  --surface: light-dark(#ffe9e6, #2b1c1a);
  --surface-high: light-dark(#fee2de, #362624);
  --surface-highest: light-dark(#f8dcd9, #42312e);
  --on: light-dark(#261816, #f8dcd9);
  --on-var: light-dark(#5a403d, #e2beb9);
  --outline: light-dark(#8e706c, #a98985);
  --outline-var: light-dark(#e2beb9, #5a403d);
  --primary: light-dark(#b4271f, #ffb4aa);
  --on-primary: light-dark(#fff, #690003);
  --primary-c: light-dark(#ffdad5, #910809);
  --on-primary-c: light-dark(#410001, #ffdad5);
  --bar-none: light-dark(#fdd7d2, #4b3330);
}
[data-palette="gray"] {
  --bg: light-dark(#f9f9f9, #131313);
  --surface-low: light-dark(#f3f3f3, #1b1b1b);
  --surface: light-dark(#eeeeee, #1f1f1f);
  --surface-high: light-dark(#e8e8e8, #2a2a2a);
  --surface-highest: light-dark(#e2e2e2, #353535);
  --on: light-dark(#1b1b1b, #e2e2e2);
  --on-var: light-dark(#474747, #c6c6c6);
  --outline: light-dark(#777777, #919191);
  --outline-var: light-dark(#c6c6c6, #474747);
  --primary: light-dark(#5e5e5e, #c6c6c6);
  --on-primary: light-dark(#fff, #303030);
  --primary-c: light-dark(#e2e2e2, #474747);
  --on-primary-c: light-dark(#1b1b1b, #e2e2e2);
  --bar-none: light-dark(#dfdfdf, #393939);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--on);
  font: 400 0.9rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color 300ms;
}

a { color: var(--primary); }
code { font-family: var(--mono); font-size: 0.9em; overflow-wrap: anywhere; }

.icon { width: 1.35rem; height: 1.35rem; flex: none; fill: currentColor; }

.skip {
  position: absolute;
  left: 0.9rem;
  top: -5.625rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  z-index: 10;
}
.skip:focus { top: 0.675rem; }

:focus-visible { outline: 0.169rem solid var(--primary); outline-offset: 0.113rem; }

/* ---------- tones ---------- */

[data-level] { --tone-c: var(--surface-high); --on-tone-c: var(--on); --shape-c: var(--outline); --shape-on: var(--bg); }
[data-level="ok"] { --tone-c: var(--ok-c); --on-tone-c: var(--on-ok-c); --shape-c: var(--ok-shape); --shape-on: #fff; }
[data-level="minor"], [data-level="partial"] { --tone-c: var(--warn-c); --on-tone-c: var(--on-warn-c); --shape-c: var(--warn-shape); --shape-on: var(--on-warn-shape); }
[data-level="major"] { --tone-c: var(--err-c); --on-tone-c: var(--on-err-c); --shape-c: var(--err-shape); --shape-on: #fff; }

/* ---------- shapes ---------- */

.mshape {
  --size: 2.475rem;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  flex: none;
  color: var(--shape-on);
}
.mshape .shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mshape .shape path { fill: var(--shape-c); transition: fill 400ms; }
.mshape .icon { position: relative; width: calc(var(--size) * 0.46); height: calc(var(--size) * 0.46); }

/* ---------- page ---------- */

.page {
  max-width: 63rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.125rem 1.35rem 2.7rem;
  display: flex;
  flex-direction: column;
  gap: 1.575rem;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  min-width: 0;
  transition: opacity 200ms;
}
.content[aria-busy="true"] { opacity: 0.85; }

.footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.225rem 0.45rem;
  color: var(--on-var);
  font-size: 0.731rem;
  line-height: 1.012rem;
}

/* ---------- top bar ---------- */

.top-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem; }

.brand {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  gap: 0.675rem;
  color: inherit;
  text-decoration: none;
}
.brand-mark { --size: 2.7rem; --shape-c: var(--primary-c); --shape-on: var(--on-primary-c); }
.brand-mark .icon { width: 1.35rem; height: 1.35rem; }
.brand-name {
  font-size: 1.463rem;
  line-height: 1.2;
  font-weight: 800;
  font-variation-settings: "wdth" 125, "opsz" 32;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.225rem;
  padding: 0.225rem;
  border-radius: 999px;
  background: var(--surface-high);
}
.nav-item {
  padding: 0.675rem 1.012rem;
  border-radius: 0.675rem;
  color: var(--on-var);
  font-size: 0.844rem;
  line-height: 1.125rem;
  font-weight: 550;
  text-decoration: none;
  transition: var(--press);
}
/* Outer corners concentric with the pill .nav: half the 2.475rem item height.
   999px would trigger radius scaling and flatten the 0.675rem inner corners.
   Must precede the selected and pressed rules so their radii win. */
.nav-item:first-child { border-start-start-radius: 1.238rem; border-end-start-radius: 1.238rem; }
.nav-item:last-child { border-start-end-radius: 1.238rem; border-end-end-radius: 1.238rem; }
.nav-item:hover { background: color-mix(in oklch, var(--on) 8%, transparent); }
.nav-item[aria-current] { padding-inline: 1.463rem; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 700; }
.nav-item[aria-current] + .nav-item { padding-inline-start: 0.563rem; }
.nav-item:has(+ .nav-item[aria-current]) { padding-inline-end: 0.563rem; }
.nav-item:active { border-radius: 0.787rem; transform: scale(0.96); }
.nav-form { display: contents; }

.theme { position: relative; }

.theme-btn {
  position: relative;
  z-index: 16;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 1.35rem;
  background: var(--primary-c);
  color: var(--on-primary-c);
  cursor: pointer;
  transition: var(--press);
}
.theme-btn:hover { border-radius: 0.787rem; }
/* Concentric with the popup's 1.575rem corner, 0.9rem out. */
.theme-btn[aria-expanded="true"] { border-radius: 0.675rem; }
.theme-btn:active { transform: scale(0.9) rotate(-20deg); }
/* Icons in markup order: auto, dark, light. */
.theme-btn .icon { display: none; }
:root:not([data-theme]) .theme-btn .icon:nth-child(1),
:root[data-theme="dark"] .theme-btn .icon:nth-child(2),
:root[data-theme="light"] .theme-btn .icon:nth-child(3) { display: block; }

.theme-menu {
  z-index: 15;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on);
}
/* The surface is its own layer so it can grow with its shadow, which a
   clip-path would cut off. */
.theme-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 1.575rem;
  background: var(--surface-high);
  box-shadow: 0 0.338rem 1.125rem var(--shadow), 0 1px 0.169rem var(--shadow);
}
.theme-menu:modal { inset: 0; width: min(20.25rem, calc(100% - 1.8rem)); margin: auto; animation: pop 300ms var(--spring); }
.theme-menu::backdrop { background: oklch(0 0 0 / 0.32); }
/* Fills the dialog, so a click that lands on the modal itself came from
   the backdrop. */
.theme-body { display: flex; flex-direction: column; gap: 0.787rem; padding: 0.9rem; }
.theme-menu:modal .theme-body { gap: 1.125rem; padding: 1.125rem 1.35rem 1.575rem; }

/* The popup reaches 0.9rem past the button, which stays on top as its header
   icon. Until .expanded it is collapsed onto the button, in its colour. */
.theme-menu:not(:modal) { inset: -0.9rem -0.9rem auto auto; pointer-events: none; }
.theme-menu:not(:modal)::before {
  inset: 0.9rem 0.9rem calc(100% - 3.6rem) calc(100% - 3.6rem);
  border-radius: 1.35rem;
  background: var(--primary-c);
  box-shadow: 0 0.338rem 1.125rem transparent, 0 1px 0.169rem transparent;
  transition: inset 200ms var(--shape-ease), border-radius 200ms var(--shape-ease), background-color 200ms, box-shadow 200ms;
}
.theme-menu:not(:modal) .theme-body {
  clip-path: inset(0.9rem 0.9rem calc(100% - 3.6rem) calc(100% - 3.6rem) round 1.35rem);
  opacity: 0;
  transition: clip-path 200ms var(--shape-ease), opacity 70ms;
}
.theme-menu.expanded { pointer-events: auto; }
.theme-menu.expanded::before {
  inset: 0;
  border-radius: 1.575rem;
  background: var(--surface-high);
  box-shadow: 0 0.338rem 1.125rem var(--shadow), 0 1px 0.169rem var(--shadow);
  transition: inset 330ms var(--shape-ease), border-radius 330ms var(--shape-ease), background-color 200ms, box-shadow 330ms;
}
.theme-menu.expanded .theme-body {
  clip-path: inset(0 round 1.575rem);
  opacity: 1;
  transition: clip-path 330ms var(--shape-ease), opacity 170ms 70ms;
}

.theme-head { display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; padding-inline-start: 0.225rem; }
.theme-menu:not(:modal) .theme-head { min-height: 2.7rem; }
.theme-title { margin: 0; color: var(--on-var); font-size: 0.787rem; line-height: 1.125rem; font-weight: 650; }
.theme-menu:modal .theme-title { color: var(--on); font-size: 1.35rem; line-height: 1.8rem; font-weight: 720; font-variation-settings: "wdth" 112; }
.theme-close {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  margin: -0.225rem -0.45rem -0.225rem 0;
  border: 0;
  border-radius: 1.125rem;
  background: transparent;
  color: var(--on-var);
  cursor: pointer;
  transition: var(--press);
}
.theme-close:hover { background: color-mix(in oklch, var(--on) 8%, transparent); }
.theme-close:active { border-radius: 0.675rem; transform: scale(0.9); }
.theme-menu:not(:modal) .theme-close { display: none; }

.theme-menu input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }

.theme-modes .seg { flex: 1 1 auto; justify-content: center; padding-inline: 0.787rem; cursor: pointer; }
.theme-modes .seg:has(:checked) { padding-inline: 1.125rem; }
.theme-modes .seg:has(:focus-visible) { outline: 0.169rem solid var(--primary); outline-offset: 0.113rem; }

.theme-colors { display: flex; justify-content: space-between; gap: 0.225rem; }
.theme-color {
  position: relative;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: box-shadow 200ms;
}
.theme-color:hover { background: color-mix(in oklch, var(--on) 8%, transparent); }
.theme-color:has(:checked) { box-shadow: inset 0 0 0 0.169rem var(--primary); }
.theme-color:has(:focus-visible) { outline: 0.169rem solid var(--on); outline-offset: 0.113rem; }
.theme-swatch { width: 2.25rem; height: 2.25rem; transition: transform 500ms var(--spring); }
.theme-color:has(:checked) .theme-swatch { transform: scale(0.75); }
.theme-color:active .theme-swatch { transform: scale(0.85); }
.theme-swatch path:nth-child(1) { fill: var(--primary-c); }
.theme-swatch path:nth-child(2) { fill: var(--on-primary-c); }
.theme-swatch path:nth-child(3) { fill: var(--primary); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--press);
}
.btn:active { transform: scale(0.95); }

.btn-text {
  padding: 0.675rem 0.9rem;
  border-radius: 1.35rem;
  background: transparent;
  color: var(--primary);
  font-size: 0.844rem;
  line-height: 1.125rem;
  font-weight: 600;
}
.btn-text:hover { background: var(--surface-high); }
.btn-text:active { border-radius: 0.787rem; transform: none; }

.btn-tonal, .btn-filled {
  min-height: 2.925rem;
  padding: 0 1.238rem;
  border-radius: 1.463rem;
  font-size: 0.844rem;
  font-weight: 700;
}
.btn-tonal { background: var(--primary-c); color: var(--on-primary-c); }
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-tonal:hover, .btn-filled:hover { border-radius: 0.9rem; }
.btn-tonal .icon { width: 1.238rem; height: 1.238rem; margin-left: -0.225rem; }

/* ---------- hero ---------- */

.hero-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.45rem; }
.hero-row .hero { flex: 999 1 23.625rem; }

.hero {
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.8rem 2.475rem;
  padding: 2.25rem 2.475rem;
  border-radius: 3.15rem 3.15rem 3.15rem 1.125rem;
  background: var(--tone-c);
  color: var(--on-tone-c);
  transition: background-color 400ms;
}
.hero-shape { --size: 11.25rem; }

.hero-text { flex: 1 1 21.375rem; min-width: 0; display: flex; flex-direction: column; gap: 1.012rem; }
.hero-title {
  margin: 0;
  font-size: clamp(2.925rem, 8vw, 5.625rem);
  line-height: 0.92;
  font-weight: 780;
  font-variation-settings: "wdth" 118, "opsz" 144;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.563rem; margin-top: 0.338rem; }
.count {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.563rem 1.125rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--on-tone-c) 9%, transparent);
}
.count-n { font-size: 1.688rem; line-height: 1.2; font-weight: 800; font-variation-settings: "wdth" 125; }
.count-label { font-size: 0.844rem; font-weight: 600; }

.btn-hero {
  min-height: 3.15rem;
  padding: 0 1.35rem;
  border-radius: 1.575rem;
  background: var(--on-tone-c);
  color: var(--tone-c);
  font-size: 0.9rem;
  font-weight: 700;
}
.btn-hero:hover { border-radius: 1.012rem; padding-inline: 1.688rem; }
.btn-hero .icon { width: 1.238rem; height: 1.238rem; }

.hero-sub { gap: 1.35rem 2.025rem; padding: 1.8rem 2.25rem; border-radius: 3.15rem 1.125rem 3.15rem 3.15rem; }
.hero-health { border-radius: 1.125rem 3.15rem 3.15rem 3.15rem; }
.hero-sub .hero-shape { --size: 7.875rem; }
.hero-sub .hero-text { flex-basis: 16.875rem; gap: 0.45rem; }
.hero-sub .hero-title { font-size: clamp(2.475rem, 6vw, 4.05rem); line-height: 0.95; font-weight: 800; font-variation-settings: "wdth" 125, "opsz" 144; letter-spacing: -0.03em; }
.hero-detail { margin: 0; font-size: 1.012rem; }
.hero-message {
  align-self: flex-start;
  margin-top: 0.338rem;
  padding: 0.563rem 0.9rem;
  border-radius: 0.9rem;
  background: color-mix(in oklch, var(--on-tone-c) 9%, transparent);
  font-size: 0.787rem;
  line-height: 1.5;
}

/* ---------- refresh countdown ---------- */

.refresh {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.675rem;
  padding: 0.45rem 0.675rem;
}
.ring { width: 2.475rem; height: 2.475rem; flex: none; overflow: visible; }
.ring path { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ring-track { stroke: var(--tone-c); }
.ring-progress { stroke: var(--shape-c); }

/* app.js sizes the text to fill the height beside the hero. It is out of
   flow so its length cannot stretch the row it is measured against. */
.refresh-box { --fit: 2.25rem; position: relative; flex: 1 1 0; min-height: 0; width: var(--fit); overflow: hidden; }
.refresh-text {
  position: absolute;
  top: 0;
  left: 0;
  writing-mode: vertical-rl;
  white-space: nowrap;
  font-size: var(--fit);
  line-height: 1;
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  letter-spacing: 0.02em;
}

/* ---------- monitor list ---------- */

.status-page { display: flex; flex-direction: column; gap: 2.25rem; }

.group { display: flex; flex-direction: column; gap: 0.787rem; }
.group-head { display: flex; align-items: center; gap: 0.675rem; padding: 0 0.675rem; }
.group-title {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.2;
  font-weight: 750;
  font-variation-settings: "wdth" 115, "opsz" 40;
  letter-spacing: -0.02em;
}

.pill {
  padding: 0.225rem 0.675rem;
  border-radius: 999px;
  background: var(--primary-c);
  color: var(--on-primary-c);
  font-size: 0.787rem;
  font-weight: 700;
  white-space: nowrap;
}

/* The list clips its outer corners round; items keep small corners until
   hovered. */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.169rem;
  border-radius: 2.025rem;
  overflow: hidden;
}

.item {
  --item-fg: var(--on);
  --item-var: var(--on-var);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.125rem 1.35rem;
  border-radius: 0.45rem;
  background: var(--surface);
  color: var(--item-fg);
  transition: border-radius 420ms var(--shape-ease), background-color 200ms;
}
.item[data-level="major"] { --item-fg: var(--on-err-c); --item-var: var(--on-err-c); background: var(--err-c); }
.item-link:hover, .item-link:focus-within { border-radius: 1.8rem; }
.item-link:not([data-level="major"]):hover { background: var(--surface-high); }

/* The right padding keeps the row clear of the tall bars for recent days. */
.item-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-right: 4.05rem;
  color: inherit;
  text-decoration: none;
}
a.item-head::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
a.item-head:focus-visible { outline: none; }
.item-link:has(> a.item-head:focus-visible) { outline: 0.169rem solid var(--primary); outline-offset: -0.169rem; }

.item-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.113rem; }
.item-name {
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 650;
  font-variation-settings: "wdth" 108;
  overflow-wrap: anywhere;
}
.item-desc { color: var(--item-var, var(--on-var)); font-size: 0.787rem; line-height: 1.4; overflow-wrap: anywhere; }
.item-state { font-size: 0.844rem; font-weight: 700; color: var(--ok); white-space: nowrap; }
[data-level="major"] > .item-head .item-state { color: var(--err); }
[data-level="none"] > .item-head .item-state { color: var(--on-var); }

.chip {
  padding: 0.225rem 0.563rem;
  border-radius: 0.45rem;
  border: 1px solid var(--outline-var);
  color: var(--item-var, var(--on-var));
  font: 600 0.675rem/0.9rem var(--mono);
  white-space: nowrap;
}

/* ---------- daily bars ---------- */

/* The last few days grow taller and wider, so today reads first. */
.bars {
  --h: 1.575rem;
  --grow: 3.712rem;
  --gap: 0.169rem;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: var(--gap);
  height: var(--h);
  margin-top: 0.675rem;
}
/* Hovering only ever changes heights: a change in width would slide the next
   day under the pointer. The ceiling sits just above today's resting height,
   which the content above already clears. */
.bar {
  --e: 0;
  --m: 0;
  --rest: calc(var(--h) + var(--grow) * var(--e));
  --peak: min(var(--rest) + 0.8 * var(--h), 1.12 * (var(--h) + var(--grow)));
  position: relative;
  flex-grow: calc(1 + 1.4 * var(--e));
  flex-basis: 0;
  min-width: 0.113rem;
  height: calc(var(--rest) + (var(--peak) - var(--rest)) * var(--m));
  border-radius: 999px;
  background: var(--bar-none);
  transition: height 650ms var(--bounce), filter 150ms;
}
/* The hit area spans the gaps and the room the bar grows into, so the pointer
   never falls between bars or off a bar that is still growing. */
.bar::before {
  content: "";
  position: absolute;
  inset: auto calc(var(--gap) / -2) 0;
  height: var(--peak);
}
.bar:nth-last-child(1) { --e: 1; }
.bar:nth-last-child(2) { --e: 0.5; }
.bar:nth-last-child(3) { --e: 0.25; }
.bar:nth-last-child(4) { --e: 0.125; }
.bar:nth-last-child(5) { --e: 0.0625; }
.bar:nth-last-child(6) { --e: 0.03125; }
.bar:nth-last-child(7) { --e: 0.015625; }
.bar[data-level="ok"] { background: var(--bar-ok); }
.bar[data-level="minor"] { background: var(--bar-minor); }
.bar[data-level="partial"] { background: var(--bar-partial); }
.bar[data-level="major"] { background: var(--bar-major); }
.bar.active { --m: 1; filter: brightness(1.08) saturate(1.1); }
.bar.active + .bar, .bar:has(+ .bar.active) { --m: 0.5; }
.bar.active + * + .bar, .bar:has(+ * + .bar.active) { --m: 0.25; }
.bar.active + * + * + .bar, .bar:has(+ * + * + .bar.active) { --m: 0.125; }
.bar.active + * + * + * + .bar, .bar:has(+ * + * + * + .bar.active) { --m: 0.0625; }
.bar:focus-visible { outline-width: 0.113rem; outline-offset: 1px; }
.item-link .bar { cursor: pointer; }

/* The margin leaves room for a hovered bar's bounce under the title. */
.card .bars { --h: 2.25rem; --grow: 3.15rem; margin-top: 1.35rem; }

.bars-axis {
  display: flex;
  align-items: center;
  gap: 0.675rem;
  color: var(--item-var, var(--on-var));
  font-size: 0.731rem;
  line-height: 1.012rem;
  white-space: nowrap;
}
.axis-rule { flex: 1; height: 1px; background: var(--outline-var); }
.axis-uptime { color: var(--item-fg, var(--on)); font-size: 0.787rem; font-weight: 750; }

.span-60, .span-30 { display: none; }

/* Fewer days on narrow screens, like the status pages users know. */
@media (max-width: 50.5625em) {
  .bars .bar:nth-child(-n+30) { display: none; }
  .span-90 { display: none; }
  .span-60 { display: inline; }
}
@media (max-width: 33.6875em) {
  .bars .bar:nth-child(-n+60) { display: none; }
  .span-60 { display: none; }
  .span-30 { display: inline; }
}

.legend { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0 0.225rem; list-style: none; }
.legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.787rem 0.45rem 0.563rem;
  border-radius: 0.675rem;
  background: var(--surface);
  font-size: 0.787rem;
  line-height: 1.125rem;
}
.legend-label { font-weight: 600; }
.legend-note { color: var(--on-var); }

.swatch { display: inline-block; width: 0.45rem; height: 1.012rem; flex: none; border-radius: 999px; background: var(--bar-none); vertical-align: -0.225rem; }
.swatch[data-level="ok"] { background: var(--bar-ok); }
.swatch[data-level="minor"] { background: var(--bar-minor); }
.swatch[data-level="partial"] { background: var(--bar-partial); }
.swatch[data-level="major"] { background: var(--bar-major); }
.swatch-band { width: 0.787rem; height: 0.787rem; border-radius: 0.281rem; background: var(--fail-band); vertical-align: -0.113rem; }

/* ---------- tooltip ---------- */

.tooltip {
  position: fixed;
  z-index: 20;
  max-width: min(16.875rem, calc(100vw - 1.8rem));
  padding: 0.675rem 0.9rem;
  border-radius: 0.9rem;
  background: var(--surface-highest);
  color: var(--on);
  box-shadow: 0 0.338rem 1.125rem var(--shadow), 0 1px 0.169rem var(--shadow);
  pointer-events: none;
  font-size: 0.731rem;
  line-height: 1.012rem;
  transform-origin: var(--origin, 50% 100%);
  animation: pop 250ms var(--spring);
}
.tooltip[hidden] { display: none; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }

.tt-title { color: var(--on-var); font-size: 0.675rem; font-weight: 500; }
.tt-value { display: flex; align-items: center; gap: 0.45rem; margin: 0.225rem 0 0.113rem; font-size: 0.844rem; line-height: 1.125rem; font-weight: 650; }
.tt-key { width: 0.338rem; height: 0.9rem; flex: none; border-radius: 999px; background: var(--bar-none); }
.tt-key[data-level="ok"] { background: var(--bar-ok); }
.tt-key[data-level="minor"] { background: var(--bar-minor); }
.tt-key[data-level="partial"] { background: var(--bar-partial); }
.tt-key[data-level="major"] { background: var(--bar-major); }
.tt-key[data-level="line"] { background: var(--primary); }
.tt-muted { color: var(--on-var); }
.tt-line:empty { display: none; }

/* ---------- page heads ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.125rem; }
.page-head-end { align-items: flex-end; gap: 0.9rem; }
.page-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.page-head-end .page-head-text { gap: 0.338rem; }

.back-btn {
  width: 3.6rem;
  height: 3.6rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 1.8rem;
  background: var(--primary-c);
  color: var(--on-primary-c);
  transition: var(--press);
}
.back-btn:hover { border-radius: 1.125rem; }
.back-btn:active { transform: scale(0.9); }
.back-btn .icon { width: 1.575rem; height: 1.575rem; }

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.787rem;
  line-height: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.page-title {
  margin: 0;
  font-size: clamp(2.475rem, 6.5vw, 4.5rem);
  line-height: 0.95;
  font-weight: 780;
  font-variation-settings: "wdth" 118, "opsz" 144;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.page-title-xl { font-size: clamp(2.7rem, 7vw, 4.95rem); line-height: 0.92; }
.page-title-sm { font-size: clamp(2.025rem, 5vw, 2.7rem); }
.page-desc { margin: 0; color: var(--on-var); font-size: 1.012rem; }
.target {
  align-self: flex-start;
  margin-top: 0.225rem;
  padding: 0.338rem 0.675rem;
  border-radius: 0.563rem;
  background: var(--surface-high);
  font-size: 0.787rem;
  word-break: break-all;
}

/* ---------- stats ---------- */

/* Values scale down with their tile, so a long one like 99.97% still fits. */
.stats { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.stat {
  flex: 1 1 9rem;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 0.338rem;
  padding: 1.35rem 1.463rem;
  border-radius: 1.35rem;
  background: var(--surface);
  transition: border-radius 420ms var(--shape-ease);
}
.stat:first-child { flex: 2 1 13.5rem; border-radius: 2.25rem 2.25rem 2.25rem 0.675rem; background: var(--primary-c); color: var(--on-primary-c); }
.stat:last-child { border-radius: 1.35rem 2.25rem 2.25rem 1.35rem; }
.stat:hover { border-radius: 2.7rem; }
.stat-label { font-size: 0.787rem; font-weight: 600; }
.stat-value {
  font-size: min(2.25rem, 25cqi);
  line-height: 1;
  font-weight: 800;
  font-variation-settings: "wdth" 125, "opsz" 96;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.stat:first-child .stat-value { font-size: min(3.15rem, 25cqi); }
.stat-note { font-size: 0.731rem; opacity: 0.85; }

/* ---------- cards ---------- */

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.575rem 1.8rem;
  border-radius: 2.025rem;
  background: var(--surface);
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.225rem 0.9rem; }
.card-head-start .card-title { flex: none; }
.card-title {
  flex: 1;
  margin: 0;
  white-space: nowrap;
  font-size: 1.463rem;
  line-height: 1.25;
  font-weight: 720;
  font-variation-settings: "wdth" 112;
}
.card-sub { flex-basis: 100%; margin: 0; color: var(--on-var); font-size: 0.844rem; line-height: 1.4; }
.empty { margin: 0; color: var(--on-var); }

.empty-row {
  display: flex;
  align-items: center;
  gap: 0.787rem;
  margin: 0;
  padding: 1.125rem 1.012rem;
  border-radius: 1.35rem;
  background: var(--surface-low);
  color: var(--on-var);
  font-size: 0.844rem;
}
.empty-row .mshape { --size: 1.8rem; }

/* ---------- chart ---------- */

.chart {
  display: grid;
  grid-template-columns: 3.15rem minmax(0, 1fr);
  grid-template-rows: 11.588rem auto;
  gap: 0.45rem;
  margin-top: 0.225rem;
}
.chart-y { position: relative; }
.chart-y span, .chart-x span {
  position: absolute;
  color: var(--on-var);
  font-size: 0.675rem;
  line-height: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chart-y span { right: 0; transform: translateY(-50%); }
.chart-x { grid-column: 2; position: relative; height: 0.9rem; margin: 0 0.338rem; }
.chart-x span { transform: translateX(-50%); }
.chart-x .chart-now { right: 0; transform: none; }

.chart-plot {
  position: relative;
  overflow: hidden;
  border-radius: 1.125rem;
  background: var(--surface-low);
  cursor: crosshair;
  touch-action: pan-y;
}
.chart-grid span { position: absolute; left: 0; right: 0; height: 1px; background: var(--outline-var); opacity: 0.6; transform: translateY(-50%); }
.chart-grid span:first-child { opacity: 1; transform: translateY(-100%); }
.chart-grid span:last-child { transform: none; }

.chart-bars { position: absolute; inset: 0 0.338rem; display: flex; align-items: flex-end; gap: 1px; }
.win {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 999px 999px 0.225rem 0.225rem;
}
.win[data-failed] { background: var(--fail-band); }
.win-bar { width: 100%; min-height: 0.225rem; border-radius: 999px 999px 0.225rem 0.225rem; background: var(--primary); }
.win.active { background: color-mix(in oklch, var(--on) 10%, transparent); }
.win.active[data-failed] { background: color-mix(in oklch, var(--err-shape) 40%, var(--fail-band)); }
.win.active .win-bar { background: var(--on-primary-c); }

.chart-key { display: flex; align-items: center; gap: 0.45rem; margin: 0; color: var(--on-var); font-size: 0.787rem; }

/* ---------- segmented filter ---------- */

.seg-group { display: flex; gap: 0.113rem; }
.seg {
  display: flex;
  align-items: center;
  gap: 0.338rem;
  min-height: 2.475rem;
  padding: 0 0.9rem;
  border-radius: 0.45rem;
  background: var(--primary-c);
  color: var(--on-primary-c);
  font-size: 0.844rem;
  font-weight: 650;
  text-decoration: none;
  transition: var(--press);
}
/* Half the 2.475rem height: 999px would scale the 0.45rem inner corners to nothing. */
.seg:first-child { border-radius: 1.238rem 0.45rem 0.45rem 1.238rem; }
.seg:last-child { border-radius: 0.45rem 1.238rem 1.238rem 0.45rem; }
.seg[aria-current], .seg:has(:checked) { padding-inline: 1.238rem; border-radius: 999px; background: var(--primary); color: var(--on-primary); }
.seg:active { transform: scale(0.95); }
.seg .icon { width: 1.125rem; height: 1.125rem; }

/* ---------- row tables ---------- */

.rows-table { width: 100%; margin: -0.169rem 0; border-collapse: separate; border-spacing: 0 0.169rem; font-size: 0.844rem; line-height: 1.4; }
.rows-table th {
  padding: 0.563rem 1.012rem;
  color: var(--on-var);
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.rows-table td { padding: 0.787rem 1.012rem; background: var(--surface-low); vertical-align: middle; }
.rows-table td:first-child { border-radius: 0.338rem 0 0 0.338rem; }
.rows-table td:last-child { border-radius: 0 0.338rem 0.338rem 0; }
.rows-table tbody tr:last-child td:first-child { border-bottom-left-radius: 1.35rem; }
.rows-table tbody tr:last-child td:last-child { border-bottom-right-radius: 1.35rem; }
.rows-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.msg { width: 100%; color: var(--on-var); font: 0.731rem/1.5 var(--mono); overflow-wrap: anywhere; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.338rem;
  padding: 0.225rem 0.675rem 0.225rem 0.338rem;
  border-radius: 999px;
  background: var(--tone-c);
  color: var(--on-tone-c);
  font-size: 0.731rem;
  line-height: 1.012rem;
  font-weight: 700;
}
.status-pill .icon { width: 1.012rem; height: 1.012rem; }

.pager { display: flex; justify-content: center; gap: 0.45rem; }

.table-scroll { overflow-x: auto; }
.monitors-table { min-width: 49.5rem; font-size: 0.787rem; }
.monitors-table td { padding: 0.9rem 1.012rem; vertical-align: top; }
.link { font-size: 0.9rem; font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }
.cell-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.338rem; margin-top: 0.338rem; color: var(--on-var); font-size: 0.675rem; }
.cell-sub code { font-size: 0.675rem; }
.chip-small { padding: 0.113rem 0.45rem; border-radius: 0.338rem; }
.monitors-table td:first-child { min-width: 10.688rem; }
.target-cell { min-width: 11.25rem; }
.target-cell code { font-size: 0.731rem; line-height: 1.5; word-break: break-all; }
.opts { display: flex; flex-wrap: wrap; gap: 0.225rem; min-width: 10.125rem; }
.opt { padding: 0.169rem 0.563rem; border-radius: 999px; background: var(--surface-high); font: 0.675rem/0.9rem var(--mono); overflow-wrap: anywhere; }
.opt-key { color: var(--on-var); }

/* ---------- day table ---------- */

.table-view summary {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 1.125rem;
  color: var(--primary);
  font-size: 0.844rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: var(--press);
}
.table-view summary::-webkit-details-marker { display: none; }
.table-view summary::before { content: "▸"; margin-right: 0.45rem; transition: transform 400ms var(--spring); }
.table-view[open] summary::before { transform: rotate(90deg); }
.table-view summary:hover { background: var(--surface-high); }
.table-view summary:active { border-radius: 0.675rem; }
.table-wrap { max-height: 23.625rem; overflow: auto; margin-top: 0.45rem; }
.data { width: 100%; border-collapse: collapse; font-size: 0.787rem; line-height: 1.125rem; }
.data th {
  position: sticky;
  top: 0;
  padding: 0.45rem 0.675rem;
  background: var(--surface);
  color: var(--on-var);
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}
.data td { padding: 0.563rem 0.675rem; border-top: 1px solid var(--outline-var); vertical-align: top; }
.data .swatch { margin-right: 0.45rem; }

/* ---------- settings ---------- */

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.813rem, 1fr)); gap: 0.338rem; margin: 0; }
.kv-wide { grid-template-columns: repeat(auto-fill, minmax(12.375rem, 1fr)); }
.kv > div { display: flex; flex-direction: column; gap: 0.338rem; min-width: 0; padding: 0.787rem 0.9rem; border-radius: 1.012rem; background: var(--surface-low); }
.kv dt { color: var(--on-var); font: 0.675rem/0.9rem var(--mono); }
.kv dd { margin: 0; font: 500 0.844rem/1.4 var(--mono); overflow-wrap: anywhere; }

.json {
  margin: 0;
  max-height: 23.625rem;
  overflow: auto;
  padding: 1.35rem 1.575rem;
  border-radius: 1.8rem;
  background: var(--surface-high);
  font: 0.731rem/1.6 var(--mono);
}

/* ---------- health components ---------- */

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.169rem; border-radius: 1.575rem; overflow: hidden; }
.row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.012rem 1.238rem;
  border-radius: 0.338rem;
  background: var(--surface-low);
  transition: border-radius 420ms var(--shape-ease);
}
.row:hover { border-radius: 1.575rem; }
.row .item-name { font-size: 1.069rem; }
.row .mshape .icon { width: 1.012rem; height: 1.012rem; }
.state-pill {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--tone-c);
  color: var(--on-tone-c);
  font-size: 0.787rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- authentication ---------- */

.auth-pop {
  width: min(23.625rem, calc(100% - 1.8rem));
  padding: 1.575rem 1.8rem;
  border: 0;
  border-radius: 2.025rem;
  background: var(--surface-high);
  color: var(--on);
  box-shadow: 0 0.45rem 1.575rem var(--shadow);
}
.auth-pop::backdrop { background: oklch(0 0 0 / 0.32); }
.auth-card { width: 100%; max-width: 29.25rem; margin: 1.35rem auto 0; }

.auth-form { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; margin-top: 0.45rem; }
.field { display: flex; flex-direction: column; gap: 0.338rem; align-self: stretch; }
.field-label { color: var(--on-var); font-size: 0.731rem; font-weight: 600; }
.field-input {
  height: 3.15rem;
  padding: 0 1.012rem;
  border: 1px solid var(--outline);
  border-radius: 0.9rem;
  background: var(--surface-low);
  color: var(--on);
  font: 0.9rem var(--mono);
  transition: border-radius 320ms var(--shape-ease);
}
.field-input:hover { border-color: var(--on); }
.field-input:focus { outline: none; border-color: var(--ring, var(--primary)); box-shadow: inset 0 0 0 1px var(--ring, var(--primary)); border-radius: 0.675rem; }
.field-input[aria-invalid="true"] { border-color: var(--err); --ring: var(--err); }
.field-error { margin: -0.45rem 0 0; color: var(--err); font-size: 0.787rem; line-height: 1.125rem; }

/* ---------- small screens ---------- */

@media (max-width: 33.6875em) {
  .page { padding: 0.9rem 0.9rem 1.8rem; gap: 1.125rem; }

  /* Navigation wraps onto its own line below the brand and theme. */
  .theme { order: 1; }
  .nav { order: 2; }
  .brand-name { font-size: 1.238rem; }
  .nav-item { padding-inline: 0.787rem; }
  .nav-item[aria-current] { padding-inline: 1.125rem; }
  .nav-item[aria-current] + .nav-item { padding-inline-start: 0.45rem; }
  .nav-item:has(+ .nav-item[aria-current]) { padding-inline-end: 0.45rem; }

  .hero { gap: 1.125rem; padding: 1.575rem 1.35rem; border-radius: 2.25rem 2.25rem 2.25rem 0.9rem; }
  .hero-shape { --size: 6.3rem; }
  .hero-text { flex-basis: 100%; }
  .hero-title { font-size: clamp(2.025rem, 11vw, 2.925rem); }
  .count { padding: 0.45rem 0.9rem; }
  .count-n { font-size: 1.35rem; }
  .hero-sub { padding: 1.35rem; border-radius: 2.25rem 0.9rem 2.25rem 2.25rem; }
  .hero-health { border-radius: 0.9rem 2.25rem 2.25rem 2.25rem; }
  .hero-sub .hero-shape { --size: 4.95rem; }
  .hero-sub .hero-title { font-size: clamp(2.025rem, 11vw, 2.475rem); }
  .hero-detail { font-size: 0.9rem; }

  .refresh { flex: 1 1 100%; flex-direction: row; gap: 0.787rem; padding: 0.225rem 0.675rem; }
  .refresh-box { flex: none; width: auto; overflow: visible; }
  .refresh-text { position: static; writing-mode: horizontal-tb; font-size: 1.913rem; }

  .status-page { gap: 1.8rem; }
  .group-title { font-size: 1.463rem; }
  .list { border-radius: 1.575rem; }
  .item { padding: 0.9rem 1.012rem; }
  .item-head { gap: 0.675rem; padding-right: 2.025rem; }
  .item-head .chip, .item-head > .icon { display: none; }
  .item-name { font-size: 1.012rem; }
  .item-link:hover, .item-link:focus-within { border-radius: 1.35rem; }

  .back-btn { width: 2.925rem; height: 2.925rem; }
  .page-head { gap: 0.787rem; }
  .page-title { font-size: clamp(1.913rem, 10vw, 2.475rem); }
  .page-title-xl { font-size: clamp(2.25rem, 12vw, 2.7rem); }
  .page-desc { font-size: 0.9rem; }

  .stat { flex-basis: 7.875rem; padding: 1.012rem 1.125rem; }
  .stat:first-child { flex-basis: 100%; }

  .card { padding: 1.238rem 1.012rem; border-radius: 1.575rem; }
  .card-title { font-size: 1.238rem; }

  .chart { grid-template-columns: 2.475rem minmax(0, 1fr); }
  .chart-plot { border-radius: 0.787rem; }
  .chart-bars { inset: 0 0.169rem; gap: 0; }

  /* Log rows stack instead of scrolling sideways. */
  .log, .log tbody { display: block; margin: 0; }
  .log thead { display: none; }
  .log tr {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 0.45rem 0.675rem;
    margin-bottom: 0.169rem;
    padding: 0.675rem 0.787rem;
    border-radius: 0.338rem;
    background: var(--surface-low);
  }
  .log tr:last-child { margin-bottom: 0; border-radius: 0.338rem 0.338rem 1.125rem 1.125rem; }
  .log td { display: block; padding: 0; background: none; }
  .log td.msg { grid-column: 1 / -1; width: auto; }

  .row { flex-wrap: wrap; gap: 0.675rem 0.9rem; }
  .row .state-pill { margin-left: 3.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .bar, .swatch, .mshape .shape path, .win, .win-bar, .theme-color { forced-color-adjust: none; }
  .seg[aria-current], .seg:has(:checked) { forced-color-adjust: none; background: SelectedItem; color: SelectedItemText; }
}
