/* Design System Variables */
:root {
    --bg-app: #080b11;
    --bg-card: rgba(22, 27, 38, 0.7);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-card-active: rgba(0, 240, 255, 0.3);
    
    --text-primary: #ffffff; /* pure white for maximum contrast */
    --text-secondary: #ffffff; /* pure white for maximum contrast */
    --text-muted: #b8c6d9; /* bright grey-blue for units and grid labels */

    /* Colors */
    --color-cyan: #00f0ff;
    --color-emerald: #00ff88;
    --color-yellow: #ffd000;
    --color-orange: #ff7700;
    --color-red: #ff0055;
    
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    
    --header-height: 60px;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow: hidden;
    line-height: 1.4;
}

body {
    background: radial-gradient(circle at 50% 0%, #182236 0%, #080b11 80%);
}

.app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    padding: 10px;
    gap: 10px;
    position: relative;
}

/* Header bar */
.app-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px var(--color-cyan));
}

.logo-text h1 {
    font-size: 18px; /* larger */
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.logo-text .sub-text {
    font-size: 10px; /* larger */
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--color-cyan);
}

.status-indicators {
    display: flex;
    gap: 15px;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px; /* larger */
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.ind-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.ind-val {
    color: var(--text-primary);
    font-weight: 700;
    font-family: var(--font-mono);
}

.ind-val.locked {
    color: var(--color-emerald);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.ind-val.unlocked {
    color: var(--color-red);
    text-shadow: 0 0 6px rgba(255, 0, 85, 0.4);
}

/* Floating Window Workspace Desktop */
.workspace-desktop {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Window Panel / Floating Card */
.window-panel {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.window-panel.dragging {
    box-shadow: 0 20px 50px 0 rgba(0, 0, 0, 0.6);
    border-color: var(--border-card-active);
    z-index: 10;
}

.window-panel.active-focus {
    z-index: 5;
    border-color: rgba(0, 240, 255, 0.15);
}

.panel-header {
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: move;
}

.panel-title {
    font-size: 13px; /* larger */
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-content {
    flex: 1;
    padding: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: se-resize;
    z-index: 12;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.15) 50%);
    border-bottom-right-radius: 12px;
}

.resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, var(--color-cyan) 50%);
}

/* Level Meter Card Layout */
.levels-content {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
}

.meters-container {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    height: 100%;
}

/* Fixed-Width Channel Strip */
.channel-strip {
    width: 28px; /* Fixed width */
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.overload-box {
    width: 100%;
    height: 14px;
    background: #1a030b;
    border: 1px solid #3c0615;
    border-radius: 3px;
    color: #ff0055;
    font-size: 7px;
    font-weight: 700;
    font-family: var(--font-mono);
    text-align: center;
    line-height: 12px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.1s ease;
}

.overload-box.triggered {
    background: var(--color-red);
    color: #ffffff;
    border-color: #ff4d80;
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.6);
}

.meter-track {
    flex: 1;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.meter-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%; /* Static full height, clipped dynamically in JS */
    background: #ffd000; /* Yellow base color */
    clip-path: inset(100% 0 0 0); /* Empty initially */
    transition: clip-path 0.08s linear;
}

.peak-marker {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    box-shadow: 0 0 6px #ffffff;
    bottom: 0%;
    z-index: 2;
}

.rms-indicator {
    position: absolute;
    left: 15%;
    width: 70%;
    background: rgba(255, 255, 255, 0.35);
    height: 4px;
    bottom: 0%;
    border-radius: 1px;
    z-index: 1;
}

.channel-label {
    font-family: var(--font-mono);
    font-size: 11px; /* larger */
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* PPM Scale tick marks drawn inside canvas or as floating markers */
.scale-marks-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family: var(--font-mono);
    font-size: 10px; /* larger */
    color: var(--text-muted);
}

.scale-tick-line {
    position: absolute;
    left: 0;
    width: 100%;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.scale-tick-label {
    position: absolute;
    right: 2px;
    transform: translateY(-50%);
}

/* Loudness Card Layout */
.loudness-content {
    justify-content: space-between;
    height: 100%;
    gap: 10px;
}

.loudness-dials {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    flex: 2; /* Occupy maximum vertical space */
    min-height: 0;
}

.dial-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.dial-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 145px; /* Increased from 125px */
    max-height: 145px; /* Increased from 125px */
    aspect-ratio: 1 / 1;
}

.dial-ring {
    width: 100%;
    height: 100%;
    transform: rotate(90deg) scaleY(-1); /* 180° gedreht: Sweep beginnt oben (12 o'clock), Target bei unten (6 o'clock) */
}

.dial-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.45);
    stroke-width: 6px; /* slightly thicker */
}

