/* Self-hosted variable fonts (SIL Open Font License), served from /fonts. */
@font-face { font-family: "Geist"; src: url("../assets/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../assets/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* Display face: Lampwick Display, a subset of Mona Sans (OFL; see fonts/OFL-lampwick-display.txt).
   Variable: wdth 100–112.5, wght 500–700, opsz 0–30. Same face and tokens as site/assets/tokens.css. */
@font-face { font-family: "Lampwick Display"; src: url("../assets/fonts/lampwick-display.woff2") format("woff2-variations"), url("../assets/fonts/lampwick-display.woff2") format("woff2"); font-weight: 500 700; font-stretch: 100% 112.5%; font-display: swap; }
/* Fallback while it loads: Arial matched to the display face's width and vertical metrics, so
   headings keep their line breaks when it swaps in. Two faces, because Arial has one width: the
   wider settings (106%, 112.5%) get a larger size-adjust, with ascent/descent scaled back so line
   boxes stay the same. */
@font-face { font-family: "Lampwick Display Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica Neue"); font-stretch: 100% 104%; size-adjust: 109%; ascent-override: 100.1%; descent-override: 29.4%; line-gap-override: 0%; }
@font-face { font-family: "Lampwick Display Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica Neue"); font-stretch: 104.01% 112.5%; size-adjust: 111%; ascent-override: 98.3%; descent-override: 28.9%; line-gap-override: 0%; }

:root {
  --bg: #161618;
  --sidebar: #1d1d1f;
  --panel: #1f1f22;
  --panel-2: #26262a;
  --panel-3: #2e2e33;
  --row: rgba(255, 255, 255, .03);
  --row-hover: rgba(255, 255, 255, .045);
  --hover: rgba(255, 255, 255, .05);
  --active: rgba(255, 255, 255, .09);
  --seg-active: #3a3a40;
  --btn-hover: #38383e;
  --card-hover: #232327;
  --code-bg: #141416;
  --card-border: rgba(255, 255, 255, .06);
  --shadow: 0 0 0 1px var(--card-border), inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .25), 0 4px 8px -2px rgba(0, 0, 0, .2), 0 16px 32px -8px rgba(0, 0, 0, .3);
  --shadow-hover: 0 0 0 1px var(--card-border), inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .25), 0 8px 16px -4px rgba(0, 0, 0, .25), 0 24px 48px -12px rgba(0, 0, 0, .4);
  --c-ok: #0a84ff;
  --c-ok-2: #64d2ff;
  --c-warn: #ff9f0a;
  --c-bad: #ff375f;
  --ring: rgba(255, 255, 255, .12);
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .12);
  --text: #e8e8ed;
  --text-strong: #f5f5f7;
  --muted: rgba(235, 235, 245, .55);
  --icon-muted: #8e8e93;
  --faint: rgba(235, 235, 245, .28);
  --accent: #0a84ff;
  --accent-hover: #2490ff;
  --accent-soft: rgba(10, 132, 255, .16);
  --ok: #30d158;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --ok-soft: rgba(48, 209, 88, .14);
  --warn-soft: rgba(255, 159, 10, .14);
  --bad-soft: rgba(255, 69, 58, .14);
  /* Text in the state colours (badges, -text classes, notices): WCAG AA on panels and soft backgrounds. */
  --ok-text: #30d158;
  --warn-text: #ff9f0a;
  --bad-text: #ff6961;
  --hl: rgba(255, 69, 58, .13);
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  --display: "Lampwick Display", "Lampwick Display Fallback", var(--sans);
  /* Display width (wdth via font-stretch), weight and optical size, as on the site: wider and with
     display spacing for titles, normal width and text spacing (opsz 0) for small display text. */
  --display-wide: 112.5%;
  --display-mid: 106%;
  --display-normal: 100%;
  --fw-display: 640;
  --fw-display-small: 600;
  --display-opsz: 30;
  --display-opsz-small: 0;
  /* Motion: strong ease-out for things that respond to the user, ease-in-out for movement on screen. */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  /* Radii. Buttons and inputs use --r-sm (the marketing site copied 9px buttons: it can follow). */
  --r-xs: 4px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-pill: 999px;
  /* Spacing scale: everything snaps to these. */
  --s-1: 2px;
  --s-2: 4px;
  --s-3: 6px;
  --s-4: 8px;
  --s-5: 12px;
  --s-6: 16px;
  --s-7: 20px;
  --s-8: 24px;
  /* Type scale. */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 15px;
  --fs-lg: 21px;
  --fs-xl: 26px;
  /* Elevation: overlays (palette, dialogs, menus), their backdrop, the raised pill of a segmented control. */
  --shadow-overlay: var(--shadow-hover), 0 32px 64px -16px rgba(0, 0, 0, .4);
  --backdrop: rgba(0, 0, 0, .32);
  --shadow-seg: 0 0 0 .5px var(--ring), 0 1px 2px rgba(0, 0, 0, .1), 0 2px 6px -2px rgba(0, 0, 0, .12);
  /* Dark tooltip surface (status page bars), in both themes. */
  --menu-bg: #2a2a2e;
  --menu-ring: rgba(255, 255, 255, .08);
  --menu-hover: rgba(255, 255, 255, .07);
  --menu-active: rgba(255, 255, 255, .1);
  --menu-shadow: 0 0 0 1px var(--menu-ring), 0 10px 30px -6px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  --tile-ring: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .15);
  --accent-text: #5eadff;
  /* App frame: the sidebar and the layout background around the content card (main). Light mode
     redefines these for a light grey frame with the white-ish card raised by its border/shadow. */
  --sb-text: #e8e8ed;
  --sb-text-strong: #f5f5f7;
  --sb-muted: #8e8e93;
  --sb-faint: #58585d;
  --sb-icon: #8e8e93;
  --sb-label: rgba(255, 255, 255, .45);
  --sb-hover: rgba(255, 255, 255, .05);
  --sb-active: rgba(255, 255, 255, .09);
  --sb-active-shadow: none;
  --sb-border: rgba(255, 255, 255, .07);
  --sb-border-strong: rgba(255, 255, 255, .12);
  --sb-field: rgba(255, 255, 255, .05);
  --sb-menu-bg: #2a2a2e;
  --sb-menu-ring: rgba(255, 255, 255, .08);
  --sb-menu-hover: rgba(255, 255, 255, .07);
  --sb-menu-active: rgba(255, 255, 255, .1);
  --sb-menu-shadow: 0 0 0 1px var(--sb-menu-ring), 0 10px 30px -6px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  --sb-tile: #3a3a40;
  --sb-tile-fg: #d1d1d6;
  --sb-tile-add: #8e8e93;
  --sb-tile-add-ring: rgba(255, 255, 255, .16);
  --main-border: rgba(255, 255, 255, .07);
  --main-shadow: none;
  color-scheme: dark;
}

/* Light mode follows the system theme. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f7;
    --sidebar: #ebebee;
    --panel: #ffffff;
    --panel-2: #f4f4f7;
    --panel-3: #e9e9ee;
    --row: #f6f6f9;
    --row-hover: #f1f1f5;
    --hover: rgba(0, 0, 0, .045);
    --active: rgba(0, 0, 0, .075);
    --seg-active: #ffffff;
    --btn-hover: #dedee5;
    --card-hover: #ffffff;
    --code-bg: #f6f6f9;
    --card-border: rgba(0, 0, 0, .055);
    --shadow: 0 0 0 1px var(--card-border), 0 1px 1px rgba(0, 0, 0, .03), 0 2px 4px -1px rgba(0, 0, 0, .03), 0 6px 12px -3px rgba(0, 0, 0, .04), 0 18px 36px -10px rgba(0, 0, 0, .07);
    --shadow-hover: 0 0 0 1px var(--card-border), 0 1px 1px rgba(0, 0, 0, .03), 0 4px 8px -2px rgba(0, 0, 0, .05), 0 12px 24px -6px rgba(0, 0, 0, .07), 0 28px 56px -14px rgba(0, 0, 0, .12);
    --c-ok: #007aff;
    --c-ok-2: #5ac8fa;
    --c-warn: #ff9500;
    --c-bad: #ff2d55;
    --ring: rgba(0, 0, 0, .1);
    --border: rgba(0, 0, 0, .07);
    --border-strong: rgba(0, 0, 0, .13);
    --text: #2c2c30;
    --text-strong: #1d1d1f;
    --muted: rgba(60, 60, 67, .68);
    --icon-muted: #85858b;
    --faint: rgba(60, 60, 67, .36);
    --accent: #007aff;
    --accent-hover: #0068d9;
    --accent-soft: rgba(0, 122, 255, .1);
    --ok: #1f9d47;
    --warn: #c76a00;
    --bad: #e0332b;
    --ok-soft: rgba(52, 199, 89, .14);
    --warn-soft: rgba(255, 149, 0, .15);
    --bad-soft: rgba(255, 59, 48, .11);
    --ok-text: #157a35;
    --warn-text: #9a5200;
    --bad-text: #c02a22;
    --hl: rgba(255, 59, 48, .1);
    --accent-text: #0062cc;
    --sb-text: #2c2c30;
    --sb-text-strong: #1d1d1f;
    --sb-muted: #636366;
    --sb-faint: #8a8a8f;
    --sb-icon: #76767c;
    --sb-label: #7c7c82;
    --sb-hover: rgba(0, 0, 0, .05);
    --sb-active: #ffffff;
    --sb-active-shadow: 0 0 0 .5px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .07);
    --sb-border: rgba(0, 0, 0, .07);
    --sb-border-strong: rgba(0, 0, 0, .12);
    --sb-field: rgba(255, 255, 255, .65);
    --sb-menu-bg: #ffffff;
    --sb-menu-ring: rgba(0, 0, 0, .08);
    --sb-menu-hover: rgba(0, 0, 0, .045);
    --sb-menu-active: rgba(0, 0, 0, .07);
    --sb-menu-shadow: 0 0 0 .5px var(--sb-menu-ring), 0 10px 30px -6px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08);
    --sb-tile: #d9d9df;
    --sb-tile-fg: #48484a;
    --sb-tile-add: #6e6e73;
    --sb-tile-add-ring: rgba(0, 0, 0, .16);
    --main-border: rgba(0, 0, 0, .07);
    --main-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px -8px rgba(0, 0, 0, .08);
    color-scheme: light;
  }
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
html, body { margin: 0; }
body { font: var(--fs-base)/1.5 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); }
/* One focus ring for keyboard focus (buttons, links, tabs, ranges, chips); inputs keep their glow. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: none; }
h1 { font-family: var(--display); font-size: var(--fs-xl); line-height: 1.2; font-weight: var(--fw-display); font-stretch: var(--display-mid); color: var(--text-strong); margin: 0 0 var(--s-2); letter-spacing: -.01em; font-variation-settings: "opsz" var(--display-opsz); }
h2 { font-size: var(--fs-base); font-weight: 600; color: var(--text-strong); margin: 0 0 var(--s-5); display: flex; align-items: baseline; gap: var(--s-4); }
h2 .muted { font-weight: 400; font-variant-numeric: tabular-nums; }
h3 { font-size: var(--fs-base); font-weight: 600; color: var(--text-strong); margin: var(--s-6) 0 var(--s-3); }
strong { font-weight: 600; color: var(--text-strong); }
code, pre, .mono { font-family: var(--mono); font-size: var(--fs-sm); }
code { background: var(--panel-3); padding: 1px var(--s-2); border-radius: var(--r-xs); }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
pre code, .codebox code { background: none; padding: 0; }

/* Nucleo UI Fill icons are drawn on an 18px and a 12px grid: keep them at exactly that size. */
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; }
.icon.sm { width: 12px; height: 12px; vertical-align: -1px; }

