@font-face {
  font-family: Manrope;
  src: url("/assets/manrope.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

/* VetoLoom light theme: calm paper surface, one purple accent from the logo,
   green / amber / red reserved for released / waiting / blocked. */
:root {
  color-scheme: light;
  color: var(--text);
  background: var(--page);
  font: 15px/1.6 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --page: #f6f6f3;
  --panel: #ffffff;
  --raised: #f0efeb;
  --field: #ffffff;
  --text: #12141a;
  --text-2: #2b2f37;
  --muted: #5e6570;
  --line: #e4e3de;
  --line-strong: #d2d1ca;
  --accent: #6a45e0;
  --accent-hover: #5a37cc;
  --accent-soft: #f1ecfe;
  --accent-light: #6a45e0;
  --accent-2: #a78bfa;
  --ok: #17784d;
  --ok-soft: #e3f4eb;
  --bad: #c63d2a;
  --bad-soft: #fcebe7;
  --warn: #a86400;
  --warn-soft: #fdf1dd;
  --mint: var(--ok);
  --coral: var(--bad);
  --mint-indicator: #1f9d62;
  --coral-indicator: #e0533e;
  --mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Consolas, monospace;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(18, 20, 26, .05), 0 4px 14px -8px rgba(18, 20, 26, .12);
  --shadow-lg: 0 1px 2px rgba(18, 20, 26, .05), 0 24px 60px -24px rgba(40, 22, 100, .28);
  --grid: rgba(18, 20, 26, .045);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); -webkit-font-smoothing: antialiased; }
.wrap { width: min(1240px, calc(100% - clamp(32px, 6vw, 96px))); margin-inline: auto; }
a { color: inherit; }
p, h1, h2, h3, h4 { margin: 0; }
p:empty, output:empty { display: none; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3.1rem); }
h3 { font-size: clamp(1.1rem, 1.4vw, 1.3rem); }
nav a, .button, .brand { text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code { font-family: var(--mono); }

/* ---------- Top bar ---------- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.04em; }
.brand-tile { display: grid; place-items: center; width: 34px; height: 34px; }
.brand-tile img { display: block; width: 30px; height: 30px; object-fit: contain; }
nav, .demo-controls, .inline, .hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
nav { gap: clamp(12px, 2.3vw, 26px); justify-content: flex-end; }
nav a { color: var(--muted); font-size: .875rem; font-weight: 600; }
nav a:hover, .text-link:hover { color: var(--text); }
.nav-action {
  color: #fff !important;
  background: var(--accent);
  border-radius: 9px;
  padding: 8px 14px;
  box-shadow: 0 6px 16px -8px rgba(106, 69, 224, .7);
}
.nav-action:hover { background: var(--accent-hover); }
.control-page .bar { width: 100%; padding-inline: clamp(16px, 3vw, 28px); background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }

/* ---------- Public beta page ---------- */
.hero, .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}
.hero { padding-block: clamp(48px, 8vw, 104px); position: relative; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0 -40vw;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 50% 70% at 70% 40%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 50% 70% at 70% 40%, #000 20%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero-copy { min-width: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 .75rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 14px; height: 1.5px; background: currentColor; }
h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1.02; letter-spacing: -.045em; }
.hero h1 span { color: var(--accent); }
.lede { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--muted); max-width: 46ch; margin-top: 20px; }
.hero-actions { margin-top: 28px; gap: 16px; }
.text-link { color: var(--accent); text-underline-offset: .3em; font-size: .9375rem; font-weight: 700; }

.panel, .control-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.6vw, 28px);
  background: var(--panel);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.simulator { border-color: var(--line-strong); box-shadow: var(--shadow-lg); scroll-margin-top: 24px; }
.sim-header { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 4px 13px; }
.sim-header h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
.sim-mode { color: var(--muted); font: .75rem/1.5 var(--mono); }
.sim-instruction {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
}
.sim-instruction span { color: var(--muted); font-size: .9375rem; }
.sim-instruction strong { font: 600 1.5rem/1.2 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
#timeline { list-style: none; border-top: 1px solid var(--line); min-height: 136px; margin: 20px 0 0; padding: 12px 0 0; }
#timeline li { position: relative; padding: 4px 0 4px 20px; color: var(--muted); font-size: .9375rem; }
#timeline li::before {
  content: "";
  position: absolute;
  top: .9em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
}
#timeline[data-result] li:last-child { font-weight: 700; margin-top: 4px; }
#timeline[data-result="approved"] li:last-child { color: var(--ok); }
#timeline[data-result="rollback"] li:last-child { color: var(--bad); }
#timeline[data-result="approved"] li:last-child::before { background: var(--mint-indicator); }
#timeline[data-result="rollback"] li:last-child::before { background: var(--coral-indicator); }

