/* Pulsar — interface styles */

:root {
  --brand-l: #5B47E0; --brand-d: #A99BFF;
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --r-s: 6px; --r-m: 10px; --r-l: 18px;
  --row-pad: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --bg: #F2F4FA; --bg-2: #E9ECF6; --panel: #FFFFFF; --panel-2: #F6F7FC;
  --line: #DCE0EE; --line-2: #C6CBE2;
  --text: #171B36; --muted: #5E6590; --faint: #9399BC;
  --up: #0C9C7B; --slow: #BE7B00; --down: #DA2C4C; --idle: #8C92B4;
  --up-bg: rgba(12, 156, 123, .1); --slow-bg: rgba(190, 123, 0, .1); --down-bg: rgba(218, 44, 76, .1);
  --brand: var(--brand-l); --brand-ink: #FFFFFF;
  --shadow: 0 1px 2px rgba(23, 27, 54, .06), 0 18px 40px -20px rgba(23, 27, 54, .28);
  --glow: 0;
  color-scheme: light;
}
:root[data-accent=blue] { --brand-l: #2160D8; --brand-d: #86B6FF; }
:root[data-accent=magenta] { --brand-l: #B8327F; --brand-d: #FF94D2; }
:root[data-accent=graphite] { --brand-l: #3B4170; --brand-d: #C8CCE6; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #13162B; --bg-2: #181C36; --panel: #1A1E3A; --panel-2: #20254A;
    --line: #2A3060; --line-2: #3A4185;
    --text: #E7E9F7; --muted: #9AA0CB; --faint: #646A9C;
    --up: #4FE3C1; --slow: #FFC24B; --down: #FF5C7A; --idle: #646A9C;
    --up-bg: rgba(79, 227, 193, .1); --slow-bg: rgba(255, 194, 75, .1); --down-bg: rgba(255, 92, 122, .12);
    --brand: var(--brand-d); --brand-ink: #13162B;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 60px -24px rgba(0, 0, 0, .6);
    --glow: 1;
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #13162B; --bg-2: #181C36; --panel: #1A1E3A; --panel-2: #20254A;
  --line: #2A3060; --line-2: #3A4185;
  --text: #E7E9F7; --muted: #9AA0CB; --faint: #646A9C;
  --up: #4FE3C1; --slow: #FFC24B; --down: #FF5C7A; --idle: #646A9C;
  --up-bg: rgba(79, 227, 193, .1); --slow-bg: rgba(255, 194, 75, .1); --down-bg: rgba(255, 92, 122, .12);
  --brand: var(--brand-d); --brand-ink: #13162B;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 60px -24px rgba(0, 0, 0, .6);
  --glow: 1;
  color-scheme: dark;
}
:root[data-density=compact] { --row-pad: 8px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.num, .tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.logo { color: var(--brand); flex: none; }
.logo .beat { stroke-dasharray: 60; stroke-dashoffset: 0; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--panel); color: var(--text);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: var(--down); }
.btn.primary.danger-fill { background: var(--down); border-color: var(--down); color: #fff; }
.btn.wide { width: 100%; justify-content: center; height: 44px; }
.btn[disabled], .btn.busy { opacity: .6; pointer-events: none; }
.btn.busy .ic, .icon-btn.busy .ic { animation: spin .8s linear infinite; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-m);
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-s);
  border: 1px solid var(--line-2); background: var(--panel-2); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.field .hint { font-size: 12.5px; color: var(--faint); }
.mono-in { font-family: var(--mono); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2:has(> [hidden]) { grid-template-columns: 1fr; }
.form { display: grid; gap: 16px; }
.form-error { margin: 0; padding: 10px 12px; border-radius: var(--r-s); background: var(--down-bg); color: var(--down); font-size: 14px; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .knob { position: relative; width: 36px; height: 20px; border-radius: 20px; background: var(--line-2); transition: background .2s; flex: none; }
.switch .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .knob { background: var(--brand); }
.switch input:checked + .knob::after { transform: translateX(16px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--brand); outline-offset: 2px; }
.switches { display: grid; gap: 12px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-m); background: var(--bg-2); border: 1px solid var(--line); }
.seg button, .seg-opt span {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.seg button[aria-selected=true], .seg-opt input:checked + span { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brand); }
.seg.types { display: grid; grid-template-columns: repeat(4, 1fr); }
.seg.types .seg-opt span { width: 100%; justify-content: center; height: 34px; }

kbd { font-family: var(--font); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--faint); background: var(--panel); }

/* ---------- boot & auth ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .logo { width: 44px; height: 44px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; transform: scale(.94); } }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 18px; }
.auth-card h1 { font-family: var(--serif); font-size: 44px; line-height: 1.05; letter-spacing: -.01em; }
.auth-card p { margin: 0; }
.auth-card .logo { width: 40px; height: 40px; }
.auth-card .link { font-size: 14px; justify-self: center; }
.fatal { max-width: 560px; }
.fatal code { font-family: var(--mono); font-size: 13px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: max(10px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px; }
.brand .logo { width: 28px; height: 28px; }
.search {
  min-width: 0; position: relative; display: flex; align-items: center; gap: 8px; flex: 1; max-width: 360px; margin-left: auto;
  height: 36px; padding: 0 10px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--panel); color: var(--faint);
}
.search:focus-within { border-color: var(--brand); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.search input::-webkit-search-cancel-button { display: none; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .btn.primary { margin-right: 6px; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 64px; }
.foot { text-align: center; color: var(--faint); font-size: 12.5px; padding: 0 0 32px; }

/* ---------- hero ---------- */
.hero { padding: clamp(24px, 5vw, 56px) 0 8px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 6.2vw, 68px); line-height: 1.02;
  letter-spacing: -.015em; max-width: 18ch; text-wrap: balance;
}
.hero h1.is-down { color: var(--down); }
.hero h1.is-slow { color: var(--slow); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.hero-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-meta .warn-link {
  display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 0; background: none; cursor: pointer;
  color: var(--slow); font-size: 14px; text-align: left;
}
.hero-meta .warn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero-meta .ok { color: var(--up); }

.trace {
  position: relative; height: 112px; margin: 26px 0 8px; border-radius: var(--r-l);
  background-color: var(--panel);
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--line-2) 70%, transparent) 1px, transparent 1.2px);
  background-size: 16px 16px; background-position: 8px 8px;
  border: 1px solid var(--line); overflow: hidden;
}
.trace canvas { display: block; width: 100%; height: 100%; }

