/* Waveguides and optical fibres: page-specific styles (layout comes from the shared CSS). */

.wg-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.wg-presets .preset-option {
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
    padding: 8px 6px;
}

.tool-page .preset-note {
    margin: 10px 0 0;
    font-size: .84rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.wg-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.wg-seg-legend {
    width: 100%;
    padding: 0;
    margin-bottom: 6px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.wg-seg label {
    flex: 1 1 120px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: .86rem;
    cursor: pointer;
}

.wg-seg label:has(input:checked) {
    border-color: var(--primary-color);
    background: var(--primary-light, rgba(104, 85, 189, .09));
    font-weight: 600;
}

.wg-seg[disabled] label,
.wg-seg.is-disabled label {
    opacity: .5;
    cursor: not-allowed;
}

.wg-label {
    display: block;
    margin-bottom: 6px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-page .wg-select {
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}

.wg-hint {
    margin: 6px 0 0;
    font-size: .8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.wg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: 0 !important;
}

.wg-actions .action-btn {
    min-height: 36px;
}

.wg-readouts,
#coupleReadouts,
.wg-dispersion .optics-readouts {
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)) !important;
    margin: 4px 0 14px;
    padding: 12px;
    border-radius: 12px;
    background: var(--optics-card-bg);
    border: 1px solid var(--optics-card-border);
}

.wg-dispersion {
    margin: 14px 0;
}

#modeTable {
    margin: 10px 0;
}

#modeTable tr.is-selected td {
    background: var(--primary-light, rgba(104, 85, 189, .09));
    font-weight: 700;
}

.wg-related {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: baseline;
    margin: 16px 0 4px;
    font-size: .9rem;
    color: var(--text-secondary);
    text-align: left;
}

.wg-related a {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 480px) {
    .wg-presets {
        grid-template-columns: minmax(0, 1fr);
    }
}