/* The sidebar maps the shared tokens to its own (--sb-*). Icons and sidebar text use solid colours:
   with a translucent colour, overlapping icon paths add up and look muddy. */
.sidebar { --text: var(--sb-text); --text-strong: var(--sb-text-strong); --muted: var(--sb-muted); --faint: var(--sb-faint); --icon-muted: var(--sb-icon);
  --hover: var(--sb-hover); --active: var(--sb-active); --border: var(--sb-border); --border-strong: var(--sb-border-strong); color: var(--text); }

/* Layout */
/* The page content is a rounded panel inset in the app frame (the sidebar colour) around it. */
.layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; background: var(--sidebar); }

/* Project switcher at the top of the sidebar: a button with the current project's tile that opens a menu
   with every project. The menu scales in from the button; closing is instant. */
.switcher { position: relative; margin: 0 0 var(--s-5); }
.switcher summary { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3); border-radius: var(--r); cursor: pointer; list-style: none; user-select: none;
  font: var(--fw-display-small) var(--fs-md) var(--display); font-stretch: var(--display-normal); letter-spacing: 0; font-variation-settings: "opsz" var(--display-opsz-small); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--border);
  transition: background .15s ease, box-shadow .15s ease, transform 160ms var(--ease-out); }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary:hover, .switcher[open] summary { background: var(--hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.switcher summary:active { transform: scale(.98); }
.switcher .grow { flex: 1; min-width: 0; }
.switcher summary .chev { display: inline-flex; color: var(--faint); transform: rotate(90deg); transition: transform 200ms var(--ease-out); }
.switcher summary .chev .icon { color: inherit; }
.switcher[open] summary .chev { transform: rotate(-90deg); }
.switcher-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; padding: var(--s-2); border-radius: var(--r); background: var(--sb-menu-bg);
  box-shadow: var(--sb-menu-shadow);
  transform-origin: top center; transition: opacity 160ms var(--ease-out), transform 200ms var(--ease-out);
  @starting-style { opacity: 0; transform: translateY(-4px) scale(.97); } }
.switcher-menu a { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2); border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-base); }
.switcher-menu a:hover { background: var(--sb-menu-hover); }
.switcher-menu a.active { background: var(--sb-menu-active); color: var(--text-strong); }
.switcher-sep { height: 1px; margin: var(--s-2) var(--s-2); background: var(--sb-menu-ring); }
.switcher-label { padding: var(--s-3) var(--s-4) var(--s-2); font-size: var(--fs-xs); font-weight: 500; color: var(--sb-label); text-transform: uppercase; letter-spacing: .04em; }
.tile { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: var(--r-sm); font: var(--fw-display-small) var(--fs-sm) var(--display); font-stretch: var(--display-normal); letter-spacing: 0; font-variation-settings: "opsz" var(--display-opsz-small); color: #fff;
  background: var(--tile, var(--sb-tile)); box-shadow: var(--tile-ring); }
.tile .icon { color: inherit; }
.switcher-menu .tile { width: 22px; height: 22px; border-radius: var(--r-sm); font-size: var(--fs-xs); }
.tile.home { --tile: var(--sb-tile); color: var(--sb-tile-fg); }
.tile.add { --tile: transparent; color: var(--sb-tile-add); box-shadow: inset 0 0 0 1px var(--sb-tile-add-ring); }
.tile.c0 { --tile: #0a84ff; } .tile.c1 { --tile: #bf5af2; } .tile.c2 { --tile: #ff9f0a; } .tile.c3 { --tile: #30d158; }
.tile.c4 { --tile: #ff375f; } .tile.c5 { --tile: #64d2ff; color: #0b2a3a; } .tile.c6 { --tile: #5e5ce6; } .tile.c7 { --tile: #ffd60a; color: #3a2e00; }
.sidebar { background: var(--sidebar); font-weight: 500; padding: var(--s-6) var(--s-5); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: var(--s-4); font-size: var(--fs-md); font-weight: 500; letter-spacing: -.01em; color: var(--text-strong); padding: var(--s-1) var(--s-5) var(--s-6); }
.brand .icon { color: var(--accent); }
.nav a { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-3) var(--s-5); margin-bottom: var(--s-1); border-radius: var(--r-sm); color: var(--text); transition: background .12s; }
.nav a .icon { color: var(--icon-muted); }
.nav a:hover { background: var(--hover); }
.nav a { position: relative; isolation: isolate; }
.nav a.active { color: var(--text-strong); }
.nav a.active .pill { display: block; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--active); box-shadow: var(--sb-active-shadow); }
.nav a.active .icon { color: var(--accent); }
.nav .grow { flex: 1; }
.nav .section { font-size: var(--fs-xs); font-weight: 500; color: var(--faint); margin: var(--s-6) var(--s-5) var(--s-2); }

/* Collapsible submenus (Executions, Events): <details> whose content height eases open (where the browser
   can interpolate to auto height; elsewhere it simply toggles). The chevron turns along. */
.nav summary { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-3) var(--s-5); margin-bottom: var(--s-1); border-radius: var(--r-sm); color: var(--text); cursor: pointer; list-style: none; user-select: none; transition: background .15s ease, color .15s ease, transform 160ms var(--ease-out); }
.nav summary::-webkit-details-marker { display: none; }
.nav summary .icon { color: var(--icon-muted); }
.nav summary:hover { background: var(--hover); }
.nav summary:active { transform: scale(.98); }
.nav details.current > summary { color: var(--text-strong); }
.nav details.current > summary > .icon { color: var(--accent); }
.nav .chev { display: inline-flex; color: var(--faint); transition: transform 240ms var(--ease-out); }
.nav .chev .icon { color: inherit; }
.nav details[open] > summary .chev { transform: rotate(90deg); }
.sub-items { margin: 0 0 var(--s-2) var(--s-6); padding-left: var(--s-4); box-shadow: inset 1px 0 var(--border); }
.nav details::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size 260ms var(--ease-drawer), opacity 160ms ease, content-visibility 260ms allow-discrete; }
.nav details[open]::details-content { block-size: auto; opacity: 1; transition: block-size 320ms var(--ease-drawer), opacity 240ms var(--ease-out) 40ms, content-visibility 320ms allow-discrete; }
:root { interpolate-size: allow-keywords; }
/* Always visible: sticks to the bottom of the sidebar and the nav scrolls underneath it. */
/* Mobile menu (see the 900px block): on desktop the wrapper is invisible and the toggle hidden. */
.sidebar-menu { display: contents; }
.menu-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); cursor: pointer; }
.menu-toggle:hover { background: var(--hover); }
.menu-toggle .icon { color: inherit; }
.menu-toggle .icon + .icon, .sidebar.menu-open .menu-toggle .icon:first-child { display: none; }
.sidebar.menu-open .menu-toggle .icon + .icon { display: inline-block; }
.sidebar-footer { position: sticky; bottom: -16px; margin: auto -10px -16px; padding: var(--s-5) var(--s-7) var(--s-6); background: var(--sidebar); border-top: 1px solid var(--border); z-index: 1; font-size: var(--fs-sm); color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); }
.sidebar-footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: var(--s-2); border-radius: var(--r-sm); }
.sidebar-footer button:hover { color: var(--text-strong); background: var(--hover); }