.dial-fill {
    fill: none;
    stroke: #00ff88; /* Green */
    stroke-width: 8px;
    stroke-linecap: butt; /* kein runder Endpunkt -> scharfer Übergang zu Rot */
    stroke-dasharray: 283; /* r=45, Umfang=282.74 */
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.08s linear;
}

.dial-fill-overrun {
    fill: none;
    stroke: #ff0055; /* Red overrun */
    stroke-width: 8px;
    stroke-linecap: butt; /* kein runder Endpunkt -> scharfer Übergang zu Grün */
    stroke-dasharray: 0 141.5 0 283; /* r=45, 50% Gap initial */
    transition: stroke-dasharray 0.08s linear;
}

.target-marker-line {
    stroke: #ff0055;
    stroke-width: 2.5px;
    stroke-linecap: round;
    opacity: 0.85;
}

.dial-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 80%;
}

.dial-label {
    font-size: 10px; /* larger */
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.dial-value {
    font-family: var(--font-mono);
    font-size: 24px; /* larger */
    font-weight: 700;
    color: var(--text-primary);
    margin: 2px 0;
}

.dial-value.overrun {
    color: var(--color-red);
    text-shadow: 0 0 8px rgba(255, 0, 85, 0.5);
}

.dial-unit {
    font-size: 10px; /* larger */
    font-weight: 600;
    color: var(--text-muted);
}

.loudness-stats {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px; /* larger */
}

.stat-label {
    color: var(--text-secondary);
}

.stat-val {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
}

/* Vectorscope (Stereosichtgerät) Layout */
.vectorscope-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}

.vectorscope-container {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 0;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.vectorscope-container canvas {
    border-radius: 8px;
}

.correlation-area {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.corr-title {
    font-size: 11px; /* larger */
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.correlation-bar-container {
    display: flex;
    align-items: center;
    width: 100%;
    height: 16px;
    gap: 8px;
}

.corr-label {
    font-family: var(--font-mono);
    font-size: 11px; /* larger */
    font-weight: 700;
    color: var(--text-secondary);
    width: 14px;
}

.corr-track {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.corr-center {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
}

.corr-fill {
    position: absolute;
    top: 0;
    height: 100%;
    display: none; /* Injected / handled dynamically or hidden */
}

#corr-fill-neg {
    right: 50%;
    left: 0;
    background: linear-gradient(to right, rgba(255, 0, 85, 0.25), rgba(255, 0, 85, 0));
}

#corr-fill-pos {
    left: 50%;
    right: 0;
    background: linear-gradient(to left, rgba(0, 255, 136, 0.25), rgba(0, 255, 136, 0));
}

.corr-needle {
    position: absolute;
    left: 50%; /* 0% to 100% via JS */
    top: -3px;
    width: 3px;
    height: 12px;
    background-color: #ffffff;
    box-shadow: 0 0 6px #ffffff;
    border-radius: 1.5px;
    transform: translateX(-50%);
    transition: left 0.05s ease-out;
}

/* History & Spectrum Content */
.canvas-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Controls */
.select-sm {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 10px;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    font-weight: 600;
}

.select-sm:focus {
    outline: none;
    border-color: var(--color-cyan);
}

/* Floating Actions: Gear Icon & Layout Reset */
.btn-gear {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(22, 27, 38, 0.85);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99;
}

.btn-gear:hover {
    transform: rotate(60deg) scale(1.1);
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.btn-reset-layout {
    position: absolute;
    right: 78px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(22, 27, 38, 0.85);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    z-index: 99;
}

.btn-reset-layout:hover {
    transform: scale(1.1);
    border-color: var(--color-cyan);
}

/* Hilfe-Button */
.btn-help {
    position: absolute;
    right: 136px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(22, 27, 38, 0.85);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-ui);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    z-index: 99;
}
.btn-help:hover {
    transform: scale(1.1);
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

/* Hilfe Modal Erweiterungen */
.modal-card-wide {
    max-width: 680px;
    width: 95%;
}

.help-tabs {
    display: flex;
    gap: 0;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0 20px;
}

.help-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-ui);
}

.help-tab:hover {
    color: var(--text-primary);
}

.help-tab.active {
    color: var(--color-cyan);
    border-bottom-color: var(--color-cyan);
}

.help-panel {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.help-panel.active {
    display: flex;
}

.help-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding-bottom: 16px;
}

.help-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.help-section h3 {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-cyan);
    letter-spacing: 1px;
}

