/* ee-shell-map.css — see docs/project-shell.md
 *
 * Zone C (Werkzeugleiste ueber der Karte + Popover) und Zone E-Kartenrand
 * (eine Kapsel unten rechts: Karten-Menue, 3D, Zoom, Kompass; Legende unten links).
 * Masse aus Zieldesign-Konfiguration-2026-10-20.html (.toolbar/.tg/.tb/.popover/
 * .prow/.legend/.mapnav). Farben/Geometrie nur ueber --ees-* (ee-shell-tokens.css).
 * Die alten Elemente (.mapSettingIcons, #turnTiltContainer, .blueprintMapPopup,
 * #layerLegendContainer) behalten ihre IDs; hier wird nur ihre Darstellung im
 * neuen Ort ueberschrieben. 64px = Hoehe der Sonnenleiste (Zone E, Mockup .sunbar).
 */

/* ── Sichtbarkeit: nur Konfiguration (body[data-ees-module]); ohne Attribut wie
      die alte Icon-Leiste (#mapControlsTopRight.visible, gesetzt von icon5Function) */
#mapControlsTopRight.ees-legacy-slot { display: none; }
.ees-toolbar-wrap,
.ees-mapedge { display: none; }
body:not([data-ees-module]) #mapControlsTopRight.visible ~ .ees-toolbar-wrap,
body[data-ees-module="config"] .ees-toolbar-wrap { display: block; }
body:not([data-ees-module]) #mapControlsTopRight.visible ~ .ees-mapedge,
body[data-ees-module="config"] .ees-mapedge { display: flex; }
body[data-ees-module]:not([data-ees-module="config"]) #layerLegendContainer,
body[data-ees-module]:not([data-ees-module="config"]) #nearbyCompanyPanel { display: none !important; }

/* ── gemeinsam ─────────────────────────────────────────────────────────── */
.ees-glass {
    background: var(--ees-glass-bg);
    -webkit-backdrop-filter: var(--ees-backdrop);
    backdrop-filter: var(--ees-backdrop);
    border: 1px solid var(--ees-glass-border);
    box-shadow: var(--ees-glass-shadow);
    color: var(--ees-text);
    font-family: var(--ees-font);
}
.ees-toolbar-wrap .ees-i,
.ees-mapedge .ees-i {
    width: var(--ees-bar-icon);
    height: var(--ees-bar-icon);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

/* ── C: Werkzeugleiste ─────────────────────────────────────────────────── */
.ees-toolbar-wrap {
    /* E45: fixed in the horizontal centre of the map area. It used to be centred in the free
       zone F (--ees-f-left/--ees-f-right), so it slid left whenever the inspector opened
       (body.ees-inspector-open widens --ees-f-right). Now it only moves if it would otherwise
       run under a panel: clamp to F using its own width --sm-tb-w (project-shell-map.js). */
    --sm-half: calc(var(--sm-tb-w, 0px) / 2);
    position: absolute;
    top: var(--ees-top);
    left: clamp(calc(var(--ees-f-left) + var(--sm-half)), 50%, calc(100% - var(--ees-f-right) - var(--sm-half)));
    transform: translateX(-50%);
    width: max-content;
    z-index: 6;
}
/* Layout v2.1: one button per tool with its own short name below the icon. The names show
   on the first visit and whenever "⋯ › Beschriftungen zeigen" is on (.ees-tb-labels, set by
   project-shell-map.js); otherwise icon + tooltip with the shortcut. When F is too narrow
   the names step back automatically (Layoutsystem K4 ②). */
.ees-toolbar {
    display: flex;
    align-items: center;
    height: var(--ees-bar-h);          /* same bar as sun bar and map capsule (ee-shell-tokens.css) */
    box-sizing: border-box;
    padding: 0 var(--ees-bar-pad);
    border-radius: var(--ees-bar-radius);
    box-shadow: var(--ees-bar-shadow);
}
.ees-toolbar.ees-tb-labels { height: var(--ees-toolbar-h); border-radius: var(--ees-radius-panel, 20px); }
.ees-tg {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
    padding: 0 4px;
}
.ees-tg[hidden] { display: none; }
.ees-tg + .ees-tg { margin-left: 1px; }
.ees-tg + .ees-tg::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 50%;
    width: 1px;
    height: 24px;
    margin-top: -12px;
    background: var(--ees-border);
}
.ees-tl {
    display: none;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: var(--ees-text-dim);
}
.ees-toolbar.ees-tb-labels .ees-tl { display: block; }

/* Knoepfe: neue <button class="ees-tb"> und das alte .mapSettingIcons
   (#terrainAnalysisToggle) sehen gleich aus */
