/* ee-shell-header.css — zone A of the project shell (docs/project-shell.md):
 * floating header with project name + variant switcher, module segment bar
 * (the existing #iconPd1–7), KPIs, project settings, HarvAI. ALL modules.
 * Colours and geometry only from ee-shell-tokens.css (--ees-*).
 * Scoped to .topNavigationBar.ees-header (set in the markup, so no flash of the
 * old round icons before JS runs); body.ees-shell is set by project-shell-header.js.
 *
 * Floating pills (Till 26.10.2026 "Kopfleiste als einzelne Pillen"): the header is no
 * longer one dark bar. It is a transparent, click-through row (pointer-events: none) with
 * four self-contained glass pills — project, navigation, KPIs, actions — 16 px apart
 * (--ees-gap). Between them the map stays visible and clickable. The pills share the
 * design of the bars below (--ees-bar-*: glass, 1px border, shadow, 40 px round buttons,
 * 19 px icons); only the height has its own token (--ees-head-h, icon + label stacked).
 * Left group: project + navigation; right group: KPIs + actions; free map in between.
 */

/* ── Row: transparent, clicks go through to the map ─────────────────── */
.topNavigationBar.ees-header {
    position: absolute;
    top: var(--ees-header-top);
    left: var(--ees-gap);
    right: var(--ees-gap);
    width: auto;
    height: var(--ees-head-h);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: var(--ees-gap);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    color: var(--ees-text);
    font-family: var(--ees-font);
    pointer-events: none;
    z-index: 5;
}

/* ── The pills: one capsule, glass, border, shadow, same height ── */
.topNavigationBar.ees-header > .ees-brand,
.topNavigationBar.ees-header > #pd-slider-container,
.topNavigationBar.ees-header > .ees-kpis,
.topNavigationBar.ees-header > .ees-hist-head,
.topNavigationBar.ees-header > .ees-actions {
    box-sizing: border-box;
    height: var(--ees-head-h);
    display: flex;
    align-items: center;
    border-radius: var(--ees-head-radius);
    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-bar-shadow);
    pointer-events: auto;
}

.ees-header .ees-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

/* ── Project pill: logo, project name, variant ──────────────────────── */
.topNavigationBar.ees-header > .ees-brand {
    gap: 10px;
    flex: 0 1 auto;
    min-width: 300px;            /* logo + a readable project name (~180 px) + variant letter */
    max-width: 460px;            /* the full project name where there is room (Till 31.10.2026) */
    padding: 0 18px 0 var(--ees-head-pad);
}

.topNavigationBar.ees-header > .ees-brand {
    position: relative; /* anchor for .ees-name-error */
}

/* Logo chip: tenant logo (ownerCI) or the Energy Experts SVG on a light glass pill so that
   coloured/dark logos stay legible on the dark header. Height-bound image => crisp on retina
   (SVG is vector, raster tenant logos are drawn at device resolution by the browser). */
