:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1a1d21;
  --ink-2: #5c6470;
  --ink-3: #9aa1ab;
  --line: #e3e6ea;
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --green: #17803d;
  --green-soft: #e8f6ec;
  --red: #c0392b;
  --red-soft: #fdeeec;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 13.5px/1.5 var(--sans); background: var(--bg); color: var(--ink); }
code, pre, .mono { font-family: var(--mono); font-size: 12px; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.hint { color: var(--ink-3); font-size: 12px; }
.spacer { flex: 1; }
.error-note { color: var(--red); font-size: 12.5px; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 20px; height: 52px; position: sticky; top: 0; z-index: 20;
}
.logo { font-weight: 700; font-size: 15px; letter-spacing: -0.2px; }
.logo span { color: var(--accent); }
.env-badge {
  font-size: 11px; font-weight: 600; color: var(--green);
  background: var(--green-soft); border-radius: 20px; padding: 2px 10px;
}

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 7px 16px; border: 1px solid var(--line); background: #fff;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #4338ca; }
.btn:disabled { cursor: progress; opacity: 0.6; }
.input {
  font: inherit; border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 10px; background: #fff; color: var(--ink);
}

.content { max-width: 1400px; margin: 0 auto; padding: 16px 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.card-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 13px; font-weight: 650; }
.card-body { padding: 14px 16px; }
.card-body p { margin-bottom: 8px; }

.welcome { padding: 22px 26px; margin-bottom: 16px; }
.welcome h2 { font-size: 16px; margin-bottom: 6px; }
.welcome p { color: var(--ink-2); max-width: 640px; margin-bottom: 12px; }
.welcome ol { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.welcome li { counter-increment: step; font-size: 12.5px; color: var(--ink-2); }
.welcome li b { color: var(--ink); }
.welcome li::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; margin-right: 7px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 11px;
}
@media (max-width: 900px) { .welcome ol { grid-template-columns: 1fr; } }

.dash-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.list-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid #f0f1f3;
}
a.list-item:hover { background: #fafbfc; }
.new-config { display: flex; gap: 8px; align-items: center; padding: 12px 16px; flex-wrap: wrap; }
.new-config .steplabel { font-size: 12px; color: var(--ink-2); }
.new-config .recipe-desc { flex-basis: 100%; }
.status-running { color: var(--accent); }
.status-done { color: var(--green); }
.status-failed, .status-canceled { color: var(--red); }

/* Rows are divs with a stretched primary link, so the action buttons can be
   real buttons instead of nested anchors. */
.row-link::after { content: ""; position: absolute; inset: 0; }
.row-actions { position: relative; display: flex; gap: 4px; opacity: 0; }
.cfg-row:hover .row-actions, .run-row:hover .row-actions { opacity: 1; }
.icon-btn {
  font: inherit; font-size: 12px; line-height: 1; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 6px; padding: 3px 7px;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Config rows: name + age on the first line, plan summary on the second. */
.cfg-row {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 1px 10px;
  align-items: center;
  padding: 9px 16px; border-bottom: 1px solid #f0f1f3;
}
.cfg-row:hover { background: #fafbfc; }
.cfg-row .cfg-name { font-size: 13px; font-weight: 600; }
.cfg-row .cfg-summary { grid-column: 1 / -1; }
.lastrun-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; vertical-align: 1px;
}
.dot-done { background: var(--green); }
.dot-failed, .dot-canceled { background: var(--red); }
.dot-running { background: var(--accent); }

/* Run rows: pill · config · progress strip · tally · when · rerun. */
.run-row {
  position: relative;
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 68px minmax(60px, 1fr) 64px auto auto auto;
  padding: 9px 16px; border-bottom: 1px solid #f0f1f3; font-size: 12.5px;
}
.run-row:hover { background: #fafbfc; }
.run-row .run-cfg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.run-row .run-when { white-space: nowrap; }
.run-tally { font-size: 12px; white-space: nowrap; }
.ok-dot { color: var(--green); font-size: 9px; vertical-align: 1px; margin-left: 1px; }
.fail-dot { color: var(--red); font-size: 9px; vertical-align: 1px; margin-left: 1px; }
.run-strip {
  display: flex; height: 5px; border-radius: 3px; background: #e8eaee; overflow: hidden;
}
.strip-ok { background: var(--green); }
.strip-fail { background: var(--red); }

.pill {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  border-radius: 5px; padding: 2px 0; text-align: center;
}
.pill-running { background: var(--accent-soft); color: var(--accent); }
.pill-done { background: var(--green-soft); color: var(--green); }
.pill-failed { background: var(--red-soft); color: var(--red); }
.pill-canceled { background: #f0f1f3; color: var(--ink-2); }

.login-box {
  max-width: 380px; margin: 80px auto; padding: 28px; text-align: center;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}

.config-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.config-head h1 { font-size: 16px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .editor-grid { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.yaml-editor {
  width: 100%; min-height: 70vh; border: none; outline: none; resize: vertical;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  padding: 14px 16px; border-radius: 12px; background: transparent;
}
.chips .chip {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 5px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); margin: 0 3px 3px 0;
}
.json {
  background: #0e1116; color: #d6dde6; padding: 14px 16px; overflow-x: auto;
  line-height: 1.55; max-height: 50vh; overflow-y: auto;
}
.verdict {
  font-size: 12px; padding: 8px 16px; border-top: 1px solid var(--line);
  color: var(--green); background: var(--green-soft);
  border-radius: 0 0 12px 12px; white-space: pre-line;
}
/* Nothing removed is not a result — it reads as a footnote. */
.verdict-none { color: var(--ink-3); background: transparent; }

.snippets { padding: 4px 0; }
.snippet summary {
  cursor: pointer; padding: 7px 16px; font-size: 12.5px; font-weight: 550;
  list-style-position: inside;
}
.snippet summary:hover { background: #fafbfc; }
.snippet-yaml {
  background: #f8f9fa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 10px 16px; overflow-x: auto; line-height: 1.5; white-space: pre;
}
.snippet-actions { display: flex; gap: 8px; padding: 8px 16px; }
.snippet-actions .btn { padding: 3px 12px; font-size: 12px; }

.req-picker { padding: 8px 16px 4px; border-bottom: 1px solid var(--line); }
.pick-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pick {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 6px; padding: 3px 10px;
}
.pick.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.tally { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); padding: 12px 16px; flex-wrap: wrap; }
.tally b { color: var(--ink); }
.table-wrap { overflow-x: auto; }
table.report { width: 100%; border-collapse: collapse; }
.report th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-3); font-weight: 650; padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.report td { padding: 6px 12px; border-bottom: 1px solid #f0f1f3; font-size: 12.5px; white-space: nowrap; }
.report td.r, .report th.r { text-align: right; }
.report .carrier { font-family: var(--mono); font-weight: 650; }
/* A floor keeps step transitions from resizing the column on every event */
.report td.status { min-width: 220px; }
.report tr.dim td { color: var(--ink-3); }
.report tr.row-running td { background: #f6f7ff; }
.footnotes { padding: 10px 16px; font-size: 12px; }
.fn-line { display: flex; gap: 8px; margin-bottom: 6px; }
.fn-mark { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.fn-line code { color: var(--red); word-break: break-all; }

/* The analyst guide, rendered from guide.md. */
.navlink { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.navlink:hover { color: var(--accent); }

.prose { max-width: 780px; margin: 0 auto; padding: 24px 32px 32px; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 22px; letter-spacing: -0.3px; margin: 28px 0 12px; }
.prose h2 {
  font-size: 15px; margin: 30px 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.prose h3 { font-size: 13.5px; margin: 20px 0 8px; }
.prose p, .prose li { color: var(--ink-2); margin-bottom: 10px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose code {
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; color: var(--ink);
}
.prose pre {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 14px; overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.prose th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-3); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.prose td {
  padding: 8px 10px; border-bottom: 1px solid #f0f1f3;
  font-size: 12.5px; color: var(--ink-2); vertical-align: top;
}
.prose td:first-child { white-space: nowrap; color: var(--ink); }
.prose blockquote {
  border-left: 3px solid var(--line); padding-left: 12px; color: var(--ink-3);
  margin-bottom: 12px;
}
