:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --ink: #0c0c0d;
  --ink-2: #3b3b40;
  --muted: #76767d;
  --line: #e7e7e4;
  --line-2: #d9d9d5;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --ok: #16794a;
  --warn: #a65d00;
  --bad: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(12, 12, 13, 0.04), 0 1px 1px rgba(12, 12, 13, 0.02);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #131315;
    --ink: #f3f3f1;
    --ink-2: #c9c9c6;
    --muted: #8b8b92;
    --line: #232326;
    --line-2: #2e2e32;
    --accent: #8b85ff;
    --accent-ink: #0b0b0c;
    --ok: #4cc38a;
    --warn: #f0a84b;
    --bad: #ff8a7a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

/* Nav */
nav.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
nav.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -0.02em; text-decoration: none; }
.brand .mark { width: 20px; height: 20px; border-radius: 6px; background: var(--ink); position: relative; }
.brand .mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--bg); }
nav.top .links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
nav.top .links a { text-decoration: none; color: var(--ink-2); }
nav.top .links a:hover { color: var(--ink); }

/* Type */
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(34px, 6vw, 58px); font-weight: 680; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 650; }
h3 { font-size: 16px; font-weight: 620; letter-spacing: -0.01em; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 18px; color: var(--ink-2); max-width: 560px; }

/* Controls */
button, .btn {
  font: inherit; font-size: 14px; font-weight: 550;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 9px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s;
}
button:hover, .btn:hover { border-color: var(--ink-2); }
button.primary, .btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.primary:hover, .btn.primary:hover { opacity: 0.88; }
button.ghost { background: transparent; border-color: transparent; color: var(--ink-2); padding: 0 8px; }
button.ghost:hover { color: var(--ink); }
button:disabled { opacity: 0.5; cursor: default; }
input[type=email], input[type=tel], input[type=text], input[type=password], textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 9px; height: 36px; padding: 0 12px; min-width: 0;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; width: 100%; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1 1 200px; }
label.check { display: flex; gap: 10px; align-items: center; margin: 8px 0; font-size: 14px; color: var(--ink-2); }
label.check input { accent-color: var(--ink); width: 15px; height: 15px; }

/* Surfaces */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card h3 { margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.stat { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550;
  height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.running { color: var(--accent); }
.pill.idle, .pill.ok { color: var(--ok); }
.pill.failed, .pill.paused_budget, .pill.bad { color: var(--bad); }
.pill.closed { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; font-weight: 550; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.wrap-cell { white-space: normal; min-width: 220px; color: var(--ink-2); }

.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 12px 16px; font-size: 14px; color: var(--ink-2); box-shadow: var(--shadow);
}

/* Checklist */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps .dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2);
  display: grid; place-items: center; font-size: 12px; color: var(--muted); font-weight: 600;
}
.steps li.done .dot { background: var(--ink); border-color: var(--ink); color: var(--bg); font-size: 0; }
.steps li.done .dot::after { content: "✓"; font-size: 12px; }
.steps li.done .label { color: var(--muted); }
.steps .label { flex: 1; min-width: 0; }
.steps .label small { display: block; color: var(--muted); font-size: 13px; }
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 12px 0 4px; }
.progress > div { height: 100%; background: var(--ink); width: 0; transition: width 0.3s; }

/* Landing */
.hero { padding-block: clamp(48px, 10vw, 120px) 56px; }
.hero h1 { max-width: 760px; }
.hero .lede { margin: 18px 0 28px; }
.signin { display: flex; gap: 8px; max-width: 460px; flex-wrap: wrap; }
.signin input { flex: 1 1 220px; height: 42px; }
.signin button { height: 42px; padding: 0 18px; }
.section { padding-block: 56px; border-top: 1px solid var(--line); }
.how { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 28px; }
.how .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.how p, .features p { color: var(--ink-2); margin: 6px 0 0; font-size: 14px; }
.features { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 28px; }
.features > div { background: var(--surface); padding: 22px; }
.transcript { font-size: 14px; border-left: 2px solid var(--line-2); padding-left: 16px; margin-top: 28px; color: var(--ink-2); }
.transcript p { margin: 8px 0; }
.transcript b { color: var(--ink); font-weight: 600; }

/* Prose (guide, legal) */
.prose { padding-block: 48px 80px; }
.prose h1 { font-size: clamp(30px, 5vw, 42px); }
.prose h2 { font-size: 20px; margin: 40px 0 10px; }
.prose h3 { margin: 22px 0 6px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose li { margin: 5px 0; }
.say { margin: 8px 0; display: grid; gap: 6px; }
.say div { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 14px; color: var(--ink); }
.say div::before { content: "“"; color: var(--muted); }
.say div::after { content: "”"; color: var(--muted); }
.callout { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; color: var(--ink-2); }
.toc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; margin: 18px 0 0; }

footer.site { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 40px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: 13px; color: var(--muted); }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--ink); }

#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18); z-index: 10;
}
[hidden] { display: none !important; }