.ees-header .ees-logo {
    height: var(--ees-head-btn);
    min-width: var(--ees-head-btn);
    max-width: 112px;
    flex: none;
    box-sizing: border-box;
    padding: 0 9px;
    border-radius: calc(var(--ees-head-btn) / 2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 1px 3px rgba(0, 0, 0, 0.18);
    color: var(--ees-accent);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* DoppelErnte brand: the theme picks the light/dark logo file, so no plate behind it */
.ees-header .ees-logo.is-brand-de {
    background: transparent;
    box-shadow: none;
    padding: 0 4px;
    max-width: 128px;
}
.ees-header .ees-logo.is-brand-de .ees-logo-img { height: 24px; max-width: 118px; }
.ees-header .ees-logo-img {
    display: block;
    height: 26px;
    width: auto;
    max-width: 94px;
    object-fit: contain;
    image-rendering: auto;
}

.ees-header .ees-brand-text {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;         /* one line: project name … + variant letter (Till 31.10.2026) */
    align-items: center;
    gap: 8px;
}

.ees-header .ees-brand-text > .ees-name-row {
    flex: 0 1 auto;              /* the variant letter sits right after the name */
}

.ees-header .ees-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.ees-header .ees-project-name {
    font-weight: 650;
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Customer under the project name, in every module (eewish:8). */
.ees-header .ees-customer-name {
    font-size: 11.5px;
    line-height: 1.2;
    color: var(--ees-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.ees-header .ees-customer-name[hidden] {
    display: none;
}

.ees-header .ees-project-name.is-renamable {
    cursor: text;
    border-radius: 4px;
}

.ees-header .ees-project-name.is-renamable:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ees-header .ees-name-edit {
    flex: none;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    display: inline-grid;
    place-items: center;
    background: none;
    color: var(--ees-text-dim);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.ees-header .ees-name-edit[hidden] {
    display: none;
}

.ees-header .ees-name-edit .ees-icon {
    width: 14px;
    height: 14px;
}

.ees-header .ees-brand:hover .ees-name-edit,
.ees-header .ees-name-edit:focus-visible {
    opacity: 1;
}

.ees-header .ees-name-edit:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ees-text);
}

@media (hover: none) {
    .ees-header .ees-name-edit {
        opacity: 0.7;
    }
}

.ees-header .ees-name-input {
    min-width: 0;
    width: 100%;
    max-width: 260px;
    box-sizing: border-box;
    margin: -2px 0;
    padding: 1px 6px;
    border: 1px solid var(--ees-accent);
    border-radius: 6px;
    outline: none;
    background: var(--ees-field);
    color: var(--ees-text);
    font: inherit;
    font-weight: 650;
    font-size: 14px;
    line-height: 1.25;
    box-shadow: 0 0 0 3px rgba(63, 161, 77, 0.25);
}

.ees-header .ees-name-input.is-invalid {
    border-color: var(--ees-danger);
    box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.25);
}

.ees-header .ees-name-input.is-saving {
    opacity: 0.7;
    cursor: progress;
}

.ees-header .ees-name-error {
    position: absolute;
    top: calc(100% + 6px);
    left: var(--ees-head-pad);
    max-width: 320px;
    padding: 6px 10px;
    border: 1px solid var(--ees-danger);
    border-radius: var(--ees-radius-sm, 8px);
    background: var(--ees-surface);
    color: var(--ees-danger);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    z-index: 5;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.ees-header .ees-name-error[hidden] {
    display: none;
}



.ees-header .ees-variant-button {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    align-self: center;
    flex-shrink: 0;       /* the variant letter must never be the thing that gives way (E51) */
    margin: 0;
    padding: 2px 7px;
    border: 1px solid var(--ees-border);
    border-radius: 999px;
    background: none;
    font: inherit;
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.3;
    color: var(--ees-text-dim);
    cursor: pointer;
    white-space: nowrap;
    max-width: 100%;
}

.ees-header .ees-variant-button:disabled {
    cursor: default;
}

/* The label itself (no rule existed before, E51): never wraps, even while the brand
   pill shrinks toward its minimum — the project name gives way first (ellipsis). */
.ees-header .ees-variant-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.ees-header .ees-variant-button .ees-caret {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.7;
}

.ees-header .ees-variant-button:not(.is-multi) .ees-caret {
    display: none;
}

.ees-header .ees-variant-button.is-multi:hover {
    color: var(--ees-text);
}

/* Variant menu: moved to <body> by JS (the header lives in the transformed .popup-content) */
.ees-variant-menu {
    position: fixed;
    z-index: 99995;
    min-width: 180px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    border-radius: var(--ees-radius-md);
    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), var(--ees-float-shadow);
    font-family: var(--ees-font);
}

.ees-variant-menu[hidden] {
    display: none;
}

.ees-variant-menu .ees-variant-item {
    text-align: left;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--ees-text);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
}

.ees-variant-menu .ees-variant-item:hover,
.ees-variant-menu .ees-variant-item:focus-visible {
    background: var(--ees-surface-3);
    outline: none;
}

.ees-variant-menu .ees-variant-item[aria-checked="true"] {
    background: var(--ees-accent-soft);
    color: var(--ees-accent-strong);
    font-weight: 600;
}

/* ── Navigation pill: one segmented control over all phases ─────────── *
 * ONE pill, not two (Till: "entscheide nach Optik"): the phases are one navigation, one
 * selection; two pills would compete for width with the project and KPI pills and split
 * the selection highlight. The groups workspace | process | Betrieb (E44,
 * data-ees-seg-group) are kept as thin hairlines inside the pill. The DOM stays one flat
 * list #iconPd1–7 (handleIconClick maps by DOM index, deep links use the ids). */
.topNavigationBar.ees-header > #pd-slider-container {
    position: static;
    width: auto;
    top: auto;
    flex: 0 0 auto;              /* the project pill gives way first (name ellipsis) */
    min-width: 0;
    margin: 0 auto 0 0;          /* left group ends here, the free map follows */
    padding: 0 3px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

/* last resort, no tier fits: the navigation pill shrinks and scrolls, never overlaps */
.topNavigationBar.ees-header.ees-seg-scroll > #pd-slider-container {
    flex: 0 1 auto;
}

.topNavigationBar.ees-header #pd-slider-container::-webkit-scrollbar {
    display: none;
}

.topNavigationBar.ees-header .pd-icon-container {
    display: flex;
    align-items: center;
    justify-content: flex-start !important; /* beats the payLevel centring in ee-project-styles.css */
    gap: 2px;
    width: max-content;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: none;
    border: 0;
}

/* Order of the target design; the DOM order stays, handleIconClick maps by DOM index */
.ees-header #iconPd4 { order: 1; }
.ees-header #iconPd5 { order: 2; }
.ees-header #iconPd1 { order: 3; }
.ees-header #iconPd2 { order: 4; }
.ees-header #iconPd3 { order: 5; }
.ees-header #iconPd6 { order: 6; }
.ees-header #iconPd7 { order: 7; }