/* ---------- Controls ---------- */
button, .button, input, select, textarea {
  font: inherit;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 13px;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 6px 14px -8px rgba(106, 69, 224, .75);
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
button:hover, .button:hover { background: var(--accent-hover); }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.secondary { background: var(--panel); border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.secondary:hover { background: var(--raised); border-color: var(--text); }
.rollback { background: var(--bad-soft); color: var(--bad); border-color: #f0c4ba; box-shadow: none; }
.rollback:hover { background: #f9d9d1; border-color: var(--bad); }
input, select, textarea { background: var(--field); color: var(--text); width: 100%; }
input:hover, select:hover, textarea:hover { border-color: #b9b8b0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #9aa0a8; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); padding: 0; }
select {
  appearance: none;
  padding-right: 36px;
  text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 53%, calc(100% - 12px) 53%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
label { font-weight: 600; font-size: .85rem; color: var(--text-2); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--muted); }
textarea { resize: vertical; }
pre { font-family: var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: .875rem; }

/* ---------- Beta invite ---------- */
.workspace { padding-block: clamp(40px, 7vw, 88px); border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.beta-invite h2 { max-width: 15ch; }
.beta-invite h2 + p { color: var(--muted); max-width: 43ch; margin-top: 15px; }
#keys { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: .8125rem; }
#credentials summary { cursor: pointer; font-weight: 700; color: var(--accent); }
form:not(.inline), .control-card { display: grid; align-content: start; gap: 10px; }
form:not(.inline) > button { justify-self: start; }
.control-card h3 { margin-bottom: 4px; }
.control-card output { overflow-wrap: anywhere; font-size: .875rem; color: var(--text-2); padding: 10px 12px; background: var(--raised); border-radius: 10px; }

/* proof demo (kept for compatibility) */
.proof-demo { align-items: start; }
.proof-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 19px 0; }
.proof-summary dt, .proof-root span { color: var(--muted); font-size: .875rem; }
.proof-summary dd { margin: 4px 0 0; font-weight: 700; }
.proof-entries { list-style: none; padding: 0; margin: 0 0 18px; }
.proof-entries li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 10px 0; }
.proof-root { padding: 10px 12px; margin-bottom: 16px; border-radius: 10px; background: var(--raised); }
.proof-root code { display: block; overflow-wrap: anywhere; font-size: .8125rem; }
.proof-result[data-verdict="verified"] { color: var(--ok); background: var(--ok-soft); }
.proof-result[data-verdict="failed"] { color: var(--bad); background: var(--bad-soft); }

/* ---------- Rollback steps ---------- */
.rollback-steps { display: grid; gap: 8px; list-style: none; margin: 2px 0 0; padding: 0; }
.rollback-steps li {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 8px;
  background: var(--raised);
  font-size: .875rem;
}
.rollback-steps li[data-check="checked"] { border-left-color: var(--mint-indicator); }
.rollback-steps li:is([data-check="conflict"], [data-check="blocked"]) { border-left-color: var(--coral-indicator); }
.rollback-steps li:is([data-check="in_flight"], [data-check="unverified"]) { border-left-color: var(--accent); }
.rollback-steps li span { color: var(--muted); overflow-wrap: anywhere; }
.order-handoff { display: grid; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; }
.order-handoff legend { font-weight: 700; padding-inline: 4px; }
.order-handoff button { justify-self: start; }

/* ---------- Control Center shell ---------- */
.console { padding-block: clamp(28px, 4vw, 48px); border-top: 1px solid var(--line); scroll-margin-top: 9px; }
.control-page main.wrap { width: 100%; max-width: none; margin: 0; }
.control-page .console { min-height: calc(100svh - 69px); border-top: 0; padding: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.sandbox-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid #f3d9a8;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font: 600 .75rem/1 var(--mono);
}
.sandbox-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.console-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: center;
  gap: clamp(22px, 6vw, 72px);
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(32px, 8vw, 110px) clamp(16px, 4vw, 32px);
}
.console-entry h3 { font-size: clamp(2.3rem, 4.4vw, 3.6rem); letter-spacing: -.045em; }
.console-entry h3 + p { margin: 14px 0; color: var(--muted); max-width: 40ch; }
.console-entry .control-card { box-shadow: var(--shadow-lg); padding: 28px; gap: 12px; }
.console-entry ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: .9rem; }
.console-entry li { display: flex; gap: 10px; align-items: center; }
.console-entry li::before { content: "✓"; color: var(--ok); font-weight: 800; }
#status { margin: 0 clamp(16px, 3vw, 28px) 12px; }
#status:not(:empty) {
  padding: 10px 14px;
  border: 1px solid #f0c4ba;
  border-radius: 10px;
  background: var(--bad-soft);
  color: var(--bad);
  font-weight: 600;
}
.console-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100svh - 69px); }
.console-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: stretch;
  min-width: 0;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.console-sidebar > * { flex: none; }
