/* Óptica geométrica interactiva (reutiliza las piezas de probabilidad/probabilidad.css y bf-tools.css) */
.op-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.op-panel[hidden] { display: none; }
.op-panel--single { grid-template-columns: minmax(0, 860px); }
.op-controls h2, .op-conv h2 { margin: 0 0 8px; font-size: 1.1rem; }
.op-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 12px 0; align-items: start; }
@media (max-width: 760px) { .op-grid2 { grid-template-columns: 1fr; } }
.op-grid2 .gx-slider[hidden] { display: none; }
.op-rays { border: 1px solid var(--bf-border, rgba(130,190,255,.2)); border-radius: 12px; padding: 8px 14px 12px; margin: 4px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.op-rays legend { padding: 0 6px; font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--bf-text-2, #b3c2db); }
.op-rays label { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: .92rem; cursor: pointer; }
.op-rays input { width: 20px; height: 20px; accent-color: var(--primary, #8b6bff); }

/* Escena */
.op-scene { margin: 0 -4px; }
.op-svg { width: 100%; height: auto; display: block; user-select: none; touch-action: pan-y; background: color-mix(in srgb, var(--bf-surface, #0e1528) 70%, transparent); border-radius: 14px; }
.op-axis { stroke: var(--bf-text-2, #b3c2db); stroke-width: 1.2; opacity: .7; }
.op-focus { stroke: var(--bf-text, #eaf2ff); stroke-width: 2; }
.op-label { fill: var(--bf-text-2, #b3c2db); font-size: 13px; font-weight: 700; font-family: 'JetBrains Mono', 'JetBrains Mono Fallback', monospace; }
.op-label--f { fill: var(--bf-text, #eaf2ff); font-size: 14px; }
.op-label--obj { fill: var(--bf-text, #eaf2ff); }
.op-label--img { fill: #ff8a7a; }
html.theme-light .op-label--img { fill: #b3261e; }
.op-lens, .op-mirror { fill: none; stroke: var(--secondary, #5ef2e0); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
html.theme-light .op-lens, html.theme-light .op-mirror { stroke: #0b6e63; }
.op-hatch { stroke: var(--secondary, #5ef2e0); stroke-width: 1.4; opacity: .6; }
html.theme-light .op-hatch { stroke: #0b6e63; }
.op-arrow-shaft { stroke-width: 3.4; stroke-linecap: round; }
.op-arrow-head { fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.op-obj .op-arrow-shaft, .op-obj .op-arrow-head { stroke: var(--bf-text, #eaf2ff); }
.op-image .op-arrow-shaft, .op-image .op-arrow-head { stroke: #ff8a7a; }
html.theme-light .op-image .op-arrow-shaft, html.theme-light .op-image .op-arrow-head { stroke: #b3261e; }
.op-image--virtual .op-arrow-shaft, .op-image--virtual .op-arrow-head { stroke-dasharray: 7 5; }
.op-object { cursor: ew-resize; outline: none; }
.op-grab { fill: transparent; stroke: transparent; stroke-width: 2; }
.op-object:hover .op-grab, .op-object:focus-visible .op-grab { stroke: var(--primary, #8b6bff); }
.op-object:focus-visible .op-grab { stroke: var(--secondary, #5ef2e0); stroke-width: 3; }
.op-ray { stroke-width: 2.1; stroke-linecap: round; fill: none; }
.op-ray--virtual { stroke-dasharray: 6 5; opacity: .85; }
.op-ray--paralelo, .op-swatch.op-ray--paralelo { stroke: #f5a623; background: #f5a623; }
.op-ray--centro, .op-swatch.op-ray--centro { stroke: #3ecf8e; background: #3ecf8e; }
.op-ray--foco, .op-swatch.op-ray--foco { stroke: #5ea8ff; background: #5ea8ff; }
.op-ray--vertice, .op-swatch.op-ray--vertice { stroke: #ff6b9a; background: #ff6b9a; }
.op-ray--oblicuo, .op-swatch.op-ray--oblicuo { stroke: #c084fc; background: #c084fc; }
html.theme-light .op-ray--paralelo, html.theme-light .op-swatch.op-ray--paralelo { stroke: #b45309; background: #b45309; }
html.theme-light .op-ray--centro, html.theme-light .op-swatch.op-ray--centro { stroke: #047857; background: #047857; }
html.theme-light .op-ray--foco, html.theme-light .op-swatch.op-ray--foco { stroke: #1d4ed8; background: #1d4ed8; }
html.theme-light .op-ray--vertice, html.theme-light .op-swatch.op-ray--vertice { stroke: #be185d; background: #be185d; }
html.theme-light .op-ray--oblicuo, html.theme-light .op-swatch.op-ray--oblicuo { stroke: #7e22ce; background: #7e22ce; }
.op-swatch { display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 8px; flex: none; }
.op-legend { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; font-size: .9rem; line-height: 1.5; color: var(--bf-text-2, #b3c2db); }
.op-legend li { display: flex; gap: 0; align-items: baseline; }
.op-legend strong { color: var(--bf-text, #eaf2ff); margin-right: 4px; }
.op-scale { margin: 4px 0 0; }

/* Resultados */
.op-summary { padding: 10px 14px; border-left: 4px solid var(--primary, #8b6bff); background: color-mix(in srgb, var(--primary, #8b6bff) 10%, transparent); border-radius: 8px; margin: 10px 0; line-height: 1.5; }
.op-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
.op-numbers div { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--bf-border, rgba(130,190,255,.14)); }
.op-numbers dt { font-size: .76rem; color: var(--bf-text-2, #b3c2db); }
.op-numbers dd { margin: 2px 0 0; font-family: 'JetBrains Mono', 'JetBrains Mono Fallback', monospace; font-weight: 800; }
/* en línea con el texto, pero una fórmula ancha hace scroll en su caja en vez de ensanchar toda la página en móvil */
.op-steps .bf-math-line, .op-conv .bf-math-line { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: bottom; }
.op-facts { margin: 8px 0; padding-left: 1.2em; line-height: 1.6; font-size: .93rem; }

/* Modos de práctica */
.op-paso { margin: 12px 0 6px; }
.op-paso__n { font-weight: 800; color: var(--secondary, #5ef2e0); margin: 0 0 4px; }
html.theme-light .op-paso__n { color: #0b6e63; }
.op-opts { border: 1px solid var(--bf-border, rgba(130,190,255,.2)); border-radius: 12px; padding: 8px 12px; margin: 8px 0; display: grid; gap: 2px; min-width: 0; }
.op-opts legend { font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 0 6px; color: var(--bf-text-2, #b3c2db); }
.op-opt { display: flex; gap: 10px; align-items: flex-start; min-height: 40px; padding: 6px 4px; cursor: pointer; line-height: 1.45; }
.op-opt input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary, #8b6bff); flex: none; }
.op-qgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
@media (max-width: 640px) { .op-qgrid { grid-template-columns: 1fr; } }
.op-table { width: 100%; font-size: .9rem; margin: 10px 0; }
.op-table th, .op-table td { vertical-align: top; }
.op-conv ul { line-height: 1.7; padding-left: 1.2em; }
@media (max-width: 640px) { .op-table { display: block; overflow-x: auto; } }