/* The content keeps a max width of 1416px and is centred in wide windows. */
main { padding: var(--s-8) max(32px, calc((100% - 1416px) / 2)) 64px; min-width: 0; margin: var(--s-4) var(--s-4) var(--s-4) 0; background: var(--bg); border: 1px solid var(--main-border); box-shadow: var(--main-shadow); border-radius: var(--r-lg); min-height: calc(100vh - 16px); }
/* Page header (macros.html page_header): the title on the left, the page's actions on the right with
   the one primary (create) action right-most. The title takes the row on phones, so the actions
   wrap below it instead of squeezing it. */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: var(--s-5) var(--s-6); margin-bottom: var(--s-7); flex-wrap: wrap; min-height: 40px; }
.topbar-main { flex: 1 1 320px; min-width: 0; }
.topbar-main h1 { margin: 0; overflow-wrap: anywhere; }
.topbar-main .subtitle { margin-top: var(--s-2); }
.topbar-main h1.title-code { font-family: var(--mono); font-size: var(--fs-md); font-weight: 600; line-height: 1.4; letter-spacing: 0; font-stretch: normal; font-variation-settings: normal; word-break: break-word; }
.issue-message { margin-top: var(--s-2); font-size: var(--fs-md); overflow-wrap: anywhere; color: var(--text); }
.issue-badges { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.topbar-actions { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.topbar-actions > form { margin: 0; }
/* Filters: one row directly under the header. Tabs on the left; search, selects and the range picker
   on the right (the range picker always right-most). */
.toolbar-end { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; margin-left: auto; }
.toolbar .search input[type=search] { width: 280px; }
.toolbar .ranges, .toolbar .tabs { padding: var(--s-2); }
.toolbar .tabs a, .toolbar .ranges a { line-height: 20px; }
.crumbs { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s-2); display: flex; gap: var(--s-3); align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text-strong); }
.crumbs .sep { color: var(--faint); }
.subtitle { color: var(--muted); }

/* Segmented controls (range picker, tabs): a soft track with a raised pill behind the active item. */
.ranges, .tabs { display: inline-flex; align-items: center; gap: var(--s-1); padding: var(--s-2); background: var(--panel-3); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--border); }
.ranges a, .tabs a { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-5); font-size: var(--fs-base); font-weight: 500; line-height: 20px; color: var(--muted); border-radius: var(--r-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranges a { padding: var(--s-2) var(--s-5); font-size: var(--fs-sm); }
.ranges a:hover, .tabs a:hover { color: var(--text-strong); }
.ranges a.active, .tabs a.active { color: var(--text-strong); }
.pill { display: none; }
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ranges a.active .pill, .tabs a.active .pill { display: block; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--seg-active); box-shadow: var(--shadow-seg); }
.tabs a.active .count { color: var(--accent); background: var(--accent-soft); }
.card.flush > .tabs { margin: var(--s-5) 0 var(--s-1) var(--s-7); }

/* Toolbar: segmented control on the left, filters and search on the right. */
.toolbar { display: flex; gap: var(--s-5); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-5); }
.search-form { display: flex; flex-wrap: wrap; gap: var(--s-5); align-items: center; min-width: 0; max-width: 100%; }
.search, .select { position: relative; display: inline-flex; align-items: center; }
.search .icon, .select .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--icon-muted); pointer-events: none; }
.select .icon { left: 12px; }
.search input[type=search], .select select { height: 34px; border: 0; border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); font-weight: 450; transition: box-shadow .15s ease; }
.search input[type=search] { padding: 0 34px 0 35px; width: 320px; }
.search input[type=search]:focus, .select select:focus { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd { position: absolute; right: 9px; font: 500 var(--fs-xs) var(--mono); color: var(--faint); border-radius: var(--r-xs); padding: 0 var(--s-2); line-height: 18px; box-shadow: inset 0 0 0 1px var(--border-strong); pointer-events: none; transition: opacity .15s ease; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { opacity: 0; }
.select, .select select, .toolbar select { max-width: 100%; }
.select select[name] { appearance: none; padding: 0 30px 0 31px; cursor: pointer; color: var(--text-strong); background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

/* Panels */
.card { background: var(--panel); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s-7) var(--s-7); margin-bottom: var(--s-6); min-width: 0; }
.card.flush { padding: 0; overflow-x: auto; }
.card.flush > h2 { padding: var(--s-6) var(--s-7) var(--s-2); }
.grid { display: grid; gap: var(--s-6); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
/* Stat rows: one row of equal tiles when they fit, otherwise even rows (never one tile alone). */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-5); margin-bottom: var(--s-6); }
.stats:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1339px) { .stats:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .stats:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .stats, .stats:has(> :nth-child(6):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; } }   /* never an orphan tile */
.stat { background: var(--panel); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s-5) var(--s-6); min-width: 0; }
.stat .label { font-size: var(--fs-sm); color: var(--muted); }
.stat .value { font-family: var(--display); font-size: var(--fs-lg); font-weight: var(--fw-display-small); font-stretch: var(--display-normal); font-variation-settings: "opsz" var(--display-opsz-small); line-height: 1.3; color: var(--text-strong); margin-top: var(--s-2); font-variant-numeric: lining-nums; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Proportional digits: the display face's tabular figures have a slashed zero, which reads as code
   in a headline number. Each card holds one value, so there is no column to align. */
.stat .value.bad { color: var(--bad-text); }
.stat .value.text { font-family: var(--sans); font-size: var(--fs-md); font-stretch: normal; font-variation-settings: normal; letter-spacing: -.01em; }
.stat .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 1px; }
/* Sparkline along the bottom edge of a stat card. The line keeps a crisp 1.5px stroke however the card
   stretches; the fill fades out downwards. Drawn in left to right on load. */
.stat { position: relative; overflow: hidden; }
.stat:has(.sparkline) { padding-bottom: 46px; }
.sparkline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40px; overflow: visible; --tone: var(--c-ok);
  animation: draw 900ms var(--ease-out) 150ms backwards; }
