/*! Copyright (c) 2025-2026 Markus Schüssler. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-Markus-Schuessler-Proprietary; see repository LICENSE.
 */
/* A mode toolbar is one segmented button group, including its fullscreen action. */
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) { display:inline-flex; align-items:center; gap:0; padding:0; border:1px solid var(--ui-color-border); border-radius:var(--ui-radius-md,6px); color:var(--ui-color-text); background:var(--ui-color-surface); box-shadow:none; backdrop-filter:none; }
.ol-map-view-switch > button,
.xc-planner__map-mode > .ol-map-view-switch__button,
.task-replay-layers__mode > button { box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; flex:none; min-width:44px; height:44px; min-height:44px; margin:0; padding:0 12px; border:0; border-radius:0; color:var(--ui-color-text-muted); background:transparent; box-shadow:none; backdrop-filter:none; font:600 14px/1 var(--ui-font-family,Barlow,sans-serif); cursor:pointer; }
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) > button:not([hidden]) ~ button:not([hidden]) { border-left:1px solid var(--ui-color-border); }
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) > button:first-child { border-radius:var(--ui-radius-md,6px) 0 0 var(--ui-radius-md,6px); }
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) > button:last-child { border-radius:0 var(--ui-radius-md,6px) var(--ui-radius-md,6px) 0; }
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) > [hidden] { display:none!important; }
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) > select { min-height:44px; }
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) > button:hover:not(:disabled) { background:var(--ui-color-surface-hover); }
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) > button:is(.is-active,[aria-pressed="true"]) { color:var(--ui-color-map-active); background:var(--ui-color-map-active-surface); }
:is(.ol-map-view-switch,.xc-planner__map-mode,.task-replay-layers__mode) > button:focus-visible { outline:2px solid var(--ui-color-primary); outline-offset:-2px; }

/* Equivalent tools share a surface without changing which tools each map offers. */
:is(.map-controls-layout,.map-controls-layout__grid) :is(.flightmap-v2-map-control,.analyzer-map-control,.task-replay-layers__control,.replay-weather__toggle),
body.layout-default .analyzer-map-controls .analyzer-map-control,
.live-tracking .flightmap-v2-map-controls .flightmap-v2-map-control,
.xc-planner .xc-planner__map-control { box-sizing:border-box; width:44px; min-width:44px; height:44px; min-height:44px; border:1px solid var(--ui-color-border); border-radius:var(--ui-radius-md,6px); color:var(--ui-color-text-muted); background:var(--ui-color-surface); box-shadow:none; backdrop-filter:none; }
:is(.map-controls-layout,.map-controls-layout__grid) :is(.flightmap-v2-map-control,.analyzer-map-control,.task-replay-layers__control,.replay-weather__toggle):hover:not(:disabled),
body.layout-default .analyzer-map-controls .analyzer-map-control:hover:not(:disabled),
.live-tracking .flightmap-v2-map-controls .flightmap-v2-map-control:hover:not(:disabled),
.xc-planner .xc-planner__map-control:hover:not(:disabled) { background:var(--ui-color-surface-hover); }
:is(.map-controls-layout,.map-controls-layout__grid) :is(.flightmap-v2-map-control,.analyzer-map-control,.task-replay-layers__control,.replay-weather__toggle):is(.is-active,[aria-pressed="true"],[data-active="true"],[aria-expanded="true"]:not([aria-pressed]):not([data-active])),
body.layout-default .analyzer-map-controls .analyzer-map-control:is(.is-active,[aria-pressed="true"],[aria-expanded="true"]:not([aria-pressed]):not([data-active])),
.live-tracking .flightmap-v2-map-controls .flightmap-v2-map-control:is(.is-active,[aria-pressed="true"],[aria-expanded="true"]:not([aria-pressed]):not([data-active])),
.xc-planner .xc-planner__map-control:is(.is-active,[aria-pressed="true"],[aria-expanded="true"]:not([aria-pressed]):not([data-active])),
.task-replay-layers .task-replay-layers__control:is(.is-active,[aria-pressed="true"],[aria-expanded="true"]:not([aria-pressed]):not([data-active])) { border-color:var(--ui-color-map-active-border); color:var(--ui-color-map-active); background:var(--ui-color-map-active-surface); }
.task-replay-layers .task-replay-layers__control[data-layer-error="true"] { color:var(--ui-color-warning); }
:is(.map-controls-layout,.map-controls-layout__grid) :is(.flightmap-v2-map-control,.analyzer-map-control,.task-replay-layers__control,.replay-weather__toggle):focus-visible,
body.layout-default .analyzer-map-controls .analyzer-map-control:focus-visible,
.live-tracking .flightmap-v2-map-controls .flightmap-v2-map-control:focus-visible,
.xc-planner .xc-planner__map-control:focus-visible { outline:2px solid var(--ui-color-primary); outline-offset:2px; }
body.layout-default :is(.analyzer-map-menu,.analyzer-color-menu),
.live-tracking .flightmap-v2-map-menu,
.xc-planner .xc-planner__map-menu,
.task-replay-layers .task-replay-layers__panel { border:1px solid var(--ui-color-border); border-radius:var(--ui-radius-md,6px); color:var(--ui-color-text); background:var(--ui-color-surface); box-shadow:var(--ui-shadow-overlay); backdrop-filter:none; }

