.ship-class-labels {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    color: #eee;
    font: 10px/12px Arial, sans-serif;
    text-shadow: none;
}

.ship-class-labels > div {
    position: absolute;
    inset-inline: 0;
    display: flex;
    white-space: pre;
    pointer-events: none;
}

/* Let the space before the label shrink when the name reaches the right edge. */
.ship-class-labels > div::before {
    content: "";
    flex: 0 1 var(--ship-x);
}

.EnemyScanEstimate::before { content: "\f05b"; }
.TerritoryControlled::before { content: "\f5ee"; }
#PlanetsContainer .territory-legend, #PlanetsContainer .territory-legend button { box-sizing: border-box; }
.territory-legend {
    --territory-top: 12px;
    position: absolute; top: var(--territory-top); left: 12px; z-index: 5;
    display: flex; flex-direction: column; width: max-content; max-width: min(20rem, calc(100% - 24px)); max-height: calc(100% - var(--territory-top) - 12px); border-radius: 5px;
    opacity: 1; color: #fff; background: linear-gradient(#303030, #171717); font: 14px/1.4 Arial, sans-serif;
}
#MapBottomButtons ~ .territory-legend { --territory-top: 63px; }
.territory-title, .territory-ok {
    flex: none; padding: 8px 10px; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.territory-title { background: linear-gradient(#444, #242424); border-radius: 5px 5px 0 0; font-weight: bold; }
.territory-ok { background: linear-gradient(#292929, #080808); border-radius: 0 0 5px 5px; color: #aaa; }
.territory-ok::before { content: "« "; }
.territory-legend ul { max-height: 35vh; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #666 #222; padding: 0; margin: 4px 10px 0; }
.territory-legend li { list-style: none; }
.territory-owner {
    display: flex; align-items: center; gap: 7px; width: 100%; padding: 4px 3px;
    background: transparent; border: 0; border-radius: 3px; color: inherit; font: inherit;
    text-align: left; overflow-wrap: anywhere; cursor: pointer;
}
.territory-owner::before { content: ""; flex: 0 0 14px; height: 14px; border-radius: 3px; background: var(--owner-color); }
.territory-owner:is(:hover, [aria-pressed=true]) { background: #444; }
.territory-legend button:focus { outline: none; box-shadow: none; }
.territory-legend button:focus-visible { text-decoration: underline; }
.territory-count, .territory-share { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.territory-count { margin-left: auto; color: #ddd; }
.territory-share { min-width: 5ch; text-align: right; }
.territory-features {
    flex: none; margin: 5px 10px 7px; padding: 6px 8px; border: 0; border-radius: 5px;
    background: linear-gradient(#494949, #303030); color: #eee; font: inherit; text-align: left; cursor: pointer;
}
.EnemyScanEstimate.toolactive::before { color: #ffa340; }

#LeftContent.MapReportPanel {
    top: 0;
    z-index: 82; /* Keep the panel controls above the mobile map toolbars. */
    width: min(400px, calc(52% / var(--game-ui-scale, 1)));
    height: calc(100% / var(--game-ui-scale, 1));
}
.MapReportPanel #BoxContainer {
    box-sizing: border-box;
    inset: 40px 0;
    height: auto;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    overflow-wrap: anywhere;
    scrollbar-width: thin;
    scrollbar-color: #666 #222;
    cursor: text;
}
.map-report-list { list-style: none; padding: 0; margin: 0; }
.map-report-list > li { position: relative; display: flow-root; padding: 12px 14px; }
.map-report-list > li + li { border-top: 1px solid #303030; }
.map-report-list > li:has(.map-report-location[aria-current]) { background: #303434; }
@media (hover: hover) {
    .map-report-list > li:has(.map-report-location):hover { background: linear-gradient(#333, #222); }
}
.map-report-image {
    float: right; width: auto; height: auto;
    max-width: min(32%, 60px); max-height: 60px;
    margin: 0 0 4px 8px; border-radius: 6px;
}
.map-report-list .map-report-location {
    position: absolute; inset: 0; width: 100%; height: 100%;
    margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer;
}
.map-report-list .map-report-location:focus { outline: none; }
.map-report-list > li:has(.map-report-location:focus-visible) { background: #394343; text-decoration: underline; }
#MapReportReader .map-report-group { margin: 0; padding: 0; }
.map-report-toggle {
    flex: none; margin-left: auto; padding: 5px 6px; border: 0;
    background: transparent; color: #ddd; font: inherit; line-height: 1.3; white-space: nowrap; cursor: pointer;
}
.map-report-toggle i { display: none; }
.map-report-toggle:focus { outline: none; box-shadow: none; }
.map-report-toggle:is(:hover, :focus-visible) { color: #fff; text-decoration: underline; }
.map-report-group > summary {
    display: flex; align-items: center; gap: 8px; padding: 9px 14px;
    font-size: 13px; line-height: 1.4; font-weight: bold; color: #eee;
    background: linear-gradient(#363636, #242424); cursor: pointer;
}
.map-report-group > summary::-webkit-details-marker { display: none; }
.map-report-count { margin-left: auto; color: #bbb; font-variant-numeric: tabular-nums; }
.map-report-group > summary::after { content: ""; width: 6px; height: 6px; border: solid #bbb; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.map-report-group[open] > summary::after { transform: rotate(135deg); }
.map-report-group h3 { margin: 0 0 4px; color: #fff; font-family: inherit; font-size: 15px; line-height: 1.3; }
.map-report-group summary i, .map-report-filters .dashboard-filters button i { color: var(--report-accent, #acc2d2); }
:is(.map-report-group, .map-report-filters button):is([data-report-type="6"], [data-report-type="10"], [data-report-type="16"], [data-report-type="critical"]) { --report-accent: #ffab75; }
:is(.map-report-group, .map-report-filters button):is([data-report-type="5"], [data-report-type="2"], [data-report-type="15"]) { --report-accent: #9dd88d; }
:is(.map-report-group, .map-report-filters button):is([data-report-type="3"], [data-report-type="4"], [data-report-type="12"]) { --report-accent: #d6a5ec; }
:is(.map-report-group, .map-report-filters button):is([data-report-type="7"], [data-report-type="8"], [data-report-type="11"]) { --report-accent: #7fd7e0; }
#Alerts .map-reports-task {
    display: block; box-sizing: border-box; width: 100%; height: calc(1lh + 1px);
    background: transparent; box-shadow: none; border-width: 0 0 1px;
    color: inherit; font-family: inherit; text-align: left;
}
#Alerts .map-reports-task:is(:active, :focus) { outline: none; box-shadow: none; }
#Alerts .map-reports-task:focus-visible { text-decoration: underline; }
.map-report-body { color: #ddd; font-size: 14px; line-height: 1.5; }
.MapReportPanel #rNavTop { cursor: pointer; color: #aaa; }
.MapReportReader .BoxTopTitle { display: flex; align-items: center; gap: 4px; container-type: inline-size; }
@container (max-width: 265px) {
    .map-report-toggle i { display: inline-block; }
    .map-report-toggle span { display: none; }
}
.MapReportReader .TopTitleBlock { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-report-filter { flex: none; max-width: 50%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-right: 3px; padding: 5px 8px; border: 0; border-radius: 5px; background: linear-gradient(#565656, #333); color: #eee; font: inherit; line-height: 1.3; cursor: pointer; }
.map-report-filter:focus, .map-report-filters .dashboard-filters button:focus { outline: none; box-shadow: none; }
.map-report-filter:focus-visible span, .map-report-filters .dashboard-filters button:focus-visible span { text-decoration: underline; }
#PlanetsContainer dialog.map-report-filters {
    --picker-width: min(340px, calc(100vw - 16px));
    box-sizing: border-box; position: fixed; inset: 8px auto auto;
    left: clamp(8px, calc(var(--panel-edge) + 5px), calc(100vw - var(--picker-width) - 8px));
    width: var(--picker-width); max-height: calc(100dvh - 16px);
    margin: 0; padding: 0; overflow: hidden; border: 1px solid #444; border-radius: 8px;
    color: #eee; background: #161616; font: inherit;
}
.map-report-filters[open] { display: flex; flex-direction: column; }
.map-report-filters::backdrop { background: rgb(0 0 0 / 24%); }
.map-report-filters h2 { margin: 0; padding: 10px 12px; background: linear-gradient(#444, #242424); font-size: 15px; cursor: pointer; }
.map-report-filters .dashboard-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); overflow: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: #666 #222; }
.map-report-filters .dashboard-filters button { white-space: normal; text-align: left; }
.map-report-filters .dashboard-filters button b { margin-left: auto; }
.map-report-ok { padding: 9px; border: 0; background: linear-gradient(#292929, #080808); color: #aaa; text-align: left; font: inherit; cursor: pointer; }
.map-report-ok::before { content: "« "; }

dialog.enemy-scan-picker {
    box-sizing: border-box;
    width: min(24rem, 94vw);
    max-height: 85vh;
    margin: auto;
    padding: 16px;
    border: 1px solid #494949;
    border-radius: 10px;
    color: #eee;
    background: linear-gradient(#303030, #191919);
    font: 14px/1.4 Arial, sans-serif;
}
.enemy-scan-picker::backdrop { background: rgb(0 0 0 / 50%); }
.enemy-scan-picker h2 { margin: 0; font-size: 18px; }
.enemy-scan-picker p { margin: 6px 0 12px; color: #ccc; }
.enemy-scan-picker fieldset {
    min-width: 0;
    max-height: 44vh;
    overflow-y: auto;
    scrollbar-color: #666 #242424;
    margin: 0;
    padding: 0;
    border: 0;
}
.enemy-scan-picker legend { color: #ddd; font-weight: bold; }
.enemy-scan-picker label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.enemy-scan-picker label:hover, .enemy-scan-picker label:focus-within { background: #383838; }
.enemy-scan-picker input { accent-color: #ffa340; }
.enemy-scan-picker label small { margin-left: auto; white-space: nowrap; color: #bbb; }
.enemy-scan-picker footer { display: flex; gap: 8px; margin-top: 14px; }
.enemy-scan-picker button {
    border: 0;
    border-radius: 5px;
    padding: 7px 12px;
    background: linear-gradient(#555, #333);
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.enemy-scan-picker button:disabled { opacity: .45; }
.enemy-scan-picker button:first-child { margin-right: auto; }