.ees-tb,
.ees-toolbar .mapSettingIcons {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: var(--ees-bar-btn);
    height: var(--ees-bar-btn);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;                /* round like the buttons of the bottom bars */
    background: none;
    color: var(--ees-text);
    fill: none;
    stroke: currentColor;
    cursor: pointer;
    transform: none;
    transition: background-color 0.15s, color 0.15s;
}
.ees-toolbar.ees-tb-labels .ees-tb,
.ees-toolbar.ees-tb-labels .mapSettingIcons { width: 56px; height: 50px; border-radius: var(--ees-radius-sm); }
.ees-toolbar .mapSettingIcons:hover { transform: none; }

/* One tooltip look for the toolbar (below the button) and the map capsule (above it,
   further down): opaque dark chip from the --ees-tip-* tokens (E44, readable over any
   aerial photo, light and dark theme). Only content and placement differ per zone. */
.ees-toolbar [data-ees-tip]::after,
.ees-mapedge [data-ees-tip]::after {
    position: absolute;
    left: 50%;
    z-index: 8;
    padding: 5px 9px;
    border-radius: var(--ees-tip-radius);
    background: var(--ees-tip-bg);
    border: 1px solid var(--ees-tip-border);
    box-shadow: var(--ees-tip-shadow);
    color: var(--ees-tip-text);
    font: 500 11.5px/1.3 var(--ees-font);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s, transform 0.12s;
}

/* Tooltip of a tool: name + shortcut, below the button (never over the header) */
.ees-toolbar [data-ees-tip]::after {
    content: attr(data-ees-tip) "  " attr(data-ees-key);
    top: calc(100% + 8px);
    white-space: pre;
    transform: translate(-50%, -4px);
}
.ees-toolbar [data-ees-tip]:hover::after,
.ees-toolbar [data-ees-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.35s; }
.ees-toolbar [aria-expanded="true"]::after { display: none; }
@media (prefers-reduced-motion: reduce) { .ees-toolbar [data-ees-tip]::after { transition: none; } }
.ees-tb:hover:not(:disabled),
.ees-toolbar .mapSettingIcons:hover { background: var(--ees-surface-3); }
.ees-tb:focus-visible,
.ees-toolbar .mapSettingIcons:focus-visible,
.ees-prow:focus-visible,
.ees-popover .mapSettingIcons:focus-visible,
.ees-nb:focus-visible { outline: 2px solid var(--ees-accent); outline-offset: 1px; }

/* aktiv = gruen gefuellt (Mockup .tg.act .tb.on) */
.ees-tb[aria-expanded="true"],
body.ees-drawing .ees-tb[data-ees-drawing="on"],
.ees-toolbar-wrap:has(#measureTool.active) #eesMeasureBtn,
.ees-toolbar .mapSettingIcons.active {
    background: var(--ees-accent);
    color: var(--ees-accent-text) !important; /* #terrainAnalysisToggle setzt style.color inline */
}
.ees-tb[aria-expanded="true"] .ees-tl,
body.ees-drawing .ees-tb[data-ees-drawing="on"] .ees-tl,
.ees-toolbar-wrap:has(#measureTool.active) #eesMeasureBtn .ees-tl,
.ees-toolbar .mapSettingIcons.active .ees-tl { color: inherit; }
.ees-toolbar .mapSettingIcons.loading { animation: infraPulse 1s ease-in-out infinite; }

/* gesperrt (DesignSperre / Showroom) */
.ees-tg.is-locked .ees-tb { opacity: 0.4; cursor: not-allowed; }

/* E47: Schalter "Anlage anzeigen" in der Gruppe Elektro (project-electrical.js ensurePlantToggle), nur bei
   sichtbarem Elektro. Ruhig wie der Rest der Leiste: Symbol, kleiner Schalter (.ees-sw, Zustand = Klasse
   "active"), kurzer Name, daneben das "i" mit dem deckenden E44-Tooltip (--ees-tip-*). */
.ees-tbsw-wrap { display: inline-flex; align-items: center; gap: 2px; height: 38px; margin-left: 2px; }
.ees-tbsw-wrap[hidden] { display: none; }
.ees-tbsw {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: var(--ees-radius-sm);
    background: none;
    color: var(--ees-text);
    font: 500 12px/1 var(--ees-font);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s;
}
.ees-tbsw:hover { background: var(--ees-surface-3); }
.ees-tbsw:focus-visible,
.ees-toolbar .ees-tb-i:focus-visible { outline: 2px solid var(--ees-accent); outline-offset: 1px; }
.ees-tbsw .ees-i { width: 17px; height: 17px; }
.ees-tbsw:not(.active) .ees-i,
.ees-tbsw:not(.active) .ees-tbsw-l { color: var(--ees-text-dim); }
.ees-toolbar .ees-tb-i {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid var(--ees-border-strong, #bbb);
    color: var(--ees-text-dim);
    font: italic 600 9.5px/1 Georgia, serif;
    cursor: help;
}
.ees-toolbar .ees-tb-i:hover { color: var(--ees-accent); border-color: var(--ees-accent); }
/* Erklärung = mehrzeiliger Text: umbrechen statt einer langen Zeile, sonst gleicher Chip wie jedes Werkzeug */
.ees-toolbar .ees-tb-i[data-ees-tip]::after {
    content: attr(data-ees-tip);
    width: 260px;
    white-space: normal;
    text-align: left;
    font-style: normal;
    font-family: var(--ees-font);
}

/* ── C: Popover ────────────────────────────────────────────────────────── */
.ees-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 7;
    width: 248px;
    max-height: calc(100vh - var(--ees-top) - 90px);
    overflow-y: auto;
    padding: 8px;
    border-radius: var(--ees-radius);
    font-size: 13px;
}
.ees-popover[hidden] { display: none; }
.ees-toolbar-wrap > .ees-popover::before {
    content: "";
    position: absolute;
    top: -6px;
    left: var(--sm-arrow-x, 30px);
    width: 10px;
    height: 10px;
    transform: rotate(45deg);
    background: linear-gradient(var(--ees-glass-tint), var(--ees-glass-tint));
    border-left: 1px solid var(--ees-glass-border);
    border-top: 1px solid var(--ees-glass-border);
}
.ees-ph {
    padding: 6px 8px 8px;
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--ees-text-dim);
}
.ees-pfoot {
    margin-top: 4px;
    padding: 8px 8px 4px;
    border-top: 1px solid var(--ees-border);
    font-size: 11px;
    color: var(--ees-text-dim);
}

/* Zeilen: neue .ees-prow und die alten Elemente im Popover */
.ees-prow,
.ees-popover .mapSettingIcons,
.ees-popover .blueprintMapIcon {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ees-text);
    fill: none;
    stroke: none;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transform: none;
    transition: background-color 0.15s;
}
.ees-prow[hidden] { display: none; }

