:root {
  --paper: #f1eadc;
  --ink: #171713;
  --muted: #746f64;
  --faint: #a49d8d;
  --line: rgba(23, 23, 19, 0.16);
  --line-strong: rgba(23, 23, 19, 0.45);
  --acid: #ff4d00;
  --wash: #e6ddcb;
  --green: #246b4b;
  --red: #9e2a1f;
  --font-sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "Fragment Mono", ui-monospace, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(255, 77, 0, 0.22);
}

:focus-visible {
  outline: 2px solid rgba(255, 77, 0, 0.6);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.grain {
  position: fixed;
  z-index: 100;
  inset: 0;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

em {
  color: var(--acid);
  font-style: normal;
}

/* ---------------------------------------------------------------- orbit */

.orbit {
  position: relative;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.orbit::before {
  position: absolute;
  top: 50%;
  right: -18%;
  left: -18%;
  border-top: 1px solid var(--line);
  content: "";
  transform: rotate(-26deg);
}

.orbit::after {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  background: var(--acid);
  content: "";
  transform: rotate(-58deg) translateX(var(--orbit-r));
  animation: orbit var(--orbit-t, 16s) linear infinite;
}

.orbit-boot {
  width: 96px;
  height: 96px;
  --orbit-r: 48px;
  --orbit-t: 2.2s;
}

.orbit-boot::after {
  width: 10px;
  height: 10px;
  margin: -5px;
}

.orbit-idle {
  width: 124px;
  height: 124px;
  margin-bottom: 30px;
  --orbit-r: 62px;
  --orbit-t: 16s;
}

.orbit-idle::after {
  width: 12px;
  height: 12px;
  margin: -6px;
}

.orbit-gate {
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  --orbit-r: 27px;
  --orbit-t: 9s;
}

.orbit-gate::after {
  width: 7px;
  height: 7px;
  margin: -3.5px;
}

.orbit-mark {
  width: 22px;
  height: 22px;
  border-color: var(--ink);
  --orbit-r: 11px;
  --orbit-t: 30s;
}

.orbit-mark::before {
  display: none;
}

.orbit-mark::after {
  width: 6px;
  height: 6px;
  margin: -3px;
}

@keyframes orbit {
  to {
    transform: rotate(302deg) translateX(var(--orbit-r));
  }
}

/* ------------------------------------------------------------- overlays */

.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity 300ms ease;
}

.boot.done {
  opacity: 0;
  pointer-events: none;
}

/* the ledger's double head-rule */

.rule-double {
  position: relative;
  border-bottom: 2px solid var(--ink);
}

.rule-double::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  border-top: 1px solid var(--ink);
  content: "";
}

/* ----------------------------------------------------------------- shell */

#app {
  width: min(1600px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px) 72px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 16px;
  margin-bottom: 5px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark .orbit-mark {
  align-self: center;
}

.wordmark-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.masthead-meta {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
}

.count-line {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.count-line .mono {
  color: var(--ink);
  font-weight: 400;
}

.text-button {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 140ms ease;
}

.text-button:hover {
  color: var(--acid);
}

/* --------------------------------------------------------- reference row */

.reference-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: clamp(14px, 2.5vw, 28px);
  margin-top: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 160ms ease;
}

.reference-row:focus-within {
  border-color: var(--acid);
}

.reference-row > label,
.section-head,
.gate-card label,
.publish-dialog label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.reference-row input {
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
}

.reference-row input::placeholder {
  color: var(--faint);
}

.model-note {
  align-self: center;
  justify-self: start;
  margin: 0;
  padding: 6px 14px 7px;
  border: 1px solid var(--ink);
  background: rgba(230, 221, 203, 0.55);
  white-space: nowrap;
}

.model-note strong {
  display: block;
  min-height: 1.2em;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
}

.model-note strong::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--acid);
  content: "";
  vertical-align: 2px;
}

.model-note small {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.forge {
  align-self: center;
  padding: 9px 18px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms ease;
}

.forge:hover {
  background: var(--acid);
}

.forge:disabled {
  opacity: 0.55;
  cursor: default;
}

.form-error {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ------------------------------------------------------------- workspace */

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100svh - 200px);
  margin-top: 26px;
}

