/* Guardian. One stylesheet, no webfont, no framework. */

:root {
  /* Brand: the Guardian logo's navy and gold. */
  --navy: #0b2a58;
  --gold: #f2b419;

  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --ink: #10213d;
  --quiet: #4a5a74;
  --muted: #687790;
  --line: #dde3ec;
  --grid: #e9edf3;
  --track: #e3e8f0;
  --fill: #5c6b85;
  --accent: #1d4f91;
  --side: #0b2a58;
  --side-ink: #eef2fa;
  --side-quiet: #a9b8d3;
  --side-hover: #14366b;
  --side-current: #1d427d;

  --ok-fg: #0b5a52;
  --ok-tint: #e2f1ed;
  --ok-dot: #12806f;
  --watch-fg: #7c4508;
  --watch-tint: #fcf0dc;
  --watch-dot: #c27414;
  --bad-fg: #8a1f30;
  --bad-tint: #fbe5e8;
  --bad-dot: #c8384d;
  --wait-fg: #4b6168;
  --wait-tint: #eaf0f1;
  --wait-dot: #81979d;

  /* Chart colors. Validated with the dataviz checker against white and
     against the dark card surface. A server keeps its color everywhere. */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #4a3aa7;
  --k-web: #4a3aa7;
  --k-wp: #1baf7a;
  --k-pro: #eda100;

  --display: "Avenir Next", Avenir, "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --sans: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --pad: clamp(1rem, 3vw, 2.25rem);
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1424;
    --surface: #111d33;
    --surface-2: #15233c;
    --ink: #e6ecf6;
    --quiet: #9daac2;
    --muted: #7f8ca6;
    --line: #22314d;
    --grid: #1a2742;
    --track: #1f2e4a;
    --fill: #8290aa;
    --accent: #8fb4ef;
    --side: #08152b;
    --side-hover: #102345;
    --side-current: #173057;

    --ok-fg: #86dccb;
    --ok-tint: #12332e;
    --ok-dot: #3fbfa6;
    --watch-fg: #f3c27e;
    --watch-tint: #37280f;
    --watch-dot: #e09a3a;
    --bad-fg: #f5a3ae;
    --bad-tint: #3c1a20;
    --bad-dot: #e5566b;
    --wait-fg: #9ab0b5;
    --wait-tint: #1b3035;
    --wait-dot: #6e878d;

    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #9085e9;
    --k-web: #9085e9;
    --k-wp: #199e70;
    --k-pro: #c98500;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

p { margin: 0; }
h1, h2, h3, h4 { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.18em; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted { color: var(--quiet); }

/* Focus and skip link */

.skip {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  transform: translateY(-200%);
  background: var(--surface);
  color: var(--ink);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  z-index: 50;
}

.skip:focus { transform: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
.skip:focus {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.side a:focus-visible, .side button:focus-visible { outline-color: var(--side-ink); }

main:focus { outline: none; }

/* State colors. Every place that uses them also shows the word. */

.is-steady { --fg: var(--ok-fg); --tint: var(--ok-tint); --dot: var(--ok-dot); }
.is-watch { --fg: var(--watch-fg); --tint: var(--watch-tint); --dot: var(--watch-dot); }
.is-trouble, .is-silent { --fg: var(--bad-fg); --tint: var(--bad-tint); --dot: var(--bad-dot); }
.is-waiting { --fg: var(--wait-fg); --tint: var(--wait-tint); --dot: var(--wait-dot); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.7rem 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--tint, var(--wait-tint));
  color: var(--fg, var(--quiet));
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.pill::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--dot, var(--wait-dot));
  transition: background-color 180ms linear;
}

.pill-small { font-size: 0.8125rem; padding: 0.1rem 0.55rem 0.1rem 0.45rem; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.brand img, .auth-brand img { display: block; height: auto; }
.brand-mark { width: 2.1rem; }
.brand-word { width: 7rem; }

/* App shell */

.shell {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.4rem 1rem 1rem;
  background: var(--side);
  color: var(--side-ink);
  overflow-y: auto;
}

.side .brand { padding: 0 0.5rem; }

.brand-sub { padding: 0.35rem 0.5rem 0 3.2rem; color: var(--side-quiet); font-size: 0.8125rem; }

.side-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); }

.side-nav { margin-top: 1.75rem; }

.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  color: var(--side-quiet);
  font-weight: 500;
  text-decoration: none;
}

