:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9dee7;
  --green: #168a51;
  --red: #b42318;
  --amber: #b76e00;
  --blue: #175cd3;
  --violet: #6941c6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.shell { max-width: 1180px; margin: 0 auto; padding: 24px; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 18px;
}
.eyebrow { margin: 0 0 6px; color: var(--green); font-weight: 700; font-size: 13px; text-transform: uppercase; }
h1 { margin: 0; font-size: 34px; line-height: 1.1; letter-spacing: 0; }
h2 { margin: 0; font-size: 18px; }
.sub { margin: 10px 0 0; color: var(--muted); max-width: 760px; }
.status {
  flex: 0 0 auto;
  border: 1px solid #b7e2c6;
  background: #eaf8ef;
  color: #05603a;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
}
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.metric { padding: 16px; }
.metric strong { display: block; font-size: 26px; line-height: 1.1; }
.metric span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.panel { padding: 16px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.panel-head span { color: var(--muted); font-size: 13px; }
.list { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 7px; padding: 12px; }
.item-title { font-weight: 750; }
.item p { margin: 8px 0 0; color: var(--muted); line-height: 1.45; font-size: 13px; }
.meta { margin-top: 7px; color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.meta.wide { display: block; line-height: 1.5; }
.pill { border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 700; background: #eef4ff; color: var(--blue); }
.pill.warn { background: #fff4e5; color: var(--amber); }
.pill.stop { background: #fee4e2; color: var(--red); }
label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0 6px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  font: inherit;
}
textarea { min-height: 92px; resize: vertical; }
.workflow-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
.workflow-form label { margin-top: 0; }
button {
  margin-top: 12px;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  padding: 10px 13px;
  font-weight: 750;
  cursor: pointer;
}
pre {
  white-space: pre-wrap;
  background: #101828;
  color: #f2f4f7;
  border-radius: 7px;
  padding: 12px;
  min-height: 80px;
  overflow: auto;
}
.compact .item { padding: 10px; }
.rules { display: flex; flex-wrap: wrap; gap: 8px; }
.rules.inline { margin-top: 9px; }
.rule { border: 1px solid #b7e2c6; background: #f0faf3; color: #05603a; border-radius: 999px; padding: 7px 10px; font-weight: 700; font-size: 13px; }
.phase-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.phase-button {
  display: grid;
  gap: 6px;
  min-height: 116px;
  margin: 0;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 12px;
}
.phase-button strong { font-size: 14px; color: var(--green); }
.phase-button span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.phase-button.active {
  border-color: #84caa2;
  box-shadow: 0 0 0 3px #e3f6ea;
}
.phase-page { margin-top: 14px; border-color: #cfe8d8; }
.lead { margin: 0 0 14px; color: var(--ink); line-height: 1.55; max-width: 900px; }
.phase-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; }
.phase-footer {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--violet);
  font-weight: 750;
  line-height: 1.45;
}
.bottom-note { margin-top: 14px; line-height: 1.55; color: var(--muted); }
.bottom-note strong { color: var(--ink); }
@media (max-width: 820px) {
  .topbar, .layout { display: block; }
  .status { display: inline-block; margin-top: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phase-nav, .phase-grid, .workflow-form { grid-template-columns: 1fr; }
  .panel { margin-top: 14px; }
}
