/* v24: caller cards and viewport-safe mobile controls. */
#totals .alternative-heading{display:flex;flex-direction:column;gap:2px;text-align:left;line-height:1.25}
#totals .alternative-heading small{display:block;font-size:10px;color:#91aeca;font-weight:600;white-space:normal}
#disarrayWithoutBoom{min-height:50px;height:auto}
.caller-controls-only{justify-content:flex-end;margin-top:12px}
.caller-player-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin:18px 0}
.caller-player-card{display:flex;flex-direction:column;min-width:0;padding:14px 10px;border:1px solid #385a73;border-radius:12px;background:linear-gradient(155deg,#1b384d,#0d2032);text-align:center;transition:border-color .15s,background .15s}
.caller-player-card:focus-within,.caller-player-card:hover{border-color:#8cc7e9;background:linear-gradient(155deg,#24485f,#112a3e)}
.caller-card-top{display:flex;justify-content:space-between;align-items:center;padding:0 4px;color:#9ab6cb}
.caller-card-top .caller-rank{font-size:15px;color:#83a4bd}
.caller-card-count{font-size:12px}.caller-card-count b{font-size:22px;color:#b4e2fa}
.caller-card-person{display:flex;align-items:center;flex-direction:column;gap:10px;min-width:0;width:100%;padding:10px 0;border:0;background:transparent!important;cursor:pointer}
.caller-card-person strong{font-size:16px;overflow-wrap:anywhere;min-height:38px;display:grid;place-items:center;line-height:1.25}
.caller-card-person[aria-expanded=true]{color:#a9ddff}
.caller-avatar{position:relative;width:76px;height:76px;display:grid;place-items:center;flex-shrink:0;border-radius:50%;background:radial-gradient(circle at 35% 20%,#4d7d99,#142b3e 75%);border:1px solid #6f9cb8;overflow:hidden;box-shadow:0 4px 20px #0004}
.caller-avatar>span{font-size:28px;color:#b8e0f5}.caller-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.caller-card-weapons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;min-height:98px;align-content:start}
.caller-card-weapons>span{position:relative;display:grid;place-items:center;min-width:0;background:#081b2b66;border-radius:6px;padding-bottom:7px}
.caller-card-weapons img{width:44px;height:44px;max-width:100%;object-fit:contain}
.caller-card-weapons b{position:absolute;right:2px;bottom:0;color:#bce5fb;font-size:11px;background:#081727e8;padding:1px 4px;border-radius:4px}
.caller-player-card .caller-tags{justify-content:center;min-height:0;margin-top:10px}.caller-player-card .caller-tags:empty{display:none}
.caller-player-card .caller-badge{font-size:10px;padding:3px 4px}.caller-player-card .caller-badge svg{width:17px;height:19px}
.caller-card-mark{margin-top:auto;min-height:36px;width:100%;font-size:12px;background:#1a394f;border-color:#52758e}
.caller-card-person{padding:6px 0;min-height:42px}.caller-card-person strong{min-height:26px}
.caller-card-weapons{min-height:54px;margin:4px 0 10px}
.caller-guild-toggle{grid-template-columns:36px minmax(0,1fr) auto auto 24px}
.caller-guild-candidates{display:flex;align-items:baseline;gap:7px;color:#b5d8ef;font-size:23px}.caller-guild-candidates small{font-size:12px;color:#93b4ca}
.ip-inferred{color:#a8cce5;font-size:12px}
.withdrawn-entry{border-color:#a26a84!important;background:#302333!important}
.withdrawn-entry>.death-meta{background:#422c3c!important}.withdrawal-notice{margin:12px;padding:14px;border:1px solid #a16b85;border-left:4px solid #da91ad;border-radius:8px;background:#4c2f3f55;color:#efbed0}
.withdrawal-notice>b{font-size:15px}.withdrawal-notice p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.6;color:#e4c6d3}
.withdrawal-notice small{font-size:12px;color:#b99eae}.request-locked{color:#d2a5bb!important;background:#3a2937!important}
.withdraw-request:disabled{opacity:.5;cursor:not-allowed}.personal-controls label{display:grid;gap:7px}.personal-controls select{min-height:42px}
#withdrawDialog{width:min(560px,calc(100vw - 24px))}#withdrawReason{display:block;width:100%;font:inherit;font-size:16px;color:#e5eff9;background:#0b1d2c;border:1px solid #5d7b95;border-radius:7px;padding:12px;margin:10px 0;resize:vertical}
.withdraw-dialog-actions{display:flex;gap:10px;justify-content:flex-end}.withdraw-dialog-actions button{min-width:90px;min-height:44px}#submitWithdrawal{background:#654054;border-color:#be8aa3}#withdrawError{color:#f0a7b0;font-size:13px}
.caller-player-card:has(.caller-card-mark) .caller-tags{margin-bottom:10px}
.battle-detail-selectors{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin:12px 0 16px}
.battle-detail-selectors label{display:grid;gap:6px;color:#9fb9ce;font-size:12px;flex:1;min-width:140px;max-width:290px}
.battle-detail-selectors select{width:100%;min-width:0;max-width:100%;min-height:44px;font-size:14px}
.mobile-battle-sort{display:none}
.battle-column-filters th{vertical-align:top;padding:6px 12px 12px;text-align:left}
.battle-column-filters label{display:grid;gap:5px;min-width:0;color:#9fb9ce;font-size:11px;font-weight:500}
#reports .battle-column-filters select{display:block;width:100%;min-width:0;max-width:100%;height:36px;min-height:36px;margin:0;padding:5px 6px;font-size:12px;box-sizing:border-box}
.battle-column-filters #detailRole{max-width:180px}
.battle-column-filters .ip-rule-label{font-size:10px;line-height:1.4}
.battle-player-table{table-layout:fixed}.battle-player-table th:first-child{width:15%}.battle-player-table th:nth-child(2){width:29%}.battle-player-table th:nth-child(3),.battle-player-table th:nth-child(4){width:13%}.battle-player-table th:nth-child(n+5){width:7.5%}.battle-player-table td{overflow-wrap:anywhere}
#highlightViewer{box-sizing:border-box;width:min(1200px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
#highlightViewer .highlight-stage{position:relative;width:100%;aspect-ratio:16/9}
#highlightViewer .highlight-stage>img,#highlightViewer .highlight-stage>video{display:block;width:100%;height:100%;max-height:none;object-fit:contain}
.highlight-playback-status{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;min-height:40px;margin-top:8px;font-size:13px;color:#a9cce3}
.highlight-playback-status button{min-height:40px}.highlight-playback-status[data-state=error]{color:#f0bd9c}
.highlight-viewer-heading>strong{min-width:0;overflow-wrap:anywhere}.highlight-viewer-heading>span{white-space:nowrap}
@media(max-width:1500px){.caller-player-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:1150px){.caller-player-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:850px){.caller-player-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(hover:none),(pointer:coarse){
 #totals .total:hover .tooltip,#totals .total:focus .tooltip,#totals .total:focus-visible .tooltip{display:none!important}
 #totals .total.tip-pinned:not(.tip-dismissed) .tooltip{display:block!important}
}
@media(max-width:760px){
 html,body{max-width:100%;overflow-x:clip}
 main,main>section{min-width:0;max-width:100%}
 /* ID-specific desktop widths may remain, but can never exceed this cap. */
 dialog,dialog.guild-dialog-fallback[open]{box-sizing:border-box!important;min-width:0!important;max-width:calc(100vw - 20px)!important;max-height:calc(100vh - 24px)!important;max-height:calc(100dvh - 24px)!important;padding:14px!important;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
 dialog:not(.guild-dialog-fallback){margin:auto}
 dialog input,dialog select,dialog textarea{max-width:100%;min-width:0}
 .dialog-heading{position:sticky;top:-14px;z-index:3;background:#0f1d2f;padding:10px 0;gap:10px;margin-bottom:10px}
 dialog>form[method=dialog]:first-child{position:sticky;top:-14px;z-index:4;background:#0f1d2f}
 dialog>form[method=dialog]:first-child>.dialog-heading{position:static}
 #highlightViewer>form[method=dialog]:first-child{background:#07131f}
 .dialog-heading h2{font-size:20px!important;min-width:0;overflow-wrap:anywhere}
 .dialog-heading button{flex:0 0 44px;min-height:44px}
 .pagination{flex-wrap:wrap;gap:8px;font-size:12px;max-width:100%}.pagination>span{overflow-wrap:anywhere;text-align:center}
 #rankingDialog,#disarrayDialog{width:calc(100vw - 20px)!important}
 #rankingDialog #rankSearch{box-sizing:border-box;min-width:0;width:100%}
 #rankResults{max-height:calc(100dvh - 250px);overflow-y:auto;overflow-x:hidden}
 #rankResults .rank-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:8px;width:100%;font-size:14px;padding:12px 2px}
 #rankResults .rank-row strong{min-width:0;white-space:normal;overflow-wrap:anywhere}
 #rankResults .rank-row b{font-size:13px}#rankResults .rank-row small{width:auto;grid-column:3}
 #disarrayContent{min-width:0;overflow-wrap:anywhere}
 #disarrayContent .formula{display:grid;grid-template-columns:1fr;gap:7px;padding:12px}
 #disarrayContent .formula>div{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;text-align:left;gap:5px 10px;padding:9px;background:#102338;border-radius:6px;font-size:13px}
 #disarrayContent .formula b{margin:0;font-size:32px;grid-column:2;grid-row:1/3}
 #disarrayContent .formula small{grid-column:1;font-size:11px}
 #disarrayContent .formula>span{text-align:center;color:#8caec7}
 #disarrayContent details,#disarrayContent p{white-space:normal;overflow-wrap:anywhere}
 #totals .total .tooltip{box-sizing:border-box;position:fixed;z-index:200;top:auto;bottom:calc(16px + env(safe-area-inset-bottom,0px));left:12px;width:calc(100vw - 24px);max-height:35dvh;overflow-y:auto;font-size:13px;padding:12px;border-radius:10px}
 #totals .alternative-heading{text-align:center}#totals .alternative-heading small{font-size:10px}
 #tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;overflow:visible!important;height:auto;gap:3px}
 #tabs button{min-width:0;min-height:44px;font-size:12px;padding:7px 3px;gap:4px;justify-content:center;white-space:normal}
 #tabs button b{white-space:nowrap;font-size:10px}#tabs .nav-separator{display:none}
 #tabs button:last-child{grid-column:auto!important;margin-left:0}
 .battle-detail-selectors{display:grid;grid-template-columns:1fr 1fr;gap:10px}
 .battle-detail-selectors label{min-width:0;max-width:none}.battle-detail-selectors label:first-child{grid-column:1/-1}
 .battle-detail-selectors label:last-child{grid-column:1/-1}
 .battle-detail-selectors select{font-size:16px}
 .mobile-battle-sort{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}
 .mobile-battle-sort button{flex:1;min-height:40px;font-size:12px;padding:7px 9px}
 .mobile-battle-sort button[aria-pressed=true]{background:#294e69;border-color:#92c6e5;color:#e4f6ff}
 .report-table-wrap:has(.battle-player-table){overflow:visible;background:transparent;border:0}
 #reports .battle-player-table{display:block;table-layout:auto;min-width:0!important;width:100%!important}
 #reports .battle-player-table thead{display:block;margin-bottom:12px}
 #reports .battle-player-table thead>tr:first-child{display:none}
 #reports .battle-player-table thead tr.battle-column-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px;border:1px solid #37536b;border-radius:10px;background:#13283a}
 #reports .battle-player-table .battle-column-filters th{display:block;width:auto;min-width:0;padding:0;border:0}
 #reports .battle-player-table .battle-column-filters th.filter-spacer{display:none}
 #reports .battle-column-filters select{height:44px;min-height:44px;font-size:16px}
 #reports .battle-column-filters #detailRole{max-width:100%}
 #reports .battle-player-table tbody{display:grid;gap:12px;width:100%}
 #reports .battle-player-table tr{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;align-items:center;width:100%;padding:13px 12px;border:1px solid #37536b;border-left:3px solid var(--guild-tint,#567690);border-radius:10px;background:linear-gradient(120deg,#172e43,#101f30)}
 #reports .battle-player-table td{display:block;padding:0;border:0!important;min-width:0;overflow-wrap:anywhere}
 #reports .battle-player-table td:first-child{grid-column:1/4;font-size:16px}
 #reports .battle-player-table td.battle-weapons{grid-column:4/7;grid-row:1;min-width:0;max-width:none}
 #reports .battle-player-table .death-weapon-list{display:flex;flex-wrap:wrap;gap:3px;justify-content:flex-end;max-width:100%}
 #reports .battle-player-table .battle-weapons img{width:36px;height:36px}
 #reports .battle-player-table td:nth-child(3),#reports .battle-player-table td:nth-child(4){grid-column:span 3;font-size:12px;line-height:1.5}
 #reports .battle-player-table td:nth-child(5){grid-column:span 6;font-size:13px}
 #reports .battle-player-table td:nth-child(n+6){grid-column:span 2;font-size:21px;font-weight:800;padding-top:8px;border-top:1px solid #344c61!important}
 #reports .battle-player-table td[data-label]::before{content:attr(data-label);display:block;color:#90aabe;font-size:10px;font-weight:600;margin-bottom:3px}
 #reports .battle-player-table td:nth-child(5)::before{display:inline;margin-right:8px}
 .battle-summaries{display:grid;grid-template-columns:1fr;gap:12px}.summary-panel{min-width:0;overflow-x:auto}
 .summary-panel .report-table{min-width:0!important;font-size:11px}.summary-panel .report-table td,.summary-panel .report-table th{padding:8px 5px}
 .battle-tabs{gap:6px}.battle-tabs button{min-width:0;font-size:12px;padding:8px 9px}
 .intel-caller-heading .date-controls{min-width:0;max-width:100%;margin:0}.caller-guild-content{min-width:0}
 .caller-guild-toggle{grid-template-columns:20px minmax(0,1fr) auto auto 15px;gap:7px}
 .caller-guild-candidates{flex-direction:column;align-items:center;gap:0;font-size:21px}.caller-guild-candidates small{font-size:10px}
}
@media(max-width:540px){
 .caller-player-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .caller-player-card{padding:12px 8px}.caller-card-person strong{font-size:15px}.caller-card-top{padding:0}
 .caller-avatar{width:64px;height:64px}.caller-card-weapons img{width:40px;height:40px}
 .caller-guild-content .pagination{gap:7px}.caller-controls-only .date-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
 .caller-controls-only .date-controls label{min-width:0}.caller-controls-only .date-controls input{width:100%;font-size:16px}
 #highlightViewer .highlight-viewer-footer{margin-top:8px}.highlight-viewer-tools{margin-top:8px}
 .highlight-viewer-heading{gap:8px}.highlight-viewer-heading>strong{font-size:15px}.highlight-viewer-heading>span{font-size:11px}
}
@media(max-height:600px) and (orientation:landscape){
 #highlightViewer{width:min(calc(100vw - 24px),calc((100dvh - 130px)*1.7778))!important;padding:8px!important;max-height:calc(100dvh - 12px)!important}
 #highlightViewer .highlight-viewer-heading{margin-bottom:3px}#highlightViewer .highlight-view-progress{margin-bottom:4px}
 #highlightViewer .highlight-viewer-heading button{min-height:30px;height:30px}
 #highlightViewer .highlight-viewer-footer{margin-top:5px;gap:8px}#highlightViewer .highlight-viewer-footer button{min-height:30px;font-size:22px}
 #highlightViewer .highlight-viewer-tools{margin-top:5px;gap:10px}#highlightViewer .highlight-viewer-tools button{min-height:30px}
 #highlightViewer .highlight-playback-status{min-height:30px;margin-top:4px}
}