.ees-header .iconBoxPd {
    position: relative;
    flex: none;
    max-width: none;
    border-radius: calc(var(--ees-head-seg-h) / 2);
}

/* the former per-tile group surfaces are gone: one pill, hairlines between the groups */
.ees-header .iconBoxPd::before {
    content: none;
}

.ees-header #iconPd1,
.ees-header #iconPd7 {
    margin-left: 13px;
}

.ees-header #iconPd1::before,
.ees-header #iconPd7::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 25%;
    bottom: 25%;
    width: 1px;
    border-radius: 1px;
    background: var(--ees-border-strong);
    pointer-events: none;
}

/* E41: no rotating ring around header tab icons while the page reloads/recalculates.
   The tabs stay locked (toggleSpinner sets pointer-events:none, body.interactions-disabled);
   the progress pill and the work lock show the loading state. */
.ees-header .iconBoxPd .spinner-overlay,
.ees-header .iconBoxPd .spinner {
    display: none !important;
    animation: none !important;
}

.ees-header .iconBoxPd.spinner-active > * {
    filter: none !important;
}

/* Segment: icon in its well above, label below — the same size and weight for EVERY
   phase (Till 26.10.2026: "gleiche Schriftgröße, gleiches Gewicht"). */
.ees-header .iconButtonPd,
.ees-header #iconPdButtonPd4 {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: auto;
    min-width: 0;
    height: var(--ees-head-seg-h);
    box-sizing: border-box;
    margin: 0;
    padding: 0 12px;
    border-radius: calc(var(--ees-head-seg-h) / 2);
    color: var(--ees-text-dim);
    fill: currentColor;
    stroke: currentColor;
    font-size: var(--ees-head-label);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.1px;
    white-space: nowrap;
    transform: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ees-header .iconButtonPd:hover {
    background: var(--ees-surface-3);
    color: var(--ees-text);
}

.ees-header .iconButtonPd:focus-visible {
    outline: 2px solid var(--ees-accent);
    outline-offset: -2px;
}

/* active phase: light inner surface (the segmented-control thumb), same label size/weight */
.ees-header .iconButtonPd.clicked,
.ees-header .iconButtonPd.clicked:hover {
    background: var(--ees-seg-active-bg);
    box-shadow: var(--ees-seg-active-shadow);
    color: var(--ees-text);
    font-weight: 600;
}

.ees-header .iconButtonPd.clicked::after {
    content: none;
}

/* icon well: one 26px round form for all seven phases; no hover swap */
.ees-header .iconButtonPd .iconPd,
.ees-header .iconButtonPd:hover .iconPd,
.ees-header .iconButtonPd:not(:hover) .iconPd,
.ees-header .iconButtonPd.clicked .iconPd,
.ees-header #iconPdButtonPd4:hover .iconPd {
    position: relative;
    width: var(--ees-head-ring);
    height: var(--ees-head-ring);
    flex: none;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ees-surface-3);
    color: inherit;
    fill: currentColor;
    stroke: currentColor;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
    transform: none;
}

.ees-header .iconButtonPd.clicked .iconPd {
    /* active = filled well in ink, the icon keeps one colour (Till 01.11.2026) */
    background: rgba(var(--ee-fg-rgb), 0.14);
    color: inherit;
    fill: currentColor;
    stroke: currentColor;
}

/* E44 (Till 24.10.2026): the status ring belongs to the four phases only (Netzanschluss,
   Finanzierung, Genehmigung, Bau); the ring sits on the edge of the same well every phase
   has, so the row keeps one form. Dashboard, Konfigurieren and Betrieb carry no ring. */
.ees-header .iconPd .progress-ring {
    position: absolute;
    inset: 0;
    width: var(--ees-head-ring);
    height: var(--ees-head-ring);
}

.ees-header .iconPd .progress-background {
    stroke: currentColor;
    opacity: 0.18;
    stroke-width: 5;
}

.ees-header .iconPd .progress-bar {
    /* one colour: the ring shows progress by length, not by hue (overrides the inline score colour) */
    stroke: currentColor !important;
    opacity: 0.7;
    stroke-width: 5;
}

.ees-header .iconPd .headerIcon,
.ees-header #dashboardIconSvg {
    width: 14px;
    height: 14px;
    margin: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.ees-header :is(#iconPd4, #iconPd5, #iconPd7) .iconPd .headerIcon,
.ees-header #dashboardIconSvg {
    width: 15px;
    height: 15px;
}

/* the configuration icon carries one hard-coded dark tick */
.ees-header #configurationIconSvg path {
    fill: currentColor;
}

/* label: the former hover pill, now always shown as text */
.ees-header .iconButtonPd .pillViewPd,
.ees-header .iconButtonPd:hover .pillViewPd,
.ees-header .iconButtonPd:not(:hover) .pillViewPd,
.ees-header .iconButtonPd.clicked .pillViewPd {
    position: static;
    display: block;
    min-width: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    fill: currentColor;
    opacity: 1;
    transform: none;
    transition: none;
}

