:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --surface-3: #262626;
  --ink: #eaeaea;
  --ink-2: #b5b5b5;
  --muted: #909090;
  --line: #2b2b2b;
  --line-strong: #484848;
  --brand: #ff3b30;
  --brand-strong: #ff1f12;
  --brand-deep: #150604;
  --brand-tint: rgba(255, 59, 48, 0.1);
  --brand-line: rgba(255, 59, 48, 0.45);
  --red: #ff3b30;
  --red-tint: rgba(255, 59, 48, 0.12);
  --high: #ff6a3d;
  --high-tint: rgba(255, 106, 61, 0.12);
  --amber: #ffb020;
  --amber-tint: rgba(255, 176, 32, 0.13);
  --green: #4ff542;
  --green-tint: rgba(79, 245, 66, 0.1);
  --info: #8fa0ad;
  --info-tint: rgba(143, 160, 173, 0.13);
  --shadow-sm: 0 0 0 transparent;
  --shadow-md: 3px 3px 0 #000;
  --shadow-lg: 6px 6px 0 #000;
  --radius: 0;
  --radius-sm: 0;
  --radius-lg: 0;
  --header-h: 68px;
  --sans: "Space Grotesk", -apple-system, "SF Pro Display", "Helvetica Neue", ui-sans-serif, system-ui, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/space-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* CRT scanline overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.16) 3px, rgba(0, 0, 0, 0.16) 4px);
  opacity: 0.3;
}

::selection { background: var(--brand); color: var(--brand-deep); }

button, input, select, textarea { font: inherit; }