.help-section p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.help-section code {
    background: rgba(0,240,255,0.08);
    color: var(--color-cyan);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.help-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 11px;
}

.help-coeff {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-cyan);
    border: 1px solid rgba(0,240,255,0.1);
}

/* OSS-Liste */
.oss-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oss-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.oss-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.oss-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.oss-license {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-emerald);
    background: rgba(0,255,136,0.08);
    border: 1px solid rgba(0,255,136,0.2);
    border-radius: 4px;
    padding: 2px 7px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.oss-item p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.oss-link {
    font-size: 11px;
    color: var(--color-cyan);
    text-decoration: none;
    font-family: var(--font-mono);
    opacity: 0.8;
    transition: opacity 0.15s;
}

.oss-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Universal Button Styles */
.btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm {
    padding: 3px 8px;
    font-size: 9px;
    min-height: 20px;
    border-radius: 4px;
}

.btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sec {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-sec.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-danger {
    background: rgba(255, 0, 85, 0.15);
    color: var(--color-red);
    border: 1px solid rgba(255, 0, 85, 0.3);
}

.btn-danger:hover {
    background: var(--color-red);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
}

/* Modal Settings Menu Panel Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 8, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none; /* Shown via JS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: #111622;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: modalSlideUp 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-red);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 15px;
}

.settings-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-section h3 {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-cyan);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px; /* larger */
    gap: 10px;
}

.settings-row label {
    color: var(--text-secondary);
    font-weight: 500;
}

.settings-row select, .settings-row input[type="number"] {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px; /* larger */
    font-weight: 600;
    outline: none;
    min-width: 180px;
    font-family: var(--font-ui);
}

.settings-row select:focus, .settings-row input[type="number"]:focus {
    border-color: var(--color-cyan);
}

.settings-row input[type="color"] {
    border: none;
    width: 48px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    cursor: pointer;
}

.modal-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
}

/* Einstellungs-Hinweistext */
.settings-hint {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: -2px;
}
.settings-hint strong { color: var(--color-cyan); font-weight: 700; }

/* AES67-Quellenliste */
.settings-row-block {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}
.aes67-sources {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 6px;
    max-height: 160px;
    overflow-y: auto;
}
.aes67-src-empty {
    font-size: 11px;
    color: var(--text-muted);
    padding: 6px;
    text-align: center;
}
.aes67-src-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.aes67-src-row.active {
    border-color: rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.05);
}
.aes67-src-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.aes67-src-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aes67-src-meta {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Kanal-Beschriftung */
.channel-names-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 6px;
}

#channel-names-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.channel-name-idx {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-cyan);
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.channel-name-fullname {
    font-size: 11px;
    color: var(--text-muted);
    flex: 1;
}

.channel-name-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    width: 120px;
    font-family: var(--font-ui);
    outline: none;
    flex-shrink: 0;
}

.channel-name-input:focus {
    border-color: var(--color-cyan);
    box-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
}

.channel-name-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Presets List Styling */
.presets-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 6px;
    margin-top: 5px;
}

.presets-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

.presets-list::-webkit-scrollbar {
    width: 6px;
}
.presets-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}
.presets-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}
.presets-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-cyan);
}

.preset-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 3px 8px;
    transition: all 0.2s ease;
}

.preset-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.preset-row.active {
    border-color: rgba(0, 255, 136, 0.25);
    background: rgba(0, 255, 136, 0.04);
}

.preset-idx {
    font-family: var(--font-mono);
    font-size: 12px; /* larger */
    font-weight: 700;
    color: var(--text-muted);
    width: 22px;
    text-align: center;
}

.preset-row.active .preset-idx {
    color: var(--color-emerald);
}

.preset-name-input {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 12px; /* larger */
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 4px;
    outline: none;
    transition: all 0.15s ease;
    font-family: var(--font-ui);
}

.preset-name-input:focus, .preset-name-input:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
}

.preset-name-input:focus {
    border-color: var(--color-cyan);
    box-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
}

.preset-actions {
    display: flex;
    gap: 4px;
}