.jobs-panel {
  padding-right: clamp(18px, 3vw, 36px);
  border-right: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.job-list {
  display: grid;
}

.job-row {
  position: relative;
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 13px 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.job-row::before {
  position: absolute;
  top: 0;
  bottom: -1px;
  left: -1px;
  width: 2px;
  background: var(--acid);
  content: "";
  transform: scaleY(0);
  transition: transform 140ms ease;
}

.job-row:hover {
  background: rgba(230, 221, 203, 0.5);
}

.job-row.active {
  background: rgba(230, 221, 203, 0.75);
}

.job-row.active::before {
  transform: scaleY(1);
}

.job-title {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------- status flag */

.status-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.status-flag::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-flag[data-status="completed"] {
  color: var(--green);
}

.status-flag[data-status="failed"] {
  color: var(--red);
}

.status-flag[data-status="running"],
.status-flag[data-status="queued"] {
  color: var(--acid);
}

.status-flag[data-status="running"]::before,
.status-flag[data-status="queued"]::before {
  animation: blink 1.6s ease-in-out infinite;
}

.jobs-more {
  margin: 14px 10px 0;
}

.empty-note {
  margin: 22px 0;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.25;
}

/* ---------------------------------------------------------------- detail */

.detail-panel {
  min-width: 0;
  padding: 4px 0 0 clamp(22px, 3.5vw, 44px);
}

.idle-state {
  display: grid;
  min-height: 460px;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
  font-family: var(--font-serif);
  font-size: 23px;
  line-height: 1.25;
}

.idle-state p {
  margin: 0;
}

.detail-number {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-domain {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.5vw, 68px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px clamp(16px, 2vw, 28px);
  margin: 22px 0 0;
}

.detail-meta > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.detail-meta dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.detail-meta dd {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.detail-meta .status-flag {
  display: inline;
  text-transform: capitalize;
}

.detail-meta .status-flag::before {
  content: none;
}

.detail-duration {
  font-variant-numeric: tabular-nums;
}

.detail-body {
  margin-top: 26px;
}

/* --------------------------------------------------------------- console */

.console-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(241, 234, 220, 0.16);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.console-side {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pulse-lines {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 14px;
}

.pulse-lines i {
  width: 3px;
  height: 14px;
  background: var(--acid);
  opacity: 0.5;
  transform: scaleY(0.36);
  transform-origin: bottom;
  animation: meter 1.1s ease-in-out infinite alternate;
}

.pulse-lines i:nth-child(2) { animation-delay: -0.5s; }
.pulse-lines i:nth-child(3) { animation-delay: -0.8s; }
.pulse-lines i:nth-child(4) { animation-delay: -0.2s; }
.pulse-lines i:nth-child(5) { animation-delay: -0.65s; }

.console-live::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--acid);
  content: "";
  animation: blink 1.6s ease-in-out infinite;
}

.console-live[data-ended] {
  color: rgba(241, 234, 220, 0.55);
}

.console-live[data-ended]::before {
  background: rgba(241, 234, 220, 0.4);
  animation: none;
}

.agent-lanes {
  display: flex;
  overflow-x: auto;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(241, 234, 220, 0.16);
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 234, 220, 0.3) var(--ink);
}

.agent-lanes::-webkit-scrollbar,
.console::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.agent-lanes::-webkit-scrollbar-track,
.console::-webkit-scrollbar-track {
  background: var(--ink);
}

.agent-lanes::-webkit-scrollbar-thumb,
.console::-webkit-scrollbar-thumb {
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(241, 234, 220, 0.32);
}

.agent-lanes::-webkit-scrollbar-thumb:hover,
.console::-webkit-scrollbar-thumb:hover {
  background: rgba(241, 234, 220, 0.5);
}

.agent-lanes::-webkit-scrollbar-button,
.console::-webkit-scrollbar-button {
  display: none;
}

.agent-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex: 0 0 max-content;
  min-width: 150px;
  gap: 0 10px;
  align-items: baseline;
  padding: 0 14px 11px;
  border-right: 1px solid rgba(241, 234, 220, 0.12);
}

.lane-meter {
  grid-column: 1 / -1;
  height: 2px;
  margin-bottom: 10px;
  background: rgba(241, 234, 220, 0.22);
}

.agent-lane[data-state="started"] .lane-meter {
  background: var(--acid);
  animation: blink 1.6s ease-in-out infinite;
}

.agent-lane[data-state="interrupted"] .lane-meter {
  background: var(--red);
}

.lane-name {
  min-width: 0;
  overflow: visible;
  color: rgba(241, 234, 220, 0.55);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.agent-lane[data-state="started"] .lane-name {
  color: var(--paper);
}

.lane-time {
  color: rgba(241, 234, 220, 0.4);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.agent-lane[data-state="started"] .lane-time {
  color: rgba(241, 234, 220, 0.75);
}

.console {
  display: grid;
  grid-template-columns: 70px fit-content(120px) fit-content(90px) minmax(0, 1fr);
  align-content: start;
  height: max(360px, calc(100svh - 430px));
  margin: 0;
  padding: 8px 18px 20px;
  overflow-y: auto;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 234, 220, 0.3) var(--ink);
}

.console-wrap:has(.agent-lanes:not([hidden])) .console {
  height: max(300px, calc(100svh - 492px));
}

.console li {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid rgba(241, 234, 220, 0.07);
  white-space: pre-wrap;
}

.console time {
  color: rgba(241, 234, 220, 0.45);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.log-source:empty {
  display: none;
}

.console li:has(.log-source:empty) .log-label {
  grid-column: 2 / 4;
}

.log-source {
  overflow: hidden;
  color: rgba(241, 234, 220, 0.5);
  text-align: right;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.log-label {
  overflow: hidden;
  color: rgba(241, 234, 220, 0.38);
  text-align: right;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.log-message {
  grid-column: 4;
  min-width: 0;
  overflow-wrap: anywhere;
}

.console li:hover {
  background: rgba(241, 234, 220, 0.035);
}

.console li[data-kind="tool"] .log-message,
.console li[data-kind="think"] .log-message,
.console li[data-kind="system"] .log-message {
  color: rgba(241, 234, 220, 0.56);
}

.console li[data-kind="think"] .log-message {
  font-style: italic;
}

.console li[data-kind="tool"] .log-message::before {
  margin-right: 7px;
  color: rgba(241, 234, 220, 0.28);
  content: "\203A";
}

.console li[data-kind="say"] {
  padding-block: 10px;
}

.console li[data-kind="say"] .log-label {
  color: var(--acid);
}

.console li[data-kind="say"] {
  background: rgba(255, 77, 0, 0.055);
  border-bottom-color: rgba(255, 77, 0, 0.14);
}

.console li[data-kind="say"] .log-message {
  max-width: 90ch;
  color: var(--paper);
}

.console-elapsed {
  color: rgba(241, 234, 220, 0.55);
  font-variant-numeric: tabular-nums;
}

.console-elapsed:empty {
  display: none;
}

.console-jump {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgba(241, 234, 220, 0.25);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease;
}

.console-jump:hover {
  border-color: var(--acid);
}

.console-jump::before {
  color: var(--acid);
  content: "\2193";
}

.console li[data-kind="lifecycle"] .log-label {
  color: rgba(241, 234, 220, 0.72);
}

.console li[data-level="error"] {
  color: #ff9082;
}

.console li[data-level="warn"] {
  color: #ffcb73;
}

.console li[data-level="error"] .log-label,
.console li[data-level="error"] .log-message,
.console li[data-level="warn"] .log-label,
.console li[data-level="warn"] .log-message {
  color: inherit;
}

/* --------------------------------------------------------------- results */

.results-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.results-head .mono {
  color: var(--ink);
  font-weight: 400;
}

.qa-warning {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 2px solid #b46b00;
  background: rgba(255, 185, 62, 0.12);
}

.qa-warning strong,
.diagnostic-links strong {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.qa-warning p {
  margin: 0;
  color: #704500;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
}

.deck-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.deck-bar .deck-note {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.deck-bar .deck-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.deck-bar[data-live] .deck-label::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  content: "";
  vertical-align: 1px;
}

.deck-bar a.mono {
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
}

.deck-bar a.mono:hover {
  color: var(--acid);
}

.deck-bar .variant-actions {
  margin-left: 0;
}

.variant-card {
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--line);
}

.variant-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.variant-num {
  flex: none;
  color: var(--acid);
  font-size: 11px;
}

.variant-head h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.variant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: auto;
}

.variant-actions a,
.variant-actions button {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 140ms ease;
}

.variant-actions a:hover,
.variant-actions button:hover {
  color: var(--acid);
}

.variant-card > p {
  max-width: 70ch;
  margin: 10px 0 0 27px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.variant-frame-wrap {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--ink);
  background: white;
}

.variant-frame-wrap::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, transparent 48%, var(--acid) 49%);
  pointer-events: none;
  content: "";
}

.variant-frame {
  width: 1440px;
  height: 900px;
  border: 0;
  transform: scale(var(--frame-scale, 0.5));
  transform-origin: top left;
}

/* --------------------------------------------------------------- failure */

.failure-card {
  margin-top: 26px;
  padding: 18px 22px;
  border-left: 2px solid var(--red);
  background: rgba(158, 42, 31, 0.06);
}

.failure-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
}

.failure-card p {
  margin: 0;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.diagnostic-links {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(158, 42, 31, 0.18);
}

.diagnostic-links > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.diagnostic-links a {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.diagnostic-links a:hover {
  color: var(--red);
}

/* ------------------------------------------------------------------ gate */

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--line) 31px 32px),
    var(--paper);
}

.gate-card {
  width: min(400px, 100%);
  padding: 34px 34px 26px;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--wash);
}

