:root {
  color-scheme: light;
  --canvas: #e7ece4;
  --paper: #fffaf0;
  --paper-soft: rgba(255, 250, 240, 0.82);
  --ink: #172421;
  --muted: #68756f;
  --line: rgba(23, 36, 33, 0.14);
  --line-strong: rgba(23, 36, 33, 0.22);
  --green: #0f6f64;
  --green-deep: #123f39;
  --green-soft: rgba(15, 111, 100, 0.12);
  --ochre: #c66b2c;
  --ochre-soft: rgba(198, 107, 44, 0.13);
  --red: #a73825;
  --red-soft: rgba(167, 56, 37, 0.12);
  --blueprint: #13231f;
  --shadow: 0 24px 70px rgba(24, 36, 32, 0.14);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  font-family: "Avenir Next", "Gill Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 36, 33, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, rgba(23, 36, 33, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(circle at 12% 10%, rgba(15, 111, 100, 0.20), transparent 30rem),
    radial-gradient(circle at 86% 2%, rgba(198, 107, 44, 0.18), transparent 28rem),
    radial-gradient(circle at 52% 38%, rgba(19, 35, 31, 0.08), transparent 36rem),
    linear-gradient(135deg, #f5eedf 0%, var(--canvas) 48%, #f7eddd 100%);
}

button,
a {
  font: inherit;
}

button,
a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.58rem 0.86rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.68);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

