:root {
  --font-body: 'General Sans', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --text-xs: 12px; --text-sm: 14px; --text-base: 16px; --text-lg: 18px; --text-xl: 24px;
  --bg: #f4f3ef; --surface: #fbfaf7; --surface-2: #efede7; --line: #dcd9d0; --line-strong: #c4c0b4;
  --ink: #1b1e22; --ink-2: #4b5058; --ink-3: #5c6168; /* v18.1: was #6f747c (4.24:1 on --bg, 4.02:1 on --surface-2) */
  --accent: #1d5873; --accent-ink: #ffffff; --accent-soft: #dfe9ee;
  --crit: #a3271d; --crit-soft: #f6e1de; --high: #9a5512; --high-soft: #f5e7d6;
  --med: #6c6418; --med-soft: #eeebd6; --info: #3d5a6b; --info-soft: #e2e9ec;
  --ok: #2f6b3f; --ok-soft: #e0ece2;
  --radius: 8px; --shadow: 0 1px 2px rgba(20,20,20,.05), 0 4px 16px rgba(20,20,20,.05);
}
[data-theme="dark"] {
  --bg: #121417; --surface: #181b1f; --surface-2: #1f2328; --line: #2b3036; --line-strong: #3a4048;
  --ink: #e6e4df; --ink-2: #b4b2ad; --ink-3: #9d9c97; /* v18.1: was #8b8a86 */
  --accent: #6fb3d2; --accent-ink: #0d1a20; --accent-soft: #1b2e37;
  --crit: #ee8a7f; --crit-soft: #3a1f1c; --high: #e3a865; --high-soft: #362817; --med: #cfc27a; --med-soft: #2f2c18;
  --info: #9cb8c7; --info-soft: #1e2a31; --ok: #8cc79b; --ok-soft: #1b2c20;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html { margin: 0; height: 100%; }
body { margin: 0; min-height: 100%; }
body { font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
.mono { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .02em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { display: block; height: 22px; width: auto; flex: none; }
[data-theme="dark"] .brand-logo { background: #fff; padding: 5px 8px; border-radius: 6px; height: 32px; }
.brand-divider { width: 1px; height: 28px; background: var(--line); flex: none; }
.print-logo { display: block; height: 24px; width: auto; margin: 0 0 14px; }
.brand-name { font-weight: 600; font-size: var(--text-sm); letter-spacing: -.005em; }
.brand-sub { font-size: var(--text-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.progress { display: flex; align-items: center; gap: 8px; margin-right: 10px; color: var(--ink-2); }
.progress-bar { width: 110px; height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 6px; border: 1px solid transparent; background: none; font-size: var(--text-sm); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn.ghost { color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.outline { border-color: var(--line-strong); background: var(--surface); }
.btn.outline:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.icon { width: 34px; padding: 0; justify-content: center; color: var(--ink-2); }
.btn.icon:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr) 380px; min-height: calc(100vh - 60px); }
.steps { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 20px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.steps-label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding: 0 10px 10px; }
.step-link { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; color: var(--ink-2); font-size: var(--text-sm); }
.step-link:hover { background: var(--surface-2); color: var(--ink); }
.step-link[aria-current="step"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.step-num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); }
.step-link[aria-current="step"] .step-num { color: var(--accent); }
.step-state { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.step-state.part { border-color: var(--accent); background: conic-gradient(var(--accent) var(--p, 0%), transparent 0); }
.step-state.done { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.step-state svg { width: 10px; height: 10px; }
.step-sep { height: 1px; background: var(--line); margin: 12px 10px; }
.steps-foot { padding: 14px 10px 0; font-size: var(--text-xs); color: var(--ink-3); line-height: 1.5; }

main { padding: 32px clamp(20px, 4vw, 56px) 96px; outline: none; min-width: 0; }
.step-head { max-width: 760px; margin-bottom: 24px; }
.eyebrow { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
h1 { font-size: var(--text-xl); line-height: 1.2; letter-spacing: -.015em; margin: 0 0 10px; font-weight: 600; }
.lede { color: var(--ink-2); margin: 0; max-width: 68ch; }
.considerations { margin: 18px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); max-width: 760px; }
.considerations h3, .considerations .cons-h { margin: 0 0 6px; font-size: var(--text-xs); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 500; }
.considerations ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: var(--text-sm); }
.considerations li + li { margin-top: 4px; }

.q { max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 14px; }
.q-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.q-title { font-size: var(--text-base); font-weight: 600; margin: 0; }
.q-kind { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); white-space: nowrap; }
.q-why { font-size: var(--text-sm); color: var(--ink-2); margin: 4px 0 14px; max-width: 68ch; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-box { display: flex; gap: 10px; align-items: flex-start; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); transition: border-color .15s, background .15s; }
.opt:hover .opt-box { border-color: var(--line-strong); }
.opt input:focus-visible + .opt-box { outline: 2px solid var(--accent); outline-offset: 1px; }
.opt input:checked + .opt-box { border-color: var(--accent); background: var(--accent-soft); }
.tick { flex: none; width: 16px; height: 16px; margin-top: 2px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; background: var(--surface); }
.opt.radio .tick { border-radius: 50%; }
.opt.check .tick { border-radius: 4px; }
.opt input:checked + .opt-box .tick { border-color: var(--accent); background: var(--accent); }
.opt.radio input:checked + .opt-box .tick::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); }
.opt.check input:checked + .opt-box .tick::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) translate(1px, -1px); }
.opt-l { font-size: var(--text-sm); font-weight: 500; line-height: 1.35; }
.opt-h { display: block; font-size: var(--text-xs); color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.text-in { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; font-size: var(--text-sm); }
.text-in:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.note-toggle { margin-top: 12px; border: 0; background: none; padding: 0; font-size: var(--text-xs); color: var(--ink-3); cursor: pointer; font-family: var(--font-mono); }
.note-toggle:hover { color: var(--accent); }
.note { width: 100%; margin-top: 8px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; font-size: var(--text-sm); resize: vertical; }
.q-inline-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.step-foot { max-width: 760px; display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Severity chips */
.sev { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.sev.critical { background: var(--crit-soft); color: var(--crit); }
.sev.high { background: var(--high-soft); color: var(--high); }
.sev.medium { background: var(--med-soft); color: var(--med); }
.sev.info { background: var(--info-soft); color: var(--info); }
.sev.ok { background: var(--ok-soft); color: var(--ok); }
.cat { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }

/* Panel */
.panel { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; border-left: 1px solid var(--line); background: var(--surface); padding: 20px 18px 40px; }
.panel h2 { font-size: var(--text-sm); font-weight: 600; margin: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-close { display: none; }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.tally div { padding: 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.tally b { display: block; font-size: var(--text-lg); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tally span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; }
.tally .c b { color: var(--crit); } .tally .h b { color: var(--high); } .tally .m b { color: var(--med); } .tally .i b { color: var(--info); }
.seg { display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: 6px; margin-bottom: 12px; }
.seg button { flex: 1; height: 28px; border: 0; border-radius: 5px; background: none; font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.finding { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); margin-bottom: 8px; }
.finding > button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; cursor: pointer; }
.finding-top { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.finding-title { font-size: var(--text-sm); font-weight: 500; line-height: 1.35; }
.finding-body { padding: 0 12px 12px; font-size: var(--text-sm); color: var(--ink-2); }
.finding-body p { margin: 0 0 8px; }
.finding-body ul { margin: 0 0 8px; padding-left: 18px; }
.finding-body li + li { margin-top: 3px; }
.finding-body .refs { font-size: var(--text-xs); }
.finding-body .refs a { display: block; margin-top: 3px; }
.sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 4px; }
.empty { padding: 24px 12px; text-align: center; color: var(--ink-3); font-size: var(--text-sm); border: 1px dashed var(--line-strong); border-radius: 6px; }
.panel-note { margin-top: 18px; font-size: var(--text-xs); color: var(--ink-3); line-height: 1.5; }

.panel-fab { display: none; }
.ex-short { display: none; }
.scrim { display: none; }

/* Blueprint */
.bp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 8px 0 22px; overflow-x: auto; }
.bp-tabs button { height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.bp-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.stat { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat b { display: block; font-size: var(--text-xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: var(--text-xs); color: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--text-xs); color: var(--ink-2); margin-bottom: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.arch { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; }
.layers { display: grid; gap: 8px; }
.layer { display: grid; grid-template-columns: 150px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.layer-name { padding: 12px; background: var(--surface-2); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-mono); color: var(--ink-2); display: flex; align-items: center; }
.layer-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
.cross { display: grid; gap: 8px; align-content: start; }
.cross .layer { grid-template-columns: 1fr; }
.cross .layer-name { padding: 10px 12px; }
.cross .layer-items { flex-direction: column; }
.cross .comp { flex: 0 0 auto; }
.comp { flex: 1 1 170px; min-width: 0; padding: 8px 10px; border-radius: 5px; border: 1px solid var(--line); border-left-width: 3px; background: var(--bg); }
.comp b { display: block; font-size: var(--text-xs); font-weight: 600; }
.comp span { display: block; font-size: var(--text-xs); color: var(--ink-3); line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.comp.ok { border-left-color: var(--ok); }
.comp.weak { border-left-color: var(--med); }
.comp.gap { border-left-color: var(--crit); background: var(--crit-soft); }
.comp.rec { border-left-color: var(--accent); border-style: dashed; border-left-style: solid; }
.comp.open { border-left-color: var(--line-strong); }
.comp.na { opacity: 1; border-style: dashed; } .comp.na, .comp.na b, .comp.na span { color: var(--ink-3); } /* v18.1: opacity replaced so text keeps 4.5:1 */
.flow { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-align: center; margin: -2px 0; letter-spacing: .1em; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--surface-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.muted { color: var(--ink-3); }
.group-h { font-size: var(--text-base); font-weight: 600; margin: 22px 0 10px; display: flex; gap: 10px; align-items: center; }
.bars { display: grid; gap: 12px; max-width: 760px; }
.bar-row { display: grid; grid-template-columns: 200px 1fr 64px; gap: 12px; align-items: center; font-size: var(--text-sm); }
.bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.bar-row .mono { text-align: right; color: var(--ink-2); }
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-width: 900px; }
.export-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px; }
.export-card h3 { margin: 0; font-size: var(--text-base); font-weight: 600; }
.export-card p { margin: 0 0 6px; font-size: var(--text-sm); color: var(--ink-2); flex: 1; }
.more-links { margin-top: 28px; max-width: 760px; }
.more-links h2 { margin: 0 0 10px; font-size: var(--text-xs); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 500; }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.more-grid a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; background: var(--surface); transition: border-color .15s; }
.more-grid a:hover, .more-grid a:focus-visible { border-color: var(--accent); }
.more-grid b { display: block; font-size: var(--text-sm); }
.more-grid span { display: block; font-size: var(--text-xs); color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.steps-links { padding: 12px 10px 0; font-size: var(--text-xs); line-height: 1.6; display: flex; flex-direction: column; }
.steps-links span { color: var(--ink-3); margin-bottom: 2px; }
.steps-links a { color: var(--ink-2); text-decoration: none; }
.steps-links a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 560px) { .more-grid { grid-template-columns: 1fr; } }
.disclaimer { margin-top: 26px; max-width: 760px; font-size: var(--text-xs); color: var(--ink-3); line-height: 1.6; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; }
.open-list { list-style: none; padding: 0; margin: 0; max-width: 760px; }
.open-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin-bottom: 6px; font-size: var(--text-sm); align-items: center; }
.welcome { max-width: 760px; }
.welcome-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 22px 0; }
.welcome-grid div { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: var(--text-sm); color: var(--ink-2); }
.welcome-grid b { display: block; color: var(--ink); margin-bottom: 4px; font-size: var(--text-sm); }

/* Dialog and toast */
.dialog-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10,12,14,.45); padding: 16px; }
.dialog-wrap[hidden] { display: none; }
.dialog { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; box-shadow: var(--shadow); }
.dialog h2 { margin: 0 0 8px; font-size: var(--text-lg); font-weight: 600; }
.dialog p { margin: 0 0 18px; color: var(--ink-2); font-size: var(--text-sm); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 70; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-size: var(--text-sm); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .panel { position: fixed; top: 0; right: 0; bottom: 0; height: 100vh; width: min(400px, 92vw); z-index: 50; transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .panel.open { transform: none; }
  .panel-close { display: inline-flex; }
  .panel-fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; right: 18px; bottom: 18px; z-index: 40; height: 42px; padding: 0 16px; border-radius: 21px; border: 0; background: var(--ink); color: var(--bg); font-size: var(--text-sm); font-weight: 500; cursor: pointer; box-shadow: var(--shadow); }
  .panel-fab .mono { background: var(--crit); color: #fff; border-radius: 10px; padding: 1px 7px; }
  [data-theme="dark"] .panel-fab .mono { color: #121417; } /* v18.1: white on dark-mode --crit was 2.44:1; now 7.54:1 */
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10,12,14,.35); }
  .arch { grid-template-columns: 1fr; }
  .cross { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .steps { position: sticky; top: 60px; z-index: 20; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .steps::-webkit-scrollbar { display: none; }
  .steps-label, .step-sep, .steps-foot, .steps-links { display: none; }
  .step-link { grid-template-columns: auto auto; width: auto; flex: none; padding: 7px 10px; }
  .step-link .step-title { display: none; }
  .step-link[aria-current="step"] .step-title { display: inline; }
  .step-link .step-state { display: none; }
  main { padding: 22px 16px 96px; }
  .progress, .brand-sub { display: none; }
  .step-foot { gap: 10px; }
  .step-foot .btn { min-width: 0; white-space: normal; text-align: center; height: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
  .topbar { padding: 0 12px; }
  .top-actions .btn.ghost { padding: 0 8px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .layer { grid-template-columns: 1fr; }
  .layer-name { padding: 8px 12px; }
  .cross { grid-template-columns: 1fr; }
  .welcome-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr 52px; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .q { padding: 16px; }
  .opts { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .brand-name { display: none; }
  .brand-divider { display: none; }
  .topbar { gap: 8px; }
  .brand { flex: 1 1 auto; }
  .brand-logo { box-sizing: border-box; height: auto; width: 100%; max-width: 150px; min-width: 0; flex: 0 1 auto; }
  [data-theme="dark"] .brand-logo { height: auto; padding: 4px 6px; border-radius: 5px; }
  .top-actions .btn:not(.icon) { padding-left: 8px; padding-right: 8px; }
  .ex-long { display: none; }
  .ex-short { display: inline; }
  .top-actions { gap: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.link-btn { display: inline-block; margin-top: 10px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.print-view { display: none; }

/* practice method components */
.avoid, .counsel { margin: 8px 0; padding: 8px 10px; border-radius: 6px; font-size: var(--text-sm); }
.avoid { background: var(--high-soft); border-left: 3px solid var(--high); }
.counsel { background: var(--info-soft); border-left: 3px solid var(--info); }
.avoid .sub, .counsel .sub { margin-top: 0; }
.avoid p, .counsel p { margin: 0; color: var(--ink-2); }
td .avoid, td .counsel { font-size: 12px; }
.tier-card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 22px; max-width: 760px; }
.tier-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.tier-top .sub { margin-top: 0; }
.tier-big { font-size: var(--text-xl); font-weight: 650; line-height: 1.15; }
.tier-score { text-align: right; }
.tier-score b { font-size: var(--text-xl); display: block; line-height: 1.1; }
.tier-score span { font-size: var(--text-xs); color: var(--ink-3); }
.tier-bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 99px; margin: 14px 0 6px; overflow: hidden; }
.tier-bar span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 99px; transition: width .25s ease; }
.tier-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.tier-bands { display: grid; grid-template-columns: repeat(4, 1fr); font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.tier-note { margin: 10px 0 0; font-size: var(--text-sm); color: var(--ink-2); }
.tier-note.muted { color: var(--ink-3); font-size: var(--text-xs); }
.tier-list { margin: 10px 0 0; padding-left: 18px; font-size: var(--text-sm); color: var(--ink-2); }
.tier-list li + li { margin-top: 4px; }
.ev { display: inline-block; font-size: 11px; font-family: var(--font-mono); padding: 2px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid var(--line); color: var(--ink-2); }
.ev.indicated { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.ev.partial { background: var(--med-soft); color: var(--med); border-color: transparent; }
.ev.missing { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.ev.na { color: var(--ink-3); }
.review-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; max-width: 900px; }
.rv { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); border-left-width: 3px; }
.rv.pass { border-left-color: var(--ok); }
.rv.concern { border-left-color: var(--high); }
.rv.open { border-left-color: var(--line-strong); }
.rv.na { opacity: .7; }
.rv-n { font-size: var(--text-lg); color: var(--ink-3); line-height: 1.2; }
.rv-t { font-weight: 600; font-size: var(--text-base); line-height: 1.4; }
.rv-note { font-size: var(--text-sm); color: var(--ink-2); margin-top: 4px; }
.rv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.yield { display: inline-block; font-size: 10px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--ink); vertical-align: middle; margin-left: 4px; } /* v18.1: was --accent-ink on --accent-soft (1.23:1) */
@media (max-width: 560px) {
  .rv { grid-template-columns: 26px 1fr; }
  .rv-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
}

@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #111 !important; }
  body.printing > *:not(.print-view) { display: none !important; }
  body.printing .print-view { display: block; font-size: 11px; }
  .print-view h1 { font-size: 20px; margin: 0 0 4px; }
  .print-view h2 { font-size: 15px; margin: 22px 0 10px; break-after: avoid; }
  .print-view .arch { grid-template-columns: minmax(0, 1fr) 200px; }
  .print-view .layer, .print-view .comp, .print-view tr { break-inside: avoid; }
  .print-view .tbl-wrap { overflow: visible; }
  .print-view a { color: #111; }
  .print-view .disclaimer { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* v16: conflicts, readings, save state, sources, mobile step selector */
.btn.sm { height: 28px; padding: 0 10px; font-size: var(--text-xs); }
.resolve { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.reading { margin: 8px 0; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); border-left: 3px solid var(--ink-3); font-size: var(--text-sm); }
.reading .sub { margin-top: 0; }
.reading p { margin: 0; color: var(--ink-2); }
.q.flash { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .3s; }
.adr-why { margin-top: 4px; font-size: 12px; color: var(--ink-3); }
td.unsupported { color: var(--crit); font-weight: 600; }
.readiness-line { font-size: var(--text-sm); color: var(--ink-2); margin: 0 0 16px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); max-width: 760px; }
.zero-why { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); margin: -2px 0 6px; }
.example-banner { margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--high); border-radius: 6px; background: var(--high-soft); font-size: var(--text-sm); color: var(--ink-2); max-width: 900px; }
.src-url { color: var(--ink-3); word-break: break-all; margin-top: 3px; font-size: 11px; }
.save-note { font-size: var(--text-xs); color: var(--ink-3); white-space: nowrap; margin: 0 4px; }
.save-note.dirty { color: var(--high); font-weight: 600; }
.save-note.dirty::before { content: "● "; }
.print-cover-line { font-size: 12px; font-weight: 600; margin: 0 0 8px; }
.step-select-wrap { display: none; }
@media (max-width: 1180px) { .save-note { display: none; } }
@media (max-width: 860px) {
  :root { --fab-h: 42px; --fab-gap: 18px; }
  .steps { display: block; padding: 8px 12px; overflow: visible; }
  .steps .step-link { display: none; }
  .step-select-wrap { display: flex; align-items: center; gap: 10px; }
  .step-select-wrap label { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); flex: none; }
  .step-select-wrap select { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--text-sm); }
  main { padding-bottom: calc(var(--fab-h) + var(--fab-gap) + 16px); }
  .panel-fab { height: var(--fab-h); bottom: var(--fab-gap); }
}
@media (max-width: 560px) {
  .topbar { position: static; height: auto; flex-wrap: wrap; padding: 8px 12px; row-gap: 6px; }
  .brand { flex: 1 1 100%; }
  .brand-name, .brand-divider { display: block !important; }
  .top-actions { flex: 1 1 100%; justify-content: space-between; flex-wrap: wrap; }
  .save-note { display: inline; flex: 1 1 100%; order: 10; margin: 0; }
  .steps { top: 0; }
  .shell { min-height: 0; }
}
@media (max-width: 1180px) { .toast { bottom: calc(42px + 18px + 12px); } }
@media (min-width: 861px) { .bp-tabs { flex-wrap: wrap; overflow-x: visible; } }

/* v16.3 */
.btn[hidden] { display: none; }
.q { scroll-margin-top: calc(var(--sticky-h, 60px) + 8px); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-btn:hover { text-decoration-thickness: 2px; }
.filter-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: var(--text-sm); }

/* v18.1 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fid { font-size: 11px; color: var(--ink-3); letter-spacing: 0; }
.finding-top .fid { margin-left: auto; }
.stale-banner { margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--crit); border-radius: 6px; background: var(--crit-soft); font-size: var(--text-sm); color: var(--ink); max-width: 900px; }
.tab-h { font-size: var(--text-lg); font-weight: 600; margin: 0 0 14px; letter-spacing: -.005em; }
.act-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 12px; }
.act-filters label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-xs); color: var(--ink-2); font-weight: 500; }
.act-filters select { height: 34px; min-width: 180px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--text-sm); }
@media print { .stale-banner { border-left-color: #111; background: #fff; color: #111; } }
