/* Thin films tool: layout for the layer editor and small controls. Shared look comes from
   ../shared/simulation.css and ../shared/optics-lab-theme.css. */

.tf-editor {
    margin-bottom: 4px;
}

.tf-table {
    min-width: 560px;
}

.tf-table caption {
    font-size: .8rem;
    line-height: 1.4;
}

.tf-table td {
    vertical-align: middle;
}

.tf-table tr.tf-medium td {
    color: var(--optics-ink-2);
    font-style: italic;
}

.tf-table tr.tf-medium td input {
    font-style: normal;
}

body.tool-optics-lab .tf-table input.tf-num {
    width: 6.2em;
    min-height: 30px;
}

.tf-table input.tf-name {
    width: 9em;
    min-height: 30px;
    padding: 3px 6px;
    box-sizing: border-box;
    font: inherit;
    color: var(--optics-ink);
    background: var(--surface-color, #fff);
    border: 1px solid var(--optics-card-border);
    border-radius: 6px;
}

body.tool-optics-lab.dark-mode .tf-table input.tf-name {
    background: rgba(0, 0, 0, .35);
    border-color: rgba(167, 139, 250, .45);
}

.tf-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-end;
}

body.tool-optics-lab button.tf-row-btn {
    min-width: 32px;
    min-height: 30px;
    padding: 2px 7px;
    font: 600 .8rem/1 inherit;
    color: var(--optics-ink);
    background: var(--surface-color, #fff);
    border: 1px solid var(--optics-card-border);
    border-radius: 6px;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}

body.tool-optics-lab.dark-mode button.tf-row-btn {
    background: rgba(0, 0, 0, .3);
}

body.tool-optics-lab button.tf-row-btn:hover:not(:disabled) {
    border-color: var(--optics-focus);
}

body.tool-optics-lab button.tf-row-btn:disabled {
    opacity: .35;
    cursor: default;
}

.tf-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.tf-reset {
    width: 100%;
    margin-top: 10px;
}

.preset-note {
    min-height: 1em;
    margin: 10px 0 0;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.tf-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 4px 0 0;
    padding: 6px 0 0;
    border: 0;
    color: var(--text-primary);
    font-size: .88rem;
}

.tf-radio-row legend {
    padding: 0;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: .9rem;
}

.tf-radio-row label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

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

.tf-select {
    width: 100%;
    min-height: 36px;
    margin-bottom: 14px;
    padding: 4px 8px;
    font: inherit;
    font-size: .85rem;
    color: var(--optics-ink);
    background: var(--surface-color, #fff);
    border: 1px solid var(--optics-card-border);
    border-radius: 6px;
}

body.tool-optics-lab.dark-mode .tf-select {
    background: rgba(0, 0, 0, .35);
}

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

.tf-swatch {
    display: inline-block;
    width: 1.4em;
    height: 1em;
    vertical-align: -2px;
    border: 1px solid var(--optics-card-border);
    border-radius: 3px;
}

#readouts {
    margin: 10px 0;
}

#readouts>div {
    flex-wrap: wrap;
}

#absTable {
    margin: 8px 0;
}

.optics-model .tf-eq {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--primary-light, rgba(104, 85, 189, .09));
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .86rem;
    overflow-x: auto;
    color: var(--optics-ink);
}

.tf-related {
    margin: 12px 0 28px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--optics-card-bg);
    border: 1px solid var(--optics-card-border);
    text-align: left;
}

.tf-related h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--optics-ink);
}

.tf-related ul {
    margin: 0;
    padding-left: 1.2em;
    columns: 2 260px;
    color: var(--optics-ink-2);
}

@media (max-width: 620px) {
    .tf-readouts-wide {
        grid-column: 1 / -1;
    }
}

body.tool-optics-lab #readouts {
    grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
}

body.tool-optics-lab #readouts dd {
    min-width: 0;
    overflow-wrap: anywhere;
}