.console-sidebar nav { flex: 1; }
.console-sidebar-title { color: var(--muted); font: 600 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding-inline: 10px; }
.workspace-chip {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
  font-size: .8125rem;
}
.workspace-chip strong { display: flex; align-items: center; gap: 7px; font-size: .875rem; }
.workspace-chip strong::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint-indicator); box-shadow: 0 0 0 3px var(--ok-soft); }
.workspace-chip span { color: var(--muted); }
.console-sidebar nav { display: flex; flex-direction: column; justify-content: flex-start; gap: 18px; }
.console-nav-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.console-nav-group > span { color: var(--muted); font: 600 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 0 10px 6px; }
.console-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
}
.console-sidebar nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.console-sidebar nav a:hover { background: var(--raised); }
.console-sidebar nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.console-sidebar nav a[aria-current="page"] svg { color: var(--accent); }
.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font: 700 .72rem/1.4 var(--mono);
  text-align: center;
}
#disconnect { justify-self: start; background: transparent; color: var(--muted); border-color: var(--line); box-shadow: none; width: 100%; }
#disconnect:hover { color: var(--bad); border-color: #f0c4ba; background: var(--bad-soft); }
.console-main { min-width: 0; padding: clamp(20px, 3.2vw, 40px) clamp(16px, 3.2vw, 44px) 64px; }
.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 24px;
}
.view-heading h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.04em; }
.view-heading p { color: var(--muted); margin-top: 6px; }
.console-view .control-card h4 { font-size: 1.02rem; line-height: 1.35; letter-spacing: -.015em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head span { color: var(--muted); font-size: .8125rem; }
.sandbox-start {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  border-color: #dcd0fb;
  background: linear-gradient(100deg, var(--accent-soft), var(--panel) 75%);
}
.sandbox-start p { margin-top: 5px; color: var(--muted); }
.sandbox-start ol { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .85rem; color: var(--text-2); counter-reset: s; }
.sandbox-start ol li { counter-increment: s; display: flex; gap: 8px; align-items: center; }
.sandbox-start ol li::before { content: counter(s); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 .7rem/1 var(--mono); }
.sandbox-submit { border-color: #dcd0fb; }
#sandbox-submit-status:not(:empty) { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text-2); }
#sandbox-submitted-action:empty { display: none; }

/* ---------- Overview dashboard ---------- */
#metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}
#metrics > div {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
#metrics dt { font-size: .8125rem; color: var(--muted); font-weight: 600; }
#metrics dd { margin: 6px 0 0; font: 600 clamp(1.3rem, 2.4vw, 1.75rem)/1.15 var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#metrics dd small { display: block; margin-top: 4px; font: 500 .75rem/1.3 Manrope, system-ui, sans-serif; color: var(--muted); letter-spacing: 0; }
#metrics [data-attention] { border-color: #f3d9a8; background: linear-gradient(180deg, var(--warn-soft), var(--panel)); }
#metrics [data-attention] dd { color: var(--warn); }
#metrics .metric-good dd { color: var(--ok); }
#metrics .metric-bad dd { color: var(--bad); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.chart { width: 100%; height: 190px; display: block; }
.chart text { font: 500 10.5px var(--mono); fill: var(--muted); }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .bar-released { fill: var(--mint-indicator); }
.chart .bar-rolled { fill: var(--coral-indicator); }
.chart .bar-other { fill: var(--accent-2); }
.chart rect:hover { opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8125rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.outcomes { display: grid; gap: 14px; }
.outcome-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--raised); }
.outcome-bar span { height: 100%; }
.outcome-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.outcome-list li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; font-size: .875rem; }
.outcome-list li i { width: 10px; height: 10px; border-radius: 3px; }
.outcome-list strong { font: 600 .875rem var(--mono); font-variant-numeric: tabular-nums; }
.saved {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: .875rem;
  color: var(--text-2);
}
.saved strong { display: block; font: 600 1.35rem/1.2 var(--mono); color: var(--accent); }
.empty-chart { display: grid; place-items: center; height: 190px; color: var(--muted); font-size: .875rem; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; padding: 16px; }
#attention-note { color: var(--muted); }
#attention-items, #activity-list { list-style: none; margin: 0; padding: 0; }
#attention-items:empty, #activity-list:empty { display: none; }
#attention-items > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(9rem, auto);
  gap: 9px 15px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