.side-nav a:hover { background: var(--side-hover); color: var(--side-ink); }

.side-nav a[aria-current="page"] {
  background: var(--side-current);
  color: var(--side-ink);
  font-weight: 600;
}

.icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-status {
  margin-top: auto;
  padding: 0.85rem 0.75rem;
  border-radius: 12px;
  background: var(--side-hover);
  display: grid;
  gap: 0.45rem;
  justify-items: start;
}

.side-updated { color: var(--side-quiet); font-size: 0.8125rem; }

.account {
  margin-top: 0.75rem;
  padding: 0.85rem 0.25rem 0;
  border-top: 1px solid var(--side-current);
  display: grid;
  gap: 0.7rem;
}

.who { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
}

.side .avatar, .avatar { background: var(--gold); color: var(--navy); }

.who-text { display: grid; min-width: 0; }

.who-email {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who-role { font-size: 0.8125rem; color: var(--side-quiet); }

.side .out button {
  width: 100%;
  background: transparent;
  color: var(--side-ink);
  border-color: var(--side-current);
}

.side .out button:hover { background: var(--side-hover); }

.main-col { min-width: 0; display: flex; flex-direction: column; }

.mobile-bar, .tabbar { display: none; }

/* Page header */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 2rem var(--pad) 1.25rem;
  max-width: 84rem;
  width: 100%;
}

.page-head h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ph-intro { margin-top: 0.35rem; color: var(--quiet); max-width: 40rem; }

.periods {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.periods a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 9px;
  color: var(--quiet);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.periods a:hover { color: var(--ink); }

.periods a[aria-current="page"] { background: var(--ink); color: var(--surface); font-weight: 600; }

main {
  display: grid;
  gap: 1.25rem;
  align-content: start;
  padding: 0 var(--pad) 2rem;
  max-width: 84rem;
  width: 100%;
}

.page-foot {
  margin-top: auto;
  padding: 1rem var(--pad) 2rem;
  max-width: 84rem;
  color: var(--muted);
  font-size: 0.875rem;
  display: grid;
  gap: 0.35rem;
}

/* Surfaces */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.4rem;
  min-width: 0;
}

