/* Grundlegendes Seitenlayout: Serifenlose Schrift, heller Hintergrund */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background: #f5f5f5;
}
/* Kopfzeile mit Logos, Titel, Sprachumschalter und Burger-Menü (Flexbox) */
.top-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    justify-content: flex-start;
    position: sticky;
    top: 0;
    z-index: 200;
}
/* Thermokon-Logo links, feste Höhe ohne Flex-Wachstum */
.logo {
    height: 50px;
    flex: 0 0 auto;
}
/* LoRaWAN-Logo rechts neben dem Titel */
.logo-right {
    height: 50px;
    flex: 0 0 auto;
}
h1 {
    margin: 0;
    flex: 0 0 auto;
}
/* Hauptcontainer für die Parametertabellen mit abgerundeten Ecken */
.container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 1200px;
}
/* Spaltenüberschriften-Zeile (Parameter, Hex, Modbus, Protokolladresse, Wert, Bereich) */
.header {
    display: flex;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 2px solid #ccc;
    padding-bottom: 5px;
    gap: 10px;
}
.header-param {
    flex: 1;
    min-width: 200px;
}
.header-hex {
    width: 100px;
    text-align: center;
}
.header-modbus {
    width: 140px;
    text-align: center;
}
.header-protaddr {
    width: 150px;
    text-align: center;
}
.header-value {
    width: 120px;
    text-align: center;
}
.header-range {
    width: 90px;
    text-align: center;
}
/* Einzelne Parameterzeile als Flex-Row mit vertikaler Zentrierung */
.row {
    display: flex;
    margin-bottom: 8px;
    align-items: center;
    gap: 10px;
}
/* Parametername-Spalte, nimmt den verfügbaren Platz ein (flex: 1) */
.topic {
    flex: 1;
    min-width: 200px;
}
/* Hex-Identifier-Spalte: Monospace, blau, zentriert (z.B. 0x0003) */
.hex-col {
    width: 100px;
    text-align: center;
    font-family: monospace;
    font-weight: bold;
    color: #007bff;
}
/* Modbus-Register-Spalte: Monospace, grün, zentriert (z.B. [2]) */
.modbus-col {
    width: 140px;
    text-align: center;
    font-family: monospace;
    font-weight: bold;
    color: #28a745;
}
/* Modbus-Protokolladresse-Spalte: Monospace, orange, zentriert */
.protaddr-col {
    width: 150px;
    text-align: center;
    font-family: monospace;
    font-weight: bold;
    color: #e67e22;
}
.input {
    width: 120px;
}
/* Wertebereich-Spalte: zeigt gültigen Min...Max-Bereich in Grau */
.range-col {
    width: 90px;
    text-align: center;
    font-family: monospace;
    font-size: 13px;
    color: #888;
}
input {
    width: 100%;
    padding: 5px;
}
/* Sticky-Ausgabebereich: bleibt beim Scrollen oben sichtbar */
.sticky-output {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f5f5f5;
    padding: 12px 0 8px 0;
    margin-bottom: 10px;
}
/* Generierter Hex-Downlink-String mit rotem Akzent-Rand links */
#output {
    margin-top: 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #d32f2f;
    color: #333;
    font-family: monospace;
    word-break: break-all;
    max-width: 1200px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.6;
}
/* Ein Parameter-Paar im Downlink-Output (Hex-ID + Wert) */
.dl-pair {
    display: inline;
    margin-right: 0;
}
/* Vertikaler Trennstrich zwischen aufeinanderfolgenden Paaren (IBAN-Stil) */
.dl-pair + .dl-pair {
    border-left: 2px solid #ccc;
    padding-left: 8px;
    margin-left: 6px;
}
/* Hex-Identifier im Output: blau, fett, mit gepunkteter Trennung zum Wert */
.dl-id {
    color: #007bff;
    font-weight: bold;
    border-right: 1px dotted #bbb;
    padding-right: 3px;
    margin-right: 2px;
}
/* Hex-Wert im Output: schwarz, folgt direkt auf den Identifier */
.dl-val {
    color: #000;
}
button {
    margin-top: 10px;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: Arial, sans-serif;
    border: none;
    box-sizing: border-box;
    line-height: 1.4;
    vertical-align: middle;
    transition: all 0.2s ease;
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.action-btn-copy {
    background: white;
    border: 2px solid #333;
    color: #333;
}
.action-btn-copy:hover {
    background: #333;
    color: white;
}
.action-btn-clear {
    background: #d32f2f;
    color: white;
}
.action-btn-clear:hover {
    background: #b71c1c;
}
/* Home-Button: immer oben links, vor dem Logo */
.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: white;
    border: 2px solid #d32f2f;
    border-radius: 8px;
    text-decoration: none;
    font-size: 20px;
    flex: 0 0 auto;
    transition: all 0.3s ease;
    color: #d32f2f;
}
.home-btn:hover {
    background: #d32f2f;
    color: white;
}
.home-btn.disabled {
    border-color: #ddd;
    color: #bbb;
    pointer-events: none;
    cursor: default;
}
/* Sprachumschalter: wird per margin-left:auto ans rechte Ende der Top-Bar geschoben */
.language-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.language-toggle button {
    background: white;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 24px;
    margin-top: 0;
    transition: all 0.3s ease;
    display: flex;
    gap: 8px;
    align-items: center;
}
.language-toggle button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}
/* Flaggen-Icons (DE/EN): inaktiv = halbtransparent, aktiv = volle Deckkraft mit Glow */
.flag {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
.flag.active {
    opacity: 1;
    filter: drop-shadow(0 0 3px rgba(0, 123, 255, 0.6));
}
/* Originale Tab-Leiste: versteckt, aber im DOM für ID-Kompatibilität behalten */
.page-tabs {
    display: none;
}
/* Hamburger-Menü Container: position:relative für absolutes Dropdown */
.burger-menu {
    position: relative;
    flex: 0 0 auto;
}
/* Hamburger-Button: 3 animierte Striche, wird zum X-Icon wenn .open */
.burger-btn {
    background: none;
    border: 2px solid #d32f2f;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}
.burger-btn:hover {
    background: #d32f2f;
}
.burger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #d32f2f;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.burger-btn:hover span {
    background: white;
}
/* Animation: 3 Striche transformieren sich zu einem X-Symbol beim Öffnen */
.burger-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.burger-btn.open span:nth-child(2) {
    opacity: 0;
}
.burger-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}
/* Dropdown-Menü: absolut positioniert unter dem Burger-Button */
.burger-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    left: 0;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 200;
    min-width: 220px;
    overflow: hidden;
}
.burger-dropdown.open {
    display: block;
}
.burger-dropdown .menu-item {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
}
.burger-dropdown .menu-item:last-child {
    border-bottom: none;
}
.burger-dropdown .menu-item:hover {
    background: #f5f5f5;
    color: #d32f2f;
}
.burger-dropdown .menu-item.active {
    color: #d32f2f;
    background: #fef0f0;
}
.page-tab {
    padding: 10px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}
