:root {
  --brand: #d0021b; --brand-ink: #a30015; --brand-soft: #fff1f2; --brand-line: #ffd5d9;
  --ink: #0f172a; --ink-2: #334155; --mute: #64748b; --faint: #94a3b8;
  --line: #e2e8f0; --line-2: #eef2f6; --bg: #f5f7fa; --card: #ffffff; --inset: #f8fafc;
  --pass: #15803d; --pass-soft: #ecfdf3; --pass-line: #bbf7d0;
  --fail: #dc2626; --fail-soft: #fef2f2; --fail-line: #fecaca;
  --block: #b45309; --block-soft: #fffbeb; --block-line: #fde68a;
  --focus: #2563eb;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #ff4d5e; --brand-ink: #ff7a87; --brand-soft: #2a1216; --brand-line: #4a1d24;
    --ink: #f1f5f9; --ink-2: #cbd5e1; --mute: #94a3b8; --faint: #64748b;
    --line: #273142; --line-2: #1e2633; --bg: #0b1017; --card: #121923; --inset: #0f151e;
    --pass: #4ade80; --pass-soft: #0f2418; --pass-line: #1f4d32;
    --fail: #f87171; --fail-soft: #2a1414; --fail-line: #5a2323;
    --block: #fbbf24; --block-soft: #261d0b; --block-line: #5a4512;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
b, strong { font-weight: 600; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--line-2); padding: 1px 5px; border-radius: 5px; }
.num { font-variant-numeric: tabular-nums; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; flex: none; }
.mark svg { width: 18px; height: 18px; }
.brand .sep { width: 1px; height: 18px; background: var(--line); }
.brand .prod { color: var(--mute); font-weight: 500; }
.user { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.user .nm { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.linkbtn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.linkbtn:hover { background: var(--inset); }
@media (max-width: 560px) { .user .nm, .brand .sep, .brand .prod { display: none; } }

main { max-width: 1200px; margin: 0 auto; padding: 32px 20px 96px; }
@media (max-width: 560px) { main { padding: 22px 16px 80px; } }

/* Type */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 0 0 8px; }
h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 18px; letter-spacing: -.01em; margin: 0 0 14px; font-weight: 650; }
.sub { color: var(--mute); margin: 0; font-size: 16px; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head span { color: var(--mute); font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* Hero stats */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(96px, 1fr)); gap: 10px; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .k { font-size: 13px; color: var(--mute); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.dot.pass { background: var(--pass); } .dot.fail { background: var(--fail); } .dot.blocked { background: var(--block); } .dot.untested { background: var(--faint); }
.stat .v small { font-size: 15px; color: var(--mute); font-weight: 500; }

/* Progress bar */
.bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--line-2); gap: 2px; }
.bar i { display: block; height: 100%; }
.bar .p { background: var(--pass); } .bar .f { background: var(--fail); } .bar .b { background: var(--block); } .bar .u { background: var(--faint); opacity: .5; }

/* Flow cards */
.ready { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.flowcard { display: flex; flex-direction: column; gap: 14px; padding: 20px; text-decoration: none; transition: border-color .15s, transform .15s; }
.flowcard:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.flowcard .row { display: flex; align-items: flex-start; gap: 14px; }
.fbadge { flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.flowcard h3 { margin: 0; font-size: 16.5px; line-height: 1.35; letter-spacing: -.01em; font-weight: 650; }
.flowcard .meta-line { color: var(--mute); font-size: 13.5px; margin-top: 3px; }
.flowcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.go { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

.planned { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 0; padding: 0; }
.planned li { list-style: none; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--mute); font-size: 14px; background: color-mix(in srgb, var(--card) 50%, transparent); }
.planned ul { margin: 0; padding: 0; display: contents; }
.planned .n { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--line-2); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; color: var(--mute); }

/* Guide cards */
.guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 820px) { .guide { grid-template-columns: 1fr; } }
.guide .card { padding: 20px; }
.guide h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 15.5px; font-weight: 650; }
.guide p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ico svg { width: 17px; height: 17px; }
.ico.red { background: var(--brand-soft); color: var(--brand); }
.ico.blue { background: color-mix(in srgb, var(--focus) 12%, transparent); color: var(--focus); }
.roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.roles li { font-size: 14.5px; color: var(--ink-2); padding-left: 14px; position: relative; }
.roles li::before { content: ""; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }

