/* noise-band-explorer/styles.css */

.nbe-page {
    padding-top: var(--ai-space-2);
    padding-bottom: var(--ai-space-6);
}

.nbe-page .ai-header {
    margin-bottom: var(--ai-space-3);
    padding: var(--ai-space-3) var(--ai-space-5);
}

.nbe-lead {
    margin: 0;
    line-height: 1.6;
    color: #334155;
}

.nbe-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--ai-space-4);
    margin-bottom: var(--ai-space-4);
}

.nbe-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--ai-space-3);
    margin-bottom: var(--ai-space-3);
}

.nbe-controls {
    display: grid;
    grid-template-columns: minmax(280px, 1.15fr) minmax(240px, 1fr);
    gap: var(--ai-space-3);
}

.nbe-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--ai-radius-lg);
    padding: var(--ai-space-3);
}

.nbe-panel h2 {
    margin: 0 0 var(--ai-space-2);
    font-size: 0.95rem;
    color: var(--ai-blue-800);
}

.nbe-part-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.nbe-part {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--ai-radius-md);
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
}

.nbe-part:has(input:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
}

.nbe-part input {
    margin-top: 2px;
    accent-color: var(--ai-blue-600);
}

.nbe-part-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.nbe-part-text strong {
    display: block;
    font-size: 0.82rem;
    color: #1e293b;
    line-height: 1.25;
}

.nbe-part-text span {
    font-size: 0.72rem;
    color: var(--ai-gray-600);
    line-height: 1.3;
}

.nbe-hint {
    margin: var(--ai-space-2) 0 0;
    font-size: 0.72rem;
    color: var(--ai-gray-600);
    line-height: 1.35;
}

.nbe-band-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e40af;
    margin-bottom: var(--ai-space-2);
}

.nbe-slider-row {
    margin-bottom: var(--ai-space-2);
}

.nbe-slider-row label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: #374151;
}

.nbe-slider-row input[type="range"] {
    width: 100%;
}

.nbe-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--ai-space-2);
}

.nbe-preset-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    border: 1px solid #d1d5db;
    border-radius: var(--ai-radius-sm);
    background: #fff;
    cursor: pointer;
}

.nbe-preset-btn.is-active {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
    font-weight: 600;
}

.nbe-plots-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--ai-space-3);
    align-items: start;
    margin-bottom: var(--ai-space-4);
}

.nbe-nsd-section,
.nbe-scope-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.nbe-scope-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.nbe-scope-header h3 {
    margin: 0;
    font-size: 0.92rem;
    color: #1e293b;
}

.nbe-scope-note {
    margin: 0;
    font-size: 0.74rem;
    color: var(--ai-gray-600);
    line-height: 1.35;
}

.nbe-nsd-section h3 {
    margin: 0 0 6px;
    font-size: 0.92rem;
    color: #1e293b;
}

.nbe-chart-wrap {
    position: relative;
    flex: none;
    overflow: hidden;
}

.nbe-chart-wrap--nsd,
.nbe-chart-wrap--scope {
    height: clamp(520px, 55vh, 720px);
}

.nbe-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 0;
    margin-bottom: var(--ai-space-2);
    clear: both;
}

.nbe-metric-row {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--ai-radius-md);
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
    line-height: 1.35;
}

.nbe-metric-sub {
    color: var(--ai-gray-600);
    font-size: 0.74rem;
}

.nbe-metric-note {
    color: #64748b;
    font-size: 0.72rem;
    font-style: italic;
}

.nbe-footer-row {
    display: flex;
    align-items: flex-start;
    gap: var(--ai-space-3);
    flex-wrap: wrap;
}

.nbe-insight {
    flex: 1;
    min-width: min(100%, 480px);
    padding: 8px 12px;
    background: #fefce8;
    border-left: 3px solid var(--ai-gold);
    border-radius: var(--ai-radius-md);
    font-size: 0.82rem;
    line-height: 1.45;
}

.nbe-insight .nbe-aha {
    margin-top: 4px;
    color: #1e3a5f;
}

.nbe-reset-btn {
    flex-shrink: 0;
    align-self: flex-start;
    padding: 6px 12px;
    background: var(--ai-gray-100);
    border: 1px solid #d1d5db;
    border-radius: var(--ai-radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .nbe-controls {
        grid-template-columns: 1fr;
    }

    .nbe-part-list {
        grid-template-columns: 1fr;
    }

    .nbe-plots-row {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 720px) {
    .nbe-chart-wrap--nsd,
    .nbe-chart-wrap--scope {
        height: clamp(440px, 50vh, 600px);
    }

    .nbe-panel {
        padding: var(--ai-space-2);
    }
}