/**
 * LORO-X Online-Berechnung Styles
 * Passend zum LORO Template (style.css)
 *
 * VEREINHEITLICHT 2026-07-19: nutzt jetzt die zentralen Komponenten
 * (.oa-btn / .oa-card / .alert / .oa-badge / .form-control / .table,
 * Markenblau #006aac) aus templates/css/style.css. Toter nackter
 * .btn/.btn-primary/.btn-secondary-Block entfernt (Markup nutzt laengst
 * .oa-btn). Hier verbleiben nur noch einzigartige Kernfeatures
 * (Ergebnis-Ampel, Artikel-Autocomplete, Hilfe-Tooltip, Teilflaechen-Header).
 * Original-Backup: backups/tool_styles_2026-07-19/online-berechnung/.
 *
 * Farben:
 * - Primaer: #006aac (CI-Blau)
 * - Primaer Hover: #005590
 * - Text: #444444
 * - Hintergrund: #ffffff
 * - Hellgrau: #eeeeee
 * - Grau: #cccccc
 */

/* ========================================
   CONTAINER - Mit CSS-Isolation
   ======================================== */
.calc-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    color: #444444;
    line-height: 1.6;
    /* CSS-Isolation gegen TYPO3 Template-Konflikte */
    position: relative;
    box-sizing: border-box;
    display: block;
    float: none;
    clear: both;
}

.calc-container *,
.calc-container *::before,
.calc-container *::after {
    box-sizing: border-box;
}

.calc-container .calc-section {
    position: relative;
    display: block;
    float: none;
    clear: both;
}

/* ========================================
   TITEL
   ======================================== */
.calc-title {
    font-size: 1.5rem;
    color: #006aac;
    margin: 0 0 25px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #006aac;
}

/* ========================================
   SEKTIONEN – Basis (Hintergrund/Grundrahmen) jetzt aus zentraler .oa-card;
   hier nur noch die Marken-Rahmenfarbe + Layout-Werte, die der
   Negativ-Margin-Bleed-Trick der Teilflaechen-Header (s.u.) braucht.
   overflow:visible hebt oa-cards overflow:hidden wieder auf, damit der
   Hilfe-Icon-Tooltip (::after) nicht abgeschnitten wird.
   ======================================== */
.calc-section {
    border-color: #006aac;
    border-radius: 4px;
    margin-bottom: 25px;
    padding: 20px;
    overflow: visible;
}

.calc-section-title {
    font-size: 1.25rem;
    color: #006aac;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eeeeee;
}

.calc-flaeche {
    background: #fafafa;
}

.calc-flaeche-title {
    background: #006aac;
    color: #ffffff;
    margin: -20px -20px 20px -20px;
    padding: 15px 20px;
    border-radius: 3px 3px 0 0;
    border-bottom: none;
}

.calc-flaeche-title .calc-flaeche-name {
    font-weight: normal;
    font-size: 1rem;
    margin-left: 15px;
    opacity: 0.9;
}

/* Teilfläche Header mit Buttons */
.calc-flaeche-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #006aac;
    margin: -20px -20px 20px -20px;
    padding: 10px 20px;
    border-radius: 3px 3px 0 0;
}

.calc-flaeche-header .calc-section-title {
    background: transparent;
    margin: 0;
    padding: 5px 0;
    border: none;
    flex: 1;
}