h1, h2, h3, h4, p, ul, ol { margin: 0; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  z-index: 300;
  padding: 10px 14px;
  background: var(--brand);
  color: var(--brand-deep);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.shell {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding-inline: max(28px, env(safe-area-inset-left));
}

.view-head, .section-block, .workspace, .scan-layout, .report-layout {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* ---------- Boot / loading ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  background: var(--bg);
  font-family: var(--mono);
  transition: opacity 450ms ease;
  animation: boot-auto-dismiss 4.5s ease 1s forwards;
}
@keyframes boot-auto-dismiss {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
.boot-done { opacity: 0; pointer-events: none; }
.boot-frame { width: min(560px, calc(100vw - 48px)); border: 1px solid var(--line-strong); padding: 24px; }
.boot-line { font-size: 13px; color: var(--ink); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.boot-brand { color: var(--brand); font-weight: 700; margin-bottom: 16px; }
.boot-dim { color: var(--muted); animation: bootline 0.3s ease both; }
.boot-dim:nth-child(2) { animation-delay: 0.15s; }
.boot-dim:nth-child(3) { animation-delay: 0.35s; }
.boot-dim:nth-child(4) { animation-delay: 0.55s; }
.boot-track { height: 14px; border: 1px solid var(--line-strong); margin: 18px 0 12px; }
.boot-fill { height: 100%; width: 0; background: var(--brand); animation: bootfill 1.35s ease-out 0.2s both; }
.boot-cursor { color: var(--muted); font-size: 12px; display: flex; gap: 10px; align-items: center; animation: bootline 0.3s ease 0.9s both; }
.boot-caret { color: var(--green); animation: caretblink 1s steps(1) infinite; }
@keyframes bootline { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes bootfill { from { width: 0; } to { width: 100%; } }
@keyframes caretblink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- Landing reveals & typing ---------- */
body.booted .reveal { animation: rise 620ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
body.booted .prompt-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  animation: type 1.1s steps(20) 0.25s both;
}
@keyframes type { from { width: 0; } to { width: 20ch; } }
body.booted .prompt-caret { color: var(--brand); animation: caretblink 1s steps(1) 0.25s infinite; }
body.booted .mini-line { animation: rise 420ms ease both; animation-delay: calc(0.95s + var(--l, 0) * 140ms); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 110;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border: 2px solid var(--brand);
  display: grid;
  place-items: center;
  color: var(--brand);
}
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: -0.01em; font-weight: 800; }
.brand-text small { color: var(--muted); font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-inline: auto;
  border: 1px solid var(--line-strong);
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  padding: 9px 16px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.nav-item:last-child { border-right: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item:active { background: var(--surface-3); }
.nav-item[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav-step {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 10px;
  border: 1px solid currentColor;
}
.nav-item[aria-current="page"] .nav-step { border-color: currentColor; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.label-short { display: none; }
.label-long { display: inline; }

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.privacy-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(79, 245, 66, 0.5);
}
.github-link { text-decoration: none; }
.github-link::before {
  content: "//";
  color: var(--muted);
  font-weight: 700;
  margin-right: 4px;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 110ms ease, background 140ms ease, border-color 140ms ease, box-shadow 110ms ease;
}
.button:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.button:active { transform: translate(1px, 1px); box-shadow: 0 0 0 transparent; }
.button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.button.primary {
  color: var(--brand-deep);
  background: var(--brand);
  border-color: var(--brand);
}
.button.primary:hover { background: var(--brand-strong); }
.button.secondary {
  color: var(--ink);
  background: var(--surface-2);
}
.button.secondary:hover { background: var(--surface-3); }
.button.ghost { border-color: var(--line-strong); background: transparent; color: var(--ink-2); }
.button.ghost:hover { border-color: var(--brand-line); background: var(--brand-tint); color: var(--brand); }
.button.large { min-height: 52px; padding: 14px 24px; font-size: 14px; }
.button.block { width: 100%; }
.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Segmented ---------- */
.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.segment {
  border: 0;
  border-right: 1px solid var(--line-strong);
  min-height: 42px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.segment:last-child { border-right: 0; }
.segment:hover { color: var(--ink); }
.segment.active { background: var(--ink); color: var(--bg); }

/* ---------- Views ---------- */
.view { padding: 34px 0 56px; }
.view-head { margin-bottom: 28px; max-width: 760px; }
.view-head h1 {
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.02em;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.view-sub { color: var(--ink-2); font-size: 15.5px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.eyebrow::before { content: "[ "; color: var(--brand); }
.eyebrow::after { content: " ]"; color: var(--brand); }

/* ---------- Mobile home menu ---------- */
.mobile-home { display: none; }
.mobile-home > * { min-width: 0; }
.mobile-home summary { list-style: none; }
.mobile-home summary::-webkit-details-marker { display: none; }
.mobile-menu-title { display: grid; gap: 2px; }
.mobile-menu-title .eyebrow { margin-bottom: 0; }
.mobile-menu-title strong { color: var(--ink); font-size: 15px; text-transform: uppercase; letter-spacing: 0.02em; }
.mobile-menu-toggle { color: var(--brand); font-family: var(--mono); font-size: 24px; line-height: 1; }
.mobile-home[open] .mobile-menu-toggle { transform: rotate(45deg); }
.mobile-home > :not(summary) { animation: mobile-menu-reveal 220ms ease both; }
.mobile-info { display: none; }
.mobile-info summary { list-style: none; }
.mobile-info summary::-webkit-details-marker { display: none; }
.mobile-info[open] .mobile-menu-toggle { transform: rotate(45deg); }
.mobile-info-body { display: grid; gap: 18px; padding: 16px 14px; border: 1px solid var(--line-strong); border-top: 0; background: var(--surface); animation: mobile-menu-reveal 220ms ease both; }
.mobile-info-block { display: grid; gap: 9px; }
.mobile-steps, .mobile-facts { display: grid; gap: 9px; margin: 0; padding-left: 22px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.mobile-steps strong { color: var(--ink); }
.mobile-facts { list-style: none; padding-left: 0; }
.mobile-facts li { position: relative; padding-left: 15px; }
.mobile-facts li::before { content: "+"; position: absolute; left: 0; color: var(--green); font-family: var(--mono); font-weight: 700; }
.mobile-info-links { display: grid; gap: 9px; padding-top: 14px; border-top: 1px solid var(--line); }
@keyframes mobile-menu-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.mh-status { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.mh-status h2 { font-size: 20px; text-transform: uppercase; letter-spacing: -0.01em; font-weight: 800; margin-bottom: 4px; }
.mh-status-line { margin: 0; font-size: 12px; }
.mh-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.mh-actions .button { width: 100%; }
.quick-surfaces { display: grid; gap: 4px; }
.mh-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 4px 2px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Hero (home) ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 48px;
  align-items: center;
  padding: 52px 0 24px;
}
.hero-copy h1 {
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 900;
  text-transform: uppercase;
  margin: 12px 0 20px;
  text-wrap: balance;
}
.hero-copy .accent { color: var(--brand); position: relative; white-space: nowrap; }
.hero-lead {
  color: var(--ink-2);
  font-size: 17px;
  max-width: 58ch;
  margin-bottom: 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.trust-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.trust-strip li { display: flex; align-items: center; gap: 8px; }
.trust-strip li::before {
  content: "+";
  color: var(--green);
  font-weight: 700;
  flex: none;
}
.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

.hero-panel { min-width: 0; }
.mini-report {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-family: var(--mono);
  position: relative;
  overflow: hidden;
}
.mini-report::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.22) 3px, rgba(0, 0, 0, 0.22) 4px);
  opacity: 0.35;
}
.mini-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
}
.mini-dot { width: 10px; height: 10px; background: var(--line-strong); }
.mini-dot:nth-child(1) { background: #ff3b30; }
.mini-dot:nth-child(2) { background: #ffb020; }
.mini-dot:nth-child(3) { background: #8fa0ad; }
.mini-label {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-body { padding: 18px; position: relative; }
.mini-prompt { color: var(--ink); font-size: 13px; margin-bottom: 14px; }
.prompt-sym { color: var(--brand); font-weight: 700; }
.prompt-text { letter-spacing: 0.02em; }
.prompt-caret { color: var(--brand); margin-left: 2px; }
.mini-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-2);
}
.mini-bar {
  display: flex;
  height: 12px;
  background: var(--line);
  margin: 16px 0 12px;
}
.mini-bar-seg { height: 100%; }
.mini-result {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mini-risk { color: var(--amber); font-weight: 700; }
.hero-note { margin-top: 16px; color: var(--muted); font-size: 12.5px; text-align: center; font-family: var(--mono); }

/* ---------- Sections ---------- */
.section-block { padding: 48px 0 8px; }
.section-head { margin-bottom: 24px; max-width: 720px; }
.section-head h2 {
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -0.02em;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.section-sub { color: var(--ink-2); }

.surface-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.surface-card {
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 18px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 110ms ease, box-shadow 110ms ease;
}
.surface-card:hover { border-color: var(--brand-line); background: var(--surface-2); transform: translate(-2px, -2px); box-shadow: var(--shadow-md); }
.surface-card:active { transform: translate(1px, 1px); box-shadow: 0 0 0 transparent; }
.surface-card.active { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.check-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.surface-card.active .check-badge { background: var(--brand); border-color: var(--brand); color: var(--brand-deep); }

.selection-bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--brand-line);
  background: var(--brand-tint);
  flex-wrap: wrap;
}
.selection-info { font-size: 14px; color: var(--ink); font-weight: 600; }
.selection-info strong { font-size: 17px; font-weight: 800; font-family: var(--mono); }
.selection-actions { display: flex; gap: 10px; }
.surface-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--brand-line);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  color: var(--brand);
}
.surface-card h3 { font-size: 15.5px; margin-bottom: 6px; letter-spacing: -0.01em; text-transform: uppercase; font-weight: 700; }
.surface-card p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.surface-count { margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--brand); font-family: var(--mono); text-transform: uppercase; }

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.how-card {
  padding: 22px 20px;
  border-left: 1px solid var(--line-strong);
}
.how-card:first-child { border-left: 0; }
.how-card:hover { background: var(--surface-2); }
.how-num {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  background: var(--brand);
  color: var(--brand-deep);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
}
.how-card h3 { font-size: 15px; margin-bottom: 6px; text-transform: uppercase; }
.how-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }

.rubric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.rubric-card {
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--info);
  background: var(--surface);
  padding: 16px;
}
.rubric-card:nth-child(1) { border-top-color: var(--red); }
.rubric-card:nth-child(2) { border-top-color: var(--high); }
.rubric-card:nth-child(3) { border-top-color: var(--amber); }
.rubric-card:nth-child(4) { border-top-color: var(--green); }
.rubric-sev { font-weight: 700; font-size: 14px; margin-bottom: 8px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.rubric-card p { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.rule-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  background: var(--surface);
  padding: 14px 16px;
}
.rule-card h3 { font-size: 14.5px; margin-bottom: 5px; text-transform: uppercase; }
.rule-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---------- Panels / workspace ---------- */
.project-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.project-switch { flex: 1; min-width: 220px; margin-bottom: 0; }
.project-bar-actions { display: flex; gap: 8px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(300px, 0.55fr);
  gap: 18px;
  align-items: start;
}
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.panel-header { margin-bottom: 16px; }
.panel-header.sub { margin-top: 28px; }
.panel-header.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-header h2 { font-size: 17px; letter-spacing: -0.01em; text-transform: uppercase; font-weight: 700; }
.reference-copy { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; margin-bottom: 12px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { color: var(--ink-2); font-size: 13px; font-weight: 650; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.03em; }
.field > span em, .field-group legend em { color: var(--muted); font-weight: 500; font-style: normal; text-transform: none; letter-spacing: 0; font-family: var(--sans); }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14.5px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 3px 3px 0 rgba(255, 59, 48, 0.35);
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #6b6b6b; }

.field-group {
  border: 1px solid var(--line-strong);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: grid;
  gap: 6px;
}
.field-group legend { color: var(--ink-2); font-size: 13px; font-weight: 650; padding: 0 4px; font-family: var(--mono); text-transform: uppercase; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; min-height: 32px; }
.check-line input { width: auto; }

.rule-list { padding-left: 20px; display: grid; gap: 12px; }
.rule-list li { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.rule-list strong { color: var(--ink); display: block; font-size: 13.5px; margin-bottom: 2px; }

.severity-quick { display: grid; gap: 10px; }
.sq-row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: start; }
.sq-sev { font-family: var(--mono); font-weight: 700; font-size: 11.5px; letter-spacing: 0.03em; padding-top: 1px; }
.sq-row span:last-child { color: var(--ink-2); font-size: 13px; line-height: 1.5; }

.step-actions { margin-top: 22px; display: flex; }
.step-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .step-bar .button { flex: 1; }
}

/* ---------- Scan view ---------- */
.scan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}
.scan-main { display: grid; gap: 18px; min-width: 0; }
.scan-side { position: sticky; top: calc(var(--header-h) + 16px); }

.smoke-grid { display: grid; gap: 10px; }
.smoke-opts {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
}
.smoke-opts .check-line { min-height: 26px; }
.smoke-proxy-wrap { border: 0; margin-top: 4px; padding: 0; background: none; }
.smoke-proxy-wrap summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0;
}
.smoke-proxy-wrap[open] summary { margin-bottom: 8px; }
.smoke-proxy { margin-top: 8px; }
.smoke-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: var(--surface-2);
}
.smoke-status { width: 12px; height: 12px; background: var(--line-strong); }
.smoke-status.pass { background: var(--green); }
.smoke-status.warn { background: var(--amber); }
.smoke-status.fail { background: var(--red); }
.smoke-title { font-weight: 650; font-size: 13.5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.03em; }
.smoke-detail { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.progress-count { font-weight: 700; font-size: 13px; color: var(--brand); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.progress-track { height: 14px; border: 1px solid var(--line-strong); background: var(--bg); overflow: hidden; margin-bottom: 18px; }
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  transition: width 300ms ease;
}
.progress-track.complete { border-color: var(--green); }
.progress-track.complete .progress-fill { background: var(--green); }

.complete-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--brand-line);
  background: var(--brand-tint);
  color: var(--ink);
  font-size: 13px;
}
.complete-banner[hidden] { display: none; }

.surface-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.chip:hover { border-color: var(--brand-line); color: var(--ink); }
.chip.active { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); }
.chip .chip-count { font-size: 11px; font-weight: 800; opacity: 0.75; font-family: var(--mono); }

.checklist { display: grid; gap: 14px; }
.check-group {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  overflow: hidden;
}
.check-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
}
.check-group-head h3 { font-size: 12.5px; letter-spacing: 0.08em; font-family: var(--mono); text-transform: uppercase; color: var(--ink-2); }
.group-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.group-progress { color: var(--muted); font-size: 12px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.group-toggle {
  border: 1px solid var(--line-strong);
  padding: 4px 10px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.group-toggle:hover { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); }
.check-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 150ms ease;
  cursor: pointer;
}
.check-item:last-child { border-bottom: 0; }
.check-item:hover { background: var(--surface-2); }
.check-item.done { background: var(--green-tint); }
.check-item.done:hover { background: rgba(79, 245, 66, 0.14); }
.check-box {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid var(--line-strong);
  background: var(--bg);
  cursor: pointer;
  flex: none;
  position: relative;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.check-box:hover { border-color: var(--brand-line); }
.check-box:checked {
  background-color: var(--brand);
  border-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23150604' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}
body.booted .check-box:checked { animation: check-pop 220ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes check-pop {
  0% { transform: scale(1); }
  40% { transform: scale(0.82); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.check-item.done .check-box:checked { background-color: var(--green); border-color: var(--green); }
.check-body { min-width: 0; }
.check-label { font-size: 14px; line-height: 1.45; cursor: pointer; display: block; }
.check-hint { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; line-height: 1.5; display: none; }
.check-hint.show { display: block; }

.check-item.done .check-label { color: var(--muted); }

.hint-toggle {
  border: 0;
  padding: 0;
  margin-top: 2px;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.hint-toggle:hover { color: var(--brand); }

.check-actions { display: flex; gap: 6px; align-items: center; }
.log-finding {
  border: 1px solid var(--line-strong);
  padding: 5px 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.log-finding:hover { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); }

@media (hover: hover) {
  .check-actions { opacity: 0; transition: opacity 140ms ease; }
  .check-item:hover .check-actions,
  .check-item:focus-within .check-actions,
  .check-actions:focus-within { opacity: 1; }
  .check-item:hover .check-hint,
  .check-item:focus-within .check-hint { display: block; }
}

.findings-panel { min-height: 300px; display: flex; flex-direction: column; }
.scan-side .finding-list { max-height: 420px; overflow: auto; }
.count-badge {
  min-width: 30px;
  height: 26px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
  color: var(--brand);
  font-weight: 800;
  font-size: 12.5px;
  font-family: var(--mono);
}
.finding-list { display: grid; gap: 9px; margin: 6px 0 14px; }
.finding-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  background: var(--surface);
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.finding-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.finding-card h3 { font-size: 13.5px; line-height: 1.4; margin-bottom: 8px; }
.finding-card h3 .fid { color: var(--muted); font-weight: 700; font-family: var(--mono); font-size: 12px; }
.finding-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--info);
  padding: 3px 7px;
  background: var(--info-tint);
  color: var(--info);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill.sev-critical { border-color: var(--red); background: var(--red-tint); color: var(--red); }
.pill.sev-high { border-color: var(--high); background: var(--high-tint); color: var(--high); }
.pill.sev-medium { border-color: var(--amber); background: var(--amber-tint); color: var(--amber); }
.pill.sev-low { border-color: var(--green); background: var(--green-tint); color: var(--green); }
.pill.sev-informational { border-color: var(--info); background: var(--info-tint); color: var(--info); }

.sev-critical { border-left-color: var(--red) !important; }
.sev-high { border-left-color: var(--high) !important; }
.sev-medium { border-left-color: var(--amber) !important; }
.sev-low { border-left-color: var(--green) !important; }
.sev-informational { border-left-color: var(--info) !important; }

.empty-state {
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  padding: 28px 22px;
  text-align: center;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.empty-state .empty-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--brand-line);
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
  margin-bottom: 2px;
}
.empty-state h3 { font-size: 15px; text-transform: uppercase; }
.empty-state p { color: var(--muted); font-size: 13px; max-width: 42ch; line-height: 1.5; }
.empty-state .empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.empty-actions .link-button { font-size: 12.5px; }

/* ---------- Report view ---------- */
.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.report-main { display: grid; gap: 18px; min-width: 0; }
.report-side { display: grid; gap: 18px; position: sticky; top: calc(var(--header-h) + 16px); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stat-card {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 16px;
}
.stat-card .stat-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.stat-card .stat-label { color: var(--muted); font-size: 12px; font-weight: 650; margin-top: 4px; letter-spacing: 0.03em; font-family: var(--mono); text-transform: uppercase; }

.risk-box { display: grid; gap: 3px; justify-items: end; }
.risk-label { color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--mono); }
.risk-score {
  min-width: 54px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--amber-tint);
  border: 1px solid var(--amber);
  color: var(--amber);
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  transition: background 200ms ease, color 200ms ease;
}

.chart-wrap {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 10px;
}
#riskCanvas { display: block; width: 100%; height: 170px; }

.report-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.report-output {
  min-height: 420px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  background: var(--bg);
}
#copyStatus { margin: 0 0 10px; color: var(--green); font-size: 13px; min-height: 0; }
.compile-note { color: var(--muted); font-size: 12.5px; }

.severity-legend { display: grid; gap: 10px; }
.legend-item { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: start; font-size: 13px; }
.legend-item .dot { width: 12px; height: 12px; margin-top: 3px; border: 1px solid currentColor; }
.legend-item strong { display: block; font-size: 13px; font-family: var(--mono); text-transform: uppercase; }
.legend-item p { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 2px; }

.delivery-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.delivery-list li { display: flex; gap: 9px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.delivery-list li::before {
  content: "+";
  color: var(--brand);
  font-weight: 800;
  flex: none;
}

/* ---------- Dialog ---------- */
.finding-dialog {
  width: min(680px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 48px);
  overflow: auto;
}
.finding-dialog::backdrop { background: rgba(5, 5, 5, 0.78); }
.finding-dialog[open] { animation: dialog-in 180ms ease both; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-strong);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.dialog-head h2 { font-size: 19px; letter-spacing: -0.01em; text-transform: uppercase; font-weight: 800; }
.dialog-body { padding: 20px 22px; }
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-strong);
  position: sticky;
  bottom: 0;
  background: var(--surface);
}
.dialog-spacer { flex: 1; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-wide { grid-column: 1 / -1; }

.ai-settings {
  border: 1px solid var(--line);
  padding: 12px 14px;
  margin-top: 4px;
  background: var(--bg);
}
.ai-settings summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink-2); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.03em; }
.ai-settings[open] summary { margin-bottom: 10px; }
.ai-settings .reference-copy { font-size: 12.5px; }
.ai-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--info);
  background: var(--info-tint);
  color: var(--info);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--mono);
}
.dialog-status { color: var(--muted); font-size: 13px; }

