/* Balanced mixer interactive — RF / HF palette (distinct from NMR blue). */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a3d32 0%, #0f241e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #2a2a2a;
}

.back-link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    margin-bottom: 14px;
    font-size: 0.95em;
}
.back-link:hover { color: #e8c547; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1a3d32 0%, #0f241e 100%);
    color: white;
    padding: 28px 30px;
    text-align: center;
}
.header h1 { font-size: 2.1em; margin-bottom: 8px; font-weight: 300; }
.header p { font-size: 1.05em; opacity: 0.92; max-width: 820px; margin: 0 auto; line-height: 1.5; }

.tab-bar { display: flex; background: #eef2ef; border-bottom: 2px solid #d4ddd8; flex-wrap: wrap; }
.tab-button {
    padding: 14px 22px;
    border: none;
    background: transparent;
    font-size: 0.98em;
    font-weight: 600;
    color: #5a6b63;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}
.tab-button:hover { color: #c45c00; background: #faf3eb; }
.tab-button.active { color: #c45c00; border-bottom-color: #c45c00; background: white; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.content { display: grid; grid-template-columns: 360px 1fr; gap: 0; }
.controls-panel {
    background: #f7faf8;
    padding: 22px 22px 28px;
    border-right: 1px solid #dde5e0;
    font-size: 0.95em;
}
.controls-panel h2 { color: #1a3d32; margin-bottom: 14px; font-size: 1.2em; }
.controls-panel h3 { color: #c45c00; margin: 18px 0 8px; font-size: 1em; text-transform: uppercase; letter-spacing: 0.05em; }

.intro {
    background: #edf5f1;
    border-left: 3px solid #2d8a6e;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.92em;
    line-height: 1.55;
    color: #34463f;
    border-radius: 0 6px 6px 0;
}
.intro b { color: #1a3d32; }

.control-group { margin-bottom: 14px; }
.control-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: 0.92em;
    color: #2a2a2a;
}
.control-label .value {
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-weight: 600;
    color: #c45c00;
}
.control-label .hint { color: #888; font-size: 0.88em; }

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92em;
    color: #2a2a2a;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}
.checkbox-group input[type="checkbox"] {
    accent-color: #c45c00;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: #cdd8d2;
    border-radius: 4px;
    outline: none;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #c45c00;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(196, 92, 0, 0.35);
}
.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #c45c00;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.readout {
    background: white;
    border: 1px solid #dde5e0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 0.9em;
    line-height: 1.65;
}
.readout div { display: flex; justify-content: space-between; gap: 12px; }
.readout .k { color: #555; }
.readout .v { font-family: ui-monospace, "JetBrains Mono", monospace; font-weight: 600; color: #1a3d32; }
.readout .v--sum { color: #e8c547; }
.readout .v--diff { color: #ff8c42; }

.preset-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.preset-btn {
    flex: 1 1 auto;
    padding: 8px 10px;
    font-size: 0.85em;
    font-weight: 600;
    background: white;
    border: 1px solid #c6d2cb;
    color: #1a3d32;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.preset-btn:hover { background: #edf5f1; border-color: #2d8a6e; }
.preset-btn.active { background: #2d8a6e; color: white; border-color: #2d8a6e; }

.note-box {
    background: #fff8f0;
    border: 1px solid #f0dcc8;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 14px;
    font-size: 0.88em;
    line-height: 1.5;
    color: #5a4a3a;
}

.visualization-panel {
    padding: 18px 22px 22px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.chart-container {
    background: white;
    border: 1px solid #dde5e0;
    border-radius: 10px;
    padding: 8px;
    min-height: 280px;
}
.chart-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #1a3d32;
    margin-bottom: 4px;
    padding-left: 4px;
}

/* Math tab */
.math-panel {
    padding: 28px 36px 36px;
    max-width: 900px;
    line-height: 1.65;
    font-size: 1.02em;
}
.math-panel h2 { color: #1a3d32; margin: 24px 0 10px; font-size: 1.35em; }
.math-panel h2:first-child { margin-top: 0; }
.math-panel p { margin-bottom: 12px; color: #333; }
.math-panel ul { margin: 0 0 14px 24px; color: #333; }
.math-panel li { margin-bottom: 6px; }
.math-panel .eq-block {
    background: #f7faf8;
    border: 1px solid #dde5e0;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 14px 0;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.95em;
    overflow-x: auto;
}
.math-panel a { color: #c45c00; }

.footer-link {
    text-align: center;
    padding: 16px;
    background: #f7faf8;
    border-top: 1px solid #dde5e0;
    font-size: 0.95em;
}
.footer-link a { color: #c45c00; font-weight: 600; }

@media (max-width: 960px) {
    .content { grid-template-columns: 1fr; }
    .controls-panel { border-right: none; border-bottom: 1px solid #dde5e0; }
}
