/*
 * KPD Beta Portal styles.
 *
 * The tokens are KPD's own (src/styles/app.css in the KPD repo): the same
 * slate text, teal accent, navy chrome, canvas dot grid and note yellow, so
 * the portal and the designer read as one product. Light on :root, dark under
 * [data-theme="dark"] (theme.js) or the OS setting when no choice is saved.
 *
 * Chart colours (--c1…--c5) are the palette-role groups in a fixed order that
 * was checked for colour-blind separation, with separate steps for dark mode.
 */

:root {
  --font-ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #f1f5f9;
  --bg-selected: #e6f2f0;
  --chrome: #1e2532;
  --chrome-deep: #0b1220;
  --chrome-line: #334155;
  --chrome-text: #e2e8f0;
  --chrome-muted: #94a3b8;

  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #ccfbf1;
  --accent-ink: #0f766e;
  --focus: #14b8a6;

  --error: #dc2626;
  --error-soft: #fee2e2;
  --error-ink: #991b1b;
  --warning: #c2410c;
  --warning-soft: #ffedd5;
  --warning-ink: #7c2d12;
  --info-soft: #dbeafe;
  --info-ink: #1e3a8a;
  --success: #15803d;
  --success-soft: #dcfce7;
  --success-ink: #14532d;

  --canvas-bg: #f8fafc;
  --canvas-dot: #cbd5e1;
  --note-bg: #fef9c3;
  --note-border: #fde68a;
  --note-text: #422006;

  --c1: #16a34a; /* Sources */
  --c2: #7c3aed; /* Processing */
  --c3: #c2410c; /* Sinks */
  --c4: #2563eb; /* Topics */
  --c5: #94a3b8; /* Other */
  --series: #0f766e;
  --grid: #e2e8f0;

  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 1px 3px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 10px 30px rgb(15 23 42 / 0.12);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1623;
    --bg-subtle: #131c2c;
    --bg-muted: #1a2436;
    --bg-selected: #123a36;
    --chrome: #0b1220;
    --chrome-deep: #070d18;
    --chrome-line: #243045;
    --text: #e2e8f0;
    --text-muted: #a3b1c6;
    --text-faint: #8090a6;
    --border: #243045;
    --border-strong: #334155;
    --accent: #0d9488;
    --accent-hover: #14b8a6;
    --accent-soft: #134e4a;
    --accent-ink: #5eead4;
    --focus: #2dd4bf;
    --error: #f87171;
    --error-soft: #3b1518;
    --error-ink: #fecaca;
    --warning: #fb923c;
    --warning-soft: #3a1d0b;
    --warning-ink: #fed7aa;
    --info-soft: #172554;
    --info-ink: #bfdbfe;
    --success: #4ade80;
    --success-soft: #0f2e1b;
    --success-ink: #bbf7d0;
    --canvas-bg: #0d1420;
    --canvas-dot: #243045;
    --note-bg: #3f3a12;
    --note-border: #6b5e12;
    --note-text: #fef9c3;
    --c1: #16a34a;
    --c2: #8b5cf6;
    --c3: #ea580c;
    --c4: #3b82f6;
    --c5: #64748b;
    --series: #14b8a6;
    --grid: #243045;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 30px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0f1623;
  --bg-subtle: #131c2c;
  --bg-muted: #1a2436;
  --bg-selected: #123a36;
  --chrome: #0b1220;
  --chrome-deep: #070d18;
  --chrome-line: #243045;
  --text: #e2e8f0;
  --text-muted: #a3b1c6;
  --text-faint: #8090a6;
  --border: #243045;
  --border-strong: #334155;
  --accent: #0d9488;
  --accent-hover: #14b8a6;
  --accent-soft: #134e4a;
  --accent-ink: #5eead4;
  --focus: #2dd4bf;
  --error: #f87171;
  --error-soft: #3b1518;
  --error-ink: #fecaca;
  --warning: #fb923c;
  --warning-soft: #3a1d0b;
  --warning-ink: #fed7aa;
  --info-soft: #172554;
  --info-ink: #bfdbfe;
  --success: #4ade80;
  --success-soft: #0f2e1b;
  --success-ink: #bbf7d0;
  --canvas-bg: #0d1420;
  --canvas-dot: #243045;
  --note-bg: #3f3a12;
  --note-border: #6b5e12;
  --note-text: #fef9c3;
  --c1: #16a34a;
  --c2: #8b5cf6;
  --c3: #ea580c;
  --c4: #3b82f6;
  --c5: #64748b;
  --series: #14b8a6;
  --grid: #243045;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 30px rgb(0 0 0 / 0.45);
  color-scheme: dark;
}

/* ---- base ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Keep the footer at the bottom on short pages (the admin shell has its own grid). */
body:not(.admin) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body:not(.admin) > main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--bg);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
}

.skip-link:focus {
  left: 8px;
}

.icon {
  flex: none;
  vertical-align: -0.15em;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 13px;
}

.optional {
  font-weight: 400;
  color: var(--text-faint);
  font-size: 13px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 560px;
}

/* ---- buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 500 15px/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  color: var(--text);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--bg);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.btn-quiet {
  color: var(--text-muted);
}

.btn-quiet:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(0.92);
  color: #fff;
}

.btn-danger-quiet {
  color: var(--error);
}

.btn-danger-quiet:hover {
  background: var(--error-soft);
  color: var(--error);
}

.btn-ghost-dark {
  color: var(--chrome-text);
  border-color: var(--chrome-line);
}

.btn-ghost-dark:hover {
  background: rgb(255 255 255 / 0.06);
  color: #fff;
}

/* ---- top bar (public pages) ---------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  background: var(--chrome);
  color: var(--chrome-text);
  border-bottom: 1px solid var(--chrome-line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--chrome-text);
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  color: #5eead4;
  display: inline-flex;
}

.brand-name {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
}

.brand-pill {
  font-size: 12px;
  font-weight: 500;
  color: #5eead4;
  border: 1px solid rgb(94 234 212 / 0.4);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  color: var(--chrome-muted);
  text-decoration: none;
  font-size: 15px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
}

.nav-link.is-active {
  border-bottom-color: var(--focus);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 0;
  background: none;
  color: var(--chrome-muted);
  cursor: pointer;
}

.theme-toggle:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.06);
}

.when-dark {
  display: none;
}

:root[data-theme='dark'] .when-dark {
  display: inline-flex;
}

:root[data-theme='dark'] .when-light {
  display: none;
}

/* ---- hero: the beta drawn on KPD's dark canvas ------------------------------ */

.hero {
  background-color: var(--chrome-deep);
  background-image:
    radial-gradient(circle at 12% 0%, rgb(20 184 166 / 0.16), transparent 42%),
    radial-gradient(circle at 92% 100%, rgb(124 58 237 / 0.18), transparent 46%),
    radial-gradient(circle, rgb(148 163 184 / 0.16) 1px, transparent 1.4px);
  background-size: auto, auto, 16px 16px;
  color: var(--chrome-text);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 48px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 64px;
}