#attention-items > li:last-child { padding-bottom: 0; }
#attention-items code { display: block; color: var(--muted); overflow-wrap: anywhere; font-size: .75rem; }
.all-clear { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: .9rem; }
.all-clear::before { content: "✓"; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800; }
#activity-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: .875rem; }
#activity-list li:first-child { border-top: 0; }
#activity-list .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--raised); color: var(--muted); font: 700 .7rem/1 var(--mono); }
#activity-list .dot[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
#activity-list .dot[data-tone="bad"] { background: var(--bad-soft); color: var(--bad); }
#activity-list .dot[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
#activity-list time { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
#activity-list span { display: block; color: var(--muted); font-size: .8125rem; }

/* ---------- Generic grids & lists ---------- */
.export-card button { justify-self: start; }
.export-card p { color: var(--muted); }
#audit-result { display: block; margin-top: 12px; }
.ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
.recovery-desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 16px; align-items: start; }
#workflow-filter { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; }
#workflow-filter > div { display: grid; gap: 5px; min-width: 0; }
#workflow-filter > button { grid-column: 1 / -1; }
#workflow-list { list-style: none; margin: 0; padding: 0; }
#workflow-list:empty { display: none; }
#workflow-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-block: 12px;
}
#workflow-list li:last-child { padding-bottom: 0; }
#workflow-list li > div:first-child { min-width: 0; }
#workflow-list li > div:first-child > span, #workflow-list code { display: block; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
#workflow-list li > div:last-child { display: grid; justify-items: start; gap: 5px; }
.recovery-settings, .advanced { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 4px 18px; }
.recovery-settings > summary, .advanced > summary { cursor: pointer; color: var(--text-2); font-weight: 700; padding: 12px 0; }
.recovery-settings[open], .advanced[open] { padding-bottom: 18px; }
.recovery-settings .control-card, .advanced .control-card { box-shadow: none; }
.recovery-settings .ops-grid { margin-top: 4px; }
#intent, #policy-editor { max-width: 720px; }
.recent-actions { margin-bottom: 16px; }
#policy-domain-fields { display: grid; gap: 6px; }
#policy-domains, #capacity-json, #keys { font-family: var(--mono); }
#capacity-bookings { margin: 0; padding-left: 1.15rem; overflow-wrap: anywhere; }
#parent-field { display: grid; gap: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row > div { display: grid; gap: 6px; min-width: 0; }
.actions-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.actions-title .inline { gap: 8px; }
.actions-title select, .actions-title input { width: auto; min-height: 36px; }
#action-search { width: 220px; }

