/* Prometheus admin: a calm starship-console look. Black canvas, pill shapes, condensed type. */
:root {
  --bg: #000;
  --surface: #0d0d10;
  --surface-2: #16161b;
  --line: #24242b;
  --text: #f1eee9;
  --muted: #8d8a94;
  --orange: #f5a25d;
  --gold: #f1c86b;
  --lilac: #c99bd8;
  --blue: #9aa6f5;
  --red: #e2726e;
  --green: #8fd6a4;
  --rail: 150px;
  --bar: 22px;
  --display: 'Barlow Condensed', 'Antonio', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: var(--display); /* one font family everywhere */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 19px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Frame: elbow + top bar + side rail ---------- */
.frame {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: 96px auto;
  column-gap: 0;
  min-height: 100vh; /* the window scrolls; elbow, top bar, rail and footer are sticky */
  padding: 16px 20px 20px;
}
/* Black strip over the frame's 16px top padding, so scrolled content never shows above the top bar. */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 16px; background: var(--bg); z-index: 8; }
.elbow {
  position: sticky; top: 16px; z-index: 7; /* above the top bar, so its arm joins the orange bar */
  background: var(--orange);
  border-top-left-radius: 64px;
  margin-right: -36px; /* the arm reaches under the top bar */
}
.elbow::after {
  content: '';
  position: absolute;
  right: 0; top: var(--bar); bottom: 0;
  width: 36px;
  background: var(--bg);
  border-top-left-radius: 28px;
}
.topbar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-left: 36px;
  position: sticky; top: 16px; z-index: 6;
  height: 96px; background: var(--bg); /* scrolled content passes underneath */
}
.topbar .seg { height: var(--bar); border-radius: 0; background: var(--orange); }
.topbar .seg.grow { flex: 1; }
.topbar .seg.a { width: 64px; background: var(--lilac); }
.topbar .seg.b { width: 28px; background: var(--blue); border-radius: 0 999px 999px 0; }
.topbar .title {
  margin: -8px 4px 0; /* centres the capitals on the 22px bar */
  font: 800 38px/1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
  white-space: nowrap;
}
.topbar .sub {
  position: absolute;
  margin-top: 34px;
  font: 700 17px/1 var(--display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  /* Sticky under the top bar (16 + 96 = 112px) and sized to end 20px above the window bottom,
     so the rounded orange end always sits at the bottom of the window. */
  position: sticky; top: 112px; align-self: start;
  height: calc(100vh - 132px); min-height: 0;
}
/* System Commands (left rail). Each command is a .cmd block; pick a colour with cmd-1..cmd-4,
   use cmd-danger for destructive commands. */
.rail .cmd, .rail .fill {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  text-align: left;
  padding: 10px 12px; /* compact: no minimum height */
  border: 0;
  width: 100%;
  background: var(--lilac);
  color: #000;
  font: 800 19px/1 var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s;
}
.rail .cmd:hover { filter: brightness(1.15); }
.rail .cmd[aria-current="page"] { box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.35); }
.rail .cmd-1 { background: var(--lilac); }
.rail .cmd-2 { background: var(--blue); }
.rail .cmd-3 { background: var(--gold); }
.rail .cmd-4 { background: var(--green); }
.rail .cmd-danger { background: var(--red); }
.rail .fill { flex: 1; background: var(--orange); border-bottom-left-radius: 28px; cursor: default; }
.rail form { margin: 0; display: contents; }
/* Folder commands with 2 to 4 entries: a \ marker on the right, and on hover (or keyboard focus)
   a menu of those pages opens to the right of the rail. */
