/* Free preview scan panel (#start). Matches the v4 look: cream, teal, amber, Familjen Grotesk + Onest.
   Self-contained so it doesn't depend on .appshot scoping in app-ui.css. */
.pv {
  --pv-code-bg: #10151F; --pv-code-ink: #E3E7EE; --pv-code-dim: #8D97AA;
  --pv-high: #C0281C; --pv-medium: #B5560B; --pv-low: #2A62B0; --pv-info: #5B6475; --pv-pass: #157A3E;
  --pv-line: rgba(18, 24, 38, 0.12);
  margin-top: var(--s4, 32px); max-width: 640px; min-width: 0;
  font-family: var(--body, "Onest", sans-serif); color: var(--ink, #121826);
}
.pv[hidden] { display: none; }
.pv *, .pv *::before, .pv *::after { box-sizing: border-box; }

/* terminal */
.pv-term { background: var(--pv-code-bg); color: var(--pv-code-ink); border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(18, 24, 38, 0.14); }
.pv-term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.pv-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3A4357; }
.pv-term-bar i:nth-child(1) { background: #E0892B; }
.pv-term-bar span { margin-left: 8px; font-size: 13px; color: var(--pv-code-dim); overflow-wrap: anywhere; }
.pv-steps { list-style: none; margin: 0; padding: 14px 16px 16px; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pv-steps li { display: flex; gap: 10px; align-items: baseline; animation: pv-in 0.25s ease-out both; overflow-wrap: anywhere; }
.pv-steps li::before { content: "›"; color: var(--amber, #E0892B); flex: none; }
.pv-steps li.done::before { content: "✓"; color: #4CC38A; }
.pv-steps li.fail::before { content: "×"; color: #F07167; }
.pv-steps li.run::after { content: ""; width: 0.6em; height: 1em; background: var(--pv-code-ink); opacity: 0.7; animation: pv-blink 1s steps(1) infinite; align-self: center; flex: none; }
@keyframes pv-in { from { opacity: 0; transform: translateY(3px); } }
@keyframes pv-blink { 50% { opacity: 0; } }

/* report */
.pv-report { margin-top: var(--s3, 24px); background: var(--white, #fff); border: 1px solid var(--pv-line); border-radius: var(--radius, 16px);
  padding: var(--s3, 24px); box-shadow: var(--shadow, 0 20px 60px rgba(18, 24, 38, 0.08)); }
.pv-report, .pv-error { scroll-margin-top: 96px; }
.pv-report:focus { outline: none; }
.pv-report:focus-visible { outline: 3px solid var(--teal, #0E7C86); outline-offset: 3px; }
.pv-head { display: flex; gap: var(--s3, 24px); align-items: center; }
.pv-grade { flex: none; width: 84px; height: 84px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  font: 700 46px/1 var(--display, "Familjen Grotesk", sans-serif); background: var(--g, var(--pv-info)); }
.pv-grade.g-A { --g: var(--pv-pass); } .pv-grade.g-B { --g: var(--teal, #0E7C86); } .pv-grade.g-C { --g: var(--pv-medium); }
.pv-grade.g-D { --g: var(--pv-high); } .pv-grade.g-F { --g: #8E1F7E; }
.pv-head h3 { font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.pv-meta { margin: 6px 0 0; color: rgba(18, 24, 38, 0.72); font-size: 15px; overflow-wrap: anywhere; }
.pv-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s2, 16px) 0 0; padding: 0; list-style: none; }

.pv-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 7px; font-size: 13px; font-weight: 600;
  white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 11%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 24%, transparent); }
.pv-chip::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.sev-high { --c: var(--pv-high); } .sev-medium { --c: var(--pv-medium); } .sev-low { --c: var(--pv-low); }
.sev-info { --c: var(--pv-info); } .sev-pass { --c: var(--pv-pass); }

.pv-group { margin-top: var(--s3, 24px); }
.pv-group h4 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(18, 24, 38, 0.7); margin-bottom: 8px; }
.pv-f { border: 1px solid var(--pv-line); border-left: 4px solid var(--c); border-radius: 10px; margin-top: 8px; background: #fff; }
.pv-f summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; min-height: 48px; }
.pv-f summary::-webkit-details-marker { display: none; }
.pv-f summary::after { content: "+"; font: 600 20px/1 var(--display, sans-serif); color: rgba(18, 24, 38, 0.5); }
.pv-f[open] summary::after { content: "−"; }
.pv-f summary:focus-visible { outline: 3px solid var(--teal, #0E7C86); outline-offset: 2px; border-radius: 8px; }
.pv-f-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pv-f-title small { display: block; font-weight: 400; font-size: 13px; color: rgba(18, 24, 38, 0.62); }
.pv-f-body { padding: 0 14px 14px; font-size: 15px; line-height: 1.55; }
.pv-f-body p { margin: 8px 0 0; overflow-wrap: anywhere; }
.pv-f-body b { font-weight: 600; }
.pv-f-body code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--sand, #F6EFE4); border-radius: 6px; padding: 1px 5px; }

.pv-cta { margin-top: var(--s4, 32px); padding: var(--s3, 24px); border-radius: var(--radius, 16px); background: var(--ink, #121826); color: #fff; }
.pv-cta p { margin: 0 0 var(--s2, 16px); font-size: 17px; line-height: 1.5; }
.pv-cta .btn { margin: 0; }

.pv-error { margin-top: var(--s3, 24px); padding: var(--s3, 24px); border-radius: var(--radius, 16px); border: 2px solid var(--pv-high);
  background: color-mix(in srgb, var(--pv-high) 6%, #fff); }
.pv-error:focus { outline: none; }
.pv-error h3 { font-size: 20px; }
.pv-error p { margin: 8px 0 var(--s2, 16px); overflow-wrap: anywhere; }
.pv-error .btn { margin: 0; }
.pv-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 560px) {
  .pv-head { gap: var(--s2, 16px); align-items: flex-start; }
  .pv-grade { width: 64px; height: 64px; font-size: 36px; border-radius: 14px; }
  .pv-head h3 { font-size: 20px; }
  .pv-report, .pv-cta, .pv-error { padding: var(--s2, 16px); }
  .pv-f summary { grid-template-columns: 1fr auto; }
  .pv-f summary .pv-chip { grid-column: 1 / -1; justify-self: start; }
  .pv-steps { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .pv-steps li, .pv-steps li.run::after { animation: none; }
}
/* Once a report is open the form column grows tall; keep the lynx at the top instead of centred. */
.final-grid:has(.pv:not([hidden])) { align-items: start; }
