/* ward console — design system.
   Identity: a harbour at night. Deep navy water, one warm beacon colour for "act here",
   and running-light colours for state. The watch strip (ticks over time) is the signature
   element; everything else stays quiet so state changes are what you notice.
   Fonts are bundled (OFL): Geist for the interface, Geist Mono for machine values,
   Lexend Exa only for the wordmark and the big status line. */

@font-face { font-family: "Geist"; src: url("fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("fonts/geist-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Lexend Exa"; src: url("fonts/lexend-exa-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0d1424;
  --bg-deep: #090e1b;
  --surface: #141d33;
  --raised: #1a2540;
  --hover: #1f2b4a;
  --line: #25304f;
  --line-strong: #364468;
  --ink: #e9edf7;
  --muted: #8f9bba;
  --faint: #5f6b8c;
  --beacon: #ffcf4a;
  --beacon-ink: #1b1503;
  --beacon-glow: rgb(255 207 74 / 0.14);
  --link: #ffd766;
  --ok: #3bd4a0;
  --bad: #ff5f70;
  --warn: #ff9d42;
  --maint: #a393ff;
  --info: #62b9ff;
  --none: #3b4768;
  --ok-wash: rgb(59 212 160 / 0.12);
  --bad-wash: rgb(255 95 112 / 0.13);
  --warn-wash: rgb(255 157 66 / 0.13);
  --maint-wash: rgb(163 147 255 / 0.14);
  --shadow: 0 18px 50px rgb(3 6 16 / 0.55);
  --r: 10px;
  --r-s: 7px;
  --font: "Geist", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  --display: "Lexend Exa", "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
/* light theme: explicit choice, or system preference when nothing was chosen */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4fa; --bg-deep: #e8ecf5; --surface: #ffffff; --raised: #ffffff; --hover: #eef1f9;
  --line: #dfe4f0; --line-strong: #c3cbe0; --ink: #0d1424; --muted: #56627f; --faint: #8893ad;
  --beacon: #ffc21f; --beacon-ink: #1b1503; --beacon-glow: rgb(255 194 31 / 0.22); --link: #2b3fb0;
  --ok: #0f9469; --bad: #d22f45; --warn: #c76a05; --maint: #6a55e0; --info: #1676c9; --none: #c5cce0;
  --ok-wash: rgb(15 148 105 / 0.1); --bad-wash: rgb(210 47 69 / 0.09); --warn-wash: rgb(199 106 5 / 0.1); --maint-wash: rgb(106 85 224 / 0.1);
  --shadow: 0 18px 50px rgb(20 30 60 / 0.16);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f2f4fa; --bg-deep: #e8ecf5; --surface: #ffffff; --raised: #ffffff; --hover: #eef1f9;
    --line: #dfe4f0; --line-strong: #c3cbe0; --ink: #0d1424; --muted: #56627f; --faint: #8893ad;
    --beacon: #ffc21f; --beacon-ink: #1b1503; --beacon-glow: rgb(255 194 31 / 0.22); --link: #2b3fb0;
    --ok: #0f9469; --bad: #d22f45; --warn: #c76a05; --maint: #6a55e0; --info: #1676c9; --none: #c5cce0;
    --ok-wash: rgb(15 148 105 / 0.1); --bad-wash: rgb(210 47 69 / 0.09); --warn-wash: rgb(199 106 5 / 0.1); --maint-wash: rgb(106 85 224 / 0.1);
    --shadow: 0 18px 50px rgb(20 30 60 / 0.16);
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.08rem; }
h3 { font-size: 0.97rem; }
p { margin: 0 0 0.75rem; max-width: 72ch; }
code, .mono, kbd, pre { font-family: var(--mono); font-size: 0.9em; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
:focus-visible { outline: 2px solid var(--beacon); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
::selection { background: var(--beacon); color: var(--beacon-ink); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.s { width: 15px; height: 15px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; background: var(--beacon); color: var(--beacon-ink); padding: 8px 12px; border-radius: var(--r-s); z-index: 50; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--bg-deep); border-right: 1px solid var(--line); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--ink); text-decoration: none; font: 600 1.12rem/1 var(--display); letter-spacing: -0.02em; }
.brand .mark { width: 26px; height: 26px; color: var(--beacon); flex: none; }
.rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail nav { flex: 1; }
.rail li a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-s); color: var(--muted); text-decoration: none; font-weight: 500; }
.rail li a:hover { background: var(--hover); color: var(--ink); }
.rail li a[aria-current] { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--beacon); }
.rail li a[aria-current] .icon { color: var(--beacon); }
.rail li a .count { margin-left: auto; }
.rail-foot { margin: 0; padding: 12px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.87rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: none; }
.rail-foot .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
.count { min-width: 1.6em; padding: 1px 6px; text-align: center; font-size: 0.76rem; font-weight: 600; border-radius: 99px; background: var(--line); color: var(--ink); }
.count.bad { background: var(--bad); color: #fff; }
.count.warn { background: var(--warn); color: #1b1002; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 32px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .grow { flex: 1; }
.search-trigger { display: flex; align-items: center; gap: 9px; width: min(26rem, 100%); padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; text-align: left; }
.search-trigger:hover { border-color: var(--line-strong); color: var(--ink); }
.search-trigger span { flex: 1; }
.kbd { font: 500 0.74rem/1 var(--mono); padding: 3px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--bg); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 0.88rem; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--surface); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-wash); }
.pill.bad { color: #fff; background: var(--bad); border-color: var(--bad); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-wash); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-s); border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.menu-btn { display: none; }
.live { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; position: relative; }
main { padding: 26px 32px 72px; max-width: 1280px; width: 100%; }

.bare { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(60rem 34rem at 50% -8rem, var(--beacon-glow), transparent 70%), var(--bg); }
.door { width: min(27rem, 100%); padding: 34px 30px; margin: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.door .brand { padding: 0 0 26px; font-size: 1.3rem; }
.door h1 { margin-bottom: 8px; }
.door .btn.primary { width: 100%; justify-content: center; padding: 11px 16px; font-size: 1rem; margin-top: 6px; }

/* ---------- page furniture ---------- */
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head .actions, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 0.88rem; margin: 0 0 6px; max-width: none; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.lede { font: 600 1.3rem/1.3 var(--font); letter-spacing: -0.02em; margin: 0 0 10px; max-width: 52ch; }
.hero .lede { font: 600 1.7rem/1.22 var(--display); letter-spacing: -0.035em; max-width: 30ch; margin-bottom: 8px; }
.lede.bad { color: var(--bad); }
.lede.ok { color: var(--ink); }
.sub { color: var(--muted); }
.section { margin: 0 0 30px; }
.section > h2 { margin-bottom: 10px; }
main > h2, .scroll + h2, table.rows + h2, .section > .scroll + h2, .section > table.rows + h2 { margin: 26px 0 10px; }
.legend + h2, .strip-block + h2 { margin-top: 26px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; align-items: start; }
.stack > * + * { margin-top: 14px; }

/* the overview's opening block: the beacon lights whatever needs attention */
.hero { position: relative; overflow: hidden; padding: 26px 28px 22px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(38rem 16rem at 12% -30%, var(--beacon-glow), transparent 72%), var(--surface); }
.hero.bad { background: radial-gradient(38rem 16rem at 12% -30%, var(--bad-wash), transparent 72%), var(--surface); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.hero .strip { margin-top: 18px; height: 36px; }
.hero .legend { margin-top: 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 18px; overflow: hidden; }
.card > :not(.card-head):not(table):not(.scroll):not(.empty) { margin-left: 18px; margin-right: 18px; }
.card > :last-child:not(table):not(.scroll) { margin-bottom: 16px; }
.card > .card-head + :not(table):not(.scroll) { margin-top: 14px; }
.card > :first-child:not(.card-head):not(table):not(.scroll) { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card table.rows { border: 0; border-radius: 0; }
.card .empty { border: 0; margin: 0; }

dl.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 0 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
dl.stats > div { padding: 13px 16px; min-width: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
dl.stats dt { color: var(--muted); font-size: 0.82rem; margin-bottom: 3px; }
dl.stats dd { margin: 0; font-size: 1.22rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
dl.stats dd a { color: inherit; text-decoration: none; }
dl.stats dd a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--beacon); }
dl.stats dd small { font-size: 0.82rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
dl.stats dd.bad { color: var(--bad); } dl.stats dd.ok { color: var(--ok); } dl.stats dd.warn { color: var(--warn); }

.empty { color: var(--muted); padding: 34px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r); max-width: none; margin: 0 0 18px; }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

/* ---------- tables ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.toolbar input[type=search] { width: min(20rem, 100%); }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-s); }
.seg a, .seg button { padding: 4px 12px; border-radius: 5px; color: var(--muted); text-decoration: none; font: inherit; font-weight: 500; font-size: 0.9rem; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg [aria-current], .seg [aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.scroll { overflow-x: auto; }
table.rows { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rows th { text-align: left; font-weight: 500; font-size: 0.8rem; color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: color-mix(in srgb, var(--bg-deep) 55%, var(--surface)); }
.rows th[data-sort] { cursor: pointer; user-select: none; }
.rows th[data-sort]:hover { color: var(--ink); }
.rows th[aria-sort="ascending"]::after { content: " ↑"; color: var(--beacon); }
.rows th[aria-sort="descending"]::after { content: " ↓"; color: var(--beacon); }
.rows td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rows tbody tr:last-child td { border-bottom: 0; }
.rows tbody tr:hover td { background: var(--hover); }
.rows .num { text-align: right; white-space: nowrap; }
.rows td.wide { width: 32%; min-width: 190px; }
.rows a.primary { color: var(--ink); font-weight: 600; text-decoration: none; }
.rows a.primary:hover { color: var(--link); }
.rows .sub { font-size: 0.85rem; }
.rows tr.is-down td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.rows tr.is-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* ---------- state ---------- */
.state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 500; }
.state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--none); flex: none; }
.state.ok::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-wash); }
.state.down::before { background: var(--bad); border-radius: 2px; box-shadow: 0 0 0 3px var(--bad-wash); }
.state.warn::before { background: var(--warn); border-radius: 1px; transform: rotate(45deg); }
.state.maint::before { background: transparent; border: 2px solid var(--maint); }
.state.down { color: var(--bad); font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; font-size: 0.78rem; font-weight: 500; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.tag.bad { border-color: transparent; background: var(--bad-wash); color: var(--bad); }
.tag.warn { border-color: transparent; background: var(--warn-wash); color: var(--warn); }
.tag.ok { border-color: transparent; background: var(--ok-wash); color: var(--ok); }
.tag.maint { border-color: transparent; background: var(--maint-wash); color: var(--maint); }

/* ---------- the watch strip, sparkline, meters ---------- */
.strip { display: block; width: 100%; height: 22px; }
.strip rect { rx: 1px; }
.strip .s-ok { fill: var(--ok); opacity: 0.5; }
.strip .s-warn { fill: var(--warn); }
.strip .s-down { fill: var(--bad); }
.strip .s-maint { fill: var(--maint); opacity: 0.75; }
.strip .s-none { fill: var(--none); opacity: 0.7; }
.strip.tall { height: 44px; }
.rows .strip { height: 20px; min-width: 150px; }
.spark { width: 120px; height: 26px; display: block; }
.spark .line { fill: none; stroke: var(--info); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark .area { fill: var(--info); opacity: 0.14; stroke: none; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 0.83rem; margin: 8px 0 0; max-width: none; }
.legend .state::before { width: 8px; height: 8px; }
.legend .state { font-weight: 400; color: var(--muted); }
.legend .legend-note { margin-left: auto; }
.meter { display: block; width: 100%; height: 6px; border-radius: 3px; overflow: hidden; }
.meter .track { fill: var(--line); }
.meter .fill { fill: var(--info); }
.meter.ok .fill { fill: var(--ok); } .meter.bad .fill { fill: var(--bad); } .meter.warn .fill { fill: var(--warn); }
progress { width: 100%; height: 8px; accent-color: var(--beacon); }

/* ---------- controls ---------- */
.btn, button.link { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--raised); color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.35; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--beacon); border-color: var(--beacon); color: var(--beacon-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--hover); color: var(--ink); }
.btn.small { padding: 3px 9px; font-size: 0.86rem; }
.btn[aria-busy], .link[aria-busy], form[aria-busy] .btn { opacity: 0.55; pointer-events: none; }
button.link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button.link.danger, a.danger { color: var(--bad); }

