/* Self-hosted variable fonts (SIL Open Font License), served from /fonts. */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

: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: "Bricolage Grotesque", var(--sans);
  /* 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);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  color-scheme: dark;
}

/* Light mode follows the system theme. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f7;
    --sidebar: #ececf0;
    --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);
    color-scheme: light;
  }
  /* The sidebar keeps its dark look in light mode. */
  .sidebar {
    --sidebar: #1d1d1f;
    --panel-2: #2a2a2e;
    --hover: rgba(255, 255, 255, .06);
    --active: rgba(255, 255, 255, .11);
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .13);
    --text: #e8e8ed;
    --text-strong: #f5f5f7;
    --muted: #8e8e93;
    --faint: #58585d;
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, .25);
    --bad: #ff453a;
    color-scheme: dark;
    color: var(--text);
  }
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
html, body { margin: 0; }
body { font: 13px/1.5 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: none; }
h1 { font-family: var(--display); font-size: 26px; line-height: 1.2; font-weight: 600; color: var(--text-strong); margin: 0 0 4px; letter-spacing: -.025em; font-variation-settings: "opsz" 32, "wdth" 100; }
h2 { font-size: 13px; font-weight: 600; color: var(--text-strong); margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; }
h2 .muted { font-weight: 400; font-variant-numeric: tabular-nums; }
code, pre, .mono { font-family: var(--mono); font-size: 12px; }
code { background: var(--panel-3); padding: 1px 5px; border-radius: 4px; }
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; }

/* Icons and sidebar text use solid colours: with a translucent colour, overlapping icon paths
   add up and look muddy. */