/* short label (Netz, Finanzen, …), inserted by project-shell-header.js; full name otherwise */
.ees-header .pillViewPd .pillTextShort {
    display: none;
}

/* ── Width tiers (eesFitSegments, project-shell-header.js). The rule: the labels are
 *    there for ALL phases or for NONE — never only for some (Till 26.10.2026).
 *    full                  every phase with its full name
 *    ees-seg-short         short names (Netz, Finanzen) for all
 *    ees-seg-tight         short names, narrower segments
 *    ees-seg-icons         <= 1100 px only: icons for all, name as tooltip (title)
 *    ees-kpi-short         narrow desktop: Fläche moves into "Alle Kennzahlen"
 *    ees-kpi-collapsed     very narrow: the KPIs fold into "Alle Kennzahlen" ── */
.topNavigationBar.ees-header.ees-seg-short .pillViewPd .pillText {
    display: none;
}

.topNavigationBar.ees-header.ees-seg-short .pillViewPd .pillTextShort {
    display: inline;
}

.topNavigationBar.ees-header.ees-seg-tight :is(.iconButtonPd, #iconPdButtonPd4) {
    padding: 0 8px;
}

@media (max-width: 1100px) {
    .topNavigationBar.ees-header.ees-seg-icons .iconButtonPd .pillViewPd {
        display: none;
    }

    .topNavigationBar.ees-header.ees-seg-icons :is(.iconButtonPd, #iconPdButtonPd4) {
        min-width: var(--ees-head-btn);
        padding: 0 6px;
    }
}

/* ── KPI pill (values written by project-area.js) ──────────────────── *
 * Layout v2.1: at most three in the pill (Fläche, Leistung, Rendite), each with a small
 * title and its unit; the round button opens "Alle Kennzahlen" (#eesKpiMenu, mirrored by
 * project-shell-header.js, the value ids stay where they are). */
.topNavigationBar.ees-header > .ees-kpis {
    gap: 0;
    flex: none;
    padding: 0 var(--ees-head-pad) 0 8px;
}

.ees-header .ees-kpi-kwh {
    display: none; /* only in "Alle Kennzahlen" */
}

.ees-header .ees-kpi-more {
    position: relative;
    width: var(--ees-head-btn);
    height: var(--ees-head-btn);
    margin-left: 2px;
    padding: 0;
    display: grid;
    place-items: center;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ees-text-dim);
    cursor: pointer;
}

.ees-header .ees-kpi-more:hover,
.ees-header .ees-kpi-more[aria-expanded="true"] {
    background: var(--ees-surface-3);
    color: var(--ees-text);
}

.ees-header .ees-kpi-more:focus-visible {
    outline: 2px solid var(--ees-accent);
    outline-offset: -2px;
}

.ees-header .ees-kpi-more .ees-icon {
    width: var(--ees-bar-icon);
    height: var(--ees-bar-icon);
}

/* chart icon only while the KPIs are folded into the menu */
.ees-header .ees-kpi-more .ees-kpi-chart {
    display: none;
}

.ees-kpi-menu {
    min-width: 230px;
    padding: 6px 10px;
    gap: 0;
}

.ees-kpi-menu .ees-kpi-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid var(--ees-border);
    color: var(--ees-text);
    font-size: 12.5px;
}

.ees-kpi-menu .ees-kpi-row:first-child {
    border-top: 0;
}

.ees-kpi-menu .ees-kpi-row > span {
    color: var(--ees-text-dim);
}

.ees-kpi-menu .ees-kpi-row b {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ees-kpi-menu .ees-kpi-row b small {
    margin-left: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ees-text-dim);
}

/* the "vorläufig" hint, mirrored into the menu: readable and clickable there too */
.ees-kpi-menu .ees-kpi-row-hint {
    display: block;
    margin: -3px 0 6px auto;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    text-align: right;
    color: var(--ees-warn);
    cursor: pointer;
}

.ees-kpi-menu .ees-kpi-row-hint[data-tone="danger"] {
    color: var(--ees-danger);
}

.ees-kpi-menu .ees-kpi-row-hint u {
    text-underline-offset: 2px;
}

body:not(.paylevel-unlocked) .topNavigationBar.ees-header > .ees-kpis {
    display: none; /* same audience as the old tile in the configuration module */
}

.ees-header .ees-kpi {
    padding: 0 12px;
    text-align: right;
    border-left: 1px solid var(--ees-border);
}

/* E51: a KPI without a value is set [hidden] by JS (eeHeaderAnlagenflaeche, project-area.js) —
   never left showing its unit alone. Explicit rule so it does not depend on the UA default
   for [hidden] against this file's flex children. */
.ees-header .ees-kpi[hidden] {
    display: none;
}

/* Fläche is always first in the markup; hidden (no value), the next tile (Leistung) becomes
   visually first and must lose the divider the same way ees-kpi-short already does. */
.ees-header .ees-kpi-ha[hidden] + .ees-kpi-mwp {
    border-left: 0;
}

.ees-header .ees-kpi:first-child {
    border-left: 0;
}

