/* =====================================================================
   Labs y controles compartidos (también los usan los ejercicios).
   ===================================================================== */
.lab-sheet { padding-top: var(--space-3); }
.lab-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
@media (max-width: 960px) { .lab-grid { grid-template-columns: 1fr; } }

.lab-controls { display: grid; gap: var(--space-2); margin: 0; }
.lab-field { display: grid; gap: 6px; }
.lab-field[hidden] { display: none; }
.lab-field__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-1); }
.lab-field__label { font: 600 0.75rem/1.2 var(--font-body); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.lab-field__out { font: 500 0.9rem/1 var(--font-mono); color: var(--text); }
.lab-field__hint { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.lab-field__hint code { font-size: 0.8rem; }
.lab-input {
  width: 100%; min-height: 44px; padding: 9px 10px;
  font: 400 0.95rem/1.3 var(--font-body); color: var(--text);
  background: var(--page); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.lab-input--mono, .lab-input--num { font-family: var(--font-mono); font-weight: 500; }
.lab-input--num { max-width: 220px; }
.lab-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.lab-range { width: 100%; min-height: 32px; accent-color: var(--accent); }
.lab-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); }
.lab-buttons { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.lab-buttons .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.lab-given { min-height: 2.4em; padding: 8px 12px; border-left: 3px solid var(--plot-ref); background: var(--page); border-radius: 0 var(--radius) var(--radius) 0; overflow-x: auto; }
.lab-note { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.lab-missing { color: var(--text-muted); }

.lab-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 0.9rem; }
.lab-facts[hidden] { display: none; }
.lab-facts dt { color: var(--text-muted); }
.lab-facts dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.lab-board { margin: 0; display: grid; gap: var(--space-1); min-width: 0; }
.lab-board__title { margin: 0; font-size: 1.05rem; color: var(--text-muted); }
.lab-stage { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
.lab-stage--manim { aspect-ratio: 16 / 10; overflow: hidden; }
.lab-stage--manim canvas { display: block; max-width: 100%; }
.lab-plot { display: block; height: auto; }
.lab-plot .ref, .lab-plot .student, .lab-plot .axis, .lab-plot .trace { fill: none; }
.lab-tick { font: 500 12px var(--font-mono); fill: var(--text-muted); }
.lab-ball { fill: var(--plot-trace); }
.lab-status { margin: 0; font: 400 0.82rem/1.4 var(--font-mono); color: var(--text-muted); min-height: 1.4em; }

.lab-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font: 500 0.8rem/1.3 var(--font-mono); color: var(--text-muted); }
.sw { display: inline-block; width: 22px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 3px solid; }
.sw--ref { border-color: var(--plot-ref); }
.sw--error { border-color: var(--plot-error); }
.sw--student { border-color: var(--plot-student); border-top-style: dashed; }
.sw--trace { border-color: var(--plot-trace); }
.sw--aux { border-color: var(--plot-aux); }

/* ===== Veredicto: estado en texto + color (§5.5) ===== */
.verdict { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); border-left: 4px solid currentColor; }
.verdict[hidden] { display: none; }
.verdict--ok { background: var(--ok-bg); color: var(--ok); }
.verdict--warn { background: var(--warn-bg); color: var(--warn); }
.verdict--bad { background: var(--bad-bg); color: var(--bad); }
.verdict__state { font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.verdict__title { font: 700 1rem/1.3 var(--font-display); }
.verdict__note { margin: 0; color: var(--text); font-size: 0.92rem; }

/* ===== Editor matemático (MathLive) y paleta estilo WebAssign ===== */
.math-input__box math-field, .math-input__box .lab-input { display: block; width: 100%; }
math-field.math-field {
  min-height: 50px; padding: 8px 10px; font-size: 1.3rem;
  color: var(--pen); background: var(--page);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  --caret-color: var(--accent);
  --selection-background-color: var(--accent-soft);
  --selection-color: var(--text);
  --contains-highlight-background-color: var(--accent-soft);
  --placeholder-color: var(--text-muted);
  --primary-color: var(--accent);
  --smart-fence-color: var(--text-muted);
}
math-field.math-field:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
math-field.math-field[read-only] { opacity: 0.85; }
math-field::part(menu-toggle), math-field::part(virtual-keyboard-toggle) { display: none; }
.math-palette { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.math-palette[hidden] { display: none; }
.math-palette__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; min-height: 40px; padding: 0 9px;
  font: 500 0.95rem/1 var(--font-body); color: var(--text);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease;
}
.math-palette__btn:hover { border-color: var(--accent); color: var(--accent); }
.math-palette__btn sup { font-size: 0.7em; line-height: 0; }
.math-palette__kbd { margin-left: auto; font-size: 1.15rem; }
.math-palette.is-locked .math-palette__btn { opacity: 0.45; pointer-events: none; }
.mp-frac { display: inline-flex; flex-direction: column; align-items: center; font-size: 0.72em; line-height: 1.05; }
.mp-frac i { font-style: normal; }
.mp-frac i:first-child { border-bottom: 1px solid currentColor; padding: 0 2px; }
.kbd-close {
  position: fixed; right: 12px; z-index: 200;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  font: 600 0.9rem/1 var(--font-body); color: var(--text);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer;
}
.kbd-close[hidden] { display: none; }
.kbd-close:hover { border-color: var(--accent); color: var(--accent); }
.kbd-close span { font-size: 1.2rem; line-height: 1; }

/* ===== Gráficas de los labs (LabPlot) ===== */
.lab-plot .ref, .lab-plot .aux, .lab-plot .error, .lab-plot .student, .lab-plot .trace, .lab-plot .axis { fill: none; }
.plot-grid { stroke: var(--line); stroke-width: 1; }
.lab-plot .dot-ref { fill: var(--plot-ref); }
.lab-plot .dot-aux { fill: var(--plot-aux); }
.lab-plot .dot-error { fill: var(--plot-error); }
.lab-plot .dot-trace { fill: var(--plot-trace); }
.lab-plot .dot-student { fill: var(--plot-student); }
.lab-plot .area-fill { fill: var(--plot-ref); fill-opacity: 0.18; stroke: none; }
.lab-plot .area-fill--aux { fill: var(--plot-aux); fill-opacity: 0.22; }
.lab-plot .rect-fill { fill: var(--plot-aux); fill-opacity: 0.22; stroke: var(--plot-aux); stroke-width: 1.2; }
.lab-plot .rect-fill--neg { fill: var(--plot-error); stroke: var(--plot-error); }
.lab-stack { display: grid; gap: 4px; }
.lab-stack .lab-plot { width: 100%; height: auto; }
.lab-stack__label { font: 600 0.8rem/1.2 var(--font-mono); color: var(--text-muted); margin: 6px 0 0; }
.sw--dashed { border-top-style: dashed; }
.lab-table-wrap { overflow-x: auto; }
.lab-table { border-collapse: collapse; font-size: 0.88rem; min-width: 280px; }
.lab-table caption { text-align: left; color: var(--text-muted); font-size: 0.82rem; padding-bottom: 4px; }
.lab-table th, .lab-table td { text-align: left; padding: 6px 12px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lab-table th { font-family: var(--font-body); font-weight: 600; color: var(--text-muted); }
.lab-list { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; display: grid; gap: 4px; }

/* ===== Vista 3D del lab de sólidos (solo PC) ===== */
.lab-stage--3d { aspect-ratio: 3 / 2; cursor: grab; }
.lab-stage--3d:active { cursor: grabbing; }
.lab-viewbar[hidden] { display: none; }
.lab-viewbar .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* ===== La gráfica acompaña al scroll =====
   Misma técnica que el circuito del Portfolio: la columna de la gráfica ocupa
   todo el alto de los controles y la gráfica es sticky dentro de ella, así se
   queda a la vista mientras se mueven los controles.
   PC: centrada en el espacio bajo el encabezado (--board-top lo calcula
   LabUI.follow con la altura real de la gráfica; si no cabe, no se fija).
   Móvil: la gráfica va arriba y los controles abajo, sin fijarse ni desplazarse
   (fijarla en teléfono estorbaba más de lo que ayudaba). */
@media (min-width: 961px) {
  .lab-board.is-follow { position: sticky; top: var(--board-top, calc(var(--header-h) + 12px)); align-self: start; }
}
@media (max-width: 960px) {
  .lab-grid > .lab-board { order: -1; }
}

/* fbd-builder: lista de fuerzas con su dirección */
.fbd-forces { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-1) var(--space-2); margin: 0; display: grid; gap: 6px; }
.fbd-row { display: grid; grid-template-columns: minmax(9rem, auto) 1fr; gap: 8px; align-items: center; }
.fbd-row__name { display: flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; }
.fbd-row select { min-width: 0; }
@media (max-width: 560px) { .fbd-row { grid-template-columns: 1fr; } }

/* Labs con dos modos: selector arriba y un panel a la vez */
.lab-mode { max-width: 420px; margin-bottom: var(--space-2); }
.lab-grid[hidden] { display: none; }

/* ---- lab coulomb-check ---- */
.coulomb-table { display: grid; gap: 6px; }
.coulomb-table__row { display: grid; grid-template-columns: 2.2rem repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; }
.coulomb-table__row[hidden] { display: none; }
.coulomb-table__row .lab-input { padding: 8px 6px; min-width: 0; }
.coulomb-table__name { font: 600 0.95rem/1 var(--font-mono); color: var(--text); }
.coulomb-table__head { font: 600 0.8rem/1.2 var(--font-body); color: var(--text-muted); }   /* sin mayúsculas: μ se volvía M */
.coulomb-board, .lab-stage--drag, .pw-stage { -webkit-user-select: none; user-select: none; }   /* arrastrar no selecciona texto */
.coulomb-board .coulomb-charge { cursor: grab; touch-action: none; }
.coulomb-board .coulomb-charge:active { cursor: grabbing; }
.coulomb-board .coulomb-hit { fill: none; stroke: none; pointer-events: all; }

/* ---- lab field-lines ---- */
.lab-controls[hidden] { display: none; }
.lab-stage--drag { touch-action: none; cursor: grab; }
.lab-stage--drag:active { cursor: grabbing; }
.lab-stage--drag:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- lab potential-work ---- */
.pw-stage { touch-action: none; }
.pw-live { font-size: 0.82rem; overflow-wrap: anywhere; }
.pw-details summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }

/* ---- lab tangent-plane ---- */
.tp-cuts { display: grid; gap: var(--space-1); }
.tp-cuts .lab-plot { width: 100%; height: auto; }
@media (min-width: 1200px) { .tp-cuts { grid-template-columns: 1fr 1fr; } }
.tp-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.tp-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.tp-board dt { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .tp-board { grid-template-columns: 1fr; gap: 0; }
  .tp-board dd { margin-bottom: 6px; }
}

/* ---- lab surface-contour ---- */
.sc-wrap { container-type: inline-size; min-width: 0; }
.sc-views { display: grid; gap: var(--space-1); align-items: start; min-width: 0; }
.sc-views .lab-stack { min-width: 0; }
.sc-views .lab-stack__label[hidden] { display: none; }
@container (min-width: 760px) { .sc-views { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }

/* ---- lab coord-convert ---- */
.cc-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-1); }
.cc-row3 .lab-input { min-width: 0; padding: 8px 6px; }
.cc-row3 .lab-field__label { text-transform: none; letter-spacing: 0; font-size: 0.85rem; }   /* sin mayúsculas: ρ se volvía Ρ */
.cc-flat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.cc-flat[hidden] { display: none; }
@media (max-width: 960px) { .cc-flat { grid-template-columns: minmax(0, 1fr); } }
.cc-pane { display: grid; gap: 4px; min-width: 0; }
.cc-3d { touch-action: pan-y; cursor: grab; }
.cc-3d:active { cursor: grabbing; }
.cc-board .cc-handle { cursor: grab; touch-action: none; }
.cc-board .cc-handle:active { cursor: grabbing; }
.cc-board .cc-hit { fill: none; stroke: none; pointer-events: all; }
.cc-board { -webkit-user-select: none; user-select: none; }   /* arrastrar no selecciona texto */