.sidebar { --muted: #8e8e93; --faint: #58585d; --icon-muted: #8e8e93; }

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

/* 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 12px; }
.switcher summary { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 12px; cursor: pointer; list-style: none; user-select: none;
  font: 600 15px var(--display); letter-spacing: -.01em; 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 .count { font-size: 11px; font-weight: 500; color: #fff; background: var(--bad); border-radius: 9px; padding: 0 6px; line-height: 17px; font-variant-numeric: tabular-nums; }
.switcher-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; padding: 5px; border-radius: 12px; background: #2a2a2e;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 30px -6px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  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: 10px; padding: 5px 8px 5px 5px; border-radius: 8px; color: var(--text); font-size: 13px; }
.switcher-menu a:hover { background: rgba(255, 255, 255, .07); }
.switcher-menu a.active { background: rgba(255, 255, 255, .1); color: var(--text-strong); }
.switcher-sep { height: 1px; margin: 5px 4px; background: rgba(255, 255, 255, .08); }
.switcher-label { padding: 6px 8px 3px; font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .45); text-transform: uppercase; letter-spacing: .04em; }
.tile { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; font: 600 11.5px var(--display); letter-spacing: -.01em; color: #fff;
  background: var(--tile, #3a3a40); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .15); }
.tile .icon { color: inherit; }
.switcher-menu .tile { width: 22px; height: 22px; border-radius: 7px; font-size: 10.5px; }
.tile.home { --tile: #3a3a40; color: #d1d1d6; }
.tile.add { --tile: transparent; color: #8e8e93; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.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: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: var(--text-strong); padding: 2px 10px 16px; }
.brand .icon { color: var(--accent); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 2px; 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); }
.nav a.active .icon { color: var(--accent); }
.nav .grow { flex: 1; }
.nav .section { font-size: 11px; font-weight: 500; color: var(--faint); margin: 16px 10px 5px; }
.nav .count { font-size: 11px; font-weight: 500; color: #fff; background: var(--bad); border-radius: 9px; padding: 0 6px; line-height: 17px; font-variant-numeric: tabular-nums; }

/* 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-gap { height: 10px; }
.nav summary { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 2px; 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 4px 15px; padding-left: 9px; 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. */
.sidebar-footer { position: sticky; bottom: -16px; margin: auto -10px -16px; padding: 12px 20px 16px; background: var(--sidebar); border-top: 1px solid var(--border); z-index: 1; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sidebar-footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: var(--r-sm); }
.sidebar-footer button:hover { color: var(--text-strong); background: var(--hover); }

main { padding: 24px 32px 64px; min-width: 0; margin: 8px 8px 8px 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); min-height: calc(100vh - 16px); }
main > * { max-width: 1416px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
/* Filter row under the title: segmented status tabs on the left, search/filters and the range on the right. */
.toolbar-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.toolbar .search input[type=search] { width: 280px; }
.toolbar .ranges, .toolbar .tabs { padding: 4px; }
.toolbar .tabs a, .toolbar .ranges a { line-height: 20px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; 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: 2px; padding: 3px; background: var(--panel-3); border-radius: 11px; box-shadow: inset 0 0 0 1px var(--border); }
.ranges a, .tabs a { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; font-size: 12.5px; font-weight: 500; line-height: 20px; color: var(--muted); border-radius: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranges a { padding: 3px 11px; font-size: 12px; }
.ranges a:hover, .tabs a:hover { color: var(--text-strong); }
.ranges a.active, .tabs a.active { color: var(--text-strong); }
.pill { display: 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: 0 0 0 .5px var(--ring), 0 1px 2px rgba(0, 0, 0, .1), 0 2px 6px -2px rgba(0, 0, 0, .12); }
.tabs .n { font-size: 11px; font-weight: 600; color: var(--faint); min-width: 18px; padding: 0 5px; line-height: 17px; border-radius: 999px; background: var(--hover); text-align: center; }
.tabs a.active .n { color: var(--accent); background: var(--accent-soft); }
.card.flush > .tabs { margin: 14px 0 2px 18px; }

/* Toolbar: segmented control on the left, filters and search on the right. */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search-form { display: flex; flex-wrap: wrap; gap: 10px; 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: 11px; 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 11px var(--mono); color: var(--faint); border-radius: 5px; padding: 0 5px; 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: 18px 20px; margin-bottom: 16px; min-width: 0; }
.card.flush { padding: 0; overflow-x: auto; }
.card.flush > h2 { padding: 16px 20px 4px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 12px 15px; min-width: 0; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-family: var(--mono); font-size: 21px; font-weight: 600; line-height: 1.3; color: var(--text-strong); margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .value.bad { color: var(--bad-text); }
.stat .value.text { font-family: var(--sans); font-size: 15px; letter-spacing: -.01em; }
.stat .sub { color: var(--muted); font-size: 12px; 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: 9px 12px; vertical-align: top; }
td { background: var(--row); transition: background .12s; }
th { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; padding-top: 4px; padding-bottom: 2px; }
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: 2px 8px 6px; }
.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: 12px; 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: 12px; }
.nowrap { white-space: nowrap; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.time { font-family: var(--mono); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 0 8px; font-size: 11px; font-weight: 600; line-height: 19px; border-radius: 999px; 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: 2px; 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: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.chart-grid span:not(:last-child) { padding-top: 3px; }
.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: 5px; cursor: default; }
.stack { width: 64%; max-width: 22px; min-height: 3px; display: flex; flex-direction: column-reverse; gap: 1.5px; border-radius: 4px; 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. */
.chart-bars .col:hover::after {
  content: attr(data-tip); display: block; position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 5;
  white-space: nowrap; font-size: 11.5px; font-weight: 500; color: var(--text-strong); background: var(--panel); padding: 5px 10px;
  border-radius: 9px; box-shadow: var(--shadow-hover); pointer-events: none;
  transform: translateX(-50%); 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); } }
.chart-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; margin-top: 8px; padding-right: 34px; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; 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: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-head h2 { margin: 0; }

/* Forms */
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select {
  font: 13px var(--sans); color: var(--text-strong); background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 9px; padding: 7px 11px;
}
input::placeholder { color: var(--faint); }
input:focus, select: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: 6px; font: 500 13px var(--sans); padding: 6px 13px; border-radius: 9px;
  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.danger { color: var(--bad-text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--panel-3); }
form.inline { display: inline; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
.field input { width: 100%; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* 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: 24px 16px; 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: 16px 0 0; }
.auth .brand { justify-content: center; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; padding-bottom: 22px; }
.auth .brand { gap: 7px; }
.auth .brand .icon { width: 20px; height: 20px; color: var(--text-strong); }
.auth h2 { font-size: 15px; }
.error { background: var(--bad-soft); color: var(--bad-text); padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; }
.error a, .notice a { color: inherit; font-weight: 600; text-decoration: underline; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 20px; 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: 12px 14px; overflow-x: auto; color: var(--text-strong); }

/* Stack trace */
.frames { display: flex; flex-direction: column; gap: 4px; }
.frame { background: var(--row); border-radius: var(--r); overflow: hidden; }
.frame summary { padding: 9px 14px; cursor: pointer; display: flex; gap: 12px; 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: 11px 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: 12px; color: var(--text-strong); word-break: break-all; }
.frame summary .fn { font-family: var(--mono); font-size: 11.5px; color: var(--muted); word-break: break-all; margin-top: 2px; }
.source { font: 12px/1.7 var(--mono); background: var(--code-bg); overflow-x: auto; padding: 6px 0; }
.source div { white-space: pre; padding: 0 14px; }
.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: 5px; overflow: hidden; margin: 4px 0 12px; background: var(--panel-3); gap: 2px; }
.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: 4px 16px; font-size: 12px; color: var(--muted); }
.stage-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.timeline td.bar { width: 28%; min-width: 160px; }
.tl { position: relative; height: 6px; background: var(--panel-3); border-radius: 3px; margin-top: 7px; }
.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: 11.5px; color: var(--muted); white-space: nowrap; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 12px; }
.filters button { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--sans); padding: 4px 6px 4px 11px; border-radius: 999px; border: 0; background: var(--panel-2); color: var(--muted); cursor: pointer; box-shadow: inset 0 0 0 1px var(--border); }
.filters button:hover { color: var(--text-strong); }
.filters button .n { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--faint); background: var(--hover); border-radius: 999px; padding: 0 6px; line-height: 17px; }
.filters button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.filters button.on .n { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

details.json summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 4px; }
details.json summary:hover { color: var(--text-strong); }
details.json .codebox { margin-top: 6px; }
.log-level { font: 600 11px 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: 12px var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text-strong); }