.rail { z-index: 6; } /* the menu opens over the page and its footer */
.rail .cmd-group { position: relative; display: flex; }
.rail .cmd-mark { margin-left: auto; padding-left: 8px; opacity: 0.7; }
.rail .cmd-sub {
  position: absolute; left: 100%; top: -6px; /* the first item lines up with the command */
  padding: 6px; /* 6px black around the items, same as the gap between them */
  display: flex; flex-direction: column; gap: 6px;
  min-width: 200px;
  background: var(--bg); /* dark backing, so the gaps between items are not see-through */
  background-clip: padding-box; border-left: 8px solid transparent; padding-left: 0; /* 8px hover bridge on the left stays clear */
  border-radius: 0 26px 26px 0; /* item's round end plus the 6px padding */
  opacity: 0; visibility: hidden; transform: translateX(-6px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.rail .cmd-sub .cmd { width: auto; white-space: nowrap; border-radius: 0 999px 999px 0; padding-right: 22px; }
.rail .cmd-group:is(:hover, :focus-within) .cmd-sub { opacity: 1; visibility: visible; transform: none; }
.rail .cmd-group:is(:hover, :focus-within) > .cmd { filter: brightness(1.15); }
/* Badge at the bottom of the orange end block, in black. */
.rail .fill { justify-content: center; padding-bottom: 28px; }
.rail .fill .badge { width: 56px; height: 56px; fill: #000; display: block; }

/* main fills the full width and at least the window height, so the content reaches the right edge
   and the footer sits at the bottom even on short pages. */
main {
  display: flex;
  flex-direction: column;
  padding: 18px 0 0 36px;
  min-height: calc(100vh - 132px);
  width: 100%;
}
main > section:last-of-type { margin-bottom: 44px; }

/* ---------- Sections ---------- */
section + section { margin-top: 40px; }
.section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 18px;
}
.section-head h2 {
  margin: 0;
  font: 800 24px/1 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.section-head::before { content: ''; width: 28px; height: 14px; border-radius: 999px; background: var(--blue); }
.section-head .meta { margin-left: auto; color: var(--muted); font: 700 18px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
.sites-section .section-head h2 { color: var(--orange); }
.sites-section .section-head::before { background: var(--orange); }
.build-section .section-head h2 { color: var(--lilac); }
.build-section .section-head::before { background: var(--lilac); }

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 28px 28px;
}
.stat .label {
  font: 700 17px/1 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat .value {
  margin-top: 8px;
  font: 700 31px/1.1 var(--display);
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .value small { font-size: 20px; color: var(--muted); letter-spacing: 0.04em; }
.stat .value.ok { color: var(--green); }
.stat .value.down { color: var(--red); }
.bar { margin-top: 10px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--orange); transition: width 0.6s ease; }
.bar.warn span { background: var(--gold); }
.bar.crit span { background: var(--red); }

/* ---------- Sites ---------- */
.site-actions { display: flex; gap: 8px; }
.pill {
  padding: 8px 18px 7px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #000;
  font: 800 19px/1 var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.15s;
}
.pill:hover { filter: brightness(1.15); }
.pill.danger { background: var(--red); }
.pill:disabled { opacity: 0.4; cursor: wait; }

.sites { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px 12px 0;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  transition: background 0.2s;
}
.site::before {
  content: ''; align-self: stretch; width: 14px; flex: none;
  background: var(--orange);
  transition: background 0.2s;
}
.site.off::before { background: #3a3a42; }
.site .name { flex: 1; min-width: 0; }
.site .name strong { display: block; font: 700 24px/1.15 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.site .name a { color: var(--muted); font-size: 17px; text-decoration: none; overflow-wrap: anywhere; }
.site .name a:hover { color: var(--text); text-decoration: underline; }
.site.off .name strong { color: var(--muted); }
.site.off .name a { pointer-events: none; opacity: 0.6; }
.site .state { font: 700 17px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange); width: 62px; text-align: right; }
.site.off .state { color: var(--muted); }
.empty { color: var(--muted); padding: 12px 0; }
.dot { display: none; }

.switch { position: relative; width: 52px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: #2c2c33; transition: background 0.2s; }
.switch .track::after {
  content: ''; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: #8d8a94; transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .track { background: var(--orange); }
.switch input:checked + .track::after { transform: translateX(24px); background: #000; }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 3px; }
.switch input:disabled { cursor: wait; }

/* ---------- Build ---------- */
dl { display: grid; grid-template-columns: 140px 1fr; gap: 12px 20px; margin: 0; }
dt { font: 700 17px/1.6 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
dd.hash { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--gold); }

.footer-line {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: auto; padding: 14px 0; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; z-index: 5; background: var(--bg); /* always visible while scrolling */
  color: var(--muted); font: 700 17px/1.4 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
}
.footer-line b { color: var(--text); font-weight: 400; }
.update-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: 700 17px/1.4 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
}
.update-btn b { color: var(--gold); font-weight: 700; }
.update-btn:hover b { text-decoration: underline; text-underline-offset: 3px; }
.update-btn:disabled { cursor: wait; }
.update-btn:disabled b { color: var(--muted); }

.toast {
  position: fixed; right: 20px; bottom: 64px; z-index: 50;
  padding: 10px 20px 9px; border-radius: 999px; background: var(--gold); color: #000;
  font: 800 19px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase;
  transform: translateY(12px); opacity: 0; transition: all 0.25s; pointer-events: none;
}
.toast.show { transform: none; opacity: 1; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 400px; }
.login-head { display: flex; align-items: center; gap: 8px; margin-bottom: 30px; }
.login-head .cap { width: 40px; height: 40px; border-radius: 999px 0 0 999px; background: var(--orange); }
.login-head .seg { flex: 1; height: 40px; background: var(--orange); }
.login-head .title { font: 800 34px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); padding: 0 6px; }
.login-head .end { width: 22px; height: 40px; border-radius: 0 999px 999px 0; background: var(--lilac); }
.login .sub { margin: 0 0 22px; color: var(--muted); font: 700 18px/1 var(--display); letter-spacing: 0.18em; text-transform: uppercase; }
.login label { display: block; margin: 16px 0 6px; color: var(--muted); font: 700 17px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; }
.login input {
  width: 100%; padding: 12px 16px; border: 2px solid #3a3a42; border-radius: 12px;
  background: var(--surface); color: var(--text); font: 19px var(--body); outline: none; transition: border-color 0.15s;
}
.login input:focus { border-color: var(--orange); }
.login .pill { width: 100%; margin-top: 26px; padding: 13px; font-size: 21px; background: var(--orange); }
.login .err { min-height: 1.4em; margin: 0; color: var(--red); font-size: 18px; }

/* ---------- Small screens: rail becomes a row of pills ---------- */
@media (max-width: 760px) {
  body::before { display: none; }
  .frame { display: block; padding: 0 16px 24px; }
  .elbow { display: none; }
  .topbar { position: sticky; top: 0; z-index: 6; height: auto; background: var(--bg); padding: 14px 0 10px; }
  .topbar .seg.grow { border-radius: 999px 0 0 999px; }
  .topbar .title { font-size: 30px; margin-top: -4px; }
  .topbar .seg.a { display: none; }
  .topbar .sub { position: static; display: none; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 14px 0 0; }
  .rail .cmd { width: auto; min-height: 0; padding: 8px 14px 7px; border-radius: 999px; align-items: center; }
  .rail .fill { display: none; }
  .rail .cmd-group { display: contents; }
  .rail .cmd-mark, .rail .cmd-sub { display: none; }
  main { padding: 24px 0 0; min-height: 0; }
  dl { grid-template-columns: 1fr; gap: 2px; }
  dd { margin-bottom: 10px; }
  .site .state { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* ---------- Apps, tokens and settings forms ---------- */
.tokens-section .section-head h2 { color: var(--gold); }
.tokens-section .section-head::before { background: var(--gold); }
.section-head .meta.ok { color: var(--green); }
.section-head .meta.warn { color: var(--gold); }
section + section { margin-top: 44px; }
.pill.small { padding: 6px 14px 5px; font-size: 17px; }
.pill.ghost { background: var(--surface-2); color: var(--text); }
.panel-form { margin: 0 0 18px; padding: 18px 20px; background: var(--surface); border-radius: 14px; border-left: 14px solid var(--blue); }
.panel-form.open { border-left-color: var(--lilac); }
.panel-form .hint { margin: 0 0 14px; color: var(--muted); font-size: 18px; }
.panel-form .hint b { color: var(--text); font-weight: 500; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 18px; }
.grid-form .wide { grid-column: span 2; }
.grid-form label, .app-picks legend { display: block; color: var(--muted); font: 700 17px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; }
.grid-form label small { font-size: 14px; letter-spacing: 0.1em; opacity: 0.7; margin-left: 6px; }
.panel-form input:not([type=checkbox]), .panel-form select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  background: var(--bg); color: var(--text); border: 2px solid #3a3a42; border-radius: 10px;
  font: 19px/1.3 var(--body);
}
.panel-form input:focus, .panel-form select:focus { outline: none; border-color: var(--orange); }
.app-picks { margin: 16px 0 0; padding: 0; border: 0; }
.app-picks div { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.token-row { display: flex; gap: 10px; align-items: center; }
.token-row input { margin-top: 0 !important; flex: 1; }
.new-token { margin: 0 0 18px; padding: 16px 20px; border-radius: 14px; background: var(--surface); border-left: 14px solid var(--gold); }
.new-token p { margin: 0 0 10px; }
.new-token code { flex: 1; padding: 10px 12px; border-radius: 10px; background: var(--bg); color: var(--gold); font: 16px/1.3 ui-monospace, 'Cascadia Mono', Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.site .name .detail { display: block; color: var(--muted); font-size: 17px; }
.site .name .detail.err { color: var(--red); }
.site .name .url-off { color: var(--muted); font-size: 17px; opacity: 0.6; }
.site.token::before { background: var(--gold); }
.site.token.off::before { background: #3a3a42; }
.toggles { display: flex; gap: 18px; }
.toggle { display: flex; align-items: center; gap: 8px; }
.toggle-label { font: 700 16px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.row-actions { display: flex; gap: 8px; }
@media (max-width: 760px) {
  .site.app, .site.token { flex-wrap: wrap; padding-left: 0; }
  .site.app .name { flex-basis: calc(100% - 40px); }
  .toggles, .row-actions { margin-left: 30px; }
  .grid-form .wide { grid-column: auto; }
  .token-row { flex-wrap: wrap; }
}

/* ---------- App pages (docs rendered from Markdown) ---------- */
.doc { max-width: 860px; padding-bottom: 32px; font-size: 20px; line-height: 1.65; }
.doc h1, .doc h2, .doc h3, .doc h4 { font-family: var(--display); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.1; }
.doc h1 { font-size: 38px; color: var(--orange); margin: 0 0 20px; }
.doc h2 { font-size: 28px; color: var(--blue); margin: 36px 0 12px; }
.doc h3 { font-size: 23px; color: var(--lilac); margin: 28px 0 10px; }
.doc h4 { font-size: 20px; color: var(--gold); margin: 22px 0 8px; }
.doc a { color: var(--gold); text-underline-offset: 3px; }
.doc code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font: 0.9em ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.doc pre { padding: 14px 16px; border-radius: 12px; background: var(--surface); overflow-x: auto; }
.doc pre code { padding: 0; background: none; }
.doc blockquote { margin: 16px 0; padding: 4px 18px; border-left: 8px solid var(--lilac); border-radius: 4px; color: var(--muted); }
.doc table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.doc th, .doc td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.doc th { font: 700 17px/1.2 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.doc img { max-width: 100%; border-radius: 10px; }
.doc hr { border: 0; height: 6px; border-radius: 999px; background: var(--surface-2); margin: 28px 0; }
.doc ul.page-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.doc ul.page-list a { display: block; padding: 10px 16px; border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--text); font: 700 21px/1.2 var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.doc ul.page-list a:hover { background: var(--surface-2); color: var(--orange); }
.app-login { max-width: 420px; }
.app-login details { margin-top: 16px; color: var(--muted); }
.app-login summary { cursor: pointer; font: 700 17px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; }
.rail .fill img.badge { width: 56px; height: 56px; }
.doc .wikilink.missing { color: var(--red); border-bottom: 1px dashed var(--red); cursor: help; }

/* Checkboxes in the console style: a small rounded block that lights up orange with a black tick.
   (The on/off switches use their own hidden input and are not affected.) */
input[type=checkbox]:not(.switch input) {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 22px; height: 22px; margin: 0; vertical-align: -5px;
  border-radius: 7px 4px 4px 7px; border: 2px solid #3a3a42; background: var(--surface-2);
  display: inline-grid; place-content: center; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
input[type=checkbox]:not(.switch input)::before {
  content: ''; width: 11px; height: 6px; margin-top: -3px;
  border: solid #000; border-width: 0 0 3px 3px; transform: rotate(-45deg) scale(0);
  transition: transform 0.12s;
}
input[type=checkbox]:not(.switch input):hover { border-color: var(--orange); }
input[type=checkbox]:not(.switch input):checked { background: var(--orange); border-color: var(--orange); }
input[type=checkbox]:not(.switch input):checked::before { transform: rotate(-45deg) scale(1); }
input[type=checkbox]:not(.switch input):disabled { cursor: default; opacity: 0.85; }
.check { gap: 10px; font: 700 19px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
/* Markdown task lists: the box sits centred on the first line of its text, even when the text wraps. */
.doc li:has(> input[type=checkbox]) { list-style: none; position: relative; margin-left: -1.2em; padding-left: 32px; }
.doc li > input[type=checkbox]:not(.switch input) { position: absolute; left: 0; top: calc((1lh - 22px) / 2); margin: 0; font-size: inherit; line-height: inherit; }
.doc li:has(> p > input[type=checkbox]) { list-style: none; margin-left: -1.2em; }

/* App header search (docs apps), under the title on the right */
.topbar .app-search {
  position: absolute; right: 0; top: 40px; width: min(320px, 40%);
  padding: 8px 14px; border: 2px solid #3a3a42; border-radius: 999px;
  background: var(--surface); color: var(--text); font: 600 19px/1.2 var(--display); letter-spacing: 0.04em;
}
.topbar .app-search:focus { outline: none; border-color: var(--orange); }
.topbar .app-search::placeholder { color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; font-size: 17px; }
.doc .search-meta { color: var(--muted); }
.doc ul.search-results { list-style: none; padding: 0; display: grid; gap: 10px; }
.doc ul.search-results a { display: block; padding: 12px 18px; border-radius: 14px; background: var(--surface); border-left: 10px solid var(--orange); text-decoration: none; color: var(--text); }
.doc ul.search-results a:hover { background: var(--surface-2); }
.doc ul.search-results b { display: block; font: 700 23px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.doc ul.search-results .path { display: block; color: var(--muted); font-size: 17px; }
.doc ul.search-results .snippet { display: block; margin-top: 4px; color: var(--text); opacity: 0.85; }
.doc mark { background: var(--gold); color: #000; border-radius: 3px; padding: 0 2px; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .topbar .app-search { position: static; width: 100%; margin-top: 10px; }
  .topbar:has(.app-search) { flex-wrap: wrap; }
}
.type-tag { display: inline-block; margin-left: 10px; padding: 3px 9px 2px; border-radius: 999px; vertical-align: 3px; background: var(--lilac); color: #000; font: 800 14px/1 var(--display); letter-spacing: 0.12em; }
.type-tag.node { background: var(--green); }

/* ---------- App pages: Report bug ---------- */
.doc .page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 20px; }
.doc .page-head > :is(h1, h2, h3, h4, h5, h6) { margin: 0; }
.doc .page-head-empty { justify-content: flex-end; }
.doc .bug-toggle { flex: none; margin-top: 6px; background: var(--red); }
.doc .bug-toggle[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.doc .bug-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease, margin 0.25s ease; }
.doc .bug-panel.open { grid-template-rows: 1fr; margin: 0 0 24px; }
.doc .bug-form { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0.25s; }
.doc .bug-panel.open .bug-form { visibility: visible; }
.doc .bug-form label { display: block; margin: 16px 0 8px; color: var(--muted); font: 700 17px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; }
.doc .bug-form label:first-child { margin-top: 0; }
.doc .bug-form label .opt { color: var(--line); filter: brightness(2); letter-spacing: 0.1em; }
.doc .bug-form :is(input, textarea) {
  display: block; width: 100%; box-sizing: border-box;
  padding: 12px 16px; border: 2px solid var(--line); border-left: 14px solid var(--red); border-radius: 14px;
  background: var(--surface); color: var(--text); font: 400 19px/1.4 var(--body);
}
.doc .bug-form textarea { min-height: 120px; resize: vertical; }
.doc .bug-form :is(input, textarea):focus { outline: none; border-color: var(--orange); border-left-color: var(--red); }
.doc .bug-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.doc .bug-status { color: var(--muted); font-size: 18px; }
.doc .bug-status.ok { color: var(--green); }
.doc .bug-status.err { color: var(--red); }

/* ---------- App pages: front matter table ---------- */
.doc table.front-matter { width: auto; min-width: min(100%, 420px); margin: 0 0 24px; background: var(--surface); border-radius: 14px; overflow: hidden; border-left: 14px solid var(--lilac); }
.doc table.front-matter th { width: 1%; white-space: nowrap; padding-right: 28px; color: var(--lilac); }
.doc table.front-matter tr:last-child :is(th, td) { border-bottom: 0; }
.doc table.front-matter .none { color: var(--muted); }

/* Decision IDs (D-002): dotted underline with a console tooltip holding the decision's definition. */
.doc .decision { position: relative; border-bottom: 1px dotted currentColor; cursor: help; white-space: nowrap; }
.doc .decision-tip {
  position: absolute; left: -12px; top: calc(100% + 10px); z-index: 20;
  width: max-content; max-width: min(380px, 80vw); padding: 12px 16px 14px 20px;
  border-radius: 6px 16px 16px 6px; border-left: 10px solid var(--lilac); background: var(--surface-2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
  color: var(--text); font: 400 17px/1.45 var(--body); letter-spacing: 0.01em; text-transform: none; white-space: normal; text-align: left;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s, visibility 0.15s; pointer-events: none;
}
.doc .decision-tip::before { content: ''; position: absolute; left: 8px; top: -7px; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--surface-2); }
.doc .decision:is(:hover, :focus-visible) .decision-tip { opacity: 1; visibility: visible; transform: none; }
.doc .decision.missing .decision-tip { border-left-color: var(--red); }
.doc .decision-tip { white-space: pre-line; }
.doc .decision-tip.above { top: auto; bottom: calc(100% + 10px); transform: translateY(4px); }
.doc .decision-tip.above::before { top: auto; bottom: -7px; border-bottom: 0; border-top: 7px solid var(--surface-2); }

/* ---------- Hover glow on buttons ----------
   Every rail command and pill gets a soft glow in its own colour on hover (and keyboard focus).
   --glow carries the button's colour; it is mixed with transparency below. */
.rail .cmd, .pill { --glow: var(--lilac); transition: filter 0.12s, box-shadow 0.12s, opacity 0.15s; }
.pill { --glow: var(--blue); }
.rail .cmd-1 { --glow: var(--lilac); }
.rail .cmd-2 { --glow: var(--blue); }
.rail .cmd-3 { --glow: var(--gold); }
.rail .cmd-4 { --glow: var(--green); }
.rail .cmd-danger, .pill.danger { --glow: var(--red); }
.pill.ghost { --glow: var(--muted); }
.login .pill { --glow: var(--orange); }
.rail .cmd:is(:hover, :focus-visible), .rail .cmd-group:is(:hover, :focus-within) > .cmd, .pill:not(:disabled):is(:hover, :focus-visible) {
  position: relative; z-index: 1; /* glow shows over the neighbouring buttons */
  box-shadow: 0 0 14px 1px color-mix(in srgb, var(--glow) 55%, transparent);
}