.sparkline.bad { --tone: var(--c-bad); }
.sparkline .line { fill: none; stroke: var(--tone); stroke-width: 1.5px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sparkline .area { fill: color-mix(in srgb, var(--tone) 14%, transparent); stroke: none; mask: linear-gradient(#000, transparent); -webkit-mask: linear-gradient(#000, transparent); }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Tables: every row is a small rounded card inset in its panel */
table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
th, td { text-align: left; padding: var(--s-4) var(--s-5); vertical-align: top; }
td { background: var(--row); transition: background .12s; }
th { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); white-space: nowrap; padding-top: var(--s-2); padding-bottom: var(--s-1); }
th a { color: inherit; }
th.sorted, th.sorted a { color: var(--text-strong); }
th.sorted a::after { content: " ↓"; color: var(--accent); }
td:first-child { border-radius: var(--r) 0 0 var(--r); }
td:last-child { border-radius: 0 var(--r) var(--r) 0; }
td:only-child { border-radius: var(--r); }
tbody tr:hover td { background: var(--row-hover); }
.card.flush > table { padding: var(--s-1) var(--s-4) var(--s-3); }
.card > table:not(:first-child) { margin-top: -4px; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.num { font-family: var(--mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
td.label { max-width: 0; width: 50%; min-width: 140px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.row-link { color: var(--text-strong); }
/* The main link of a row covers the whole row, so the entire card is clickable. */
tbody tr { position: relative; }
td.label .row-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
td:not(.label) a { position: relative; z-index: 1; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
/* Empty state (macros.html empty_state): an icon, a title, one line and at most one action. */
.empty-state { padding: 32px 20px; text-align: center; display: grid; justify-items: center; gap: var(--s-3); }
.empty-state > .icon { width: 20px; height: 20px; color: var(--icon-muted); margin-bottom: var(--s-1); }
.empty-state.ok > .icon { color: var(--ok-text); }
.empty-state .es-title { font-weight: 600; color: var(--text-strong); }
.empty-state.neutral .es-title { font-weight: 500; color: var(--muted); }
.empty-state .es-text { margin: 0; max-width: 46ch; color: var(--muted); text-wrap: pretty; }
.empty-state .btn { margin-top: var(--s-3); }
/* An empty line inside a card (account activity, notices): no icon, no action. */
.empty-line { margin: 0; color: var(--muted); }
.card.flush > .empty-line { padding: 0 var(--s-7) var(--s-6); }
.time { font-family: var(--mono); font-size: var(--fs-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 0 var(--s-4); font-size: var(--fs-xs); font-weight: 600; line-height: 19px; border-radius: var(--r-pill); background: var(--panel-3); color: var(--muted); white-space: nowrap; vertical-align: 1px; font-variant-numeric: tabular-nums; }
.badge.ok { color: var(--ok-text); background: var(--ok-soft); }
.badge.warn { color: var(--warn-text); background: var(--warn-soft); }
.badge.bad { color: var(--bad-text); background: var(--bad-soft); }
.badge.accent { color: var(--accent); background: var(--accent-soft); }
.zero { color: var(--faint); }
/* Uptime: the latest checks of a monitor as a strip of small bars, oldest first. */
.beats { display: flex; gap: var(--s-1); align-items: stretch; height: 18px; }
.beats i { width: 4px; border-radius: 2px; background: var(--ok); opacity: .85; }
.beats i.down { background: var(--bad); opacity: 1; }
.beats i:hover { opacity: 1; transform: scaleY(1.15); }
.bad-text { color: var(--bad-text); font-weight: 500; }
.warn-text { color: var(--warn-text); font-weight: 500; }

/* Charts: rounded HTML bars, so corners don't stretch with the plot */
.chart { position: relative; height: 128px; }
.chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid span { position: relative; height: 0; border-top: 1px dashed var(--border); }
.chart-grid span:last-child { border-top-style: solid; border-top-color: var(--border-strong); }
.chart-grid span { font-size: var(--fs-xs); color: var(--faint); font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.chart-grid span:not(:last-child) { padding-top: var(--s-2); }
.chart-bars { position: absolute; inset: 0 34px 0 0; display: flex; align-items: flex-end; }
.chart-bars .col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; border-radius: var(--r-xs); cursor: default; }
.stack { width: 64%; max-width: 22px; min-height: 3px; display: flex; flex-direction: column-reverse; gap: 1.5px; border-radius: var(--r-xs); overflow: hidden; transition: opacity .15s, filter .15s; }
.stack i { display: block; flex-basis: 0; min-height: 1.5px; }
.stack i.ok { background: linear-gradient(to top, var(--c-ok), color-mix(in srgb, var(--c-ok) 70%, var(--c-ok-2))); }
.stack i.warn { background: var(--c-warn); }
.stack i.bad { background: var(--c-bad); }
.chart-bars:hover .col:not(:hover) .stack { opacity: .4; }
.chart-bars .col:hover { background: var(--hover); }
/* Tooltip: only rendered on hover (so it never widens the page) and eased in via @starting-style. */
/* Tooltip (chart bars, deploy markers): only rendered on hover, so it never widens the page. */
.chart-bars .col:hover::after, .deploy-mark:hover::after {
  content: attr(data-tip); display: block; position: absolute; left: 50%; z-index: 5;
  white-space: nowrap; font-size: var(--fs-sm); font-weight: 500; color: var(--text-strong); background: var(--panel); padding: var(--s-2) var(--s-5);
  border-radius: var(--r-sm); box-shadow: var(--shadow-hover); pointer-events: none; transform: translateX(-50%);
}
.chart-bars .col:hover::after {
  bottom: calc(100% + 8px); transform-origin: bottom center;
  transition: opacity 125ms var(--ease-out), transform 125ms var(--ease-out);
  @starting-style { opacity: 0; transform: translateX(-50%) translateY(2px) scale(.97); }
}
.chart-bars .col.tip-l:hover::after { left: 0; transform: none; transform-origin: bottom left; @starting-style { transform: translateY(2px) scale(.97); } }
.chart-bars .col.tip-r:hover::after { left: auto; right: 0; transform: none; transform-origin: bottom right; @starting-style { transform: translateY(2px) scale(.97); } }
/* Deploy markers (deploys.rs): a dashed line at the deploy's moment with a dot on top; hover shows the version. */
.chart-deploys { position: absolute; inset: 0 34px 0 0; pointer-events: none; }
.deploy-mark { position: absolute; top: -5px; bottom: 0; width: 11px; margin-left: -5.5px; pointer-events: auto; z-index: 2; }
.deploy-mark::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; border-left: 1.5px dashed var(--accent); opacity: .65; transition: opacity 125ms var(--ease-out); }
.deploy-mark { background: radial-gradient(circle at 50% 4px, var(--accent) 3px, transparent 3.5px) no-repeat; }
.deploy-mark.many { background: radial-gradient(circle at 50% 4px, var(--accent) 2px, transparent 2.5px, transparent 3px, var(--accent) 3.5px, var(--accent) 4.5px, transparent 5px) no-repeat; }
.deploy-mark:hover::before { opacity: 1; }
.deploy-mark:hover::after {
  bottom: calc(100% + 6px); z-index: 6;
  max-width: min(320px, 80vw); overflow: hidden; text-overflow: ellipsis;
}
.deploy-mark.tip-l:hover::after { left: 0; transform: none; }
.deploy-mark.tip-r:hover::after { left: auto; right: 0; transform: none; }
.chart-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: var(--fs-xs); margin-top: var(--s-4); padding-right: 34px; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: nowrap; min-width: 0; overflow: hidden; white-space: nowrap; gap: var(--s-4); font-size: var(--fs-xs); color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: var(--s-3); background: var(--c-ok); vertical-align: 0; }
.legend span.warn::before { background: var(--c-warn); }
.legend span.bad::before { background: var(--c-bad); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-5); flex-wrap: nowrap; margin-bottom: var(--s-5); }
.chart-head h2 { margin: 0; flex: none; }

/* Forms */
/* One input style: text inputs, selects and textareas. */
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  font: var(--fs-base) var(--sans); color: var(--text-strong); background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: var(--s-4) var(--s-5);
}
input::placeholder { color: var(--faint); }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn, button.btn {
  display: inline-flex; align-items: center; gap: var(--s-3); font: 500 var(--fs-base) var(--sans); padding: var(--s-3) var(--s-5); border-radius: var(--r-sm);
  border: 0; background: var(--panel-3); color: var(--text-strong); cursor: pointer; box-shadow: inset 0 0 0 .5px var(--ring), 0 1px 1px rgba(0, 0, 0, .08); transition: background .12s;
}
.btn:hover { background: var(--btn-hover); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary.danger { background: var(--bad); color: #fff; }
.btn.primary.danger:hover { background: color-mix(in srgb, var(--bad) 88%, #000); }
.btn.danger { color: var(--bad-text); }
.btn.sm { font-size: var(--fs-sm); padding: var(--s-1) var(--s-4); gap: var(--s-2); }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--panel-3); }
form.inline { display: inline; }
.field { margin-bottom: var(--s-6); }
.field label { display: block; font-weight: 500; margin-bottom: var(--s-3); }
.field input { width: 100%; }
.field .help { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-3); }

/* The card sits exactly at the vertical centre: the brand fills the row above it, anything after
   the card (a "Back to log in" link) the equal row below. */
.auth { max-width: 360px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: var(--s-8) var(--s-6); display: grid; grid-template-rows: 1fr auto 1fr; }
.auth > .brand { grid-row: 1; align-self: end; }
.auth > .card { grid-row: 2; margin: 0; }
.auth > :not(.brand, .card) { grid-row: 3; align-self: start; margin: var(--s-6) 0 0; }
.auth .brand { justify-content: center; font-family: var(--display); font-size: var(--fs-lg); font-weight: var(--fw-display); font-stretch: var(--display-mid); letter-spacing: -.01em; font-variation-settings: "opsz" var(--display-opsz); padding-bottom: var(--s-8); }
.auth .brand { gap: var(--s-4); }
.auth .brand .icon { width: 20px; height: 20px; color: var(--text-strong); }
.auth h2 { font-size: var(--fs-md); }
/* ---- Components (macros.html) ---- */
/* Alert: one inline message for errors, results and warnings. `.row` puts a button at the end. */
.alert { padding: var(--s-5) var(--s-6); border-radius: var(--r); margin-bottom: var(--s-6); background: var(--hover); color: var(--text); }
.alert.ok { background: var(--ok-soft); color: var(--ok-text); }
.alert.warn { background: var(--warn-soft); color: var(--text-strong); }
.alert.bad { background: var(--bad-soft); color: var(--bad-text); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.alert.row { display: flex; align-items: center; gap: var(--s-5); justify-content: space-between; }
.alert.row .btn { flex-shrink: 0; }
@media (max-width: 600px) { .alert.row { flex-direction: column; align-items: flex-start; } }
[aria-invalid="true"] { border-color: var(--bad); }
.help.field-error { color: var(--bad-text); }
/* Counter: a small number in a pill (tabs, chips, the sidebar); .bad for things that need attention. */
.count { display: inline-block; min-width: 18px; padding: 0 var(--s-3); font-size: var(--fs-xs); font-weight: 600; line-height: 17px; text-align: center; color: var(--faint); background: var(--hover); border-radius: var(--r-pill); font-variant-numeric: tabular-nums; }
.count.bad { color: #fff; background: var(--bad); }
/* Chip: a toggleable filter (execution timeline types, crawl result kinds). */
.chip { display: inline-flex; align-items: center; gap: var(--s-3); font: 500 var(--fs-sm) var(--sans); padding: var(--s-2) var(--s-3) var(--s-2) var(--s-5); border-radius: var(--r-pill); border: 0; background: var(--panel-2); color: var(--muted); cursor: pointer; box-shadow: inset 0 0 0 1px var(--border); text-decoration: none; }
.chip:hover { color: var(--text-strong); }
.chip.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.chip.on .count { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chips { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-5); }
.card.flush > .chips { padding: 0 var(--s-7); }
/* Card head: the title with a badge or small action on the right. */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; margin-bottom: var(--s-5); }
.card-head h2 { margin: 0; }
/* The intro line under a card title. */
.card-intro { color: var(--muted); margin: -4px 0 var(--s-5); max-width: 72ch; }
/* A row of buttons (danger zone, card actions). */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.actions > form { margin: 0; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-4) var(--s-7); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.codebox { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-5) var(--s-5); overflow-x: auto; color: var(--text-strong); }

/* Stack trace */
.frames { display: flex; flex-direction: column; gap: var(--s-2); }
.frame { background: var(--row); border-radius: var(--r); overflow: hidden; }
.frame summary { padding: var(--s-4) var(--s-5); cursor: pointer; display: flex; gap: var(--s-5); align-items: baseline; list-style: none; }
.frame summary::-webkit-details-marker { display: none; }
.frame summary:hover { background: var(--row-hover); }
.frame[open] summary { background: var(--row-hover); }
.frame .idx { font: var(--fs-xs) var(--mono); color: var(--faint); min-width: 18px; font-variant-numeric: tabular-nums; }
.frame.vendor summary { opacity: .5; }
.frame summary .file { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-strong); word-break: break-all; }
.frame summary .fn { font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); word-break: break-all; margin-top: var(--s-1); }
.source { font: var(--fs-sm)/1.7 var(--mono); background: var(--code-bg); overflow-x: auto; padding: var(--s-3) 0; }
.source div { white-space: pre; padding: 0 var(--s-5); }
.source div.hl { background: var(--hl); box-shadow: inset 2px 0 var(--bad); color: var(--text-strong); }
.source .ln { display: inline-block; width: 44px; color: var(--faint); user-select: none; }

/* Execution timeline */
.stages { display: flex; height: 10px; border-radius: var(--r-xs); overflow: hidden; margin: var(--s-2) 0 var(--s-5); background: var(--panel-3); gap: var(--s-1); }
.stages div { min-width: 2px; height: 100%; }
.stage-0 { background: #8e8e93; } .stage-1 { background: #5e5ce6; } .stage-2 { background: #0a84ff; } .stage-3 { background: #64d2ff; }
.stage-4 { background: #30d158; } .stage-5 { background: #ffd60a; } .stage-6 { background: #ff9f0a; }
.stage-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); font-size: var(--fs-sm); color: var(--muted); }
.stage-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: var(--s-3); }
.timeline td.bar { width: 28%; min-width: 160px; }
.tl { position: relative; height: 6px; background: var(--panel-3); border-radius: 3px; margin-top: var(--s-4); }
.tl span { position: absolute; top: 0; height: 100%; border-radius: 3px; background: var(--accent); }
.tl span.exception, .tl span.log-error { background: var(--bad); }
.tl span.query { background: #5e5ce6; }
.tl span.cache-event { background: var(--ok); }
.tl span.outgoing-request { background: var(--warn); }
.tl span.log { background: #8e8e93; }
.type { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }


details.json summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-2); }
details.json summary:hover { color: var(--text-strong); }
details.json .codebox { margin-top: var(--s-3); }
.log-level { font: 600 var(--fs-xs) var(--mono); color: var(--accent); }
.log-level.lvl-error, .log-level.lvl-critical, .log-level.lvl-alert, .log-level.lvl-emergency { color: var(--bad); }
.log-level.lvl-warning { color: var(--warn); }
.log-level.lvl-debug { color: var(--muted); }
.log-msg { font: var(--fs-sm) var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text-strong); }

.snippet { position: relative; }
.copy { position: absolute; top: 8px; right: 8px; }
/* Keep snippet text clear of the Copy button (long first lines wrap instead of running under it). */
.snippet > pre { padding-right: 76px; }

/* Live refresh (app.js): refreshed content skips the entrance animations. */
main[data-refreshed] > *, main[data-refreshed] .stack, main[data-refreshed] .sparkline { animation: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  /* The sidebar becomes one sticky bar: switcher, search (icon only) and the menu button. The menu
     opens the nav and the account row below it. Without JS the nav simply stays open. */
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; max-height: 100dvh; overflow: visible; padding: var(--s-4); flex-flow: row wrap; align-items: center; gap: var(--s-3); }
  .sidebar .switcher summary { min-height: 44px; }
  .nav a, .nav summary { min-height: 44px; }
  .sidebar .switcher { flex: 1; min-width: 0; margin: 0; }
  .sidebar .palette-trigger { width: 44px; height: 44px; margin: 0; padding: 0; justify-content: center; background: none; box-shadow: none; color: var(--text); }
  .sidebar .palette-trigger .icon { color: inherit; }
  .sidebar .palette-trigger:hover { background: var(--hover); }
  .sidebar .palette-trigger .grow, .sidebar .palette-trigger kbd { display: none; }
  .menu-toggle { display: inline-flex; }
  .sidebar-menu { flex: 1 1 100%; overscroll-behavior: contain; display: flex; flex-direction: column; max-height: calc(100dvh - 76px); overflow-y: auto; }
  .js .sidebar:not(.menu-open) .sidebar-menu { display: none; }
  .sidebar-footer { position: static; margin: var(--s-4) 0 0; padding: var(--s-5) var(--s-3) var(--s-2); }
  main { padding: var(--s-6); margin: 0 var(--s-4) var(--s-4); min-height: 0; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .search, .search input { width: 100%; }
  .toolbar-end { margin-left: 0; width: 100%; }
  .toolbar .search, .toolbar .search input[type=search] { flex: 1; width: auto; }
  .toolbar .search-form { flex: 1 1 100%; }
}

/* All-projects overview */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-6); margin-bottom: var(--s-6); }
.project-card { display: flex; flex-direction: column; gap: var(--s-5); background: var(--panel); border: 0; border-radius: var(--r-lg); padding: var(--s-7) var(--s-7); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.project-card:hover { background: var(--card-hover); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.project-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-5); }
.project-name { display: flex; align-items: center; gap: var(--s-4); font-family: var(--display); font-size: var(--fs-md); font-weight: var(--fw-display-small); font-stretch: var(--display-normal); font-variation-settings: "opsz" var(--display-opsz-small); color: var(--text-strong); min-width: 0; letter-spacing: 0; }
.project-name .icon { color: var(--accent); }
.project-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.project-stats .label { font-size: var(--fs-sm); color: var(--muted); }
.project-stats .value { font: 600 var(--fs-md) var(--mono); color: var(--text-strong); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.project-stats .value.bad { color: var(--bad-text); }
.spark { height: 44px; display: flex; align-items: flex-end; gap: 0; padding-bottom: var(--s-3); border-bottom: 1px solid var(--border); }
.spark .col { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.spark .stack { min-height: 2px; border-radius: 3px; gap: 1px; }
.spark .stack i.ok { background: var(--c-ok); opacity: .8; }
.project-waiting { display: flex; flex-direction: column; gap: var(--s-2); flex: 1; justify-content: flex-end; }
.link { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--accent); font-weight: 500; }
.link .icon { color: inherit; }
.project-foot { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.project-foot .small { margin-left: auto; }

/* Account & 2FA */
.footer-user { display: flex; align-items: center; gap: var(--s-3); color: var(--muted); min-width: 0; }
.footer-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-user:hover { color: var(--text-strong); }
/* Every page uses the same centred column; forms and text inside cards keep a readable width. */
.field { max-width: 560px; }
.modal .field { max-width: none; }
.card > p, .card > form > p { max-width: 80ch; }
.setup-2fa { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--s-8); align-items: start; }
.qr { width: 180px; height: 180px; border-radius: var(--r); background: #fff; padding: var(--s-4); image-rendering: pixelated; }
.secret { font: 600 var(--fs-md) var(--mono); letter-spacing: .06em; color: var(--text-strong); user-select: all; }
.code-input { font: 600 var(--fs-lg) var(--mono) !important; letter-spacing: .3em; text-align: center; width: 180px; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: var(--s-3) 28px; font: var(--fs-md) var(--mono); color: var(--text-strong); margin: var(--s-2) 0 var(--s-5); }
@media (max-width: 600px) { .setup-2fa { grid-template-columns: 1fr; } }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row label { margin-bottom: var(--s-3); }

/* Motion (after Emil Kowalski's design-engineering notes): short, ease-out, transform and opacity only. */
.btn, button.btn { transition: background .15s ease, transform 160ms var(--ease-out); }
.btn:active { transform: scale(.97); }
.nav a { transition: background .15s ease, color .15s ease, transform 160ms var(--ease-out); }
.nav a:active { transform: scale(.98); }
.ranges a, .tabs a, .chip, .sidebar-footer button { transition: background .15s ease, color .15s ease, transform 160ms var(--ease-out); }
.ranges a:active, .tabs a:active, .chip:active, .sidebar-footer button:active { transform: scale(.95); }
.project-card { transition: box-shadow .25s ease, transform .25s var(--ease-out); }
.project-card:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) {
  .project-card:hover { transform: translateY(-2px); }
  .project-card:hover:active { transform: translateY(-1px) scale(.99); }
}

/* Page content rises in, slightly staggered. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } }
/* Desktop: the content frame stays put (its rounded corners always visible) and scrolls inside. */
@media (min-width: 901px) {
  .layout { height: 100vh; height: 100dvh; min-height: 0; }
  main { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  main:focus { outline: none; }
}
main > * { animation: rise 360ms var(--ease-out) backwards; }
main > :nth-child(2) { animation-delay: 40ms; }
main > :nth-child(3) { animation-delay: 80ms; }
main > :nth-child(4) { animation-delay: 120ms; }
main > :nth-child(5) { animation-delay: 160ms; }
main > :nth-child(n+6) { animation-delay: 200ms; }
/* Page chrome (title, filters) stays put; only the content below it rises in. */
main > .topbar, main > .toolbar { animation: none; }

/* Chart bars grow from the baseline, sweeping left to right (--p is the bar's position, 0..1). */
@keyframes grow { from { transform: scaleY(0); } }
.stack { transform-origin: bottom; animation: grow 520ms var(--ease-out) backwards; animation-delay: calc(120ms + var(--p, 0) * 280ms); }

/* Opened stack frames and copy feedback. */
.frame[open] .source { animation: fade 200ms var(--ease-out); }
@keyframes pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: none; } }
.copied { animation: pop 320ms var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .switcher-menu { transition: none; }
  main > *, .stack, .copied, .sparkline { animation-name: fade; }
  .nav details::details-content, .nav details[open]::details-content { transition: none; }
  .nav summary:active { transform: none; }
  .btn:active, .nav a:active, .ranges a:active, .tabs a:active, .chip:active, .sidebar-footer button:active,
  .project-card:active, .project-card:hover, .project-card:hover:active { transform: none; }
}