.ees-header .ees-kpi > i {
    display: block;
    font-style: normal;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: var(--ees-text-dim); /* AA over the glass (text-faint only reached 3:1) */
}

.ees-header .ees-kpi b {
    white-space: nowrap;
    font-size: 16px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: var(--ees-text);
}

.ees-header .ees-kpi b span {
    font-size: 0.7em;
    font-weight: 500;
    color: var(--ees-text-dim); /* "/ total ha" from updateAllConstructionHealthPanelKPIs */
}

.ees-header .ees-kpi > span {
    margin-left: 3px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ees-text-dim);
}

.ees-header .ees-kpi-roi b {
    color: var(--ees-kpi-good); /* AA on the glass in both modes (see the signal colours below) */
}

/* Active EPC offer (2.25.753): same cell as a KPI, but a button (opens Investition › Solarteur) */
.ees-header .ees-kpi-epc {
    margin: 0;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.ees-header .ees-kpi-epc[hidden] {
    display: none;
}

.ees-header .ees-kpi-epc > i {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ees-header .ees-kpi-epc:hover {
    background: var(--ees-accent-soft);
}

.ees-header .ees-kpi-epc:focus-visible {
    outline: 2px solid var(--ees-accent);
    outline-offset: 1px;
}

.ees-header .ees-kpi-epc.is-standard b {
    font-size: 13px;
    font-weight: 600;
    color: var(--ees-text-dim);
}

/* preliminary ROI: no longer 45 % opacity (unreadable on a bright aerial image) — the value
   turns calm grey, the hint below it carries the signal and stays fully readable */
.topNavigationBar.ees-header .ees-kpi b.ees-kpi-prelim {
    opacity: 1 !important;
    color: var(--ees-text-dim);
}

.topNavigationBar.ees-header .ees-kpi .ees-kpi-est,
.topNavigationBar.ees-header .ees-kpi .ees-kpi-prov {
    opacity: 1 !important;
    margin: 1px 0 0 auto !important;
    font-size: 10.5px !important;
    font-weight: 600;
}

/* ── Action pill: electrical recalc (only while preliminary), project settings (gear + progress ring), HarvAI, bug, admin ── */
.topNavigationBar.ees-header > .ees-actions {
    gap: 2px;
    flex: none;
    padding: 0 var(--ees-head-pad);
}

.topNavigationBar.ees-header #projectSettingContainer,
.topNavigationBar.ees-header .aiIconContainer {
    position: static;
    width: auto;
    height: auto;
    display: block;
    pointer-events: auto;
    z-index: auto;
}

.topNavigationBar.ees-header .aiIconContainer[hidden] {
    display: none !important;
}

.ees-header .profileIcon,
.ees-header .aiIcon,
.topNavigationBar.ees-header #ee-bug-reporter-btn,
.topNavigationBar.ees-header #eeAdminModeEnableBtn,
.topNavigationBar.ees-header .ees-recalc-btn {
    position: relative;
    width: var(--ees-head-btn);
    height: var(--ees-head-btn);
    flex: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ees-text);
    fill: none;
    box-shadow: none;
    opacity: 1;
    transform: none;
    filter: none;
    cursor: pointer;
}

.topNavigationBar.ees-header #ee-bug-reporter-btn,
.topNavigationBar.ees-header #eeAdminModeEnableBtn {
    position: static;
}

.ees-header .profileIcon:hover,
.ees-header .aiIcon:hover,
.topNavigationBar.ees-header #ee-bug-reporter-btn:hover,
.topNavigationBar.ees-header #eeAdminModeEnableBtn:hover,
.topNavigationBar.ees-header .ees-recalc-btn:hover {
    transform: none;
    box-shadow: none;
    background: var(--ees-surface-3);
}

.ees-header .profileIcon:focus-visible,
.ees-header .aiIcon:focus-visible,
.topNavigationBar.ees-header #ee-bug-reporter-btn:focus-visible,
.topNavigationBar.ees-header #eeAdminModeEnableBtn:focus-visible,
.topNavigationBar.ees-header .ees-recalc-btn:focus-visible {
    outline: 2px solid var(--ees-accent);
    outline-offset: -2px;
}

.ees-header .aiIcon {
    color: var(--ees-accent-strong);
}

.ees-header .aiIcon .ees-icon,
.topNavigationBar.ees-header .ees-recalc-btn .ees-icon,
.topNavigationBar.ees-header #eeAdminModeEnableBtn .ees-icon,
.ees-header #profileIconSvg {
    width: var(--ees-bar-icon);
    height: var(--ees-bar-icon);
}

/* electrical planning preliminary (Till 26.10.2026): a yellow circular arrow next to the action
   icons instead of the text under the ROI — same round button, so the header keeps its height */
.topNavigationBar.ees-header .ees-recalc-btn {
    color: var(--ees-recalc);
}

.topNavigationBar.ees-header .ees-recalc-btn[data-tone="danger"] {
    color: var(--ees-danger);
}