.card h2, .section-title {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-head a { font-size: 0.9375rem; font-weight: 500; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

/* Hero */

.hero {
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2.25rem);
  background: var(--tint);
  border-radius: calc(var(--radius) + 4px);
}

.hero-pill { background: var(--surface); font-size: 0.9375rem; padding: 0.3rem 0.85rem 0.3rem 0.7rem; }

.hero-lead {
  margin-top: 0.85rem;
  max-width: 48rem;
  font-family: var(--display);
  font-size: clamp(1.3rem, 1rem + 1.3vw, 1.9rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.hero-lead-small { font-family: var(--sans); font-size: 1.0625rem; font-weight: 500; letter-spacing: 0; line-height: 1.5; }

/* Tiles */

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.tile-label { color: var(--quiet); font-size: 0.9375rem; font-weight: 600; }

.tile-value {
  font-size: clamp(2rem, 1.6rem + 1.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.tile .pill { align-self: flex-start; }

.tile-note { margin-top: auto; padding-top: 0.35rem; color: var(--quiet); font-size: 0.875rem; line-height: 1.4; }

.spark { display: block; width: 100%; height: 2rem; margin-top: 0.25rem; }
.spark-bar { fill: var(--track); }
.spark-now { fill: var(--s1); }

/* Server cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.sc-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
}

.sc-head h3, .sc-head h2 {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.sc-plain { margin-top: 0.6rem; font-size: 1.0625rem; }

.meters { margin: 1.1rem 0 0; display: grid; gap: 0.75rem; }

.meter { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; gap: 0.75rem; }

.meter dt { color: var(--quiet); font-size: 0.9375rem; }

.meter dd { margin: 0; display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); align-items: center; gap: 0.6rem; }

.meter-value { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }

.meter-bar { display: block; width: 100%; height: 0.55rem; border-radius: 4px; overflow: hidden; }
.meter-track { fill: var(--track); }
.meter-fill { fill: var(--fill); }
.meter.is-watch .meter-fill { fill: var(--watch-dot); }
.meter.is-trouble .meter-fill { fill: var(--bad-dot); }

.sc-more { margin-top: 1rem; font-size: 0.9375rem; font-weight: 500; }

/* Charts */

.chart { margin: 0; min-width: 0; }

.chart + .chart { margin-top: 1.75rem; }

.chart-title { font-size: 1.0625rem; font-weight: 650; margin-bottom: 0.75rem; }

.chart-empty {
  padding: 2rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--quiet);
  text-align: center;
  font-size: 0.9375rem;
}

.chart-legend {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  color: var(--quiet);
  font-size: 0.875rem;
}

.chart-legend li, .split-legend li { display: inline-flex; align-items: center; gap: 0.45rem; }

.key { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; background: var(--fill); }
.key-line { height: 3px; width: 1rem; border-radius: 2px; }
.key-limit { height: 0; width: 1rem; border-radius: 0; background: none; border-top: 2px dashed var(--ink); }

.key.s-1 { background: var(--s1); }
.key.s-2 { background: var(--s2); }
.key.s-3 { background: var(--s3); }
.key.s-4 { background: var(--s4); }
.key.k-web { background: var(--k-web); }
.key.k-wp { background: var(--k-wp); }
.key.k-pro { background: var(--k-pro); }

.plot { position: relative; height: 13rem; margin-left: 3.25rem; }
.plot-line { height: 9rem; }

.plot-svg { display: block; width: 100%; height: 100%; overflow: visible; }

.y-axis { position: absolute; inset: 0 auto 0 -3.25rem; width: 2.75rem; }

.y-axis span {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.y-axis .y0 { bottom: 0; }
.y-axis .y1 { bottom: 25%; }
.y-axis .y2 { bottom: 50%; }
.y-axis .y3 { bottom: 75%; }
.y-axis .y4 { bottom: 100%; }

.grid { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; shape-rendering: crispEdges; }
.baseline { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; shape-rendering: crispEdges; }

.hit { fill: transparent; }
.col:hover .hit { fill: var(--grid); }
.col:hover .mark { opacity: 0.85; }

.mark { fill: var(--fill); }
.mark.s-1, .line.s-1 { fill: var(--s1); stroke: var(--s1); }
.mark.s-2, .line.s-2 { fill: var(--s2); stroke: var(--s2); }
.mark.s-3, .line.s-3 { fill: var(--s3); stroke: var(--s3); }
.mark.s-4, .line.s-4 { fill: var(--s4); stroke: var(--s4); }
.mark.k-web { fill: var(--k-web); }
.mark.k-wp { fill: var(--k-wp); }
.mark.k-pro { fill: var(--k-pro); }

.line { fill: none !important; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.area { stroke: none; opacity: 0.12; }
.area.s-1 { fill: var(--s1); }
.area.s-2 { fill: var(--s2); }
.area.s-3 { fill: var(--s3); }
.area.s-4 { fill: var(--s4); }
.limit { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }

.x-axis {
  display: flex;
  margin: 0.45rem 0 0 3.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.x-axis span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; }
.x-axis .x-hide { visibility: hidden; }
.x-axis-ends { justify-content: space-between; }
.x-axis-ends span { flex: none; }

.numbers { margin-top: 0.85rem; font-size: 0.875rem; }

.numbers summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--quiet);
  font-weight: 500;
  cursor: pointer;
}

.numbers summary:hover { color: var(--ink); }

.numbers table { margin-top: 0.5rem; }

/* Horizontal bars */

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }

.hbars li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1rem;
  align-items: baseline;
}

.hb-label { min-width: 0; overflow-wrap: anywhere; }
.hb-note { margin-left: 0.5rem; color: var(--muted); font-size: 0.8125rem; }
.hb-value { font-weight: 650; font-variant-numeric: tabular-nums; }

.hb { grid-column: 1 / -1; display: block; width: 100%; height: 0.6rem; border-radius: 4px; overflow: hidden; }
.hb-track { fill: var(--track); }

/* Split bar */

.split-svg { display: block; width: 100%; height: 1.4rem; border-radius: 6px; overflow: hidden; }

.split-legend { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.split-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 3rem; gap: 0.6rem; }
.sl-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.sl-pct { color: var(--quiet); text-align: right; font-variant-numeric: tabular-nums; }

.chart-foot { margin-top: 0.85rem; font-size: 0.875rem; }

/* Tables */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }

th, td { padding: 0.6rem 0.75rem 0.6rem 0; border-top: 1px solid var(--line); text-align: left; vertical-align: baseline; }

thead th { border-top: 0; padding-top: 0; color: var(--quiet); font-size: 0.8125rem; font-weight: 500; }

.numbers td, .numbers thead th + th, td.n, .journals thead th:nth-child(n+3) { text-align: right; }

tbody th { font-weight: 400; }

.data .path { overflow-wrap: anywhere; font-size: 0.875rem; }

.j-name { display: block; font-weight: 600; }
.j-site { display: block; color: var(--quiet); font-size: 0.8125rem; overflow-wrap: anywhere; }
.unread td { color: var(--quiet); }

.big-note { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; }
.big-num { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }

/* Timeline */

.log { list-style: none; margin: 0; padding: 0; }

.log li {
  position: relative;
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.15rem 1rem;
  padding: 0 0 1rem 1.5rem;
}

.log li:last-child { padding-bottom: 0; }

.log li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--dot, var(--fill));
}

