/* Result sheet: readable receipt, compact artwork, and a reachable action footer. */
.modal:has(>.gr-result){width:min(100%,520px);min-height:0;max-height:calc(var(--gr-viewport-height,100svh) - 92px);padding:0;border-radius:24px;overflow:auto;background:#fff;color:var(--gr-ink);box-shadow:0 10px 32px #15274714}
.modal .gr-result{display:flex;flex-direction:column;align-items:stretch;min-height:0;max-height:none;overflow:visible;padding:24px 22px 0;text-align:center}
.gr-result .eyebrow{color:var(--gr-blue);font-size:10px;line-height:16px;font-weight:750;letter-spacing:2px;margin:0 0 6px}
.gr-result .gr-result-art{width:104px;height:104px;object-fit:contain;align-self:center;margin:0 0 8px;animation:gr-reward-enter 420ms cubic-bezier(.2,.75,.2,1) both}
.modal .gr-result h2{font-size:clamp(22px,6vw,28px);line-height:1.35;letter-spacing:-.5px;color:var(--gr-ink);margin:0 0 14px;font-weight:800;word-break:keep-all;overflow-wrap:anywhere}
.modal .gr-result .stage-earnings{margin:0;padding:0;border:0;background:none;box-shadow:none}
.modal .gr-result .stage-earnings>span{font-size:12px;line-height:20px;color:var(--gr-muted)}
.modal .gr-result .stage-earned{display:block;font-size:clamp(32px,9vw,42px);line-height:1.25;font-weight:850;color:var(--gr-blue);text-shadow:none;letter-spacing:-1px;margin:3px 0 18px;font-variant-numeric:tabular-nums;animation:gr-amount-enter 300ms ease-out both}
.modal .gr-result .bonus-breakdown{margin:0;padding:12px 14px;background:#f3f6fb;color:var(--gr-ink);border:1px solid #e6ebf3;border-radius:14px;box-shadow:none;display:grid;gap:7px;font-size:12px;line-height:1.6;text-align:left}
.modal .gr-result .bonus-breakdown>div{display:flex;gap:12px;align-items:baseline;justify-content:space-between;padding:0}
.modal .gr-result .bonus-breakdown dt{color:var(--gr-muted);flex:1;min-width:0;word-break:keep-all;overflow-wrap:anywhere}
.modal .gr-result .bonus-breakdown dd{margin:0;color:var(--gr-ink);font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.modal .gr-result .bonus-breakdown .full-combo-pay{border-top:1px solid #dfe6f1;padding-top:6px}
.modal .gr-result .full-combo-pay dt,.modal .gr-result .full-combo-pay dd{color:var(--gr-gold);font-weight:750}
.modal .gr-result .stage-earnings>p{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--gr-muted);margin:12px 0 0}
.modal .gr-result .stage-earnings>p b{color:var(--gr-ink);font-size:14px;font-variant-numeric:tabular-nums}
.modal .gr-result .intro{font-size:13px;line-height:1.6;color:var(--gr-muted);margin:12px 0}
.gr-result-actions{position:sticky;bottom:0;background:#fff;border-top:1px solid #e8edf5;padding:12px 0 14px;margin-top:2px;z-index:2}
.modal .gr-result .primary{position:static;inset:auto;width:100%;min-height:54px;margin:0;padding:13px 16px;background:var(--gr-blue);color:#fff;border:1px solid var(--gr-blue);border-bottom:3px solid #1747b8;border-radius:14px;box-shadow:none;text-shadow:none;font-size:16px;line-height:1.4;font-weight:750}
.modal .gr-result .primary:disabled{opacity:1;background:#e9edf4;color:#68758a;border-color:#e9edf4}
.modal .gr-result #nextDelivery,.modal .gr-result #nextMilestone{position:static;box-shadow:none;inset:auto}
.modal:has(>.gr-result){height:auto}
.modal .gr-result .text-button{position:static;display:block;width:100%;height:auto;min-height:44px;border:0;background:transparent;color:var(--gr-muted);margin:3px 0 0;padding:10px;font-size:13px;border-radius:10px;box-shadow:none}
.modal .gr-result .rank-note{font-size:10px;line-height:1.6;color:var(--gr-muted);margin:3px 0 0}
.modal .gr-result .tutorial-complete-icon{width:72px;height:72px;margin:8px auto 16px;background:var(--gr-soft);color:var(--gr-blue);font-size:36px;line-height:72px;border-radius:24px}
.modal .milestone-modal.gr-result{padding-bottom:22px}
.gr-result .milestone-stars{color:var(--gr-gold)}
.gr-milestone-award{position:relative;align-self:center;width:112px;height:108px;margin:4px auto 8px}
.gr-milestone-award .gr-result-art{width:104px;height:104px;margin:0}
.gr-milestone-award .world-medal{position:absolute;bottom:0;right:0;width:38px;height:38px;border:2px solid #fff;border-radius:12px;box-shadow:none}
.modal .milestone-modal.gr-result{padding-bottom:0}
@media(max-width:650px){.overlay:has(.gr-result){inset:64px 0 0;padding:12px 16px}.roadgrit-embedded .overlay:has(.gr-result){top:52px!important}}
@keyframes gr-reward-enter{from{opacity:0;transform:translateY(10px) scale(.85)}to{opacity:1;transform:none}}
@keyframes gr-amount-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(max-height:700px){.modal .gr-result{padding:16px 16px 0}.gr-result .gr-result-art{width:72px;height:72px;margin-bottom:4px}.modal .gr-result h2{font-size:23px;margin-bottom:8px}.modal .gr-result .stage-earned{font-size:34px;margin-bottom:12px}.modal .gr-result .bonus-breakdown{gap:4px;padding:10px}.modal .gr-result .intro{margin:8px 0}.gr-result-actions{padding:10px 0}.modal .gr-result .rank-note{font-size:10px}}
@media(prefers-reduced-motion:reduce){.gr-result .gr-result-art,.modal .gr-result .stage-earned{animation:none}}

/* End-of-run states share the receipt system, not the legacy green game skin. */
.modal .gr-run-result{padding:24px;text-align:left;gap:0}
.gr-run-result .gr-run-heading{position:static;display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:auto;padding:0;border:0;background:none;flex:none}
.gr-run-heading>div{min-width:0;flex:1}
.gr-run-heading img{width:64px;height:64px;object-fit:contain;flex:none}
.modal .gr-run-result .gr-run-label{font-size:12px;font-weight:650;color:var(--gr-blue);margin:0 0 7px}
.modal .gr-run-result h2{font-size:clamp(20px,5.6vw,26px);font-weight:750;letter-spacing:0;margin:0;text-wrap:balance}
.modal .gr-run-result .gr-run-subtitle{font-size:12px;line-height:1.7;color:var(--gr-muted);margin:10px 0 0;text-wrap:balance}
.gr-run-total{padding:20px 0 18px;border-bottom:1px solid var(--gr-border);margin-bottom:18px}
.gr-run-total>span{display:block;font-size:12px;color:var(--gr-muted)}
.gr-run-total>strong{display:block;font-size:clamp(32px,9vw,42px);line-height:1.35;letter-spacing:-.8px;font-weight:800;color:var(--gr-blue);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.modal .gr-run-total>p{margin:5px 0 0;font-size:12px;color:var(--gr-ink);font-weight:600}
.modal .gr-run-result .gr-run-continue>.rank-note{margin:9px 4px 14px;font-size:11px;line-height:1.7;text-wrap:balance;min-height:19px}
.gr-run-tools{display:flex;gap:8px;margin-bottom:12px}
.modal .gr-run-result .secondary{position:static;inset:auto;flex:1;display:flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:48px;height:auto;margin:0;padding:11px 8px;border:1px solid var(--gr-border);border-radius:12px;background:var(--gr-surface);color:var(--gr-ink);font-size:13px;line-height:1.4;font-weight:650;box-shadow:none;text-shadow:none}
.modal .gr-run-result .secondary:hover{background:var(--gr-soft)}
.modal .gr-run-result .secondary:disabled{background:#f1f4f8;color:var(--gr-muted);cursor:not-allowed}
.modal .gr-result-disclosure{padding:0;margin:0;border:0;border-bottom:1px solid var(--gr-border);border-radius:0;background:none;color:var(--gr-ink);text-align:left}
.gr-result-disclosure>summary{list-style:none;display:flex;align-items:center;gap:9px;min-height:54px;padding:10px 2px;font-size:13px;font-weight:650;color:var(--gr-ink);cursor:pointer}
.gr-result-disclosure>summary::-webkit-details-marker{display:none}
.gr-result-disclosure>summary img{width:28px;height:28px;object-fit:contain;flex:none}
.gr-disclosure-caret{margin-left:auto;color:var(--gr-muted);font-size:20px;line-height:1;transition:transform 120ms ease}
.gr-result-disclosure[open]>summary .gr-disclosure-caret{transform:rotate(180deg)}
.gr-disclosure-content{padding:0 2px 14px}
.modal .gr-disclosure-content p{margin:4px 0 12px;color:var(--gr-muted);font-size:12px;line-height:1.7;text-wrap:balance}
.gr-disclosure-content label{display:block;color:var(--gr-ink);font-size:12px;font-weight:650;margin-bottom:6px}
.gr-disclosure-content .rank-input{display:block;width:100%;min-height:46px;padding:10px 12px;margin:0 0 10px;border:1px solid #8594ac;border-radius:10px;background:var(--gr-surface);color:var(--gr-ink);font-size:15px}
.gr-disclosure-content dl{margin:0;display:grid;gap:9px;font-size:12px}
.gr-disclosure-content dl>div{display:flex;justify-content:space-between;gap:12px}
.gr-disclosure-content dt{color:var(--gr-muted)}
.gr-disclosure-content dd{margin:0;font-weight:650;font-variant-numeric:tabular-nums}
.modal .gr-run-result .online-error{color:var(--gr-danger);margin-top:8px}
.gr-run-result .online-error:empty{display:none}
.gr-run-result .penalty-history{background:#f4f6fa;color:var(--gr-ink);border:0;padding:10px 12px;margin:12px 0 0;border-radius:10px}
.gr-run-result .penalty-history summary{min-height:36px;cursor:pointer;display:flex;align-items:center}
.gr-run-result .penalty-history b{color:var(--gr-danger)}
.modal .gr-run-result #resultHome{margin:12px 0 0;min-height:44px;font-weight:600}
@media(max-width:360px),(max-height:700px){.modal .gr-run-result{padding:18px}.gr-run-heading img{width:48px;height:48px}.gr-run-total{padding:15px 0;margin-bottom:14px}.gr-run-tools{gap:6px}.modal .gr-run-result .secondary{font-size:12px}.gr-result-disclosure>summary{font-size:12px}}
@media(prefers-reduced-motion:reduce){.gr-disclosure-caret{transition:none}}