/* ---------- Table ---------- */
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
td, th { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafaf8; }
th { color: var(--muted); font: 600 .72rem/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; background: var(--raised); }
td:nth-child(2) { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td code { display: block; font-size: .75rem; color: var(--muted); }
td summary { font-size: .8125rem; color: var(--accent); cursor: pointer; }
td:last-child button + button { margin-left: 8px; }
td button, td .button { min-height: 32px; padding: 5px 11px; font-size: .8125rem; }
.action-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--raised);
  color: var(--muted);
  line-height: 1.3;
  font: 600 .75rem/1.3 var(--mono);
  white-space: nowrap;
}
.action-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.action-status[data-state="pending"] { color: var(--warn); background: var(--warn-soft); }
.action-status:is([data-state="approved"], [data-state="released"]) { color: var(--ok); background: var(--ok-soft); }
.action-status:is([data-state="rolled_back"], [data-state="needs_reconciliation"], [data-state="failed"]) { color: var(--bad); background: var(--bad-soft); }
.action-status:is([data-state="authorizing"], [data-state="reviewing"], [data-state="capturing"], [data-state="canceling"], [data-state="refunding"]) { color: var(--accent); background: var(--accent-soft); }

/* ---------- Review drawer ---------- */
#review-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(600px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100dvh;
  margin: 0;
  padding: clamp(18px, 4vw, 32px);
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: -30px 0 80px -30px rgba(18, 20, 26, .35);
}
#review-dialog::backdrop { background: rgba(18, 20, 26, .35); }
.review-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.review-heading h3 { font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: -.035em; }
#review-status:not(:empty) { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--raised); }
.review-amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.review-amounts div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.review-amounts dt { color: var(--muted); font-size: .8125rem; }
.review-amounts dd { margin: 4px 0 0; font: 600 clamp(1.2rem, 4.5vw, 1.6rem)/1.2 var(--mono); }
.review-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.review-section blockquote { margin: 8px 0 0; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
#review-window { margin-top: 8px; }
#review-controls:not(:empty) { margin-top: 12px; }
#review-events { list-style: none; padding: 0; margin: 10px 0 0; position: relative; }
#review-events li { position: relative; padding: 0 0 14px 22px; }
#review-events li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
#review-events li::after { content: ""; position: absolute; left: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
#review-events li:last-child::after { display: none; }
#review-events time { display: block; color: var(--muted); font-size: .8125rem; }
#review-references { color: var(--muted); }
#review-references summary { cursor: pointer; }
#review-references code { overflow-wrap: anywhere; font-size: .8125rem; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; max-width: min(380px, calc(100% - 40px)); }
.toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 220ms ease both;
}
.toast[data-tone="bad"] { background: var(--bad); }
.toast[data-tone="ok"] { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.demo-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  color: var(--muted);
  font-size: .8125rem;
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
}
.demo-footer div { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.demo-footer a { text-underline-offset: .24em; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  #metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .hero, .workspace { grid-template-columns: 1fr; }
  .hero { gap: 34px; }
  .console-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .recovery-desk { grid-template-columns: minmax(0, 1fr); }
  .console-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px clamp(16px, 3vw, 28px); gap: 10px; }
  .console-sidebar-title, .workspace-chip { display: none; }
  .console-sidebar nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .console-nav-group { display: flex; gap: 4px; }
  .console-nav-group > span { display: none; }
  .console-sidebar nav a { white-space: nowrap; }
  #disconnect { width: auto; align-self: flex-start; }
  .console-entry { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .ops-grid, .field-row { grid-template-columns: 1fr; }
  .sandbox-start { grid-template-columns: minmax(0, 1fr); }
  .sandbox-start .button { justify-self: start; }
  #metrics { gap: 8px; }
  #metrics > div { padding: 12px; }
  #attention-items > li { grid-template-columns: minmax(0, 1fr) auto; }
  #attention-items > li > div:last-child { grid-column: 1 / -1; }
  #attention-items > li > div:last-child:empty { display: none; }
  .bar { min-height: 60px; gap: 10px; }
  nav { gap: 6px 12px; }
  nav a { font-size: .8125rem; }
  #action-search { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  button, .button, .toast { transition: none; animation: none; }
}
.entry-link { margin-top: 18px; }
.sw-released { background: var(--mint-indicator); }
.sw-rolled { background: var(--coral-indicator); }
.sw-other { background: var(--accent-2); }
#activity-list li { cursor: pointer; }
#activity-list li:hover strong { color: var(--accent); }

/* ---------- Sign-in card ---------- */
.entry-card { gap: 12px; box-shadow: var(--shadow-lg); padding: 24px; }
.entry-card form { gap: 10px; }
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 11px; background: var(--raised); border: 1px solid var(--line); margin-bottom: 6px; }
.switch button { background: transparent; color: var(--muted); box-shadow: none; min-height: 36px; font-weight: 600; }
.switch button:hover { background: rgba(255, 255, 255, .6); color: var(--text); }
.switch button[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
#signup-status:not(:empty) { padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: .875rem; font-weight: 600; }
#credentials { display: grid; gap: 12px; }
#credentials h4 { font-size: 1.05rem; }
.key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.key-row > div { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; }
.key-row > div span { color: var(--muted); }
.key-row code { font-size: .75rem; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.key-row .copy { min-height: 34px; padding: 6px 12px; }
.control-page #entry-footer { width: min(1240px, calc(100% - clamp(32px, 6vw, 96px))); margin-inline: auto; }

/* ---------- Loop Breaker / emergency stop ---------- */
.sidebar-actions { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar-actions .muted { font-size: .75rem; display: flex; align-items: center; gap: 7px; padding-inline: 2px; }
.sidebar-actions .muted::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint-indicator); box-shadow: 0 0 0 3px var(--ok-soft); flex: none; }
.is-frozen .sidebar-actions .muted::before { background: var(--coral-indicator); box-shadow: 0 0 0 3px var(--bad-soft); }
.danger { background: var(--panel); color: var(--bad); border-color: #f0c4ba; box-shadow: none; width: 100%; }
.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.danger.armed, #unfreeze.armed { background: var(--bad); color: #fff; border-color: var(--bad); }
.freeze-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid #f0c4ba;
  border-radius: 14px;
  background: linear-gradient(100deg, var(--bad-soft), var(--panel) 80%);
  box-shadow: var(--shadow-sm);
}
.freeze-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bad); color: #fff; font-size: 1.2rem; }
.freeze-banner strong { color: var(--bad); font-size: 1rem; }
.freeze-banner p { color: var(--text-2); font-size: .875rem; margin-top: 2px; }
.loop-card ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; color: var(--text-2); font-size: .9rem; }
.loop-card p { color: var(--text-2); font-size: .9rem; }
.loop-card { border-color: #dcd0fb; background: linear-gradient(180deg, var(--accent-soft), var(--panel) 60%); }
@media (max-width: 860px) {
  .sidebar-actions { grid-template-columns: 1fr auto; border-top: 0; padding-top: 0; }
  .sidebar-actions .muted { display: none; }
  .danger { width: auto; }
}
@media (max-width: 620px) { .freeze-banner { grid-template-columns: auto minmax(0, 1fr); } .freeze-banner button { grid-column: 1 / -1; justify-self: start; } }

/* ---------- Easy onboarding ---------- */
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 4px 0 2px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#open-sandbox-box { display: grid; gap: 8px; }
#open-sandbox-box button { width: 100%; }
.connect-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 900px; }
.connect-steps > li { gap: 14px; }
.step-head { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.step-head h4 { margin-top: 5px; }
.step-head p { margin-top: 2px; }
.step-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 .8rem/1 var(--mono); }
#connect-key { max-width: 520px; font-family: var(--mono); }
.test-result { display: grid; gap: 6px; justify-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.test-result p { font-size: .9rem; color: var(--text-2); }
.code-tabs { max-width: 560px; grid-template-columns: repeat(4, 1fr); }
.code-box { position: relative; }
.code-box pre { margin: 0; padding: 16px 18px; border-radius: 12px; background: #12141a; color: #e8e8e6; font-size: .8rem; line-height: 1.65; overflow-x: auto; white-space: pre; max-height: 380px; }
.code-box .copy { position: absolute; top: 10px; right: 10px; min-height: 30px; padding: 4px 10px; font-size: .78rem; }
.explanation { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--raised); color: var(--text-2); font-size: .9rem; border-left: 3px solid var(--accent); }
.explanation[data-status="blocked"], .explanation[data-status="failed"] { background: var(--bad-soft); border-left-color: var(--bad); }
.explanation[data-status="completed"] { background: var(--ok-soft); border-left-color: var(--ok); }
@media (max-width: 620px) { .code-tabs { grid-template-columns: 1fr 1fr; } }
.console-sidebar nav { align-items: stretch; }
