:root {
  --bg: #f4f5f8; --surface: #ffffff; --surface-2: #eceef3; --text: #171a21; --muted: #555c69; --line: #dcdfe6;
  --accent: #2a4fd7; --accent-text: #ffffff; --focus: #2a4fd7; --accent-soft: #e8edff;
  --ok: #16653a; --ok-bg: #e2f4e9; --warn: #7a4b00; --warn-bg: #fdf0d6; --bad: #a3141f; --bad-bg: #fbe4e6;
  --info: #2a4fd7; --info-bg: #e8edff; --code-bg: #eff1f5;
  --radius: 12px; --shadow: 0 1px 2px rgba(23, 26, 33, 0.06), 0 4px 16px rgba(23, 26, 33, 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116; --surface: #181b22; --surface-2: #20242d; --text: #eceef2; --muted: #a8aebb; --line: #2f3440;
    --accent: #8fb1ff; --accent-text: #0d1220; --focus: #8fb1ff; --accent-soft: #1d2846;
    --ok: #7fd9a3; --ok-bg: #173325; --warn: #f5c56b; --warn-bg: #3a2c10; --bad: #ff9aa2; --bad-bg: #3d1a1e;
    --info: #8fb1ff; --info-bg: #1d2846; --code-bg: #232731;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -10000px; top: 0; padding: 8px 12px; background: var(--surface); }
.skip:focus { left: 8px; top: 8px; z-index: 10; }

.top { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem; }
.brand span { font-weight: 400; color: var(--muted); }
.top ul { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 0; padding: 0; }
.top nav a { text-decoration: none; padding: 4px 2px; }
.top nav a { color: var(--text); border-radius: 8px; padding: 6px 10px; }
.top nav a:hover { background: var(--surface-2); }
.top nav a[aria-current="page"] { font-weight: 700; background: var(--accent-soft); color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

main { max-width: 1120px; margin: 0 auto; padding: 16px 24px 48px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 8px 0 16px; }
h2 { font-size: 1.3rem; margin: 32px 0 12px; }
h3 { font-size: 1.05rem; margin: 20px 0 8px; }
p { max-width: 75ch; }
.muted, .hint { color: var(--muted); }
.hint { display: block; font-size: 0.9rem; }
.foot { max-width: 1120px; margin: 0 auto; padding: 16px 24px 32px; color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--muted); }

.flash { background: var(--ok-bg); color: var(--ok); border: 1px solid currentColor; border-radius: 6px; padding: 10px 14px; margin: 12px 0; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; }
.callout.bad { border-left-color: var(--bad); }
.callout.info { border-left-color: var(--info); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 16px 0; box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.stats { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 12px 0; }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; min-width: 140px; box-shadow: var(--shadow); }
.stats .num { display: block; font-size: 1.5rem; font-weight: 700; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
caption { text-align: left; font-weight: 600; padding: 8px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.9rem; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; max-width: 100%; padding: 1px 8px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; border: 1px solid currentColor; overflow-wrap: anywhere; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: transparent; }

form { margin: 0; }
.field { margin: 12px 0; }
.field label, .check label { font-weight: 600; }
.field input, .field select, .field textarea { display: block; width: 100%; max-width: 560px; margin-top: 4px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 10px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: start; margin: 12px 0; }
.check input { margin-top: 5px; width: 18px; height: 18px; }
.check .hint { grid-column: 2; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.btn { display: inline-flex; align-items: center; font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--accent); cursor: pointer; text-decoration: none; min-height: 42px; }
.btn-big { font-size: 1.05rem; padding: 12px 22px; min-height: 50px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--surface); color: var(--accent); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.inline { display: inline; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 8px 0 16px; padding: 0; }
.tabs a { display: inline-block; padding: 4px 0; }
.tabs a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 3px; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
code { background: var(--code-bg); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.log { max-height: 60vh; overflow-y: auto; }

.fix { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; margin: 16px 0; }
.fix h3 { margin-top: 0; overflow-wrap: anywhere; }
.fix .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 8px; }
.evidence { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.evidence figure { margin: 0; max-width: 100%; }
.evidence img { display: block; max-width: min(100%, 420px); max-height: 240px; border: 1px solid var(--line); border-radius: 4px; background: #fff; object-fit: contain; }
.evidence figcaption { font-size: 0.85rem; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.swatch { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; font-weight: 600; }
.swatch small { display: block; font-weight: 400; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.filters .field { margin: 0; }
.pager { display: flex; gap: 12px; margin: 16px 0; }
.preview { max-width: 280px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }

@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  main { padding: 12px 16px 40px; }
  .fix { padding: 12px 14px; }
}
.signout { margin-left: auto; }
.linklike { background: none; border: 0; padding: 4px 2px; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.codes { columns: 2; max-width: 420px; font-size: 1.1rem; }
.codes li { margin: 4px 0; }

/* Home: the pipeline */
.count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 0.85rem; font-weight: 600; text-align: center; }
.needs { background: var(--warn-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 12px; margin: 16px 0; }
.needs h2 { margin-top: 12px; }
.board { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }
.column { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px 12px; }
.column h3 { margin: 4px 0 10px; font-size: 1rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.needs .cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.pcard h4 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.pcard p { margin: 4px 0; }
.pcard .next { font-size: 0.92rem; }
.pcard .actions { margin: 8px 0 0; }
.pcard .btn { min-height: 36px; padding: 6px 12px; font-size: 0.92rem; }
.welcome ol { padding-left: 1.3em; }
.welcome li { margin: 6px 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 3px 0 3px 28px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border: 2px solid var(--muted); border-radius: 4px; }
.checklist li.ok { color: var(--muted); text-decoration: line-through; }
.checklist li.ok::before { content: "✓"; border-color: var(--ok); color: var(--ok); font-size: 12px; line-height: 13px; text-align: center; text-decoration: none; }
.new-project summary, details > summary { cursor: pointer; font-weight: 600; }

/* Steps: where a project stands */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 16px 0; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 0.8rem; }
.steps li.done { color: var(--ok); border-color: var(--ok); }
.steps li.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.steps li.current { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.steps li.current::before { background: var(--accent-text); color: var(--accent); }
.next-step { border-left: 4px solid var(--accent); }
.next-step p { font-size: 1.05rem; }
input.copy { width: 100%; max-width: 720px; padding: 9px 12px; font: 0.95rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; }
.grid-fields { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin: 10px 0; }
pre.email { background: var(--surface); border: 1px solid var(--line); }

/* The client's page */
.client main { max-width: 860px; }
.lede { font-size: 1.1rem; color: var(--muted); }
.problems { padding-left: 1.2em; }
.problems li { margin: 10px 0; }
table.quote tfoot th, table.quote tfoot td { font-size: 1.1rem; border-bottom: 0; }
.terms { margin: 12px 0; }
.terms-text { max-height: 260px; overflow: auto; margin-top: 8px; padding: 12px 14px; background: var(--code-bg); border-radius: 10px; font-size: 0.92rem; }
@media (max-width: 640px) {
  .steps li { font-size: 0.85rem; }
  .board { grid-template-columns: 1fr; }
}