/* ⌘K command palette (static/app.js) */
.palette-trigger { display: flex; align-items: center; gap: var(--s-5); width: 100%; margin: 0 0 var(--s-5); padding: var(--s-3) var(--s-4) var(--s-3) var(--s-5); border: 0; border-radius: var(--r-sm);
  background: var(--sb-field); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; text-align: left;
  transition: background .12s, color .12s, transform 160ms var(--ease-out); }
.palette-trigger:hover { background: var(--active); color: var(--text); }
.palette-trigger:active { transform: scale(.98); }
.palette-trigger .icon { color: var(--icon-muted); }
.palette-trigger .grow { flex: 1; }
kbd { font: 500 var(--fs-xs) var(--sans); color: var(--muted); padding: 1px var(--s-3); border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--border-strong); white-space: nowrap; }
.palette-open, .palette-open body { overflow: hidden; }
.palette-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh var(--s-6) var(--s-6);
  background: var(--backdrop); backdrop-filter: blur(2px); animation: palette-fade 140ms ease-out; }
.palette-backdrop[hidden] { display: none; }
.palette { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg);
  background: var(--panel); box-shadow: var(--shadow-overlay); animation: palette-in 160ms var(--ease-out); }
.palette-head { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-5) var(--s-5); border-bottom: 1px solid var(--border); }
.palette-head input[type=text] { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; padding: var(--s-2) 0; font-size: var(--fs-md); color: var(--text-strong); outline: none; }
.palette-head input[type=text]:focus { box-shadow: none; }
.palette-head input[readonly] { color: var(--muted); }
.palette-list { overflow-y: auto; padding: var(--s-3); min-height: 60px; }
.palette-group { font-size: var(--fs-xs); font-weight: 500; color: var(--faint); padding: var(--s-4) var(--s-5) var(--s-2); }
.palette-item { display: flex; align-items: baseline; gap: var(--s-5); padding: var(--s-4) var(--s-5); border-radius: var(--r-sm); cursor: pointer; color: var(--text); }
.palette-item.active { background: var(--active); color: var(--text-strong); }
.palette-item.danger .palette-title { color: var(--bad); }
.palette-title { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-sub { flex: 1; min-width: 0; color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-kind { margin-left: auto; flex: none; font-size: var(--fs-xs); color: var(--faint); }
.palette-empty, .palette-prompt { padding: var(--s-5) var(--s-5); color: var(--muted); }
.palette-confirm { margin: var(--s-3); padding: var(--s-5) var(--s-5); border-radius: var(--r-sm); background: var(--warn-soft); color: var(--text-strong); }
.palette-confirm.danger { background: var(--bad-soft); }
.palette-secret { padding: var(--s-5); display: grid; gap: var(--s-5); justify-items: start; }
.palette-secret p { margin: 0; color: var(--muted); }
.palette-secret code { display: block; width: 100%; padding: var(--s-5) var(--s-5); font-size: var(--fs-base); word-break: break-all; user-select: all; }
.palette-foot { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }
.palette-foot.error { color: var(--bad); }
@keyframes palette-fade { from { opacity: 0; } }
@keyframes palette-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .palette-backdrop, .palette { animation: none; } }
/* Decorative LED-matrix lighthouse along the bottom of the auth pages (app.js, [data-lighthouse]). */
.lighthouse { color: var(--text-strong); position: fixed; inset: auto 0 0; height: min(280px, 36vh); pointer-events: none; z-index: 0; }
.lighthouse canvas { display: block; }
.auth { position: relative; z-index: 1; }
/* Onboarding: "Connect your app" card (settings, empty overview) and the welcome block on an empty home page. */
.connect-steps { margin: var(--s-4) 0; padding-left: var(--s-7); }
.connect-steps li { margin: 0 0 var(--s-5); }
.connect-steps .codebox { margin-top: var(--s-3); }
.connect-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: -4px 0 var(--s-5); }
.connect-values { align-items: center; margin: var(--s-5) 0 var(--s-2); }
.connect-values .codebox { padding: var(--s-4) 88px var(--s-4) var(--s-5); }
.connect-values .codebox code { word-break: break-all; }
.connect-values .copy { top: 50%; transform: translateY(-50%); }
.welcome { padding: var(--s-4) 0 var(--s-8); max-width: 640px; }
.welcome h1 { margin-bottom: var(--s-4); }
.welcome-steps { margin: var(--s-6) 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--s-5); }
.welcome-steps li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: var(--s-5); row-gap: var(--s-1); }
.welcome-steps li::before { content: counter(step); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: var(--fs-base); }
@media (max-width: 600px) { .connect-values { grid-template-columns: minmax(0, 1fr); } }