.page-tab:hover {
    border-color: #007bff;
    color: #007bff;
}
.page-tab.active {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}
/* Seitenwechsel: nur die aktive Seite (Generator oder Info) wird angezeigt */
.page {
    display: none;
}
.page.active {
    display: block;
}
/* Produktinformations-Seite: weißer Container mit max. 900px Breite */
.info-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 900px;
}
/* 2-Spalten-Grid für Info-Seite: Bild links, Text rechts */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}
.info-image {
    text-align: center;
}
.info-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.info-text h2 {
    color: #d32f2f;
    margin-bottom: 15px;
}
.info-text p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}
.info-features {
    list-style: none;
    padding: 0;
}
.info-features li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    color: #555;
}
.info-features li:before {
    content: "✓ ";
    color: #d32f2f;
    font-weight: bold;
    margin-right: 8px;
}
/* Abschnittsüberschrift (z.B. "Laufzeit-Parameter"): roter Rand oben, Flex für Info-Button */
.section-title {
    margin-top: 50px !important;
    margin-bottom: 8px !important;
    padding: 10px 0;
    border-top: 3px solid #d32f2f;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 700;
    font-size: 18px;
    color: #d32f2f;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Runder Info-Button (SVG "i"-Icon) neben den Abschnittsüberschriften */
.section-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #007bff;
    background: #e8f0fe;
    color: #007bff;
    cursor: help;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.section-info-btn svg {
    fill: #007bff;
    transition: fill 0.2s ease;
}
.section-info-btn:hover {
    background: #007bff;
}
.section-info-btn:hover svg {
    fill: white;
}
.header-info {
    width: 30px;
    text-align: center;
}
/* Beschreibungsspalte pro Zeile: zeigt abgekürzten Info-Text mit Fade-Out */
.info-icon {
    width: 180px;
    text-align: left;
    flex-shrink: 0;
    margin-left: 5px;
}
/* Inline-Infotext: kursiv, halbtransparent, mit CSS-Maskierung zum Ausblenden am Rand */
.info-text-inline {
    font-style: italic;
    opacity: 0.45;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    cursor: help;
    display: block;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 90%);
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 90%);
    transition: opacity 0.2s ease;
}
.info-text-inline:hover {
    opacity: 0.7;
}
.info-icon button {
    background: #e8f0fe;
    border: 2px solid #007bff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 14px;
    color: #007bff;
    font-weight: 700;
    font-style: italic;
    font-family: 'Times New Roman', Georgia, serif;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-shadow: 0 0 1px #007bff;
}
.info-icon button:hover {
    background: #007bff;
    color: white;
}
/* Globaler Tooltip: folgt dem Mauszeiger, zeigt vollständigen Beschreibungstext */
.info-tooltip {
    display: none;
    position: fixed;
    z-index: 1000;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    white-space: normal;
    max-width: 360px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    pointer-events: none;
}
.info-tooltip.visible {
    display: block;
}
/* Download-Button pro Zeile: grüner Kreis mit Pfeil, öffnet PDF-Handbuch */
.download-icon {
    width: 30px;
    text-align: center;
    flex-shrink: 0;
    margin-left: 4px;
}
.download-icon button {
    background: none;
    border: 1.5px solid #28a745;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 13px;
    color: #28a745;
    font-weight: bold;
    font-family: Arial, sans-serif;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.download-icon button:hover {
    background: #28a745;
    color: white;
}

/* ==== DASHBOARD-SPEZIFISCHE STYLES ==== */
.dashboard-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-title {
    color: #d32f2f;
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.dashboard-subtitle {
    color: #666;
    font-size: 16px;
    text-align: center;
    margin-bottom: 30px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.tool-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    border-color: #d32f2f;
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.15);
    transform: translateY(-3px);
}

.tool-card--coming-soon {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.tool-card--coming-soon::after {
    content: 'Demnächst';
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    color: #aaa;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tool-icon {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

.tool-title {
    font-size: 18px;
    font-weight: 600;
    color: #d32f2f;
    margin-bottom: 10px;
}

.tool-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.tool-link {
    display: inline-block;
    background: #d32f2f;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.tool-link:hover {
    background: #b71c1c;
}

/* ==== RESPONSIVE: Tablet & Smartphone (≤768px) ==== */
@media (max-width: 768px) {
    body {
        margin: 8px;
    }
    .top-bar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 12px;
    }
    .top-bar h1 {
        font-size: 16px;
        order: 2;
        width: 100%;
        text-align: center;
    }
    .logo, .logo-right {
        height: 32px;
    }
    .language-toggle {
        order: 3;
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    .language-toggle button {
        font-size: 18px;
        padding: 6px 12px;
    }
    /* Burger-Dropdown auf Mobile: nach rechts öffnen statt nach links */
    .burger-dropdown {
        min-width: 180px;
        right: auto;
        left: 0;
    }
    .sticky-output {
        padding: 8px 0 6px 0;
    }
    .sticky-output h3 {
        font-size: 14px;
    }
    .sticky-output button {
        font-size: 12px;
        padding: 8px;
    }
    #output {
        font-size: 12px;
        padding: 10px;
    }
    .container {
        padding: 10px;
    }
    .section-title {
        font-size: 15px;
        margin-top: 30px !important;
    }

    /* Hide table header on mobile */
    .header {
        display: none;
    }

    /* Card layout for rows */
    .row {
        flex-wrap: wrap;
        background: #fafafa;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 10px;
        gap: 4px 8px;
    }
    .topic {
        min-width: unset;
        width: 100%;
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 2px;
    }
    .info-icon {
        width: 100%;
        margin-left: 0;
    }
    .info-text-inline {
        max-width: 100%;
        -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 95%);
        mask-image: linear-gradient(to right, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 95%);
    }
    .hex-col, .modbus-col, .protaddr-col {
        width: auto;
        text-align: left;
        font-size: 12px;
    }
    .hex-col::before {
        content: 'Hex: ';
        font-weight: normal;
        color: #888;
        font-family: Arial, sans-serif;
    }
    .modbus-col::before {
        content: 'Register: ';
        font-weight: normal;
        color: #888;
        font-family: Arial, sans-serif;
    }
    .protaddr-col::before {
        content: 'Prot.Addr: ';
        font-weight: normal;
        color: #888;
        font-family: Arial, sans-serif;
    }
    .range-col {
        width: auto;
        text-align: left;
        font-size: 12px;
    }
    .range-col::before {
        content: '⟹ ';
        color: #888;
    }
    .input {
        width: 100%;
    }
    .input input {
        font-size: 16px;
        padding: 8px;
    }
    .download-icon {
        margin-left: auto;
    }

    /* Info page responsive */
    .info-content {
        padding: 15px;
    }
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .info-text h2 {
        font-size: 18px;
    }
    .info-text p {
        font-size: 14px;
    }

    /* Dashboard responsive */
    .dashboard-container {
        padding: 15px;
    }
    .dashboard-title {
        font-size: 22px;
    }
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==== RESPONSIVE: Extra kleine Bildschirme (≤480px) ==== */
@media (max-width: 480px) {
    .top-bar h1 {
        font-size: 14px;
    }
    .logo, .logo-right {
        height: 26px;
    }
    .dl-pair + .dl-pair {
        padding-left: 5px;
        margin-left: 4px;
    }
}

/* ==== DOWNLINK-HISTORIE ==== */
.history-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.history-bar select {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 2px solid #007bff;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    background: white;
    cursor: pointer;
}
.history-bar select:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}
.history-bar button {
    margin-top: 0;
}
.btn-save-history {
    background: #28a745;
    color: white;
}
.btn-save-history:hover {
    background: #218838;
}
.btn-save-history:disabled {
    background: #aaa;
    cursor: not-allowed;
}
.btn-export-history {
    background: #007bff;
    color: white;
}
.btn-export-history:hover {
    background: #0056b3;
}
.btn-export-history:disabled {
    background: #aaa;
    cursor: not-allowed;
}
.btn-delete-history {
    background: #d32f2f;
    color: white;
}
.btn-delete-history:hover {
    background: #b71c1c;
}
.btn-delete-history:disabled {
    background: #aaa;
    cursor: not-allowed;
}
@media (max-width: 768px) {
    .history-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .history-bar select {
        min-width: unset;
    }
    .history-bar button {
        width: 100%;
    }
}

/* ==== GEMINI KI-ASSISTENT ==== */
.gemini-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.gemini-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
    min-height: 500px;
    position: relative;
}

