/* ════════ Scene layout — one headline, one visual, details on demand ════════
   Loaded after story.css by the walkthrough pages only. */

.scene { width: 100%; max-width: 1160px; display: flex; flex-direction: column; gap: 22px; animation: rise .45s cubic-bezier(.22,.7,.2,1) both; }
.sc-head { display: flex; flex-direction: column; gap: 8px; }
.sc-step { font-size: 12.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.sc-step .back-link { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.sc-title { margin: 0; font-size: clamp(32px, 3.3vw, 46px); font-weight: 850; letter-spacing: -.03em; line-height: 1.08; }
.sc-sub { margin: 0; font-size: clamp(16px, 1.3vw, 19px); color: var(--ink2); line-height: 1.5; max-width: 860px; }
.sc-sub code, .card code, .ci-card code, .pr-m code, .req-line code { font-family: var(--mono); font-size: .9em; background: var(--bg2); padding: 1px 6px; border-radius: 5px; }
.sc-h2 { margin: 6px 0 -6px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }

.sc-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.scene .card { padding: 20px 22px; border-radius: var(--r-md); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-k { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-note { margin: 0; font-size: 14.5px; color: var(--ink2); line-height: 1.5; }
.code-h { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--ink2); }
.code-key { margin-left: auto; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.code-key i { font-style: normal; font-weight: 800; margin-left: 8px; }
.code-key i.add { color: var(--ok); } .code-key i.del { color: var(--danger); }
.scene .code { margin: 0; max-height: 340px; overflow: auto; }

/* unified diff */
.udiff { padding: 12px 0 !important; white-space: pre; }
.ud { display: block; padding: 0 14px 0 0; }
.ud i { display: inline-block; width: 26px; text-align: center; font-style: normal; color: #64748b; user-select: none; }
.ud.add { background: rgba(34,197,94,.16); } .ud.add i { color: #4ade80; }
.ud.del { background: rgba(248,113,113,.14); color: #fca5a5; } .ud.del i { color: #f87171; }

/* "why it's different" + details button */
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.sc-edge { font-size: 15px; color: var(--ink); line-height: 1.45; display: flex; align-items: baseline; gap: 10px; }
.edge-k { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink);
  background: var(--grad-soft); border: 1px solid #dbe4fb; padding: 3px 9px; border-radius: 999px; }
.sc-details { flex: none; cursor: pointer; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 700;
  font-size: 14px; padding: 10px 16px; border-radius: 12px; box-shadow: var(--sh-sm); }
.sc-details:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ── overview ── */
.ov2 { align-items: center; text-align: center; gap: 20px; }
.ov-title { margin: 0; font-size: clamp(36px, 3.9vw, 56px); font-weight: 850; letter-spacing: -.035em; line-height: 1.08; }
.ov-sub { max-width: 760px; }
.ov-loop { display: flex; align-items: stretch; gap: 10px; margin-top: 8px; }
.ov-step { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 22px; min-width: 170px; box-shadow: var(--sh-sm); }
.ov-step.hot { border-color: #bfe8cc; background: linear-gradient(180deg, #fff, #f3fcf6); }
.ov-ic { font-size: 26px; } .ov-step b { font-size: 17px; } .ov-step span:last-child { font-size: 13.5px; color: var(--ink2); }
.ov-arr { align-self: center; color: var(--muted); font-size: 20px; }
.bm { display: block; width: min(560px, 100%); text-align: left; text-decoration: none; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 18px; box-shadow: var(--sh-sm); transition: border-color .15s, box-shadow .15s; }
.bm:hover { border-color: #c3d0f5; box-shadow: var(--sh); }
.bm-h { font-size: 13px; font-weight: 750; color: var(--ink2); margin-bottom: 8px; display: flex; justify-content: space-between; }
.bm-h span { color: var(--accent); font-weight: 700; }
.bm-row { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.bm-n { color: var(--ink2); font-weight: 650; }
.bm-bar { height: 10px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.bm-bar i { display: block; height: 100%; background: #94a3b8; border-radius: 99px; }
.bm-row.cm .bm-bar i { background: var(--grad); } .bm-row.cm .bm-n, .bm-row.cm b { color: var(--accent-ink); }
.bm-row b { text-align: right; }
.ov-cta { margin-top: 4px; }

/* ── PR gate ── */
.pr-h { display: flex; gap: 12px; align-items: flex-start; }
.pr-ic { font-size: 22px; line-height: 1.2; }
.pr-t { font-weight: 800; font-size: 16px; line-height: 1.3; }
.pr-m { font-size: 13px; color: var(--ink2); margin-top: 3px; }
.ci-card { border-color: var(--danger-line) !important; }
.ci-h { display: flex; gap: 12px; align-items: center; font-size: 16px; }
.ci-x { width: 30px; height: 30px; border-radius: 50%; background: var(--danger); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex: none; }
.ci-sub { font-size: 13px; color: var(--ink2); font-weight: 500; }
.ci-find { background: var(--danger-bg); border: 1px solid var(--danger-line); border-radius: var(--r-sm); padding: 12px 14px; }
.ci-find b { margin-left: 8px; font-size: 15px; }
.ci-find p { margin: 6px 0 0; font-size: 14px; color: var(--ink2); line-height: 1.45; }
.ci-k { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ci-routes { list-style: none; margin: -4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.ci-routes li { display: grid; grid-template-columns: 10px auto 1fr; gap: 10px; align-items: center; }
.ci-routes li span:last-child { color: var(--ink2); }
.sev-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.sev-dot.sev-CRITICAL { background: var(--danger); } .sev-dot.sev-HIGH { background: #f97316; } .sev-dot.sev-MEDIUM { background: #eab308; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: auto; }
.stats div { background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 10px 12px; }
.stats b { display: block; font-size: 20px; font-weight: 850; letter-spacing: -.02em; }
.stats span { font-size: 12px; color: var(--ink2); }

/* ── find ── */
.sevbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; }
.sev-bg-CRITICAL { background: var(--danger); } .sev-bg-HIGH { background: #f97316; } .sev-bg-MEDIUM { background: #eab308; } .sev-bg-LOW { background: #94a3b8; }
.sevkey { display: flex; gap: 18px; font-size: 14px; color: var(--ink2); font-weight: 650; margin-top: -10px; }
.sevkey i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.scene .vuln-card { padding: 20px 22px; gap: 8px; }
.scene .vc-meta code { background: none; padding: 0; font-size: 1em; }

/* diagnosis compare */
.cmp-col { display: flex; flex-direction: column; gap: 12px; }
.cmp-row { display: flex; gap: 12px; border: 1px solid var(--line); background: #fff; border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--sh-sm); }
.cmp-row b { font-size: 14.5px; } .cmp-row p { margin: 3px 0 4px; font-size: 14.5px; line-height: 1.45; }
.cmp-row small { font-size: 13px; color: var(--ink2); line-height: 1.4; }
.cmp-ic { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex: none; }
.cmp-row.bad .cmp-ic { background: var(--danger-bg); color: var(--danger); }
.cmp-row.good { border-color: var(--ok-line); } .cmp-row.good .cmp-ic { background: var(--ok); color: #fff; }
.impact-line { margin: 0; font-size: 14px; color: #991b1b; background: var(--danger-bg); border-radius: var(--r-sm); padding: 10px 14px; line-height: 1.45; }

/* ── verify / fix: request & response ── */
.req-line { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.req-m { font-family: var(--mono); font-weight: 800; font-size: 12px; color: #fff; background: #0f172a; padding: 3px 8px; border-radius: 6px; }
.req-body, .resp-body { margin: 0; font-family: var(--mono); font-size: 13.5px; background: #0c1424; color: #e2e8f0; border-radius: 10px; padding: 14px; white-space: pre-wrap; word-break: break-word; }
.req-body .hl { background: rgba(248,113,113,.4); color: #fff; border-radius: 3px; padding: 0 2px; }
.resp-body .tok { color: #f87171; font-weight: 800; }
.scene .card .btn.lg { align-self: flex-start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.scene .chip { font-family: var(--sans); font-size: 12.5px; color: var(--ink2); background: var(--bg); border: 1px solid var(--line2); padding: 5px 10px; border-radius: 999px; }
.resp { justify-content: flex-start; }
.resp-wait { margin: auto; color: var(--muted); font-size: 14.5px; display: flex; gap: 10px; align-items: center; }
#attackOut:empty { display: none; }
.resp-h { font-weight: 800; font-size: 17px; }
.resp-h.breach { color: var(--danger); }
.resp-note { margin: 0; font-size: 14px; color: var(--ink2); line-height: 1.45; }
.verdict { font-weight: 850; font-size: 14px; letter-spacing: .02em; color: var(--ok-ink); background: var(--ok-bg); border: 1px solid var(--ok-line); padding: 10px 14px; border-radius: var(--r-sm); }
.ba { display: flex; flex-direction: column; gap: 8px; }
.ba-row { display: grid; grid-template-columns: 110px 74px 1fr; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; border: 1px solid; }
.ba-row span { font-size: 12.5px; font-weight: 750; color: var(--ink2); }
.ba-row em { font-style: normal; color: var(--ink2); line-height: 1.4; }
.ba-row.breach { background: var(--danger-bg); border-color: var(--danger-line); } .ba-row.breach b { color: var(--danger); }
.ba-row.block { background: var(--ok-bg); border-color: var(--ok-line); } .ba-row.block b { color: var(--ok-ink); }
.ba-row.ok { background: #fff; border-color: var(--line); } .ba-row.ok b { color: var(--ok-ink); }

/* ── ship ── */
.ship-card { max-width: 760px; width: 100%; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 14.5px; }
.checks li { display: flex; gap: 10px; align-items: center; }
.ck-ic { width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 12px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ship-res { margin-top: 4px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ship-res.ok { background: var(--ok-bg); border-color: var(--ok-line); } .ship-res.ok b { color: var(--ok-ink); }
.ship-res.bad { background: var(--danger-bg); border-color: var(--danger-line); }

/* ── technical details drawer: tabs ── */
.dtabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid #1c2740; overflow-x: auto; }
.dtabs button { cursor: pointer; background: none; border: none; color: #93a4bd; font-weight: 700; font-size: 13px; padding: 9px 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.dtabs button:hover { color: #fff; }
.dtabs button.on { color: #fff; border-bottom-color: #60a5fa; }
.drawer .db { flex: 1; }
.dt-note { margin: 0 0 12px; font-size: 13px; color: #93a4bd; }
.dt-note code, .an code { font-family: var(--mono); background: #1e293b; padding: 1px 5px; border-radius: 4px; color: #e2e8f0; }
.drawer pre.raw { font-size: 12.5px; }
.an { font-size: 14px; line-height: 1.55; color: #d7e0ea; }
.an p { margin: 0 0 6px; }
.an-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid #1c2740; }
.an-row span { color: #93a4bd; font-size: 13px; }
.an-k { margin: 16px 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #60a5fa; }
.an-k a { color: #93a4bd; text-transform: none; letter-spacing: 0; font-weight: 600; }
.an-list { margin: 0; padding-left: 18px; } .an-list li { margin-bottom: 4px; }
.an .mchip { background: #1e293b; color: #cbd5e1; border-color: #334155; }
.drawer .gcli { margin: 0; }
.drawer .file-view { max-height: none; }
.af-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #d7e0ea; }
.af-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #93a4bd; padding: 8px 6px; border-bottom: 1px solid #1c2740; }
.af-table td { padding: 7px 6px; border-bottom: 1px solid #1c2740; vertical-align: top; }
.af-table td code { font-family: var(--mono); font-size: 12px; color: #93a4bd; }
.af-table tr.feat td { background: rgba(96,165,250,.08); }

/* ── small screens ── */
@media (max-width: 900px) {
  .sc-grid { grid-template-columns: 1fr; }
  .sc-foot { flex-direction: column; align-items: stretch; }
  .sc-edge { flex-direction: column; gap: 6px; }
  .ov-loop { flex-direction: column; align-items: stretch; } .ov-arr { transform: rotate(90deg); }
  .checks { grid-template-columns: 1fr; }
  .ba-row { grid-template-columns: 1fr auto; } .ba-row em { grid-column: 1 / -1; }
}

/* pass-2 fixes */
.udiff { white-space: pre-wrap; word-break: break-word; }
.ud { padding-left: 26px; text-indent: -26px; }
.ci-find b { display: block; margin: 8px 0 0; }
.scene.narrow { max-width: 860px; }
.scene.narrow .ship-card { max-width: none; }
.udiff { padding: 12px 10px 12px 4px !important; }
.drawer .gcli-body { white-space: normal; font-size: 12.5px; line-height: 1.55; max-height: calc(var(--app-h, 100vh) - 290px); }
.drawer .gcli-body .cli-line { white-space: pre-wrap; word-break: break-word; }
.drawer .gcli-head { font-size: 12px; }
.drawer .file-chip { background: #1e293b; color: #cbd5e1; border-color: #334155; }
.drawer .file-chip.active { background: #60a5fa; color: #0b1220; border-color: #60a5fa; }
@media (max-width: 720px) {
  #targetChip, #vulnChip, .notes-btn { display: none !important; }
  .nav-btn { white-space: nowrap; }
}