.topNavigationBar.ees-header .ees-recalc-btn[hidden] {
    display: none !important;
}

.topNavigationBar.ees-header .ees-recalc-btn[aria-disabled="true"] {
    cursor: default;
}

.topNavigationBar.ees-header .ees-recalc-btn .ees-icon {
    stroke-width: 2.2;
}

/* ROI while the header waits for the calculation: "…" calmly pulsing, never 0 % */
.topNavigationBar.ees-header .ees-kpi b.ees-kpi-loading {
    color: var(--ees-text-dim);
    animation: ees-kpi-pulse 1.2s ease-in-out infinite;
}

/* last finished figures held while a recalc runs (never "—"): dimmed, calm */
.topNavigationBar.ees-header .ees-kpi b.ees-kpi-held {
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

@keyframes ees-kpi-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .topNavigationBar.ees-header .ees-kpi b.ees-kpi-loading { animation: none; }
}

/* the settings progress ring stays as a ring around the gear */
.ees-header svg#progress-profile-ring {
    position: absolute;
    inset: 4px;
    width: calc(var(--ees-head-btn) - 8px);
    height: calc(var(--ees-head-btn) - 8px);
    transform: rotate(-90deg);
}

.ees-header #progress-profile-ring .progress-background {
    stroke: var(--ees-border-strong);
    stroke-width: 3;
}

.ees-header #progress-profile-ring .progress-bar {
    stroke-width: 3;
}

.ees-header #profileIconSvg {
    position: relative;
    width: 15px;
    height: 15px;
}

/* ── Modules below the header: content must start under it ──────────
 * Desktop: dashboard (.dashboardView-content) and the floating widget grids of
 * Netz/Finanzierung/Genehmigung/Bau/Betrieb (.ee-floating-widgets) keep their
 * 120px — already below the header (var(--ees-top) = 90px). max() only guards a
 * taller header, nothing moves. Konfiguration: zones B–E use var(--ees-top). */
body.ees-shell .dashboardView-content,
body.ees-shell .ee-floating-widgets {
    padding-top: max(120px, var(--ees-top));
}

/* the bug icon keeps its signal colour, on the calm round button */
.topNavigationBar.ees-header #ee-bug-reporter-btn .ee-bug-icon svg {
    width: var(--ees-bar-icon);
    height: var(--ees-bar-icon);
    fill: var(--ees-danger);
}

.topNavigationBar.ees-header #ee-bug-reporter-btn.ee-capturing {
    background: var(--ees-warn-soft);
}

/* the header's HarvAI button opens the agent widget: no second floating bubble */
body.ees-shell:has(#aiIconContainer:not([hidden])) .ee-agent-bubble {
    display: none !important;
}

/* ── KPIs folded (very narrow, ees-kpi-collapsed): only the round button, chart icon,
 *    a dot when the ROI is preliminary; the menu shows every KPI and the hint. ── */
.topNavigationBar.ees-header.ees-kpi-collapsed > .ees-kpis {
    padding: 0 var(--ees-head-pad);
}

.topNavigationBar.ees-header.ees-kpi-collapsed .ees-kpis .ees-kpi {
    display: none;
}

.topNavigationBar.ees-header.ees-kpi-collapsed .ees-kpi-more {
    margin-left: 0;
    color: var(--ees-text);
}

.topNavigationBar.ees-header.ees-kpi-collapsed .ees-kpi-more .ees-kpi-chart {
    display: block;
}

.topNavigationBar.ees-header.ees-kpi-collapsed .ees-kpi-more .ees-kpi-caret {
    display: none;
}

.topNavigationBar.ees-header.ees-kpi-collapsed .ees-kpis.is-prelim .ees-kpi-more::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ees-warn);
    box-shadow: 0 0 0 2px var(--ees-surface);
}

/* Signal colours of the KPI pill (ROI, the "vorläufig" hint) set locally so the small text
   keeps WCAG AA on the glass over ANY backdrop (white, black, aerial image): dark mode a
   lighter tone (#30d158 / #ff9f0a / #ff453a reached only ~3.2:1 over a bright map), light
   mode a darker one (--ees-warn #c26f00 reached only ~3:1). Checked in
   tests/js/ee-shell-map-capsule.dom.cjs. */
.topNavigationBar.ees-header > .ees-kpis,
.ees-kpi-menu {
    --ees-kpi-good: #8ee8a6;
    --ees-warn: #ffd591;
    --ees-danger: #ffd0cb;
}



/* narrow desktop (ees-kpi-short) and tablet: two KPIs in the pill (Leistung, Rendite);
   Fläche stays in "Alle Kennzahlen" */
.topNavigationBar.ees-header.ees-kpi-short .ees-kpi-ha {
    display: none;
}

.topNavigationBar.ees-header.ees-kpi-short .ees-kpi-mwp {
    border-left: 0;
}

@media (max-width: 1100px) {
    .ees-header .ees-kpi-ha,
    .ees-header .ees-kpi-epc {
        display: none;
    }

    .ees-header .ees-kpi-mwp {
        border-left: 0;
    }

    .topNavigationBar.ees-header > .ees-brand {
        max-width: 240px;
    }
}

