:root {
  --paper: #eef1f4;
  --paper-2: #f7f8fa;
  --ink: #14181f;
  --ink-soft: #3d4756;
  --muted: #6b7787;
  --line: #d4dce6;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --accent: #0d5c4f;
  --accent-deep: #094439;
  --accent-soft: #e4f2ee;
  --steel: #2f4a63;
  --ok: #1f7a4c;
  --ok-soft: #e5f5ec;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  --live: #1d5fbf;
  --live-soft: #e8f1fc;
  --radius: 10px;
  --font: "Schibsted Grotesk", sans-serif;
  --display: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, #e7edf3 0%, var(--paper) 42%, #e9ece8 100%);
}
.ridge {
  position: absolute;
  inset: auto -8% -18% -8%;
  height: 48vh;
  background:
    radial-gradient(closest-side at 18% 40%, rgba(13, 92, 79, 0.16), transparent 70%),
    radial-gradient(closest-side at 72% 30%, rgba(47, 74, 99, 0.14), transparent 72%),
    linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.55) 38%, transparent 68%);
  transform: skewY(-4deg);
  filter: blur(2px);
  animation: drift 18s var(--ease) infinite alternate;
}
.haze {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 24, 31, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 24, 31, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 78%);
}

@keyframes drift {
  from { transform: skewY(-4deg) translate3d(0, 0, 0); }
  to { transform: skewY(-4deg) translate3d(0, -18px, 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bar {
  from { transform: scaleX(0.15); }
  to { transform: scaleX(1); }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  /* Top padding kept tight so site-nav fits in existing headroom without pushing cards down. */
  padding: 14px 0 48px;
}

/* Global page switcher — compact pill buttons, top-right on every board. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 14px;
  min-height: 0;
}
.site-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(13, 92, 79, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-deep);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(20, 24, 31, 0.04);
  backdrop-filter: blur(8px);
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
    transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.site-nav-btn:hover {
  background: #fff;
  border-color: rgba(13, 92, 79, 0.45);
  box-shadow: 0 6px 18px rgba(13, 92, 79, 0.1);
  transform: translateY(-1px);
}
.site-nav-btn:focus-visible {
  outline: 2px solid rgba(13, 92, 79, 0.45);
  outline-offset: 2px;
}
.site-nav-btn[hidden] {
  display: none !important;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(20, 24, 31, 0.08);
  animation: rise 0.7s var(--ease) both;
}
.hero-copy {
  display: grid;
  gap: 0;
  align-content: end;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand-mark {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 8px 20px rgba(20, 24, 31, 0.12);
}
.brand-lockup-fleet .brand-mark {
  width: 44px;
  height: 44px;
}
@media (max-width: 720px) {
  .brand-mark {
    width: 40px;
    height: 40px;
  }
  .brand-lockup {
    gap: 10px;
  }
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 6vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero h1 span {
  font-style: italic;
  color: var(--accent);
}
.lede {
  margin: 16px 0 0;
  max-width: 36rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.launch {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid rgba(20, 24, 31, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  animation: rise 0.8s var(--ease) 0.08s both;
}
.launch-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.launch-top .eyebrow { margin: 0; }
.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 7px 11px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.field { display: grid; gap: 6px; }
.field span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.launch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.launch-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 900px) {
  .launch-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .launch-row,
  .launch-row-3 { grid-template-columns: 1fr; }
}

.server-load {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  max-width: 34rem;
  padding: 14px 16px 13px;
  border-radius: 14px;
  border: 1px solid rgba(20, 24, 31, 0.08);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(20, 24, 31, 0.04);
  animation: rise 0.85s var(--ease) 0.12s both;
}
.server-load[data-level="ok"] {
  border-color: rgba(31, 122, 76, 0.22);
  background: linear-gradient(135deg, rgba(229, 245, 236, 0.92), rgba(255, 255, 255, 0.82));
}
.server-load[data-level="warn"] {
  border-color: rgba(154, 103, 0, 0.28);
  background: linear-gradient(135deg, rgba(255, 244, 214, 0.95), rgba(255, 255, 255, 0.82));
}
.server-load[data-level="full"] {
  border-color: rgba(180, 35, 24, 0.28);
  background: linear-gradient(135deg, rgba(253, 236, 235, 0.96), rgba(255, 255, 255, 0.84));
}
.server-load-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.server-load-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.server-load-title > span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.server-load-summary {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.server-load-head strong {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.server-load[data-level="ok"] .server-load-head strong { color: var(--ok); }
.server-load[data-level="warn"] .server-load-head strong { color: var(--warn); }
.server-load[data-level="full"] .server-load-head strong { color: var(--bad); }
.fleet-worker-health {
  display: grid;
  gap: 6px;
}
.fleet-health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(20, 24, 31, 0.08);
  background: rgba(255, 255, 255, 0.72);
}
.fleet-health-row[data-online="0"] {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(253, 236, 235, 0.65);
}
.fleet-health-main { min-width: 0; display: grid; gap: 1px; }
.fleet-health-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--ink);
}
.fleet-health-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
}
.fleet-health-pill.off {
  background: var(--bad-soft);
  color: var(--bad);
}
.fleet-health-meta {
  font-size: 0.74rem;
  color: var(--ink-soft);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.server-meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px) {
  .server-meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.meter { display: grid; gap: 5px; }
.meter-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.meter-label span:first-child {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.meter-label span:last-child {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink);
}
.meter-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(20, 24, 31, 0.08);
  overflow: hidden;
}
.meter-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #127061, var(--accent));
  transition: width 0.45s var(--ease), background 0.3s ease;
}
.server-load[data-level="warn"] .meter-track i {
  background: linear-gradient(90deg, #c48a12, #9a6700);
}
.server-load[data-level="full"] .meter-track i {
  background: linear-gradient(90deg, #d6453a, var(--bad));
}
.server-load-advice {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.35;
}
@media (max-width: 720px) {
  .server-meters { grid-template-columns: 1fr; gap: 8px; }
  .meter-label { flex-direction: row; justify-content: space-between; align-items: baseline; }
}

.fleet-entry {
  display: none; /* replaced by .site-nav top bar */
}

.fleet-shell {
  max-width: 980px;
}
.fleet-page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
  animation: rise 0.7s var(--ease) both;
}
.fleet-page-copy {
  max-width: 36rem;
}
.fleet-page-copy h1 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}
.fleet-page-copy h1 span {
  font-style: italic;
  color: var(--accent);
}
.fleet-page-copy .lede {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}
.fleet-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.fleet-queue-card,
.fleet-code-card {
  margin-top: 16px;
  animation: rise 0.75s var(--ease) 0.1s both;
}
.fleet-queue-card .fleet-row-actions {
  flex-wrap: nowrap;
}
.fleet-code-card .fleet-head {
  align-items: center;
}
.fleet-status {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(20, 24, 31, 0.08);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  animation: rise 0.75s var(--ease) 0.12s both;
}
.fleet-howto {
  margin-bottom: 8px;
  animation: rise 0.78s var(--ease) 0.16s both;
}
.fleet-intro {
  margin: 0;
  line-height: 1.45;
}
.fleet-guide-block {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(20, 24, 31, 0.06);
}
.fleet-guide-block h3 {
  margin: 4px 0 0;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--ink);
}
.fleet-guide-block > p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 0.92rem;
}
.fleet-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 0.92rem;
}
.fleet-steps code,
.fleet-bullets code,
.fleet-hint code,
.fleet-intro code {
  font-family: var(--mono);
  font-size: 0.84em;
}
.fleet-bullets {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}
.fleet-code {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(20, 24, 31, 0.08);
  background: rgba(20, 24, 31, 0.04);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.fleet-howto kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(20, 24, 31, 0.12);
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--mono);
  font-size: 0.78em;
}
.fleet-token-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 10px;
  border: 1px dashed rgba(18, 112, 97, 0.28);
  background: rgba(18, 112, 97, 0.05);
}
.fleet-token-box code {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--ink);
}
.fleet-manage-hint {
  margin: 0;
}
.fleet-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
  animation: rise 0.8s var(--ease) 0.1s both;
}
.fleet-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(20, 24, 31, 0.08);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
}
.fleet-add-card {
  gap: 12px;
}
.fleet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.fleet-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fleet-head strong,
.fleet-status strong {
  display: block;
  margin-top: 2px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}