/* evidence attachments */
.evidence-attach {
  border: 1px dashed var(--line-strong);
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--bg);
}
.evidence-attach-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.attach-label { color: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.attach-label em { color: var(--muted); font-weight: 500; font-style: normal; }
.evidence-previews { display: grid; gap: 8px; margin-top: 12px; }
.evidence-empty { margin: 0; font-size: 12px; }
.evidence-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: var(--surface);
}
.evidence-thumb {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}
.evidence-filetype {
  width: 52px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--brand);
}
.evidence-meta { display: grid; gap: 2px; min-width: 0; }
.evidence-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-size { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.evidence-remove { width: 30px; height: 30px; font-size: 16px; }

.custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  background: var(--surface-2);
}
.custom-row h3 { font-size: 14.5px; text-transform: uppercase; }
.custom-row p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.custom-row-actions { display: flex; gap: 8px; flex: none; }
.chip.chip-custom { border-style: dashed; }

/* ---------- Legal pages ---------- */
.mono { font-family: var(--mono); }
.legal-layout { display: grid; gap: 14px; max-width: 860px; }
.legal-block h2 { font-size: 17px; text-transform: uppercase; letter-spacing: 0.02em; font-weight: 700; margin-bottom: 8px; }
.legal-block p { color: var(--ink-2); font-size: 14px; line-height: 1.65; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 28px 40px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line-strong);
  margin-top: 12px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.footer-col { display: grid; gap: 8px; align-content: start; }