/* ---------- toolbar ---------- */
.board { margin-top: 28px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.chip span { font-variant-numeric: tabular-nums; color: var(--faint); }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.on span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.chip.c-up i { background: var(--up); } .chip.c-slow i { background: var(--slow); } .chip.c-down i { background: var(--down); }
.chip.tag { border-style: dashed; }
.tool-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.toolbar .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.select-sm { height: 32px; padding: 0 28px 0 10px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; color: var(--muted); }

/* ---------- monitor rows ---------- */
.list { border-top: 1px solid var(--line); }
.row {
  display: grid; align-items: center; gap: 16px; cursor: pointer;
  grid-template-columns: 12px minmax(170px, 1.25fr) 52px minmax(140px, 2fr) 78px 82px 66px;
  padding: var(--row-pad) 10px; border-bottom: 1px solid var(--line); position: relative;
  transition: background .12s;
}
.row:hover, .row:focus-visible { background: var(--panel); outline: none; }
.row:focus-visible { box-shadow: inset 3px 0 0 var(--brand); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--idle); position: relative; flex: none; }
.s-up .dot { background: var(--up); }
.s-slow .dot { background: var(--slow); }
.s-down .dot { background: var(--down); }
.s-pending .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--idle); }
.s-paused .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--faint); }
.s-down .dot::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--down);
  animation: ring 1.8s ease-out infinite;
}
@keyframes ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.who { min-width: 0; }
.who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn { color: var(--slow); }
.who .sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 13px; color: var(--muted); min-width: 0; }
.host { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sub .err { color: var(--down); }
.sub .warn { color: var(--slow); }
.tag { font-size: 12px; color: var(--faint); }
.kind { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 0; text-align: center; border: 1px solid var(--line); border-radius: 5px; }
.s-paused .who, .s-paused .beats, .s-paused .num { opacity: .5; }

.beats { display: flex; align-items: flex-end; justify-content: flex-end; gap: 2px; height: 28px; overflow: hidden; }
.beats i { flex: 0 0 4px; height: calc(var(--h, .3) * 100%); min-height: 4px; border-radius: 2px; background: var(--up); opacity: .9; }
.beats i.s2 { background: var(--slow); }
.beats i.s0 { background: var(--down); height: 100%; }
.beats i.e { background: var(--line); height: 4px; opacity: 1; }
.beats i:last-child { opacity: 1; }

.num { text-align: right; line-height: 1.15; }
.num b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.num small { display: block; font-size: 12px; color: var(--faint); }
.lat small { display: inline; margin-left: 3px; }
.acts { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity .12s; }
.row:hover .acts, .row:focus-within .acts { opacity: 1; }
@media (hover: none) { .acts { opacity: 1; } }

.empty { padding: 56px 0 24px; max-width: 640px; }
.empty h2 { font-family: var(--serif); font-size: 34px; font-weight: 400; line-height: 1.1; }
.empty p { color: var(--muted); }
.quick { display: grid; gap: 8px; margin-top: 20px; }
.quick button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel);
}
.quick button:hover { border-color: var(--brand); }
.quick b { font-weight: 600; }
.quick .host { margin-left: auto; }
.no-match { padding: 40px 10px; color: var(--muted); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(10, 12, 30, .38); opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(780px, 100vw);
  background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(102%); transition: transform .32s var(--ease); overflow-y: auto; overscroll-behavior: contain;
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.dw-head { padding: max(20px, env(safe-area-inset-top)) 28px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: relative; }
.dw-close { position: absolute; top: 14px; right: 14px; }
.dw-title { display: flex; align-items: center; gap: 12px; padding-right: 40px; }
.dw-title .dot { width: 12px; height: 12px; }
.dw-title h2 { font-family: var(--serif); font-size: clamp(30px, 4.5vw, 42px); font-weight: 400; line-height: 1.05; overflow-wrap: anywhere; }
.dw-host { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.dw-host .kind { padding: 1px 8px; }
.dw-state { margin: 14px 0 0; font-size: 15px; }
.dw-state b { font-weight: 600; }
.s-up .dw-state b { color: var(--up); } .s-slow .dw-state b { color: var(--slow); } .s-down .dw-state b { color: var(--down); }
.dw-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dw-actions .btn { height: 34px; padding: 0 12px; font-size: 13.5px; }
.dw-body { padding: 22px 28px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
.dw-body > * { min-width: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dw-sec h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.dw-sec > p { margin: -6px 0 12px; }

.chart-wrap { position: relative; height: 240px; margin-top: 14px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.tip {
  position: absolute; top: 6px; pointer-events: none; padding: 8px 10px; border-radius: var(--r-s);
  background: var(--text); color: var(--bg); font-size: 12.5px; line-height: 1.4; white-space: nowrap; z-index: 2;
}
.tip b { font-size: 14px; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stats div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats dt { font-size: 12.5px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

.days { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; height: 34px; }
.days i { border-radius: 2px; background: var(--up); }
.days i.na { background: var(--line); }
.days i.mid { background: var(--slow); }
.days i.bad { background: var(--down); }
.days i:hover { filter: brightness(1.2); outline: 1px solid var(--text); }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 6px; }

.rhythm { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 11px; line-height: 1.2; color: var(--faint); }
.rhythm span { display: flex; align-items: center; }
.rhythm .hh { grid-column: span 6; }
.rhythm i { min-width: 0; aspect-ratio: 1 / 1; border-radius: 3px; background: color-mix(in srgb, var(--brand) calc(var(--v, 0) * 88% + 8%), var(--panel-2)); }
.rhythm i.na { background: var(--panel-2); }
.rhythm i.dn { box-shadow: inset 0 0 0 2px var(--down); }

.incidents { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.incidents li { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.incidents .dot { background: var(--down); top: 1px; }
.incidents .done .dot { background: var(--faint); }
.incidents .cause { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.incidents .len { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }

.log { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.log td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.log td:nth-child(1) { width: 1%; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; padding-right: 20px; }
.log td:nth-child(2) { width: 1%; white-space: nowrap; padding-right: 20px; }
.log td:nth-child(3) { width: 1%; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-right: 20px; }
.log td:last-child { color: var(--muted); overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.pill .dot { width: 8px; height: 8px; }

/* ---------- modal ---------- */
.modal-layer {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(10, 12, 30, .45); animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(600px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow);
  animation: rise .22s var(--ease);
}
.modal.wide { width: min(900px, 100%); }
@keyframes rise { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.m-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px 24px; }
.m-head h2 { font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1.1; flex: 1; }
.m-body { padding: 8px 24px 20px; overflow-y: auto; }
.m-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.type-help { margin: -6px 0 0; }
.more summary { cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted); padding: 4px 0; }
.more[open] summary { margin-bottom: 14px; }
.more > .grid2 { margin-bottom: 14px; }
.test-out { padding: 12px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--panel-2); display: flex; gap: 12px; align-items: baseline; font-size: 14px; }
.test-out .dot { top: 1px; }
.test-out.s-up { border-color: color-mix(in srgb, var(--up) 40%, var(--line)); }
.test-out.s-down { border-color: color-mix(in srgb, var(--down) 40%, var(--line)); }
.test-out.s-slow { border-color: color-mix(in srgb, var(--slow) 40%, var(--line)); }

/* settings */
.settings { display: grid; grid-template-columns: 180px 1fr; gap: 28px; min-height: 420px; }
.tabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; align-self: start; }
.tabs button { text-align: left; padding: 8px 12px; border: 0; border-radius: var(--r-s); background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected=true] { background: var(--bg-2); color: var(--text); }
.pane { display: grid; gap: 18px; align-content: start; }
.pane h3 { font-size: 16px; font-weight: 600; }
.pane p { margin: 0; }
.callout { padding: 14px 16px; border-radius: var(--r-m); background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; display: grid; gap: 10px; }
.callout.good { border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.callout.bad { border-color: color-mix(in srgb, var(--slow) 50%, var(--line)); }
.callout ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.copy { display: flex; gap: 6px; }
.copy input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--panel); font-family: var(--mono); font-size: 12.5px; }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--panel); cursor: pointer; box-shadow: 0 0 0 1px var(--line-2); }
.swatches button[aria-pressed=true] { box-shadow: 0 0 0 2px var(--text); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.report .ok { color: var(--up); } .report .no { color: var(--down); }

/* command palette */
.palette { width: min(560px, 100%); align-self: start; margin-top: 12vh; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; animation: rise .18s var(--ease); }
.palette input { width: 100%; height: 54px; padding: 0 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; outline: 0; font-size: 16px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-s); cursor: pointer; font-size: 14.5px; }
.palette li[aria-selected=true] { background: var(--bg-2); }
.palette li .host { margin-left: auto; }
.palette li .ic { color: var(--muted); }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: rise .2s var(--ease); max-width: 90vw; }
.toast.err { background: var(--down); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }

/* public status page */
.status-page { max-width: 880px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 32px) 56px; }
.status-page .brand { margin-bottom: clamp(28px, 6vw, 56px); }
.status-page h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 7vw, 64px); line-height: 1.03; letter-spacing: -.015em; }
.status-page h1.is-down { color: var(--down); }
.status-page .lede { color: var(--muted); margin: 14px 0 36px; }
.svc { padding: 18px 0; border-top: 1px solid var(--line); }
.svc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.svc-top b { font-weight: 600; }
.svc-top .state { margin-left: auto; font-size: 14px; color: var(--muted); }
.s-up .state { color: var(--up); } .s-slow .state { color: var(--slow); } .s-down .state { color: var(--down); }
.status-page .incidents { margin-top: 10px; }
.status-page .foot-links { margin-top: 40px; display: flex; justify-content: space-between; color: var(--faint); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .row { grid-template-columns: 12px minmax(150px, 1fr) minmax(120px, 1.3fr) 70px 74px 0; }
  .row .kind { display: none; }
  .acts { display: none; }
}
@media (max-width: 720px) {
  .top { gap: 8px; }
  .brand-name { display: none; }
  .search kbd { display: none; }
  .top-actions .btn.primary span { display: none; }
  .top-actions .btn.primary { padding: 0 10px; margin-right: 0; }
  .top-actions [data-act=palette], .top-actions [data-act=theme] { display: none; }
  .top-actions { gap: 0; }
  .search { height: 38px; }
  .row { grid-template-columns: 12px 1fr auto; grid-template-areas: "dot who lat" ". beats upt"; gap: 6px 12px; }
  .row .dot { grid-area: dot; }
  .row .who { grid-area: who; }
  .row .lat { grid-area: lat; }
  .row .beats { grid-area: beats; height: 20px; }
  .row .upt { grid-area: upt; }
  .row .upt small { display: inline; margin-left: 4px; }
  .toolbar .end { width: 100%; margin-left: 0; }
  .toolbar .end .select-sm { flex: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dw-head, .dw-body { padding-left: 18px; padding-right: 18px; }
  .log td:nth-child(1) { white-space: normal; min-width: 92px; }
  .log td { padding-right: 12px !important; }
  .grid2 { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .tabs { flex-direction: row; overflow-x: auto; position: static; margin: 0 -4px; }
  .tabs button { white-space: nowrap; }
  .modal-layer { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: var(--r-l) var(--r-l) 0 0; }
  .seg.types .seg-opt span { padding: 0 4px; font-size: 13px; }
  .days { gap: 1px; }
  .rhythm { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 1px; }
}

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