.fleet-list {
  display: grid;
  gap: 8px;
}
.fleet-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 13px;
  border-radius: 10px;
  border: 1px solid rgba(20, 24, 31, 0.07);
  background: rgba(255, 255, 255, 0.7);
}
.fleet-row[data-online="0"] {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(253, 236, 235, 0.55);
}
.fleet-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.fleet-row-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}
.fleet-row-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-row-err {
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--bad);
}
.fleet-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}
.fleet-cap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid rgba(20, 24, 31, 0.08);
  background: rgba(255, 255, 255, 0.85);
}
.fleet-cap-val {
  min-width: 1.6rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
}
.fleet-cap-btn {
  min-width: 1.8rem;
  padding-left: 0.45rem !important;
  padding-right: 0.45rem !important;
}
.fleet-add-card .ghost {
  justify-self: start;
}
.fleet-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(31, 122, 76, 0.12);
  color: var(--ok);
}
.fleet-pill.off {
  background: rgba(180, 35, 24, 0.12);
  color: var(--bad);
}
.fleet-pill.local {
  background: rgba(18, 112, 97, 0.12);
  color: var(--accent);
}
.fleet-add-hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.fleet-add-hint code {
  font-size: 0.78rem;
}
.fleet-bootstrap-box {
  align-items: stretch;
}
.fleet-bootstrap-box code {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 7.5rem;
  overflow: auto;
  line-height: 1.35;
}
.fleet-advanced {
  margin-top: 4px;
  border-top: 1px solid rgba(20, 24, 31, 0.08);
  padding-top: 10px;
}
.fleet-advanced summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.fleet-advanced[open] summary {
  margin-bottom: 8px;
}
.fleet-add-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.fleet-add-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}
.fleet-ghl-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
}
.fleet-ghl-card .fleet-add-grid {
  margin-top: 4px;
}
.fleet-token-field {
  grid-column: 1 / -1;
}
.fleet-hint {
  margin: 0;
  line-height: 1.4;
}
.fleet-hint code {
  font-family: var(--mono);
  font-size: 0.78em;
}
@media (max-width: 860px) {
  .fleet-layout { grid-template-columns: 1fr; }
  .fleet-page-hero { flex-direction: column; }
  .fleet-page-nav { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .fleet-add-grid { grid-template-columns: 1fr; }
  .fleet-row { grid-template-columns: 1fr; }
  .fleet-row-actions { justify-content: flex-start; }
}

.field input,
.field select,
.controls input,
.controls select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 13px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus,
.field select:focus,
.controls input:focus,
.controls select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 92, 79, 0.12);
}
.controls .agent-filter-field {
  display: block;
  margin: 0;
  min-width: 0;
}
.controls .filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 720px) {
  .controls .filter-row {
    grid-template-columns: 1fr;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.primary {
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 700;
  color: #f4fffb;
  background: linear-gradient(180deg, #127061 0%, var(--accent-deep) 100%);
  cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.2s ease;
}
.primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary:disabled { opacity: 0.6; cursor: wait; transform: none; }

.debug-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 4px 0 10px;
}
.debug-flags .check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.debug-flags input { accent-color: var(--accent); }

.live-debug {
  margin: 0;
  padding: 14px 14px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(18, 112, 97, 0.07), transparent 70%);
}
.live-debug[hidden] { display: none !important; }
.rail .live-debug-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.live-debug-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.live-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.live-actions .primary,
.live-actions .ghost {
  flex: 1 1 auto;
  padding: 8px 10px;
  font-size: 0.82rem;
}
.live-url {
  margin: 10px 0 6px;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 0.72rem;
  color: var(--ink);
  word-break: break-all;
}
.live-cdp {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}
.live-cdp code {
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 0.72rem;
  background: rgba(20, 24, 31, 0.05);
  padding: 6px 8px;
  border-radius: 6px;
  word-break: break-all;
}
.rail .live-debug .subtle {
  font-size: 0.74rem;
  word-break: break-all;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
/* Scope to enrollment board stats strip only — never style Agents table .metric cells. */
.metrics > .metric {
  position: relative;
  background: var(--panel-solid);
  border: 1px solid rgba(20, 24, 31, 0.08);
  border-radius: var(--radius);
  padding: 18px 18px 16px 20px;
  overflow: hidden;
}
.metrics > .metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.metrics > .metric:nth-child(2)::before { background: var(--live); }
.metrics > .metric:nth-child(3)::before { background: var(--steel); }
.metrics > .metric:nth-child(4)::before { background: var(--ok); }
.metrics > .metric:nth-child(5)::before { background: var(--warn); }
.metrics > .metric:nth-child(6)::before { background: var(--bad); }
.metrics > .metric .label {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.metrics > .metric .value {
  margin-top: 10px;
  font-family: var(--display);
  font-size: 2.55rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.metrics > .metric .sub {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}
.metrics > .metric.live .value { color: var(--live); }
.metrics > .metric.queue .value { color: var(--steel); }
.metrics > .metric.ok .value { color: var(--ok); }
.metrics > .metric.verified .value { color: var(--warn); }
.metrics > .metric.bad .value { color: var(--bad); }

.workspace {
  display: grid;
  grid-template-columns: 0.92fr 1.2fr;
  gap: 14px;
  align-items: stretch;
  min-height: 640px;
}
.rail, .stage {
  background: var(--panel-solid);
  border: 1px solid rgba(20, 24, 31, 0.08);
  border-radius: 14px;
  overflow: hidden;
  min-height: 0;
}
.rail-head, .stage-top {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.rail-head h2, .stage-top h2, .stage-empty h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.subtle { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }

.controls {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.segment {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.segment.segment-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.segment.segment-7 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #141a16;
  color: #f4f7f2;
  box-shadow: 0 18px 40px rgba(20, 26, 22, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: toast-in 220ms ease-out;
}
.toast[data-kind="already_running"],
.toast[data-kind="warn"] {
  background: linear-gradient(135deg, #1d2a20 0%, #243528 100%);
  border-color: rgba(126, 184, 130, 0.35);
}
.toast[data-kind="already_queued"],
.toast[data-kind="info"] {
  background: linear-gradient(135deg, #1a2430 0%, #223044 100%);
  border-color: rgba(120, 168, 220, 0.35);
}
.toast[data-kind="recent_success"] {
  background: linear-gradient(135deg, #1f2a18 0%, #2d3a20 55%, #243018 100%);
  border-color: rgba(160, 196, 110, 0.45);
  box-shadow: 0 18px 40px rgba(36, 48, 24, 0.35);
}
.toast[data-kind="error"] {
  background: linear-gradient(135deg, #2a1818 0%, #3a2020 100%);
  border-color: rgba(220, 120, 120, 0.4);
}
.toast-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.toast-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.toast-message {
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(244, 247, 242, 0.86);
}
.toast-close {
  border: 0;
  background: transparent;
  color: rgba(244, 247, 242, 0.7);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.toast-close:hover {
  color: #fff;
}
.toast.toast-out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.metric.queue {
  cursor: pointer;
}
.metric.queue:hover {
  outline: 1px solid var(--line);
}
.run-item .queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.run-item .queue-priority-btn,
.run-item .queue-cancel-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.run-item .queue-priority-btn {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: transparent;
}
.run-item .queue-priority-btn:disabled,
.run-item .queue-cancel-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.run-item .queue-pos {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.segment button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 8px 6px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.segment button.active,
.segment button:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.agent-report {
  padding: 10px 8px 16px;
  overflow: auto;
}
.agent-report-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px 12px;
}
.agent-report-head h3 {
  margin: 0;
  font-family: var(--serif, "Instrument Serif", Georgia, serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
}
.agent-report-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.agent-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.agent-report-table th,
.agent-report-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.agent-report-table th:first-child,
.agent-report-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
.agent-report-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper-2);
}
.agent-report-table thead th:first-child {
  background: var(--paper-2);
}
.agent-report-table tbody tr:last-child td {
  border-bottom: 0;
}
.agent-report-table .totals td {
  font-weight: 700;
  background: var(--accent-soft);
  border-top: 1px solid var(--line);
}
.agent-report-table .totals td:first-child {
  background: var(--accent-soft);
}
.agent-report-table .n-ok { color: var(--ok); font-weight: 600; }
.agent-report-table .n-live { color: var(--live); font-weight: 600; }
.agent-report-table .n-bad { color: var(--bad); font-weight: 600; }
.agent-report-tags {
  margin: 12px 6px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.agent-report-tags li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 0.8rem;
}
.agent-report-tags .tag-name {
  color: var(--ink);
  font-weight: 600;
}
.agent-report-tags .tag-count {
  color: var(--muted);
  font-family: var(--mono);
}

.list-pager-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.page-size-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 550;
}
.page-size-field select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 28px 6px 10px;
  border-radius: 8px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.list-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.list-pager[hidden] { display: none !important; }
.pager-btn {
  padding: 6px 10px !important;
  font-size: 0.78rem !important;
  min-height: 32px;
}
.pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pager-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--mono);
  min-width: 4.5rem;
  text-align: center;
}

.run-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding: 10px 10px 14px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.run-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(20, 24, 31, 0.08);
  background: var(--panel-solid);
  border-radius: 12px;
  padding: 14px 14px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  display: grid;
  gap: 8px;
  box-shadow: 0 1px 0 rgba(20, 24, 31, 0.03);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.run-item:hover,
.run-item.active {
  background: var(--paper-2);
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(20, 24, 31, 0.05);
}
.run-item.active {
  border-color: rgba(13, 92, 79, 0.35);
  background: var(--accent-soft);
}
.run-item .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.run-item .card-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.run-item .card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.retry-btn,
.stop-btn {
  appearance: none;
  border: 1px solid var(--bad);
  background: var(--panel-solid);
  color: var(--bad);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.stop-btn {
  border-color: #b45309;
  color: #b45309;
}
.retry-btn:hover:not(:disabled) {
  background: var(--bad);
  color: #fff;
}
.stop-btn:hover:not(:disabled) {
  background: #b45309;
  color: #fff;
}
.retry-btn:disabled,
.stop-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.run-item .name {
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-item .meta,
.run-item .outcome {
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--mono);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-item .outcome {
  color: var(--ink-soft);
  font-weight: 500;
}
.history-wrap {
  margin: 0 0 18px;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.history-wrap h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
}
.history-wrap .subtle {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-solid);
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.history-item .history-stop {
  justify-self: end;
}
.history-item:hover {
  border-color: var(--line);
}
.history-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.history-run {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.history-when {
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.history-server {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--steel);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-outcome {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.lead-wrap,
.actions-wrap,
.shots-wrap,
.facts-fold,
.replay-row {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.replay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.replay-row .replay-copy {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.replay-row .fold-meta {
  margin-left: 0;
}
.replay-row .replay-open[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.replay-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
}
.replay-modal[hidden] {
  display: none !important;
}
.replay-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(4px);
}
.replay-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 96vw);
  height: min(88vh, 860px);
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 12px;
  overflow: hidden;
  background: #10151c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.replay-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #161d27;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.replay-modal-title {
  color: #e8eef5;
  font-size: 0.95rem;
  font-weight: 650;
}
.replay-modal-sub {
  margin-top: 2px;
  color: #9aa8b8;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.replay-modal-close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #e8eef5;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.replay-modal-close:hover {
  border-color: rgba(255, 255, 255, 0.35);
}
.replay-modal-body {
  overflow: auto;
  padding: 14px;
  background: #0c1016;
}
.replay-modal-status {
  color: #9aa8b8;
  font-size: 0.9rem;
  padding: 24px 8px;
}
.replay-modal-player {
  display: flex;
  justify-content: center;
}
.replay-modal-player .rr-player {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.panel-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}
.panel-fold > summary::-webkit-details-marker {
  display: none;
}
.panel-fold > summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
  margin-left: 4px;
}
.panel-fold[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.panel-fold .fold-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink);
}
.panel-fold .fold-meta {
  margin-left: auto;
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.panel-fold > summary + .subtle,
.panel-fold > summary + .facts,
.panel-fold > summary + .actions-list,
.panel-fold > summary + .timeline {
  margin-top: 12px;
}
.lead-wrap h3,
.actions-wrap h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
}
.lead-wrap .subtle,
.actions-wrap .subtle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.actions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}
.action-row {
  display: grid;
  grid-template-columns: 140px 1fr 1.2fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-solid);
  border: 1px solid transparent;
}
.action-row.ok { border-color: rgba(31, 122, 76, 0.25); }
.action-row.bad { border-color: rgba(180, 35, 24, 0.28); background: var(--bad-soft); }
.action-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
}
.action-page {
  margin-top: 2px;
  font-size: 0.68rem;
  opacity: 0.85;
  word-break: break-all;
}
.action-field {
  font-size: 0.82rem;
  font-weight: 650;
  word-break: break-word;
}
.action-value {
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--ink-soft);
  word-break: break-word;
}
@media (max-width: 900px) {
  .action-row { grid-template-columns: 1fr; gap: 2px; }
}
.shots-wrap h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
}
.shots-wrap .subtle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.shot-hero,
.shot-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0f141a;
  text-decoration: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}
.shot-hero:hover,
.shot-thumb:hover {
  border-color: var(--accent);
}
.shot-stage {
  display: block;
  width: 100%;
  min-height: 180px;
  max-height: 360px;
  background: #0f141a;
}
.shot-hero img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #0f141a;
  /* Avoid white flash while the next frame decodes. */
  background-color: #0f141a;
}
.shot-hero .shot-label,
.shot-thumb span {
  display: block;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--muted);
  background: var(--panel-solid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.shot-thumb img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
  background: #0f141a;
}

body.lightbox-open {
  overflow: hidden;
}
.shot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}
.shot-lightbox[hidden] {
  display: none !important;
}
.shot-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(4px);
}
.shot-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 96vw);
  height: min(90vh, 920px);
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 12px;
  overflow: hidden;
  background: #10151c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.shot-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #161d27;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.shot-lightbox-title {
  color: #e8eef5;
  font-family: var(--mono);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shot-lightbox-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.shot-lightbox-download,