.hero-title {
  font-size: clamp(34px, 4.4vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  background: linear-gradient(100deg, #ffffff 0%, #ffffff 38%, #99f6e4 72%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.version {
  display: inline-block;
  vertical-align: middle;
  font: 500 14px/1 var(--font-mono);
  letter-spacing: 0;
  color: #5eead4;
  -webkit-text-fill-color: #5eead4;
  border: 1px solid rgb(94 234 212 / 0.45);
  border-radius: 999px;
  padding: 5px 10px;
  margin-left: 6px;
  position: relative;
  top: -4px;
}

.hero-tagline {
  font-size: 19px;
  color: var(--chrome-muted);
  margin-bottom: 20px;
}

.hero-lede {
  font-size: 17px;
  color: #cbd5e1;
  max-width: 34rem;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-guide {
  margin-top: 18px;
  font-size: 15px;
  color: var(--chrome-muted);
}

.hero-guide a {
  color: #5eead4;
  font-weight: 500;
}

.hero-figure {
  margin: 0;
}

.hero-figure figcaption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--chrome-muted);
}

.hero-pipeline {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.hp-box {
  fill: #111a2b;
  stroke-width: 1.5;
}

.hp-name {
  font: 600 10.5px var(--font-mono);
  fill: #e2e8f0;
}

.hp-kind {
  font: 400 10px var(--font-ui);
  fill: #94a3b8;
}

.hp-port {
  fill: #0b1220;
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.hp-link {
  stroke: #64748b;
  stroke-width: 1.5;
}

.hp-link-err {
  stroke: #ef4444;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.hp-edge-label {
  font: 400 10px var(--font-mono);
  fill: #f87171;
}

.hp-dot {
  fill: #38bdf8;
  stroke: #0b1220;
  stroke-width: 1;
}

.hp-dot-err {
  fill: #f87171;
  stroke: #0b1220;
  stroke-width: 1;
}

/* The one page-load moment: the assets drop onto the canvas left to right. */
.hp-node {
  animation: hp-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hp-node[data-i='1'] { animation-delay: 90ms; }
.hp-node[data-i='2'] { animation-delay: 180ms; }
.hp-node[data-i='3'] { animation-delay: 270ms; }
.hp-node[data-i='4'] { animation-delay: 420ms; }

@keyframes hp-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp-node {
    animation: none;
  }
  .hp-stream {
    display: none;
  }
}

/* ---- Two ways to work: Storyboard and Engineer modes ------------------------ */

.modes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.mode {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: 'switch .' 'canvas text';
  column-gap: 32px;
  row-gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 20px 24px 24px;
  background: var(--chrome);
  color: var(--chrome-text);
  border: 1px solid var(--chrome-line);
  border-radius: 12px;
}

.mode-flip {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: '. switch' 'text canvas';
}

.mode > .mode-switch { grid-area: switch; justify-self: start; }
.mode > .mode-canvas { grid-area: canvas; }
.mode > .mode-text { grid-area: text; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.mode h3 {
  margin: 0;
  font-size: 20px;
  color: #fff;
}

.mode-for {
  margin: 0;
  color: var(--chrome-muted);
}

.mode ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.mode-switch {
  align-self: flex-start;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--chrome-line);
  border-radius: 999px;
  background: var(--chrome-deep);
  font: 600 12px var(--font-ui);
}

.mode-switch span {
  padding: 3px 11px;
  border-radius: 999px;
  color: var(--chrome-muted);
}

.mode-switch .on {
  background: #5eead4;
  color: #06221e;
}

.mode-canvas {
  padding: 12px;
  border-radius: var(--radius-lg);
  background-color: var(--chrome-deep);
  background-image: radial-gradient(circle, #1e293b 1px, transparent 1.2px);
  background-size: 16px 16px;
}

.mode-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.mode-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--accent-ink);
  font: 500 13px var(--font-mono);
}

.mode-link-arrow {
  width: 44px;
  height: 24px;
  transform: rotate(90deg);
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-link-arrow path:first-child {
  stroke-dasharray: 6 5;
}

.mode-foot {
  margin: 20px 0 0;
  color: var(--text-muted);
  max-width: 80ch;
}

.sb-box {
  fill: #111a2b;
  stroke-width: 1.5;
}

.sb-kind {
  font: 500 9.5px var(--font-ui);
  text-anchor: middle;
}

.sb-name {
  font: 600 11px var(--font-ui);
  fill: #e2e8f0;
  text-anchor: middle;
}

.sb-step {
  fill: #e2e8f0;
  stroke: #0b1220;
  stroke-width: 1.5;
}

.sb-step-n {
  font: 700 9px var(--font-ui);
  fill: #0b1220;
  text-anchor: middle;
}

.sb-note-box {
  fill: #fef3c7;
  stroke: #f59e0b;
  stroke-width: 1;
}

.sb-note-t {
  font: 600 10.5px var(--font-ui);
  fill: #422006;
}

.sb-note-s {
  font: 400 9.6px var(--font-ui);
  fill: #713f12;
}

.sb-focus {
  fill: none;
  stroke: #5eead4;
  stroke-width: 2;
}

.sb-rule {
  stroke: #334155;
  stroke-width: 1;
}

.sb-story {
  font: 400 11.5px var(--font-ui);
  fill: #cbd5e1;
}

.sb-story-n {
  font: 600 11px var(--font-mono);
  fill: #5eead4;
}

.en-bad {
  fill: #ef4444;
  stroke: #0b1220;
  stroke-width: 1.5;
}

.en-good {
  fill: #22c55e;
  stroke: #0b1220;
  stroke-width: 1.5;
}

.en-mark {
  font: 700 11px var(--font-ui);
  fill: #fff;
  text-anchor: middle;
}

.en-tick {
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Items drop onto each canvas in step order, as the hero's do. */
.sb-node {
  animation: hp-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sb-node[data-i='1'] { animation-delay: 120ms; }
.sb-node[data-i='2'] { animation-delay: 240ms; }
.sb-node[data-i='3'] { animation-delay: 360ms; }
.sb-node[data-i='4'] { animation-delay: 480ms; }
.sb-node[data-i='5'] { animation-delay: 640ms; }

@media (max-width: 960px) {
  .mode,
  .mode-flip {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'switch' 'canvas' 'text';
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sb-node {
    animation: none;
  }
  .sb-focus {
    display: none;
  }
}

/* ---- Website metrics: the world map ------------------------------------------- */

.world-map {
  --wm-0: #e2e8f0;
  --wm-1: #ccfbf1;
  --wm-2: #99f6e4;
  --wm-3: #2dd4bf;
  --wm-4: #0d9488;
  --wm-5: #115e59;
  --wm-edge: var(--bg);
  margin: 8px 0 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .world-map {
    --wm-0: #1e293b;
    --wm-1: #134e4a;
    --wm-2: #115e59;
    --wm-3: #0d9488;
    --wm-4: #2dd4bf;
    --wm-5: #99f6e4;
  }
}

:root[data-theme='dark'] .world-map {
  --wm-0: #1e293b;
  --wm-1: #134e4a;
  --wm-2: #115e59;
  --wm-3: #0d9488;
  --wm-4: #2dd4bf;
  --wm-5: #99f6e4;
}

.world-map svg {
  display: block;
  width: 100%;
  height: auto;
}

.world-map path {
  stroke: var(--wm-edge);
  stroke-width: 0.5;
}

.world-map path:hover {
  stroke: var(--text);
  stroke-width: 1;
}

.world-map .wm-0 { fill: var(--wm-0); }
.world-map .wm-1 { fill: var(--wm-1); }
.world-map .wm-2 { fill: var(--wm-2); }
.world-map .wm-3 { fill: var(--wm-3); }
.world-map .wm-4 { fill: var(--wm-4); }
.world-map .wm-5 { fill: var(--wm-5); }

.world-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.wm-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wm-swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
}

.world-legend .wm-0 { background: var(--wm-0); }
.world-legend .wm-1 { background: var(--wm-1); }
.world-legend .wm-2 { background: var(--wm-2); }
.world-legend .wm-3 { background: var(--wm-3); }
.world-legend .wm-4 { background: var(--wm-4); }
.world-legend .wm-5 { background: var(--wm-5); }

/* ---- About page sections ---------------------------------------------------- */

.band {
  padding: 64px 0;
}

.band-subtle {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.band h2 {
  font-size: 26px;
}

.section-lede {
  color: var(--text-muted);
  max-width: 68ch;
  margin-bottom: 32px;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.principle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: 12px;
}

.principle h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.principle p {
  color: var(--text-muted);
  margin: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.shot {
  margin: 0;
}

.shot-main {
  grid-column: 1 / -1;
}

.shot img,
.shot video {
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 100%;
  height: auto;
  background: var(--bg);
}

/* Short looping clips (pages/public.ts shotClip, js/clips.js), with a pause button in the corner. */
.clip {
  position: relative;
}
.clip-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0.85;
}
.clip-toggle:hover,
.clip-toggle:focus-visible {
  opacity: 1;
}
.clip-toggle[hidden] {
  display: none;
}

/* Light and dark screenshots: the one matching the site's theme shows (pages/public.ts shotImages). */
.shot .shot-dark { display: none; }
:root[data-theme='dark'] .shot .shot-dark { display: block; }
:root[data-theme='dark'] .shot .shot-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .shot .shot-dark { display: block; }
  :root:not([data-theme='light']) .shot .shot-light { display: none; }
}

.shot figcaption {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 10px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 18px;
  color: var(--text-muted);
}

.steps li b {
  color: var(--text);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 600 14px/28px var(--font-mono);
  text-align: center;
}

.caveats {
  padding: 0;
  margin: 0;
  list-style: none;
}

.caveats li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 14px;
  color: var(--text-muted);
}

.caveats li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--warning);
}

.caveats li b {
  color: var(--text);
}

.disclaimer {
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  color: var(--warning-ink);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  font-size: 15px;
}

/* ---- about the author -------------------------------------------------------- */

.author-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  max-width: 940px;
}

.author-photo {
  margin: 0;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  /* The photo is a cut-out: it sits on a teal disc like the About box's author badge. */
  background: radial-gradient(circle at 50% 35%, #99f6e4 0%, #5eead4 45%, #0f766e 100%);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent), var(--shadow-lg);
}

.author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.author-kicker {
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 6px;
}

.author-text h1 {
  font-size: clamp(32px, 4vw, 42px);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.author-role {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.author-lede {
  font-size: 18px;
  max-width: 60ch;
}

.author-text > p {
  max-width: 62ch;
}

.author-areas {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 4px 0 22px;
}

.author-areas li {
  font-size: 14px;
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
}

.author-areas li.author-areas-more {
  border-style: dashed;
  color: var(--text-muted);
  background: none;
}

.author-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 20px;
}

.author-note {
  font-size: 14px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.author-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}

.author-strip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.author-strip img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 50% 35%, #99f6e4 0%, #5eead4 45%, #0f766e 100%);
  object-fit: cover;
  object-position: center top;
}

.author-strip-link {
  margin-left: auto;
  color: var(--accent-ink);
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .author-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .author-photo {
    width: 180px;
    height: 180px;
  }
  .author-strip-link {
    display: none;
  }
}

.prose {
  max-width: 68ch;
}

.prose h1 {
  font-size: 34px;
}

.prose h2 {
  font-size: 20px;
  margin-top: 32px;
}

.prose p {
  color: var(--text-muted);
}

/* ---- footer ----------------------------------------------------------------- */

.site-footer {
  background: var(--chrome);
  color: var(--chrome-muted);
  font-size: 14px;
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-inner p {
  margin: 0;
}

.site-footer a {
  color: var(--chrome-text);
}

/* ---- canvas pages: register, sign in ------------------------------------- */

.canvas-band {
  background-color: var(--canvas-bg);
  background-image: radial-gradient(circle, var(--canvas-dot) 1px, transparent 1.3px);
  background-size: 16px 16px;
  padding: 56px 0;
}

.canvas-band-full {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.panel-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.panel-head h1,
.panel-head h2 {
  font-size: 17px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 20px;
}

.panel-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 14px;
}

.panel-foot-split {
  justify-content: space-between;
}

.register-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 56px;
  align-items: start;
}

.register-intro h1 {
  font-size: 34px;
}

.register-intro h2 {
  font-size: 17px;
  margin-top: 28px;
}

.register-intro p {
  color: var(--text-muted);
}

.band-open-beta .register-intro h2 {
  font-size: 26px;
  margin-top: 0;
}

.band-open-beta {
  scroll-margin-top: 64px;
}

.login-stack {
  width: min(420px, calc(100% - 32px));
  display: grid;
  gap: 20px;
}

.done {
  padding: 32px;
}

.done h1 {
  font-size: 26px;
}

.done-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  margin-bottom: 16px;
}

/* KPD's note colours: the broadcast is a sticky note on the canvas. */
.sticky-note {
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  color: var(--note-text);
  border-radius: 3px;
  padding: 12px 16px 14px;
  box-shadow: var(--shadow);
  transform: rotate(-0.6deg);
}

.sticky-note-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 6px;
}