.footer-brand { font-size: 18px; font-weight: 800; color: var(--ink); text-transform: uppercase; letter-spacing: -0.01em; }
.footer-tag { color: var(--muted); font-size: 12.5px; line-height: 1.6; max-width: 30ch; }
.footer-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 2px;
}
.footer-label::before { content: "[ "; color: var(--brand); }
.footer-label::after { content: " ]"; color: var(--brand); }
.footer-link {
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: none;
  width: fit-content;
  transition: color 140ms ease;
}
.footer-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 22px;
}
.built-by {
  font-weight: 650;
  color: var(--ink-2);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}
.built-by::before {
  content: "+";
  display: inline-block;
  margin-right: 8px;
  color: var(--brand);
  font-weight: 800;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--brand);
  background: var(--surface-3);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 500;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Persona switching ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  body .reveal, body .mini-line, .prompt-text { opacity: 1 !important; transform: none !important; }
}

html.no-transition *,
html.no-transition *::before,
html.no-transition *::after { transition: none !important; }

/* ---------- Light theme (brutalist Swiss-print variant) ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-2: #ece9e2;
  --surface-3: #e2ded5;
  --ink: #171310;
  --ink-2: #4a453d;
  --muted: #6a645b;
  --line: #d8d4cb;
  --line-strong: #b3ada1;
  --brand: #c81010;
  --brand-strong: #a50a0a;
  --brand-deep: #ffffff;
  --brand-tint: rgba(200, 16, 16, 0.08);
  --brand-line: rgba(200, 16, 16, 0.45);
  --red: #b30000;
  --red-tint: rgba(179, 0, 0, 0.09);
  --high: #cc3600;
  --high-tint: rgba(204, 54, 0, 0.09);
  --amber: #8a5a00;
  --amber-tint: rgba(138, 90, 0, 0.1);
  --green: #157347;
  --green-tint: rgba(21, 115, 71, 0.09);
  --info: #55636c;
  --info-tint: rgba(85, 99, 108, 0.1);
  --shadow-md: 3px 3px 0 rgba(0, 0, 0, 0.85);
  --shadow-lg: 6px 6px 0 rgba(0, 0, 0, 0.8);
}
html[data-theme="light"] body {
  background:
    radial-gradient(1100px 520px at 14% -10%, rgba(200, 16, 16, 0.05), transparent 62%),
    radial-gradient(900px 440px at 96% 0%, rgba(204, 54, 0, 0.04), transparent 55%),
    var(--bg);
}
html[data-theme="light"] body::after { opacity: 0.08; }
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #a39d92; }
html[data-theme="light"] .check-box:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
html[data-theme="light"] .privacy-dot,
html[data-theme="light"] .boot-caret { box-shadow: none; }

/* scroll-triggered section reveals */
.reveal-on-scroll { opacity: 0; transform: translateY(18px); }
.reveal-on-scroll.in-view { opacity: 1; transform: none; transition: opacity 600ms ease, transform 600ms ease; }