.snippet { position: relative; }
.copy { position: absolute; top: 8px; right: 8px; }
.copy.btn { padding: 3px 9px; font-size: 12px; }

.live { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 500; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2.4s infinite; }
.live.idle { color: var(--muted); }
.live.idle::before { background: var(--faint); animation: none; }
/* Live updates (app.js): a status pill top right in the topbar. Refreshed content skips the
   entrance animations. */
.live-pill { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 auto; padding: 5px 11px 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 16px; color: var(--muted); background: var(--hover); white-space: nowrap; }
.live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.live-pill.on { color: var(--ok); background: var(--ok-soft); }
.live-pill.on::before { background: var(--ok); animation: pulse 2.4s infinite; }
.live-pill.connecting::before { animation: blink 1.2s ease-in-out infinite; }
.live-pill.beat { animation: pop 320ms var(--ease-out); }
main[data-refreshed] > *, main[data-refreshed] .stack, main[data-refreshed] .sparkline { animation: none; }
@keyframes blink { 50% { opacity: .3; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .5); } 70% { box-shadow: 0 0 0 6px rgba(48, 209, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); } }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-footer { position: static; }
  main { padding: 16px; margin: 0 8px 8px; 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; }
}

/* All-projects overview */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.project-card { display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 0; border-radius: var(--r-lg); padding: 18px 20px; 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: 12px; }
.project-name { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--text-strong); min-width: 0; letter-spacing: -.01em; }
.project-name .icon { color: var(--accent); }
.project-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.project-stats .label { font-size: 11.5px; color: var(--muted); }
.project-stats .value { font: 600 15px 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: 6px; 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-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.project-foot .small { margin-left: auto; }
.live.idle { font-weight: 400; }

/* Account & 2FA */
.footer-user { display: flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; }
.footer-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-user:hover { color: var(--text-strong); }
.narrow { max-width: 720px; }
.notice { background: var(--ok-soft); color: var(--ok-text); padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; }
.setup-2fa { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.qr { width: 180px; height: 180px; border-radius: var(--r); background: #fff; padding: 8px; image-rendering: pixelated; }
.secret { font: 600 14px var(--mono); letter-spacing: .06em; color: var(--text-strong); user-select: all; }
.code-input { font: 600 20px var(--mono) !important; letter-spacing: .3em; text-align: center; width: 180px; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 28px; font: 14px var(--mono); color: var(--text-strong); margin: 4px 0 14px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@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: 6px; }

/* 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, .filters button, .sidebar-footer button { transition: background .15s ease, color .15s ease, transform 160ms var(--ease-out); }
.ranges a:active, .tabs a:active, .filters button: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; } }
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; }
  .live::before, .live-pill::before, .live-pill.beat { animation: none; }
  .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, .filters button: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: 10px; width: 100%; margin: 0 0 12px; padding: 6px 8px 6px 10px; border: 0; border-radius: var(--r-sm);
  background: var(--hover); 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 11px var(--sans); color: var(--muted); padding: 1px 6px; border-radius: 5px; 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 16px 16px;
  background: rgba(0, 0, 0, .32); 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-hover), 0 32px 64px -16px rgba(0, 0, 0, .4); animation: palette-in 160ms var(--ease-out); }
.palette-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.palette-head input[type=text] { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; padding: 4px 0; font-size: 15px; 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: 6px; min-height: 60px; }
.palette-group { font-size: 11px; font-weight: 500; color: var(--faint); padding: 8px 10px 4px; }
.palette-item { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; 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: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-kind { margin-left: auto; flex: none; font-size: 11px; color: var(--faint); }
.palette-empty, .palette-prompt { padding: 14px 10px; color: var(--muted); }
.palette-confirm { margin: 6px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--text-strong); }
.palette-confirm.danger { background: var(--bad-soft); }
.palette-secret { padding: 10px; display: grid; gap: 10px; justify-items: start; }
.palette-secret p { margin: 0; color: var(--muted); }
.palette-secret code { display: block; width: 100%; padding: 10px 12px; font-size: 13px; word-break: break-all; user-select: all; }
.palette-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; 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 h3 { font-size: 12.5px; font-weight: 600; color: var(--text-strong); margin: 18px 0 8px; }
.connect-steps { margin: 8px 0; padding-left: 20px; }
.connect-steps li { margin: 0 0 10px; }
.connect-steps .codebox { margin-top: 6px; }
.connect-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: -4px 0 12px; }
.live.waiting::before { animation: blink 1.2s ease-in-out infinite; }
.connect-values { align-items: center; margin: 12px 0 4px; }
.connect-values .codebox { padding: 8px 88px 8px 12px; }
.connect-values .codebox code { word-break: break-all; }
.connect-values .copy { top: 50%; transform: translateY(-50%); }
.welcome { padding: 8px 0 24px; max-width: 640px; }
.welcome h1 { margin-bottom: 8px; }
.welcome-steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.welcome-steps li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
.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: 13px; }
@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; }
.auth h3 { font-size: 14px; }

/* 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; }
.team-roles { margin: -4px 0 8px; font-size: 12.5px; max-width: 720px; }
/* Text in a flush card (no padding of its own): lined up with its heading. */
.card.flush > .team-roles, .card.flush > .card-intro, .card.flush > .card-foot { padding: 0 20px; }
.card.flush > .card-intro { margin: -2px 0 8px; font-size: 12.5px; }
.card.flush > .card-foot { margin: 4px 0 16px; }
.set-password { margin: 4px 0 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.set-password h3 { margin: 0 0 4px; font-size: 14px; }
td.row-actions { text-align: right; }
.inline-label { align-self: center; font-size: 12.5px; }
@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: 6px; padding: 6px 0; }
  table.stack-rows td, table.stack-rows td:first-child, table.stack-rows td:last-child { background: none; border-radius: 0; padding: 3px 12px; }
  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(--font, inherit); }
  .hide-sm { display: none; }
}

/* Billing: usage meters and the plan cards */
.meter-row { margin-bottom: 14px; }
.meter-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 999px; 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: 12.5px; color: var(--bad); margin-top: 5px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.plan { border-radius: var(--r); background: var(--panel-2, var(--panel-3)); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.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(--mono); font-size: 19px; font-weight: 600; color: var(--text-strong); }
.plan-price .muted { font-family: var(--sans); font-size: 12px; font-weight: 400; }
.plan ul { margin: 4px 0 8px; padding-left: 16px; font-size: 13px; color: var(--muted); flex: 1; }
.plan form { margin: 0; }
.plan form .btn { width: 100%; justify-content: center; }
.plan-hint { margin: 0; text-align: center; }
.narrow.wide { max-width: 960px; }
.quota-banner a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Public status page (status_page.html, status_missing.html): standalone, no app chrome. Text
   uses the strong/plain text colours (WCAG AA in both themes); the state colours go on dots, bars
   and backgrounds, and on badges only in their darker -text shades. Bars are the daily uptime of
   a component; worse days are also shorter, so they don't rely on colour; the oldest ones (.old)
   are hidden on phones. */
.sp-body {
  background: var(--bg);
  --ok-text: #30d158; --bad-text: #ff6961; --warn-text: #ff9f0a; --accent-text: #5eadff;
}
@media (prefers-color-scheme: light) {
  .sp-body { --muted: rgba(60, 60, 67, .78); --ok-text: #157a35; --bad-text: #c02a22; --warn-text: #9a5200; --accent-text: #0062cc; }
}
.sp-body .badge.ok { color: var(--ok-text); }
.sp-body .badge.bad { color: var(--bad-text); }
.sp-body .badge.warn { color: var(--warn-text); }
.sp-body .badge.accent { color: var(--accent-text); }
.sp { max-width: 760px; margin: 0 auto; padding: 48px 16px 32px; }
.sp-head h1 { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--text-strong); margin: 0 0 6px; overflow-wrap: anywhere; }
.sp-desc { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.sp-overall { display: flex; align-items: center; gap: 10px; margin: 24px 0 16px; padding: 14px 18px; border-radius: var(--r-lg); font-size: 15px; background: var(--panel-3); color: var(--text-strong); }
.sp-overall .sp-dot { background: var(--icon-muted); }
.sp-overall.operational { background: var(--ok-soft); }
.sp-overall.operational .sp-dot { background: var(--ok); }
.sp-overall.partial_outage { background: var(--warn-soft); }
.sp-overall.partial_outage .sp-dot { background: var(--warn); }
.sp-overall.major_outage { background: var(--bad-soft); }
.sp-overall.major_outage .sp-dot { background: var(--bad); }
.sp-overall.maintenance { background: var(--accent-soft); }
.sp-overall.maintenance .sp-dot { background: var(--accent); }
.sp-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.sp-card { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 4px 20px; margin-bottom: 16px; }
.sp-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 0; padding: 14px 0 10px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.sp-legend li { display: flex; align-items: flex-end; gap: 6px; }
.sp-legend i { width: 6px; height: 14px; border-radius: 2px; background: var(--panel-3); }
.sp-legend i.up { background: var(--ok); }
.sp-legend i.degraded { background: var(--warn); height: 10px; }
.sp-legend i.down { background: var(--bad); height: 6px; }
.sp-component { padding: 16px 0; }
.sp-component + .sp-component { border-top: 1px solid var(--border); }
.sp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.sp-name { font-weight: 500; color: var(--text-strong); overflow-wrap: anywhere; min-width: 0; }
.sp-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--text); }
.sp-state .sp-dot { width: 8px; height: 8px; background: var(--icon-muted); }
.sp-state.operational .sp-dot { background: var(--ok); }
.sp-state.outage .sp-dot { background: var(--bad); }
.sp-bars { display: flex; align-items: flex-end; gap: 2px; height: 30px; }
.sp-bars i { flex: 1; min-width: 0; height: 100%; border-radius: 2px; background: var(--panel-3); }
.sp-bars i.up { background: var(--ok); }
.sp-bars i.degraded { background: var(--warn); height: 70%; }
.sp-bars i.down { background: var(--bad); height: 40%; }
.sp-bars i:hover { opacity: .75; }
.sp-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-narrow { display: none; }
.sp-days { margin-top: 6px; font-size: 12px; color: var(--muted); }
.sp-days summary { cursor: pointer; width: fit-content; }
.sp-days summary:hover { color: var(--text-strong); }
.sp-days ul { margin: 6px 0 0; padding-left: 18px; columns: 2 220px; }
.sp-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.sp-empty { color: var(--muted); text-align: center; padding: 24px 0; margin: 0; }
.sp-notice { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 16px; border-left: 3px solid var(--bad); }
.sp-notice.maintenance { border-left-color: var(--accent); }
.sp-notice h2, .sp-past h3 { font-size: 15px; margin: 8px 0 4px; color: var(--text-strong); overflow-wrap: anywhere; }
.sp-notice-head { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-window { margin: 2px 0 4px; font-weight: 500; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.sp-text { margin: 4px 0; white-space: pre-line; overflow-wrap: anywhere; }
.sp-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.sp-history { margin-top: 28px; }
.sp-history > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.sp-past { padding: 10px 0; border-top: 1px solid var(--border); }
.sp-past h3 { margin-top: 0; }
.sp-foot { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-top: 32px; font-size: 12px; color: var(--muted); }
.sp-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.sp-preview { position: sticky; top: 0; z-index: 1; padding: 10px 16px; text-align: center; font-size: 13px; 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: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--text-strong); margin: 0 0 8px; }
.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: 28px; }
  .sp-head h1 { font-size: 23px; }
  .sp-card, .sp-notice { padding-left: 14px; padding-right: 14px; }
  .sp-bars { gap: 1.5px; }
  .sp-bars i.old { display: none; }
  .sp-wide { display: none; }
  .sp-narrow { display: inline; }
  .sp-missing { padding-top: 48px; }
}