/* Auth pages (login heading with an invited address, invite page's "new here" section) */
.auth h2 { overflow-wrap: anywhere; }
/* The legal notice under buttons that create an account (macros.html legal_notice) */
.legal-notice { margin: var(--s-5) 0 0; text-align: center; line-height: 1.5; text-wrap: pretty; }

/* Teams pages (team.html, teams.html): emails that wrap, the roles help line, row actions, and
   tables that stack into one block per row on phones. Also the "in team" label of the new-project form. */
.email { overflow-wrap: anywhere; }
/* Text in a flush card (no padding of its own): lined up with its heading. */
.card.flush > .card-intro, .card.flush > .card-foot { padding: 0 var(--s-7); }
.card.flush > .card-foot { margin: var(--s-2) 0 var(--s-6); }
.set-password { margin: var(--s-2) 0 var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--border); }
.set-password h3 { margin-top: 0; }
td.row-actions { text-align: right; }
.inline-label { align-self: center; font-size: var(--fs-base); }
@media (max-width: 600px) {
  table.stack-rows, table.stack-rows tbody, table.stack-rows tr, table.stack-rows td { display: block; }
  table.stack-rows thead { display: none; }
  table.stack-rows tr { background: var(--row); border-radius: var(--r); margin-bottom: var(--s-3); padding: var(--s-3) 0; }
  table.stack-rows td, table.stack-rows td:first-child, table.stack-rows td:last-child { background: none; border-radius: 0; padding: var(--s-2) var(--s-5); }
  table.stack-rows td.label { max-width: none; width: auto; min-width: 0; }
  table.stack-rows td.num, table.stack-rows td.row-actions { text-align: left; }
  table.stack-rows td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-family: var(--sans); }
  .hide-sm { display: none; }
}

