/* reports-chat-ux75: the viewport owns the frame; only message/report lists scroll. */
:is(.reports-screen,.report-replay-screen)#overlay{padding:6px;background:#03162cf5;overflow:hidden}
:is(.reports-screen,.report-replay-screen) #panel{display:flex;flex-direction:column;height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);width:min(1240px,100%);overflow:hidden;scrollbar-gutter:auto}
:is(.reports-screen,.report-replay-screen,.chat-overlay) .panel-head{padding:0 8px;min-height:38px;height:38px;flex:none}
:is(.reports-screen,.report-replay-screen,.chat-overlay) .panel-head h1{font-size:16px;margin:0}
:is(.reports-screen,.report-replay-screen,.chat-overlay) .panel-head .close{height:36px;width:40px;min-height:36px;min-width:40px}
:is(.reports-screen,.report-replay-screen) #panelBody{flex:1;min-height:0;overflow:hidden;padding:4px 6px}
.reports-screen #reportsWorkspace{height:100%;display:flex;flex-direction:column;min-height:0;gap:4px;overflow:hidden}
.reports-toolbar{display:flex;gap:3px;flex:none;min-width:0}
.reports-screen#overlay #panelBody button{min-height:32px;min-width:28px;padding:3px 5px;font-size:11px}
.reports-toolbar>button{white-space:nowrap;flex:1}
.reports-toolbar>button[aria-pressed=true]{color:var(--gold)!important;outline:1px solid var(--gold);outline-offset:-2px}
.reports-toolbar #reportsClearRead{font-size:9px;max-width:130px;white-space:normal}
.reports-master-detail{display:grid;grid-template-columns:minmax(160px,.3fr) minmax(0,.7fr);gap:8px;flex:1;min-height:0;overflow:hidden}
.reports-master{display:flex;flex-direction:column;gap:3px;min-height:0;min-width:0}
.reports-target-filter{display:flex;align-items:center;gap:4px;font-size:10px;flex:none}
.reports-target-filter select{width:100%;min-width:0;height:28px;font-size:12px;padding:2px}
#reportsList{flex:1;min-height:0;overflow:auto;overflow-x:hidden;overscroll-behavior:contain}
.reports-screen#overlay #panelBody .report-row{width:100%;display:grid;grid-template-columns:8px minmax(0,1fr) auto;gap:2px 4px;text-align:left;min-height:49px;margin:0 0 3px;padding:3px 5px;background:#071f34;border:1px solid #245675;border-image:none;font-size:11px}
.report-row.selected{outline:1px solid var(--cyan);outline-offset:-2px;background:#12344c!important}
.report-row.unread{border-left:3px solid var(--gold)!important}
.report-row b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;font-size:12px}
.report-row time{font-size:9px;color:var(--muted)}
.report-row small,.report-row>span{grid-column:2/-1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:10px}
.report-dot{width:6px;height:6px;margin-top:5px;background:#91aabc;border-radius:50%;grid-column:1;grid-row:1/4}
.report-dot.won{background:var(--positive)}.report-dot.lost{background:var(--loss)}.report-dot.spy{background:var(--cyan)}.report-dot.cargo{background:var(--gold)}
#reportDetail{min-height:0;min-width:0;display:flex;flex-direction:column;gap:4px;border:1px solid #285675;background:#04182a;padding:4px;overflow:hidden}
.report-detail-heading{position:static;display:flex;align-items:center;gap:6px;min-height:30px;height:auto;padding:0;background:none;z-index:auto;flex:none}
.report-detail-heading>div{min-width:0;flex:1}
.report-detail-heading b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}
.report-detail-heading small{font-size:9px;display:block;color:var(--muted)}
.report-outcome{font-size:10px;white-space:nowrap;color:var(--cyan)}.report-outcome.won{color:var(--positive)}.report-outcome.lost{color:var(--loss)}
#reportFacts{min-height:0;min-width:0;flex:1;display:flex;flex-direction:column;gap:4px;overflow:hidden}
.report-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:4px;min-height:0;flex:1}
.report-metric{border:1px solid #1c405b;background:#071d30;min-height:0;min-width:0;padding:4px;display:flex;flex-direction:column;gap:4px;font-size:11px;overflow:hidden}
.report-metric>small{font-size:9px;color:var(--muted);line-height:1.1;flex:none}
.report-metric>b{font-size:15px}
.report-metric p{margin:0;line-height:1.2;overflow-wrap:anywhere}
.report-resource-grid{display:flex;flex-direction:column;gap:3px;justify-content:center;flex:1;min-height:0}
.report-resource-grid>span{display:grid;grid-template-columns:18px minmax(0,1fr) auto;gap:3px;align-items:center;min-width:0}
.report-resource-grid img{height:16px;width:16px;object-fit:contain}
.report-resource-grid small{font-size:10px;color:var(--muted)}.report-resource-grid b{font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
.report-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;font-size:10px}
.report-levels span{display:flex;justify-content:space-between;gap:3px}
.report-unit-rail{display:flex;overflow:auto;overflow-y:hidden;gap:3px;min-height:0;flex:1;touch-action:pan-x;overscroll-behavior:contain}
.reports-screen#overlay #panelBody .report-unit{display:flex;flex:0 0 48px;flex-direction:column;justify-content:center;gap:1px;padding:1px;min-height:0;font-size:10px;min-width:48px;background:#0a2b43}
.report-unit>img{width:100%;height:22px;object-fit:contain}
.report-unit b{font-size:10px}
.report-unknown{font-size:10px;color:var(--muted)}
.report-composition{gap:2px}
.report-unit-hint{margin:0;min-height:13px;max-height:26px;line-height:1.1;font-size:10px;color:var(--muted);flex:none;overflow-wrap:anywhere;overflow:hidden}
.report-actions{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;flex:none}
.reports-screen#overlay #panelBody .report-actions>button{font-size:9px;padding:2px;min-height:38px;line-height:1.1;min-width:0;overflow-wrap:anywhere}
.report-comparison{border-collapse:collapse;width:100%;font-size:11px;line-height:1.1;flex:1}
.report-comparison th,.report-comparison td{text-align:right;padding:1px 2px;font-variant-numeric:tabular-nums}
.report-comparison th:first-child{text-align:left;color:var(--muted);font-weight:normal}
.report-comparison thead{font-size:9px}.report-comparison tbody tr:last-child td{color:var(--loss)}
.report-recovery{display:flex;justify-content:space-between;gap:3px;align-items:center;font-size:10px;flex:none}
.reports-screen#overlay #panelBody .report-recovery button{min-height:24px;font-size:9px}
.report-scan-picker{display:flex;overflow:auto;overflow-y:hidden;gap:4px;flex:none;max-height:34px}
.report-scan-picker button{flex:none}
.report-scan-picker button[aria-pressed=true]{color:var(--gold)!important}
.report-scan-actions{display:flex;gap:3px;margin-top:auto}
.report-info-body{overflow:auto;font-size:12px;line-height:1.25;min-height:0;overflow-wrap:anywhere}
.report-replay-frame{height:100%;min-height:0;display:flex;flex-direction:column;gap:3px}
.report-replay-frame .battle-replay{min-height:0;flex:1;display:flex;flex-direction:column;margin:0;padding:3px}
.report-replay-frame .battle-replay h3,.report-replay-frame .battle-replay-legend,.report-replay-frame .battle-replay>.muted{display:none}
.report-replay-frame #battleReplayCanvas{min-height:0;flex:1;width:100%;height:auto;object-fit:contain}
.report-replay-frame .battle-replay-controls{flex:none;gap:3px;margin:0;flex-wrap:nowrap}
.report-replay-screen#overlay #panelBody button{font-size:10px;min-height:32px;padding:3px 5px;min-width:28px}
.report-replay-frame .battle-replay-controls fieldset{padding:0 2px;gap:2px}.report-replay-frame .battle-replay-controls legend{display:none}
.report-replay-frame .battle-round-status{font-size:10px;margin:1px;flex:none}
#orientationGuard>button{min-height:44px;padding:5px 14px;margin-top:10px}
/* Full visual viewport, including keyboard pan. No inferred keyboard pixel height. */
.chat-overlay#overlay{inset:auto;top:var(--chat-top,0px);left:var(--chat-left,0px);width:var(--chat-width,100vw);height:var(--chat-height,100dvh);padding:5px;overflow:hidden;background:#03162cf7;align-items:stretch;justify-content:center}
.chat-overlay #panel{height:100%;max-height:100%;width:min(1000px,100%);overflow:hidden;scrollbar-gutter:auto}
.chat-overlay #panelBody{display:flex;flex-direction:column;padding:4px 6px;min-height:0;overflow:hidden}
.chat-overlay #chat-screen{min-height:0;flex:1;gap:3px}
.chat-overlay#overlay #panelBody .chat-tabs button{min-height:32px;padding:3px 8px;font-size:12px}
.chat-overlay .chat-heading{min-height:0;flex:none}
.chat-overlay .chat-heading h2{font-size:11px;line-height:1.1}
.chat-overlay .chat-heading button{min-height:26px;font-size:10px;padding:1px 5px}
.chat-overlay .chat-stream,.chat-overlay .chat-contacts{min-height:0;overflow-x:hidden;scrollbar-gutter:auto;flex:1 1 0}
.chat-overlay .chat-message{padding:3px 8px;line-height:1.25;font-size:12px;min-width:0;overflow-wrap:anywhere;white-space:normal;border-bottom:1px solid #17344b}
.chat-overlay .chat-message.chat-own{padding-inline-start:6px}
.chat-message time{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}
.chat-message .chat-tag{color:var(--gold);font-size:11px}
.chat-overlay.source-skin #panelBody .chat-message button,.source-skin .chat-overlay #panelBody .chat-message button{display:inline;min-width:0;min-height:0;border:0;border-image:none;background:none;box-shadow:none;padding:0;font:inherit;font-size:12px;line-height:1.25;vertical-align:baseline;white-space:normal;overflow-wrap:anywhere}
.chat-overlay .chat-message .chat-author{color:var(--cyan)}
.chat-overlay .chat-message .chat-coordinates{color:var(--gold);font-size:11px}
.chat-overlay .chat-text{white-space:normal;overflow-wrap:anywhere}
.chat-overlay #chat-compose{flex:none;margin:0;min-width:0}
.chat-overlay .chat-compose-row{gap:4px;min-height:44px;align-items:stretch}
.chat-overlay #panelBody #chat-input{font-size:16px;line-height:1.2;height:44px;min-height:44px;max-height:44px;padding:10px 6px;margin:0;width:100%;min-width:0;resize:none}
.chat-overlay#overlay #panelBody .chat-compose-row button{min-height:44px;padding:5px 10px;font-size:12px}
.chat-overlay .chat-attachment{min-height:24px;height:24px;font-size:10px;flex:none}
.chat-overlay .chat-attachment button{height:24px;min-height:24px;width:28px;padding:0}
.chat-overlay .mutation-error{margin:2px 6px;padding:3px;font-size:10px;line-height:1.15;max-height:44px;overflow:auto;flex:none}
.chat-overlay .mutation-error button{display:inline;min-height:28px;font-size:10px;padding:2px;margin:0}
@media(orientation:portrait){
 .reports-master-detail{grid-template-columns:minmax(92px,.28fr) minmax(0,.72fr);gap:4px}
 .reports-toolbar{flex-wrap:wrap}.reports-toolbar>button{flex:1 0 20%}.reports-toolbar #reportsClearRead{max-width:none;flex:1 0 65%}
 .reports-target-filter{font-size:0}.reports-target-filter select{font-size:11px}
 .report-facts{grid-template-columns:1fr;grid-auto-rows:minmax(0,1fr)}
 .report-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
 .report-resource-grid{gap:2px}
 .report-row time{grid-column:2;font-size:8px}.reports-screen#overlay #panelBody .report-row{grid-template-columns:6px minmax(0,1fr)}
 .report-unit-hint{max-height:24px;font-size:9px}
 .chat-overlay#overlay{padding:0}.chat-overlay #panel{border-inline:0;width:100%}
 .chat-overlay .chat-heading h2{font-size:12px}
}
@media(max-height:260px){
 .chat-overlay .panel-head{height:28px;min-height:28px}.chat-overlay .panel-head h1{font-size:13px}
 .chat-overlay .panel-head .close{height:28px;min-height:28px}
 .chat-overlay .chat-heading{display:none}
 .chat-overlay#overlay #panelBody .chat-tabs button{min-height:28px;height:28px;font-size:11px;padding:2px}
}
:is(.reports-screen,.chat-overlay) .panel-threat{flex:none;min-height:24px;height:24px;font-size:10px;padding:2px 6px;position:static}
.reports-screen .mutation-error{flex:none;max-height:38px;overflow:auto;margin:2px 6px;padding:2px 4px;font-size:10px;line-height:1.15}
.reports-screen .mutation-error button{display:inline;min-height:24px;font-size:10px;padding:2px;margin:0}
.report-recovery{flex-wrap:wrap;gap:2px;font-size:9px;line-height:1.1}
.reports-screen .report-unit-hint{margin:0}
:is(.reports-screen,.chat-overlay)#overlay #panelThreat{min-height:24px;height:24px;padding:2px 6px;line-height:18px}
:is(.reports-screen,.report-replay-screen,.chat-overlay)#overlay .panel-head{height:44px;min-height:44px}
:is(.reports-screen,.report-replay-screen,.chat-overlay)#overlay .panel-head .close{min-height:40px;height:40px;min-width:40px}
.report-metric{padding:3px;gap:3px}
.report-metric>small{font-size:8px;line-height:9px}
.report-resource-grid{gap:2px}
.report-resource-grid>span{line-height:12px;min-height:12px}
.report-resource-grid small{font-size:9px;line-height:12px}
.report-resource-grid b{font-size:11px;line-height:12px}
.report-comparison{font-size:10px;line-height:11px}
.report-comparison th,.report-comparison td{padding:0 2px;line-height:11px}
.report-levels{font-size:9px;line-height:11px;gap:1px}
.report-metric>b{font-size:13px;line-height:14px}
@media(max-height:260px){.chat-overlay#overlay .panel-head{height:28px;min-height:28px}.chat-overlay#overlay .panel-head .close{min-height:28px;height:28px}}
.chat-overlay#overlay #panelBody .chat-heading button{min-height:24px;height:24px;padding:2px 6px;line-height:18px}
.chat-overlay .chat-heading{height:24px;min-height:0}
.chat-overlay .chat-heading:has(h2:only-child){height:13px}
.chat-overlay#overlay,:is(.reports-screen,.report-replay-screen)#overlay{display:flex;align-items:stretch;justify-content:center}
.chat-overlay.chat-keyboard-compact#overlay .panel-head{height:28px;min-height:28px}
.chat-overlay.chat-keyboard-compact#overlay .panel-head .close{min-height:28px;height:28px}
.chat-overlay.chat-keyboard-compact .chat-heading{display:none}
.chat-overlay.chat-keyboard-compact#overlay #panelBody .chat-tabs button{min-height:28px;height:28px;font-size:11px;padding:2px}
@media(orientation:portrait){
 .reports-toolbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;min-width:0}
 .reports-screen#overlay #panelBody .reports-toolbar>button{min-width:0;white-space:normal;overflow-wrap:anywhere;font-size:10px;line-height:1.1}
 .reports-toolbar #reportsClearRead{grid-column:2/5;max-width:none}
}