.field { display: block; margin: 0 0 14px; max-width: 32rem; }
.field > span { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 5px; }
.field .hint { display: block; color: var(--muted); font-size: 0.84rem; font-weight: 400; margin-top: 5px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 7px 10px; width: 100%; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--beacon); outline-offset: 0; border-color: transparent; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0 8px 0 0; accent-color: var(--beacon); flex: none; }
textarea { min-height: 6.5rem; font-family: var(--mono); font-size: 0.88rem; }
.check { display: flex; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.check .hint, .check .sub, .check small { margin-left: 6px; color: var(--muted); }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.inline-form .field { margin: 0; flex: 1 1 16rem; }
.form-error { color: var(--bad); font-weight: 500; margin: 8px 0; padding: 8px 11px; background: var(--bad-wash); border-radius: var(--r-s); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; max-width: 44rem; }

.note { border: 1px solid var(--line); border-left: 3px solid var(--info); background: var(--surface); padding: 10px 14px; border-radius: var(--r-s); max-width: 72ch; }
.note.bad { border-left-color: var(--bad); background: var(--bad-wash); }
.note.warn { border-left-color: var(--warn); background: var(--warn-wash); }
.note.ok { border-left-color: var(--ok); background: var(--ok-wash); }
pre.snippet { background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-s); padding: 11px 13px; overflow-x: auto; font: 0.86rem/1.55 var(--mono); margin: 0 0 12px; white-space: pre-wrap; word-break: break-all; }

dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 22px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--beacon); }

/* Numbered steps. Default: a vertical flow whose steps hold real content (restore, commands to run).
   .inline: a compact row of pills that only names the steps. */
ol.steps { list-style: none; margin: 0 0 20px; padding: 0; counter-reset: step; display: grid; gap: 16px; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 0 44px; min-height: 30px; min-width: 0; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink); font-size: 0.85rem; font-weight: 600; }
ol.steps > li::after { content: ""; position: absolute; left: 13px; top: 34px; bottom: -12px; width: 2px; background: var(--line); }
ol.steps > li:last-child::after { display: none; }
ol.steps > li[aria-current]::before { background: var(--beacon); color: var(--beacon-ink); }
ol.steps > li > h2, ol.steps > li > h3 { margin: 4px 0 6px; }
ol.steps > li > p:last-child { margin-bottom: 0; }
ol.steps.inline { display: flex; gap: 6px; flex-wrap: wrap; }
ol.steps.inline > li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; min-height: 0; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-weight: 500; font-size: 0.9rem; }
ol.steps.inline > li::before { position: static; width: 22px; height: 22px; font-size: 0.78rem; }
ol.steps.inline > li::after { display: none; }
ol.steps.inline > li[aria-current] { color: var(--ink); border-color: var(--beacon); }