.export { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; flex-wrap: wrap; }
.export p { margin: 2px 0 0; color: var(--mute); font-size: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--inset); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Flow page */
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); text-decoration: none; font-size: 14px; margin-bottom: 18px; }
.crumb:hover { color: var(--ink); }
.fhead { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: end; margin-bottom: 24px; }
@media (max-width: 900px) { .fhead { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 99px; background: var(--card); color: var(--ink-2); border: 1px solid var(--line); }
.progress-box { padding: 14px 16px; }
.progress-box .t { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--mute); margin-bottom: 8px; }
.progress-box .t b { color: var(--ink); }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1080px) { .layout { grid-template-columns: 1fr; } .stepnav { display: none; } }
.stepnav { position: sticky; top: 84px; }
.stepnav p { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0 0 8px 10px; }
.stepnav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stepnav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; color: var(--ink-2); }
.stepnav a:hover { background: var(--card); }
.stepnav a.on { background: var(--card); box-shadow: var(--shadow); color: var(--ink); font-weight: 600; }
.stepnav .sn { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: none; color: var(--mute); background: var(--card); }
.stepnav .sn.pass { background: var(--pass); border-color: var(--pass); color: #fff; }
.stepnav .sn.fail { background: var(--fail); border-color: var(--fail); color: #fff; }
.stepnav .sn.blocked { background: var(--block); border-color: var(--block); color: #fff; }
.stepnav .sn.untested { border-style: dashed; }
.stepnav .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

details.brief { padding: 0; margin-bottom: 22px; overflow: hidden; }
details.brief summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; align-items: center; gap: 10px; font-weight: 650; }
details.brief summary::-webkit-details-marker { display: none; }
details.brief summary .chev { margin-left: auto; transition: transform .2s; color: var(--mute); }
details.brief[open] summary .chev { transform: rotate(180deg); }
.brief .proves { margin: 0 20px 16px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--ink); font-size: 15px; border: 1px solid var(--brand-line); }
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); border-top: 1px solid var(--line); }
.kv dt, .kv dd { margin: 0; padding: 11px 20px; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.kv dt { color: var(--mute); font-weight: 500; }
.kv dd { color: var(--ink-2); }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .kv dt { padding-bottom: 0; border-bottom: 0; } .kv dd { padding-top: 2px; } }

/* Step card */
.step { position: relative; margin-bottom: 18px; overflow: hidden; }
.step::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.step.pass::before { background: var(--pass); } .step.fail::before { background: var(--fail); } .step.blocked::before { background: var(--block); } .step.untested::before { background: var(--faint); }
.step-head { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px 18px; border-bottom: 1px solid var(--line-2); }
.step-no { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--card); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.step-head .of { font-size: 12.5px; color: var(--mute); font-weight: 500; margin-bottom: 2px; }
.step-head .do { font-size: 16.5px; line-height: 1.5; color: var(--ink); }
.step-head .grow { flex: 1; min-width: 0; }
@media (max-width: 560px) {
  .step-head { flex-wrap: wrap; gap: 8px 12px; padding: 16px 16px 14px; }
  .step-head .grow { flex-basis: calc(100% - 48px); }
  .step-head .badge { margin-left: 48px; }
  .expect, .record { padding: 16px; }
  .shot img { height: 240px; }
}
.badge svg { width: 13px; height: 13px; }
.badge { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--line-2); color: var(--mute); white-space: nowrap; }
.badge.pass { background: var(--pass-soft); color: var(--pass); } .badge.fail { background: var(--fail-soft); color: var(--fail); } .badge.blocked { background: var(--block-soft); color: var(--block); }