.calc-flaeche-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.calc-btn-add,
.calc-btn-remove {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.calc-btn-add {
    background: #28a745;
    color: #ffffff;
}

.calc-btn-add:hover {
    background: #218838;
    transform: scale(1.1);
}

.calc-btn-remove {
    background: #dc3545;
    color: #ffffff;
}

.calc-btn-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Nur eine Teilfläche - Remove-Button deaktiviert */
.calc-flaeche:only-of-type .calc-btn-remove {
    opacity: 0.4;
    cursor: not-allowed;
}

.calc-flaeche:only-of-type .calc-btn-remove:hover {
    transform: none;
    background: #dc3545;
}

/* Responsive */
@media (max-width: 480px) {
    .calc-flaeche-header {
        margin: -15px -15px 15px -15px;
        padding: 10px 15px;
    }

    .calc-btn-add,
    .calc-btn-remove {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }

    .calc-flaeche-title {
        font-size: 1rem;
    }
}

/* ========================================
   FORMULAR ZEILEN
   ======================================== */
.calc-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.calc-row > label:first-child {
    flex: 0 0 280px;
    font-weight: 500;
    color: #444444;
}

/* Optik (Rand/Radius/Fokus) kommt jetzt aus zentralem .form-control/.form-select;
   hier nur noch die Flex-Einbettung in die .calc-row-Zeile. */
.calc-row .form-control,
.calc-row .form-select {
    flex: 1;
    min-width: 150px;
}

.calc-input-small {
    max-width: 100px !important;
    flex: 0 0 100px !important;
}

/* Link-Button fuer externe Seiten (z.B. KOSTRA-DWD) */
.calc-link-button {
    display: inline-block;
    padding: 10px 16px;
    font-size: 0.95rem;
    color: #006aac;
    background: #e8f2f9;
    border: 1px solid #006aac;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.calc-link-button:hover {
    background: #006aac;
    color: #ffffff;
}

.calc-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.calc-unit {
    color: #666666;
    font-size: 0.9rem;
    white-space: nowrap;
}

.calc-hint {
    font-size: 0.85rem;
    color: #006aac;
    margin-left: 10px;
}

/* ========================================
   HILFE-ICON MIT TOOLTIP (dezenter Quellenhinweis, z.B. KOSTRA-DWD/CC BY 4.0)
   Hover/Focus fuer Desktop per CSS, Tap-Toggle fuer Mobile per JS (Klasse --active)
   ======================================== */
.calc-help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 3px;
    border: 1px solid #999999;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    color: #666666;
    cursor: help;
    user-select: none;
    vertical-align: middle;
}

.calc-help-icon:hover,
.calc-help-icon:focus,
.calc-help-icon.calc-help-icon--active {
    background: #e8f2f9;
    border-color: #006aac;
    color: #006aac;
    outline: none;
}

.calc-help-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 0;
    background: #333333;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: normal;
    white-space: normal;
    width: 230px;
    text-align: left;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 1000;
    pointer-events: none;
}

.calc-help-icon:hover::after,
.calc-help-icon:focus::after,
.calc-help-icon.calc-help-icon--active::after {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   RADIO BUTTONS
   ======================================== */
.calc-radio-group {
    display: flex;
    gap: 20px;
    flex: 1;
}

.calc-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: normal;
}

.calc-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #006aac;
    cursor: pointer;
}

/* ========================================
   CHECKBOX
   ======================================== */
.calc-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.calc-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #006aac;
    cursor: pointer;
}

/* ========================================
   ERWEITERTE FUNKTIONEN
   ======================================== */
