:root {
  --bg: #10141a;
  --bg-raise: #171c24;
  --ink: #f4f1ea;
  --muted: #b7b1a6;
  --line: #2c333d;
  --accent: #e8a54b;
  --high: #e15b64;
  --med: #e8a54b;
  --low: #7dcea0;
  --alice: #7eb6ff;
  --bob: #e8a54b;
  --sans: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
body { min-height: 100%; }
button, input { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); }

.top, main, footer { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 22px 0 8px;
}
.brand { font-weight: 600; letter-spacing: -0.03em; font-size: 18px; }
.top-meta { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }

.hero { padding: 28px 0 8px; }
.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}
h1 {
  margin: 0 0 14px;
  max-width: 16ch;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.lead { margin: 0; max-width: 62ch; color: var(--muted); font-size: 18px; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: #1a140c; border-color: var(--accent); font-weight: 600; }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.btn.primary[aria-pressed="true"] { color: #1a140c; }

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}
.editor {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.editor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.who { font-weight: 600; flex: none; }
.branch {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.filetab {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.code-scroll {
  position: relative;
  height: min(420px, 52vh);
  overflow: auto;
  padding: 8px 0 12px;
}
.line {
  display: grid;
  grid-template-columns: 42px 1fr;
  min-height: 20px;
  cursor: pointer;
}
.line:hover { background: rgba(255, 255, 255, 0.03); }
.gutter {
  color: #6d675f;
  text-align: right;
  padding-right: 10px;
  font-family: var(--mono);
  font-size: 12px;
  user-select: none;
}
.code {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 20px;
  white-space: pre;
  padding-right: 16px;
}
.line.alice { background: rgba(126, 182, 255, 0.16); }
.line.bob { background: rgba(232, 165, 75, 0.16); }
.line.cursor .gutter { color: var(--ink); }
.editor-status {
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.tok-comment { color: #8d877e; }
.tok-keyword { color: var(--accent); }
.tok-string { color: var(--low); }
.tok-number { color: #9ec1e6; }

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.step {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
}
.step span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 11px;
}
.step.on { color: var(--ink); border-color: #4a5563; }
.step.on span { border-color: var(--accent); color: var(--accent); }
.step.bad { border-color: var(--high); }
.pipeline-note { margin: 8px 0 0; color: var(--muted); font-size: 14px; min-height: 1.3em; }

.warning {
  margin-top: 18px;
  background: #f6f8fa;
  color: #1f2328;
  border-radius: 12px;
  padding: 16px;
}
.warning h2 { margin: 0; font-size: 16px; }
.warning .ai-notice { margin-top: 4px; color: #57606a; font-size: 12px; font-style: italic; }
.warn-head { border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.risk-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}
.panel-block {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.panel-block h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #57606a;
}
.dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dev-card { background: #f6f8fa; border: 1px solid #e5e7eb; border-radius: 6px; padding: 10px; }
.dev-card strong { display: block; margin-bottom: 4px; }
.dev-card p { margin: 2px 0; color: #57606a; font-size: 13px; }
.chip {
  display: inline-block;
  background: #e5e7eb;
  color: #57606a;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  margin-bottom: 8px;
}
.affected {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.rec {
  background: #f0f7ff;
  border: 1px solid #c8dffe;
  color: #0969da;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.semantic {
  margin-top: 8px;
  color: #24292f;
  font-size: 13px;
}
.warn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.warn-actions .btn { border-radius: 6px; }
.warn-actions .go { background: #0969da; color: white; border-color: #0969da; }
.warn-actions .quiet { background: white; color: #24292f; }

.log-wrap { margin-top: 22px; }
.log-wrap h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.log {
  list-style: none;
  margin: 0;
  padding: 12px;
  min-height: 88px;
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c1016;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}
.log li { color: #d9d3c8; }
.log li span { color: var(--accent); margin-right: 8px; }

footer { padding: 28px 0 40px; color: var(--muted); font-size: 13px; line-height: 1.5; }
footer p { margin: 0; max-width: 78ch; }

dialog {
  width: min(860px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-raise);
  color: var(--ink);
  padding: 16px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-note { color: var(--muted); font-size: 14px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.diff-card { border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 360px; }
.diff-card header { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.diff-card pre { margin: 0; padding: 10px; font-size: 12px; line-height: 1.45; }
.terminal {
  margin: 0;
  padding: 12px;
  background: #0c1016;
  border-radius: 8px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 800px) {
  .workspace, .pipeline, .dev-grid, .diff-grid { grid-template-columns: 1fr; }
  .code-scroll { height: 280px; }
  .top { flex-direction: column; align-items: flex-start; }
}
