:root {
    /* DARK MODE DEFAULT */
    --bg-body: #0d1117;
    --bg-card: #161b22;
    --bg-input: #0d1117;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;
    --accent: #238636;
    --accent-hover: #2ea043;
    --highlight: #1f6feb;
    --danger: #da3633;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.5);
    
    --wled-orange: #ff9800;
    --wled-blue: #2196f3;
}

* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0; padding: 20px;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background 0.3s, color 0.3s;
}

.app-container { max-width: 1100px; margin: 0 auto; }

/* HEADER */
header { margin-bottom: 25px; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
h1 { margin: 0; font-size: 1.8rem; background: linear-gradient(90deg, var(--wled-orange), var(--wled-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* LAYOUT */
.content-wrapper { display: flex; flex-wrap: wrap; gap: 20px; }
.input-section { flex: 1; min-width: 300px; }
.results-section { flex: 1; min-width: 300px; opacity: 0.5; pointer-events: none; transition: opacity 0.3s; }
.results-section.visible { opacity: 1; pointer-events: auto; }

/* CARDS */
.card { background: var(--bg-card); padding: 20px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--card-shadow); margin-bottom: 20px; }

/* FORMS */
.form-group { margin-bottom: 15px; position: relative; }
label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 0.9rem; color: var(--text-muted); display:flex; align-items:center; gap:6px; }
.form-control, .search-box {
    width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-input); color: var(--text-main); font-size: 1rem; transition: border 0.2s;
}
.form-control:focus { outline: none; border-color: var(--highlight); }

/* BUTTONS */
.btn-group { display: flex; gap: 10px; margin-top: 20px; }

/* Hier das Update einfügen: */
button { 
    cursor: pointer; border: none; padding: 12px 20px; border-radius: 6px; 
    font-size: 1rem; font-weight: 600; 
    transition: transform 0.1s, opacity 0.2s;
    /* WICHTIG FÜR ICONS: */
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
button:active { transform: scale(0.98); }
.btn-primary { background: var(--highlight); color: #fff; flex: 2; }
.btn-secondary { background: var(--border); color: var(--text-main); flex: 1; }

/* PROJECT MANAGER */
.project-manager { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 15px; margin-bottom: 20px; }
.project-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.section-label { font-size:0.9rem; font-weight:bold; color:var(--text-muted); display:flex; align-items:center; gap:6px; }
.project-controls { display:flex; gap:8px; margin-bottom:10px; }
.project-input { flex:1; padding:8px; border-radius:4px; border:1px solid var(--border); background:var(--bg-input); color:var(--text-main); }
.btn-icon { 
    background: var(--highlight); color: #fff; 
    padding: 0; /* Reset Padding */
    width: 42px; /* Feste Breite für Quadrat */
    height: 38px; /* Höhe an Input anpassen */
    border-radius: 4px; 
    font-size: 1.2rem; /* Icon Größe */
}
.project-list { max-height:150px; overflow-y:auto; border-top:1px solid var(--border); padding-top:5px; }
.project-item { display:flex; justify-content:space-between; align-items:center; padding:6px 0; font-size:0.9rem; border-bottom:1px solid rgba(255,255,255,0.05); }
.project-name { cursor:pointer; flex:1; display:flex; align-items:center; gap:8px; }
.project-name:hover { color:var(--highlight); }
.project-actions { display:flex; gap:5px; }
.btn-icon-small { 
    padding: 6px; 
    font-size: 1.1rem; 
    background: transparent; 
    color: var(--text-muted); 
    width: 32px; height: 32px;
}
.btn-icon-small:hover { color:var(--text-main); background:rgba(255,255,255,0.1); }
.btn-delete:hover { color:var(--danger); }

.adv-content {
    /* STARTZUSTAND: VERSTECKT */
    display: none;
    
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none; /* Visuelle Verbindung */
    
    /* LAYOUT FIX: */
    margin-top: 0;    /* WICHTIG: Nicht negativ, sonst schneidet es ab! */
    padding: 20px;    /* Genug Abstand innen */
    
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-bottom: 24px;
}

/* Wird per JS (.classList.toggle('visible')) aktiviert */
.adv-content.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.adv-content.visible { display:block; animation: fadeIn 0.3s; }

/* CHANNELS */
.channels-section { margin-top:20px; padding-top:15px; border-top:1px solid var(--border); }
.section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:15px; font-weight:bold; color:var(--text-muted); font-size:0.9rem; }
.section-header span { display:flex; align-items:center; gap:6px; }
.channel-row { background:rgba(255,255,255,0.03); border:1px solid var(--border); border-radius:8px; padding:10px; margin-bottom:10px; position:relative; }
.channel-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.lbl-strip-index { font-size:0.8rem; font-weight:bold; color:var(--wled-blue); text-transform:uppercase; letter-spacing:1px; }
/* --- LÖSCHEN BUTTON (in den Kanälen) --- */
.btn-remove {
    background: transparent;
    color: var(--danger); /* Rot */
    border: 1px solid var(--border); /* Optional: Rahmen */
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
}

.btn-remove:hover {
    background: rgba(218, 54, 51, 0.15); /* Roter Hintergrund beim Hover */
    border-color: var(--danger);
    transform: scale(1.05);
}
.channel-inputs { display:flex; gap:10px; }
.channel-inputs > div { flex:1; }
.mode-switch { display:flex; background:var(--bg-input); border-radius:4px; padding:2px; }
.mode-switch input { display:none; }
.mode-btn { padding:4px 10px; font-size:0.75rem; cursor:pointer; border-radius:3px; color:var(--text-muted); }
.mode-switch input:checked + .mode-btn { background:var(--highlight); color:white; }

/* RESULTS GRID */
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.res-card { background: rgba(255,255,255,0.03); padding: 15px; border-radius: 8px; text-align: center; border: 1px solid var(--border); }
.res-icon { font-size: 1.5rem; margin-bottom: 5px; color: var(--highlight); }
.res-val { font-size: 1.2rem; font-weight: bold; }
.res-lbl { font-size: 0.8rem; color: var(--text-muted); }
.amp-green { border-color: var(--accent); color: var(--accent); } 
.amp-green .res-icon { color: var(--accent); }
.amp-yellow { border-color: #ffb74d; color: #ffb74d; }
.amp-yellow .res-icon { color: #ffb74d; }
.amp-red { border-color: var(--danger); color: var(--danger); }
.amp-red .res-icon { color: var(--danger); }

.info-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.info-line span { display:flex; align-items:center; gap:6px; color:var(--text-muted); }

/* TABS */
.tabs { display:flex; gap:5px; margin-bottom:15px; margin-top:20px; }
.tab-btn { flex:1; padding:10px; background:transparent; border:1px solid var(--border); color:var(--text-muted); font-size:0.9rem; display:flex; justify-content:center; align-items:center; gap:6px; }
.tab-btn.active { background:var(--bg-card); border-bottom-color:var(--highlight); color:var(--highlight); }
.tab-content { min-height:200px; position:relative; overflow:hidden; } /* Für Swipe */
.tab-pane { display:none; animation: fadeIn 0.3s; }
.tab-pane.active { display:block; }

/* SHOPPING LIST */
.shop-card { display: flex; gap: 15px; background: rgba(255,255,255,0.03); padding: 10px; margin-bottom: 10px; border-radius: 8px; border: 1px solid var(--border); align-items: center; }
.shop-img-box { width: 60px; height: 60px; border-radius: 6px; overflow: hidden; background: #000; flex-shrink: 0; display:flex; align-items:center; justify-content:center; }
.shop-img-box img { width: 100%; height: 100%; object-fit: cover; }
.shop-actions { display: flex; gap: 8px; margin-top: 8px; }
.shop-actions a { display: inline-block; padding: 6px 10px; font-size: 0.8rem; background: var(--bg-input); color: var(--text-main); text-decoration: none; border-radius: 4px; border: 1px solid var(--border); transition: 0.2s; display:flex; align-items:center; justify-content:center; gap:5px; }
.shop-actions a:hover { border-color: var(--highlight); color: var(--highlight); }

/* TIPS LIST */
.tips-list { list-style: none; padding: 0; margin: 0; }
.tip-item { display: flex; gap: 12px; padding: 12px; margin-bottom: 8px; border-radius: 8px; font-size: 0.9rem; align-items: flex-start; }
.tip-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: -2px; }
.tip-info { background: rgba(33, 150, 243, 0.1); border-left: 3px solid #2196f3; } .tip-info .tip-icon { color: #2196f3; }
.tip-warning { background: rgba(255, 152, 0, 0.1); border-left: 3px solid #ff9800; } .tip-warning .tip-icon { color: #ff9800; }
.tip-danger { background: rgba(244, 67, 54, 0.1); border-left: 3px solid #f44336; } .tip-danger .tip-icon { color: #f44336; }
.tip-success { background: rgba(76, 175, 80, 0.1); border-left: 3px solid #4caf50; } .tip-success .tip-icon { color: #4caf50; }
.section-title { margin-top: 20px; margin-bottom: 10px; font-size: 1rem; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 5px; display:flex; align-items:center; gap:8px; }

/* --- SHARE BOX STYLING --- */
.share-box {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px dashed var(--border); /* Dashed Border für "temporären" Look */
    border-radius: 8px;
    text-align: center;
}

.share-title {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.share-title i {
    color: var(--highlight);
    font-size: 1.2rem;
}

/* Die Input-Group (Feld + Button nebeneinander) */
.share-input-group {
    display: flex;
    max-width: 400px; /* Nicht zu breit werden lassen */
    margin: 0 auto;   /* Zentrieren */
    position: relative;
}

.share-input-group input {
    flex: 1; /* Nimmt den meisten Platz */
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-right: none; /* Keine Kante zum Button hin */
    border-radius: 6px 0 0 6px; /* Nur links runden */
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: monospace; /* Sieht mehr nach Code/Link aus */
    outline: none;
    transition: color 0.2s, background 0.2s;
}

.share-input-group input:focus {
    color: var(--text-main);
    background: rgba(255,255,255,0.02);
}

.share-input-group button {
    background: var(--highlight);
    color: white;
    border: 1px solid var(--highlight);
    border-radius: 0 6px 6px 0; /* Nur rechts runden */
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    width: auto; /* Breite anpassen */
    margin: 0; /* Reset Margin */
}

.share-input-group button:hover {
    background: var(--accent-hover); /* Etwas heller beim Hover */
    border-color: var(--accent-hover);
}

.share-input-group button:active {
    transform: none; /* Kein Wackeln hier */
    background: var(--accent);
}

/* TOOLTIP */
.help-tip {
    display: inline-block; width: 16px; height: 16px; background: var(--text-muted); color: var(--bg-body); border-radius: 50%;
    text-align: center; font-size: 11px; line-height: 16px; cursor: help; margin-left: 5px; position: relative;
}
.help-tip:hover::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: 25px; transform: translateX(-50%);
    background: #333; color: #fff; padding: 8px; border-radius: 6px; font-size: 0.8rem; width: 200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); z-index: 100; pointer-events: none;
}

/* DIY COMPARISON */
details.solder-details { background: rgba(0,0,0,0.2); padding: 10px; border-radius: 6px; margin-top: 5px; }
summary { cursor: pointer; font-weight: bold; color: var(--highlight); }
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 10px; }
.comp-col h4 { margin: 0 0 5px 0; font-size: 0.9rem; color: var(--text-main); display:flex; align-items:center; gap:6px; }
.comp-item { font-size: 0.8rem; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-muted); }

/* ANIMATION */
@keyframes fadeIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }

@media (max-width: 768px) {
    .content-wrapper { flex-direction: column; }
    .comp-grid { grid-template-columns: 1fr; }
}

/* --- SPACING FIXES --- */

/* 1. Einheitliche Abstände zwischen den Hauptblöcken herstellen */
.project-manager,
.card {
    margin-bottom: 24px; /* Etwas mehr Luft für saubere Trennung */
}

/* --- FIX: Stromkosten Inhalt als eigenständige Box --- */
.adv-content {
    /* STARTZUSTAND: VERSTECKT */
    display: none;
    
    background: var(--bg-card);
    border: 1px solid var(--border); /* Rahmen überall (auch oben) */
    
    /* ABGERUNDETE ECKEN ÜBERALL */
    border-radius: 8px; 
    
    padding: 20px;
    margin-bottom: 24px;
    
    /* Kleiner Abstand zum Button darüber, damit es nicht klebt */
    margin-top: 10px; 
    
    position: relative;
    z-index: 1;
}

/* Wird per JS sichtbar geschaltet */
.adv-content.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* --- CUSTOM CHECKBOXES --- */

/* Standard-Checkbox verstecken und stylen */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--bg-input);
    margin: 0;
    color: currentColor;
    
    /* GRÖSSE ERZWINGEN (mit !important gegen Inline-Styles) */
    width: 22px !important; 
    height: 22px !important;
    min-width: 22px !important;
    flex-shrink: 0; 
    
    border: 1px solid var(--border);
    border-radius: 4px;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

/* Hover Effekt */
input[type="checkbox"]:hover {
    border-color: var(--text-muted);
}

/* Checked Status */
input[type="checkbox"]::before {
    content: "";
    width: 12px;
    height: 12px;
    box-shadow: inset 1em 1em white;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transition: 0.2s transform ease-in-out;
}

input[type="checkbox"]:checked {
    background-color: var(--highlight);
    border-color: var(--highlight);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Label-Ausrichtung verbessern */
.form-group label,
.project-controls label {
    display: flex;
    align-items: center;
    gap: 12px; /* Abstand Text zu Box */
    cursor: pointer;
    line-height: 1.4;
}

#costSettings .project-manager {
    margin-bottom: 0; /* Entfernt den unteren Abstand nur hier */
}

/* --- PROJEKT MANAGER TOGGLE --- */

/* --- UNIVERSAL TOGGLE STYLES (Projekte & Stromkosten) --- */

/* Gemeinsame Klasse für beide Toggle-Buttons */
.project-toggle,
.adv-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: var(--text-muted);
    transition: background 0.2s, margin-bottom 0.2s; /* Auch Margin animieren */
    user-select: none;
    
    /* WICHTIG: Standard-Abstand nach unten (wenn ZU) */
    margin-bottom: 20px;
}

.project-toggle:hover,
.adv-toggle:hover {
    background: rgba(255,255,255,0.05);
}

/* Icons und Text ausrichten */
.project-toggle span:first-child,
.adv-toggle span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* WICHTIG: Wenn OFFEN (.active), muss der Abstand weg! */
.project-toggle.active,
.adv-toggle.active {
    margin-bottom: 0;
    color: var(--text-main); /* Text wird heller wenn aktiv */
    border-color: var(--highlight); /* Optional: Blauer Rand wenn aktiv */
}

/* Icon Rotation */
.toggle-icon {
    transition: transform 0.3s ease;
}
.project-toggle.active .toggle-icon,
.adv-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

/* --- CONTENT BOXEN --- */
.project-content,
.adv-content {
    /* Start: Versteckt */
    display: none;
    
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    
    /* Abstand zum nächsten Element */
    margin-bottom: 24px;
    
    /* Abstand zum Button darüber */
    margin-top: 10px;
    
    position: relative;
    z-index: 1;
}

/* Sichtbar schalten */
.project-content.visible,
.adv-content.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Fix für Zentrierung in der Projekt-Box */
#costSettings .project-manager,
#projectBox .project-controls {
    margin-bottom: 0;
}

@media print {
    /* --- GRUNDLAGEN --- */
    body { 
        background-color: white !important; 
        color: black !important; 
        font-family: sans-serif;
    }
    
    /* Alles verstecken, was wir nicht brauchen */
    header, 
    .input-section, 
    .project-toggle,
    .adv-toggle, 
    .share-box, 
    .tab-header, /* Die Tab-Buttons oben weg */
    #installBtn,
    .btn-icon,
    button { 
        display: none !important; 
    }

    /* --- LAYOUT FIXES --- */
    .app-container, 
    .content-wrapper, 
    .results-section { 
        width: 100% !important; 
        margin: 0 !important; 
        padding: 0 !important; 
        box-shadow: none !important;
        max-width: none !important;
    }

    /* Container für Ergebnisse entsperren */
    .card {
        border: none !important;
        background: white !important;
        margin-bottom: 0 !important;
    }

    /* --- TABS: ALLE ANZEIGEN --- */
    /* Der Trick: Wir ignorieren .active und zeigen einfach alle .tab-pane an */
    .tab-pane {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        height: auto !important;
        margin-bottom: 40px; /* Schön Abstand zwischen den Sektionen */
        page-break-inside: avoid; /* Versuchen, Blöcke nicht zu zerreißen */
        border-bottom: 2px solid #ddd; /* Trennlinie zwischen den Themen */
        padding-bottom: 20px;
    }

    /* Überschriften für die Tabs simulieren (da wir die Buttons ausgeblendet haben) */
    #tab-hw::before { content: "1. Hardware & Verkabelung"; display: block; font-size: 1.5rem; font-weight: bold; margin-bottom: 15px; border-bottom: 2px solid black; }
    #tab-shop::before { content: "2. Einkaufsliste"; display: block; font-size: 1.5rem; font-weight: bold; margin-bottom: 15px; border-bottom: 2px solid black; margin-top: 20px; }
    #tab-tips::before { content: "3. Tipps & Tricks"; display: block; font-size: 1.5rem; font-weight: bold; margin-bottom: 15px; border-bottom: 2px solid black; margin-top: 20px; }

    /* --- SCHALTPLAN (SVG) OPTIMIEREN --- */
    /* Hintergrund Weiß, Linien Schwarz */
    svg {
        background-color: #ffffff !important;
        border: 1px solid #000 !important;
    }
    
    /* Alle Texte im SVG schwarz */
    svg .txt, svg .pin, svg .pin-r {
        fill: #000000 !important;
    }
    
    /* Bauteile (ESP32, PSU) weiß mit schwarzem Rand */
    svg .comp, svg .buck, svg rect[fill="#333"] {
        fill: #ffffff !important;
        stroke: #000000 !important;
        stroke-width: 2px !important;
    }
    
    /* Kabel dicker für besseren Druck */
    svg .wire {
        stroke-width: 2px !important;
    }
    /* GND Kabel (meist grau) etwas dunkler machen für Kontrast */
    svg .wire[stroke="#cccccc"] {
        stroke: #999999 !important;
    }
    
    /* --- EINKAUFSLISTE --- */
    .shop-card {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
        page-break-inside: avoid;
    }
    .shop-actions { display: none !important; } /* Shop Links brauchen wir gedruckt nicht */
    
    /* --- TIPPS --- */
    .tip-item {
        background: white !important;
        border: 1px solid #000 !important;
        color: black !important;
    }
    .tip-icon { color: black !important; }

    /* Pfeil vom Summary verstecken (sieht gedruckt doof aus) */
    details > summary {
        list-style: none !important;
    }
    details > summary::-webkit-details-marker {
        display: none !important;
    }

    /* Vergleichs-Grid (Löten & DIY) für Papier optimieren */
    .comp-grid {
        display: flex !important;
        border: 1px solid #000 !important;
        background: transparent !important;
        color: #000 !important;
        page-break-inside: avoid;
    }

    .comp-col {
        flex: 1;
        border-right: 1px solid #000;
        padding: 10px;
    }
    .comp-col:last-child {
        border-right: none;
    }

    /* Überschriften in den Tabellen */
    .comp-col h4 {
        color: #000 !important;
        border-bottom: 1px solid #000;
        padding-bottom: 5px;
        margin-bottom: 5px;
    }

    /* Die einzelnen Punkte */
    .comp-item {
        color: #000 !important;
        border-bottom: 1px dotted #ccc;
    }
    
    /* Icons im Druck schwarz machen */
    i, .ph-bold {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }
}

/* --- QR CODE BUTTON (Mitte) --- */
.share-input-group .btn-middle {
    border-radius: 0; /* Keine Ecken, da in der Mitte */
    border-left: 1px solid rgba(255,255,255,0.2); /* Trennlinie links */
    border-right: 1px solid rgba(255,255,255,0.2); /* Trennlinie rechts */
    background: var(--highlight);
    color: white;
    padding: 0 15px;
    width: auto;
}
.share-input-group .btn-middle:hover {
    background: var(--accent-hover);
}

/* --- QR CODE MODAL (Popup) --- */
.qr-modal {
    display: none; /* Start: Versteckt */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); /* Abdunkeln */
    backdrop-filter: blur(5px);   /* Weichzeichner */
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.qr-modal.active {
    display: flex; /* Flexbox zum Zentrieren */
}

.qr-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    width: 300px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.2s;
}

.qr-modal.active .qr-content {
    transform: scale(1);
}

.qr-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; font-weight: bold; font-size: 1.1rem; color: var(--text-main);
}

.btn-close {
    background: transparent; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; padding: 5px;
}
.btn-close:hover { color: var(--danger); }

.qr-body img {
    width: 200px; height: 200px;
    border-radius: 8px;
    /* WICHTIG: Weißer Hintergrund für Scanbarkeit! */
    background: white; 
    padding: 10px;
    display: block; margin: 0 auto;
}

.qr-footer {
    margin-top: 15px; font-size: 0.9rem; color: var(--text-muted);
}

/* Power Switch (Gleicher Look wie der andere Toggle) */
.pwr-switch {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
}
.pwr-switch input { display: none; }
.pwr-switch label {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
    margin: 0 !important; /* Reset margin from other labels */
}
.pwr-switch input:checked + label {
    background: var(--highlight);
    color: white;
    font-weight: 600;
}

#dataTips {
    padding-left: 0px;
}

#matrixInputContainer {
    margin-top: 24px;
}