/* ---------- timeline ---------- */
ol.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
ol.timeline li { padding: 0 0 18px 24px; position: relative; border-left: 2px solid var(--line); }
ol.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--none); border: 2px solid var(--bg); }
ol.timeline li.bad::before { background: var(--bad); border-radius: 3px; }
ol.timeline li.ok::before { background: var(--ok); }
ol.timeline li.warn::before { background: var(--warn); }
ol.timeline .at { color: var(--muted); font-size: 0.85rem; }

/* ---------- dialogs, palette, toasts ---------- */
dialog.sheet { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 24px 26px; width: min(34rem, calc(100vw - 28px)); box-shadow: var(--shadow); }
dialog.sheet.wide { width: min(60rem, calc(100vw - 28px)); }
dialog::backdrop { background: rgb(5 9 20 / 0.62); backdrop-filter: blur(3px); }
dialog.sheet h2 { margin-bottom: 8px; font-size: 1.2rem; }
dialog.sheet .actions { justify-content: flex-end; margin-top: 20px; }
dialog.sheet .field { max-width: none; }

dialog.palette { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 0; width: min(38rem, calc(100vw - 24px)); margin-top: 12vh; box-shadow: var(--shadow); overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 15px 18px; font-size: 1.05rem; background: transparent; }
.palette input:focus-visible { outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-s); color: var(--ink); text-decoration: none; }
.palette li a small { color: var(--muted); margin-left: auto; font-size: 0.82rem; white-space: nowrap; }
.palette li a .icon { color: var(--muted); }
.palette li[aria-selected="true"] a { background: var(--hover); box-shadow: inset 2px 0 0 var(--beacon); }
.palette .none { padding: 18px; color: var(--muted); margin: 0; }
.palette footer { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { margin: 0; padding: 10px 15px; background: var(--raised); color: var(--ink); border: 1px solid var(--line-strong); border-left: 3px solid var(--ok); border-radius: var(--r-s); max-width: 30rem; box-shadow: var(--shadow); }
.toast.bad { border-left-color: var(--bad); }

.skeleton { border-radius: var(--r-s); background: linear-gradient(90deg, var(--line) 25%, var(--hover) 50%, var(--line) 75%); background-size: 200% 100%; color: transparent; min-height: 1em; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .rows td.wide { min-width: 130px; }
  .card { overflow-x: auto; }
  .head .actions .btn { flex: 1 1 auto; justify-content: center; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); z-index: 40; transform: translateX(-102%); box-shadow: var(--shadow); }
  .nav-open .rail { transform: none; }
  .nav-open::after { content: ""; position: fixed; inset: 0; background: rgb(5 9 20 / 0.6); z-index: 30; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 8px 14px; }
  .search-trigger .kbd, .search-trigger span { display: none; }
  .search-trigger { width: auto; padding: 8px; border-color: transparent; background: none; }
  main { padding: 18px 14px 60px; }
  .rows th, .rows td { padding: 9px 10px; }
  .hide-narrow { display: none; }
  .hero .lede { font-size: 1.32rem; }
  .hero { padding: 20px 18px 18px; }
  #toasts { left: 14px; right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .rail { transition: transform 0.18s ease-out; }
  dialog[open] { animation: rise 0.16s ease-out; }
  .toast { animation: rise 0.18s ease-out; }
  @keyframes rise { from { transform: translateY(8px); opacity: 0; } }
  .live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ping 2.4s ease-out infinite; }
  @keyframes ping { 0% { transform: scale(0.5); opacity: 0.7; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
  .skeleton { animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { to { background-position: -200% 0; } }
  .btn, .rail li a, .rows td, .icon-btn { transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
}