.calc-extended {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.calc-extended h4 {
    font-size: 1.1rem;
    color: #006aac;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eeeeee;
}

.calc-retention-section {
    background: #f5f9fc;
    border: 1px solid #006aac;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

/* ========================================
   WARNUNGEN – Box (Hintergrund/Rahmen) jetzt zentrale .alert-warning;
   hier nur noch der einzigartige nummerierte "!"-Icon-Bullet je Zeile.
   ======================================== */
.calc-warnung {
    color: #856404;
    margin: 0 0 8px 0;
    padding-left: 25px;
    position: relative;
}

.calc-warnung:last-child {
    margin-bottom: 0;
}

.calc-warnung::before {
    content: "!";
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    background: #ffc107;
    color: #856404;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-weight: bold;
    font-size: 0.85rem;
}

/* ========================================
   ERGEBNISSE MIT ABLAUF-FELDERN
   ======================================== */
.calc-ergebnis-container {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.calc-ergebnis-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.calc-ergebnis-box {
    padding: 15px;
    text-align: center;
    border-radius: 4px 4px 0 0;
}

.calc-ergebnis-haupt {
    background: #46b270;
    color: #ffffff;
}

.calc-ergebnis-not {
    background: #e30613;
    color: #ffffff;
}

.calc-ergebnis-label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 5px;
    opacity: 0.95;
}

.calc-ergebnis-wert {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
}

/* Ablauf-Felder unter den Ergebnis-Boxen */
.calc-ablauf-feld {
    background: #f5f5f5;
    border: 1px solid #cccccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 10px;
}

.calc-ablauf-feld label {
    display: block;
    font-size: 0.8rem;
    color: #666666;
    margin-bottom: 5px;
}

/* Anzahl + Ablauf Zeile */
.calc-ablauf-input-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.calc-anzahl-input {
    width: 55px !important;
    min-width: 55px;
    flex-shrink: 0;
    text-align: center;
    padding: 8px 5px !important;
    font-size: 0.9rem;
    border: 1px solid #cccccc;
    border-radius: 3px;
}

.calc-anzahl-x {
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
}

.calc-ablauf-input-row .calc-artikel-input {
    flex: 1;
    min-width: 0;
}

/* Entfernen-Button */
.calc-ablauf-clear {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    margin-left: 5px;
    font-size: 1.2rem;
    line-height: 1;
    color: #999;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-ablauf-clear:hover {
    color: #e30613;
    background: #fff;
    border-color: #e30613;
}

/* Retention-Hinweis */
.calc-retention-hinweis {
    margin-top: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.calc-ablauf-feld input {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9rem;
    border: 1px solid #cccccc;
    border-radius: 3px;
}

.calc-ablauf-feld input:focus {
    border-color: #006aac;
    outline: none;
}

.calc-ablauf-feld .calc-lx-link-container {
    margin-top: 5px;
}

/* Ablauf-Info (wenn LX-Nummer eingegeben) */
.calc-ablauf-info {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.85rem;
    color: #444;
}

.calc-ablauf-info strong {
    color: #006aac;
}

/* Haupt-Spalte Styling */
.calc-ergebnis-column-haupt .calc-ablauf-feld {
    border-color: #46b270;
    background: #f0f9f4;
}

/* Not-Spalte Styling */
.calc-ergebnis-column-not .calc-ablauf-feld {
    border-color: #e30613;
    background: #fef5f5;
}

/* Animation fuer Live-Updates */
.calc-ergebnis-wert.calc-updated {
    animation: calc-pulse 0.3s ease-out;
}

@keyframes calc-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input-Felder Aktualisierung */
input.calc-updated {
    background-color: #e8f2f9 !important;
    transition: background-color 0.3s ease;
}

/* ========================================
   PRODUKTVORSCHLAEGE
   ======================================== */
.calc-vorschlaege {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #eeeeee;
    border-radius: 4px;
}

.calc-vorschlaege-hinweis {
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 15px;
    text-align: center;
}

/* width/border-collapse/margin jetzt aus zentralem .table; hier nur noch
   die Abweichung vom Tabellen-Grid (kein Rahmen, 2 gleich breite Spalten
   fuer Haupt-/Not-Vorschlag nebeneinander). */
.calc-vorschlaege-table {
    border: none;
}

.calc-vorschlaege-table td {
    padding: 10px;
    vertical-align: middle;
    border: none;
    width: 50%;
}

.calc-vorschlag-haupt {
    background: #e8f5e9;
}

.calc-vorschlag-not {
    background: #ffebee;
}

.calc-vorschlaege-table a {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #006aac;
    text-decoration: none;
    padding: 10px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.calc-vorschlaege-table a:hover {
    background: rgba(0, 106, 172, 0.1);
}

.calc-vorschlaege-table img {
    flex-shrink: 0;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    background: #ffffff;
}

.calc-vorschlaege-table span {
    font-weight: 500;
}

/* ========================================
   BUTTONS
   ======================================== */
.calc-actions {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
}

/* Toter .btn/.btn-primary/.btn-secondary-Block entfernt 2026-07-19:
   nackte globale Selektoren, im Markup laengst durch .oa-btn ersetzt
   (kollidierte site-weit mit anderen Tools). Siehe Backup. */

/* ========================================
   PDF DOWNLOAD – Box (Hintergrund/Rahmen) jetzt zentrale .alert-info;
   hier nur noch Innenabstand/Abstand/Ueberschrift.
   ======================================== */
.calc-pdf-download {
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.calc-pdf-download h2 {
    font-size: 1.25rem;
    color: #006aac;
    margin: 0 0 15px 0;
}

.pdf-icon {
    display: inline-block;
    background: #e30613;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ========================================
   HINWEISTEXTE
   ======================================== */
.calc-hinweise {
    margin-top: 40px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #666666;
}

.calc-hinweise p {
    margin: 0 0 15px 0;
}

.calc-hinweise p:last-child {
    margin-bottom: 0;
}

.calc-hinweise small {
    font-size: 0.85rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .calc-container {
        padding: 15px;
    }

    .calc-row {
        flex-direction: column;
        align-items: stretch;
    }

    .calc-row > label:first-child {
        flex: none;
        margin-bottom: 5px;
    }

    .calc-input-group {
        flex-wrap: wrap;
    }

    .calc-input-small {
        max-width: 100% !important;
        flex: 1 !important;
    }

    .calc-radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .calc-ergebnis-container {
        flex-direction: column;
        gap: 15px;
    }

    .calc-ergebnis-box {
        border-radius: 4px 4px 0 0;
    }

    .calc-vorschlaege-table td {
        display: block;
        width: 100%;
    }

    .calc-vorschlaege-table tr {
        display: block;
        margin-bottom: 10px;
    }

    .calc-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .calc-actions .oa-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calc-title {
        font-size: 1.25rem;
    }

    .calc-section {
        padding: 15px;
    }

    .calc-flaeche-title {
        margin: -15px -15px 15px -15px;
        padding: 12px 15px;
    }

    .calc-ergebnis-wert {
        font-size: 1.25rem;
    }
}

/* ========================================
   ARTIKEL-SUCHE AUTOCOMPLETE
   ======================================== */
.calc-artikel-search-container {
    flex: 1;
    position: relative;
}

.calc-artikel-input {
    width: 100%;
}

.calc-artikel-popup {
    background: #ffffff;
    border: 1px solid #006aac;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
}

.calc-artikel-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.calc-artikel-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eeeeee;
    transition: background-color 0.15s ease;
}

.calc-artikel-item:last-child {
    border-bottom: none;
}

.calc-artikel-item:hover,
.calc-artikel-item.active {
    background-color: #e8f2f9;
}

.calc-artikel-item strong {
    color: #006aac;
    font-size: 0.95rem;
}

.calc-artikel-item small {
    color: #666666;
    font-size: 0.8rem;
    line-height: 1.3;
    display: block;
    margin-top: 3px;
}

.calc-artikel-loading,
.calc-artikel-no-results {
    padding: 15px;
    text-align: center;
    color: #666666;
    font-size: 0.9rem;
}

/* LX-Link Container */
.calc-lx-link-container {
    margin-top: 8px;
}

.calc-lx-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #006aac;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 10px;
    background: #e8f2f9;
    border: 1px solid #006aac;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.calc-lx-link:hover {
    background: #006aac;
    color: #ffffff;
}

/* Basis-Optik jetzt zentrale .oa-badge/.oa-badge-primary; .calc-lx-badge
   bleibt nur noch als Hook fuer die Hover-Farbumkehr (Link/Chooser-Vorschau
   wird blau, Badge dreht auf Weiss-auf-Blau-Kontrast). */
.calc-lx-link:hover .calc-lx-badge {
    background: #ffffff;
    color: #006aac;
}

.calc-lx-info {
    display: inline-block;
    color: #666666;
    font-size: 0.85rem;
    padding: 5px 10px;
    background: #f5f5f5;
    border: 1px solid #cccccc;
    border-radius: 4px;
}

/* ========================================
   PRODUKTFOTOS
   ======================================== */
.calc-produkt-foto-container {
    margin-top: 10px;
    text-align: center;
}

.calc-produkt-foto {
    max-width: 100%;
    max-height: 120px;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    background: #ffffff;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Haupt-Spalte Foto */
.calc-ergebnis-column-haupt .calc-produkt-foto {
    border-color: #46b270;
}

/* Not-Spalte Foto */
.calc-ergebnis-column-not .calc-produkt-foto {
    border-color: #e30613;
}

/* ========================================
   ARTIKEL-SUCHERGEBNISSE MIT FOTO
   ======================================== */
.calc-artikel-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calc-artikel-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    background: #ffffff;
    flex-shrink: 0;
}

.calc-artikel-text {
    flex: 1;
    min-width: 0;
}

/* Overflow-Fix (2026-07-19): .calc-ergebnis-column ist flex:1-Kind ohne
   min-width:0 (Default auto verhindert Schrumpfen unter Content-Breite);
   Produktvorschlag-Bilder sind flex-shrink:0 und hatten kein max-width, ein
   grosses Rohbild haette die 50%-Tabellenzelle sprengen koennen. */
.calc-ergebnis-column { min-width: 0; }
.calc-vorschlaege-table img { max-width: 100%; }

/* ========================================
   Q-INFO ANZEIGE (Leistung & Anzahl)
   ======================================== */
.calc-q-info-container {
    margin-top: 8px;
}

.calc-q-info {
    background: #f0f7ff;
    border: 1px solid #006aac;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.calc-q-leistung {
    color: #006aac;
    font-weight: 500;
}

.calc-q-anzahl {
    color: #444444;
}

.calc-q-anzahl strong {
    color: #006aac;
    font-size: 1rem;
}

/* Haupt-Spalte Q-Info */
.calc-ergebnis-column-haupt .calc-q-info {
    background: #e8f5e9;
    border-color: #46b270;
}

.calc-ergebnis-column-haupt .calc-q-leistung,
.calc-ergebnis-column-haupt .calc-q-anzahl strong {
    color: #2e7d32;
}

/* Not-Spalte Q-Info */
.calc-ergebnis-column-not .calc-q-info {
    background: #ffebee;
    border-color: #e30613;
}

.calc-ergebnis-column-not .calc-q-leistung,
.calc-ergebnis-column-not .calc-q-anzahl strong {
    color: #c62828;
}

/* ========================================
   LX-CHOOSER (Mehrere Datenblätter)
   ======================================== */
.calc-lx-chooser {
    background: #f0f7ff;
    border: 1px solid #006aac;
    border-radius: 4px;
    padding: 10px;
}

.calc-lx-chooser-label {
    font-size: 0.8rem;
    color: #006aac;
    font-weight: 500;
    margin-bottom: 8px;
}

.calc-lx-chooser-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    flex-wrap: wrap;
}

.calc-lx-chooser-item + .calc-lx-chooser-item {
    border-top: 1px solid #d0e3f0;
}

.calc-lx-chooser-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #006aac;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 8px;
    background: #e8f2f9;
    border: 1px solid #006aac;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.calc-lx-chooser-preview:hover {
    background: #006aac;
    color: #ffffff;
}

.calc-lx-chooser-preview:hover .calc-lx-badge {
    background: #ffffff;
    color: #006aac;
}

.calc-lx-chooser-q {
    font-size: 0.8rem;
    color: #555;
}

.calc-lx-chooser-btn {
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #ffffff;
    background: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.calc-lx-chooser-btn:hover {
    background: #218838;
}

/* Responsive Artikel-Suche */
@media (max-width: 768px) {
    .calc-artikel-popup {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-height: 50vh;
    }

    .calc-artikel-search-container {
        width: 100%;
    }

    .calc-artikel-thumb {
        width: 40px;
        height: 40px;
    }
}

/* ===== Kombi-Ablaeufe (2026-07-24): voller-Breite-Kasten unter Haupt/Not.
   Zugeklappt als Randerscheinung; oeffnet bei Belegung. Der zweifarbige Punkt
   (gruen/rot) ist dieselbe Farbsprache wie die Kombi-Marker der Plan-Messung. */
.calc-kombi-block { background: #fff; border: 1px solid #ccc; border-radius: 4px;
    padding: 0 16px; margin: 10px 0 0; }
.calc-kombi-block > summary { padding: 10px 0; color: #006aac; font-weight: 600;
    font-size: 0.92rem; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.calc-kombi-block > summary:hover { color: #00568a; }
.calc-kombi-punkt { width: 14px; height: 14px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,.35); display: inline-block; flex: 0 0 auto;
    background: linear-gradient(90deg, #46b270 50%, #e30613 50%); }
.calc-kombi-inner { padding: 4px 0 14px; border-top: 1px solid #eee; }
.calc-kombi-anteil, .calc-kombi-anteil-uebernahme { display: block; font-size: 0.78rem;
    color: #444; margin-top: 3px; }
.calc-kombi-vorschlaege { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.calc-kombi-vorschlag { display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid #ccc; border-radius: 4px; background: #fff; padding: 6px 10px;
    font-size: 0.8rem; color: #444; cursor: pointer; text-align: left; }
.calc-kombi-vorschlag:hover { border-color: #006aac; background: #f0f7fc; }
.calc-kombi-vorschlag img { width: 42px; height: 42px; object-fit: contain; }

/* ===== Klapp-Vorschlaege je Ablauf-Kasten (2026-07-24): erst aufklappen,
   dann Schnellauswahl - Klick uebernimmt Artikel + Anzahl in "Gewaehlt". */
.calc-vorschlaege-klapp { margin-top: 8px; }
.calc-vorschlaege-klapp > summary { color: #006aac; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; padding: 2px 0; }
.calc-vorschlaege-klapp > summary:hover { color: #00568a; }
.calc-vorschlaege-liste { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* Kombi-Vorschlaege: festes 3x2-Raster (Betreiber 2026-08-02); auf schmalen
   Handys 2 Spalten, damit die Karten lesbar bleiben */
.calc-vorschlaege-3x2 { display: grid; grid-template-columns: repeat(3, 1fr); }
.calc-vorschlaege-3x2 .calc-vorschlag-item { width: 100%; }
@media (max-width: 480px) {
  .calc-vorschlaege-3x2 { grid-template-columns: repeat(2, 1fr); }
}
/* Einzel-Vorschlaege Haupt/Not (2026-08-02, "immer sechs"): 2 Spalten x 3
   Reihen - die Kaesten sind nur halb so breit wie der Kombi-Kasten */
.calc-vorschlaege-2x3 { display: grid; grid-template-columns: repeat(2, 1fr); }
.calc-vorschlaege-2x3 .calc-vorschlag-item { width: 100%; }
.calc-vorschlag-item { display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid #ccc; border-radius: 4px; background: #fff; padding: 4px 8px;
    font-size: 0.78rem; color: #444; cursor: pointer; text-align: left; }
.calc-vorschlag-item:hover { border-color: #006aac; background: #f0f7fc; }
.calc-vorschlag-item img { width: 38px; height: 38px; object-fit: contain; }

/* ===== Bemessungs-Haken (2026-07-24): erscheint, wenn Ist >= Soll ===== */
.calc-bemessung-ok{color:#28a745;font-weight:700;font-size:1.15rem;line-height:1;margin-left:.3rem;align-self:center;}
.calc-bemessung-ok[hidden]{display:none;}

/* ===== KOSTRA-Nachweis zur Regenspende (2026-07-28) =====
   Steht als schmale Zeile unter den beiden Regenspende-Feldern und nennt Ort,
   PLZ und Quelle. Wird von script.js live umgeschrieben; bei von Hand
   geaenderter Regenspende erscheint statt der Quellenangabe ein neutraler
   Hinweis (.calc-kostra-geaendert) - eine KOSTRA-Quelle an einem selbst
   eingetippten Wert waere falsch. */
.calc-kostra-nachweis { margin: 0; font-size: 0.8rem; line-height: 1.5; color: #006aac; }
.calc-kostra-nachweis.calc-kostra-geaendert { color: #777777; }
.calc-kostra-zeile { margin-top: -6px; }

/* ===== Kontrollkaestchen "inkl. Stueckliste" neben dem PDF-Knopf (2026-07-28) ===== */
.calc-stueckliste-wahl { display: inline-flex; align-items: center; gap: 7px;
    font-size: 0.88rem; color: #444444; cursor: pointer; margin: 0; }
.calc-stueckliste-wahl input { margin: 0; cursor: pointer; }
/* Dropdown "Ausgabesprache" neben dem PDF-Knopf (2026-08-23): wirkt nur auf
   das erzeugte PDF, nicht auf diese Seite - deshalb bewusst dezent gehalten. */
.calc-ausgabesprache-wahl { display: inline-flex; align-items: center; gap: 7px;
    font-size: 0.88rem; color: #444444; margin: 0; }
.calc-ausgabesprache-wahl select { cursor: pointer; }
/* Kurzhinweis unter der Vorschlaege-Ueberschrift (2026-08-02): Vorschlaege
   beruecksichtigen Leistung+Dachaufbau, nicht die Abdichtung; Details im title-Hover */
.calc-vorschlag-hinweis { font-size: 0.82em; color: #666; margin: 2px 0 4px; cursor: help;
  text-decoration: underline dotted; text-underline-offset: 2px; }

/* Rasterzellen-Auswahl (2026-08-03): dezenter Hinweis unter der Auswahl */
.calc-kostra-zellen-hinweis { font-size: 0.85rem; color: #666; margin: 0; }
/* Das hidden-Attribut allein reicht hier NICHT: die Browser-Regel [hidden]{display:none}
   ist schwaecher als die Klassenregel .calc-row{display:flex} und wird ueberstimmt.
   Ohne diese Zeile stand die Rasterzellen-Auswahl dauerhaft auf der Seite. */
.calc-row[hidden] { display: none; }
.calc-kostra-zellen-row .form-select { min-width: 260px; }

/* Fixes 2026-09-25 (Funktionspruefung Online-Berechnung) ------------------
   Ehrliche Fehlermeldung, wenn die Berechnung NICHT gespeichert werden konnte
   (vorher stand dann trotzdem "Gespeichert" da) - rot, direkt ueber dem Formular. */
.calc-speicher-fehler { color: #842029; background: #f8d7da; border: 1px solid #f5c2c7;
    border-radius: 4px; padding: 10px 14px; margin: 0 0 12px; font-size: 0.95rem; }
.calc-speicher-fehler p { margin: 0 0 4px; }
.calc-speicher-fehler p:last-child { margin-bottom: 0; }
.calc-speicher-fehler-titel { font-weight: 600; }
/* Inline-Meldung statt alert() an den +/- Knoepfen einer Teilflaeche */
.calc-flaeche-meldung { margin: 6px 0 10px; }
/* Plausibilitaetsmeldung unter den Regenspenden-Feldern (live) */
.calc-plausi-regen { margin: 4px 0 10px; }
/* "(Retention)" an den Ergebnisboxen wird live ein-/ausgeblendet */
.calc-retention-zusatz[hidden] { display: none; }
/* Neutraler Retention-Hinweis an der Hauptentwaesserung (Betreiber-Vorgabe
   2026-09-28, OB-B6): Info statt Warnung, bewusst ohne Link.
   Wird live per hidden ein-/ausgeblendet - [hidden] muss die Klassenregel schlagen. */
.calc-retention-hinweis.calc-retention-info {
    color: #1f3b53;
    background: #eef5fb;
    border-color: #b9d3ea;
}
.calc-retention-hinweis[hidden] { display: none; }
/* Chooser: mit welchem System OHNE Auswahl gerechnet wird (Betreiber 2026-09-28, OB-B2) */
.calc-lx-chooser-hinweis { font-size: 0.8rem; color: #555; margin: 2px 0 4px; }