.sticky-note-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 15px;
}

.sticky-note-text a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

/* ---- forms ------------------------------------------------------------------ */

.field {
  margin-bottom: 16px;
}

.field label,
.approve-form label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input:not([type]),
select,
textarea {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: 15px var(--font-ui);
}

textarea {
  height: auto;
  padding: 8px 10px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}

.has-error input,
.has-error select {
  border-color: var(--error);
}

.field-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.field-error {
  font-size: 13px;
  color: var(--error);
  margin: 4px 0 0;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.check {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 4px 10px;
  margin-bottom: 12px;
  font-size: 15px;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.check .field-error {
  grid-column: 2;
}

/* The terms, in short, right above the "I agree" box. */
.terms-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 4px 0 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.terms-box-head {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.terms-box ul {
  margin: 0 0 6px;
  padding-left: 18px;
}

.terms-box li {
  margin: 2px 0;
}

.terms-box p:last-child {
  margin: 0;
}

.terms-version {
  color: var(--text-faint);
  font-size: 14px;
}

.terms-summary {
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 18px;
  margin: 20px 0 8px;
}

.terms-summary p {
  margin: 0 0 4px;
  color: var(--text);
}

.terms-summary ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.panel-note {
  margin: 0;
  padding: 0 20px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.honey {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--error-soft);
  color: var(--error-ink);
  border-color: color-mix(in srgb, var(--error) 30%, transparent);
}

.alert-ok {
  background: var(--success-soft);
  color: var(--success-ink);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}

.alert-info {
  background: var(--info-soft);
  color: var(--info-ink);
  border-color: color-mix(in srgb, #2563eb 25%, transparent);
}

/* ---- admin: KPD's app shell -------------------------------------------------- */

body.admin {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 34px;
  height: 100vh;
  overflow: hidden;
  background: var(--canvas-bg);
}

.menubar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: var(--chrome);
  color: var(--chrome-text);
  border-bottom: 1px solid var(--chrome-line);
}

.menubar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menubar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--chrome-muted);
  font: 14px var(--font-ui);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
}

.project-head {
  flex-wrap: wrap;
  gap: 8px 16px;
}

.project-head-side {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-left: auto;
}

.project-head-side form {
  margin: 0;
}

.project-size {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.project-parts {
  margin: -4px 0 8px;
}

.project-parts b {
  font-weight: 600;
  color: var(--text);
}

.bin-empty {
  margin-top: 12px;
  text-align: right;
}

.menubar-version {
  padding: 3px 8px;
  border: 1px solid var(--chrome-line);
  border-radius: 999px;
  color: var(--chrome-muted);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.menubar-version:hover {
  color: #fff;
  border-color: var(--chrome-muted);
}

.menubar-link:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.06);
}

.admin-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 16px 16px 6px;
  margin: 0;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0 8px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}

.side-link .icon {
  color: var(--text-muted);
}

.side-link:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.side-link.is-active {
  background: var(--bg-selected);
  color: var(--accent-ink);
  font-weight: 600;
}

.side-link.is-active .icon {
  color: var(--accent-ink);
}

.count-badge[hidden] {
  display: none;
}

.count-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--error);
  color: #fff;
  font: 600 12px/20px var(--font-ui);
  text-align: center;
}

.admin-main {
  overflow-y: auto;
  padding: 24px 32px 40px;
}

.admin-title {
  font-size: 22px;
  margin-bottom: 16px;
}

.page-lede {
  color: var(--text-muted);
  max-width: 80ch;
}

/* A page's lede with an action beside it (Metrics → Export); the action drops below on narrow screens. */
.lede-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 24px;
}
.lede-row .page-lede {
  flex: 1 1 40ch;
  margin-top: 0;
}
.lede-row .btn {
  flex: none;
}
.lede-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 16px;
  background: var(--chrome);
  color: var(--chrome-muted);
  font: 12px var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
}

