/* V13 final pass: consistent staged decisions, compact evidence, and complete endings. */
:root {
  --v13-paper:#f5efe3;
  --v13-ink:#10373d;
  --v13-gold:#e5bf70;
  --v13-red:#943b38;
  --v13-ease:cubic-bezier(.18,.86,.23,1);
}

/* Purchase decision: replace the empty middle with a staged fact ledger. */
.purchase-choice-screen[data-purchase-judgement] {
  height:100%;
  min-height:0!important;
  padding:101px 14px max(34px,env(safe-area-inset-bottom));
  display:grid;
  grid-template-rows:44px auto minmax(178px,1fr) 216px;
  gap:7px;
  overflow:hidden;
}
.purchase-choice-screen[data-purchase-judgement]::after { background:linear-gradient(180deg,rgba(2,19,23,.38),rgba(2,25,30,.78) 50%,rgba(2,20,24,.98)); }
.decision-stage-head { min-height:44px; padding:0 0 7px; border-bottom:1px solid rgba(255,255,255,.24); }
.decision-stage-head > span { color:var(--v13-gold); font-size:12px; font-weight:800; }
.decision-skip {
  min-width:88px; min-height:44px; padding:0 4px; border:0; color:rgba(255,248,233,.72); background:transparent;
  cursor:pointer; font-size:11px; letter-spacing:.06em; transition:color .16s ease,opacity .2s ease;
}
.decision-skip::before { content:""; display:inline-block; width:17px; margin:0 7px 3px 0; border-top:1px solid currentColor; vertical-align:middle; }
.decision-skip:hover { color:#fff; }
.decision-skip:focus-visible { outline:2px solid #fff2d2; outline-offset:2px; }
.decision-skip:disabled { opacity:0; pointer-events:none; }
.decision-hero { padding:3px 2px 1px; }
.decision-hero .judgement-kicker { font-size:11px; }
.decision-hero h2 { margin-top:4px; font-size:clamp(29px,8vw,35px); line-height:1.16; }

.risk-ledger { min-height:0; display:grid; grid-template-rows:auto auto auto minmax(0,1fr); gap:5px; align-content:center; padding:2px; }
.risk-fact {
  min-height:47px; padding:7px 9px; display:grid; grid-template-columns:35px minmax(0,1fr) 72px; align-items:center; gap:8px;
  border:1px solid rgba(255,255,255,.23); border-left:3px solid rgba(229,191,112,.86); border-radius:6px 13px 13px 6px;
  background:rgba(5,36,42,.78); opacity:0; transform:translateX(15px); transition:opacity .28s ease,transform .46s var(--v13-ease);
}
.risk-fact.is-visible { opacity:1; transform:none; }
.risk-fact > span { width:30px; height:30px; display:grid; place-items:center; border:1px solid rgba(229,191,112,.5); border-radius:50%; color:var(--v13-gold); font:700 16px/1 "STSong","Songti SC",serif; }
.risk-fact small { display:block; margin-bottom:2px; color:rgba(255,255,255,.55); font-size:9px; }
.risk-fact b { display:block; color:#fff8e9; font-size:15px; line-height:1.22; }
.risk-fact > i { padding:5px 4px; border:1px solid rgba(255,255,255,.16); border-radius:999px; color:rgba(255,255,255,.67); font-size:9px; font-style:normal; text-align:center; }
.risk-name { border-color:rgba(239,204,139,.5); border-left-color:#f1cd83; background:linear-gradient(105deg,rgba(146,54,51,.95),rgba(86,35,38,.92)); }
.risk-name > span { color:#fff0c9; border-color:rgba(255,236,194,.55); }
.risk-conclusion { align-self:center; margin:4px 0 0; padding:7px 0 3px 11px; border-left:3px solid var(--v13-gold); opacity:0; transform:translateY(8px); transition:opacity .26s ease,transform .4s var(--v13-ease); }
.risk-conclusion.is-visible { opacity:1; transform:none; }
.risk-conclusion small { display:block; margin-bottom:2px; color:var(--v13-gold); font-size:9px; font-weight:800; }
.risk-conclusion b { display:block; color:#fff8e9; font-family:"STSong","Songti SC",serif; font-size:15px; line-height:1.35; }

.decision-choice-panel { position:relative; min-height:216px; margin:0; padding:9px; overflow:hidden; }
.decision-lock { position:absolute; inset:9px; z-index:2; display:grid; place-content:center; text-align:center; color:var(--v13-ink); transition:opacity .22s ease,transform .34s var(--v13-ease); }
.decision-lock::before { content:""; width:42px; height:42px; margin:0 auto 10px; border:1px solid rgba(16,55,61,.25); border-radius:50%; background:radial-gradient(circle,var(--v13-gold) 0 4px,transparent 5px); }
.decision-lock small { margin-bottom:3px; color:#9a7440; font-size:10px; font-weight:800; }
.decision-lock b { font-size:16px; }
.decision-choice-panel .choice-grid { gap:7px; opacity:0; transform:translateY(12px); pointer-events:none; transition:opacity .3s ease,transform .44s var(--v13-ease); }
.decision-choice-panel .choice { min-height:59px; padding:8px 9px 8px 12px; }
.decision-choice-panel .choice strong { font-size:15px; }
.decision-choice-panel .choice small { font-size:10px; }
.purchase-choice-screen.is-decision-ready .decision-lock { opacity:0; transform:translateY(-8px); pointer-events:none; }
.purchase-choice-screen.is-decision-ready .decision-choice-panel .choice-grid { opacity:1; transform:none; pointer-events:auto; }

/* Evidence cards use two compact, explicit layers instead of stretching text to the edges. */
.replay-screen { grid-template-rows:auto 62px minmax(258px,330px) 58px; align-content:start; }
.evidence-focus { padding:13px; grid-template-rows:auto minmax(82px,1fr) 25px minmax(82px,1fr); gap:6px; }
.evidence-side { padding:12px; justify-content:center; border-radius:10px; background:#fffdf7; border:1px solid rgba(18,58,63,.11); }
.evidence-side small { margin-bottom:5px; font-size:11px; }
.evidence-side p { font-size:16px; line-height:1.48; }
.evidence-missing { background:#eef2ed; }
.evidence-divider { padding:0 5px; }

/* Four-link reveal must fit together with its rule and exit action. */
.chain-reveal-screen {
  height:100%; min-height:0!important; padding:104px 16px max(30px,env(safe-area-inset-bottom));
  display:grid; grid-template-rows:auto minmax(0,1fr) auto 50px; gap:8px; overflow:hidden;
}
.chain-reveal-screen .truth-head { margin:0; padding:15px 17px; }
.chain-reveal-screen .truth-head h2 { font-size:24px; line-height:1.25; }
.chain-reveal-screen .chain { min-height:0; margin:0; padding:9px; display:grid; grid-template-rows:repeat(4,minmax(0,1fr)); gap:6px; overflow:hidden; }
.chain-reveal-screen .chain-node { min-height:0; padding:7px 10px; grid-template-columns:32px minmax(0,1fr); gap:9px; }
.chain-reveal-screen .chain-node > span { width:30px; height:30px; font-size:12px; }
.chain-reveal-screen .chain-node b { font-size:15px; }
.chain-reveal-screen .chain-node small { margin-top:1px; font-size:10px; line-height:1.3; }
.chain-reveal-screen .rule-banner { min-height:73px; margin:0; padding:10px 13px; border-radius:14px; }
.chain-reveal-screen .rule-banner img { width:47px; max-height:53px; }
.chain-reveal-screen .rule-banner strong { font-size:17px; line-height:1.25; }
.chain-reveal-screen .rule-banner p { margin-top:3px; font-size:11px; line-height:1.35; }
.chain-reveal-screen > .action { min-height:50px; margin:0; }

/* Results compress cleanly into one viewport and preserve both actions. */
.score-result-screen {
  height:100%; min-height:0!important; padding:104px 20px max(30px,env(safe-area-inset-bottom));
  display:grid; grid-template-rows:auto 144px auto auto auto 74px 52px; gap:8px; align-content:start; overflow:hidden;
}
.score-result-screen > .truth-kicker { margin:0; align-self:end; }
.score-result-screen .score-ring { width:140px; height:140px; margin:0 auto; }
.score-result-screen .score-ring::before { inset:8px; }
.score-result-screen .score-value b { font-size:49px; }
.score-result-screen > h2 { margin:0; font-size:22px; line-height:1.32; }
.score-result-screen > p { margin:0 auto; font-size:12px; line-height:1.55; }
.score-result-screen .score-breakdown { margin:0; gap:7px; }
.score-result-screen .score-chip { min-height:42px; padding:9px 10px; font-size:12px; }
.score-result-screen .rule-banner { min-height:74px; margin:0; padding:10px 13px; }
.score-result-screen .rule-banner img { width:48px; max-height:52px; }
.score-result-screen .rule-banner strong { font-size:17px; }
.score-result-screen .rule-banner p { margin-top:3px; font-size:11px; }
.score-actions { display:grid; grid-template-columns:1.25fr .75fr; gap:8px; }
.score-actions .action { min-height:52px; margin:0; font-size:13px; }

.share-result-screen {
  height:100%; min-height:0!important; padding:104px 20px max(30px,env(safe-area-inset-bottom));
  display:grid; grid-template-rows:minmax(0,1fr) 44px 108px; gap:10px; overflow:hidden;
}
.share-result-screen .share-card { min-height:0; margin:0; padding:19px; display:flex; flex-direction:column; }
.share-result-screen .share-score { margin-top:13px; font-size:48px; }
.share-result-screen .share-title { margin:15px 0 5px; font-size:27px; }
.share-result-screen .share-tags { margin:11px 0 13px; }
.share-result-screen .share-footer { margin-top:auto; }
.share-option {
  min-height:44px; padding:8px 12px; display:flex; align-items:center; gap:10px; border:1px solid rgba(255,255,255,.24);
  border-radius:11px; color:#f6eddd; background:rgba(7,35,40,.72); cursor:pointer; font-size:12px; text-align:left;
}
.share-option input { width:18px; height:18px; margin:0; accent-color:var(--v13-gold); }
.share-actions { display:grid; grid-template-rows:50px 50px; gap:8px; }
.share-actions .action { min-height:50px; margin:0; }

@media (max-height:740px) {
  .purchase-choice-screen[data-purchase-judgement] { padding-top:94px; padding-bottom:max(31px,env(safe-area-inset-bottom)); grid-template-rows:40px auto minmax(154px,1fr) 184px; gap:5px; }
  .decision-hero h2 { font-size:26px; line-height:1.1; }
  .risk-ledger { gap:3px; }
  .risk-fact { min-height:42px; padding-top:5px; padding-bottom:5px; }
  .risk-fact b { font-size:13px; }
  .risk-conclusion { padding-top:4px; padding-bottom:1px; }
  .risk-conclusion b { font-size:13px; line-height:1.28; }
  .decision-choice-panel { min-height:184px; padding:7px; }
  .decision-choice-panel .choice-grid { gap:5px; }
  .decision-choice-panel .choice { min-height:52px; padding-top:5px; padding-bottom:5px; }
  .decision-choice-panel .choice strong { font-size:14px; }

  .replay-screen { grid-template-rows:auto 56px minmax(230px,285px) 54px; }
  .evidence-focus { padding:10px; grid-template-rows:auto minmax(72px,1fr) 23px minmax(72px,1fr); }
  .evidence-side { padding:9px; }
  .evidence-side p { font-size:14px; line-height:1.4; }

  .chain-reveal-screen { padding-top:94px; padding-bottom:max(30px,env(safe-area-inset-bottom)); grid-template-rows:auto minmax(0,1fr) 65px 48px; gap:6px; }
  .chain-reveal-screen .truth-head { padding:11px 14px; }
  .chain-reveal-screen .truth-head h2 { font-size:20px; line-height:1.2; }
  .chain-reveal-screen .chain { padding:7px; gap:4px; }
  .chain-reveal-screen .chain-node { padding-top:4px; padding-bottom:4px; }
  .chain-reveal-screen .chain-node b { font-size:13px; }
  .chain-reveal-screen .chain-node small { font-size:9px; }
  .chain-reveal-screen .rule-banner { min-height:65px; padding:7px 10px; }
  .chain-reveal-screen .rule-banner strong { font-size:15px; }
  .chain-reveal-screen .rule-banner p { font-size:9px; }
  .chain-reveal-screen > .action { min-height:48px; }

  .migration-choice-screen { padding-top:94px; padding-bottom:max(30px,env(safe-area-inset-bottom)); display:grid; grid-template-rows:auto minmax(174px,1fr) 188px; gap:7px; }
  .migration-choice-screen .truth-head { margin:0; padding:12px 16px; }
  .migration-choice-screen .truth-kicker { margin-bottom:5px; font-size:11px; }
  .migration-choice-screen .truth-head h2 { font-size:24px; line-height:1.22; }
  .migration-choice-screen .transfer-card { min-height:0; padding:12px 16px; border-radius:18px; overflow:hidden; }
  .migration-choice-screen .transfer-card h3 { margin:6px 0; font-size:18px; line-height:1.35; }
  .migration-choice-screen .transfer-card p { margin-bottom:6px; font-size:12px; line-height:1.55; }
  .migration-choice-screen .transfer-card small { font-size:9px; }
  .migration-choice-screen > .choice-grid { padding:7px; gap:5px; border-radius:18px; }
  .migration-choice-screen > .choice-grid .choice { min-height:54px; padding:5px 8px 5px 11px; border-radius:11px; }
  .migration-choice-screen > .choice-grid .choice strong { font-size:13px; line-height:1.3; }
  .migration-choice-screen > .choice-grid .choice small { margin-top:1px; font-size:9px; line-height:1.35; }
  .migration-choice-screen > .choice-grid .choice-arrow { flex-basis:30px; width:30px; height:30px; }

  .score-result-screen { padding-top:94px; padding-bottom:max(30px,env(safe-area-inset-bottom)); grid-template-rows:auto 111px auto auto auto 61px 48px; gap:5px; }
  .score-result-screen .score-ring { width:108px; height:108px; }
  .score-result-screen .score-value b { font-size:39px; }
  .score-result-screen > h2 { font-size:18px; line-height:1.25; }
  .score-result-screen > p { font-size:10px; line-height:1.4; }
  .score-result-screen .score-breakdown { gap:5px; }
  .score-result-screen .score-chip { min-height:34px; padding:6px 8px; font-size:10px; }
  .score-result-screen .rule-banner { min-height:61px; padding:7px 10px; }
  .score-result-screen .rule-banner img { width:41px; }
  .score-result-screen .rule-banner strong { font-size:14px; }
  .score-result-screen .rule-banner p { font-size:9px; }
  .score-actions .action { min-height:48px; }

  .share-result-screen { padding-top:94px; padding-bottom:max(30px,env(safe-area-inset-bottom)); grid-template-rows:minmax(0,1fr) 42px 98px; gap:7px; }
  .share-result-screen .share-card { padding:14px; }
  .share-result-screen .share-top img { width:62px; }
  .share-result-screen .share-score { margin-top:8px; font-size:40px; }
  .share-result-screen .share-title { margin:9px 0 3px; font-size:23px; }
  .share-result-screen .share-slogan { font-size:12px; }
  .share-result-screen .share-tags { margin:8px 0 9px; }
  .share-result-screen .share-footer { padding-top:8px; }
  .share-result-screen .mini-qr { width:50px; height:50px; }
  .share-option { min-height:42px; font-size:11px; }
  .share-actions { grid-template-rows:46px 46px; gap:6px; }
  .share-actions .action { min-height:46px; }
}

@media (max-width:370px) {
  .purchase-choice-screen[data-purchase-judgement],.chain-reveal-screen { padding-left:10px; padding-right:10px; }
  .risk-fact { grid-template-columns:31px minmax(0,1fr) 64px; gap:6px; }
  .risk-fact > i { font-size:8px; }
  .score-result-screen,.share-result-screen { padding-left:14px; padding-right:14px; }
}

@media (prefers-reduced-motion:reduce) {
  .risk-fact,.risk-conclusion,.decision-lock,.decision-choice-panel .choice-grid { transition:none!important; }
}
