:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f2ea;
  color: #17211e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 88% 4%, rgba(222, 117, 52, .16), transparent 24rem),
    linear-gradient(180deg, #fbfaf6 0, #f5f2ea 42rem);
}

button, input { font: inherit; }

button { cursor: pointer; }

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #17211e;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #fff;
  background: #e06c33;
  box-shadow: 4px 4px 0 #17211e;
}

.topbar-meta, .actions, .approval-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.track, .runtime-badge, .state-pill {
  border: 1px solid #c8c8c0;
  border-radius: 999px;
  padding: 6px 9px;
  color: #53615b;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.track { color: #9f3a16; border-color: #e9b9a6; background: #fff7f3; }
.runtime-badge { background: #fff; }

.hero {
  max-width: 810px;
  padding: 78px 0 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #aa461e;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -.065em;
  line-height: .98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
  letter-spacing: -.03em;
}

h3 { margin-bottom: 10px; font-size: .86rem; }

.lede {
  max-width: 650px;
  color: #58635e;
  font-size: 1.08rem;
  line-height: 1.6;
}

.notice {
  display: flex;
  gap: 10px;
  max-width: 880px;
  padding: 13px 16px;
  border-left: 3px solid #e06c33;
  background: rgba(255, 255, 255, .64);
  color: #59635f;
  font-size: .9rem;
  line-height: 1.45;
}

.incident-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(120px, 1fr));
  gap: 1px;
  margin-top: 30px;
  border: 1px solid #17211e;
  background: #17211e;
}

.summary-primary, .summary-stat {
  min-height: 118px;
  padding: 20px;
  background: #fffdf8;
}

.summary-primary { display: flex; flex-direction: column; justify-content: space-between; }
.summary-primary h2 { font-size: 1.35rem; }
.summary-stat span { display: block; color: #6a726e; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.summary-stat strong { display: block; margin-top: 10px; font-size: 1rem; line-height: 1.35; }

.actions { margin: 20px 0 8px; flex-wrap: wrap; }

.button {
  min-height: 44px;
  border: 1px solid #17211e;
  border-radius: 5px;
  padding: 10px 16px;
  font-weight: 750;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.button:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 #17211e; }
.button:focus-visible, input:focus-visible { outline: 3px solid #d96a32; outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { color: #fff; background: #e06c33; }
.button-secondary { color: #17211e; background: #fffdf8; }
.button-dark { color: #fff; background: #17211e; }

.operation-message { min-height: 24px; margin-bottom: 22px; color: #53615b; font-size: .9rem; }
.operation-message.error { color: #a02e1b; font-weight: 700; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 18px;
}

.panel {
  min-height: 430px;
  padding: 22px;
  border: 1px solid #d1d0c8;
  border-radius: 8px;
  background: rgba(255, 253, 248, .84);
}

.panel-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid #deddd5; }
.state-pill { white-space: nowrap; background: #fff; }
.state-pill.ready { border-color: #80b79d; color: #156044; background: #effaf4; }
.state-pill.alert { border-color: #e8b1a3; color: #9f341d; background: #fff4f0; }

.tool-calls, .evidence-signals, .recovery-steps {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.tool-calls { counter-reset: steps; }

.tool-calls li {
  position: relative;
  min-height: 62px;
  margin-bottom: 9px;
  padding: 11px 12px 11px 46px;
  border: 1px solid #deddd5;
  border-radius: 6px;
  background: #fff;
}

.tool-calls li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  top: 14px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #e6f4ed;
  color: #176149;
  font-size: .72rem;
  font-weight: 800;
}

.tool-name { display: block; color: #17211e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .76rem; font-weight: 750; }
.tool-detail { display: block; margin-top: 4px; color: #61706a; font-size: .78rem; line-height: 1.35; }
.signal-section { margin-top: 28px; padding-top: 18px; border-top: 1px solid #deddd5; }

.evidence-signals li {
  margin-bottom: 9px;
  padding: 10px 12px;
  border-left: 3px solid #75ae93;
  background: #f0f8f3;
  color: #43534c;
  font-size: .84rem;
  line-height: 1.45;
}

.signal-kind { color: #176149; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.report-content { padding: 20px 0 8px; }
.cause { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; line-height: 1.2; }
.confidence { color: #53615b; font-size: .86rem; }
.recovery-steps { counter-reset: recovery; }
.recovery-steps li { position: relative; margin-bottom: 12px; padding-left: 32px; color: #37443e; font-size: .9rem; line-height: 1.45; }
.recovery-steps li::before { counter-increment: recovery; content: counter(recovery); position: absolute; left: 0; top: 1px; color: #e06c33; font-weight: 800; }
.recovery-steps strong { color: #17211e; }
.crew-update { margin: 20px 0 8px; padding: 14px; border-radius: 5px; background: #17211e; color: #f7f5ee; font-size: .9rem; line-height: 1.5; }

.approval-form { margin-top: 22px; padding-top: 20px; border-top: 1px solid #deddd5; }
.approval-form label { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.approval-controls input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid #a6aaa5; border-radius: 5px; padding: 10px 12px; background: #fff; }
.form-note { margin: 8px 0 0; color: #68736d; font-size: .75rem; }
.empty-state { color: #6a726e; font-size: .88rem; font-style: italic; }
.approved-note { padding: 13px; border-left: 3px solid #2e8b62; background: #effaf4; color: #15533e; font-size: .88rem; line-height: 1.4; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1180px); padding-top: 14px; }
  .topbar { align-items: flex-start; gap: 14px; }
  .topbar-meta { align-items: flex-end; flex-direction: column; }
  .hero { padding-top: 56px; }
  .incident-summary, .workspace { grid-template-columns: 1fr; }
  .summary-primary, .summary-stat { min-height: auto; }
  .approval-controls { align-items: stretch; flex-direction: column; }
}

