:root {
  color-scheme: dark;
  --gold: #eccd86;
  --gold-soft: rgba(236, 205, 134, 0.13);
  --gold-border: rgba(236, 205, 134, 0.32);
  --black: #000000;
  --graphite-950: #05070b;
  --graphite-900: #0b0e15;
  --graphite-850: #10141e;
  --graphite-800: #171c2a;
  --graphite-700: #252c3d;
  --white: #ffffff;
  --text: #f6f3ec;
  --muted: #a9afbc;
  --quiet: #717887;
  --success: #5dd6a1;
  --success-bg: rgba(30, 129, 91, 0.13);
  --success-border: rgba(93, 214, 161, 0.3);
  --warning: #f3b77b;
  --warning-bg: rgba(137, 55, 42, 0.16);
  --warning-border: rgba(243, 183, 123, 0.34);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { background: var(--black); }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 12%, rgba(236, 205, 134, 0.07), transparent 30rem),
    var(--black);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, code { font: inherit; }

h1, h2, p { margin-top: 0; }

h1, h2 { letter-spacing: -0.025em; }

.workspace-header {
  border-bottom: 1px solid var(--graphite-700);
  background: rgba(5, 7, 11, 0.96);
}

.header-inner,
.horizon-inner,
.workspace-shell,
footer {
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}

.header-inner {
  min-height: 112px;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand-lockup { display: flex; align-items: center; gap: 16px; }

.brand-mark {
  width: 50px;
  height: 64px;
  flex: 0 0 auto;
  border: 1px solid var(--gold-border);
  border-radius: 13px;
  background: var(--graphite-900);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 35px rgba(0,0,0,.35);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-parent,
.section-kicker,
.horizon-label {
  margin-bottom: 3px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.product-title-row { display: flex; align-items: center; gap: 12px; }
.product-title-row h1 { margin: 0; color: var(--white); font-size: clamp(24px, 2.5vw, 34px); line-height: 1.05; }
.title-divider { width: 1px; height: 25px; background: var(--graphite-700); }
.product-category { margin: 0; color: #d8dae0; font-size: clamp(14px, 1.5vw, 19px); font-weight: 600; }
.tagline { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.connection-badge {
  margin: 0;
  padding: 10px 14px 10px 34px;
  position: relative;
  white-space: nowrap;
  border: 1px solid var(--graphite-700);
  border-radius: 999px;
  background: var(--graphite-900);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.connection-badge::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--quiet);
  box-shadow: 0 0 0 4px rgba(113, 120, 135, 0.12);
}

.connection-badge.connected { border-color: var(--gold-border); color: var(--gold); }
.connection-badge.connected::before { background: var(--success); box-shadow: 0 0 0 4px rgba(93, 214, 161, .1); }
.connection-badge.unavailable { color: var(--warning); border-color: var(--warning-border); white-space: normal; max-width: 420px; }
.connection-badge.unavailable::before { background: var(--warning); }

.product-horizon { border-bottom: 1px solid var(--graphite-700); background: var(--graphite-900); }
.horizon-inner { min-height: 58px; display: flex; align-items: center; gap: 14px; overflow-x: auto; }
.horizon-label { margin: 0; padding-right: 16px; white-space: nowrap; border-right: 1px solid var(--graphite-700); }
.module-list { display: flex; align-items: center; gap: 7px; min-width: max-content; }
.module-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--quiet); font-size: 11px; user-select: none; }
.module-item strong { padding: 2px 6px; border: 1px solid var(--graphite-700); border-radius: 5px; color: var(--quiet); font-family: ui-monospace, monospace; font-size: 8px; letter-spacing: .08em; }
.module-active { border-color: var(--gold-border); background: var(--gold-soft); color: var(--gold); }
.module-active strong { border-color: var(--gold-border); color: var(--gold); }

.workspace-shell { padding: 26px 0 44px; }
.scenario-bar,
.human-boundary,
.workflow-overview,
.workspace-card,
.capabilities-panel,
.activity-panel,
.technical-inspector {
  border: 1px solid var(--graphite-700);
  border-radius: 16px;
  background: var(--graphite-900);
  box-shadow: var(--shadow);
}

.scenario-bar { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.scenario-bar h2 { margin-bottom: 3px; font-size: 18px; }
.scenario-bar > div > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.scenario-button { min-width: 184px; padding: 11px 14px; border: 1px solid var(--gold-border); border-radius: 10px; background: var(--gold-soft); color: var(--gold); cursor: pointer; text-align: left; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.scenario-button:hover { transform: translateY(-1px); background: rgba(236, 205, 134, .18); border-color: rgba(236, 205, 134, .55); }
.scenario-button:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
.scenario-button span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.scenario-button small { display: block; margin-top: 2px; color: #d4d6db; font-size: 10px; }
.scenario-ambiguous { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning); }

.human-boundary { margin-top: 16px; padding: 18px 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; border-color: var(--gold-border); background: linear-gradient(110deg, var(--gold-soft), var(--graphite-900) 42%); }
.boundary-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--gold-border); border-radius: 10px; background: var(--gold-soft); color: var(--gold); font-weight: 800; }
.boundary-copy h2 { margin-bottom: 4px; font-size: 17px; }
.boundary-copy h2 span { color: var(--gold); }
.boundary-copy > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.invariant-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.invariant-list code { padding: 6px 8px; border: 1px solid var(--gold-border); border-radius: 7px; background: var(--graphite-950); color: var(--gold); font-family: ui-monospace, monospace; font-size: 10px; }

body[data-workflow-presentation="ambiguous"] .human-boundary { border-color: var(--warning-border); background: linear-gradient(110deg, var(--warning-bg), var(--graphite-900) 45%); }
body[data-workflow-presentation="ambiguous"] .boundary-icon { color: var(--warning); border-color: var(--warning-border); background: var(--warning-bg); }

.workspace-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, .85fr); gap: 18px; align-items: start; }
.primary-column, .agent-column { display: grid; gap: 14px; }
.agent-column { position: sticky; top: 16px; }