/* Billing: usage meters and the plan cards */
.meter-row { margin-bottom: var(--s-5); }
.meter-head { display: flex; justify-content: space-between; gap: var(--s-5); font-size: var(--fs-base); margin-bottom: var(--s-2); font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: var(--r-pill); background: var(--panel-3); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }
.meter-note { font-size: var(--fs-base); color: var(--bad); margin-top: var(--s-2); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-5); margin-bottom: var(--s-5); }
.plan { border-radius: var(--r); background: var(--panel-2); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.plan.current { box-shadow: inset 0 0 0 1.5px var(--accent); }
.plan-name { font-weight: 600; color: var(--text-strong); }
.plan-price { font-family: var(--display); font-size: var(--fs-lg); font-weight: var(--fw-display); font-stretch: var(--display-wide); font-variation-settings: "opsz" var(--display-opsz); font-variant-numeric: lining-nums; color: var(--text-strong); }
.plan-price .muted { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 400; font-stretch: normal; font-variation-settings: normal; }
.plan ul { margin: var(--s-2) 0 var(--s-4); padding-left: var(--s-6); font-size: var(--fs-base); color: var(--muted); flex: 1; }
.plan form { margin: 0; }
.plan-hint { margin: 0; text-align: center; }
/* Billing: subscription management (billing.html) */
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 var(--s-5); }
.payment-form { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--border); }
.payment-form .error { margin: var(--s-5) 0 0; }
.billing-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5) var(--s-6); flex-wrap: wrap; margin: 0 0 var(--s-6); padding: 0 var(--s-2); }
#embedded-checkout { min-height: 120px; }
#billing [hidden] { display: none; }
#billing [tabindex="-1"]:focus { outline: none; }
#billing .error[tabindex="-1"]:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
/* A stacked invoice row (phones): "Total" in the text font, the amount in mono. */
@media (max-width: 600px) { #billing table.stack-rows td.num[data-label]::before { font-family: var(--sans); font-size: var(--fs-base); } }

/* OAuth consent (oauth_consent.html) */
.auth.consent { max-width: 420px; }
.consent-teams { margin: 0 0 var(--s-6); padding-left: var(--s-7); font-size: var(--fs-base); overflow-wrap: anywhere; }
.consent-access { border: 0; padding: 0; margin: 0 0 var(--s-5); display: grid; gap: var(--s-4); }
.consent-access legend { padding: 0; margin-bottom: var(--s-3); }
.choice { display: flex; gap: var(--s-5); align-items: flex-start; padding: var(--s-5) var(--s-5); border: 1px solid var(--border-strong); border-radius: var(--r); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); }
.choice input { margin-top: var(--s-2); }
.consent-buttons { display: flex; flex-direction: row-reverse; gap: var(--s-4); justify-content: flex-start; }
/* Claiming an agent workspace (claim.html): the consent card, with a warning tone and the code. */
.claim-urls span { display: block; font-family: var(--mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.claim-as { margin: 0 0 var(--s-5); }
.claim-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.claim-code { font-family: var(--mono); font-size: var(--fs-xl); letter-spacing: .12em; text-align: center; color: var(--text-strong); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r); padding: var(--s-5); margin: var(--s-4) 0; user-select: all; }
.claim-actions { display: flex; flex-wrap: wrap; gap: var(--s-4); margin: 0 0 var(--s-4); }
.claim-disconnect { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; margin: var(--s-6) 0 var(--s-5); }
.claim-reject { margin-top: var(--s-6); }
.claim-reject summary { cursor: pointer; color: var(--muted); }
.claim-reject form { display: grid; gap: var(--s-4); margin-top: var(--s-4); }
.claim code.secret { font-family: var(--mono); font-size: var(--fs-sm); overflow-wrap: anywhere; user-select: all; }
/* Public status page (status_page.html, status_missing.html): standalone, no app chrome, and the
   customer's page, so state colours lead, not the accent. Text uses the strong/plain text colours
   (WCAG AA in both themes); the state colours go on dots, bars and icons. A bar is one UTC day of
   a component; its tooltip (CSS, from data-tip) shows on hover and on tap (status.js makes iOS
   apply :hover on a tap), and the days with downtime are also listed as text. The oldest bars (.old) are hidden on phones. */
.sp-body { background: var(--bg); }
@media (prefers-color-scheme: light) {
  .sp-body { --muted: rgba(60, 60, 67, .78); }
}
.sp { max-width: 720px; margin: 0 auto; padding: 56px var(--s-6) 40px; }
.sp h2, .sp h3 { margin: 0; overflow-wrap: anywhere; }
.sp-head { margin-bottom: var(--s-8); }
.sp-head h1 { font-family: var(--display); font-size: var(--fs-xl); font-weight: var(--fw-display); font-stretch: var(--display-mid); font-variation-settings: "opsz" var(--display-opsz); letter-spacing: -.01em; color: var(--text-strong); margin: 0; overflow-wrap: anywhere; }
.sp-desc { color: var(--muted); margin: var(--s-3) 0 0; overflow-wrap: anywhere; }

.sp-hero { --state: var(--icon-muted); display: flex; align-items: center; gap: var(--s-6); padding: var(--s-7) var(--s-7); margin-bottom: var(--s-6); border-radius: var(--r-lg); background: var(--panel-3); }
.sp-hero.operational { --state: var(--ok); background: var(--ok-soft); }
.sp-hero.partial_outage { --state: var(--warn); background: var(--warn-soft); }
.sp-hero.major_outage { --state: var(--bad); background: var(--bad-soft); }
.sp-hero.maintenance { --state: var(--accent); background: var(--accent-soft); }
.sp-hero-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--state); color: #fff; }
.sp-hero-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sp-hero h2 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; line-height: 1.25; color: var(--text-strong); }
.sp-hero p { margin: var(--s-1) 0 0; color: var(--muted); }

.sp-notice { padding: var(--s-6) var(--s-7); margin-bottom: var(--s-6); border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow), inset 3px 0 0 var(--bad); }
.sp-notice.maintenance { box-shadow: var(--shadow), inset 3px 0 0 var(--accent); }
.sp-kicker { margin: 0 0 var(--s-2); font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.sp-kicker span { color: var(--bad-text); }
.maintenance .sp-kicker span { color: var(--accent-text); }
.sp-notice h2, .sp-past h3 { font-size: var(--fs-md); font-weight: 600; color: var(--text-strong); }
.sp-window { margin: var(--s-2) 0 0; font-weight: 500; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.sp-text { margin: var(--s-3) 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.sp-meta { margin: var(--s-4) 0 0; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-meta time, .sp-nowrap { white-space: nowrap; }

.sp-card { padding: 0 var(--s-7); margin-bottom: var(--s-6); border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow); }
.sp-component { padding: var(--s-7) 0; }
.sp-component + .sp-component { border-top: 1px solid var(--border); }
.sp-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-5); margin-bottom: var(--s-5); }
.sp-name { font-size: inherit; font-weight: 500; color: var(--text-strong); min-width: 0; }
.sp-state { display: inline-flex; align-items: center; gap: var(--s-3); font-size: var(--fs-base); white-space: nowrap; color: var(--muted); }
.sp-state.outage { color: var(--bad-text); font-weight: 500; }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--icon-muted); }
.sp-state.operational .sp-dot { background: var(--ok); }
.sp-state.outage .sp-dot { background: var(--bad); }
.sp-bars { display: flex; gap: 2px; height: 32px; }
.sp-bars i { position: relative; flex: 1; min-width: 0; border-radius: 2px; background: var(--panel-3); transition: opacity .15s; }
.sp-bars i.up { background: var(--ok); }
.sp-bars i.degraded { background: var(--warn); }
.sp-bars i.down { background: var(--bad); }
.sp-bars:hover i { opacity: .55; }
.sp-bars i:hover { opacity: 1; }
.sp-bars i::after { content: attr(data-tip); position: absolute; z-index: 2; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 2px); width: max-content; max-width: 240px; padding: var(--s-3) var(--s-5); border-radius: var(--r-sm); background: var(--menu-bg); box-shadow: var(--menu-shadow); color: #f5f5f7; font-size: var(--fs-sm); font-style: normal; line-height: 1.45; white-space: pre-line; font-variant-numeric: tabular-nums; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s, transform .12s var(--ease-out), visibility .12s; }
.sp-bars i:hover::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
/* Near the edges the tooltip opens inwards. */
.sp-bars i:nth-child(-n+8)::after { left: 0; transform: translate(0, 2px); }
.sp-bars i:nth-last-child(-n+8)::after { left: auto; right: 0; transform: translate(0, 2px); }
.sp-bars i:nth-child(-n+8):hover::after, .sp-bars i:nth-last-child(-n+8):hover::after { transform: none; }
.sp-axis { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-narrow { display: none; }
.sp-days { margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--muted); }
.sp-days summary { cursor: pointer; width: fit-content; }
.sp-days summary:hover { color: var(--text-strong); }
.sp-days ul { margin: var(--s-3) 0 0; padding-left: var(--s-7); font-variant-numeric: tabular-nums; }
.sp-note { margin: 0; font-size: var(--fs-base); color: var(--muted); }
.sp-empty { color: var(--muted); text-align: center; padding: var(--s-8) 0; margin: 0; }

.sp-history { margin-top: 40px; }
.sp-history > h2 { font-size: var(--fs-md); font-weight: 600; color: var(--text-strong); margin-bottom: var(--s-2); }
.sp-past { padding: var(--s-6) 0; }
.sp-past + .sp-past { border-top: 1px solid var(--border); }
.sp-past .sp-meta { margin-top: var(--s-3); }

