@import url('/static/style.css');

:root {
    --blue: #00b4d8;
    --amber: #ffaa32;
    --red-soft: #ff6b6b;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.section-intro {
    color: var(--gray);
    font-size: .88rem;
    margin-bottom: 16px;
}

.dimension-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: 600;
    color: var(--white);
    font-size: .92rem;
}

.field input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    font-size: .96rem;
    outline: none;
}

.field input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-dim);
}

.field input.invalid {
    border-color: var(--red-soft);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.18);
}

.input-hint {
    color: var(--gray);
    font-size: .82rem;
    margin-bottom: 14px;
}

.room-verdict {
    font-size: 1.05rem;
    line-height: 1.45;
    border-left: 4px solid var(--green);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    background: rgba(6, 22, 15, 0.68);
}

.verdict-good {
    border-left-color: var(--green);
}

.verdict-ok {
    border-left-color: var(--amber);
}

.verdict-bad {
    border-left-color: var(--red-soft);
}

.layout-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 8px;
}

.desk-info {
    color: var(--gray);
    font-size: .88rem;
    margin-bottom: 12px;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    color: var(--gray);
}

.toggle input {
    accent-color: var(--green);
}
}

.sweet-spot-meter {
    --meter-color: var(--green);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
    background: rgba(3, 13, 10, 0.68);
}

.sweet-spot-meter.meter-good {
    --meter-color: var(--green);
}

.sweet-spot-meter.meter-warn {
    --meter-color: var(--amber);
}

.sweet-spot-meter.meter-bad {
    --meter-color: var(--red-soft);
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--gray);
    font-size: .82rem;
    margin-bottom: 8px;
}

.meter-labels strong {
    color: var(--white);
}

.meter-track {
    height: 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.meter-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 38%;
    background: color-mix(in srgb, var(--meter-color) 70%, transparent);
}

.meter-sweet-marker {
    position: absolute;
    left: 38%;
    top: -2px;
    width: 2px;
    height: 16px;
    background: var(--white);
    opacity: .9;
}

.meter-thumb {
    position: absolute;
    top: 50%;
    left: 38%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #04130d;
    transform: translate(-50%, -50%);
    background: var(--meter-color);
    box-shadow: 0 0 14px color-mix(in srgb, var(--meter-color) 55%, transparent);
}

.meter-hint {
    margin-top: 8px;
    color: var(--gray);
    font-size: .82rem;
}

.canvas-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 230, 138, 0.03);
    padding: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}

#layoutCanvas {
    width: 100%;
    height: auto;
    display: block;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}

.legend-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--gray);
    font-size: .84rem;
    position: relative;
    cursor: help;
}

.legend-item::after {
    content: attr(data-tip);
    position: absolute;
    left: 10px;
    top: calc(100% + 8px);
    width: min(290px, 78vw);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #07140f;
    color: var(--white);
    font-size: .76rem;
    line-height: 1.35;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: .2s ease;
    z-index: 10;
}

.legend-item:hover::after,
.legend-item:focus-within::after {
    opacity: 1;
    transform: translateY(0);
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.dot-desk { background: #d7fce9; }
.dot-monitor { background: var(--green); }
.dot-reflection { background: var(--blue); }
.dot-bass { background: var(--amber); }
.dot-ceiling { background: #89e8ff; }
.dot-rear { background: #95b5a4; }

.tip-note {
    color: var(--gray);
    font-size: .82rem;
}

.tech-details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(5, 15, 11, 0.62);
    padding: 12px 14px;
}

.tech-details summary {
    cursor: pointer;
    color: var(--white);
    font-weight: 700;
    margin-bottom: 10px;
}

.tech-details[open] summary {
    margin-bottom: 12px;
}

.room-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.detail-card {
    background: rgba(3, 13, 10, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.detail-chart {
    grid-column: 1 / -1;
}

.detail-card h4 {
    margin-bottom: 6px;
}

.detail-card p {
    color: var(--gray);
    font-size: .82rem;
    margin-bottom: 12px;
}

.tech-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: .88rem;
    color: var(--gray);
    margin-bottom: 7px;
}

.tech-row strong {
    color: var(--white);
}

#ratioStatus.warn {
    color: var(--red-soft);
}

#modesList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mode-pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .78rem;
    color: var(--green);
    background: rgba(0, 230, 138, 0.08);
    cursor: help;
    transition: background 0.2s ease;
}
.mode-pill:hover {
    background: rgba(0, 230, 138, 0.18);
}

.mode-pill.overlap {
    color: #ffead1;
    border-color: rgba(255, 170, 50, 0.45);
    background: rgba(255, 170, 50, 0.22);
}

.mode-pill.warning {
    color: #ffd7d7;
    border-color: rgba(255, 107, 107, 0.5);
    background: rgba(255, 107, 107, 0.18);
}

#boltCanvas {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.budget-toolbar {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    margin-bottom: 16px;
}

.mode-toggle {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--gray);
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
}

.mode-toggle.active {
    background: var(--green);
    color: #04130d;
    box-shadow: 0 0 18px var(--green-glow);
}

.budget-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}

.budget-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(8, 22, 16, 0.8);
    padding: 16px;
    cursor: pointer;
    transition: border-color .25s, box-shadow .25s;
}

.budget-card:hover {
    border-color: var(--border-bright);
}

.budget-card.budget-active {
    border-color: var(--green);
    box-shadow: 0 0 20px var(--green-glow);
}

.budget-card h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.budget-range {
    color: var(--green);
    font-weight: 800;
    font-size: .95rem;
    margin-bottom: 10px;
}

.budget-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.budget-item {
    border: 1px solid rgba(0, 230, 138, 0.1);
    border-radius: 10px;
    padding: 8px;
    font-size: .8rem;
    color: var(--gray);
    background: rgba(0, 0, 0, 0.15);
}

.budget-item strong {
    display: block;
    color: var(--white);
    margin-bottom: 3px;
}

.rules-section {
    margin: 0;
}

.rules-list {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-list li {
    color: var(--gray);
    padding-left: 2px;
}

.rules-list li strong {
    color: var(--white);
}

@media (max-width: 980px) {
    .page-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-nav a {
        padding: 9px 12px;
    }

    .room-detail-grid,
    .budget-grid,
    .dimension-grid,
    .layout-controls {
        grid-template-columns: 1fr;
    }

    .meter-labels {
        display: flex;
        flex-direction: column;
    }

    .tech-row {
        flex-direction: column;
        gap: 4px;
    }

    .desk-info {
        text-align: left;
    }

    .legend-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: #fff;
        color: #111;
    }

    body::before,
    .page-nav,
    .cta-banner,
    .footer,
    #printBtn,
    .budget-toolbar,
    .meter-hint,
    .toggle {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .header {
        margin-bottom: 16px;
    }

    .header h1,
    .header h1 span,
    .logo,
    .header p,
    .section,
    .field,
    .detail-card,
    .legend-item,
    .rules-list li,
    .budget-item,
    .budget-range,
    .budget-card h4,
    .room-verdict,
    .tech-row,
    .tech-details summary {
        color: #111 !important;
        -webkit-text-fill-color: #111 !important;
    }

    .section,
    .detail-card,
    .legend-item,
    .budget-card,
    .room-verdict,
    .tech-details,
    .sweet-spot-meter,
    #boltCanvas {
        background: #fff !important;
        border-color: #d5d5d5 !important;
        box-shadow: none !important;
    }

    .canvas-wrap,
    .tech-details,
    .budget-card {
        break-inside: avoid;
    }
}