.gate-card h1 {
  margin: 14px 0 4px;
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.gate-sub {
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 4px 0 -3px var(--ink);
  color: var(--muted);
  font-size: 13px;
}

.gate-card label {
  display: block;
  margin-bottom: 6px;
}

.gate-input {
  border-bottom: 1px solid var(--ink);
  transition: border-color 160ms ease;
}

.gate-input:focus-within {
  border-color: var(--acid);
}

.gate-input input {
  width: 100%;
  padding: 11px 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
}

.gate-card button[type="submit"] {
  width: 100%;
  margin-top: 18px;
  padding: 11px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms ease;
}

.gate-card button[type="submit"]:hover {
  background: var(--acid);
}

/* ---------------------------------------------------------------- dialog */

.publish-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100svh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--wash);
}

.publish-dialog::backdrop {
  background: rgba(23, 23, 19, 0.55);
  backdrop-filter: blur(3px);
}

.publish-dialog form {
  padding: 28px 30px 24px;
}

.publish-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 4px 0 -3px var(--ink);
}

.publish-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
}

.publish-dialog label {
  display: block;
  margin-bottom: 7px;
}

.publish-input {
  display: flex;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid var(--ink);
  font-size: 12.5px;
  transition: border-color 160ms ease;
}

.publish-input:focus-within {
  border-color: var(--acid);
}

