.brevia-panel {
    border: 1px solid #d6dce5;
    border-radius: 10px;
    padding: 14px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-top: 10px;
}

.brevia-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.brevia-head-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
}

.brevia-head-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #003b86;
    line-height: 1.2;
}

.brevia-head-subtitle {
    font-size: 0.92rem;
    color: #335;
    line-height: 1.3;
    margin-top: 2px;
}

.brevia-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.brevia-box {
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fbfcfe;
}

.brevia-box h4 {
    margin: 0 0 8px 0;
    font-size: 0.98rem;
    color: #003b86;
}

.brevia-kv {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr;
    gap: 4px 10px;
    font-size: 0.92rem;
}

.brevia-kv div:nth-child(odd) {
    font-weight: 600;
    color: #234;
}

.brevia-kv div:nth-child(even) {
    color: #222;
}

.brevia-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    background: #eef3fb;
    color: #003b86;
}

.brevia-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.brevia-btn {
    border: 1px solid #003b86;
    background: #003b86;
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.92rem;
}

.brevia-btn-secondary {
    background: #fff;
    color: #003b86;
}

.brevia-hint {
    margin-top: 10px;
    font-size: 0.88rem;
    color: #444;
    line-height: 1.4;
}


/* ==========================================================
   BreVIA – Grundwasserdiagramm
   ========================================================== */

.brevia-gw-box {
    overflow: hidden;
}

.brevia-gw-svg {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 8px;
}

.brevia-gw-heading {
    font-size: 16px;
    font-weight: 700;
    text-anchor: middle;
}

.brevia-gw-value {
    font-size: 15px;
    fill: #111;
}

.brevia-gw-value-bold {
    font-size: 15px;
    font-weight: 700;
    fill: #111;
}

.brevia-gw-terrain {
    stroke: #a32035;
    stroke-width: 2;
}

.brevia-gw-water {
    stroke: #2459d3;
    stroke-width: 2.5;
    fill: none;
}

.brevia-gw-water-dashed {
    stroke: #2459d3;
    stroke-width: 2;
    stroke-dasharray: 8 7;
}

.brevia-gw-surface {
    stroke: #202020;
    stroke-width: 2;
}

.brevia-gw-arrow {
    stroke: #202020;
    stroke-width: 1.7;
    marker-start: url(#brevia-gw-arrowhead);
    marker-end: url(#brevia-gw-arrowhead);
}

.brevia-gw-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 6px 0 10px;
    font-size: 0.82rem;
}

.brevia-gw-legende > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.brevia-gw-legende-linie {
    display: inline-block;
    width: 34px;
    height: 0;
    border-top: 3px solid;
}

.brevia-gw-legende-linie.terrain {
    border-color: #a32035;
}

.brevia-gw-legende-linie.water {
    border-color: #2459d3;
}

.brevia-gw-legende-linie.surface {
    border-color: #202020;
}

.brevia-gw-values {
    margin-top: 14px;
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(190px, 1fr)
        );
    gap: 8px;
}

.brevia-gw-values > div {
    border: 1px solid #d8dee4;
    border-radius: 6px;
    padding: 8px 10px;
}

.brevia-gw-values strong {
    display: block;
    margin-bottom: 3px;
}

.brevia-gw-zusatz {
    margin-top: 8px;
}


/* ==========================================================
   Portalsuche vor Karte und Menüs
   ========================================================== */

#portal-search {
    position: relative !important;
    z-index: 20000 !important;
    overflow: visible !important;
}

#portal-search-results {
    position: absolute !important;
    z-index: 20001 !important;
    overflow: visible !important;
}


/* ==========================================================
   BreVIA DIN A4 Druck
   ========================================================== */

@page {
    size: A4 portrait;
    margin: 15mm;
}

