:root {
  --ink: #18231f;
  --ink-soft: #38453f;
  --muted: #68746f;
  --paper: #f5f3ec;
  --paper-2: #ece9df;
  --surface: rgba(251, 250, 246, .88);
  --surface-solid: #fbfaf6;
  --deep: #0d3127;
  --deep-2: #16483a;
  --deep-3: #08231c;
  --accent: #c8a349;
  --accent-soft: #eadcae;
  --danger: #a3332b;
  --danger-soft: #f0dfdb;
  --success: #4f8a67;
  --line: rgba(24, 35, 31, .14);
  --line-strong: rgba(24, 35, 31, .25);
  --shadow-sm: 0 8px 24px rgba(16, 31, 25, .08);
  --shadow: 0 24px 70px rgba(15, 30, 24, .14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", Times, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  background:
    radial-gradient(circle at 14% -10%, rgba(255,255,255,.95), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(200,163,73,.07), transparent 26%),
    linear-gradient(180deg, #dedbd0 0%, var(--paper) 28%, #ebe8df 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); color: var(--deep); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, label:has(input:focus-visible) {
  outline: 3px solid rgba(200,163,73,.48);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .065;
  z-index: 99;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* Masthead */
.agency-bar {
  position: relative;
  z-index: 10;
  color: #f7f3e9;
  background: linear-gradient(180deg, #10382d 0%, var(--deep) 100%);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 10px 30px rgba(8,35,28,.14);
}
.agency-wrap {
  width: min(1180px, calc(100% - 40px));
  min-height: 84px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 15px;
}
.seal {
  width: 54px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: .82;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--deep), inset 0 0 0 5px rgba(200,163,73,.62);
}
.seal span { display: block; font-family: var(--serif); font-weight: 800; font-size: 20px; }
.seal small { display: block; margin-top: 3px; font: 700 8px/1 var(--mono); letter-spacing: .18em; }
.agency-kicker { font: 800 12px/1.2 var(--mono); letter-spacing: .14em; }
.agency-sub { margin-top: 5px; opacity: .65; font-size: 11px; }
.status-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  font: 800 9px/1 var(--mono);
  letter-spacing: .09em;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6bd692;
  box-shadow: 0 0 12px rgba(107,214,146,.8);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: clamp(28px, 4vw, 48px) auto 72px;
}
.panel { display: none; animation: panelIn .38s cubic-bezier(.2,.75,.2,1) both; }
.panel.active { display: block; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Global type */
.eyebrow,
.question-number,
.case-id,
.progress-card span,
.action-stamp,
.share-feedback,
.report-preview-note {
  font-family: var(--mono);
}
.eyebrow {
  margin-bottom: 15px;
  color: var(--danger);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; }
h1, h2, h3, .question-title, .score-number, .score-label { font-family: var(--serif); }
h1 {
  max-width: 970px;
  margin-bottom: 24px;
  font-size: clamp(46px, 7vw, 88px);
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.045em;
}
h1 em { color: var(--danger); font-style: normal; }
h2 {
  margin-bottom: 15px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.035em;
}
h3 { font-size: 23px; line-height: 1.1; }
.lede {
  max-width: 880px;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.62;
}

/* Buttons */
.primary-btn,
.ghost-btn {
  min-height: 50px;
  border-radius: 8px;
  cursor: pointer;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, opacity .16s ease;
  touch-action: manipulation;
}
.primary-btn {
  border: 1px solid rgba(0,0,0,.16);
  color: #fff;
  background: linear-gradient(180deg, #16483a 0%, var(--deep) 100%);
  box-shadow: 0 5px 0 var(--deep-3), 0 10px 24px rgba(13,49,39,.17);
}
.primary-btn:hover { background: linear-gradient(180deg, #1a5242 0%, #123c30 100%); transform: translateY(-1px); }
.primary-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--deep-3), 0 5px 14px rgba(13,49,39,.13); }
.primary-btn.is-disabled { opacity: .48; filter: saturate(.6); }
.ghost-btn {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(255,255,255,.38);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}
.ghost-btn:hover { border-color: rgba(13,49,39,.36); background: rgba(255,255,255,.7); }

/* Landing */
.hero-panel,
.result-panel,
#quizForm {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5.3vw, 66px);
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--deep), var(--accent) 54%, var(--danger));
  opacity: .86;
}
.hero-panel::after {
  content: "FOR PUBLIC USE";
  position: absolute;
  right: -48px;
  top: 54px;
  transform: rotate(32deg);
  padding: 11px 68px;
  border: 2px solid rgba(163,51,43,.14);
  color: rgba(163,51,43,.14);
  font: 800 13px/1 var(--serif);
  letter-spacing: .2em;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr);
  gap: clamp(28px, 4vw, 44px);
  margin-top: 38px;
  align-items: start;
}
.notice-box {
  margin-bottom: 22px;
  padding: 17px 18px;
  border: 1px solid rgba(200,163,73,.24);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(200,163,73,.08);
  color: #46514c;
  font-size: 12px;
  line-height: 1.6;
}
.notice-box strong { color: var(--ink); }
.microcopy { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.system-card {
  align-self: start;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  color: #e8eee9;
  background:
    radial-gradient(circle at 100% 0, rgba(200,163,73,.13), transparent 42%),
    linear-gradient(150deg, #143f33 0%, #0b2a22 100%);
  box-shadow: var(--shadow-sm);
}
.system-card::before {
  content: "MODEL STATUS";
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,.48);
  font: 800 8px/1 var(--mono);
  letter-spacing: .16em;
}
.system-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
}
.system-row b { color: #77d898; font: 900 9px/1 var(--mono); letter-spacing: .1em; }
.system-row b.warn { color: #eacb70; }
.system-meter { height: 6px; margin: 18px 0 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.system-meter i { display: block; width: 78%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #e1c971); }
.system-card small { color: rgba(255,255,255,.52); font: 500 9px/1.4 var(--mono); }

/* Questionnaire */
.screening-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 26px;
  align-items: end;
  margin-bottom: 22px;
}
.screening-head p { max-width: 720px; margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.progress-card {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.48);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}
.progress-card span { font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.progress-track { height: 6px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgba(13,49,39,.10); }
#progressBar { height: 100%; width: 8%; border-radius: inherit; background: linear-gradient(90deg, var(--deep), var(--deep-2)); transition: width .28s cubic-bezier(.2,.8,.2,1); }
#quizForm { padding: clamp(26px, 5vw, 54px); }
#questionHost { min-height: 470px; }
.question-shell { animation: questionIn .28s cubic-bezier(.2,.75,.2,1) both; }
@keyframes questionIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.question-number { color: var(--danger); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.question-title {
  max-width: 900px;
  margin: 10px 0 12px;
  font-size: clamp(29px, 4vw, 45px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.question-help { max-width: 820px; margin-bottom: 28px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.options { display: grid; gap: 10px; }
.option {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 14px 16px;
  cursor: pointer;
  border: 1px solid rgba(24,35,31,.15);
  border-radius: 11px;
  background: rgba(255,255,255,.42);
  box-shadow: 0 1px 0 rgba(255,255,255,.72) inset;
  transition: transform .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { transform: translateY(-1px); border-color: rgba(13,49,39,.38); background: rgba(255,255,255,.75); box-shadow: var(--shadow-sm); }
.option.selected {
  border-color: rgba(13,49,39,.72);
  background: rgba(13,49,39,.065);
  box-shadow: inset 4px 0 0 var(--deep), 0 8px 26px rgba(13,49,39,.08);
}
.option input { width: 18px; height: 18px; margin: 0; accent-color: var(--deep); }
.option strong { min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.35; }
.option small { color: var(--muted); font: 500 9px/1.35 var(--mono); text-align: right; }
.quiz-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }

/* Scan theater */
.scan-panel { max-width: 960px; margin: min(8vh, 74px) auto; }
.scan-sub { color: var(--muted); }
.terminal-wrap {
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid #17382e;
  border-radius: var(--radius);
  color: #bbdccb;
  background: #08130f;
  box-shadow: 0 28px 80px rgba(0,0,0,.24);
}
.terminal-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border-bottom: 1px solid #17372c;
  color: #78988a;
  font: 700 9px/1.2 var(--mono);
  letter-spacing: .1em;
}
.scan-progress { height: 4px; background: #10221b; }
#scanBar { height: 100%; width: 0; background: linear-gradient(90deg, #55ba7c, #78dea0); transition: width .24s linear; }
.terminal { min-height: 350px; max-height: 420px; overflow: hidden; padding: 21px; font: 500 12px/1.75 var(--mono); }
.terminal-line { opacity: 0; animation: typeIn .18s ease forwards; }
.terminal-line.ok::before { content: "[OK] "; color: #65d68e; }
.terminal-line.warn::before { content: "[FLAG] "; color: #eacb70; }
.terminal-line.bad::before { content: "[ALERT] "; color: #ff7c6e; }
@keyframes typeIn { to { opacity: 1; } }

/* Result */
.result-panel { padding: clamp(26px, 5vw, 56px); }
.result-topline { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.case-id { color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .75fr); gap: 30px; }
.score-wrap { display: flex; gap: 26px; align-items: center; margin: 10px 0 26px; }
.score-number { color: var(--danger); font-size: clamp(78px, 12vw, 142px); font-weight: 800; line-height: .78; letter-spacing: -.07em; }
.score-label { font-size: clamp(27px, 4vw, 46px); font-weight: 900; line-height: .92; letter-spacing: -.025em; }
.score-summary { max-width: 520px; margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.gauge { position: relative; height: 14px; overflow: visible; border-radius: 999px; background: linear-gradient(90deg, #52826a 0%, #cfb651 50%, #a3332b 100%); box-shadow: inset 0 1px 2px rgba(0,0,0,.15); }
#gaugeFill { position: absolute; top: -6px; left: 50%; width: 4px; height: 26px; border-radius: 2px; background: #0b1511; box-shadow: 0 0 0 3px var(--paper); }
.gauge-labels { display: flex; justify-content: space-between; gap: 8px; margin: 9px 0 30px; color: var(--muted); font: 700 7px/1.2 var(--mono); letter-spacing: .03em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip { padding: 8px 10px; border: 1px solid rgba(163,51,43,.22); border-radius: 999px; color: #79231d; background: rgba(163,51,43,.07); font: 800 9px/1 var(--mono); }
.chip.good { border-color: rgba(13,49,39,.20); color: var(--deep); background: rgba(13,49,39,.055); }
.finding-box { padding: 17px 18px; border: 1px solid rgba(163,51,43,.14); border-left: 4px solid var(--danger); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: rgba(163,51,43,.055); font-size: 12px; line-height: 1.6; }
.action-card {
  position: relative;
  align-self: start;
  overflow: hidden;
  padding: 25px;
  border-radius: var(--radius);
  color: #edf2ee;
  background:
    radial-gradient(circle at 100% 100%, rgba(200,163,73,.12), transparent 38%),
    linear-gradient(155deg, #144438 0%, #0b2c23 100%);
  box-shadow: var(--shadow-sm);
}
.action-card::after { content: "USEFUL"; position: absolute; right: -25px; bottom: 12px; font: 800 66px/1 var(--serif); opacity: .035; transform: rotate(-14deg); }
.action-stamp { display: inline-block; margin-bottom: 18px; padding: 5px 7px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font-size: 8px; letter-spacing: .12em; }
.action-card h3 { margin-bottom: 15px; }
.action-card ul { margin: 0; padding-left: 18px; font-size: 11px; line-height: 1.55; }
.action-card li { margin-bottom: 9px; }
.not-proof { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.13); color: #a8b8b0; font-size: 9px; line-height: 1.55; }

.report-card-section {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 28px;
  align-items: start;
  margin-top: 38px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.report-card-copy p { max-width: 480px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.report-preview-wrap { overflow: hidden; padding: 10px; border-radius: var(--radius); background: var(--deep); box-shadow: 0 20px 60px rgba(11,21,17,.18); }
.report-preview-wrap img { display: block; width: 100%; height: auto; border-radius: 7px; background: #eee9dd; }
.report-preview-note { padding: 9px 2px 1px; color: rgba(255,255,255,.62); font-size: 8px; line-height: 1.45; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.share-feedback { min-height: 18px; margin-top: 12px; color: var(--muted); font-size: 9px; letter-spacing: .02em; }

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 44px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid var(--line);
  color: #4c5954;
  font-size: 11px;
}
.footer-legal { max-width: 650px; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: right; }

/* Tablet */
@media (max-width: 900px) {
  .hero-grid, .screening-head, .result-grid, .report-card-section { grid-template-columns: 1fr; }
  .system-card { max-width: 620px; }
  .progress-card { width: 100%; }
  #questionHost { min-height: 0; }
  .result-grid { gap: 28px; }
  .action-card { max-width: none; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --radius-lg: 18px; --radius: 14px; }
  body { background: linear-gradient(180deg, #e3e0d6 0%, #f3f1ea 24%, #ece9e0 100%); }
  .noise { opacity: .04; }
  .agency-wrap {
    width: calc(100% - 28px);
    min-height: 68px;
    gap: 11px;
  }
  .seal { width: 44px; height: 44px; }
  .seal span { font-size: 17px; }
  .seal small { font-size: 7px; }
  .agency-kicker { font-size: 9px; letter-spacing: .11em; }
  .agency-sub, .status-pill { display: none; }

  main {
    width: calc(100% - 24px);
    margin: 18px auto 42px;
  }
  .hero-panel,
  .result-panel,
  #quizForm { border-radius: var(--radius-lg); box-shadow: 0 16px 44px rgba(15,30,24,.12); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .hero-panel { padding: 28px 20px 22px; }
  .hero-panel::after { display: none; }
  .eyebrow { margin-bottom: 12px; font-size: 9px; }
  h1 { margin-bottom: 18px; font-size: clamp(42px, 14.3vw, 64px); line-height: .89; }
  h2 { font-size: clamp(34px, 10vw, 46px); }
  h3 { font-size: 21px; }
  .lede { font-size: 15px; line-height: 1.55; }
  .hero-grid { gap: 22px; margin-top: 26px; }
  .notice-box { padding: 14px 14px; font-size: 11px; }
  .hero-copy .primary-btn { width: 100%; }
  .microcopy { text-align: center; }
  .system-card { padding: 18px; }
  .system-row { padding: 9px 0; font-size: 10px; }

  .screening-head { gap: 16px; margin-bottom: 16px; }
  .screening-head p { font-size: 13px; }
  .progress-card { padding: 12px 14px; }
  #quizForm { padding: 22px 16px 16px; }
  .question-title { font-size: clamp(30px, 9.5vw, 40px); }
  .question-help { margin-bottom: 22px; font-size: 11px; }
  .options { gap: 9px; }
  .option {
    grid-template-columns: 22px minmax(0, 1fr);
    min-height: 64px;
    padding: 13px 13px;
    border-radius: 10px;
  }
  .option:hover { transform: none; box-shadow: 0 1px 0 rgba(255,255,255,.72) inset; }
  .option.selected { box-shadow: inset 4px 0 0 var(--deep); }
  .option strong { font-size: 13px; line-height: 1.28; }
  .option small { grid-column: 2; margin-top: -5px; font-size: 8px; line-height: 1.3; text-align: left; }
  .option input { width: 18px; height: 18px; }
  .quiz-nav {
    position: sticky;
    z-index: 4;
    bottom: 0;
    margin: 22px -16px -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: rgba(248,247,242,.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -12px 30px rgba(20,36,30,.07);
  }
  .quiz-nav .ghost-btn { flex: 0 0 34%; }
  .quiz-nav .primary-btn { flex: 1; }
  .primary-btn, .ghost-btn { min-height: 52px; font-size: 10px; }

  .scan-panel { margin: 32px auto; }
  .terminal-wrap { border-radius: 12px; }
  .terminal-top { padding: 11px 12px; font-size: 8px; }
  .terminal { min-height: 330px; max-height: 58dvh; padding: 15px; font-size: 10px; line-height: 1.7; }

  .result-panel { padding: 22px 18px; }
  .result-topline { align-items: flex-start; flex-direction: column; gap: 0; }
  .result-grid { gap: 24px; }
  .score-wrap { align-items: flex-start; flex-direction: column; gap: 12px; margin: 8px 0 24px; }
  .score-number { font-size: clamp(88px, 29vw, 118px); }
  .score-label { font-size: clamp(29px, 9vw, 40px); }
  .score-summary { font-size: 12px; }
  .gauge { height: 12px; }
  #gaugeFill { top: -5px; height: 22px; }
  .gauge-labels span:nth-child(2) { display: none; }
  .gauge-labels { font-size: 6px; }
  .chips { gap: 7px; }
  .chip { padding: 7px 9px; font-size: 8px; }
  .finding-box { font-size: 11px; }
  .action-card { padding: 21px 19px; }
  .action-card ul { font-size: 11px; }
  .report-card-section { gap: 16px; margin-top: 30px; padding-top: 26px; }
  .report-preview-wrap { margin: 0 -2px; padding: 7px; border-radius: 12px; }
  .result-actions { flex-direction: column; gap: 9px; }
  .result-actions button { width: 100%; }

  footer {
    width: calc(100% - 28px);
    margin-bottom: calc(26px + env(safe-area-inset-bottom));
    flex-direction: column;
    gap: 10px;
    font-size: 10px;
  }
  .footer-legal { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

button:disabled { cursor: not-allowed; }

.photo-panel h2 { max-width: 720px; }
.photo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: clamp(24px, 4vw, 42px);
  margin-top: 32px;
  align-items: start;
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.photo-preview-card,
.photo-scan-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.58);
  box-shadow: var(--shadow-sm);
}
.photo-preview-head,
.photo-scan-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font: 800 9px/1.2 var(--mono);
  letter-spacing: .09em;
  color: var(--muted);
}
.photo-preview-frame,
.photo-scan-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(13,49,39,.95) 0%, rgba(8,35,28,.98) 100%);
}
.photo-preview-frame.has-photo,
.photo-scan-frame:has(img:not([hidden])) {
  background: #0e2721;
}
.photo-preview-frame img,
.photo-scan-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  text-align: center;
  gap: 10px;
  color: rgba(255,255,255,.88);
}
.photo-preview-placeholder strong {
  font: 900 13px/1.2 var(--mono);
  letter-spacing: .12em;
}
.photo-preview-placeholder span {
  max-width: 300px;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  line-height: 1.55;
}
.photo-meta,
.photo-scan-note {
  padding: 14px 16px 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.photo-scan-grid {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(0, 1.05fr);
  gap: 24px;
  align-items: start;
  margin-top: 26px;
}
.photo-scan-panel { max-width: 1120px; }
.photo-scan-card { background: rgba(255,255,255,.48); }
.photo-scan-frame {
  min-height: 320px;
  background:
    radial-gradient(circle at 50% 0%, rgba(200,163,73,.12), transparent 28%),
    linear-gradient(145deg, rgba(13,49,39,.98) 0%, rgba(8,35,28,.98) 100%);
}
.photo-scan-placeholder { align-content: center; }
.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 0 82%, rgba(103,214,146,.08) 82% 100%),
    repeating-linear-gradient(180deg, rgba(255,255,255,0) 0 20px, rgba(103,214,146,.035) 20px 21px);
}
.scan-overlay span {
  position: absolute;
  inset: -30% 8% auto;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(103,214,146,.15) 10%, rgba(103,214,146,.95) 50%, rgba(103,214,146,.15) 90%, transparent 100%);
  box-shadow: 0 0 20px rgba(103,214,146,.5);
  animation: scanSweep 2.2s linear infinite;
}
@keyframes scanSweep {
  from { transform: translateY(0); }
  to { transform: translateY(380px); }
}
.scan-corners,
.scan-corners::before,
.scan-corners::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: '';
}
.scan-corners::before,
.scan-corners::after {
  inset: 18px;
  border: 1px solid rgba(103,214,146,.38);
}
.scan-corners {
  border: 1px solid rgba(103,214,146,.18);
}

@media (max-width: 900px) {
  .photo-grid,
  .photo-scan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .photo-grid { gap: 18px; margin-top: 22px; }
  .photo-actions { flex-direction: column; }
  .photo-actions button { width: 100%; }
  .photo-preview-head,
  .photo-scan-head,
  .photo-meta,
  .photo-scan-note { padding-left: 14px; padding-right: 14px; }
  .photo-preview-placeholder strong { font-size: 11px; }
  .photo-preview-placeholder span { font-size: 11px; }
  .photo-scan-frame { min-height: 250px; }
  @keyframes scanSweep {
    from { transform: translateY(0); }
    to { transform: translateY(300px); }
  }
}