/* Status page editor (status_page_edit.html). */
.sp-help { margin: -2px 20px 6px; font-size: 12.5px; max-width: 640px; }
.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: 4px; }
.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 16px; gap: 8px; }
.btn.small { font-size: 12px; padding: 3px 10px; }
.sp-edit-notice { padding: 10px 0; border-top: 1px solid var(--border); }
.sp-edit-notice-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-resolve { margin-left: auto; }
.sp-edit-body { margin: 4px 0; white-space: pre-line; color: var(--muted); overflow-wrap: anywhere; }
.sp-edit-notice details summary { cursor: pointer; color: var(--accent); margin-top: 4px; width: fit-content; }
.sp-notice-form { margin: 10px 0; }
.sp-notice-form textarea { width: 100%; font: 13px var(--sans); color: var(--text-strong); background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 9px; padding: 7px 11px; resize: vertical; }
.sp-notice-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-notice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.sp-notice-grid select, .sp-notice-grid input { width: 100%; }
.sp-notice-danger { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 6px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.sp-new-notice { font-size: 14px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
@media (max-width: 600px) {
  table.sp-components .sp-cell-label { display: block; font-size: 12px; color: var(--muted); margin: 4px 0 4px; }
  table.sp-components td.sp-order-cell { display: flex; align-items: center; gap: 8px; }
  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). */
h2.section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 10px; }
.health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.health .health-tile { display: block; background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 11px 15px; color: var(--text); min-width: 0; transition: box-shadow .15s ease; }
.health .health-tile:hover { box-shadow: var(--shadow-hover); }
.health .health-tile .label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.health .health-tile .line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-top: 4px; overflow: hidden; color: var(--text-strong); overflow-wrap: anywhere; }
.name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.name-row > .truncate { min-width: 0; }
.name-row > .badges { display: flex; gap: 4px; flex-shrink: 0; }
.name-row > .badges:empty { display: none; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.field.indent { margin-left: 24px; }
.field.indent label.check:has(input:disabled) { color: var(--muted); }
.table-foot { padding: 4px 20px 14px; }
details.records summary { cursor: pointer; color: var(--accent); margin-bottom: 8px; }
.dns-table td { word-break: break-all; }
.notice.dismissable { display: flex; align-items: center; gap: 12px; justify-content: space-between; color: var(--text); }
.notice.dismissable .btn { flex-shrink: 0; }
@media (max-width: 1000px) { .health { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .notice.dismissable { flex-direction: column; align-items: flex-start; }
}

/* ---- Site crawl (templates/crawl.html, crawl_card.html) ---- */
.crawl-warn { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; }
.crawl-warn a { color: inherit; text-decoration: underline; }
.crawl-state { margin: 10px 0 0; }
.crawl-limit { display: block; }
.crawl-heading { font-size: 14px; margin: 20px 0 8px; }
.crawl-filters { padding: 0 0 10px; }
.crawl-filter { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--sans); padding: 4px 6px 4px 11px; border-radius: 999px; background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); text-decoration: none; }
.crawl-filter:hover { color: var(--text-strong); }
.crawl-filter .n { font-size: 11px; color: var(--faint); background: var(--hover); border-radius: 999px; padding: 0 6px; line-height: 17px; }
.crawl-filter.on { background: var(--accent-soft); color: var(--accent); }
.crawl-table { table-layout: fixed; }
.crawl-table tr.crawl-group td { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--panel-2); padding-top: 6px; padding-bottom: 6px; }
.crawl-ignored { margin: 12px 0 16px; }
.crawl-ignored summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crawl-code { display: inline-block; text-align: left; margin: 8px 0 0; padding: 8px 12px; background: var(--panel-2); border-radius: var(--r); font: 12px var(--mono); color: var(--text); }
.crawl-failed strong { font-weight: 500; color: var(--text-strong); }
.crawl-start { display: flex; gap: 8px; }
.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; }
}

/* Confirmation dialog (static/app.js askConfirm), used instead of window.confirm. */
.confirm-dialog { width: min(420px, calc(100% - 32px)); padding: 20px; border: 0; border-radius: var(--r-lg);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-hover), 0 32px 64px -16px rgba(0, 0, 0, .4); }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(2px); }
.confirm-dialog .confirm-text { margin: 0 0 18px; line-height: 1.5; white-space: pre-line; }
.confirm-dialog .confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