@media print {

    body * {
        visibility: hidden !important;
    }

    #gdfb-standort-status,
    #gdfb-standort-status *,
    #gdfb-standort-ergebnis,
    #gdfb-standort-ergebnis * {
        visibility: visible !important;
    }

    #gdfb-standort-status,
    #gdfb-standort-ergebnis {
        position: relative !important;
        display: block !important;

        left: auto !important;
        top: auto !important;

        width: 180mm !important;
        max-width: 180mm !important;

        margin: 0 auto 5mm !important;
        padding: 0 !important;

        background: #fff !important;

        overflow: visible !important;
    }

    .brevia-panel {
        width: 100% !important;
        max-width: none !important;

        box-shadow: none !important;
        border: none !important;
    }

    .brevia-box,
    .brevia-gw-box {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .brevia-actions {
        display: none !important;
    }

    .brevia-gw-svg {
        max-height: 92mm;
    }
}



/* GDfB BreVIA Darstellungsumschalter START */

#gdfb-brevia-darstellung {
    display: block;
    visibility: visible;
    opacity: 1;

    position: static;
    transform: none;

    width: auto;
    max-width: none;

    margin: 12px 0 16px 0;
    padding: 12px;

    background: #f7f9fb;
    border: 1px solid #d7e0e8;
    border-radius: 6px;
    box-shadow: none;

    font-family: inherit;
}

#gdfb-brevia-darstellung
.gdfb-brevia-darstellung-titel {
    margin-bottom: 7px;
    font-weight: 600;
    text-align: center;
}

#gdfb-brevia-darstellung
.gdfb-brevia-darstellung-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

#gdfb-brevia-darstellung
button {
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid #777;
    border-radius: 5px;
    background: #fff;
    color: #222;
    cursor: pointer;
}

#gdfb-brevia-darstellung
button:hover:not(:disabled) {
    background: #f0f0f0;
}

#gdfb-brevia-darstellung
button.is-active {
    background: #343a40;
    border-color: #343a40;
    color: #fff;
    font-weight: 600;
}

#gdfb-brevia-darstellung
button:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

#gdfb-brevia-darstellung
.gdfb-brevia-darstellung-hinweis {
    max-width: 520px;
    margin-top: 8px;
    font-size: 0.88rem;
    line-height: 1.3;
}

@media (max-width: 768px) {

    #gdfb-brevia-darstellung {
        top: auto;
        bottom: 14px;
        width: calc(100vw - 28px);
    }

    #gdfb-brevia-darstellung
    .gdfb-brevia-darstellung-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}


#gdfb-brevia-darstellung
.gdfb-brevia-klickhinweis {
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #d8dee7;
    border-radius: 6px;
    background: #f7f9fc;
    color: #243447;
    font-size: 0.95rem;
    line-height: 1.35;
    text-align: center;
}

/* GDfB BreVIA Darstellungsumschalter ENDE */


#gdfb-brevia-darstellung
.gdfb-brevia-darstellung-buttons button {
    width: 100%;
    text-align: left;
}

/* GDfB Fachbereich Hauptmenue kompakt */
body.gdfb-fachbereich-aktiv #mp-header-mainMenu {
    height: 12px !important;
    min-height: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: 0 0 12px !important;
}

/* GDfB BreVIA Standortauskunft Hilfe */

#gdfb-brevia-darstellung
.gdfb-brevia-klickhinweis strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
}

#gdfb-brevia-darstellung
.gdfb-brevia-klickhinweis-text {
    line-height: 1.4;
}

#gdfb-brevia-darstellung
.gdfb-brevia-hilfe {
    margin-top: 8px;
    text-align: left;
}

#gdfb-brevia-darstellung
.gdfb-brevia-hilfe summary {
    cursor: pointer;
    font-weight: 600;
    color: #0b4a6f;
}

#gdfb-brevia-darstellung
.gdfb-brevia-hilfe-inhalt {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #d8dee7;
    font-size: 0.9rem;
    line-height: 1.45;
}

#gdfb-brevia-darstellung
.gdfb-brevia-hilfe-inhalt ol {
    margin: 0;
    padding-left: 20px;
}