/* Tablet portrait (768-900 px): even the icon tier does not fit next to a 300 px project pill,
   so here the pill gives way (down to 140 px) before the navigation would have to scroll. */
@media (min-width: 768px) and (max-width: 900px) {
    .topNavigationBar.ees-header > .ees-brand {
        min-width: 140px;
    }
}

/* ── Phone: two rows of pills (project + KPIs + actions, segments scrollable), 96px ── */
@media (max-width: 767px) {
    .topNavigationBar.ees-header {
        position: absolute !important; /* ee-responsive.css pins the old bar fixed to 0 */
        top: var(--ees-header-top) !important;
        left: var(--ees-gap) !important;
        right: var(--ees-gap) !important;
        height: var(--ees-header-h);
        flex-wrap: wrap;
        align-content: space-between;
        gap: 8px;
        padding: 0;
        background: none !important;
        z-index: 600 !important; /* above the mobile module panels (z-index 500) */
    }

    .topNavigationBar.ees-header > .ees-brand {
        order: 1;
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        gap: 8px;
        padding-right: 12px;
    }

    .ees-header .ees-logo {
        font-size: 11px;
        max-width: 84px;
        padding: 0 7px;
    }

    /* The 44px pill has room for two lines only; the dashboard hero keeps the customer. */
    .ees-header .ees-customer-name {
        display: none;
    }

    .ees-header .ees-logo-img {
        height: 22px;
        max-width: 70px;
    }

    /* The project pill gets only what the KPI, history and action pills leave, so the logo
       shrinks with it instead of running under the KPI button. */
    .ees-header .ees-logo {
        flex: 0 1 auto;
        min-width: 0;
    }

    .ees-header .ees-logo-img {
        min-width: 0;
        max-width: 100%;
    }

    /* DoppelErnte: the wordmark does not fit, its tricolour E stands in as the mark */
    .ees-header .ees-logo.is-brand-de {
        width: 18px;
        min-width: 18px;
        padding: 0;
    }

    .ees-header .ees-logo.is-brand-de .ees-logo-img {
        width: 18px;
        max-width: none;
        height: 24px;
        object-fit: cover;
        object-position: 62.5% 50%;
    }

    .topNavigationBar.ees-header > .ees-kpis {
        order: 2;
    }

    .topNavigationBar.ees-header > .ees-actions {
        order: 3;
    }

    /* project settings popup is not available on phones (ee-responsive.css) */
    .topNavigationBar.ees-header #projectSettingContainer {
        display: none !important;
    }

    .topNavigationBar.ees-header .aiIconContainer {
        position: static !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
    }

    .topNavigationBar.ees-header > #pd-slider-container {
        display: flex !important; /* ee-responsive.css hid the old icon row */
        order: 4;
        flex: 1 0 100%;
        margin: 0;
    }

    .topNavigationBar.ees-header .pd-icon-container {
        display: flex !important;
    }

    /* All seven segments fit in the 390 px row (it used to scroll with only three visible):
       short name under the icon for all, 44 px touch targets, tighter group hairlines. */
    .topNavigationBar.ees-header .pd-icon-container {
        gap: 0;
    }

    #eesHeader .iconBoxPd :is(.iconButtonPd, #iconPdButtonPd4) {
        flex-direction: column;
        gap: 2px;
        min-width: 44px;
        padding: 0 2px;
        font-size: 9.5px;
        letter-spacing: 0;
    }

    .ees-header #iconPd1,
    .ees-header #iconPd7 {
        margin-left: 7px;
    }

    .ees-header #iconPd1::before,
    .ees-header #iconPd7::before {
        left: -4px;
    }

    .ees-header .iconButtonPd .pillViewPd .pillText {
        display: none;
    }

    .ees-header .iconButtonPd .pillViewPd .pillTextShort {
        display: inline;
    }

    /* the segment row replaces the mobile category tabs */
    body.ees-shell .ee-mobile-category-tabs {
        display: none !important;
    }

    /* mobile module panels (ee-responsive.css: top 56px) start under the header */
    body.ees-shell #analyse-container.ee-mobile-expanded,
    body.ees-shell #grid-connection-container.ee-mobile-category-active,
    body.ees-shell #finance-container.ee-mobile-category-active,
    body.ees-shell #permit-container.ee-mobile-category-active,
    body.ees-shell #construction-container.ee-mobile-category-active,
    body.ees-shell #operation-container.ee-mobile-category-active {
        top: var(--ees-top) !important;
    }
}

/* ── Verlauf: ONE pill next to the KPIs (project-history.js): undo, redo | caret ── */
/* capsule look comes from the shared pill rule at the top of this file */
.topNavigationBar.ees-header > .ees-hist-head {
    gap: 2px;
    flex: none;
    padding: 0 calc(var(--ees-head-pad) - 2px);
}

.topNavigationBar.ees-header > .ees-hist-head[hidden] {
    display: none;
}

