:root {
  --ink: #101b2d;
  --muted: #5d6878;
  --line: #d7e0e8;
  --surface: #ffffff;
  --wash: #eef5f7;
  --cyan: #04a7be;
  --amber: #e79b18;
  --magenta: #c83f8c;
  --lime: #6da82c;
  --violet: #7652c8;
  --danger: #b43b4b;
  --success: #267a54;
  --shadow: 0 18px 44px rgba(25, 48, 70, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 66px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px clamp(18px, 4vw, 64px);
  color: #fff;
  background: rgba(9, 24, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  background: var(--violet);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand small {
  margin-top: 1px;
  color: #aebdca;
  font-size: 0.72rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  color: #dce7ee;
  text-decoration: none;
  font-size: 0.88rem;
}

nav a:hover,
nav a:focus-visible {
  color: #fff;
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.private-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: #dce7ee;
  font-size: 0.78rem;
}

.private-badge svg,
.icon-button svg,
button svg {
  width: 17px;
  height: 17px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: #fff;
  background: transparent;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.hero {
  position: relative;
  min-height: clamp(480px, 72vh, 760px);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 72px);
  color: #fff;
  background: #188dc5;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: center 42%;
}

.hero-shade {
  background: rgba(4, 18, 33, 0.38);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
  padding: 22px 24px;
  border-left: 4px solid #fff;
  background: rgba(7, 25, 42, 0.78);
  backdrop-filter: blur(8px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #8deeff;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(3.8rem, 10vw, 8rem);
  line-height: 0.88;
}

.hero-line {
  max-width: 620px;
  margin: 16px 0;
  color: #eef9ff;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 700;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7ee081;
  box-shadow: 0 0 0 5px rgba(126, 224, 129, 0.16);
}

.hero-separator {
  width: 1px;
  height: 17px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.45);
}

.control-band,
.team-band,
.report-band {
  padding: clamp(56px, 7vw, 96px) clamp(18px, 4vw, 64px);
}

.control-band {
  background: var(--surface);
}

.team-band {
  background: #e6f0f1;
}

.report-band {
  background: #15243a;
  color: #fff;
}

.section-heading {
  max-width: 1480px;
  margin: 0 auto 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.control-actions,
.gate-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.secondary-button,
.approve-button,
.return-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 5px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.approve-button {
  border: 1px solid var(--success);
  color: #fff;
  background: var(--success);
}

.return-button {
  border: 1px solid #d7a14f;
  color: #7a4a04;
  background: #fff2d9;
}

.mission-grid {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(500px, 2fr) minmax(190px, 0.7fr);
  gap: 16px;
  align-items: stretch;
}

.orchestrator-panel,
.workflow-panel,
.evidence-panel,
.agent-card,
.report-item,
.event-log {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.orchestrator-panel,
.evidence-panel {
  overflow: hidden;
}

.orchestrator-panel img,
.evidence-panel img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
}

.orchestrator-panel > div,
.evidence-panel > div {
  padding: 18px;
}

.agent-code {
  margin: 0 0 5px;
  color: var(--violet);
  font-size: 0.7rem;
  font-weight: 850;
}

.orchestrator-panel h3,
.evidence-panel h3,
.human-gate h3,
.agent-card h3,
.event-log h3 {
  margin: 0;
  font-size: 1.05rem;
}

dl {
  margin: 18px 0 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 750;
}

.workflow-panel {
  min-width: 0;
  padding: 22px;
}

.workflow-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 8px;
}

.workflow-state {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7fafb;
}

.workflow-state span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.workflow-state strong {
  overflow-wrap: anywhere;
  font-size: 0.72rem;
}

.workflow-state.complete {
  border-color: #7abf9d;
  background: #eaf6ef;
}

.workflow-state.current {
  border-color: var(--violet);
  box-shadow: inset 0 0 0 2px rgba(118, 82, 200, 0.18);
  background: #f0ecfb;
}

.human-gate {
  margin-top: 18px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #b7c9d3;
  border-radius: 6px;
  background: #eef6f8;
}

.human-gate.active {
  border-color: var(--amber);
  background: #fff6e5;
}

.gate-owner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.gate-owner img {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 5px;
}

.gate-owner p:last-child,
.evidence-panel p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 3px;
  border: 1px solid #b8c7cb;
  border-radius: 6px;
  background: #dce8e9;
}

.segment {
  min-width: 98px;
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 750;
}

.segment.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 53, 70, 0.12);
}

.agent-grid {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.agent-card {
  overflow: hidden;
  min-width: 0;
}

.agent-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
}

.agent-card-body {
  min-height: 180px;
  padding: 17px;
  border-top: 4px solid var(--accent);
}

.agent-card-topline,
.agent-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agent-status {
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: #f8fafb;
  font-size: 0.66rem;
  font-weight: 800;
}

.agent-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.agent-artifact {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.ledger-count {
  color: #b9c8d7;
  font-size: 0.84rem;
}

.report-layout {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 16px;
}

.report-list {
  display: grid;
  gap: 8px;
}

.report-item {
  min-height: 74px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--ink);
  box-shadow: none;
}

.report-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: #f0f5f7;
}

.report-item.ready .report-icon {
  color: var(--success);
  border-color: #8bc6a8;
  background: #e8f5ee;
}

.report-item strong,
.report-item small {
  display: block;
  overflow-wrap: anywhere;
}

.report-item small {
  margin-top: 4px;
  color: var(--muted);
}

.report-state {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.event-log {
  min-height: 100%;
  padding: 18px;
  color: var(--ink);
  box-shadow: none;
}

.event-log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.icon-button.light {
  color: var(--ink);
  border-color: var(--line);
}

.event-log ol {
  max-height: 390px;
  overflow: auto;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.event-log li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.event-log li strong {
  display: block;
  margin-bottom: 3px;
}

.event-log li span {
  color: var(--muted);
}

.empty-event {
  color: var(--muted);
}

footer {
  min-height: 70px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(18px, 4vw, 64px);
  color: #aebdca;
  background: #0b1727;
  font-size: 0.74rem;
}

@media (max-width: 1100px) {
  .mission-grid {
    grid-template-columns: 230px 1fr;
  }

  .evidence-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 150px 1fr;
  }

  .evidence-panel img {
    height: 100%;
  }

  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  nav {
    display: none;
  }

  .private-badge {
    display: none;
  }

  .hero {
    min-height: 560px;
    align-items: flex-end;
    padding: 18px;
  }

  .hero-image {
    object-position: 52% center;
  }

  .hero-copy {
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-actions {
    width: 100%;
  }

  .control-actions button {
    flex: 1;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .orchestrator-panel {
    display: grid;
    grid-template-columns: 140px 1fr;
  }

  .orchestrator-panel img {
    height: 100%;
  }

  .workflow-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .human-gate {
    align-items: flex-start;
    flex-direction: column;
  }

  .gate-buttons {
    width: 100%;
  }

  .gate-buttons button {
    flex: 1;
  }

  .agent-grid,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .agent-card {
    display: grid;
    grid-template-columns: 145px 1fr;
  }

  .agent-card img {
    height: 100%;
  }

  .agent-card-body {
    min-height: 0;
  }
}

@media (max-width: 470px) {
  .brand small {
    display: none;
  }

  h1 {
    font-size: 4rem;
  }

  .orchestrator-panel,
  .evidence-panel,
  .agent-card {
    display: block;
  }

  .workflow-panel {
    padding: 14px;
  }

  .workflow-track {
    grid-template-columns: 1fr;
  }

  .gate-owner {
    align-items: flex-start;
  }

  .gate-buttons {
    flex-direction: column;
  }

  .gate-buttons button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