.workflow-overview, .workspace-card, .capabilities-panel, .activity-panel { padding: 20px; }
.section-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-heading-row h2, .card-heading h2 { margin: 0; font-size: 18px; }
.workflow-state, .tool-count, .activity-scope, .review-required { padding: 5px 8px; border: 1px solid var(--graphite-700); border-radius: 6px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 9px; font-weight: 800; letter-spacing: .08em; }

.workflow-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--graphite-700); border-radius: 12px; overflow: hidden; }
.workflow-step { min-height: 92px; padding: 13px 12px; display: flex; flex-direction: column; border-right: 1px solid var(--graphite-700); background: var(--graphite-950); }
.workflow-step:last-child { border-right: 0; }
.step-number { color: var(--gold); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 800; }
.step-name { margin: 6px 0 auto; color: #d7d9df; font-size: 11px; line-height: 1.25; }
.workflow-step strong { margin-top: 9px; color: var(--quiet); font-family: ui-monospace, monospace; font-size: 9px; line-height: 1.2; }
.step-human { background: var(--gold-soft); }
.step-human strong { color: var(--gold); }
body[data-workflow-presentation="success"] .workflow-step:not(.step-human) { background: var(--success-bg); }
body[data-workflow-presentation="success"] .workflow-step:not(.step-human) strong { color: var(--success); }
body[data-workflow-presentation="ambiguous"] #step-meeting { background: var(--success-bg); }
body[data-workflow-presentation="ambiguous"] #step-meeting strong { color: var(--success); }
body[data-workflow-presentation="ambiguous"] #step-relationship,
body[data-workflow-presentation="ambiguous"] #step-plan,
body[data-workflow-presentation="ambiguous"] #step-draft { background: var(--warning-bg); }
body[data-workflow-presentation="ambiguous"] #step-relationship strong,
body[data-workflow-presentation="ambiguous"] #step-plan strong,
body[data-workflow-presentation="ambiguous"] #step-draft strong { color: var(--warning); }

.workspace-card { box-shadow: none; background: linear-gradient(135deg, var(--graphite-900), var(--graphite-950)); }
.card-heading { padding-bottom: 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--graphite-700); }
.card-index { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--gold-border); border-radius: 9px; background: var(--gold-soft); color: var(--gold); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 800; }
.card-heading .section-kicker { margin-bottom: 1px; }
.card-content { margin: 15px 0 0; color: #d8dae0; font-size: 13px; }
.review-card { border-color: var(--gold-border); }
.review-required { margin-left: auto; border-color: var(--gold-border); color: var(--gold); }
body[data-workflow-presentation="ambiguous"] #section-relationship-context,
body[data-workflow-presentation="ambiguous"] #section-follow-up-planning,
body[data-workflow-presentation="ambiguous"] #section-draft { border-color: var(--warning-border); }

.draft-body { margin-top: 15px; color: #d8dae0; font-size: 13px; }
.draft-body p { margin: 0 0 10px; }
.draft-body pre { margin: 14px 0; padding: 18px; white-space: pre-wrap; border: 1px solid var(--graphite-700); border-radius: 10px; background: var(--black); color: #eeece6; font-family: ui-serif, Georgia, serif; font-size: 13px; line-height: 1.65; }
.draft-body em { color: var(--gold); font-family: ui-monospace, monospace; font-size: 10px; font-style: normal; }
.waiting-copy { color: var(--quiet); }

.capabilities-panel { border-color: var(--gold-border); }
.capabilities-intro { margin: 9px 0 16px; color: var(--muted); font-size: 12px; }
.capability-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.capability-card { padding: 13px; display: grid; grid-template-columns: auto 1fr; gap: 4px 11px; align-items: center; border: 1px solid var(--graphite-700); border-radius: 10px; background: var(--graphite-950); }
.capability-kind { grid-row: 1 / span 2; padding: 5px 7px; border: 1px solid var(--gold-border); border-radius: 6px; background: var(--gold-soft); color: var(--gold); font-family: ui-monospace, monospace; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.capability-label { color: #e3e4e8; font-size: 11px; font-weight: 700; }
.capability-tool { color: var(--gold); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; overflow-wrap: anywhere; }
.capability-trust { margin: 14px 0 0; padding: 12px; border-left: 2px solid var(--gold); background: var(--gold-soft); color: #e9e5dc; font-size: 11px; font-weight: 700; }
.registered-tools { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--graphite-700); color: var(--quiet); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
#tool-list { margin: 7px 0 0; padding-left: 17px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 9px; text-transform: none; letter-spacing: 0; }

.activity-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 7px; max-height: 290px; overflow-y: auto; }
.activity-empty { padding: 14px; border: 1px dashed var(--graphite-700); border-radius: 9px; color: var(--quiet); font-size: 11px; font-style: italic; }
.activity-item { padding: 8px 10px; display: flex; align-items: baseline; gap: 8px; border-radius: 7px; background: var(--graphite-950); color: #cfd2d9; font-size: 11px; }
.activity-icon { color: var(--gold); font-weight: 800; }
.activity-actor-system .activity-icon { color: var(--success); }
.activity-actor-human .activity-icon { color: var(--white); }
.activity-summary { margin: 12px 0 0; color: var(--success); font-size: 12px; font-weight: 800; }
.activity-summary.activity-stopped { color: var(--warning); }
.activity-handoff { margin: 5px 0 0; color: var(--gold); font-size: 11px; font-weight: 700; }

.technical-inspector { overflow: hidden; box-shadow: none; }
.technical-inspector summary { padding: 13px 16px; cursor: pointer; color: var(--quiet); font-family: ui-monospace, monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.technical-content { padding: 0 16px 16px; border-top: 1px solid var(--graphite-700); color: var(--quiet); font-family: ui-monospace, monospace; font-size: 10px; }
.technical-content h2 { margin: 14px 0 4px; color: #d3d5da; font-size: 11px; }
.technical-content p { margin-bottom: 8px; }
.state-completed { color: var(--success); font-weight: 700; }
.state-needs-review { color: var(--warning); font-weight: 700; }

footer { padding: 24px 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--graphite-700); color: var(--quiet); font-size: 10px; }
footer p { margin: 0; }
footer strong { color: var(--gold); font-family: Georgia, serif; letter-spacing: .06em; }

@media (max-width: 1080px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .agent-column { position: static; grid-template-columns: 1fr 1fr; }
  .technical-inspector { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .header-inner, .horizon-inner, .workspace-shell, footer { width: min(100% - 28px, 1440px); }
  .header-inner, .scenario-bar, footer { align-items: flex-start; flex-direction: column; }
  .connection-badge { white-space: normal; }
  .human-boundary { grid-template-columns: auto 1fr; }
  .invariant-list { grid-column: 1 / -1; justify-content: flex-start; }
  .workflow-steps { grid-template-columns: 1fr; }
  .workflow-step { min-height: auto; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; border-right: 0; border-bottom: 1px solid var(--graphite-700); }
  .workflow-step:last-child { border-bottom: 0; }
  .step-name, .workflow-step strong { margin: 0; }
  .controls, .scenario-button { width: 100%; }
  .agent-column { grid-template-columns: 1fr; }
  .technical-inspector { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