.statusbar-end {
  margin-left: auto;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.kpi b {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kpi span {
  color: var(--text-muted);
  font-size: 14px;
}

.kpi small {
  display: block;
  color: var(--text-faint);
  font-size: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  min-width: 0;
}

.card-grid > .card {
  margin-bottom: 0;
}

.span-2 {
  grid-column: span 2;
}

.card h2 {
  font-size: 16px;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.card form + .card-sub {
  margin-top: 18px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-head h2 {
  margin: 0;
}

.card-highlight {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--bg));
}

.secret {
  display: inline-block;
  font-size: 22px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  user-select: all;
}

.warn-text {
  color: var(--warning);
}

/* ---- charts ------------------------------------------------------------------- */

.chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart .grid {
  stroke: var(--grid);
  stroke-width: 1;
}

.chart .tick {
  font: 11px var(--font-ui);
  fill: var(--text-muted);
}

.series-line {
  fill: none;
  stroke: var(--series);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pt {
  outline: none;
}

.pt .hit {
  fill: transparent;
}

.pt .dot {
  fill: var(--series);
  stroke: var(--bg);
  stroke-width: 2;
  opacity: 0;
  pointer-events: none;
}

.pt:hover .dot,
.pt:focus-visible .dot {
  opacity: 1;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.chart-donut {
  width: 150px;
  flex: none;
}

.seg {
  fill: none;
  outline: none;
}

.seg:hover,
.seg:focus-visible {
  filter: brightness(1.1);
}

.seg.c-1 { stroke: var(--c1); }
.seg.c-2 { stroke: var(--c2); }
.seg.c-3 { stroke: var(--c3); }
.seg.c-4 { stroke: var(--c4); }
.seg.c-5 { stroke: var(--c5); }
.swatch.c-1 { background: var(--c1); }
.swatch.c-2 { background: var(--c2); }
.swatch.c-3 { background: var(--c3); }
.swatch.c-4 { background: var(--c4); }
.swatch.c-5 { background: var(--c5); }

.donut-total {
  font: 700 26px var(--font-ui);
  fill: var(--text);
}

.donut-unit {
  font: 11px var(--font-ui);
  fill: var(--text-muted);
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 150px;
}

.legend li {
  display: grid;
  grid-template-columns: 12px 1fr auto 3.2em;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 3px 0;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.legend-pct {
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 5px 4px;
  border-radius: 4px;
  outline: none;
}

.bar-row:hover,
.bar-row:focus-visible {
  background: var(--bg-subtle);
}

.bar-label {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-note {
  color: var(--text-faint);
  font-size: 12px;
}

.bar-val {
  grid-column: 2;
  grid-row: 1;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  height: 8px;
  display: block;
}

.bar-fill {
  fill: var(--series);
}

.chart-table {
  margin-top: 8px;
  font-size: 13px;
}

.chart-table summary {
  color: var(--accent-ink);
  cursor: pointer;
  width: max-content;
}

.chart-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
  margin: 0;
}

.tip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: var(--chrome);
  color: var(--chrome-text);
  font-size: 12px;
  padding: 6px 9px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 260px;
}

/* ---- admin: lists and tables ------------------------------------------------ */

.people-list,
.activity {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.people-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.people-list li:last-child,
.activity li:last-child {
  border-bottom: 0;
}

.people-main {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 600 12px/32px var(--font-mono);
  text-align: center;
  text-transform: uppercase;
  flex: none;
}

.state {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--text-muted);
  white-space: nowrap;
}

.state-ok {
  background: var(--success-soft);
  color: var(--success-ink);
}

.state-off {
  background: var(--error-soft);
  color: var(--error-ink);
}

.state-info {
  background: var(--info-soft);
  color: var(--info-ink);
}

.activity li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.activity time {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
  /* Contains the visually hidden column labels (.sr-only is absolutely positioned),
     which otherwise sit at the table's far edge and widen the whole page on phones. */
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table.compact td,
.data-table.compact th {
  padding: 4px 8px;
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table tr.is-disabled td {
  color: var(--text-faint);
}

.row-actions {
  text-align: right;
  white-space: nowrap;
}

.row-actions form {
  display: inline-block;
  margin-left: 4px;
}

.request-list {
  display: grid;
  gap: 12px;
}

.request {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

.request h3 {
  font-size: 16px;
  margin: 0 0 2px;
}

.request p {
  margin: 2px 0;
  font-size: 14px;
}

.request blockquote {
  margin: 8px 0;
  padding-left: 10px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 14px;
  white-space: pre-wrap;
}

.request-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.input-with-button {
  display: flex;
  gap: 6px;
}

.input-with-button input {
  height: 30px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tag-warn {
  background: var(--warning-soft);
  color: var(--warning-ink);
  border-color: transparent;
}

.release-now {
  margin: 4px 0 14px;
}

.release-behind {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 0;
}

.release-behind form {
  flex: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-muted);
  border-radius: 4px;
  padding: 1px 5px;
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: transparent;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.inline-fields .field {
  margin: 0;
}

.stack > * + * {
  margin-top: 12px;
}

.stack .field {
  margin-bottom: 0;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.radio-group input {
  accent-color: var(--accent);
}

details > summary {
  cursor: pointer;
}

.summary-h2 {
  display: inline-flex;
}

/* ---- admin: feedback inbox ----------------------------------------------------- */

.count-badge-accent {
  background: var(--accent);
}

.count-badge-warn {
  background: var(--warning);
}

.tag-bug {
  background: var(--error-soft);
  color: var(--error-ink);
  border-color: transparent;
}

.tag-idea {
  background: var(--info-soft);
  color: var(--info-ink);
  border-color: transparent;
}

.fb-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
  background: var(--bg-muted);
  color: var(--text-muted);
}

.fb-new {
  background: var(--accent);
  color: #fff;
}

.fb-triaged,
.fb-planned {
  background: var(--info-soft);
  color: var(--info-ink);
}

.fb-done {
  background: var(--success-soft);
  color: var(--success-ink);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.seg-item {
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.seg-item:last-child {
  border-right: 0;
}

.seg-item:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.seg-item.is-active {
  background: var(--bg-selected);
  color: var(--accent-ink);
  font-weight: 600;
}

.seg-count {
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 2px;
}

.fb-table tr.is-new .fb-summary {
  font-weight: 600;
}

.fb-summary {
  color: var(--text);
  text-decoration: none;
}

.fb-summary:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.fb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.fb-side .card {
  margin-bottom: 16px;
}

.fb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.card h2.fb-title {
  font-size: 22px;
  display: block;
  margin: 0 0 18px;
}

.fb-main h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin: 18px 0 4px;
}

.fb-text {
  white-space: pre-wrap;
  max-width: 75ch;
  margin: 0;
}

.fb-md {
  margin: 22px 0 12px;
  font-size: 14px;
}

.fb-md summary {
  color: var(--accent-ink);
}

.fb-pre {
  font: 12.5px/1.55 var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
}

.fb-meta {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 12px;
  margin: 8px 0 0;
  font-size: 14px;
}

.fb-meta dt {
  color: var(--text-muted);
}

.fb-meta dd {
  margin: 0;
  min-width: 0;
}

.fb-ua {
  word-break: break-word;
}

@media (max-width: 1000px) {
  .fb-layout {
    grid-template-columns: 1fr;
  }
}

/* ---- responsive ------------------------------------------------------------- */

@media (max-width: 1100px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 48px;
  }
  .register-layout,
  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .request {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 0 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  .brand-name {
    display: none;
  }
  .topnav {
    gap: 12px;
  }
  .band {
    padding: 44px 0;
  }
  .principles,
  .gallery {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  body.admin {
    display: block;
    height: auto;
    overflow: visible;
  }
  .admin-body {
    display: block;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-title {
    display: none;
  }
  .sidebar ul {
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
  }
  .admin-main {
    padding: 20px 16px 32px;
  }
  .statusbar {
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 8px 16px;
    white-space: normal;
  }
  .menubar .brand-pill {
    display: none;
  }
}

/* Phone menu (layout.ts phoneMenu): hidden on wider screens, where the top bar has room for every link. */
.phone-menu {
  display: none;
  position: relative;
  margin-left: auto;
}
.phone-menu > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  color: var(--chrome-text);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 15px;
}
.phone-menu > summary::-webkit-details-marker {
  display: none;
}
.phone-menu > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.phone-menu[open] > summary {
  background: rgb(255 255 255 / 0.08);
}
.phone-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 6px;
  background: var(--chrome);
  border: 1px solid var(--chrome-line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
}
.phone-menu-link {
  color: var(--chrome-text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 15px;
}
.phone-menu-link:hover,
.phone-menu-link.is-active {
  background: rgb(255 255 255 / 0.08);
  color: #fff;
}

@media (max-width: 760px) {
  .phone-menu {
    display: block;
  }
  .topnav .nav-link {
    display: none;
  }
}

.fb-danger .btn {
  border-color: color-mix(in srgb, var(--error) 35%, transparent);
}

/* ---- admin: metrics ----------------------------------------------------------- */

.section-title {
  font-size: 17px;
  margin: 28px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.admin-main > .page-lede + .section-title {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.big-number {
  font-size: 34px;
  font-weight: 700;
  margin: 6px 0 0;
  font-variant-numeric: tabular-nums;
}

.card-foot {
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 0;
}

.metrics-foot {
  font-size: 13px;
  color: var(--text-faint);
  max-width: 90ch;
  margin-top: 24px;
}

/* ---- People → Testers: search, select, act on several ---------------------------- */
.tester-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 12px;
}

.search-box {
  position: relative;
  flex: 1 1 280px;
  max-width: 460px;
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.search-box input {
  padding-left: 34px;
  height: 34px;
  font-size: 14px;
}

.tester-search .seg {
  margin-left: auto;
}

/* Pipelines and Feedback: a dropdown filter beside the search box, and the "Showing n of m" count. */
.filter-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.filter-select select {
  width: auto;
  height: 34px;
  font-size: 14px;
}

.filter-count {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-muted);
}

.filter-count b {
  color: var(--text);
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  font-size: 14px;
}

.bulk-bar.has-selection {
  border-color: var(--accent);
  background: var(--bg-selected);
}

.bulk-count {
  color: var(--text-muted);
}

.bulk-bar.has-selection .bulk-count {
  color: var(--accent-ink);
  font-weight: 600;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bulk-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.data-table .check-col {
  width: 36px;
  padding-right: 0;
}

.check-col input {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
  accent-color: var(--accent);
  cursor: pointer;
}

.data-table tr:has(.check-col input:checked) td {
  background: var(--bg-selected);
}

@media (max-width: 640px) {
  .tester-search .seg {
    margin-left: 0;
  }
}

/* ---- /beta/check: will KPD run on this computer? -------------------------------- */
.check-wrap {
  max-width: 1040px;
}

.check-wrap h1 {
  margin-bottom: 6px;
}

.check-wrap > .lede {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 20px;
}

.check-verdict[hidden],
.check-results[hidden],
.check-verdict .verdict-actions[hidden] {
  display: none;
}

.check-verdict {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  margin-bottom: 16px;
  border: 1px solid var(--border-strong);
  border-left-width: 6px;
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.check-verdict h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.check-verdict p {
  margin: 0;
  color: var(--text-muted);
  max-width: 70ch;
}

.check-verdict .verdict-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.verdict-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 20px/1 var(--font-ui);
  color: #fff;
  background: var(--text-faint);
}

.verdict-icon::before {
  content: '…';
}

.check-verdict[data-verdict='pass'] {
  border-color: var(--success);
  background: var(--success-soft);
}
.check-verdict[data-verdict='pass'] .verdict-icon {
  background: var(--success);
}
.check-verdict[data-verdict='pass'] .verdict-icon::before {
  content: '✓';
}
.check-verdict[data-verdict='pass'] h2 {
  color: var(--success-ink);
}

.check-verdict[data-verdict='warn'] {
  border-color: var(--warning);
  background: var(--warning-soft);
}
.check-verdict[data-verdict='warn'] .verdict-icon {
  background: var(--warning);
}
.check-verdict[data-verdict='warn'] .verdict-icon::before {
  content: '!';
}
.check-verdict[data-verdict='warn'] h2 {
  color: var(--warning-ink);
}

.check-verdict[data-verdict='fail'] {
  border-color: var(--error);
  background: var(--error-soft);
}
.check-verdict[data-verdict='fail'] .verdict-icon {
  background: var(--error);
}
.check-verdict[data-verdict='fail'] .verdict-icon::before {
  content: '✕';
}
.check-verdict[data-verdict='fail'] h2 {
  color: var(--error-ink);
}

.check-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text);
}

.check-note svg {
  flex: none;
  margin-top: 3px;
  color: var(--accent-ink);
}

.check-note p {
  margin: 0;
}

.check-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.check-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.check-row:first-child {
  border-top: 0;
}

.check-icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  font: 700 12px/1 var(--font-ui);
  color: #fff;
}

.check-text {
  font-size: 14px;
  line-height: 1.45;
}

.check-why {
  display: block;
  color: var(--text-muted);
}

.check-detail {
  display: block;
  font-weight: 500;
}

.check-detail:empty {
  display: none;
}

.check-state {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  white-space: nowrap;
  padding-top: 2px;
}

.check-row[data-state='pass'] .check-icon {
  background: var(--success);
  border-color: var(--success);
}
.check-row[data-state='pass'] .check-icon::before {
  content: '✓';
}
.check-row[data-state='pass'] .check-state {
  color: var(--success-ink);
}
.check-row[data-state='pass'] .check-detail {
  color: var(--text-muted);
  font-weight: 400;
}

.check-row[data-state='warn'] .check-icon {
  background: var(--warning);
  border-color: var(--warning);
}
.check-row[data-state='warn'] .check-icon::before {
  content: '!';
}
.check-row[data-state='warn'] .check-state,
.check-row[data-state='warn'] .check-detail {
  color: var(--warning-ink);
}

.check-row[data-state='fail'] .check-icon {
  background: var(--error);
  border-color: var(--error);
}
.check-row[data-state='fail'] .check-icon::before {
  content: '✕';
}
.check-row[data-state='fail'] .check-state,
.check-row[data-state='fail'] .check-detail {
  color: var(--error-ink);
}

.check-browser [data-browser] {
  font-weight: 600;
}

.check-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
}

.check-report {
  width: 100%;
  min-height: 160px;
  margin-top: 8px;
  font: 12px/1.5 var(--font-mono);
}

@media (max-width: 760px) {
  .check-columns {
    grid-template-columns: 1fr;
  }
}

/* Settings → Backup: password and button on one row */
.backup-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin: 4px 0 12px;
}
.backup-form .field {
  flex: 0 1 380px;
  margin: 0;
}
.backup-form .btn {
  flex: none;
}
.backup-note {
  flex-basis: 100%;
  font-size: 14px;
  color: var(--success-ink);
}
.backup-note:empty {
  display: none;
}

/* ---- What KPD does (/beta/features) ------------------------------------- */

.feat-hero {
  padding: 64px 0 40px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5eead4;
  margin: 0 0 12px;
}

.feat-lede {
  max-width: 64ch;
}

.feat-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 36px 0 0;
  max-width: 920px;
}

.feat-stats div {
  border-left: 2px solid rgb(94 234 212 / 0.5);
  padding-left: 14px;
}

.feat-stats dt {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.feat-stats dd {
  margin: 4px 0 0;
  color: var(--chrome-muted);
  font-size: 14px;
}

.feat-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.feat-jump a {
  color: var(--chrome-text);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--chrome-line);
  border-radius: 999px;
}

.feat-jump a:hover {
  border-color: #5eead4;
  color: #fff;
}

.journey {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  counter-reset: none;
}

.journey-stage {
  position: relative;
  padding: 0 20px 0 0;
}

.journey-stage::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 44px;
  right: 8px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--border-strong));
}

.journey-stage:last-child::after {
  display: none;
}

.journey-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
}

.journey-stage h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.journey-stage p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 12px;
}

.chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips li {
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 2px 9px;
}

.feat-grid {
  row-gap: 36px;
}

.cloud-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cloud-row {
  display: grid;
  grid-template-columns: 24px 220px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.cloud-row:first-child {
  border-top: 0;
}

.cloud-row:nth-child(even) {
  background: var(--bg-subtle);
}

.cloud-row span:last-child {
  color: var(--text-muted);
}

.cloud-tick {
  color: var(--success);
  align-self: center;
  display: inline-flex;
}

.feat-note {
  margin-top: 14px;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.export-card {
  margin: 0;
}

.export-card p {
  color: var(--text-muted);
  margin: 0;
}

.export-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.export-head .principle-icon {
  margin: 0;
  flex: none;
}

.export-head h3 {
  font-size: 17px;
  margin: 0;
}

.export-card .export-format {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink);
  margin-top: 2px;
}

.cat-grid {
  columns: 3 280px;
  column-gap: 28px;
}

.cat {
  break-inside: avoid;
  margin-bottom: 28px;
}

.cat h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.cat-icon {
  color: var(--accent-ink);
  display: inline-flex;
}

.cat ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cat li {
  padding: 5px 0 5px 18px;
  position: relative;
  color: var(--text-muted);
  font-size: 15px;
}

.cat li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--border-strong);
}

.feat-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.feat-cta .section-lede {
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .journey {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .journey-stage {
    padding: 0 0 0 52px;
  }
  .journey-step {
    position: absolute;
    left: 0;
    top: 0;
  }
  .journey-stage::after {
    top: 40px;
    bottom: -18px;
    left: 17px;
    right: auto;
    width: 2px;
    height: auto;
    background: var(--border-strong);
  }
  .export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .feat-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cloud-row {
    grid-template-columns: 20px 1fr;
    row-gap: 2px;
  }
  .cloud-row span:last-child {
    grid-column: 2;
  }
  .export-grid {
    grid-template-columns: 1fr;
  }
}

/* ==== Beta goals (/beta/goals, pages/goals.ts) and GOD-ADMIN → Rounds (pages/adminRounds.ts) ==== */

input[type='number'],
input[type='date'] {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: 15px var(--font-ui);
}

input[type='date'] {
  color-scheme: light dark;
}

/* Item status pills, shared by the public page and the admin. */
.goal-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
  background: var(--bg-muted);
  color: var(--text-muted);
}

.goal-status-in-progress {
  background: var(--info-soft);
  color: var(--info-ink);
}

.goal-status-done {
  background: var(--success-soft);
  color: var(--success-ink);
}

.goal-status-deferred {
  background: var(--warning-soft);
  color: var(--warning-ink);
}

/* ---- the public page ---- */

.goals-hero {
  padding: 56px 0 40px;
}

.goals-title {
  max-width: 22ch;
}

.goals-meta {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--chrome-muted);
  margin: 0 0 18px;
}