.step-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 900px) { .step-body { grid-template-columns: 1fr; } }
.expect { padding: 20px 22px 22px; min-width: 0; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--mute); margin: 0 0 10px; }
.see { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.see li { display: flex; gap: 10px; font-size: 15px; color: var(--ink-2); }
.tag { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
.mustnot { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--fail-soft); border: 1px solid var(--fail-line); }
.mustnot .h { display: flex; align-items: center; gap: 7px; color: var(--fail); font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.mustnot .h svg { width: 15px; height: 15px; }
.mustnot ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; }
.mustnot li + li { margin-top: 3px; }
.shots { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x mandatory; }
.shot { flex: none; scroll-snap-align: start; margin: 0; }
.shot button { display: block; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--inset); cursor: zoom-in; overflow: hidden; }
.shot img { display: block; height: 300px; width: auto; max-width: min(560px, 78vw); object-fit: contain; background: #fff; }
.shot.design img { height: 200px; }
.shot figcaption { font-size: 12.5px; color: var(--mute); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.shot figcaption .pill { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); }
.shot figcaption .pill.built { background: var(--pass-soft); color: var(--pass); }
.notes { margin-top: 14px; display: grid; gap: 8px; }
.note { display: flex; gap: 10px; font-size: 14px; color: var(--ink-2); background: var(--inset); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; }
.note svg { flex: none; width: 16px; height: 16px; color: var(--mute); margin-top: 2px; }

/* Record panel */
.record { background: var(--inset); border-left: 1px solid var(--line-2); padding: 20px; }
@media (max-width: 900px) { .record { border-left: 0; border-top: 1px solid var(--line-2); } }
.record .stick { position: sticky; top: 84px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 16px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice > span { display: flex; align-items: center; justify-content: center; gap: 7px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.choice > span svg { width: 16px; height: 16px; }
.choice input:hover + span { border-color: var(--faint); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input:checked + span.pass { background: var(--pass); border-color: var(--pass); color: #fff; }
.choice input:checked + span.fail { background: var(--fail); border-color: var(--fail); color: #fff; }
.choice input:checked + span.blocked { background: var(--block); border-color: var(--block); color: #fff; }
.choice input:checked + span.untested { background: var(--ink-2); border-color: var(--ink-2); color: var(--card); }
.field { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.field .opt { font-weight: 400; color: var(--mute); }
textarea, input[type=text], input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
textarea:focus, input[type=text]:focus, input[type=password]:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
textarea { min-height: 76px; resize: vertical; margin: 0 0 14px; font-size: 14.5px; }
.record .btn { width: 100%; }
.saved { display: block; font-size: 12.5px; color: var(--mute); margin-top: 10px; min-height: 18px; text-align: center; }
.saved.err { color: var(--fail); }
.saved.ok { color: var(--pass); }

.closing { margin-top: 8px; padding: 16px 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: flex; gap: 12px; color: var(--ink-2); }
.closing p { margin: 0; }
.nextline { color: var(--mute); margin-top: 14px; font-size: 14.5px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 70%), var(--bg); }
.login .card { width: 100%; max-width: 400px; padding: 32px 28px 28px; }
.login .brand { margin-bottom: 26px; }
.login h1 { font-size: 24px; }
.login .sub { font-size: 15px; margin-bottom: 22px; }
.login label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; color: var(--ink-2); }
.login .btn { width: 100%; margin-top: 6px; height: 44px; }
.err { color: var(--fail); min-height: 22px; margin: 10px 0 4px; font-size: 14px; }
.login .foot { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 18px; }

/* Zoom */
.zoom { position: fixed; inset: 0; background: rgba(2, 6, 23, .82); display: grid; place-items: center; padding: 20px; z-index: 50; cursor: zoom-out; animation: fade .15s ease; }
.zoom img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
@keyframes fade { from { opacity: 0; } }
.loading { color: var(--mute); padding: 40px 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
