
:root { color-scheme: light dark; --bg: #fbfaf8; --fg: #1d1d1f; --muted: #5f5f66; --line: #e3e1dc; --card: #ffffff; --accent: #2f5bd3; --accent-fg: #ffffff; --done: #1f7a4d; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #151517; --fg: #ececef; --muted: #a2a2ab; --line: #2c2c31; --card: #1d1d21; --accent: #7d9cf0; --accent-fg: #0f1220; --done: #5cc793; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; max-width: 720px; margin: 0 auto; padding: 16px; }
.brand { font-weight: 700; letter-spacing: 0.02em; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
/* Pages with wide tables (the prospect list): the full width of larger screens. */
body.wide main, body.wide .top { max-width: 1240px; }
h1 { font-size: 1.6rem; margin: 8px 0; }
h2 { font-size: 1.05rem; margin: 0; flex: 1; }
a { color: var(--accent); }
.steps { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.step.locked, .step.coming_soon, .step.waiting_operator { opacity: 0.7; }
.step-head { display: flex; align-items: center; gap: 12px; }
.num { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.9rem; flex: none; }
.step.done .num { background: var(--done); border-color: var(--done); color: var(--card); }
.step.current { border-color: var(--accent); }
.status { font-size: 0.8rem; color: var(--muted); }
.why { color: var(--muted); margin: 12px 0 8px; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.item input { margin-top: 5px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.help { color: var(--muted); font-size: 0.92rem; }
.tip { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0 14px; }
.tip p { margin: 0 0 10px; }
.tip img { display: block; max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.how { color: var(--muted); padding-left: 20px; margin: 8px 0; }
.how li { margin: 4px 0; }
form + form { margin-top: 8px; }
.note { color: var(--muted); font-size: 0.9rem; }
button.primary { background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; margin-top: 8px; }
a.button-link { display: inline-block; border: 1px solid var(--accent); border-radius: 8px; padding: 8px 14px; text-decoration: none; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); opacity: 0; z-index: 10; pointer-events: none; }
.progress.active { opacity: 1; animation: progress 8s cubic-bezier(0.1, 0.7, 0.3, 1) forwards; }
@keyframes progress { from { width: 0; } to { width: 90%; } }
button:disabled { cursor: progress; opacity: 0.85; }
button.busy::before { content: ""; display: inline-block; width: 0.85em; height: 0.85em; margin-right: 0.5em; vertical-align: -0.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .progress.active { animation: none; width: 90%; }
  button.busy::before { animation: none; border-right-color: currentColor; opacity: 0.6; }
}
button.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; }
nav.admin { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 0.92rem; }
.badge { font-size: 0.75rem; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--muted); }
.badge.warn { border-color: var(--accent); color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.card h2 { margin-bottom: 8px; }
.row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.muted { color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li.card { padding: 16px; border: 1px solid var(--line); }
label.field { display: block; margin: 12px 0; }
label.field input { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; }
.error { color: var(--accent); font-weight: 600; }
label.field textarea { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; }
.scroll { overflow-x: auto; margin: 12px 0; }
table.ptable { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 0.92rem; }
table.ptable th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.8rem; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.ptable td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.ptable .badge, table.ptable td.cats, table.ptable th.cats { white-space: nowrap; }
.grade { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; border-radius: 6px; font-weight: 700; font-size: 0.85rem; border: 1px solid var(--line); }
.grade-A, .grade-B { color: var(--done); border-color: var(--done); }
.grade-C { color: var(--muted); }
.grade-D, .grade-F { color: var(--accent); border-color: var(--accent); }
.badge.fit-strong { color: var(--done); border-color: var(--done); }
.badge.fit-poor, .badge.fit-unscannable { color: var(--accent); border-color: var(--accent); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts div { display: contents; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
ul.checks { list-style: none; padding: 0; margin: 4px 0 12px; }
ul.checks li.ok { color: var(--muted); }
ul.checks li.bad { color: var(--fg); }
.issues { border: 1px solid var(--accent); border-radius: 8px; padding: 10px 14px; margin: 8px 0 12px; }
.issues strong { color: var(--accent); }
.issues ul { margin: 6px 0 0; padding-left: 20px; }
pre.cmd { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 0.85rem; white-space: pre-wrap; word-break: break-all; }
.cmp { margin: 12px 0; }
.cmp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.cmp-bar input { position: absolute; opacity: 0; pointer-events: none; }
.cmp-bar label { padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.cmp-bar input:checked + label { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cmp-bar input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmp-scroll { height: 75vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; overscroll-behavior: contain; }
.cmp-full .cmp-scroll { height: calc(100vh - 160px); }
.cmp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px; align-items: start; }
.cmp-grid.cmp-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cmp-grid.cmp-n1 { grid-template-columns: minmax(0, 1fr); }
.cmp-grid.cmp-mobile { grid-template-columns: repeat(auto-fit, minmax(0, 320px)); justify-content: center; }
.cmp:has(.cmp-bar .cmp-d:checked) .cmp-mobile, .cmp:has(.cmp-bar .cmp-m:checked) .cmp-desktop { display: none; }
.cmp figure { margin: 0; }
.cmp figcaption { position: sticky; top: 0; z-index: 1; background: var(--card); padding: 4px 2px; font-size: 0.85rem; color: var(--muted); }
.cmp img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
@media (max-width: 600px) { table.ptable .cats { display: none; } dl.facts { grid-template-columns: 1fr; } }
.button-primary { display: inline-block; background: var(--accent); color: var(--accent-fg); border-radius: 8px; padding: 10px 16px; font-weight: 600; text-decoration: none; }
.section-title { font-size: 1.25rem; margin: 24px 0 4px; }
.review-row { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; align-items: flex-start; }
.review-row > div { flex: 1 1 260px; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 0.92rem; }
.choices label:has(input:checked) { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.choices input { accent-color: var(--accent); margin: 0; }
.sugg { font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.actions-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); }
.actions-bar button.primary { margin-top: 0; }
select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); max-width: 100%; }
.versions { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.version-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--bg); }
.version-card.chosen { border-color: var(--accent); }
.version-card.undecided { grid-column: 1 / -1; padding: 10px 16px; }
.version-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.version-points { margin: 0 0 10px; padding-left: 18px; color: var(--muted); font-size: 0.92rem; }
.pick { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-weight: 600; cursor: pointer; }
.pick input { accent-color: var(--accent); width: 18px; height: 18px; }
.change-row h3 { margin: 0 0 6px; font-size: 1.02rem; }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 6px; }
.before-after dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.before-after dd { margin: 0; font-size: 0.95rem; }
@media (max-width: 600px) { .before-after { grid-template-columns: 1fr; } }
.note-field { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.note-field textarea { display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; }
.blockers { margin: 4px 0 12px; padding-left: 20px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88rem; word-break: break-all; }
pre.log { white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow: auto; font-size: 0.8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0; }