/* Chatverlauf-Fläche */
.gemini-response-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
    padding-right: 4px;
}

/* Willkommensbereich */
.gemini-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #999;
    gap: 12px;
    text-align: center;
    padding: 40px 20px;
}
.gemini-welcome-icon {
    font-size: 64px;
    line-height: 1;
}
.gemini-welcome p {
    font-size: 15px;
    line-height: 1.6;
    max-width: 480px;
    margin: 0;
}
.gemini-hint {
    font-size: 13px;
    color: #bbb;
}
.gemini-hint kbd {
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1px 5px;
    font-family: monospace;
    font-size: 12px;
    color: #555;
}

/* Chat-Blasen */
.gemini-bubble {
    padding: 12px 16px;
    border-radius: 10px;
    max-width: 85%;
    line-height: 1.6;
    word-break: break-word;
}
.gemini-bubble--user {
    align-self: flex-end;
    background: #d32f2f;
    color: white;
    border-bottom-right-radius: 3px;
    white-space: pre-wrap;
}
.gemini-bubble--ai {
    align-self: flex-start;
    background: #f5f5f5;
    color: #333;
    border-bottom-left-radius: 3px;
    border-left: 3px solid #d32f2f;
}

/* Markdown-Styling innerhalb der KI-Antwort */
.gemini-bubble--ai p         { margin: 0 0 8px 0; }
.gemini-bubble--ai p:last-child { margin-bottom: 0; }
.gemini-bubble--ai ul,
.gemini-bubble--ai ol        { padding-left: 20px; margin: 8px 0; }
.gemini-bubble--ai h1,
.gemini-bubble--ai h2,
.gemini-bubble--ai h3        { color: #d32f2f; margin: 10px 0 5px 0; }
.gemini-bubble--ai code {
    background: #e0e0e0;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}
.gemini-bubble--ai pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 13px;
    margin: 8px 0;
}
.gemini-bubble--ai pre code {
    background: none;
    padding: 0;
}
.gemini-bubble--ai table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}
.gemini-bubble--ai th,
.gemini-bubble--ai td {
    border: 1px solid #ddd;
    padding: 6px 10px;
    text-align: left;
    font-size: 13px;
}
.gemini-bubble--ai th {
    background: #f0f0f0;
    font-weight: 600;
}

/* Eingabe-Zeile */
.gemini-input-area {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    border-top: 2px solid #eee;
    padding-top: 16px;
}
.gemini-textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    line-height: 1.5;
}
.gemini-textarea:focus {
    outline: none;
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}
.gemini-send-btn {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s ease;
    margin-top: 0;
    align-self: flex-end;
}
.gemini-send-btn:hover {
    background: #b71c1c;
}
.gemini-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Lade-Indikator (pulsierendes Thermokon-Logo) */
.gemini-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    padding: 28px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}
.gemini-loading-logo {
    height: 50px;
    animation: geminiPulse 1.2s ease-in-out infinite;
}
.gemini-loading p {
    color: #666;
    font-size: 14px;
    margin: 0;
}
@keyframes geminiPulse {
    0%,  100% { opacity: 1;   transform: scale(1); }
    50%        { opacity: 0.3; transform: scale(0.88); }
}

/* Fehlermeldung */
.gemini-error {
    color: #d32f2f;
    font-style: italic;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .gemini-container {
        height: calc(100vh - 130px);
        padding: 12px;
    }
    .gemini-bubble {
        max-width: 95%;
    }
    .gemini-send-btn {
        padding: 12px 14px;
        font-size: 13px;
    }
}
