/* Vaka, keeps watch while you sleep.
   The look follows the Webready open source design kit: its tokens are
   copied below (the kit version is in their header), then Vaka's accent.
   No inline styles anywhere: strict CSP. */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Webready open source design kit: tokens.
 *
 * Copy this file into a tool's stylesheet. Then add the tool's accent block
 * from docs/colour.md (--accent, --accent-tile, --accent-soft) for light and
 * dark. Everything here is the same in every tool.
 *
 * Dark mode follows the system, and a data-theme="light" or "dark" attribute
 * on <html> overrides it.
 *
 * Kit version 0.6.0 (see CHANGELOG.md). Keep this line in your copy and
 * update it when you copy again.
 */

:root {
  /* Type: Figtree for everything, see docs/type.md for the @font-face */
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Neutrals: Tailwind slate */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #1e293b;
  --text-2: #475569;
  --text-3: #64748b;

  /* Meanings: never colour alone, always with an icon and a word (docs/colour.md) */
  --up: #047857;
  --up-soft: #ecfdf5;
  --down: #b91c1c;
  --down-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --new: #1d4ed8;
  --new-soft: #eff6ff;
  --quiet: #4338ca;
  --quiet-soft: #eef2ff;
  --neutral: #475569;
  --neutral-soft: #f1f5f9;
  --none: #cbd5e1;

  /* --none is the fill for "no data": empty bars, meters with nothing yet */

  /* Bars and chart marks coloured by meaning (docs/charts.md) */
  --up-bar: #10b981;
  --up-bar-soft: #6ee7b7;
  --warn-bar: #f59e0b;
  --down-bar: #ef4444;
  --running-bar: #64748b;

  /* Night: a dark surface that stays dark in both themes (Vaka's watch panel) */
  --night: #0f172a;
  --night-2: #1e293b;
  --night-text: #f1f5f9;
  --night-muted: #94a3b8;

  /* Shape */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 30px -18px rgb(15 23 42 / 0.25);
  --focus: var(--accent);
  /* Text on a filled --accent (a primary button): white here, dark slate in dark mode where every accent is light */
  --on-accent: #ffffff;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #172135;
  --line: #334155;
  --line-strong: #475569;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;

  --up: #34d399;
  --up-soft: rgb(52 211 153 / 0.12);
  --down: #f87171;
  --down-soft: rgb(248 113 113 / 0.12);
  --warn: #fbbf24;
  --warn-soft: rgb(251 191 36 / 0.12);
  --new: #93c5fd;
  --new-soft: rgb(147 197 253 / 0.12);
  --quiet: #a5b4fc;
  --quiet-soft: rgb(165 180 252 / 0.12);
  --neutral: #cbd5e1;
  --neutral-soft: rgb(148 163 184 / 0.12);
  --none: #475569;

  --running-bar: #94a3b8;
  --on-accent: #0f172a;
  --shadow: none;

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #172135;
    --line: #334155;
    --line-strong: #475569;
    --text: #f1f5f9;
    --text-2: #cbd5e1;
    --text-3: #94a3b8;

    --up: #34d399;
    --up-soft: rgb(52 211 153 / 0.12);
    --down: #f87171;
    --down-soft: rgb(248 113 113 / 0.12);
    --warn: #fbbf24;
    --warn-soft: rgb(251 191 36 / 0.12);
    --new: #93c5fd;
    --new-soft: rgb(147 197 253 / 0.12);
    --quiet: #a5b4fc;
    --quiet-soft: rgb(165 180 252 / 0.12);
    --neutral: #cbd5e1;
    --neutral-soft: rgb(148 163 184 / 0.12);
    --none: #475569;

    --running-bar: #94a3b8;
    --on-accent: #0f172a;
    --shadow: none;

    color-scheme: dark;
  }
}