/* Umkreis unter Autobahnen / Bahnstrecken (bis 50 km, Chips wie bei den Stromleitungen) */
.ees-lrad { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 8px 8px 44px; font-size: 12px; color: var(--ees-text-dim); }
.ees-lrad[hidden] { display: none; }
/* "200 m-Korridor (§35)" unter Autobahnen / Bahnstrecken: eingerueckter, kleinerer Schalter */
.ees-popover .mapSettingIcons.ees-lsub { padding-left: 44px; font-size: 12px; color: var(--ees-text-dim); }
.ees-lsub[hidden] { display: none; }
.ees-lrad-chips { display: inline-flex; gap: 4px; }
.ees-lrad-chip { padding: 3px 9px; border-radius: 99px; border: 1px solid var(--ees-border-strong); background: transparent; color: var(--ees-text-dim); font: inherit; line-height: 1.3; cursor: pointer; }
.ees-lrad-chip.on { background: var(--ees-accent-soft); border-color: var(--ees-accent); color: var(--ees-text); }
.ees-lrad-chip:focus-visible, .ees-lrad-val input:focus-visible { outline: 2px solid var(--ees-accent); outline-offset: 1px; }
.ees-lrad-val { display: inline-flex; align-items: center; gap: 3px; margin: 0; }
.ees-lrad-val input { width: 46px; padding: 2px 4px; border: 1px solid var(--ees-border-strong); border-radius: 6px; background: transparent; color: var(--ees-text); font: inherit; text-align: right; }
.ees-lrad-val i { font-style: normal; }