.ees-header .ees-hist-btn {
    width: var(--ees-head-btn);
    height: var(--ees-head-btn);
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    color: var(--ees-text);
    font: inherit;
    line-height: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background-color .15s, opacity .15s;
}

.ees-header .ees-hist-btn:hover:not(:disabled),
.ees-header .ees-hist-btn[aria-expanded="true"] {
    background: var(--ees-surface-3);
}

.ees-header .ees-hist-btn:focus-visible {
    outline: 2px solid var(--ees-accent);
    outline-offset: -2px;
}

.ees-header .ees-hist-btn:disabled {
    opacity: .35;
    cursor: default;
}

.ees-header .ees-hist-btn .ees-icon {
    width: 18px;
    height: 18px;
}

.ees-header .ees-hist-caret {
    width: 22px;
    border-radius: 11px;
    color: var(--ees-text-dim);
}

.ees-header .ees-hist-caret .ees-icon {
    width: 14px;
    height: 14px;
}

.ees-header .ees-hist-sep {
    width: 1px;
    height: 20px;
    margin: 0 2px;
    background: var(--ees-border);
    flex: none;
}

/* presence avatars sit on the bar without their own capsule */
.topNavigationBar.ees-header > .ees-coedit-users {
    pointer-events: auto;
}

@media (max-width: 1100px) {
    .topNavigationBar.ees-header > .ees-hist-head {
        gap: 0;
        padding: 0 3px;
    }

    .ees-header .ees-hist-sep {
        display: none;
    }
}

@media (max-width: 767px) {
    .topNavigationBar.ees-header > .ees-hist-head {
        order: 2;
    }

    /* phones: the list opens by long-press on undo */
    .ees-header .ees-hist-caret {
        display: none;
    }
}

/* ── "…" in the action pill: secondary actions (Bug melden, Admin-Modus) as menu rows ── */
.ees-header .ees-more-btn {
    width: var(--ees-head-btn);
    height: var(--ees-head-btn);
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ees-text);
    cursor: pointer;
}

.ees-header .ees-more-btn[hidden] {
    display: none;
}

.ees-header .ees-more-btn:hover,
.ees-header .ees-more-btn[aria-expanded="true"] {
    background: var(--ees-surface-3);
}

.ees-more-menu[hidden] {
    display: none;
}

/* the moved buttons drop their own floating/round look (ee-bug-reporter.css: fixed red circle) */
.ees-more-menu .ees-more-item,
.ees-more-menu #ee-bug-reporter-btn,
.ees-more-menu #eeAdminModeEnableBtn {
    position: static;
    width: auto;
    height: auto;
    min-width: 0;
    margin: 0;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* the bug button centres its icon as a round button */
    gap: 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    box-shadow: none;
    transform: none;
    color: var(--ees-text);
    font: inherit;
    font-size: 12.5px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.ees-more-menu .ees-more-item:disabled { opacity: .5; cursor: not-allowed; }
.ees-more-menu .ees-more-item:hover,
.ees-more-menu .ees-more-item:focus-visible,
.ees-more-menu #ee-bug-reporter-btn:hover,
.ees-more-menu #eeAdminModeEnableBtn:hover,
.ees-more-menu #ee-bug-reporter-btn:focus-visible,
.ees-more-menu #eeAdminModeEnableBtn:focus-visible {
    background: var(--ees-surface-3);
    box-shadow: none;
    transform: none;
    outline: none;
}

.ees-more-menu .ees-more-item svg,
.ees-more-menu #ee-bug-reporter-btn svg,
.ees-more-menu #eeAdminModeEnableBtn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.ees-more-menu #ee-bug-reporter-btn svg {
    fill: var(--ees-danger);
}

/* stroke icons of every moved item (share, admin); the bug icon stays filled red (rule above) */
.ees-more-menu .ees-more-item svg.ees-icon,
.ees-more-menu #eeAdminModeEnableBtn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ees-more-menu #ee-bug-reporter-btn.ee-capturing {
    background: var(--ees-warn-soft);
    animation: none;
}

/* Calc status dot in the Rendite title (Till 31.10.2026): green = unchanged, blue = changed,
   grey = first result, spinning yellow -> blue -> green while calculating. Tooltip on the cell. */
.ees-header .ees-kpi-dot {
    display: inline-block;
    box-sizing: border-box;
    width: 7px;
    height: 7px;
    margin-left: 5px;
    border-radius: 50%;
    vertical-align: 1px;
    background: #8a8f98;
}
.ees-header .ees-kpi-dot.is-ok { background: #3FA14D; }
.ees-header .ees-kpi-dot.is-changed { background: #0069B3; }
.ees-header .ees-kpi-dot.is-busy {
    width: 8px;
    height: 8px;
    background: none;
    border: 2px solid;
    border-color: #EECB00 #0069B3 #3FA14D transparent;
    animation: ees-kpi-dot-spin 0.9s linear infinite;
}
@keyframes ees-kpi-dot-spin { to { transform: rotate(360deg); } }