/* Vaka's accent (design kit docs/colour.md): the teal owl on its deep teal tile */
:root { --accent: #0e7490; --accent-tile: #0e7490; --accent-soft: #ecfeff; }
:root[data-theme="dark"] { --accent: #22d3ee; --accent-soft: rgb(34 211 238 / 0.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #22d3ee; --accent-soft: rgb(34 211 238 / 0.12); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  font-feature-settings: "ss01" off;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
/* Browsers indent a figure by 40px on each side */
figure { margin: 0; }
code, kbd { font-family: var(--mono); font-size: 0.86em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 20; padding: 8px 14px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

/* Icons: 24 px grid, stroke 2, round caps and joins, currentColor */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===================================================================
   The mark: the design kit's owl on its deep teal tile (public/marks/)
   =================================================================== */

.mark { flex: none; display: block; }

/* ===================================================================
   Login: always night, the brand's first impression
   =================================================================== */

body.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  color: var(--night-text);
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, rgb(255 255 255 / 0.7), transparent 60%),
    radial-gradient(1px 1px at 28% 72%, rgb(255 255 255 / 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 74% 22%, rgb(255 255 255 / 0.6), transparent 60%),
    radial-gradient(1px 1px at 86% 64%, rgb(255 255 255 / 0.45), transparent 60%),
    radial-gradient(1px 1px at 52% 12%, rgb(255 255 255 / 0.5), transparent 60%),
    radial-gradient(1px 1px at 63% 86%, rgb(255 255 255 / 0.35), transparent 60%),
    radial-gradient(2px 2px at 18% 42%, rgb(255 255 255 / 0.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 91% 38%, rgb(255 255 255 / 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 90%, rgb(255 255 255 / 0.4), transparent 60%),
    radial-gradient(2px 2px at 80% 9%, rgb(255 255 255 / 0.5), transparent 60%),
    radial-gradient(90% 60% at 50% 0%, rgb(25 172 202 / 0.22), transparent 70%),
    linear-gradient(180deg, #0b1222 0%, #0f172a 55%, #131f36 100%);
}
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .mark { width: 72px; height: 72px; margin: 0 auto; filter: drop-shadow(0 12px 28px rgb(25 172 202 / 0.35)); }
.login-card h1 { margin: 18px 0 2px; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.login-tagline { margin: 0 0 28px; color: var(--night-muted); font-size: 16px; }
.login-card form { text-align: left; padding: 24px; background: rgb(30 41 59 / 0.72); border: 1px solid #334155; border-radius: 18px; backdrop-filter: blur(6px); }
.login-card label { display: block; margin: 0 0 6px; font-weight: 600; font-size: 14px; color: #cbd5e1; }
.login-card label + input { margin-bottom: 16px; }
.login-card input { width: 100%; padding: 11px 13px; font: inherit; color: #f1f5f9; background: #0f172a; border: 1px solid #334155; border-radius: 11px; }
.login-card input:focus { border-color: #22d3ee; outline: none; box-shadow: 0 0 0 3px rgb(34 211 238 / 0.25); }
.login-card button { width: 100%; margin-top: 6px; padding: 12px; font-weight: 700; font-size: 15px; color: #06222b; background: #22d3ee; border: 0; border-radius: 11px; cursor: pointer; }
.login-card button:hover { background: #67e8f9; }
.login-error { margin: 0 0 16px; padding: 11px 13px; color: #fecaca; background: rgb(220 38 38 / 0.18); border: 1px solid rgb(248 113 113 / 0.35); border-radius: 11px; text-align: left; }
.login-foot { margin: 20px 0 0; color: #64748b; font-size: 13px; }
.login-foot .credit { justify-content: center; }
.login-foot a:hover, .login-foot a:focus-visible { color: #cbd5e1; }
.login-steps { text-align: left; padding: 24px; background: rgb(30 41 59 / 0.72); border: 1px solid #334155; border-radius: 18px; backdrop-filter: blur(6px); color: #cbd5e1; }
.login-steps h2 { margin: 0 0 8px; font-size: 18px; color: #f1f5f9; }
.login-steps p { margin: 12px 0 0; font-size: 14.5px; }
.login-steps code { padding: 2px 7px; border-radius: 6px; background: #0f172a; color: #67e8f9; overflow-wrap: anywhere; }
.login-steps > code { display: block; margin-top: 8px; padding: 10px 12px; }

/* ===================================================================
   Top bar
   =================================================================== */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 10px max(16px, calc((100vw - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand .mark { width: 34px; height: 34px; }
.brand-name { font-weight: 800; font-size: 24px; letter-spacing: -0.03em; }
.run-pill { display: inline-flex; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.run-pill.is-ok .run-dot { background: var(--up); box-shadow: 0 0 0 0 rgb(5 150 105 / 0.5); animation: pulse 2.4s ease-out infinite; }
.run-pill.is-stale { background: var(--down-soft); color: var(--down); }
.run-pill.is-stale .run-dot { background: var(--down); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(5 150 105 / 0.45); } 70% { box-shadow: 0 0 0 7px rgb(5 150 105 / 0); } 100% { box-shadow: 0 0 0 0 rgb(5 150 105 / 0); } }
.topbar-spacer { flex: 1; }
.icon-button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.topbar form { margin: 0; }
/* A shared page: what the link shows and until when, where signing out is */
.shared-note { display: inline-flex; align-items: center; gap: 7px; min-width: 0; margin: 0; padding: 0 4px; color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ===================================================================
   Page
   =================================================================== */

main { max-width: 1120px; margin: 0 auto; padding: 28px 16px 48px; }

/* The family footer (design kit docs/layout.md): Vaka's own half, then the credit */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; max-width: 1120px; margin: 0 auto; padding: 18px 16px 32px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.credit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.credit a { color: inherit; text-decoration: none; }
.credit a:hover, .credit a:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.credit-marks { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; }
.credit-mark { display: block; width: 16px; height: 16px; }
.section-title { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); }
/* While the overview loads: bars where the words and numbers will be, breathing slowly */
.placeholder { display: block; height: 12px; border-radius: 6px; background: var(--line); animation: placeholder 1.6s ease-in-out infinite; }
.placeholder.is-night { background: rgb(148 163 184 / 0.24); }
.watch-line .placeholder.is-wide { width: min(420px, 80%); height: 14px; margin: 7px 0 4px; }
.watch-stats .placeholder.is-stat { width: 64px; height: 24px; }
.watch-stats .placeholder.is-label { width: 84px; height: 10px; margin-top: 5px; }
.group-head .placeholder.is-title { width: 120px; height: 16px; }
.group-head .placeholder.is-meta { width: 160px; height: 12px; }
.site-row.is-placeholder { cursor: default; }
.site-row.is-placeholder:hover { background: none; }
.placeholder.is-status { width: 56px; height: 14px; }
.placeholder.is-name { width: 60%; height: 14px; }
.placeholder.is-name.is-short { width: 40%; }
.placeholder.is-days { height: 26px; }
.placeholder.is-figure { width: 52px; height: 14px; justify-self: end; }
.placeholder.is-grade { width: 18px; height: 14px; justify-self: end; }
@keyframes placeholder { 50% { opacity: 0.5; } }

.banner { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--down-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--down) 35%, transparent); }
.banner .icon { color: var(--down); margin-top: 2px; }
.banner strong { color: var(--down); }
.banner code, .empty code, .drawer code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; word-break: break-all; }

/* ===================================================================
   The watch: the night panel that says how everything is
   =================================================================== */

.watch {
  /* Not clipped: the owl's talons reach over its bottom edge */
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px;
  margin-bottom: 30px; padding: 30px 34px; border-radius: 22px; color: var(--night-text);
  background:
    radial-gradient(1.5px 1.5px at 8% 22%, rgb(255 255 255 / 0.55), transparent 60%),
    radial-gradient(1px 1px at 22% 78%, rgb(255 255 255 / 0.4), transparent 60%),
    radial-gradient(1px 1px at 38% 14%, rgb(255 255 255 / 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 57% 64%, rgb(255 255 255 / 0.35), transparent 60%),
    radial-gradient(1px 1px at 66% 20%, rgb(255 255 255 / 0.5), transparent 60%),
    radial-gradient(60% 120% at 92% 40%, var(--glow, rgb(25 172 202 / 0.30)), transparent 70%),
    linear-gradient(135deg, #0b1222 0%, #0f172a 45%, #172238 100%);
  box-shadow: 0 18px 50px -28px rgb(15 23 42 / 0.6);
}
.watch.is-alert { --glow: rgb(239 68 68 / 0.38); }
.watch.is-watch { --glow: rgb(245 158 11 / 0.30); }
.watch.is-empty { --glow: rgb(148 163 184 / 0.22); }
.watch-kicker { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--night-muted); }
.watch h1 { margin: 0; font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; letter-spacing: -0.035em; }
.watch-line { margin: 8px 0 0; max-width: 58ch; color: #cbd5e1; font-size: 16px; }
.watch-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 22px 0 0; padding: 0; list-style: none; }
.watch-stats li { display: grid; gap: 1px; }
.watch-stats b { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.watch-stats span { font-size: 12px; color: var(--night-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.watch-stats .is-down b { color: #fca5a5; }
.watch-stats .is-warn b { color: #fcd34d; }
.watch-stats .is-up b { color: #6ee7b7; }

/* The owl in the panel (the kit's character): watches calmly and blinks now and then; wide awake while a site is down */
.watch-owl { width: 136px; height: 136px; filter: drop-shadow(0 0 28px var(--glow, rgb(25 172 202 / 0.45))); }
/* Perched on the panel's bottom edge, its talons over it (y 36 of 40 sits on the edge: 14px from the bottom at 136px), tonight's moon above */
.watch-perch { position: relative; align-self: stretch; width: 136px; min-height: 196px; margin-bottom: -30px; }
.watch-perch .watch-owl { position: absolute; right: 0; bottom: -14px; }
.watch-perch .owl-feet { display: none; }
.watch-moon { position: absolute; top: 0; right: 6px; width: 46px; height: 46px; filter: drop-shadow(0 0 8px rgb(248 241 216 / 0.35)); }
.moon-dark { fill: rgb(255 255 255 / 0.08); }
.moon-lit { fill: #f8f1d8; }
.watch-owl .owl-eyes { transform-box: fill-box; transform-origin: center; animation: blink 7s infinite; }
.watch.is-alert .watch-owl .owl-eyes { animation: none; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
/* Its eyes follow a mouse over the panel (lookAt() in app.js): quick while it looks, back to the middle after a moment when the mouse leaves */
.watch-owl .owl-pupil { transition: transform 0.6s ease-in-out 0.4s; }
.watch-owl.is-following .owl-pupil { transition: transform 0.12s ease-out; }
/* Curious about a mouse resting near it, it tilts its head round its feet (20, 35 of its 40 units), which keep their hold */
.watch-owl .owl-body { transform-origin: 20px 35px; transition: transform 0.5s ease-in-out; }

/* Outages that end while someone watches: the red glow fades into the new one, the owl's eyes relax from wide awake
   (whites 5.3 to 4.6, pupils 1.4 to 2.4), and it lets out a slow blink, like a sigh */
.watch.is-relieved { isolation: isolate; }
.watch.is-relieved::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 120% at 92% 40%, rgb(239 68 68 / 0.38), transparent 70%);
  /* Seen only while it fades, so without motion it is never there */
  opacity: 0; animation: relief-glow 2.4s ease-out;
}
.watch.is-relieved .owl-eyes > circle, .watch.is-relieved .owl-pupil > circle:first-child { transform-box: fill-box; transform-origin: center; }
.watch.is-relieved .owl-eyes > circle { animation: relief-whites 1.4s ease-in-out; }
.watch.is-relieved .owl-pupil > circle:first-child { animation: relief-pupils 1.4s ease-in-out; }
.watch.is-relieved .watch-owl .owl-eyes { animation: sigh 1.2s ease-in-out 1.4s, blink 7s 2.6s infinite; }
@keyframes relief-glow { from { opacity: 1; } }
@keyframes relief-whites { from { transform: scale(1.15); } }
@keyframes relief-pupils { from { transform: scale(0.58); } }
@keyframes sigh { 0%, 100% { transform: scaleY(1); } 45%, 60% { transform: scaleY(0.1); } }

/* ===================================================================
   Needs your attention
   =================================================================== */

.attention { margin-bottom: 34px; }

/* One compact row per problem; a click opens the advice and the actions */
.incidents { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.incidents > li + li { border-top: 1px solid var(--line); }
.incidents.is-nested { border: 0; border-radius: 0; box-shadow: none; background: none; }
.incidents.is-nested > li { border-top: 1px solid var(--line); }
.incident { position: relative; }
.incident::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.incident.is-down::before { background: var(--down); }
.incident.is-failing::before, .incident.is-warn::before { background: var(--warn-bar); }
.incident.is-quiet::before { background: var(--quiet); opacity: 0.6; }
.incidents.is-nested .incident::before { display: none; }

.incident summary {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 18px; gap: 14px; align-items: center;
  padding: 12px 16px 12px 18px; cursor: pointer; list-style: none;
}
.incident summary::-webkit-details-marker { display: none; }
.incident summary:hover { background: var(--surface-2); }
.incident summary > .icon { width: 16px; height: 16px; color: var(--text-3); transform: rotate(-90deg); transition: transform 0.15s; }
.incident details[open] > summary > .icon { transform: none; }
.medallion { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.medallion .icon { width: 20px; height: 20px; }
.incident .medallion { width: 34px; height: 34px; border-radius: 10px; }
.incident .medallion .icon { width: 17px; height: 17px; }
.is-down .medallion, .is-down > .medallion { background: var(--down-soft); color: var(--down); }
.is-failing .medallion, .is-warn .medallion { background: var(--warn-soft); color: var(--warn); }
.is-quiet .medallion { background: var(--quiet-soft); color: var(--quiet); }
/* Up has its tile too, like every other state, so the detail's head never shows a bare mark; paused and not checked yet are neutral */
.is-up .medallion { background: var(--up-soft); color: var(--up); }
.is-paused .medallion, .is-pending .medallion { background: var(--surface-2); color: var(--text-3); }
.incident-title { min-width: 0; font-size: 15.5px; }
.incident-title b { font-weight: 700; overflow-wrap: anywhere; }
.incident-what { font-weight: 600; color: var(--text-2); }
.incident-title small { display: block; margin-top: 1px; color: var(--text-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.incident-time { text-align: right; white-space: nowrap; }
.incident-time span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.incident-time b { display: block; font-size: 16px; font-weight: 750; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.is-down .incident-time b { color: var(--down); }
.is-failing .incident-time b, .is-warn .incident-time b { color: var(--warn); }
.is-quiet .incident-time b { color: var(--quiet); }
.incident-body { min-width: 0; padding: 0 18px 16px 66px; }
.incident-meta { margin: 0; color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.incident-summary { margin: 10px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.advice { display: flex; gap: 9px; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.advice .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.incident-sites { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.incident-files { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.incident-files li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.incident-files code { padding: 1px 7px; border-radius: 6px; background: var(--surface-2); font-weight: 650; overflow-wrap: anywhere; }
.incident-files span { color: var(--text-2); }
.incidents.is-nested .incident summary { padding-left: 0; }
.incidents.is-nested .incident-body { padding-left: 48px; padding-right: 0; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--quiet-soft); color: var(--quiet); }
.badge .icon { width: 13px; height: 13px; }
.badge.is-warn { background: var(--warn-soft); color: var(--warn); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: none; }
.button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.button, .close-button { transition: background-color 0.12s ease-out, border-color 0.12s ease-out; }
.button[disabled] { opacity: 0.55; cursor: progress; }
.button .icon { width: 15px; height: 15px; }
.segmented { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.segmented > span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; font-size: 14px; font-weight: 650; color: var(--text-2); }
.segmented > span .icon { width: 15px; height: 15px; color: var(--quiet); }
.segmented button { height: 32px; padding: 0 11px; border: 0; border-left: 1px solid var(--line); background: none; font-size: 14px; font-weight: 650; cursor: pointer; }
.segmented button:hover { background: var(--quiet-soft); color: var(--quiet); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--line-strong); }

/* ===================================================================
   All sites
   =================================================================== */

.sites-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sites-head .section-title { margin: 0; }
.sites-head .add-site { margin-left: auto; }
.add-site[hidden], .add-group[hidden] { display: none; }
.group-head .button { height: 30px; padding: 0 11px; font-size: 13.5px; }
.group-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0; padding: 16px 18px; color: var(--text-3); font-size: 14px; }
.choice-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.choice-list label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 8px 0; cursor: pointer; }
.choice-list input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.choice-list b { font-weight: 650; font-size: 14.5px; }
.choice-list small { grid-column: 2; color: var(--text-3); font-size: 13px; }
.choice-list .inline-minutes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.field .choice-list .inline-minutes input[type="text"] { width: 72px; height: 34px; padding: 0 8px; font-size: 14px; text-align: center; border-radius: 8px; }
.choice-list .inline-minutes input:focus-visible, .choice-list input[type="radio"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.field .check.is-small { min-height: 36px; font-size: 13.5px; color: var(--text-2); }
.filter { position: relative; display: block; }
.filter .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.filter input { width: 280px; max-width: 100%; height: 38px; padding: 0 64px 0 34px; font: inherit; font-size: 14.5px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-3); background: var(--surface-2); font-size: 12px; }
/* No keyboard to press it on a touch screen */
@media (hover: none) { .filter kbd { display: none; } .filter input { padding-right: 12px; } }

.group { margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.group-head h3 { margin: 0; font-size: 16px; font-weight: 750; overflow-wrap: anywhere; }
.group-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; color: var(--text-3); font-size: 13px; }
.group-meta li { display: inline-flex; align-items: center; gap: 5px; }
.group-meta .icon { width: 14px; height: 14px; }
.columns { display: grid; grid-template-columns: 116px minmax(0, 1fr) 186px 82px 82px 64px; gap: 14px; padding: 8px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--text-3); font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.columns .right { text-align: right; }
.site-list { margin: 0; padding: 0; list-style: none; }
.site-list li + li { border-top: 1px solid var(--line); }

.site-row {
  display: grid; grid-template-columns: 116px minmax(0, 1fr) 186px 82px 82px 64px; align-items: center; gap: 14px;
  width: 100%; padding: 12px 18px; background: none; border: 0; text-align: left; cursor: pointer;
}
.site-row:hover { background: var(--surface-2); }
.site-name { min-width: 0; }
.site-name strong { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-name small { display: block; color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-name small .is-warn { color: var(--warn); font-weight: 600; }
.site-name small .is-down { color: var(--down); font-weight: 600; }
.site-figure { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.site-figure small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 500; }

/* Status: icon and word, never colour alone */
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 14px; white-space: nowrap; }
.status .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.status-up { color: var(--up); }
.status-down { color: var(--down); }
.status-failing { color: var(--warn); }
.status-paused, .status-pending { color: var(--text-3); }

/* Thirty days at a glance, one bar per day (dayClass() in app.js says which colour) */
.days { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.days > *, .day-key i { flex: 1; height: 100%; border-radius: 2px; background: var(--up-bar); opacity: 0.75; }
.days > .is-partial, .day-key .is-partial { background: var(--warn-bar); opacity: 1; }
.days > .is-down, .day-key .is-down { background: var(--down-bar); opacity: 1; }
/* Down only in maintenance: planned, so the quiet colour, softly */
.days > .is-planned, .day-key .is-planned { background: var(--quiet); opacity: 0.55; }
.days > .is-none, .day-key .is-none { background: var(--none); opacity: 1; height: 40%; }
.site-row:hover .days > :not(.is-planned) { opacity: 1; }
/* A day bar's words on hover in the site list, and the moon's beside it, placed by app.js */
.hover-tip {
  position: fixed; left: 0; top: 0; z-index: 25; max-width: min(440px, calc(100vw - 16px)); margin: 0; padding: 6px 10px;
  border-radius: 9px; background: var(--night); color: var(--night-text); font-size: 13px; font-weight: 600; line-height: 1.35;
  box-shadow: 0 10px 24px -12px rgb(15 23 42 / 0.6); pointer-events: none; opacity: 0; transition: opacity 0.1s;
}
.hover-tip.is-visible { opacity: 1; }
/* The moon's, in its own light on the night panel, where the night's own colour would vanish */
.hover-tip.is-moonlight { background: #f8f1d8; color: #0f172a; }
.no-match { padding: 22px 18px; color: var(--text-3); }

/* ===================================================================
   Empty state
   =================================================================== */

.empty { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.empty h2 { margin: 0 0 6px; font-size: 22px; }
.empty > p { margin: 0 0 18px; color: var(--text-2); }
.steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.steps p { margin: 4px 0 6px; font-weight: 600; }
.steps li.is-done::before { content: "\2713"; background: var(--up-soft); color: var(--up); }
.steps li.is-done > div > p { color: var(--text-2); }
.steps small { display: block; margin-top: 6px; color: var(--text-3); font-size: 13px; }
.steps .command + .command { margin-top: 6px; }
.command { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.command code { flex: 1; min-width: 0; background: none; padding: 0; overflow-x: auto; white-space: nowrap; }

/* ===================================================================
   Site detail: a drawer from the right
   =================================================================== */

.drawer {
  width: min(600px, 100vw); height: 100vh; max-height: 100vh; margin: 0 0 0 auto; padding: 0;
  border: 0; border-left: 1px solid var(--line); border-radius: 22px 0 0 22px;
  background: var(--surface); color: var(--text); box-shadow: -24px 0 60px -30px rgb(15 23 42 / 0.45);
  /* Scrolling past its end does not carry on into the page behind */
  overscroll-behavior: contain;
}
/* The page behind stays put while the drawer is open; the gutter keeps it from shifting sideways */
html:has(.drawer[open]) { overflow: hidden; scrollbar-gutter: stable; }
/* Opens over the page (the design kit's motion.md, 0.15 s): the panel slides in from its edge, opaque, and the dimmed backdrop
   fades in with it; a panel that faded in showed the blurred page through it for a moment, which read as a blink */
.drawer[open] { animation: slide-in 0.15s ease-out; }
.drawer[open]::backdrop { animation: backdrop-in 0.15s ease-out; }
@keyframes slide-in { from { transform: translateX(40px); } }
@keyframes backdrop-in { from { opacity: 0; } }
.drawer::backdrop { background: rgb(15 23 42 / 0.45); backdrop-filter: blur(2px); opacity: var(--dim); }
/* A finger drags the detail back out to the right (app.js): up and down scroll it, sideways is the drag. The backdrop
   clears with it through --dim, registered as a number so that it can ease when the finger lets go */
@property --dim { syntax: '<number>'; inherits: true; initial-value: 1; }
.drawer { touch-action: pan-y pinch-zoom; }
.drawer.is-settling { transition: transform 0.2s ease-out, --dim 0.2s ease-out; }
.drawer-inner { padding: 22px 24px 32px; }
.drawer-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.drawer-head .medallion { grid-row: auto; }
.drawer-head h2 { margin: 0; font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.drawer .incident-summary, .drawer .settings dd { overflow-wrap: anywhere; }
.drawer-head p { margin: 2px 0 0; color: var(--text-3); font-size: 14px; }
.close-button { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.close-button:hover { background: var(--surface-2); }
.drawer h3 { margin: 26px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 18px 0 0; }
.fact { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.fact dt { font-size: 12px; color: var(--text-3); font-weight: 600; }
.fact dd { margin: 3px 0 0; font-size: 19px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fact .fact-when { margin-top: 2px; color: var(--text-3); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.recheck-note { margin: 10px 0 0; color: var(--text-2); font-size: 13px; }
.button.is-done .icon { color: var(--up); }
.days.is-large { height: 44px; gap: 3px; touch-action: pan-y; }
.days > button { padding: 0; border: 0; cursor: pointer; }
.days > button:focus-visible { border-radius: 2px; outline-offset: 1px; }
/* A picked day (the design kit's charts.md): its bar a half step deeper, no ring, its line in the accent; the others step back
   toward the surface at once (a veil, not transparency) and come back over 0.35 s when it is let go */
.days > button { position: relative; }
.days > button::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--surface); opacity: 0; pointer-events: none; transition: opacity 0.35s ease-out; }
.days:has(.is-picked) > :not(.is-picked)::after { opacity: 0.35; transition: none; }
.days > .is-picked { opacity: 1; filter: brightness(0.88); }
.days-legend { display: flex; justify-content: space-between; margin: 6px 0 0; color: var(--text-3); font-size: 12px; }
/* The line above a chart (toldLine() in app.js): its summary, and in its place what is pointed at, in the accent. Both
   lie in one cell, so the line is as tall as the taller and the chart never moves under a finger */
.told { display: grid; margin: 0 0 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.told > span { grid-area: 1 / 1; }
.told-pick { color: var(--accent); }
.told.is-picked .told-summary { visibility: hidden; }
.day-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--text-3); font-size: 12.5px; }
.day-key li { display: flex; align-items: center; gap: 6px; }
.day-key i { flex: none; width: 8px; height: 12px; }
.day-key .is-none { height: 6px; }
/* The response time chart: the SVG stretches to the width, the labels around it are HTML (chart() in app.js) */
.chart-plot { display: grid; grid-template-columns: 48px minmax(0, 1fr); }
.chart { width: 100%; height: 150px; display: block; }
.chart-y { position: relative; color: var(--text-3); font-size: 11px; }
.chart-y span { position: absolute; left: 0; transform: translateY(-50%); }
.chart-y span:nth-child(1) { top: 8px; }
.chart-y span:nth-child(2) { top: 75px; }
.chart-y span:nth-child(3) { top: 142px; }
.chart-x { display: grid; grid-template-columns: 1fr auto 1fr; margin: 2px 0 0 48px; color: var(--text-3); font-size: 11px; }
.chart-x span:last-child { text-align: right; }
.chart .chart-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .chart-area { fill: var(--accent); opacity: 0.1; }
.chart .chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .chart-fail { fill: var(--down-bar); }
/* The check pointed at (showSample() in app.js): a finger slides along the chart, so only up and down scroll the detail */
.chart { touch-action: pan-y; overflow: visible; }
.chart .chart-cursor { stroke: var(--text-3); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; }
.chart .chart-dot { stroke: var(--accent); stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0; }
.chart .chart-dot.is-fail { stroke: var(--down-bar); }
.chart .is-shown { opacity: 1; }
.chart-note { margin: 6px 0 0; color: var(--text-3); font-size: 13px; }
.timeline { position: relative; margin: 0; padding: 0 0 0 22px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 14px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text-3); }
.timeline li.is-fail::before { border-color: var(--down); background: var(--down); }
.timeline li.is-ok::before { border-color: var(--up); background: var(--up); }
.timeline li.is-warn::before { border-color: var(--warn-bar); background: var(--warn-bar); }
.timeline li.is-quiet::before { border-color: var(--quiet); }
.timeline time { display: block; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.timeline span { font-weight: 550; }
.timeline .history-tag { margin-left: 6px; font-size: 12px; color: var(--quiet); font-weight: 700; }
.headers-summary { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.header-list { display: grid; gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; }
.header-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; }
.header-list .icon { width: 16px; height: 16px; margin-top: 2px; stroke-width: 2.4; }
.header-list .is-good .icon { color: var(--up); }
.header-list .is-weak .icon { color: var(--warn); }
.header-list .is-missing .icon, .header-list .is-none .icon { color: var(--text-3); }
.header-list p { margin: 0; }
.header-list b { font-weight: 650; }
.header-list .header-what { color: var(--text-3); font-size: 13px; }
.header-list .header-level { color: var(--text-3); font-weight: 600; }
/* A remark after the level word is a warning (it can break the site, a tag manager makes this hard): the warning colour, so it reads apart */
.header-list .header-remark { color: var(--warn); }
.header-list .is-weak .header-level, .header-list .is-weak .header-why { color: var(--warn); }
.header-list .header-why { margin-top: 4px; color: var(--text-2); font-weight: 600; }
.header-list code { display: inline-block; margin-top: 6px; overflow-wrap: anywhere; }
.header-list .records { display: grid; justify-items: start; gap: 4px; }
.header-list .records code { margin-top: 6px; }
.header-list .records code + code { margin-top: 0; }
.header-list .header-tip { margin-top: 4px; color: var(--text-3); font-size: 13px; }
.header-tip strong, .headers-tip strong { font-weight: 650; color: var(--text-2); }
.headers-lead { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }
/* What is in place: one line that opens to what the site sends for each */
.headers-done { margin: 14px 0 0; color: var(--text-2); font-size: 14px; }
.headers-done > summary { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; list-style: none; border-radius: 4px; }
.headers-done > summary::-webkit-details-marker { display: none; }
.headers-done > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.headers-done .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; stroke-width: 2.4; color: var(--up); }
.headers-done > summary .icon:last-child { width: 14px; height: 14px; margin-top: 3px; color: var(--accent); transform: rotate(-90deg); transition: transform 0.15s; }
.headers-done[open] > summary .icon:last-child { transform: none; }
.header-values { display: grid; gap: 8px; margin: 10px 0 0 26px; padding: 0; list-style: none; font-size: 13.5px; }
.header-values li { display: grid; gap: 3px; justify-items: start; }
.header-values b { font-weight: 650; color: var(--text); }
.header-values code, .header-sent code { overflow-wrap: anywhere; }
/* A header sent twice is in place, and still says what is left over and where to look */
.header-values .header-why { margin: 3px 0 0; color: var(--text-2); }
.header-values .header-tip { margin: 0; color: var(--text-3); font-size: 13px; }
.header-list .header-sent { margin-top: 4px; color: var(--text-3); font-size: 13px; }
.header-list .header-sent code { margin-top: 0; }
/* The scripts a note names are a link in the sentence (a button cannot wrap inside, so a long phrase sat on lines of its own) */
.header-why .link-button { font-size: inherit; font-weight: inherit; color: inherit; }
/* What each does and how to add it, one click away: the browser's own disclosure, so keys and screen readers work as they do anywhere */
.header-more { margin-top: 6px; }
.headers-tip { margin: 14px 0 0 26px; color: var(--text-3); font-size: 13px; }
.header-more > summary, .headers-tip > summary { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; border-radius: 4px; }
.header-more > summary::-webkit-details-marker, .headers-tip > summary::-webkit-details-marker { display: none; }
.header-more > summary:focus-visible, .headers-tip > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.header-list .header-more > summary .icon, .headers-tip > summary .icon { width: 14px; height: 14px; margin: 0; color: inherit; transform: rotate(-90deg); transition: transform 0.15s; }
.header-list .header-more[open] > summary .icon, .headers-tip[open] > summary .icon { transform: none; }
.header-more > p { margin-top: 6px; }
.headers-tip > p { margin: 6px 0 0; }
.header-scripts > p { margin-top: 8px; color: var(--text-2); font-size: 13px; }
.header-scripts ul { display: grid; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; }
.header-list .header-scripts li { display: block; }
.header-list .header-scripts code { margin-top: 0; font-size: 12.5px; }
.header-list .fix-label { margin-top: 6px; color: var(--text-2); font-size: 13px; }
.header-list .fix-label + code { margin-top: 2px; }
/* The lines to paste in, in the form picked above the list, each with its Copy */
.header-format { margin-top: 10px; }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.header-fix { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.header-list .header-fix code { flex: 1; min-width: 0; margin-top: 0; }
.button.is-small { flex: none; height: 28px; padding: 0 9px; border-radius: 8px; font-size: 13px; }
.button.is-small .icon { width: 13px; height: 13px; }
/* What Vaka sees: a tile per check, the words first, tinted when something needs a look */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.tile { min-width: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.tile.is-warn { background: var(--warn-soft); }
.tile.is-down { background: var(--down-soft); }
.tile p { margin: 0; }
.tile-label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.tile .tile-value { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: 16px; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tile-value .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; stroke-width: 2.4; color: var(--text-3); }
.tile.is-ok .tile-value .icon { color: var(--up); }
.tile.is-warn .tile-value .icon { color: var(--warn); }
.tile.is-down .tile-value .icon { color: var(--down); }
.tile .tile-sub { margin-top: 3px; color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.tile .tile-when { margin-top: 6px; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.tile .tile-was { margin-top: 3px; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
/* While "Check again" waits for a check: a calm dot; once it has run, the tile lights up and settles, once (still for reduced motion) */
/* A check "Check again" waits for: ringed in the accent, its old result dimmed, "Checking…" in the accent */
.tile.is-checking, .fact.is-checking { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tile.is-checking .tile-value, .tile.is-checking .tile-sub, .tile.is-checking .tile-was, .fact.is-checking dd:not(.fact-when) { opacity: 0.45; }
.tile.is-checking .tile-when, .fact.is-checking .fact-when { color: var(--accent); font-weight: 650; }
/* "Check again" at work: a turning ring, and the button fills as the checks come back */
.button.is-busy[disabled] { opacity: 1; border-color: var(--accent); color: var(--text-2); background: linear-gradient(to right, var(--accent-soft) calc(var(--progress, 0) * 100%), var(--surface) 0); }
.spinner { flex: none; width: 13px; height: 13px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.checking-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; animation: checking 1.2s ease-in-out infinite; }
@keyframes checking { 50% { opacity: 0.25; } }
.tile.is-fresh, .fact.is-fresh { animation: fresh 0.35s ease-out; }
.tile.is-fresh :is(.tile-value, .tile-sub, .tile-was), .fact.is-fresh dd:not(.fact-when) { animation: undim 0.35s ease-out; }
@keyframes fresh { from { box-shadow: inset 0 0 0 1.5px var(--accent); } }
@keyframes undim { from { opacity: 0.45; } }
/* A folded section opens in place: it grows to its height and fades in over 0.2 s, so what is under it slides down rather than
   jumping (the design kit drops it 4 px, which in a list of rows read as the text jumping); closing is at once. A transition needs
   a change, so a section drawn open by a refresh never plays it; a browser without ::details-content opens it at once */
details { interpolate-size: allow-keywords; }
details::details-content { block-size: 0; opacity: 0; overflow-y: clip; overflow-clip-margin: 6px; }
details[open]::details-content { block-size: auto; opacity: 1; transition: block-size 0.2s ease-out, opacity 0.2s ease-out; }
.tile .link-button { margin-top: 6px; }

/* Settings: what the site is set to do, a card of its own */
.settings-card { margin-top: 26px; padding: 0 16px 16px; border: 1px solid var(--line); border-radius: 16px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.drawer .settings-head h3 { margin: 0; }
.settings { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); font-size: 14px; }
.settings dt, .settings dd { padding: 9px 0; border-top: 1px solid var(--line); }
.settings dt { padding-right: 18px; color: var(--text-3); }
.settings dd { margin: 0; overflow-wrap: anywhere; }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.check-chips li { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--up-soft); color: var(--up); font-size: 13px; font-weight: 650; }
.check-chips li.is-off { background: var(--surface-2); color: var(--text-3); }
.check-chips .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.drawer-hint { margin: 22px 0 0; color: var(--text-3); font-size: 13.5px; }

/* Toast */
/* A popover (above the site detail, which is a modal dialog): inset, border and overflow undo the browser's popover style */
.toast { position: fixed; inset: auto auto 22px 50%; z-index: 30; transform: translate(-50%, 8px); margin: 0; padding: 11px 16px; border: 0; overflow: visible; border-radius: 12px; background: var(--night); color: var(--night-text); font-weight: 650; box-shadow: 0 12px 30px -12px rgb(15 23 42 / 0.6); opacity: 0; pointer-events: none; transition: opacity 0.15s ease-out, transform 0.15s ease-out; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ===================================================================
   Small screens
   =================================================================== */

@media (max-width: 760px) {
  .topbar { gap: 8px; }
  .run-pill { font-size: 12.5px; }
  .icon-button .label { display: none; }
  /* An assistant is set up at a computer: on a phone the run state keeps the room it needs to be read whole */
  .topbar [data-api-link] { display: none; }
  /* The icon only, as for the buttons beside it; the words stay for a screen reader */
  .shared-note .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  main { padding-top: 18px; }
  .watch { grid-template-columns: 1fr; padding: 24px 22px; }
  .watch-owl, .watch-perch .watch-owl { position: absolute; right: 16px; top: 16px; bottom: auto; width: 72px; height: 72px; }
  /* In the corner on a phone, where the numbers fill the bottom: standing feet, no moon */
  .watch-perch { display: contents; }
  .watch-perch .owl-feet { display: inline; }
  .watch-perch .owl-talons, .watch-moon { display: none; }
  .watch-kicker, .watch h1 { padding-right: 80px; }
  .columns { display: none; }
  .site-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name status" "days days" "figures figures"; row-gap: 8px; }
  .site-row .site-name { grid-area: name; }
  .site-row .status { grid-area: status; justify-self: end; }
  .site-row .days { grid-area: days; height: 18px; }
  .site-row .site-figures { grid-area: figures; display: flex; justify-content: space-between; }
  .site-row.is-placeholder .is-name { grid-area: name; }
  .site-row.is-placeholder .is-status { grid-area: status; justify-self: end; }
  .site-row.is-placeholder .is-days { grid-area: days; height: 18px; }
  .site-row.is-placeholder .is-figure, .site-row.is-placeholder .is-grade { display: none; }
  .site-figures .site-figure { display: flex; gap: 6px; align-items: baseline; }
  .site-figures .site-figure small { display: inline; }
  .incident summary { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px 12px 16px; }
  .incident summary > .icon { display: none; }
  /* Room for the whole line on a phone, such as who the registrar is: two lines instead of one cut short */
  .incident-title small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .incident-time b { font-size: 15px; }
  .incident-body { padding: 0 14px 14px 16px; }
  .incidents.is-nested .incident-body { padding-left: 0; }
  .run-count { display: none; }
  .drawer { border-radius: 0; border-left: 0; }
  .filter input { width: 100%; }
  .filter { flex: 1; }
}
@media (min-width: 761px) {
  .site-figures { display: contents; }
  .site-row .site-figure small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Adding and changing a site, in the drawer */
.drawer-inner.is-form .medallion { background: var(--accent-soft); color: var(--accent); }
.site-form { display: grid; gap: 18px; margin-top: 22px; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field legend { padding: 0; font-weight: 650; font-size: 14px; }
.field input[type="text"], .field select { width: 100%; height: 42px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.field input[type="text"]:focus-visible, .field select:focus-visible, .check-list input:focus-visible, .field .check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.field-hint { margin: 0; color: var(--text-3); font-size: 13px; }
.field-error { margin: 0; color: var(--down); font-size: 13.5px; font-weight: 650; }
.field.is-invalid input[type="text"], .field.is-invalid select { border-color: var(--down); }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; margin: 0; padding: 0; list-style: none; }
.check-list label, .field .check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.check-list input, .field .check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.button.is-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.is-primary:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.08); }
.button.is-danger { background: var(--down-soft); border-color: var(--down); color: var(--down); }
.button.is-quiet-danger { color: var(--down); }
.site-form .actions { margin-top: 4px; }
.danger-zone { padding-top: 16px; border-top: 1px solid var(--line); }
.confirm { padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--down) 40%, transparent); border-radius: var(--radius-sm); background: var(--down-soft); }
.confirm p { margin: 0; }
.confirm .actions { margin-top: 10px; }
.steps .button.is-primary { margin: 2px 0 4px; }

.form-intro { margin: 16px 0 0; color: var(--text-2); font-size: 14px; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.window-list { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 14px; }
.time-row { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 6px; }
.time-field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.time-field input { height: 40px; padding: 0 10px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color-scheme: inherit; }
.time-field input:focus-visible, .day-list input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.day-list { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 6px 0 0; padding: 0; list-style: none; }
.day-list label { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; cursor: pointer; }
.day-list input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