/* Farbregel der Flaechen (Legende im Ebenen-Menue, eesRenderAreaStyle) */
.ees-plegend { display: grid; gap: 5px; margin: 6px 4px 2px; padding: 8px 4px 0; border-top: 1px solid var(--ees-border); font-size: 11px; color: var(--ees-text-dim); }
.ees-plegend div { display: flex; align-items: center; gap: 8px; }
.ees-plegend i { flex: none; width: 18px; height: 10px; border-radius: 3px; box-sizing: border-box; }
.ees-plegend .ees-lg-area { border: 2px solid var(--ees-info); }
.ees-plegend .ees-lg-sel { border: 3px solid var(--ees-info); background: color-mix(in srgb, var(--ees-info) 18%, transparent); }
.ees-plegend .ees-lg-bound { height: 0; border-top: 2px dashed var(--ees-accent-strong); border-radius: 0; }
/* E43: Ebene „Vorgewende anzeigen“ — Legende und „i“ in der Zeile */
.ees-plegend .ees-lg-parcel { height: 0; border-top: 1px solid var(--ees-text-dim); border-radius: 0; }
.ees-plegend .ees-lg-headland { border: 1px solid #ff9f0a; background: rgba(255, 159, 10, 0.18); }
.ees-popover .ees-prow .ees-info {
    display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: auto;
    border-radius: 50%; border: 1px solid var(--ees-border-strong, #bbb); font: 600 9px/1 Georgia, serif; font-style: italic;
    color: var(--ees-text-dim, #666); cursor: help; flex: none;
}
.ees-popover .ees-prow .ees-info:hover, .ees-popover .ees-prow .ees-info:focus-visible { color: var(--ees-accent); border-color: var(--ees-accent); }
.ees-prow:hover,
.ees-popover .mapSettingIcons:hover,
.ees-popover .blueprintMapIcon:hover { background: var(--ees-surface-3); transform: none; }
.ees-prow .ees-i,
.ees-popover .mapSettingIcons .ees-i { width: 16px; height: 16px; stroke: currentColor; color: var(--ees-text-dim); }
.ees-popover .mapSettingIcons > svg:not(.ees-i) { display: none; } /* Fremd-Icons (#iconFlurstuecke, #autoDimensionTool) */
.ees-popover .mapSettingIcons.loading { animation: infraPulse 1s ease-in-out infinite; }
/* Flurstücke row (ee-flurstuecke.js): a normal toggle row; the legacy #iconFlurstuecke button rules (3rem box, orange) do not apply here */
.ees-popover #iconFlurstuecke { width: 100%; height: auto; justify-content: flex-start; border-radius: 8px; }
.ees-popover #iconFlurstuecke:hover { transform: none; }
.ees-popover #iconFlurstuecke.active { background: none; }
.ees-popover #iconFlurstuecke.loading { animation: none; }
.ees-fs-spin { display: none; flex: none; width: 12px; height: 12px; margin-left: auto; border: 2px solid var(--ees-border); border-top-color: var(--ees-accent); border-radius: 50%; animation: ees-fs-spin 0.8s linear infinite; }
#iconFlurstuecke.loading .ees-fs-spin { display: block; }
#iconFlurstuecke.is-error .ees-prow-label { color: var(--ees-warn); }
@keyframes ees-fs-spin { to { transform: rotate(360deg); } }

/* Schalter (Mockup .prow .sw) — Zustand = Klasse "active" des alten Elements */
.ees-sw {
    position: relative;
    flex: none;
    width: 28px;
    height: 16px;
    border-radius: 99px;
    background: var(--ees-border-strong);
    transition: background-color 0.15s;
}
.ees-sw::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.15s;
}
.active > .ees-sw { background: var(--ees-accent); }
.active > .ees-sw::after { left: 14px; }

/* Export › Blueprint (nur Admin): Unterzeilen nur bei aktivem Blueprint wie bisher */
#eesPopExport .mapBlueprintContainer { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--ees-border); }
#eesPopExport .blueprintMapPopup {
    position: static;
    display: none;
    padding: 0 0 0 12px;
    background: none;
    opacity: 1;
    z-index: auto;
}
#eesPopExport .blueprintMapPopup.active { display: block; }

/* ── E: Kartenrand unten rechts = EINE Glas-Kapsel (Apple Karten) ───────
 * Quer (horizontal), von links nach rechts: Karten-Menue (Kartenstil, Gelaende,
 * Neigen/Drehen), 3D, Zoom +/-, Kompass. 40 px hoch wie die bisherige Spalte breit war
 * (die Sonnenleiste haelt dafuer --ees-sunbar-edge = 2 * gap + 40 px frei). Bei offenem
 * Inspektor rutscht sie links neben ihn (nie darunter); Zahlen: tests/js/ee-shell-map-capsule.dom.cjs.
 * Eigene Tooltips (data-ees-tip statt title) klappen immer nach OBEN auf, damit sie nie
 * den naechsten Knopf verdecken (Till 20.10.2026, Screenshot "Kartenstil und Gelaende"
 * ueberlappte den 3D-Knopf in der alten senkrechten Kapsel). */
.ees-mapedge {
    position: absolute;
    right: var(--ees-f-right);
    bottom: var(--ees-gap);
    z-index: 6;
    flex-direction: row;
    align-items: center;
    box-sizing: border-box;
    height: var(--ees-bar-h);          /* same bar as the sun bar (ee-shell-tokens.css --ees-bar-*) */
    padding: 0 var(--ees-bar-pad);
    border-radius: var(--ees-bar-radius);
    box-shadow: var(--ees-bar-shadow);
    transition: right 0.2s ease;
}
@media (prefers-reduced-motion: reduce) { .ees-mapedge { transition: none; } }
.ees-col {
    position: relative;
    display: flex;
    flex-direction: row;
}
#eesMapEdge #resizeMap { margin: 0; } /* alter Abstand aus ee-project-styles.css */
.ees-sep { width: 1px; align-self: stretch; margin: 14px 0; background: var(--ees-border); }
.ees-nb,
.ees-mapedge .resizeMapIcon {
    display: grid;
    place-items: center;
    width: var(--ees-bar-btn);
    height: var(--ees-bar-btn);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;                /* round like play / toggles of the sun bar */
    background: none;
    color: var(--ees-text);
    fill: none;
    stroke: currentColor;
    font: 650 12px/1 var(--ees-font);
    letter-spacing: 0.3px;
    cursor: pointer;
    transform: none;
    user-select: none;
    transition: background-color 0.15s, color 0.15s;
}
.ees-nb:hover,
.ees-mapedge .resizeMapIcon:hover { background: var(--ees-surface-3); transform: none; }
.ees-nb[aria-expanded="true"],
.ees-nb[aria-pressed="true"]:not(.ees-nb-3d) { background: var(--ees-surface-3); color: var(--ees-accent-strong); }
.ees-nb:disabled { opacity: 0.4; cursor: default; }
.ees-nb:disabled:hover { background: none; }
/* 3D an = gruen gefuellt wie die aktiven Werkzeuge (Zustand = Klasse "active", pv3dMarkIcons) */
.ees-nb-3d.active { background: var(--ees-accent); color: var(--ees-accent-text); }
.ees-nb-3d.active:hover { background: var(--ees-accent-strong); }

/* Eigener Tooltip der Kapsel (ersetzt title, damit nichts von der Browser-Platzierung
   verdeckt wird): oeffnet immer nach oben, mittig ueber dem Knopf; am linken/rechten
   Rand der Kapsel (Karten-Menue/Kompass) bleibt er im Bild (align start/end). */
.ees-mapedge [data-ees-tip] { position: relative; }
.ees-mapedge [data-ees-tip]::after {
    content: attr(data-ees-tip);
    bottom: calc(100% + 8px);
    white-space: nowrap;
    transform: translate(-50%, 4px);
}
.ees-mapedge [data-ees-tip-align="start"]::after { left: 0; transform: translate(0, 4px); }
.ees-mapedge [data-ees-tip-align="end"]::after { left: auto; right: 0; transform: translate(0, 4px); }
.ees-mapedge [data-ees-tip]:hover::after,
.ees-mapedge [data-ees-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.ees-mapedge [data-ees-tip-align="start"]:hover::after,
.ees-mapedge [data-ees-tip-align="start"]:focus-visible::after,
.ees-mapedge [data-ees-tip-align="end"]:hover::after,
.ees-mapedge [data-ees-tip-align="end"]:focus-visible::after { transform: translate(0, 0); }
@media (prefers-reduced-motion: reduce) { .ees-mapedge [data-ees-tip]::after { transition: none; } }

/* Kompass: #iconTiltTurn ist die Nadel (project-map.js dreht/neigt sie mit der Karte),
 * Apple-Karten-artig: roter Nordhalbkreis, grauer Suedhalbkreis, kleines "N".
 * Bei Bearing 0 (data-ees-bearing="0", project-shell-map.js syncCompass) dezent. */
#eesCompassKnob { touch-action: none; }
#eesCompassKnob #iconTiltTurn {
    width: 22px;
    height: 22px;
    transition: none;
    pointer-events: auto;
}
.ees-needle { width: 22px; height: 22px; display: block; transition: opacity 0.15s; }
#eesCompassKnob[data-ees-bearing="0"] .ees-needle { opacity: 0.6; }
#eesCompassKnob:hover .ees-needle,
#eesCompassKnob:focus-visible .ees-needle { opacity: 1; }
.ees-needle-ring { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.35; }
.ees-needle-n { fill: var(--ees-danger); }
.ees-needle-s { fill: var(--ees-text-faint); }
.ees-needle-pin { fill: var(--ees-surface); }
.ees-needle-label { font: 700 4.5px var(--ees-font); fill: var(--ees-text-dim); }

/* Popover der Kapsel (Ebenen, Kartenstil): am Knopf verankert, oeffnen nach oben,
   rechtsbuendig mit F (= mit der Kapsel), Unterkante 10 px ueber der unteren Reihe,
   Oberkante bleibt unter der Werkzeugleiste; scrollen innen (Layoutsystem, Popover). */
.ees-mapedge > .ees-popover {
    top: auto;
    left: auto;
    right: 0;
    bottom: calc(var(--ees-sunbar-h) + 10px); /* ueber der ganzen unteren Reihe (Kapsel 40, Sonnenleiste 52) */
    width: 260px;
    max-height: calc(100vh - var(--ees-top) - var(--ees-toolbar-h) - 3 * var(--ees-gap) - 54px);
}
#eesPopMap { width: 240px; }
.ees-style-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 4px 8px; }
.ees-style-opt,
.ees-popover .mapSettingIcons.ees-style-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 10px 6px 8px;
    border: 1px solid var(--ees-border);
    border-radius: var(--ees-radius-sm);
    background: var(--ees-surface-2);
    color: var(--ees-text);
    font-size: 12px;
    text-align: center;
    cursor: pointer;
}
.ees-style-opt .ees-i,
.ees-popover .mapSettingIcons.ees-style-opt .ees-i { width: 22px; height: 22px; color: var(--ees-text); stroke: currentColor; }
.ees-style-opt:hover,
.ees-popover .mapSettingIcons.ees-style-opt:hover { background: var(--ees-surface-3); }
.ees-style-opt[aria-checked="true"],
.ees-popover .mapSettingIcons.ees-style-opt[aria-checked="true"] { border-color: var(--ees-accent); box-shadow: inset 0 0 0 1px var(--ees-accent); }
.ees-style-opt:focus-visible { outline: 2px solid var(--ees-accent); outline-offset: 1px; }
.ees-pop-tilt { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--ees-border); }
/* alte Slider (#iconTilt/#iconTurn) im Karten-Menue statt frei auf der Karte */
#eesPopMap #turnTiltContainer { opacity: 1; z-index: auto; display: flex; flex-direction: column; gap: 6px; padding: 0 8px 6px; }
#eesPopMap #iconTilt,
#eesPopMap #iconTurn {
    position: static;
    display: block;
    transform: none;
}
#eesPopMap #iconTilt::before,
#eesPopMap #iconTurn::before {
    content: attr(data-tooltip);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--ees-text-dim);
}
#eesPopMap #iconTilt::after,
#eesPopMap #iconTurn::after { content: none; display: none; }
#eesPopMap .slider-container-tilt-turn { width: 100%; height: 20px; }
#eesPopMap input#tiltSlider,
#eesPopMap input#turnSlider {
    position: static;
    width: 100%;
    height: 4px;
    transform: none;
    accent-color: var(--ees-accent);
    background-color: var(--ees-surface-3);
}