/* The live legend belongs to the color chooser, below its existing choices. */
[data-map-color-legend] { grid-column:1 / -1; min-width:0; padding-top:8px; margin-top:4px; border-top:1px solid var(--ui-color-border); color:var(--ui-color-text); font:12px/1.3 var(--ui-font-family,Barlow,sans-serif); }
[data-map-color-legend] .color-legend-title { margin:0 0 4px; color:var(--ui-color-text-muted); font-size:12px; }
[data-map-color-legend] :is(#legend-content,[data-analyzer-legend-content]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 8px; min-width:0; font-size:12px; }
[data-map-color-legend] .legend-item { display:flex; align-items:center; gap:6px; min-width:0; margin:0; padding:0; overflow-wrap:anywhere; }
[data-map-color-legend] .legend-item--note { grid-column:1 / -1; color:var(--ui-color-text-muted); }
[data-map-color-legend] .legend-color-bar { flex:0 0 24px; width:24px; min-width:24px; height:8px; margin:0; border-radius:2px; }

.replay-weather [data-map-weather-options]:not([hidden]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:4px; }
.replay-weather [data-map-weather-options] > :is([data-flightmap-v2-toggle-target="toggle-show-thermal-entries"],[data-analyzer-toggle-target="toggle-show-thermal-entries"]) { grid-column:1 / -1; }
.replay-weather [data-map-weather-options] > :is(button,label) { box-sizing:border-box; width:auto; min-width:0; min-height:44px; margin:0; padding:4px 6px; gap:4px; font-size:12px; line-height:1.25; }
.replay-weather [data-map-weather-options] > button i { flex:0 0 20px; width:20px; height:20px; margin:0; background:transparent; }

/* Keep the SDK's information icon at 24px inside an unobstructed 44px target. */
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-compact { box-sizing:border-box; min-width:44px; min-height:44px; border-radius:var(--ui-radius-md,6px); }
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) { width:44px; height:44px; padding:0; border:0; background:transparent; box-shadow:none; }
.maplibregl-map .maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-button { box-sizing:border-box; width:44px; min-width:44px; height:44px; min-height:44px; margin:0; padding:10px; border:0; border-radius:16px; background-color:#fff; background-clip:content-box; background-origin:content-box; background-position:center; background-repeat:no-repeat; background-size:24px; box-shadow:none; }
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-compact-show { padding:8px 44px 8px 8px; color:var(--ui-color-text); background:var(--ui-color-surface); }
.maplibregl-map :is(.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-top-left) > .maplibregl-ctrl-attrib.maplibregl-compact-show { padding:8px 8px 8px 44px; }
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner { overflow-wrap:anywhere; }
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-compact-show a { color:var(--ui-color-primary-strong); text-decoration:underline; }
.maplibregl-map .maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-button:focus-visible { outline:2px solid var(--ui-color-primary); outline-offset:-2px; }