button:hover,
a:hover {
  color: var(--green-deep);
  border-color: rgba(15, 111, 100, 0.44);
  background: rgba(255, 250, 240, 0.96);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

button.primary {
  color: var(--paper);
  border-color: var(--green-deep);
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  box-shadow: 0 12px 30px rgba(15, 111, 100, 0.24);
}

.shell {
  width: min(1760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.8rem 0 2rem;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.64rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.82);
  box-shadow: 0 18px 44px rgba(24, 36, 32, 0.12);
  backdrop-filter: blur(22px);
}

.brand {
  gap: 0.72rem;
  min-height: 2.7rem;
  padding: 0.34rem 0.9rem 0.34rem 0.38rem;
  border-color: transparent;
  background: transparent;
}

.brand:hover {
  transform: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.18rem;
  height: 2.18rem;
  color: var(--paper);
  border-radius: 50%;
  background: var(--green-deep);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand span:last-child {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  font-size: 0.98rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.top-actions,
.control-actions,
.chips,
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.56rem;
}

.home-link {
  color: var(--paper);
  border-color: var(--green-deep);
  background: var(--green-deep);
}

.run-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}

.run-copy,
.run-summary,
.control-deck,
.panel,
.scenario-strip {
  border: 1px solid var(--line);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.run-copy {
  min-height: 12rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

.eyebrow {
  margin: 0 0 0.58rem;
  color: var(--ochre);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", Georgia, serif;
  font-size: clamp(2.9rem, 5.2vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: keep-all;
}

.run-copy p:not(.eyebrow) {
  max-width: 820px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.run-summary {
  display: grid;
  gap: 1rem;
  align-content: space-between;
  padding: 1rem;
  border-radius: var(--radius-lg);
}

.status-pill {
  display: grid;
  gap: 0.16rem;
  min-height: 5.8rem;
  padding: 1rem;
  color: var(--paper);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 12%, rgba(255, 250, 240, 0.20), transparent 8rem),
    linear-gradient(135deg, var(--green), var(--green-deep));
}

.status-pill[data-state="waiting"],
.status-pill[data-state="failed"],
.status-pill[data-state="blocked"] {
  background:
    radial-gradient(circle at 90% 12%, rgba(255, 250, 240, 0.20), transparent 8rem),
    linear-gradient(135deg, var(--red), #5f2018);
}

.status-pill small {
  opacity: 0.76;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill strong {
  font-size: 2rem;
  line-height: 1;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.62rem;
}

.metrics span {
  display: grid;
  gap: 0.25rem;
  min-height: 4.7rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.68);
}

.metrics b {
  color: var(--green-deep);
  font-size: 1.35rem;
}

.metrics small {
  color: var(--muted);
  line-height: 1.25;
}

.scenario-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
  padding: 0.72rem;
  overflow: visible;
  border-radius: 26px;
  box-shadow: 0 14px 44px rgba(24, 36, 32, 0.10);
}

.scenario-card {
  display: grid;
  justify-items: start;
  min-width: 0;
  gap: 0.32rem;
  min-height: 6.4rem;
  padding: 0.92rem;
  text-align: left;
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.66);
}

.scenario-card small {
  color: var(--ochre);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scenario-card strong {
  font-size: 1.02rem;
}

.scenario-card span {
  color: var(--muted);
  line-height: 1.32;
}

.scenario-card.active {
  color: var(--paper);
  border-color: transparent;
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 250, 240, 0.22), transparent 7rem),
    linear-gradient(135deg, var(--green-deep), var(--green));
  box-shadow: 0 18px 40px rgba(15, 111, 100, 0.20);
}

.scenario-card.active small,
.scenario-card.active span {
  color: rgba(255, 250, 240, 0.74);
}

.control-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.86rem 1rem;
  border-radius: 26px;
  box-shadow: 0 16px 44px rgba(24, 36, 32, 0.10);
}

.control-deck > div:first-child {
  display: grid;
  gap: 0.2rem;
}

.control-deck span {
  color: var(--muted);
  line-height: 1.35;
}

.blocked {
  margin: 0.8rem 0 0;
  padding: 0.85rem 1rem;
  color: var(--red);
  border: 1px solid rgba(167, 56, 37, 0.22);
  border-radius: 18px;
  background: rgba(255, 241, 232, 0.90);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(420px, 0.92fr) minmax(400px, 1.08fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.stage,
.inspector {
  display: grid;
  gap: 1rem;
}

.panel {
  border-radius: var(--radius-md);
  overflow: clip;
  box-shadow: 0 14px 44px rgba(24, 36, 32, 0.10);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.2rem;
  padding: 0.82rem 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-head span {
  font-weight: 900;
}

code,
.panel-head code {
  color: var(--green-deep);
  font-size: 0.75rem;
  white-space: nowrap;
}

.rail {
  position: sticky;
  top: 5.6rem;
}

.event-list {
  display: grid;
  gap: 0.46rem;
  max-height: 31rem;
  margin: 0;
  padding: 0.86rem;
  overflow: auto;
  list-style: none;
}

.event-list li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.64rem;
  align-items: center;
  padding: 0.58rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.46);
}

.event-list i {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  color: var(--muted);
  border-radius: 50%;
  background: rgba(23, 36, 33, 0.06);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 900;
}

.event-list span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.event-list b,
.event-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-list b {
  color: var(--green-deep);
  font-size: 0.82rem;
}

.event-list em,
.event-list small {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.event-list li.is-done {
  border-color: rgba(15, 111, 100, 0.34);
  background: var(--green-soft);
}

.event-list li.is-done i {
  color: var(--paper);
  background: var(--green);
}

.event-list li.is-next {
  border-color: rgba(198, 107, 44, 0.48);
  background: var(--ochre-soft);
}

.event-list li.is-next i {
  color: var(--paper);
  background: var(--ochre);
}

.coverage-head {
  border-top: 1px solid var(--line);
}

.coverage-map,
.projection-list {
  display: grid;
  gap: 0.48rem;
  padding: 0.86rem;
}

.surface-chip,
.projection-list span {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.54rem 0.62rem;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.45);
  font-size: 0.86rem;
  line-height: 1.3;
}

.surface-chip b,
.projection-list b {
  color: var(--ink);
}

.surface-chip.is-active {
  color: var(--green-deep);
  border-style: solid;
  border-color: rgba(15, 111, 100, 0.30);
  background: var(--green-soft);
}

.conversation-feed {
  display: grid;
  gap: 0.72rem;
  min-height: 36rem;
  padding: 1rem;
}

.bubble {
  position: relative;
  display: grid;
  gap: 0.42rem;
  max-width: 88%;
  padding: 0.92rem 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
}

.bubble small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bubble strong {
  line-height: 1.5;
}

.bubble.user {
  border-color: rgba(23, 36, 33, 0.18);
  background: rgba(23, 36, 33, 0.07);
}

.bubble.assistant {
  justify-self: end;
  border-color: rgba(15, 111, 100, 0.28);
  background: rgba(15, 111, 100, 0.10);
}

.bubble.process {
  margin-left: 1.4rem;
  border-color: rgba(198, 107, 44, 0.24);
  background: var(--ochre-soft);
}

.bubble.process::before {
  position: absolute;
  left: -1rem;
  top: 1rem;
  width: 0.45rem;
  height: calc(100% - 2rem);
  content: "";
  border-radius: 999px;
  background: var(--ochre);
}

.bubble.action {
  border-color: rgba(167, 56, 37, 0.24);
  background: var(--red-soft);
}

.bubble.ref {
  justify-self: end;
  border-color: rgba(15, 111, 100, 0.24);
  background: rgba(15, 111, 100, 0.08);
}

.bubble.worker {
  margin-left: 1.4rem;
  border-color: rgba(19, 35, 31, 0.22);
  background:
    linear-gradient(135deg, rgba(15, 111, 100, 0.10), rgba(198, 107, 44, 0.10)),
    rgba(255, 250, 240, 0.76);
}

.composer {
  padding-bottom: 1rem;
}

.composer-box {
  margin: 1rem;
  min-height: 5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  line-height: 1.6;
}

.chips,
.composer-actions {
  padding: 0 1rem;
}

.chips span {
  padding: 0.38rem 0.68rem;
  color: var(--green-deep);
  border-radius: 999px;
  background: var(--green-soft);
}

.live-process {
  min-height: 15.2rem;
}

.process-stack {
  display: grid;
  gap: 0.72rem;
  padding: 1rem;
}

.part {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.76rem;
  align-items: center;
  padding: 0.84rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
}

.part b {
  color: var(--green-deep);
  font-size: 0.82rem;
}

.part span {
  line-height: 1.45;
}

.part progress {
  grid-column: 2;
  width: 100%;
  height: 0.62rem;
  accent-color: var(--green);
}

.part-tool.is-running {
  border-color: rgba(198, 107, 44, 0.35);
  background: var(--ochre-soft);
}

.part-action {
  border-color: rgba(167, 56, 37, 0.30);
  background: var(--red-soft);
}

.empty {
  margin: 1rem;
  color: var(--muted);
  line-height: 1.55;
}

.artifact,
.evidence {
  min-height: 8rem;
}

.artifact-card,
.evidence-card {
  min-height: 7rem;
  margin: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 111, 100, 0.13), transparent),
    repeating-linear-gradient(135deg, rgba(23, 36, 33, 0.06), rgba(23, 36, 33, 0.06) 1px, transparent 1px, transparent 13px);
}