#gdfb-brevia-darstellung
.gdfb-brevia-hilfe-inhalt li {
    margin-bottom: 6px;
}

/* BreVIA – direkte Metadatenlinks */

.gdfb-brevia-metadaten-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 4px 0 10px;
    font-size: 0.82rem;
    line-height: 1.3;
}

.gdfb-brevia-metadaten-links span:first-child {
    font-weight: 600;
}

.gdfb-brevia-metadaten-links a {
    color: #0b4a6f;
    text-decoration: underline;
}

.gdfb-brevia-metadaten-links a:hover {
    text-decoration: none;
}

/* BreVIA – Gebietstrennung Bremen / Bremerhaven */

.gdfb-brevia-gebiet {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #d6dde3;
}

.gdfb-brevia-gebiet:first-of-type {
    margin-top: 8px;
}

.gdfb-brevia-gebiet-kopf {
    margin-bottom: 2px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.gdfb-brevia-gebiet .gdfb-brevia-metadaten-links {
    margin: 2px 0 8px;
    font-size: 0.82rem;
}

.gdfb-brevia-gebiet .gdfb-brevia-metadaten-links a {
    font-weight: 600;
}

.gdfb-brevia-gebiet-hinweis {
    margin-top: 6px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #4f5b66;
}

/* BreVIA – Legenden-Dialog */

.gdfb-brevia-legende-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #00577a;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.gdfb-brevia-legende-dialog {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.35);
}

.gdfb-brevia-legende-dialog.is-open {
    display: flex;
}