/* ── E: Legende unten links ───────────────────────────────────────────── */
/* Karte in F unten links, ueber der unteren Reihe; nur mit aktiver Ebene (project-map.js
   updateLegendVisibility setzt display), einklappbar zum Knopf "Legende" in der Kapsel
   (body.ees-legend-closed, gemerkt) und weicht einem Popover aus, wenn F zu schmal ist
   (body.ees-legend-yield, project-shell-map.js). */
#layerLegendContainer {
    position: absolute;
    left: var(--ees-f-left);
    right: auto;
    /* + 22 px: the sun bar's time bubble (.ees-sunbar__bubble) rises above the bar and covered the last legend row (QA 01.11.) */
    bottom: calc(var(--ees-gap) + var(--ees-sunbar-h) + 10px + 22px);
    z-index: 5;
    box-sizing: border-box;
    min-width: 180px;
    max-width: 272px;
    max-height: min(236px, calc(100% - var(--ees-top) - var(--ees-toolbar-h) - 4 * var(--ees-gap) - var(--ees-sunbar-h) - 22px));
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid var(--ees-glass-border);
    border-radius: var(--ees-radius-md);
    background: var(--ees-glass-bg);
    -webkit-backdrop-filter: var(--ees-backdrop);
    backdrop-filter: var(--ees-backdrop);
    box-shadow: var(--ees-glass-shadow);
    color: var(--ees-text);
    font-family: var(--ees-font);
    font-size: 12px;
    scrollbar-color: var(--ees-border-strong) transparent;
}
.ees-legend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -2px -4px 6px;
    padding: 2px 4px 6px;
    border-bottom: 1px solid var(--ees-border);
}
.ees-legend-title {
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ees-text-dim);
}
body.ees-legend-closed #layerLegendContainer,
body.ees-legend-yield #layerLegendContainer { display: none !important; }
.ees-legend-close {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin: -2px -4px -2px 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--ees-text-dim);
    cursor: pointer;
}
.ees-legend-close .ees-i { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ees-legend-close:hover { background: var(--ees-surface-3); color: var(--ees-text); }
.ees-legend-close:focus-visible { outline: 2px solid var(--ees-accent); outline-offset: 1px; }
#layerLegendContainer .legend-section:not(:last-child) { margin-bottom: 10px; padding-bottom: 8px; border-bottom-color: var(--ees-border); }
#layerLegendContainer .legend-header {
    margin-bottom: 6px;
    padding-top: 0;
    border-top: 0;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ees-text-dim);
}
#layerLegendContainer .legend-color { width: 16px; height: 3px; border-radius: 2px; }
/* Inhalte unveraendert; feste helle Textfarben der Terrain-Legende folgen dem Thema */
#layerLegendContainer .legend-text,
#layerLegendContainer label,
#layerLegendContainer span[style*="--ee-text-primary"] { color: var(--ees-text) !important; }