.evidence-card {
  background: rgba(23, 36, 33, 0.07);
}

.artifact-card b,
.evidence-card b {
  color: var(--green-deep);
}

.artifact-card p,
.evidence-card p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.payload-panel pre,
pre {
  max-height: 20rem;
  min-height: 12rem;
  margin: 1rem;
  padding: 1rem;
  overflow: auto;
  color: #dce8de;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 111, 100, 0.14), transparent),
    var(--blueprint);
}

.team-section {
  margin-top: 1rem;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.2rem 0 0.7rem;
}

.section-title h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", Georgia, serif;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.team-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.25fr 1fr;
  gap: 1rem;
}

.team-panel {
  min-height: 13rem;
}

.team-roster,
.work-board {
  min-height: 20rem;
}

.mini-stack,
.work-stack {
  display: grid;
  gap: 0.72rem;
  padding: 0.86rem;
}

.mini-card,
.work-card,
.status-object {
  display: grid;
  gap: 0.55rem;
  padding: 0.84rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.50);
}

.mini-card > div,
.work-card > div {
  display: grid;
  gap: 0.12rem;
}

.mini-card b,
.work-card b {
  color: var(--green-deep);
}

.mini-card small,
.work-card small,
.mini-card p,
.work-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.36;
}

.mini-card i,
.work-card i {
  justify-self: start;
  padding: 0.24rem 0.55rem;
  color: var(--green-deep);
  border-radius: 999px;
  background: var(--green-soft);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-card i[data-status="failed"],
.mini-card i[data-status="blocked"],
.mini-card i[data-status="killed"] {
  color: var(--red);
  background: var(--red-soft);
}

.mini-card code {
  white-space: normal;
}

.work-card progress {
  width: 100%;
  height: 0.55rem;
  accent-color: var(--green);
}

.delegation-list,
.fact-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0.86rem;
  list-style: none;
}

.delegation-list li {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.68rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

.delegation-list span {
  color: var(--ochre);
  font-size: 0.8rem;
  font-weight: 900;
}

.delegation-list small {
  color: var(--muted);
}

.fact-list li,
.status-object {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

.fact-list li {
  display: grid;
  gap: 0.42rem;
  padding: 0.68rem;
}

.fact-list span,
.status-object span {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.62rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.32;
}

.fact-list b,
.status-object b {
  color: var(--ink);
}

.compact {
  margin: 0.86rem;
}

@media (max-width: 1320px) {
  .scenario-strip {
    grid-auto-columns: minmax(250px, 1fr);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
  }

  .run-header,
  .studio-grid,
  .control-deck,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
  }

  .event-list {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 0.75rem, 1760px);
    padding-top: 0.38rem;
  }

  .topbar {
    position: static;
    align-items: stretch;
    border-radius: 24px;
  }

  .topbar,
  .control-actions,
  .metrics {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand {
    justify-content: start;
  }

  .run-copy,
  .run-summary,
  .control-deck,
  .scenario-strip,
  .panel {
    border-radius: 22px;
  }

  .run-copy {
    min-height: auto;
    padding: 1.12rem;
  }

  h1 {
    font-size: clamp(2.2rem, 11vw, 3.05rem);
    letter-spacing: -0.06em;
    line-height: 0.94;
  }

  .scenario-strip {
    grid-auto-columns: minmax(230px, 88vw);
  }

  .conversation-feed {
    min-height: 24rem;
  }

  .bubble {
    max-width: 100%;
  }

  .part,
  .surface-chip,
  .projection-list span,
  .event-list li,
  .delegation-list li,
  .fact-list span,
  .status-object span {
    grid-template-columns: 1fr;
  }

  .part progress {
    grid-column: auto;
  }
}