/* ---------- Print ---------- */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .site-header, .site-footer, .main-nav, .header-actions, .toast,
  .scan-side, .report-side, .step-bar, .report-actions, .view-head,
  .panel-header, .skip-link, .boot { display: none !important; }
  .view { padding: 0 !important; }
  .report-layout { display: block !important; }
  .report-main { display: block !important; }
  .report-main .panel { border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 0 18px !important; }
  .report-output { white-space: pre-wrap !important; min-height: 0 !important; border: 0 !important; background: #fff !important; color: #000 !important; font-size: 11px !important; }
  .stats-grid, .chart-wrap { display: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .surface-grid, .rubric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-card { border-left: 0; border-top: 1px solid var(--line-strong); }
  .how-card:nth-child(-n+2) { border-top: 0; }
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-panel { max-width: 600px; }
  .scan-layout, .report-layout { grid-template-columns: 1fr; }
  .scan-side, .report-side { position: static; }
  .main-nav { margin-inline: auto; }
}

@media (max-width: 900px) {
  .surface-grid, .rubric-grid, .rules-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 1fr; }
  .header-inner { gap: 12px; }
  .brand-text small { display: none; }
  .privacy-chip { display: none; }
}

@media (max-width: 340px) {
  .shell { padding-inline: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text strong { font-size: 15px; }
  .header-actions { gap: 6px; }
  .header-actions .button { padding-inline: 8px; font-size: 11.5px; }
  .nav-step { width: 16px; height: 16px; font-size: 9.5px; }
  .nav-item { font-size: 10.5px; padding-inline: 3px; gap: 5px; }
}

@media (max-width: 720px) {
  .shell { padding-inline: max(16px, env(safe-area-inset-left)); }
  .view { padding: 16px 0 32px; }

  /* Mobile keeps the landing message, then reveals the workspace on demand. */
  #view-home { display: flex; flex-direction: column; }
  .hero { order: 1; display: block; padding: 26px 0 18px; }
  .hero-copy h1 { font-size: clamp(36px, 11vw, 52px); line-height: 0.96; margin: 0 0 16px; }
  .hero-lead { display: block; font-size: 14px; line-height: 1.55; margin-bottom: 18px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
  .hero-actions .button { width: 100%; min-height: 48px; padding-inline: 8px; }
  .hero-actions #heroStart { grid-column: 1 / -1; }
  .hero-actions #heroFrameworks { display: none; }
  .trust-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding-top: 12px; font-size: 10px; line-height: 1.35; }
  .hero-panel, .section-block, .how-block, #loadSample { display: none !important; }

  .mobile-home { order: 2; display: grid; gap: 10px; margin-bottom: 0; }
  .mobile-home > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
  .mobile-home > summary:focus-visible { outline-offset: 3px; }
  .mobile-info { order: 3; display: block; margin-top: 10px; }
  .mobile-info > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
  .mobile-info > summary:focus-visible { outline-offset: 3px; }

  /* The mobile header has a real two-row height so content never starts underneath it. */
  .site-header { position: sticky; height: auto; }
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    height: auto;
    padding-block: 8px 10px;
  }
  .brand { gap: 9px; min-width: 0; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-text strong { font-size: 16px; }
  .header-actions { grid-column: 2; grid-row: 1; width: auto; margin-left: 0; flex-wrap: nowrap; gap: 6px; }
  .header-actions .button { flex: 0 0 auto; min-height: 38px; padding-inline: 8px; font-size: 11px; }
  .github-link { display: none; }
  .label-long { display: none; }
  .label-short { display: inline; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; overflow: hidden; margin: 0; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-step { display: none; }
  .nav-item { flex: 1 1 25%; justify-content: center; gap: 0; min-height: 40px; padding: 8px 3px; font-size: 11px; white-space: nowrap; }

  .mh-status { padding: 14px; gap: 8px; }
  .mh-status h2 { font-size: 18px; }
  .mh-status > .button { display: none; }
  .mh-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mh-actions .button { min-height: 48px; padding-inline: 10px; }
  .mh-actions .mh-full { grid-column: 1 / -1; }
  .mobile-home > .panel { padding: 14px; }
  .mobile-home .panel-header { margin-bottom: 12px; }
  .mobile-home .surface-chips { gap: 6px; margin-bottom: 12px; }
  .mobile-home .chip { flex: 1 1 calc(50% - 6px); min-height: 40px; padding: 6px 8px; font-size: 10.5px; }
  .mobile-home .chip-count { font-size: 10px; }
  .surface-grid, .rubric-grid, .rules-grid, .stats-grid, .how-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .check-item { grid-template-columns: auto 1fr; }
  .check-actions { grid-column: 2; }
  .smoke-card { grid-template-columns: auto 1fr; }
  .step-actions .button { width: 100%; }
  .button, .segment, .chip { min-height: 44px; }
  /* The compact links above replace the long desktop footer on mobile. */
  .site-footer { display: none; }
  .mh-links { padding: 2px 2px 0; }
}