/* ---- lab flux-surface ---- */
.fx-stage { -webkit-user-select: none; user-select: none; }
.fx-stage.fx-drag { touch-action: none; cursor: grab; }
.fx-stage.fx-drag:active { cursor: grabbing; }
.fx-stage .fx-lbl { stroke: var(--panel); stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
.fx-stage .fx-key { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.fx-stage .fx-surf { fill: var(--plot-student); fill-opacity: 0.22; }
.fx-stage .fx-body { fill: var(--plot-trace); fill-opacity: 0.06; stroke: none; }
.fx-stage .fx-face { stroke: var(--plot-axis); stroke-width: 1.4; fill-opacity: 0.2; }
.fx-stage .fx-out { fill: var(--plot-error); }
.fx-stage .fx-in { fill: var(--plot-aux); }
.fx-stage .fx-zero { fill: var(--plot-axis); fill-opacity: 0.1; }
.fx-group { display: grid; gap: var(--space-2); }
.fx-group[hidden] { display: none; }
.fx-live { font-size: 0.82rem; overflow-wrap: anywhere; }
.fx-details summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }

/* ---- lab capacitor-network ---- */
.cn-stage { -webkit-user-select: none; user-select: none; }
.cn-stage .cn-hit { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }
.cn-head { margin: var(--space-2) 0 0; }
.cn-log { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; font-size: 0.85rem; color: var(--text-muted); }
.cn-log:empty { display: none; }
.cn-status { font-size: 0.85rem; }
.cn-details summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }

/* ---- lab capacitor-plates ---- */
.cp-details summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }
.cp-chain { line-height: 2.2; overflow-wrap: anywhere; }
.lab-legend li[hidden] { display: none; }

/* ---- lab directional-derivative ---- */
.dd-board { -webkit-user-select: none; user-select: none; }   /* arrastrar no selecciona texto */
.dd-map .dd-handle { cursor: grab; touch-action: none; }
.dd-map .dd-handle:active { cursor: grabbing; }
.dd-map .dd-hit { fill: none; stroke: none; pointer-events: all; }
.dd-map .dd-lbl { stroke: var(--panel); stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
.dd-cuts { display: grid; gap: var(--space-1); min-width: 0; }
.dd-cuts .lab-stack { min-width: 0; }
.dd-cuts .lab-plot { width: 100%; height: auto; }
@media (min-width: 1200px) { .dd-cuts { grid-template-columns: 1fr 1fr; } }
.dd-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.dd-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.dd-controls .lab-field__label { text-transform: none; letter-spacing: 0; }   /* sin mayúsculas: θ se volvía Θ */
.dd-reto { margin: 0; font-size: 0.95rem; line-height: 1.45; overflow-wrap: anywhere; }

/* ---- lab gradient-field ---- */
.gf-board { -webkit-user-select: none; user-select: none; }   /* arrastrar no selecciona texto */
.gf-stage .gf-handle { cursor: grab; touch-action: none; }
.gf-stage .gf-handle:active { cursor: grabbing; }
.gf-stage .gf-hit { fill: none; stroke: none; pointer-events: all; }
.gf-stage .gf-lbl { font: 600 16px var(--font-mono); fill: var(--text); stroke: var(--panel); stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
.gf-pair[hidden] { display: none; }
.gf-pair .lab-field__label, .gf-one .lab-field__label { text-transform: none; letter-spacing: 0; font-size: 0.85rem; }   /* sin mayúsculas: f_x se volvía F_X */
.gf-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.gf-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.gf-board .sw--axis { border-color: var(--plot-axis); }
.gf-facts dt { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .gf-facts { grid-template-columns: 1fr; gap: 0; }
  .gf-facts dd { margin-bottom: 6px; }
}

/* ---- lab chain-tree ---- */
.ct-steps { margin: var(--space-1) 0 0; padding-left: 1.3rem; display: grid; gap: 6px; font-size: 0.9rem; color: var(--text); }
.ct-steps:empty { display: none; }
.ct-steps li { min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; }

/* ---- lab lagrange-two ---- */
.l2-plots { display: grid; gap: var(--space-1); min-width: 0; }
.l2-plots > div { min-width: 0; }
.l2-plots .lab-plot { width: 100%; height: auto; }
@media (min-width: 1200px) { .l2-plots { grid-template-columns: 1fr 1fr; } }
.l2-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.l2-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.l2-meter { display: flex; align-items: center; gap: var(--space-1); font-size: 0.85rem; }
.l2-meter__track { flex: 1; min-width: 0; height: 10px; border-radius: 5px; background: var(--grid); overflow: hidden; }
.l2-meter__bar { display: block; height: 100%; width: 0; background: var(--plot-error); transition: width 0.15s; }
.l2-meter__txt { flex: none; color: var(--text-muted); }
.l2-board dt { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .l2-board { grid-template-columns: 1fr; gap: 0; }
  .l2-board dd { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { .l2-meter__bar { transition: none; } }

/* ---- lab kirchhoff-signs ---- */
.ks-stage { -webkit-user-select: none; user-select: none; }
.ks-stage .ks-hit { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }
.ks-stage .ks-loop { stroke-opacity: 0.35; }
.ks-head { margin: var(--space-2) 0 0; }
.ks-cur-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-1); }
.ks-terms { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-1); }
.ks-terms:empty { display: none; }
.ks-terms .lab-field__label, .ks-cur-row .lab-field__label, .ks-currents .lab-field__label { text-transform: none; letter-spacing: 0; }
.ks-eq { margin: 0; font-family: var(--font-mono); font-size: 0.95rem; overflow-wrap: anywhere; }
.ks-why { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; font-size: 0.88rem; }
.ks-why:empty { display: none; }
.ks-status { font-size: 0.85rem; }
.ks-details summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }

/* ---- lab kirchhoff-solve ---- */
.kz-stage { -webkit-user-select: none; user-select: none; }
.kz-stage .kz-hit { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }
.kz-head { margin: var(--space-2) 0 0; }
.kz-table { display: grid; grid-template-columns: 2.6em repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; }
.kz-th { font: 600 0.85rem/1.2 var(--font-mono); color: var(--text-muted); text-align: center; }
.kz-th--rhs { white-space: nowrap; }
.kz-rowlab { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.kz-table .kz-cell { width: 100%; min-width: 0; padding: 6px 6px; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.kz-table .kz-cell::-webkit-inner-spin-button, .kz-table .kz-cell::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.kz-eqs { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); overflow-wrap: anywhere; }
.kz-eqs .kz-ok { color: var(--ok); }
.kz-eqs .kz-bad { color: var(--warn); }
.kz-result dd { overflow-wrap: anywhere; font-family: inherit; }
.kz-status { font-size: 0.85rem; }
.kz-details summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }
.lab-legend li.kz-legend-cap[hidden] { display: none; }

/* ---- lab resistor-network ---- */
.rn-stage { -webkit-user-select: none; user-select: none; }
.rn-stage .rn-hit { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }
.rn-head { margin: var(--space-2) 0 0; }
.rn-controls .lab-field__label:not(.rn-head) { text-transform: none; letter-spacing: 0; }   /* sin mayúsculas: ε se volvía E y r, R */
.rn-log { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; font-size: 0.85rem; color: var(--text-muted); overflow-wrap: anywhere; }
.rn-log:empty { display: none; }
.rn-status { font-size: 0.85rem; }
.rn-details summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }

/* ---- lab rc-circuit ---- */
.rc-head { margin: var(--space-2) 0 0; }
.rc-controls .lab-field__label:not(.rc-head) { text-transform: none; letter-spacing: 0; }   /* sin mayúsculas: ε se volvía Ε y τ, Τ */
.rc-data { overflow-wrap: anywhere; }
.rc-facts dd { overflow-wrap: anywhere; }

/* ---- lab polar-element ---- */
.pe-controls .lab-field__label { text-transform: none; letter-spacing: 0; }   /* sin mayúsculas: θ se volvía Θ y f(x, y), F(X, Y) */
.pe-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.pe-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
@media (max-width: 560px) {
  .pe-facts { grid-template-columns: 1fr; gap: 0; }
  .pe-facts dd { margin-bottom: 6px; }
}

/* ---- lab triple-cubes ---- */
.tc-controls .lab-field__label { text-transform: none; letter-spacing: 0; }   /* sin mayúsculas: ρ(x, y, z) se volvía Ρ(X, Y, Z) */
.tc-views { display: grid; gap: var(--space-1); }
.tc-views .lab-plot { width: 100%; height: auto; }
@media (min-width: 1200px) { .tc-views { grid-template-columns: 1fr 1fr; } }
.tc-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.tc-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.tc-board dt { overflow-wrap: anywhere; }
.tc-board dd { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .tc-board { grid-template-columns: 1fr; gap: 0; }
  .tc-board dd { margin-bottom: 6px; }
}
.lab-plot .tc-lbl { fill: var(--text); stroke: var(--panel); stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; font-weight: 600; }
.lab-plot .tc-face { stroke: var(--plot-aux); stroke-width: 0.8; stroke-linejoin: round; fill: var(--plot-aux); }
.lab-plot .tc-face--z { fill-opacity: 0.55; }
.lab-plot .tc-face--x { fill-opacity: 0.4; }
.lab-plot .tc-face--y { fill-opacity: 0.25; }
.lab-plot .tc-face.tc-cube--row { fill: var(--plot-trace); stroke: var(--plot-trace); }
.lab-plot .tc-cell--row { fill: var(--plot-trace); stroke: var(--plot-trace); fill-opacity: 0.3; }