/* Panels der Ebenen: oben rechts statt neben der alten Icon-Spalte */
#nearbyCompanyPanel,
#mastrMatchBanner { top: calc(var(--ees-top) + var(--ees-toolbar-h) + 12px); right: var(--ees-f-right); }

/* ── Schmal (Tablet hoch und enger, auch mit offenem Inspektor): die quere Kapsel
   braucht mehr Breite als dort noch frei ist (Sonnenleiste muesste auf < 240 px
   schrumpfen) - dort wieder die bewaehrte senkrechte Spalte, 40 px breit wie vorher
   (--ees-sunbar-edge faellt entsprechend zurueck). Tooltipp-Richtung (nach oben)
   bleibt gleich, loest das Ueberlappungs-Problem in beiden Anordnungen. */
@media (max-width: 900px) {
    .ees-mapedge { flex-direction: column; height: auto; width: var(--ees-bar-h); padding: var(--ees-bar-pad) 0; }
    .ees-col { flex-direction: column; }
    .ees-sep { width: auto; height: 1px; align-self: stretch; margin: 0 14px; }
    .ees-mapedge > .ees-popover { right: calc(100% + 10px); } /* hochkant: links daneben, ueber der Sonnenleiste */
    /* --ees-sunbar-edge faellt zurueck auf 40 px: siehe ee-shell-sunbar.css (gleiche Breakpoint-Grenze) */
}

