/* Nonlinear optics tool specifics (layout and colours come from the shared optics theme) */
.tool-page .nlo-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.nlo-hint,
.preset-note {
    margin: 8px 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.preset-note:empty,
.nlo-hint:empty {
    display: none;
}

.nlo-wide {
    width: 100%;
    margin-top: 6px;
}

.nlo-actions {
    margin-top: 12px;
}

.nlo-scope {
    margin: 12px auto 0;
    max-width: 760px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.nlo-scope .optics-badge {
    margin-right: 6px;
}

.nlo-section-title {
    margin: 8px 0 12px;
    font-size: 1.2rem;
}

.canvas-area .nlo-section-title:not(:first-child) {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.nlo-eq {
    overflow-x: auto;
    padding: 8px 12px;
    border-left: 3px solid var(--primary-color);
    background: var(--surface-elevated);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

#zCanvas,
#dkCanvas,
#pmCanvas,
#timeCanvas,
#specCanvas,
#evoCanvas,
#convCanvas {
    touch-action: pan-y;
}

.optics-related {
    margin: 28px 0;
}

.optics-related ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.optics-related li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
}

.optics-related li span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

[hidden] {
    display: none !important;
}

/* readouts here carry sentence-length values: wider cells, value under the label on phones */
#shgReadouts,
#kerrReadouts {
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

@media (max-width: 560px) {

    #shgReadouts>div,
    #kerrReadouts>div {
        flex-direction: column;
        gap: 2px;
    }

    #shgReadouts dd,
    #kerrReadouts dd {
        text-align: left;
        overflow-wrap: anywhere;
    }
}