/* ---- lab region-order ---- */
.lab-plot .ro-extra { fill: var(--plot-error); fill-opacity: 0.38; stroke: none; }
.lab-plot .ro-miss { fill: var(--plot-trace); fill-opacity: 0.3; stroke: none; }
.ro-sw { display: inline-block; width: 18px; height: 12px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.ro-sw--extra { background: var(--plot-error); opacity: 0.55; }
.ro-sw--miss { background: var(--plot-trace); opacity: 0.4; }
.ro-sw--cm { width: 12px; height: 12px; border-radius: 50%; background: var(--plot-error); }
.ro-piece { display: grid; gap: var(--space-1); }
.ro-piece[hidden] { display: none; }
.ro-check { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; cursor: pointer; }
.ro-written[hidden] { display: none; }
.ro-tex { margin: 0; overflow-x: auto; }

/* ---- lab double-riemann ---- */
.dr-controls .lab-field__label { text-transform: none; letter-spacing: 0; }   /* sin mayúsculas: f(x, y) se volvía F(X, Y) */
.dr-views { display: grid; gap: var(--space-1); }
.dr-views > div { min-width: 0; }
.dr-views .lab-plot { width: 100%; height: auto; }
.dr-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.dr-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.dr-board dt { overflow-wrap: anywhere; }
.dr-board dd { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .dr-board { grid-template-columns: 1fr; gap: 0; }
  .dr-board dd { margin-bottom: 6px; }
}

/* ---- lab spherical-element ---- */
.se-controls .lab-field__label { text-transform: none; letter-spacing: 0; }   /* sin mayúsculas: δ(x, y, z) y ρ no cambian */
.se-views { display: grid; gap: var(--space-1); }
.se-views > div { min-width: 0; }
.se-views .lab-plot { width: 100%; height: auto; }
@media (min-width: 1200px) { .se-views { grid-template-columns: 1fr 1fr; } }
.se-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.se-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.se-board dt { overflow-wrap: anywhere; }
.se-board dd { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .se-board { grid-template-columns: 1fr; gap: 0; }
  .se-board dd { margin-bottom: 6px; }
}
.lab-plot .se-cell { fill: var(--plot-trace); fill-opacity: 0.16; stroke: var(--plot-trace); stroke-width: 0.8; stroke-opacity: 0.6; stroke-linejoin: round; }
.lab-plot .se-cell2 { fill: var(--plot-trace); fill-opacity: 0.32; stroke: var(--plot-trace); stroke-width: 2; }