.goals-summary {
  max-width: 64ch;
  color: #cbd5e1;
  font-size: 17px;
}

.goals-summary p,
.goals-summary ul {
  margin: 0 0 12px;
}

.goals-progress {
  max-width: 520px;
  margin: 24px 0 8px;
}

.goals-progress-bar {
  display: block;
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgb(148 163 184 / 0.25);
  appearance: none;
}

.goals-progress-bar::-webkit-progress-bar {
  background: rgb(148 163 184 / 0.25);
  border-radius: 999px;
}

.goals-progress-bar::-webkit-progress-value {
  background: linear-gradient(90deg, #14b8a6, #5eead4);
  border-radius: 999px;
}

.goals-progress-bar::-moz-progress-bar {
  background: linear-gradient(90deg, #14b8a6, #5eead4);
  border-radius: 999px;
}

.goals-progress-text {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--chrome-muted);
}

.goals-progress-text b {
  color: #fff;
}

.goals-count {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  font: 600 13px/1 var(--font-mono);
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.goal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.goal-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  min-width: 0;
}

.goal-item-in-progress {
  border-left-color: var(--info, #2563eb);
}

.goal-item-done {
  border-left-color: var(--success);
}

.goal-item-deferred {
  border-left-color: var(--warning);
  opacity: 0.8;
}

#focus .goal-item {
  border-left-color: var(--accent);
}

.goal-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.goal-item-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.goal-item-detail {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

.goal-item-detail p,
.goal-item-detail ul {
  margin: 0 0 6px;
}

.goal-item-detail ul {
  padding-left: 18px;
}

.goal-item-from {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-faint);
}

.goals-help-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.goals-help-inner .section-lede {
  margin-bottom: 0;
}

.goals-help-inner .btn {
  flex: none;
}

.goals-earlier {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  background: var(--bg);
}

.goals-earlier > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 18px;
  cursor: pointer;
}

.goals-earlier-name {
  font-weight: 600;
}

.goals-earlier-meta {
  font-size: 14px;
  color: var(--text-muted);
}

.goals-earlier-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

.goals-earlier-body > h3 {
  font-size: 15px;
  margin: 18px 0 10px;
}

.goals-outcome {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--success-soft);
  color: var(--success-ink);
}

.goals-outcome h3 {
  margin-top: 0;
}

.goals-outcome p:last-child,
.goals-outcome ul:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .goal-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .goals-help-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- GOD-ADMIN → Rounds ---- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 12px;
}

.form-grid .field-wide {
  grid-column: span 2;
}

.form-grid .field,
.stack .form-grid .field {
  margin-bottom: 14px;
}

.round-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.round-side .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.round-side .form-grid .field-wide {
  grid-column: span 2;
}

.round-side .form-grid .field-narrow {
  grid-column: span 2;
}

.round-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.round-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.round-item-main {
  flex: 1;
  min-width: 0;
}

.round-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.round-item-detail {
  margin: 4px 0 0;
  white-space: pre-line;
}

.round-item-edit > summary {
  font-size: 13px;
  color: var(--accent-ink);
  cursor: pointer;
  margin-top: 4px;
}