/* ── Handy: Leiste unter der Kopfzeile, quer scrollbar, nur Icons ─────── */
@media (max-width: 767px) {
    .ees-toolbar-wrap {
        left: var(--ees-gap);
        right: var(--ees-gap);
        width: auto;
        transform: none;
    }
    .ees-toolbar {
        height: 48px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .ees-toolbar::-webkit-scrollbar { display: none; }
    .ees-tg { flex-wrap: nowrap; max-width: none; flex: none; }
    .ees-tg + .ees-tg::before { top: 7px; }
    .ees-tl { display: none; }
    .ees-popover,
    .ees-toolbar-wrap > .ees-popover { left: 0 !important; right: 0; width: auto; max-height: 60vh; }
    .ees-toolbar-wrap > .ees-popover::before { display: none; }
    .ees-mapedge { bottom: calc(2 * var(--ees-gap) + 64px + var(--ee-mobile-bottom-nav-height, 0px)); }
    body.ees-inspector-open .ees-mapedge { right: var(--ees-gap); }
    .ees-pop-tilt { display: none; } /* Slider sind mobil ausgeblendet (ee-responsive.css) */
    .ees-mapedge > .ees-popover { max-height: 60vh; }
    /* Konfiguration (Till 02.11.2026): the bottom sheet covers the lower map, so the map edge is a row under the
       toolbar; its menus open below it and the sheet slides down while one is open */
    body[data-ees-module="config"] .ees-mapedge {
        top: calc(var(--ees-top) + 48px + var(--ees-gap)); bottom: auto; right: var(--ees-gap);
        flex-direction: row; width: auto; height: var(--ees-bar-h); padding: 0 var(--ees-bar-pad);
    }
    body[data-ees-module="config"] .ees-mapedge .ees-col { flex-direction: row; }
    body[data-ees-module="config"] .ees-mapedge .ees-sep { width: 1px; height: auto; margin: 14px 0; }
    body[data-ees-module="config"] .ees-mapedge > .ees-popover {
        top: calc(100% + 8px); bottom: auto; left: auto !important; right: 0; width: calc(100vw - 2 * var(--ees-gap)); max-height: 55vh;
    }
    body[data-ees-module="config"]:has(#eesMapEdge > .ees-popover:not([hidden])) #table-side-panel.side-panel { transform: translateY(calc(100% - 64px)); }
    body #layerLegendContainer {
        left: var(--ees-gap) !important;
        bottom: calc(2 * var(--ees-gap) + 64px + var(--ee-mobile-bottom-nav-height, 0px)) !important;
        max-width: 200px !important;
    }
}

/* Verlauf: Rückgängig / Wiederholen (project-history.js, Till 31.10.2026) */
.ees-tg[data-ees-group="history"] .ees-tb:disabled { opacity: .38; cursor: default; }
.ees-tb.ees-hist-more { width: 22px; min-width: 22px; padding-left: 0; padding-right: 0; }
.ees-hist-pop { position: fixed; z-index: 10002; width: 340px; max-height: 70vh; overflow-y: auto; padding: 8px; border-radius: var(--ees-radius, 12px); }
.ees-hist-pop[hidden] { display: none; }
.ees-hist-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 6px 6px; }
.ees-hist-chip { border: 1px solid var(--ees-border); border-radius: 999px; padding: 2px 8px; background: none; color: var(--ees-text-dim); font: inherit; font-size: 11px; font-style: normal; cursor: pointer; }
.ees-hist-chip.is-on { color: var(--ees-text); border-color: var(--ees-accent, #30d158); }
.ees-hist-chip.is-tag { flex: none; cursor: inherit; padding: 1px 6px; font-size: 10px; }
.ees-hist-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.ees-hist-row { justify-content: space-between; }
.ees-hist-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.ees-hist-row small { flex: 0 1 auto; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--ees-text-dim); }
.ees-hist-row.is-redo { opacity: .5; }
.ees-hist-row.is-redo span { font-style: italic; }
.ees-hist-row.is-mark { opacity: .7; font-size: 12px; }
.ees-hist-row.is-off { opacity: .45; cursor: not-allowed; }
.ees-hist-row:not(:disabled):not(.is-off):hover { background: var(--ees-surface-3); box-shadow: inset 2px 0 0 var(--ees-accent, #30d158); }
.ees-hist-row.is-going { opacity: 1; background: color-mix(in srgb, var(--ees-accent, #30d158) 22%, transparent); box-shadow: inset 3px 0 0 var(--ees-accent, #30d158); }
.ees-hist-row:disabled { cursor: default; }
.ees-hist-now { padding: 4px 8px; font-size: 11px; font-weight: 650; color: var(--ees-accent, #30d158); border-bottom: 1px solid var(--ees-border); }
.ees-hist-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10000; display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: var(--ees-radius, 12px); font-size: 13px; color: var(--ees-text, #fff); }
.ees-hist-toast[hidden] { display: none; }
.ees-hist-tb { border: 0; background: none; padding: 2px 4px; font: inherit; font-weight: 650; color: var(--ees-accent, #30d158); cursor: pointer; }
.ees-hist-row.is-now { font-weight: 650; }
.ees-hist-row.is-now span { color: var(--ees-accent, #30d158); }
.ees-hist-acts { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-top: 1px solid var(--ees-border); }
.ees-hist-tb:disabled { opacity: .45; cursor: default; }
.ees-hist-log { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .35); }
.ees-hist-log[hidden] { display: none; }
.ees-hist-log-box { width: min(760px, 100%); max-height: 86vh; display: flex; flex-direction: column; border-radius: var(--ees-radius, 12px); color: var(--ees-text, #fff); background: var(--ees-surface, rgba(28, 28, 30, .96)); }
.ees-hist-log-box .ees-ph { display: flex; justify-content: space-between; align-items: center; }
.ees-hist-log-f { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--ees-border, rgba(255, 255, 255, .12)); }
.ees-hist-log-f select, .ees-hist-log-f input { font: inherit; font-size: 12px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--ees-border, rgba(255, 255, 255, .2)); background: transparent; color: inherit; }
.ees-hist-log-list { overflow-y: auto; padding: 4px 12px 12px; font-size: 13px; }
.ees-hist-log-row { padding: 8px 0; border-bottom: 1px solid var(--ees-border, rgba(255, 255, 255, .08)); }
.ees-hist-log-row small { color: var(--ees-text-dim, #999); font-size: 11px; }
.ees-hist-log-meta { font-size: 11px; color: var(--ees-text-dim, #999); margin-bottom: 2px; }
.ees-hist-diff { font-size: 12px; margin-top: 2px; word-break: break-word; }
.ees-hist-diff s { color: var(--ees-text-dim, #999); }
/* Gemeinsames Bearbeiten (project-coedit.js): Anwesenheit in der Kopfzeile, Banner "nur Ansicht" */
.ees-coedit-users { display: flex; align-items: center; flex: none; margin-left: 4px; }
.ees-coedit-users[hidden] { display: none; }
/* presence chips: solid per-user fill (inline), white initials, stacked like Google Docs; the editor gets a ring + pencil.
   Colours are fixed (not tokens) so the chip reads the same in light and dark - the ring follows the scheme. */
.ees-coedit-av { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: -6px; border-radius: 50%; border: 2px solid #0a0a0f; background: #1d4ed8; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1; letter-spacing: .02em; cursor: default; }
.ees-coedit-av:first-child { margin-left: 0; }
.ees-coedit-av.is-editing { box-shadow: 0 0 0 2px #30d158; }
.ees-coedit-pen { position: absolute; right: -4px; bottom: -4px; width: 13px; height: 13px; border-radius: 50%; background: #30d158; color: #06240f; font-size: 8px; font-style: normal; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid #0a0a0f; }

.ees-coedit-banner { position: fixed; left: 50%; top: calc(var(--ees-top, 64px) + 8px); transform: translateX(-50%); z-index: 10000; display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: var(--ees-radius, 12px); font-size: 13px; }
.ees-coedit-banner[hidden] { display: none; }
.ees-coedit-banner.is-flash { animation: ees-coedit-flash .6s ease; }
/* Save state next to the undo/redo pill: its own glass chip, theme text, fades out after "Gespeichert". */
.ees-coedit-save { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--ees-text); background: var(--ees-glass-bg); border: 1px solid var(--ees-glass-border); backdrop-filter: var(--ees-backdrop); -webkit-backdrop-filter: var(--ees-backdrop); box-shadow: var(--ees-glass-shadow); opacity: 1; transition: opacity .45s ease; }
.ees-coedit-save[hidden] { display: none; }
.ees-coedit-save::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ees-text-dim); flex: none; }
.ees-coedit-save.is-saving::before { animation: ees-coedit-pulse 1s ease-in-out infinite; }
.ees-coedit-save.is-saved::before { background: var(--ees-accent); }
.ees-coedit-save.is-failed { cursor: pointer; text-decoration: underline; }
.ees-coedit-save.is-failed::before { background: var(--ees-danger, #ff6b6b); }
.ees-coedit-save.is-fading { opacity: 0; }
@keyframes ees-coedit-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes ees-coedit-flash { 30% { transform: translateX(-50%) scale(1.04); } }