.gdfb-brevia-legende-box {
    position: relative;
    width: min(420px, calc(100vw - 40px));
    max-height: calc(100vh - 80px);
    overflow: auto;
    padding: 22px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.gdfb-brevia-legende-schliessen {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.gdfb-brevia-legende-titel {
    margin: 0 32px 16px 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.gdfb-brevia-legende-zeile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.gdfb-brevia-legende-farbe {
    flex: 0 0 28px;
    width: 28px;
    height: 18px;
    border: 1px solid #666;
}

.gdfb-brevia-legende-gruen {
    background: #70ad47;
}

.gdfb-brevia-legende-gelb {
    background: #ffc000;
}

.gdfb-brevia-legende-rot {
    background: #c00000;
}

.gdfb-brevia-legende-grau {
    background: #bfbfbf;
}

.gdfb-brevia-legende-inhalt p {
    margin: 14px 0 0;
    line-height: 1.4;
}

/* ==========================================================
   Kartenebenen-Hilfe kompakter
   ========================================================== */

.gdfb-kartenebenen-hilfe {
    font-size: 0.88rem;
    line-height: 1.25;
}

.gdfb-kartenebenen-hilfe h2,
.gdfb-kartenebenen-hilfe h3 {
    margin-top: 8px;
    margin-bottom: 5px;
    font-size: 1.05rem;
    line-height: 1.15;
}

.gdfb-kartenebenen-hilfe p {
    margin-top: 3px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.gdfb-kartenebenen-hilfe > div,
.gdfb-kartenebenen-hilfe .gdfb-layer-help-row {
    padding-top: 7px;
    padding-bottom: 7px;
}

.gdfb-kartenebenen-hilfe svg,
.gdfb-kartenebenen-hilfe i {
    transform: scale(0.88);
    transform-origin: center;
}

/* BreVIA – kf-Klassen in der Legende */

.gdfb-brevia-legende-kf {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #d6dde3;
}

.gdfb-brevia-legende-kf-titel {
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.3;
}

.gdfb-brevia-legende-kf-zeile {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto;
    gap: 14px;
    padding: 4px 0;
    font-size: 0.88rem;
    line-height: 1.3;
}

.gdfb-brevia-legende-kf-zeile strong {
    white-space: nowrap;
}

@media (max-width: 520px) {
    .gdfb-brevia-legende-kf-zeile {
        grid-template-columns: 1fr;
        gap: 1px;
    }
}

/* BreVIA – Legendenfenster verschiebbar */

.gdfb-brevia-legende-titel {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.gdfb-brevia-legende-zieht,
.gdfb-brevia-legende-zieht * {
    cursor: grabbing !important;
    user-select: none !important;
}

/* Kartenebenen-Hilfe deutlich kompakter */

.gdfb-kartenebenen-hilfe {
    font-size: 0.78rem !important;
    line-height: 1.18 !important;
}

.gdfb-kartenebenen-hilfe h2,
.gdfb-kartenebenen-hilfe h3 {
    margin: 4px 0 3px !important;
    font-size: 0.95rem !important;
    line-height: 1.1 !important;
}

.gdfb-kartenebenen-hilfe p {
    margin: 1px 0 3px !important;
    line-height: 1.2 !important;
}

.gdfb-kartenebenen-hilfe > div,
.gdfb-kartenebenen-hilfe .gdfb-layer-help-row {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.gdfb-kartenebenen-hilfe hr {
    margin: 5px 0 !important;
}

.gdfb-kartenebenen-hilfe svg,
.gdfb-kartenebenen-hilfe i {
    transform: scale(0.72) !important;
    transform-origin: center !important;
}

.gdfb-kartenebenen-hilfe strong {
    font-size: 0.92em !important;
}


/* ============================================================
   GDfB BreVIA Startbox 20260930
   ============================================================ */

#gdfb-brevia-darstellung
.gdfb-brevia-klickhinweis {
    padding: 16px 18px !important;

    border: 1px solid #cfd8e3 !important;
    border-left: 6px solid #0b5f8a !important;
    border-radius: 9px !important;

    background: #f4f9fc !important;

    text-align: center !important;
}

#gdfb-brevia-darstellung
.gdfb-brevia-startbox-logos {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 12px;
}

#gdfb-brevia-darstellung
.gdfb-brevia-startbox-logo {
    display: block;

    width: auto;
    height: auto;

    object-fit: contain;
}

#gdfb-brevia-darstellung
.gdfb-brevia-startbox-logo.gdfb {
    max-width: 125px;
    max-height: 52px;
}

#gdfb-brevia-darstellung
.gdfb-brevia-startbox-logo.brevia {
    max-width: 145px;
    max-height: 55px;
}

#gdfb-brevia-darstellung
.gdfb-brevia-startbox-title {
    display: block;

    margin: 0 0 8px 0;

    color: #17324d;

    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 700;
}

#gdfb-brevia-darstellung
.gdfb-brevia-klickhinweis-text {
    margin: 0 auto 12px auto;

    max-width: 520px;

    color: #2b3d4f;

    font-size: 0.96rem;
    line-height: 1.4;
}

#gdfb-brevia-darstellung
#gdfb-brevia-darstellung
#gdfb-brevia-darstellung
#gdfb-brevia-darstellung
.gdfb-brevia-hilfe {
    margin-top: 6px;

    text-align: left;
}

#gdfb-brevia-darstellung
.gdfb-brevia-hilfe summary {
    color: #0b5f8a;

    cursor: pointer;

    font-weight: 700;
}

@media (max-width: 700px) {

    #gdfb-brevia-darstellung
    .gdfb-brevia-startbox-logos {
        gap: 10px;
    }

    #gdfb-brevia-darstellung
    .gdfb-brevia-startbox-logo.gdfb {
        max-width: 100px;
        max-height: 44px;
    }

    #gdfb-brevia-darstellung
    .gdfb-brevia-startbox-logo.brevia {
        max-width: 115px;
        max-height: 46px;
    }

    #gdfb-brevia-darstellung
    .gdfb-brevia-startbox-title {
        font-size: 1.05rem;
    }

}

/* GDfB BreVIA Schwammstadt-Logo Größenfix 20260930 */

#gdfb-brevia-darstellung
.gdfb-brevia-startbox-logo.schwammstadt {
    display: block !important;

    width: 170px !important;
    height: 55px !important;

    max-width: 170px !important;
    max-height: 55px !important;

    object-fit: contain !important;

    flex: 0 0 170px !important;
}

#gdfb-brevia-darstellung
.gdfb-brevia-startbox-logo.brevia {
    width: 145px !important;
    height: 55px !important;

    max-width: 145px !important;
    max-height: 55px !important;

    object-fit: contain !important;

    flex: 0 0 145px !important;
}

#gdfb-brevia-darstellung
.gdfb-brevia-startbox-logos {
    min-height: 60px !important;
    max-height: 65px !important;

    overflow: hidden !important;

    align-items: center !important;
}

/* BreVIA Legende Bremen: nicht geeignet = topographische Karte */

#gdfb-brevia-darstellung
.gdfb-brevia-legende-leer {
    background: #ffffff !important;
    border: 2px solid #666666 !important;
    box-sizing: border-box !important;
}


/* ==========================================================
   BreVIA – WMS-Informationsknöpfe
   ========================================================== */

.gdfb-brevia-darstellung-zeile {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.gdfb-brevia-darstellung-zeile > button[data-brevia-modus] {
    flex: 1 1 auto;
}

.gdfb-brevia-darstellung-zeile > .gdfb-brevia-wms-info {
    flex: 0 0 30px !important;

    width: 30px !important;
    height: 30px !important;

    min-width: 30px !important;
    max-width: 30px !important;

    padding: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: 2px solid #173a59 !important;
    border-radius: 50% !important;

    background: #ffffff !important;
    color: #173a59 !important;

    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    cursor: pointer;
}

.gdfb-brevia-darstellung-zeile > .gdfb-brevia-wms-info:hover,
.gdfb-brevia-darstellung-zeile > .gdfb-brevia-wms-info:focus {
    background: #173a59 !important;
    color: #ffffff !important;
}


/* ==========================================================
   BreVIA – WMS-Informationsknöpfe
   ========================================================== */

.gdfb-brevia-darstellung-zeile {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

.gdfb-brevia-darstellung-zeile
> button[data-brevia-modus] {
    flex: 1 1 auto !important;
    width: auto !important;
}

.gdfb-brevia-darstellung-zeile
> button.gdfb-brevia-wms-info {
    flex: 0 0 30px !important;

    width: 30px !important;
    height: 30px !important;

    min-width: 30px !important;
    max-width: 30px !important;

    min-height: 30px !important;
    max-height: 30px !important;

    aspect-ratio: 1 / 1 !important;

    padding: 0 !important;
    margin: 0 !important;

    box-sizing: border-box !important;

    border: 2px solid #173a59 !important;
    border-radius: 50% !important;

    background: #ffffff !important;
    color: #173a59 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    text-align: center !important;
    vertical-align: middle !important;

    cursor: pointer !important;

    align-self: center !important;
}

.gdfb-brevia-darstellung-zeile
> button.gdfb-brevia-wms-info:hover,
.gdfb-brevia-darstellung-zeile
> button.gdfb-brevia-wms-info:focus {
    background: #173a59 !important;
    color: #ffffff !important;
}



/* ==========================================================
   BreVIA – Legende innerhalb der Masterportal-Layerinformation
   ========================================================== */

.gdfb-brevia-layerinfo-legende {
    padding: 12px 14px 18px 14px;
    max-width: 720px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.gdfb-brevia-layerinfo-legende
.gdfb-brevia-legende-titel {
    margin: 0 0 16px 0;
    cursor: default;
    user-select: text;
}

.gdfb-brevia-layerinfo-legende
.gdfb-brevia-legende-leer {
    background: #ffffff !important;
    border: 2px solid #666666 !important;
    box-sizing: border-box !important;
}

.gdfb-brevia-layerinfo-legende p {
    margin: 16px 0 0 0;
}

.gdfb-brevia-layerinfo-legende
.gdfb-brevia-legende-kf {
    margin-top: 18px;
}