.round-item-edit[open] {
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.round-item-side {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: none;
}

.round-item-status {
  display: flex;
  gap: 4px;
}

.round-item-status select {
  width: auto;
  height: 30px;
  font-size: 13px;
}

.js .round-item-status button {
  display: none;
}

.round-item-move {
  display: flex;
  gap: 2px;
}

.icon-btn {
  padding: 0 6px;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.fb-in-rounds {
  margin: 0 0 12px;
  padding-left: 18px;
}

.fb-in-rounds li + li {
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .round-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .form-grid,
  .round-side .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid .field-wide {
    grid-column: auto;
  }
  .round-item {
    flex-direction: column;
  }
}

/* ==== GOD-ADMIN → Health (pages/adminHealth.ts) ==== */

.hl-checks {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.hl-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-lg);
  background: var(--bg);
  min-width: 0;
}

.hl-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

.hl-ok { border-left-color: var(--success); }
.hl-ok .hl-dot { background: var(--success); }
.hl-warn { border-left-color: var(--warning); background: var(--warning-soft); }
.hl-warn .hl-dot { background: var(--warning); }
.hl-bad { border-left-color: var(--error); background: var(--error-soft); }
.hl-bad .hl-dot { background: var(--error); }

.hl-check-label {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
}

.hl-check-detail {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.hl-warn .hl-check-detail { color: var(--warning-ink); }
.hl-bad .hl-check-detail { color: var(--error-ink); }

.hl-big {
  margin: 4px 0 2px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
}

.hl-big-of {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

.hl-bar {
  display: block;
  width: 100%;
  height: 12px;
  margin: 10px 0 8px;
  border-radius: 6px;
  overflow: hidden;
}

.hl-bar-track { fill: var(--bg-muted); }
.hl-seg-cpu { fill: var(--accent); background: var(--accent); }
.hl-seg-warn { fill: var(--warning); }
.hl-seg-bad { fill: var(--error); }
.hl-seg-designers { fill: #7c3aed; background: #7c3aed; }
.hl-seg-portal { fill: var(--accent); background: var(--accent); }
.hl-seg-other { fill: #94a3b8; background: #94a3b8; }
.hl-seg-code { fill: #475569; background: #475569; }
.hl-seg-files { fill: #b4c0cf; background: #b4c0cf; }
.hl-seg-kernel { fill: #78869a; background: #78869a; }
.hl-seg-free { background: var(--bg-muted); border: 1px solid var(--border); }

.hl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.hl-legend b {
  color: var(--text);
}

.hl-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: -1px;
}

.hl-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.hl-figure {
  margin: 0;
  min-width: 0;
}

.hl-figure figcaption {
  font-size: 14px;
  margin-bottom: 6px;
}

.hl-peak {
  float: right;
  font-size: 12px;
  color: var(--text-muted);
}

.hl-chart {
  width: 100%;
  height: auto;
}

/* The charts are drawn at 640 wide and shown smaller, so their labels are drawn larger to stay readable. */
.hl-chart .tick {
  font-size: 14px;
}

.hl-line-cpu,
.hl-line-mem,
.hl-line-designers {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.hl-line-cpu,
.hl-line-mem { stroke: var(--accent); }
.hl-line-designers { stroke: #7c3aed; stroke-dasharray: 4 3; }
.hl-line-cpu-area,
.hl-line-mem-area { fill: var(--accent); opacity: 0.12; }

.hl-limit {
  stroke: var(--error);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.hl-hit {
  fill: transparent;
}

.hl-hit:hover {
  fill: rgb(148 163 184 / 0.18);
}

.hl-key {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

.hl-key::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 0;
  margin-right: 4px;
  vertical-align: middle;
  border-top: 2px solid var(--accent);
}

.hl-key-designers::before { border-top: 2px dashed #7c3aed; }
.hl-key-limit::before { border-top: 2px dashed var(--error); }

.hl-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 8px 0 12px;
  font-size: 14px;
}

.hl-facts dt {
  color: var(--text-muted);
}

.hl-facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hl-facts-wide dd {
  text-align: left;
}

@media (max-width: 1200px) {
  .hl-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hl-charts {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .hl-checks {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Settings → Backup → Automatic backups */
.auto-backups {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.auto-backups h3 {
  margin: 0;
  font-size: 15px;
}

.backup-pick .table-scroll {
  margin-bottom: 12px;
}

/* Settings: "Who is it for?" on the developer message and the notification (src/audience.ts) */
.aud {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  margin: 0;
}

.aud legend {
  font-size: 14px;
  font-weight: 500;
  padding: 0 4px;
}

.aud-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 14px;
}

.aud:has(input[name='audience'][value='all']:checked) .aud-some {
  display: none;
}

.aud-some {
  margin-top: 8px;
}

.aud-group + .aud-group {
  margin-top: 10px;
}

.aud-head {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.aud-list {
  max-height: 180px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.aud-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 14px;
  max-height: none;
}

.aud-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* People → Quiet testers and Email lists (pages/adminEngagement.ts) */
.quiet-group + .quiet-group,
.email-list + .email-list {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.quiet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiet-head h3 {
  margin: 0;
  font-size: 15px;
}

.quiet-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.quiet-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.quiet-who {
  flex: 1;
  min-width: 0;
}

.email-box {
  font-size: 13px;
  margin-bottom: 8px;
}

/* Settings → Check-in question */
.ci-avg {
  margin: 0 0 8px;
  font-size: 15px;
}

.ci-avg b {
  font-size: 26px;
}

.ci-comments {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 260px;
  overflow: auto;
}

.ci-comments li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.ci-comments p {
  margin: 0;
}

.ci-score {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 700;
  font-size: 13px;
}

.ci-history {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.ci-history summary {
  cursor: pointer;
  font-weight: 500;
}

.ci-past h3 {
  margin: 14px 0 0;
  font-size: 15px;
}

/* Health: one colour per tester's designer (memory bar, legend, "Designers by memory") */
.hl-d0 { fill: #7c3aed; background: #7c3aed; }
.hl-d1 { fill: #2563eb; background: #2563eb; }
.hl-d2 { fill: #db2777; background: #db2777; }
.hl-d3 { fill: #ea580c; background: #ea580c; }
.hl-d4 { fill: #0891b2; background: #0891b2; }
.hl-d5 { fill: #65a30d; background: #65a30d; }
.hl-d6 { fill: #a16207; background: #a16207; }
.hl-d7 { fill: #4f46e5; background: #4f46e5; }

.hl-who-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.hl-who-bar .hl-bar {
  flex: 1;
  margin: 0;
}

/* "The beta is full" (pages/public.ts fullPage) */
.full-panel .panel-body {
  text-align: center;
}

.full-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 4px auto 8px;
  border-radius: 50%;
  background: var(--warning-soft);
  color: var(--warning);
}

/* Metrics → Every palette, by use (pages/metrics.ts paletteList) */
.pal-since {
  margin: -4px 0 12px;
  font-size: 14px;
}

.pal-up {
  color: var(--success-ink);
  font-weight: 600;
}

.pal-down {
  color: var(--error-ink);
  font-weight: 600;
}

.pal-delta {
  white-space: nowrap;
}

.pal-new {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--success-soft);
}

.pal-name {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pal-icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 5px;
}

.pal-usage-col {
  width: 38%;
}

.pal-usage {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pal-bar {
  flex: 1;
  height: 10px;
}

.pal-usage b {
  min-width: 2.5em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pal-unused td {
  opacity: 0.55;
}

.pal-unused .pal-bar .bar-fill {
  display: none;
}

/* ---- Health → Errors (pages/adminErrors.ts) ---------------------------------------- */
/* One colour per kind of failure: columns, bars, swatches and tags. */
.er-k-kpd { --er: #dc2626; }
.er-k-gone { --er: #ea580c; }
.er-k-start { --er: #a16207; }
.er-k-refused { --er: #db2777; }
.er-k-full { --er: #64748b; }
.er-k-other { --er: #94a3b8; }
svg [class*='er-k-'] { fill: var(--er); }
.hl-swatch[class*='er-k-'] { background: var(--er); }

a.hl-check-link {
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
}
a.hl-check-link:hover,
a.hl-check-link:focus-visible {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
a.hl-check-link > div { flex: 1; min-width: 0; }
.hl-check-go {
  float: right;
  color: var(--text-faint);
}
a.hl-check-link:hover .hl-check-go { color: var(--text); }

.er-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 10px;
  font-weight: 600;
  text-decoration: none;
}

.er-filters { flex-wrap: wrap; gap: 10px 14px; }
.er-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.er-num { font-size: 22px; color: var(--text); margin-right: 4px; }

.er-legend { margin: 0; }
.er-chart rect:not(.hl-hit) { shape-rendering: crispEdges; }

.er-breaks { row-gap: 26px; }
.er-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.er-rows li {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr 3.2em;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.er-rows .hl-bar { margin: 0; height: 10px; }
.er-row-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.er-row-n { text-align: right; font-variant-numeric: tabular-nums; }

.er-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--er) 13%, transparent);
  color: color-mix(in srgb, var(--er) 80%, var(--text));
}
.er-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--er);
}

.er-table td { vertical-align: top; }
.er-when { white-space: nowrap; }
.er-when a { display: block; font-weight: 600; }
.er-msg {
  min-width: 240px;
  max-width: 420px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.er-hero { border-left: 4px solid var(--er); background: color-mix(in srgb, var(--er) 5%, var(--bg)); }
.er-hero-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.er-status { font-size: 13px; color: var(--text-muted); }
.er-hero-title { margin: 10px 0 2px; font-size: 20px; }
.er-message { margin-top: 12px; }
.er-pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.er-h3 { margin: 16px 0 4px; font-size: 15px; }
.er-route { overflow-wrap: anywhere; }
.er-around tr.er-this td { background: color-mix(in srgb, var(--error) 14%, transparent); font-weight: 600; }
.er-around tr.er-failed td { color: var(--error-ink); }

@media (max-width: 900px) {
  .er-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .er-summary { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Admin → Themes (pages/adminThemes.ts) ---------------------------------------- */
.tag-ok { background: var(--success-soft, #dcfce7); color: var(--success-ink, #166534); border-color: transparent; }
.th-layout { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.th-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.th-side { flex: 1 1 300px; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.th-card { display: flex; flex-wrap: wrap; gap: 20px; }
.th-previews { flex: 0 1 240px; display: flex; flex-direction: column; gap: 8px; }
.th-preview { display: block; width: 100%; max-width: 240px; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.th-body { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.th-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.th-head h2 { margin: 0; font-size: 19px; }
.th-desc { margin: 0; color: var(--text-muted); }
.th-form { display: flex; flex-direction: column; gap: 10px; }
.th-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.th-switch input { width: 18px; height: 18px; }
.th-dates input[type="date"] { cursor: pointer; }
.th-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 420px; }
.th-actions { align-items: center; gap: 14px; flex-wrap: wrap; }
.th-unload { align-self: flex-start; padding-top: 6px; border-top: 1px solid var(--border); width: 100%; }
.th-h3 { margin: 18px 0 8px; font-size: 15px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.th-release { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.th-release li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.th-paste textarea { width: 100%; box-sizing: border-box; font-family: var(--font-mono); font-size: 12px; margin-top: 6px; }
.th-paste summary { cursor: pointer; color: var(--text-muted); font-size: 14px; }
.th-errors { margin: 6px 0 0; padding-left: 18px; }
.th-how { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text-muted); line-height: 1.5; }
@media (max-width: 640px) {
  .th-dates { grid-template-columns: minmax(0, 1fr); }
}

/* Admin → Groups (pages/adminGroups.ts) */
.crumbs { margin: -6px 0 12px; font-size: 14px; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.copy-area { width: 100%; margin-top: 6px; font-family: var(--font-mono); font-size: 12.5px; }
.input-sm { height: 30px; font-size: 13px; max-width: 220px; }
.row-actions .inline-form { display: inline-flex; gap: 6px; align-items: center; }
.danger-row { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.add-members { margin-top: 14px; }
.add-members summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.add-members .aud-list { max-height: 260px; margin: 10px 0; }
.inline-fields .field-wide { grid-column: 1 / -1; }
.group-cell { white-space: nowrap; }
.select-sm { height: 30px; font-size: 13px; padding: 0 8px; max-width: 200px; }
.bulk-move { display: inline-flex; gap: 6px; align-items: center; }

/* ---- each tester's own password (src/testerPasswords.ts) ----------------- */

.state-warn {
  background: var(--warning-soft);
  color: var(--warning-ink);
}

.issued {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}

.issued .secret {
  font-size: 17px;
  padding: 6px 12px;
}

.issued-who {
  margin-bottom: 6px;
}

.issued-text {
  width: 100%;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.pw-missing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pw-missing p {
  margin: 0;
  flex: 1 1 320px;
}

details.stack > summary {
  cursor: pointer;
  color: var(--accent-ink);
  font-weight: 500;
}

/* ---- Settings → Sessions and timeouts (src/timeouts.ts) ------------------ */

.timeouts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 20px;
}

.input-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-unit input {
  width: 6.5em;
}

.input-unit span {
  color: var(--text-muted);
  font-size: 14px;
}

/* ==== Admin Overview: mission control (pages/admin.ts overviewPage) ===================
 * Status banner + engagement tiles beside the emergency controls, then health
 * gauges, charts, live designers and activity. The SCRAM housing keeps its own
 * hazard colours in both themes; everything else uses the tokens. */

.ov { display: flex; flex-direction: column; gap: 16px; position: relative; }
.ov-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.ov-top-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.ov-kicker {
  margin: 0;
  font: 600 11px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* -- status banner -- */
.ov-banner {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  transition: background 0.4s;
}
.ov-banner-ok { background: color-mix(in srgb, var(--success) 8%, var(--bg)); border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.ov-banner-warn { background: color-mix(in srgb, var(--warning) 8%, var(--bg)); border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.ov-banner-bad { background: color-mix(in srgb, var(--warning) 12%, var(--bg)); border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.ov-banner-stopped { background: var(--error-soft); border-color: color-mix(in srgb, var(--error) 50%, var(--border)); }
.ov-banner-ok .ov-kicker { color: var(--success); }
.ov-banner-warn .ov-kicker, .ov-banner-bad .ov-kicker { color: var(--warning); }
.ov-banner-stopped .ov-kicker { color: var(--error); }
.ov-banner-head { display: flex; align-items: center; gap: 16px; }
.ov-headline { margin: 2px 0 0; font-size: 30px; line-height: 1.15; font-weight: 700; }
.ov-sub { margin: 0; color: var(--text-muted); font-size: 15px; line-height: 1.5; max-width: 90ch; }

.ov-orb { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.ov-orb-ok { background: #22c55e; animation: ov-pulse-ok 2s infinite; }
.ov-orb-warn, .ov-orb-bad { background: #f59e0b; animation: ov-blink 1.2s infinite; }
.ov-orb-stopped { background: #ef4444; animation: ov-pulse-bad 1s infinite; }
@keyframes ov-pulse-ok { 0% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0.55); } 70% { box-shadow: 0 0 0 16px rgb(34 197 94 / 0); } 100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0); } }
@keyframes ov-pulse-bad { 0% { box-shadow: 0 0 0 0 rgb(239 68 68 / 0.7); } 60% { box-shadow: 0 0 0 22px rgb(239 68 68 / 0); } 100% { box-shadow: 0 0 0 0 rgb(239 68 68 / 0); } }
@keyframes ov-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.ov-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ov-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
}
a.ov-chip:hover { border-color: var(--border-strong); }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.ov-dot.ov-ok { background: var(--success); }
.ov-dot.ov-warn { background: var(--warning); }
.ov-dot.ov-bad { background: var(--error); }

/* -- tiles -- */
.ov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; flex: 1 1 auto; }
.ov-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.ov-tile-label { font-size: 13px; color: var(--text-muted); }
.ov-tile-value { font: 600 34px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.ov-tile-value small { font-size: 17px; color: var(--text-muted); font-weight: 500; }
.ov-tile-value a { color: inherit; text-decoration: none; }
.ov-tile-attn .ov-tile-value { color: var(--warning); }
.ov-tile-note { font-size: 12px; color: var(--text-muted); }
.ov-tile-note a { color: var(--text-muted); }
.ov-up { color: var(--success); }
.ov-bad-text { color: var(--error); }
.ov-cap { width: 100%; height: 6px; display: block; }
.ov-cap-track { fill: var(--bg-muted); }
.ov-cap-fill { fill: var(--accent); }

/* -- emergency controls -- */
.ov-controls {
  flex: 0 1 236px;
  min-width: 216px;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.scram { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; }
.scram-housing { border-radius: 14px; padding: 6px; background: repeating-linear-gradient(-45deg, #facc15 0 14px, #111827 14px 28px); }
.scram-well { position: relative; width: 168px; height: 168px; border-radius: 10px; background: #111827; display: flex; align-items: center; justify-content: center; }
.scram-ring { position: absolute; width: 164px; height: 164px; transform: rotate(-90deg); }
.scram-ring circle { fill: none; stroke-width: 6; }
.scram-ring-track { stroke: #1f2937; }
.scram-ring-fill { stroke: #fde047; stroke-linecap: round; stroke-dasharray: 478; stroke-dashoffset: 478; }
.scram.is-holding .scram-ring-fill { animation: scram-fill 1.5s linear forwards; }
.scram.is-fired .scram-ring-fill { stroke-dashoffset: 0; }
@keyframes scram-fill { from { stroke-dashoffset: 478; } to { stroke-dashoffset: 0; } }

.scram-button {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: radial-gradient(circle at 38% 32%, #fca5a5, #dc2626 45%, #7f1d1d);
  box-shadow: 0 8px 0 #450a0a, 0 12px 24px rgb(0 0 0 / 0.6), inset 0 -6px 12px rgb(0 0 0 / 0.35);
  color: #fff;
  font: 700 22px var(--font-ui);
  letter-spacing: 0.08em;
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: none;
  user-select: none;
}
.scram-button:focus-visible { outline: 3px solid #fde047; outline-offset: 4px; }
.scram.is-holding .scram-button { transform: translateY(6px); box-shadow: 0 2px 0 #450a0a, 0 4px 10px rgb(0 0 0 / 0.6), inset 0 -6px 12px rgb(0 0 0 / 0.35); animation: scram-shake 0.25s infinite; }
.scram-button:disabled { cursor: not-allowed; filter: grayscale(0.6) brightness(0.6); }
.scram.is-down .scram-button { filter: brightness(0.45); box-shadow: inset 0 10px 24px rgb(0 0 0 / 0.7); transform: translateY(6px); }
@keyframes scram-shake { 0%, 100% { translate: 0; } 25% { translate: -3px 0; } 75% { translate: 3px 0; } }

/* The safety cover only exists with script (it's what lifts it); without, type SCRAM instead. */
.scram-cover { display: none; }
.js .scram-cover {
  display: block;
  position: absolute;
  inset: 0;
  border: 2px solid rgb(254 202 202 / 0.5);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgb(254 226 226 / 0.55), rgb(220 38 38 / 0.35) 60%, rgb(127 29 29 / 0.55));
  color: #fff;
  font: 700 12px var(--font-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transform-origin: 50% 0;
  transition: transform 0.55s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.4s;
}
.js .scram.is-open .scram-cover { transform: perspective(500px) rotateX(-118deg); opacity: 0.35; pointer-events: none; }
.scram-label { margin: 0; font: 600 11px var(--font-mono); letter-spacing: 0.12em; color: var(--text-muted); }
.scram.is-open .scram-label { color: var(--error); }
.scram.is-holding .scram-label { color: var(--warning); }
.scram-close { display: none; background: none; border: none; color: var(--error); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; min-height: 24px; }
.js .scram.is-open:not(.is-fired) .scram-close { display: inline; }
.scram-nojs { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.scram-nojs input { font: 14px var(--font-mono); text-align: center; letter-spacing: 0.1em; padding: 6px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.js .scram-nojs { display: none; }

.ov-start-form { width: 100%; margin: 0; }
.ov-start {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 700 14px var(--font-ui);
  letter-spacing: 0.04em;
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, var(--bg));
  color: var(--success);
}
.ov-start:disabled { cursor: default; }
.ov-start.is-ready { background: #16a34a; border-color: #15803d; color: #fff; text-transform: uppercase; cursor: pointer; animation: ov-glow 1.6s infinite; }
.ov-start.is-ready:hover { background: #15803d; }
@keyframes ov-glow { 0%, 100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0.6); } 50% { box-shadow: 0 0 0 10px rgb(34 197 94 / 0); } }
.ov-help { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-muted); }

/* One red flash on arriving from SCRAM (and while the form is sending). */
.ov.is-just-stopped::after,
body.scram-flash::after { content: ''; position: fixed; inset: 0; background: #ef4444; pointer-events: none; z-index: 1000; animation: ov-flash 0.9s ease-out forwards; }
@keyframes ov-flash { from { opacity: 0.8; } to { opacity: 0; } }

/* -- health gauges -- */
.ov-health { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ov-gauge-tile { flex-direction: row; align-items: center; gap: 16px; }
.ov-gauge-tile:hover { border-color: var(--border-strong); }
.ov-gauge { width: 76px; height: 76px; flex: none; }
.ov-gauge-track { fill: none; stroke: var(--bg-muted); stroke-width: 8; }
.ov-gauge-fill { fill: none; stroke: var(--text-faint); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.8s; }
.ov-gauge.ov-ok .ov-gauge-fill { stroke: var(--success); }
.ov-gauge.ov-warn .ov-gauge-fill { stroke: var(--warning); }
.ov-gauge.ov-bad .ov-gauge-fill { stroke: var(--error); }
.ov-gauge-text { fill: var(--text); font: 600 15px var(--font-mono); }
.ov-gauge-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; color: var(--text-muted); }
.ov-gauge-body b { font-size: 15px; color: var(--text); }
.ov-state.ov-ok { color: var(--success); }
.ov-state.ov-warn { color: var(--warning); }
.ov-state.ov-bad { color: var(--error); }

/* -- charts, live designers, activity -- */
.ov-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.ov-charts > .card, .ov-bottom > .card { margin-bottom: 0; }
.ov .hl-line-cpu { stroke: var(--c3); }
.ov .hl-key-cpu::before { border-top-color: var(--c3); }
.ov-bottom { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.ov-live { flex: 2 1 560px; }
.ov-activity { flex: 1 1 300px; }
.ov-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--bg-muted); color: var(--text-muted); white-space: nowrap; }
.ov-pill-on { background: var(--accent-soft); color: var(--accent-ink); }
.ov-pill-idle { background: var(--warning-soft); color: var(--warning-ink); }

/* -- "everything is stopped" on the other admin pages, and the status bar -- */
.stopped-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.ov-start-sm { background: #16a34a; border-color: #15803d; color: #fff; }
.ov-start-sm:hover { background: #15803d; }
.statusbar-stopped { color: #fca5a5; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .ov-orb, .ov-start.is-ready, .scram.is-holding .scram-button { animation: none; }
  .ov.is-just-stopped::after, body.scram-flash::after { animation-duration: 0.01s; }
}

/* Phones: the emergency controls come straight after the status banner, not below every tile. */
@media (max-width: 860px) {
  .ov-top-main { display: contents; }
  .ov-banner { order: 1; flex: 1 1 100%; }
  .ov-controls { order: 2; flex: 1 1 100%; }
  .ov-tiles { order: 3; flex: 1 1 100%; }
}

/* People → Waiting for approval: the header's buttons, and the "not accepting requests" notice with its undo. */
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.requests-closed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0; }
.requests-closed > span { flex: 1 1 40ch; }

/* Not the live beta (config.ts envBadge): an amber LOCAL / STAGING badge beside the name, everywhere. */
.env-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f59e0b;
  color: #1c1306;
  font: 700 11px var(--font-mono);
  letter-spacing: 0.1em;
  line-height: 1.4;
  white-space: nowrap;
}

/* Health → Errors: clear what's been investigated (nothing is deleted), show or undo what was cleared. */
.er-clear { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); font-size: 14px; color: var(--text-muted); }
.er-clear-note { flex: 1 1 40ch; }
.er-clear-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* A checkbox with its explanation beside it (Settings → Message from the developer → Always show). */
.check-field { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check-field input { margin-top: 3px; flex: none; }

/* ---- Your account (pages/account.ts) ------------------------------------------ */

.account-band {
  background: var(--bg-subtle);
  padding: 40px 0 64px;
  min-height: 60vh;
}

.account-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.account-eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.account-name {
  margin: 0;
  font-size: 30px;
  line-height: 38px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.account-back {
  font-size: 14px;
}

.account-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.account-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 16px;
}

.account-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}

.account-link:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.account-link.is-current {
  background: var(--bg-selected);
  color: var(--accent-ink);
  font-weight: 600;
}

.account-link-short {
  display: none;
}

.account-link-danger,
.account-link-danger:hover,
.account-link-danger.is-current {
  color: var(--error);
}

.account-link-danger {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.account-link-danger.is-current {
  background: var(--error-soft);
}

.account-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.acct-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0;
  scroll-margin-top: 16px;
}

.acct-card-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.acct-card-head h2,
.acct-row-text h2,
.acct-since h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
}

.acct-card-head p,
.acct-row-text p,
.acct-since p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

.acct-card-body {
  padding: 16px 24px 20px;
}

.acct-card-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 0 0 12px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.acct-card-foot-end {
  justify-content: flex-end;
}

.acct-foot-note {
  font-size: 13px;
  color: var(--text-muted);
}

.acct-foot-note.has-changes {
  color: var(--text);
  font-weight: 600;
}

.acct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.acct-since {
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.acct-since-text {
  flex: 1 1 260px;
  min-width: 0;
}

.acct-avatar {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  flex: none;
}

.acct-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
}

.acct-facts {
  margin: 0;
  padding: 8px 24px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
}

.acct-facts > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-muted);
}

.acct-facts > div:nth-last-child(-n + 2):nth-child(odd),
.acct-facts > div:last-child {
  border-bottom: 0;
}

.acct-facts dt {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.acct-facts dd {
  margin: 4px 0 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.acct-grid {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.acct-stack {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.acct-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.acct-field > label,
.acct-field > legend {
  font-size: 14px;
  font-weight: 500;
  padding: 0;
}

.acct-field input[type='text'],
.acct-field input[type='email'],
.acct-field input[type='password'],
.acct-field select {
  height: 42px;
  border-radius: var(--radius-lg);
}

.acct-field.has-error input,
.acct-field.has-error select {
  border: 2px solid var(--error);
}

.acct-field .field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
}

.acct-field .field-error .icon {
  flex: none;
  margin-top: 2px;
}

.acct-field .field-hint,
.field-changed {
  margin: 0;
}

.field-changed {
  font-size: 13px;
  color: var(--accent-ink);
}

.acct-span {
  grid-column: 1 / -1;
}

fieldset.acct-field {
  border: 0;
  margin: 0;
  padding: 0;
}

.acct-pills legend {
  margin-bottom: 6px;
}

.pill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  font-size: 14px;
  cursor: pointer;
}

.pill-option input {
  accent-color: var(--accent);
  margin: 0;
}

.pill-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-selected);
}

.pill-option:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.acct-row {
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.acct-row-text {
  flex: 1 1 300px;
  min-width: 0;
}

.acct-row-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.acct-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.acct-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin: 0;
}

.btn-danger-outline {
  border-color: color-mix(in srgb, var(--error) 35%, transparent);
  background: var(--bg);
  color: var(--error);
  font-weight: 600;
  font-size: 14px;
}

.btn-danger-outline:hover {
  background: var(--error-soft);
  color: var(--error);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.acct-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 20px;
}

.acct-alert > .icon {
  flex: none;
}

.acct-alert-error {
  background: var(--error-soft);
  color: var(--error-ink);
}

.acct-alert-error a {
  color: var(--error-ink);
}

.acct-alert-ok {
  background: var(--success-soft);
  color: var(--success-ink);
}

.acct-alert-info {
  background: var(--info-soft);
  color: var(--info-ink);
}

.acct-alert:focus {
  outline: 2px solid var(--focus);
}

.acct-narrow {
  max-width: 620px;
}

.strength {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 2px;
}

.strength span {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}

.strength[data-score='1'] span:nth-child(-n + 1) {
  background: var(--error);
}

.strength[data-score='2'] span:nth-child(-n + 2) {
  background: var(--warning);
}

.strength[data-score='3'] span:nth-child(-n + 3),
.strength[data-score='4'] span {
  background: var(--accent);
}

.acct-lists {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.acct-lists h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.acct-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 20px;
}

.acct-list li {
  display: flex;
  gap: 10px;
}

.acct-list .icon {
  flex: none;
  margin-top: 2px;
}

.acct-list-gone .icon {
  color: var(--error);
}

.acct-list-kept .icon {
  color: var(--accent);
}

.confirm-target {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  font-size: 15px;
  overflow-wrap: anywhere;
  user-select: none;
  -webkit-user-select: none;
}

.confirm-ok {
  color: var(--success);
  font-weight: 600;
}

.acct-footnote {
  margin: -8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.account-done {
  max-width: 560px;
  text-align: center;
  padding-top: 56px;
}

.account-done h1 {
  margin: 20px 0 8px;
  font-size: 28px;
  line-height: 36px;
}

.account-done p {
  font-size: 15px;
  line-height: 24px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.account-done-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 760px) {
  .account-band {
    padding: 24px 0 48px;
  }
  .account-wrap {
    padding: 0 16px;
  }
  .account-top {
    margin-bottom: 16px;
  }
  .account-name {
    font-size: 24px;
    line-height: 32px;
  }
  .account-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .account-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .account-link {
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg);
  }
  .account-link .icon {
    display: none;
  }
  .account-link-long {
    display: none;
  }
  .account-link-short {
    display: inline;
  }
  .account-link.is-current {
    border-color: var(--accent);
  }
  .account-link-danger {
    margin-top: 0;
    border-top: 1px solid color-mix(in srgb, var(--error) 35%, transparent);
    border-color: color-mix(in srgb, var(--error) 35%, transparent);
  }
  .acct-grid,
  .acct-facts,
  .acct-lists {
    grid-template-columns: minmax(0, 1fr);
  }
  .acct-facts > div:nth-last-child(-n + 2):nth-child(odd) {
    border-bottom: 1px solid var(--bg-muted);
  }
  .acct-facts > div:last-child {
    border-bottom: 0;
  }
  .acct-card-head,
  .acct-grid,
  .acct-stack,
  .acct-lists,
  .acct-card-foot,
  .acct-row,
  .acct-since,
  .acct-card-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .acct-facts {
    padding-left: 16px;
    padding-right: 16px;
  }
  .acct-field input[type='text'],
  .acct-field input[type='email'],
  .acct-field input[type='password'],
  .acct-field select {
    height: 46px;
    font-size: 16px;
  }
  .acct-card-foot .btn,
  .acct-row .btn,
  .acct-card-body .btn {
    min-height: 44px;
  }
  .acct-actions {
    width: 100%;
  }
  .acct-actions .btn {
    flex: 1 1 0;
  }
  .pill-option {
    min-height: 44px;
  }
  .acct-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-initials {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 420px) {
  /* On a phone the account link is just the initials (the words stay for screen readers). */
  .nav-link.nav-account {
    display: inline-flex;
    border-bottom: 0;
    padding: 0;
  }
  .nav-account-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .nav-initials {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .nav-account.is-active .nav-initials {
    box-shadow: 0 0 0 2px var(--focus);
  }
  .topbar .brand-pill,
  .topbar .env-badge {
    display: none;
  }
}

.acct-row-action .btn[hidden] {
  display: none;
}

/* Health → Memory now: the legend in groups (designers, the website, system, free). */
.hl-mem-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
  margin: 4px 0 10px;
}

.hl-mem-group-head {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.hl-mem-group-head b {
  color: var(--text);
}

.hl-mem-group .hl-legend {
  flex-direction: column;
  gap: 4px;
}

.hl-explain {
  margin: 0 0 8px;
  font-size: 13px;
}

.hl-explain summary {
  color: var(--accent-ink);
}

.hl-explain dl {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 12px;
}

.hl-explain dt {
  font-weight: 600;
  white-space: nowrap;
}

.hl-explain dd {
  margin: 0;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .hl-explain dl {
    grid-template-columns: 1fr;
  }
  .hl-explain dd {
    margin-bottom: 6px;
  }
}

/* People: column headers you click to sort by. */
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.th-sort:hover,
.th-sort.is-sorted {
  color: var(--text);
}

.th-sort-mark {
  font-size: 10px;
  opacity: 0.45;
}

.th-sort.is-sorted .th-sort-mark {
  opacity: 1;
  color: var(--accent-ink);
}

/* Admin → People → one tester (pages/adminTester.ts). */
.tester-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
}

.tester-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex: none;
}

.tester-who {
  flex: 1 1 280px;
  min-width: 0;
}

.tester-who h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}

.tester-who p {
  margin: 0 0 2px;
  overflow-wrap: anywhere;
}

.tester-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tester-actions form {
  margin: 0;
}

.tester-facts {
  grid-template-columns: max-content 1fr;
}

.tester-quote {
  margin: 4px 0 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 14px;
}

.tester-designer {
  font-size: 14px;
}

.tester-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin: 12px 0 6px;
}

/* Projects: a project's storyboards and pipelines, each under its own small heading. */
.project-sub {
  margin: 16px 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.card-h3 {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 600;
}