.shot-lightbox-close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #e8eef5;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
}
.shot-lightbox-download {
  border-color: rgba(13, 92, 79, 0.55);
  background: var(--accent);
  color: #fff;
}
.shot-lightbox-download:hover {
  background: var(--accent-deep);
}
.shot-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.08);
}
.shot-lightbox-stage {
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(13, 92, 79, 0.18), transparent 45%),
    #0b1016;
}
.shot-lightbox-stage img {
  max-width: 100%;
  max-height: calc(90vh - 88px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.bar {
  height: 3px;
  background: #e3e9ef;
  border-radius: 99px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #2f8f7d);
  transition: width 0.35s var(--ease);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status.running { color: var(--live); background: var(--live-soft); }
.status.success { color: var(--ok); background: var(--ok-soft); }
.status.stopped, .status.failed { color: var(--warn); background: var(--warn-soft); }
.status.error { color: var(--bad); background: var(--bad-soft); }

.stage { padding: 0; }
.stage-empty {
  min-height: 640px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 40px;
  background:
    linear-gradient(160deg, rgba(13, 92, 79, 0.05), transparent 42%),
    var(--panel-solid);
}
.stage-empty p:last-child {
  margin: 6px 0 0;
  max-width: 28rem;
  color: var(--ink-soft);
}
.stage-body { /* keep detail swaps quiet — no entrance animation on poll */ }
.stage-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.stage-top .title-block h2 { margin-bottom: 6px; }
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 8px;
}
.fact {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}
.fact.fact-wide {
  grid-column: 1 / -1;
}
.fact .k {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fact .v {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.84rem;
  word-break: break-word;
  color: var(--ink);
}

.timeline-wrap {
  margin: 0 0 8px;
  padding: 8px 18px 18px;
  border: 0;
  background: transparent;
}
.timeline-wrap > summary .fold-title {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
}
.timeline-wrap h3 {
  margin: 8px 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.timeline {
  display: grid;
  gap: 0;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}
.event {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 0 0 16px;
}
.event .spine {
  position: relative;
  display: flex;
  justify-content: center;
}
.event .spine::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: -16px;
  width: 1px;
  background: var(--line);
}
.event:last-child .spine::before { display: none; }
.event .node {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(13, 92, 79, 0.35);
  z-index: 1;
}
.event .node.warn { background: var(--warn); box-shadow: 0 0 0 1px rgba(154, 103, 0, 0.35); }
.event .node.error, .event .node.bad { background: var(--bad); box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.35); }
.event .node.success, .event .node.ok { background: var(--ok); box-shadow: 0 0 0 1px rgba(31, 122, 76, 0.35); }
.event .took {
  color: var(--accent);
  font-weight: 650;
}
.event .when {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.event .what {
  margin-top: 3px;
  font-weight: 600;
}
.event .url {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--steel);
  word-break: break-all;
}

.empty-inline {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1280px) and (min-width: 981px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .shell { width: min(100% - 24px, 1240px); padding-top: 12px; }
  .site-nav { margin-bottom: 10px; gap: 6px; }
  .site-nav-btn { height: 32px; padding: 0 12px; font-size: 0.74rem; }
  .hero, .workspace, .facts { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .segment { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .segment.segment-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .segment.segment-7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .run-list, .timeline { max-height: none; }
  .stage-empty, .workspace { min-height: auto; }
  .list-pager-controls { flex-direction: column; align-items: stretch; }
}