.publish-input span {
  flex: none;
  color: var(--muted);
}

.publish-input input {
  min-width: 60px;
  flex: 1;
  padding: 11px 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--acid);
  font: inherit;
}

.publish-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.publish-submit {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms ease;
}

.publish-submit:hover {
  background: var(--acid);
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

@keyframes meter {
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 860px) {
  .reference-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .reference-row > label {
    grid-column: 1 / -1;
    padding-top: 10px;
  }

  .reference-row input {
    grid-column: 1 / -1;
    font-size: 16px; /* stops iOS zoom-on-focus */
  }

  .model-note {
    margin-bottom: 12px;
  }

  .forge {
    margin-bottom: 8px;
  }

  .workspace {
    display: block;
  }

  .jobs-panel {
    border-right: 0;
    padding-right: 0;
  }

  .job-list {
    max-height: 300px;
    overflow-y: auto;
  }

  .detail-panel {
    margin-top: 30px;
    padding-left: 0;
  }

  .detail-meta {
    gap: 8px 24px;
  }

  .console {
    height: 45svh;
    padding-inline: 12px;
  }

  .console {
    grid-template-columns: max-content fit-content(90px) minmax(0, 1fr);
  }

  .console li {
    gap: 7px;
  }

  .log-message {
    grid-column: 3;
  }

  .console .log-label {
    display: none;
  }

  .console li:has(.log-source:empty) .log-label {
    display: block;
    grid-column: 2;
  }

  .agent-lane {
    padding-inline: 10px;
  }

  .variant-head {
    flex-wrap: wrap;
  }

  .variant-actions {
    width: 100%;
    margin-left: 27px;
  }

  .variant-card > p {
    margin-left: 27px;
  }

  .gate-card input,
  .publish-input input {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