.log li::after {
  content: "";
  position: absolute;
  left: calc(0.475rem - 0.5px);
  top: 1.25rem;
  bottom: 0.1rem;
  width: 1px;
  background: var(--line);
}

.log li:last-child::after { display: none; }
.log li.empty { display: block; padding-left: 0; color: var(--quiet); }
.log li.empty::before { display: none; }
.log time { color: var(--quiet); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.9375rem; }

/* Servers page */

.machine { scroll-margin-top: 5rem; }

.machine .reasons {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--tint);
  border-radius: 10px;
  color: var(--fg);
  font-weight: 600;
}

.machine.is-steady .reasons { display: none; }

.report { margin-top: 0.6rem; font-size: 0.875rem; }

.machine-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  margin-top: 1.25rem;
}

.machine h3 { margin: 0 0 0.6rem; font-size: 0.9375rem; font-weight: 650; color: var(--quiet); }
.machine h3 ~ h3 { margin-top: 1.5rem; }
.h-sub { font-weight: 500; }

.facts { margin: 0; }

.fact {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  gap: 0 1rem;
  align-items: start;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.fact:last-child { border-bottom: 1px solid var(--line); }
.fact dt { color: var(--quiet); }
.fact dd { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 0.35rem 1rem; }
.fact.has-gauge dd { grid-template-columns: minmax(0, 1fr) minmax(6rem, 9rem); }
.fact-value { font-variant-numeric: tabular-nums; }
.fact .pill-small { justify-self: start; grid-column: 1; }

.gauge { grid-column: 2; grid-row: 1 / span 2; display: block; width: 100%; height: 0.85rem; overflow: visible; }
.gauge-track { fill: var(--track); }
.gauge-fill { fill: var(--fill); }
.fact.is-watch .gauge-fill { fill: var(--watch-dot); }
.fact.is-trouble .gauge-fill { fill: var(--bad-dot); }
.gauge-line, .gauge-gap { vector-effect: non-scaling-stroke; shape-rendering: crispEdges; }
.gauge-line { stroke: var(--ink); stroke-width: 1.5; }
.gauge-line-hard { stroke-width: 3; }
.gauge-gap { stroke: var(--surface); stroke-width: 5; }
.gauge-gap-hard { stroke-width: 7; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.6rem; color: var(--quiet); font-size: 0.8125rem; }
.legend-mark { display: inline-block; width: 2px; height: 0.85rem; margin-left: 0.6rem; background: var(--ink); }
.legend-mark:first-child { margin-left: 0; }
.legend-mark-hard { width: 4px; }

.mini {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.mini li { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.8rem; background: var(--surface-2); min-width: 0; }
.mini-num { font-size: 1.3rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.mini-label { color: var(--quiet); font-size: 0.8125rem; line-height: 1.3; }

.notes { margin: 0.9rem 0 0; padding-left: 1.1rem; }
.notes li { margin: 0.3rem 0; }
.notes li::marker { color: var(--fill); }

/* Buttons and forms */

button {
  font: inherit;
  font-weight: 600;
  color: var(--surface);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 10px;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

/* Sign in */

.bar {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}

.bar-in { max-width: 76rem; margin: 0 auto; padding: 0.9rem var(--pad); }

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.5rem;
  padding: 2.5rem var(--pad);
  max-width: none;
}

.auth-brand { display: grid; justify-items: center; gap: 0.75rem; text-align: center; }
.auth-mark { width: 5.5rem; }
.auth-word { width: 10rem; }
.auth-sub { color: var(--quiet); font-size: 0.9375rem; }

.auth-card { width: min(100%, 28rem); padding: clamp(1.5rem, 5vw, 2.25rem); }

.auth-card h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.lede { margin-top: 0.75rem; color: var(--quiet); }
.signin { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.5rem; }
label { font-weight: 600; }

input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: max(1rem, 16px);
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--fill);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  min-height: 50px;
}

input[aria-invalid="true"] { border-color: var(--bad-dot); }
.signin button { margin-top: 0.5rem; min-height: 50px; }
.after { margin-top: 1.25rem; }
.problem { padding: 0.6rem 0.85rem; border-radius: 10px; background: var(--bad-tint); color: var(--bad-fg); font-weight: 600; }

/* Medium screens */

@media (max-width: 80rem) {
  .machine-grid { grid-template-columns: 1fr; }
}

@media (max-width: 64rem) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Phones and small tablets: the sidebar becomes a top bar and a tab bar */

@media (max-width: 60rem) {
  html { scroll-padding-top: 4.5rem; }
  .shell { display: block; }
  .side { display: none; }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem var(--pad);
    padding-top: max(0.6rem, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
  }

  .mobile-bar .brand { margin-right: auto; }
  .mobile-bar .brand-mark { width: 1.85rem; }
  .mobile-bar .brand-word { width: 6.1rem; }

  .me { position: relative; }
  .me summary { list-style: none; display: grid; place-items: center; min-width: 44px; min-height: 44px; cursor: pointer; }
  .me summary::-webkit-details-marker { display: none; }

  .me-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    width: min(18rem, calc(100vw - 2rem));
    padding: 1rem;
    display: grid;
    gap: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(10, 30, 35, 0.18);
  }

  .me-menu .who-role { color: var(--quiet); }
  .me-menu .out { margin-top: 0.75rem; }
  .me-menu button { width: 100%; }

  .page-head { padding-top: 1.25rem; }
  .periods { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .periods a { min-height: 44px; padding: 0 0.5rem; }

  main { padding-bottom: 1rem; }
  .page-foot { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }

  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 0.35rem 0.25rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--line);
  }

  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 0.15rem;
    min-height: 52px;
    padding: 0.35rem 0.1rem;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
  }

  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 650; }
  .tabbar a[aria-current="page"] .icon { stroke: var(--accent); stroke-width: 2.2; }
}

@media (max-width: 34rem) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .tile { padding: 0.9rem 1rem 1rem; }
  .tile-value { font-size: 1.85rem; }
  .tile-note { font-size: 0.8125rem; }
  .card { padding: 1rem 1rem 1.15rem; }
  .plot { height: 11rem; margin-left: 2.75rem; }
  .plot-line { height: 8rem; }
  .y-axis { left: -2.75rem; width: 2.35rem; }
  .x-axis { margin-left: 2.75rem; }
  .x-axis span:nth-child(even):not(:last-child) { visibility: hidden; }
  .x-axis span:nth-last-child(2) { visibility: hidden; }
  .meter { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .fact { grid-template-columns: 5rem minmax(0, 1fr); gap: 0 0.75rem; }
  .fact.has-gauge dd { grid-template-columns: 1fr; }
  .gauge { grid-column: 1; grid-row: auto; }
  .mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log li { grid-template-columns: 1fr; }
  .split-legend li { grid-template-columns: auto minmax(0, 1fr) auto 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pill::before { transition: none; }
}

@media print {
  .side, .tabbar, .mobile-bar, .periods, .skip, .numbers summary { display: none; }
  .shell { display: block; }
  body { background: #fff; }
  .card, .tile { break-inside: avoid; }
}