.sp-foot { display: flex; justify-content: space-between; gap: var(--s-4) var(--s-6); flex-wrap: wrap; margin-top: 40px; padding-top: var(--s-6); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }
.sp-foot a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.sp-foot a:hover { color: var(--text-strong); text-decoration-color: currentColor; }
.sp-preview { position: sticky; top: 0; z-index: 3; padding: var(--s-5) var(--s-6); text-align: center; font-size: var(--fs-base); background: var(--accent-soft); color: var(--text-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--border); }
.sp-preview a { color: var(--accent-text); font-weight: 500; }
.sp-missing { padding-top: 96px; }
.sp-missing h1 { font-family: var(--display); font-size: var(--fs-lg); font-weight: var(--fw-display); font-stretch: var(--display-mid); font-variation-settings: "opsz" var(--display-opsz); letter-spacing: -.01em; color: var(--text-strong); margin: 0 0 var(--s-4); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .sp { padding-top: 32px; }
  .sp-head { margin-bottom: var(--s-7); }
  .sp-head h1 { font-size: var(--fs-lg); }
  .sp-hero { gap: var(--s-5); padding: var(--s-6) var(--s-6); }
  .sp-hero h2 { font-size: 18px; }
  .sp-card, .sp-notice { padding-left: var(--s-6); padding-right: var(--s-6); }
  .sp-bars { gap: 3px; height: 28px; }
  .sp-bars i.old { display: none; }
  /* The first shown bar after the hidden ones also opens inwards. */
  .sp-bars i.old + i:not(.old)::after, .sp-bars i.old + i:not(.old) + i::after, .sp-bars i.old + i:not(.old) + i + i::after { left: 0; transform: translate(0, 2px); }
  .sp-bars i.old + i:not(.old):hover::after, .sp-bars i.old + i:not(.old) + i:hover::after, .sp-bars i.old + i:not(.old) + i + i:hover::after { transform: none; }
  .sp-wide { display: none; }
  .sp-narrow { display: inline; }
  .sp-missing { padding-top: 48px; }
}
@media (hover: none) {
  .sp-bars:hover i { opacity: 1; }
  .sp-bars i:hover { opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-bars i, .sp-bars i::after { transition: none; }
}
@media print {
  .sp-body { background: #fff; }
  .sp-preview, .sp-bars i::after { display: none; }
  .sp { padding: 0; max-width: none; }
  .sp-hero, .sp-notice, .sp-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .sp-component, .sp-past { break-inside: avoid; }
  .sp-bars, .sp-dot, .sp-hero-icon { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Status page editor (status_page_edit.html). */
.sp-components input[type=text] { width: 100%; min-width: 120px; }
.sp-components input.sp-order { width: 56px; min-width: 0; text-align: right; font-family: var(--sans); }
.sp-components label .truncate { max-width: 260px; }
.sp-order-cell { white-space: nowrap; }
.sp-move { display: inline-flex; gap: var(--s-2); }
.sp-move .btn { width: 30px; padding: 0; justify-content: center; }
[data-reorder].js .sp-order { display: none; }
.sp-cell-label { display: none; font-family: var(--sans); }
.sp-order-cell { font-family: var(--sans); }
.sp-save { margin: -4px 0 var(--s-6); gap: var(--s-4); }
.sp-edit-notice { padding: var(--s-5) 0; border-top: 1px solid var(--border); }
.sp-edit-notice-head { display: flex; gap: var(--s-4); align-items: center; flex-wrap: wrap; }
.sp-resolve { margin-left: auto; }
.sp-edit-body { margin: var(--s-2) 0; white-space: pre-line; color: var(--muted); overflow-wrap: anywhere; }
.sp-edit-notice details summary { cursor: pointer; color: var(--accent); margin-top: var(--s-2); width: fit-content; }
.sp-notice-form { margin: var(--s-5) 0; }
textarea.origins { font-family: var(--mono); }
/* Public contact form (contact.html): a wider auth card with a message box. */
.auth.contact { max-width: 480px; }
/* 16px text on touch screens: iOS zooms into smaller fields on focus. */
@media (pointer: coarse) { .contact input, .contact select, .contact textarea { font-size: var(--fs-md); } .contact .btn { min-height: 44px; } }
.sp-notice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-5); }
.sp-notice-grid select, .sp-notice-grid input { width: 100%; }
.sp-notice-danger { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); margin: var(--s-6) 0 var(--s-3); padding-top: var(--s-5); border-top: 1px dashed var(--border-strong); }
@media (max-width: 600px) {
  table.sp-components .sp-cell-label { display: block; font-size: var(--fs-sm); color: var(--muted); margin: var(--s-2) 0 var(--s-2); }
  table.sp-components td.sp-order-cell { display: flex; align-items: center; gap: var(--s-4); }
  table.sp-components td.sp-order-cell .sp-cell-label { margin: 0; }
  .sp-components label .truncate { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .sp-notice-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Uptime monitor page (monitor.html, host_checks.html) and list (uptime.html). */
/* A heading between cards (monitor page: Health, Settings). */
h2.section { margin: var(--s-8) 0 var(--s-5); }
/* A stat that links somewhere (the health row): label with a badge, a two-line text value. */
a.stat { display: block; color: var(--text); transition: box-shadow .15s ease; }
a.stat:hover { box-shadow: var(--shadow-hover); }
.stat .label:has(.badge) { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.stat .line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-top: var(--s-2); overflow: hidden; color: var(--text-strong); overflow-wrap: anywhere; }
.name-row { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.name-row > .truncate { min-width: 0; }
.name-row > .badges { display: flex; gap: var(--s-2); flex-shrink: 0; }
.name-row > .badges:empty { display: none; }
label.check { display: flex; gap: var(--s-4); align-items: center; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.field.indent { margin-left: var(--s-8); }
.field.indent label.check:has(input:disabled) { color: var(--muted); }
.table-foot { padding: var(--s-2) var(--s-7) var(--s-5); }
details.records summary { cursor: pointer; color: var(--accent); margin-bottom: var(--s-4); }
.dns-table td { word-break: break-all; }

/* ---- Site crawl (templates/crawl.html, crawl_card.html) ---- */
.crawl-state { margin: var(--s-5) 0 0; }
.crawl-limit { display: block; }
.crawl-table { table-layout: fixed; }
.crawl-table tr.crawl-group td { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--panel-2); padding-top: var(--s-3); padding-bottom: var(--s-3); }
.crawl-ignored { margin: var(--s-5) 0 var(--s-6); }
.crawl-ignored summary { cursor: pointer; color: var(--muted); font-size: var(--fs-base); margin-bottom: var(--s-4); }
.crawl-code { display: inline-block; text-align: left; margin: var(--s-4) 0 0; padding: var(--s-4) var(--s-5); background: var(--panel-2); border-radius: var(--r); font: var(--fs-sm) var(--mono); color: var(--text); }
.crawl-failed strong { font-weight: 500; color: var(--text-strong); }
.crawl-start { display: flex; gap: var(--s-4); }
.crawl-start input { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .crawl-table colgroup { display: none; }
  .crawl-table { table-layout: auto; }
  .crawl-table th:nth-child(3), .crawl-table td:nth-child(3):not([colspan]) { display: none; }
}

/* Dialogs: the confirmation (static/app.js askConfirm, used instead of window.confirm) and the create
   dialogs (macros.html modal). One surface, backdrop and entrance. */
.confirm-dialog, .modal { width: min(420px, calc(100% - 32px)); padding: var(--s-7); border: 0; border-radius: var(--r-lg);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-overlay); }
.modal { width: min(520px, calc(100% - 32px)); padding: 0; max-height: calc(100dvh - 48px); overflow-y: auto; }
.confirm-dialog::backdrop, .modal::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
.confirm-dialog[open], .modal[open] { animation: palette-in 160ms var(--ease-out); }
.confirm-dialog .confirm-text { margin: 0 0 var(--s-7); line-height: 1.5; white-space: pre-line; }
.confirm-dialog .confirm-actions, .modal-actions { display: flex; justify-content: flex-end; gap: var(--s-4); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); padding: var(--s-6) var(--s-7) 0; }
.modal-head h2 { margin: 0; font-size: var(--fs-md); }
.modal-close { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: -6px; border-radius: var(--r-sm); color: var(--icon-muted); }
.modal-close:hover { background: var(--hover); color: var(--text-strong); }
.modal-body { padding: var(--s-6) var(--s-7) var(--s-7); }
.modal-body > form > .alert:first-child { margin-bottom: var(--s-6); }
.modal .field input, .modal .field select, .modal .field textarea { width: 100%; }
.modal-actions { margin-top: var(--s-7); }
.modal-body .card-intro { margin-top: 0; }
/* Without JS, ?new=id#id (or a failed submit) shows the dialog as a card at the top of the page. */
html:not(.js) dialog.modal:target, html:not(.js) dialog.modal[data-open] { display: block; position: static; width: auto; max-width: 520px; margin: 0 0 var(--s-6); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .confirm-dialog[open], .modal[open] { animation: none; } }
/* The add-channel dialog shows only the chosen kind's help; a notice's window only for maintenance. */
.kind-help [data-kind] { display: none; }
.channel-form:has(#kind option[value=slack]:checked) [data-kind=slack],
.channel-form:has(#kind option[value=discord]:checked) [data-kind=discord],
.channel-form:has(#kind option[value=teams]:checked) [data-kind=teams],
.channel-form:has(#kind option[value=webhook]:checked) [data-kind=webhook] { display: inline; }
.notice-form:not(:has(select[name=kind] option[value=maintenance]:checked)) .window-fields { display: none; }

/* Schedule health (schedules.html) */
.sched td.label { width: 50%; min-width: 200px; }
.sched td.time { white-space: normal; min-width: 96px; }
.sched .task-name { overflow-wrap: anywhere; white-space: normal; }
.sched .task-controls { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-3); }
.sched .task-controls select { font-size: var(--fs-sm); padding: var(--s-1) var(--s-4); }
.sched .unknown-why { white-space: normal; max-width: 46ch; }
/* Deploys (deploys.html) */
.deploys td.label { width: 40%; min-width: 180px; }
.deploys .version { overflow-wrap: anywhere; white-space: normal; }
.deploys .deploy-del { position: relative; z-index: 1; }
.deploys tr:target td { background: var(--hover); }
/* Labels shown only in stacked (phone) rows, and cells hidden there. */
.m-label { display: none; }
@media (max-width: 600px) {
  .m-label { display: inline; }
  .d-only, .m-empty { display: none; }
  .sched td.time { white-space: normal; }
  .stats.sched-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Small utilities, instead of inline styles. */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: var(--s-4); }
.mt-3 { margin-top: var(--s-6); }
.mb-3 { margin-bottom: var(--s-6); }
.center { text-align: center; }
.d-block { display: block; }
.break { word-break: break-word; }
.w-sm { width: 190px; max-width: 100%; }
.w-md { width: 240px; max-width: 100%; }
.grow-input { flex: 1; max-width: 420px; }
form.toolbar { margin-bottom: 0; }

/* site/demo only (src/web/site_demo.rs): links outside the demo are switched off. */
[aria-disabled="true"] { cursor: default; }
