html:has(body.site-ui){scrollbar-gutter:stable}
html.site-reference-open{overflow:hidden}
body.site-ui dialog.site-reference{box-sizing:border-box;width:min(1040px,calc(100vw - 32px));height:min(900px,calc(100dvh - 32px));max-width:none;max-height:none;padding:0;border:1px solid #526a87;border-radius:18px;background:#102035;color:#edf4ff;overflow:hidden;box-shadow:0 24px 80px #0009}
body.site-ui dialog.site-reference[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:0}
.site-reference::backdrop{background:rgb(3 10 20 / .76)}
body.site-ui .site-reference-head{position:static;display:flex;gap:20px;align-items:center;justify-content:space-between;padding:16px 20px;background:linear-gradient(110deg,#1a344c,#14263c);border-bottom:1px solid #35516c;min-width:0}
.site-reference-head>div{min-width:0}.site-reference-label{color:#a8dfba;font-size:10px;letter-spacing:.12em;font-weight:800}
body.site-ui .site-reference-head h2{font-size:20px;line-height:1.25;margin:4px 0 0;overflow-wrap:anywhere;color:#f4f8ff}
body.site-ui .site-reference-head button,.site-reference-status button{flex:none;min-width:72px;min-height:44px;border:1px solid #65809e;border-radius:10px;color:#f4f8ff;background:#243e58;padding:10px 16px;font:inherit;font-weight:700;cursor:pointer}
.site-reference-head button:hover,.site-reference-status button:hover{background:#355571}.site-reference button:focus-visible{outline:3px solid #a8dfba;outline-offset:2px}
.site-reference-stage{min-width:0;min-height:0;grid-area:2 / 1;overflow:hidden}.site-reference-stage iframe{width:100%;height:100%;display:block;border:0;background:#102035}.site-reference-stage iframe[hidden]{display:none}
.site-reference-status{grid-area:2 / 1;align-self:center;justify-self:center;z-index:1;padding:24px;max-width:420px;text-align:center;line-height:1.6}.site-reference-status[hidden]{display:none}.site-reference-status button{display:block;margin:16px auto 0}
body.site-ui .site-reference-hint{margin:0;padding:9px 20px;background:#102035;border-top:1px solid #2c435d;color:#b9cada;font-size:12px;line-height:1.4}
@media(max-width:600px){body.site-ui dialog.site-reference{width:calc(100vw - 12px);height:calc(100dvh - 16px);border-radius:12px}body.site-ui .site-reference-head{padding:10px 12px;gap:10px}body.site-ui .site-reference-head h2{font-size:17px}.site-reference-label{font-size:9px}body.site-ui .site-reference-head button{padding:8px 12px;min-width:64px}body.site-ui .site-reference-hint{padding:8px 12px;font-size:11px}}

.site-reference-actions{display:flex;align-items:center;gap:8px;flex:none}.site-reference-actions button[hidden]{display:none!important}.site-reference-head>div:first-child{flex:1}
@media(max-width:600px){.site-reference-actions{gap:6px}body.site-ui .site-reference-actions button{min-width:44px;padding:8px}.site-reference-head>div:first-child{min-width:0}}

/* Keep shared dialog-header enhancement from stretching these actions. */
body.site-ui.detail-polish.game-ui dialog.site-reference[open] .site-reference-head>.site-reference-actions{flex:0 0 auto;margin-left:auto}
