/* ============================================================
 * theme.css — TEMA de la guía de las LEYES DE NEWTON (capa LIBRE).
 * Leyenda de color de fuerzas, dibujos newtSVG y los widgets por toque
 * (simulador-fma / constructor-dcl / detector-pares / que-ley-es).
 * Andamiaje en assets/guia-components.css; variables --guia-*.
 * Colores semánticos: aplicada = navy · neta = naranja profundo ·
 * fricción = rojo ladrillo · peso = tinta · normal = azul.
 * Pisos de letra: lectura ≥17 · apoyo ≥15 · MAYÚSCULAS ≥13.
 * ============================================================ */

/* ===== Hero: las 3 leyes en 30 segundos + saltos ===== */
.guia-reassure { font-size: 15px; line-height: 1.5; color: var(--guia-muted); margin: 2px 0 0; }
.newt-resumen30 { display: grid; gap: 8px; background: #fff; border: 1.5px solid var(--guia-line); border-radius: 14px; padding: 14px 16px; }
.newt-resumen30 h2 { margin: 0; font-size: 17px; }
.newt-resumen30 p { margin: 0; font-size: 16px; line-height: 1.55; }
.newt-resumen30 p b { font-weight: 800; }
.newt-saltos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.newt-saltos a { font-size: 15px; font-weight: 700; color: var(--guia-deep); text-decoration: none; border: 2px solid var(--guia-line); border-radius: 999px; padding: 5px 13px; background: var(--guia-cream); }
.newt-saltos a:hover { border-color: var(--guia-ink); }

/* ===== Leyenda de color de fuerzas ===== */
.newt-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; background: #fff; border: 1.5px solid var(--guia-line); border-radius: 12px; padding: 10px 14px; font-size: 15px; font-weight: 600; }
.newt-legend .it { display: flex; gap: 7px; align-items: center; }
.newt-legend .it b { font-weight: 800; }
.newt-legend .sw { width: 17px; height: 17px; border-radius: 4px; flex: 0 0 auto; }
.newt-legend .sw.apl { background: rgba(40, 56, 145, .16); border: 2px solid var(--guia-navy); }
.newt-legend .sw.net { background: rgba(199, 93, 8, .18); border: 2px solid var(--guia-deep); }
.newt-legend .sw.fri { background: rgba(163, 59, 46, .14); border: 2px solid #A33B2E; }
.newt-legend .sw.pes { background: rgba(24, 27, 34, .12); border: 2px solid var(--guia-ink); }
.newt-legend .sw.nrm { background: rgba(43, 125, 184, .14); border: 2px solid #2B7DB8; }

/* ===== Dibujo estático (SVG) ===== */
.newt-visual { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 2px 0; }
.newt-visual .vcap { font-size: 15px; font-weight: 700; color: var(--guia-muted); text-align: center; max-width: 46ch; }
/* Ancho RESUELTO (viewBox + max-width): el dibujo nunca colapsa a "astilla". */
.newt-svg { width: 100%; max-width: 320px; height: auto; display: block; }

/* Dibujo dentro de un ejercicio (guiado/serie): más compacto */
.guia-pitem .newt-visual { align-items: flex-start; margin: 8px 0 4px; }
.guia-pitem .newt-visual .vcap { text-align: left; font-size: 15px; }
.guia-pitem .newt-svg { max-width: 230px; }
.guia-serie-grid .newt-svg { max-width: 200px; }
/* En móvil (una sola columna) los dibujos de ejercicio usan todo el ancho:
 * el texto del SVG gana tamaño efectivo (piso de letra en pantallas chicas). */
@media (max-width: 540px) {
  .guia-pitem .newt-svg, .guia-serie-grid .newt-svg { max-width: 320px; }
}

/* ===== Caja común de los widgets por toque ===== */
.newt-sim, .newt-dcl, .newt-pares, .newt-leyes { display: grid; gap: 12px; padding: 16px; border: 2px solid var(--guia-ink); border-radius: 14px; background: var(--guia-cream); }
.newt-lab-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.newt-flag { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--guia-orange); border: 2px solid var(--guia-ink); border-radius: 999px; padding: 3px 11px; }
.newt-inst { font-size: 15px; font-weight: 700; color: var(--guia-deep); }
.newt-sim-stage { text-align: center; overflow: hidden; }
.newt-sim-stage .newt-svg { margin: 0 auto; max-width: 330px; }

/* ===== Widget ① simulador-fma ===== */
.newt-track { display: inline-block; }
.newt-track.moving { animation: newt-slide linear infinite; }
@keyframes newt-slide {
  0% { transform: translateX(-14px); }
  60% { transform: translateX(16px); }
  100% { transform: translateX(-14px); }
}
@media (prefers-reduced-motion: reduce) { .newt-track.moving { animation: none; } }

.newt-read { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-height: 1.6em; }
.newt-eq { font-size: 23px; font-weight: 800; color: var(--guia-ink); letter-spacing: .01em; }
.newt-eq.sub { font-size: 17px; color: var(--guia-muted); }
.newt-eq .lh { padding: 1px 8px; border-radius: 8px; }
/* Regla CSS+KaTeX: fondo de píldora solo en `> span` (hijo directo) */
.newt-eq > span.lh.net { background: rgba(199, 93, 8, .16); color: var(--guia-deep); }
.newt-eq > span.lh.apl { background: rgba(40, 56, 145, .14); color: var(--guia-navy); }
.newt-eq > span.lh.good { background: rgba(28, 122, 58, .14); color: var(--guia-green-deep); }
.newt-eq-note { font-size: 15px; line-height: 1.5; font-weight: 600; color: var(--guia-deep); max-width: 48ch; }
.newt-eq-note.ok { color: var(--guia-green-deep); }
.newt-eq-note b { font-weight: 800; color: var(--guia-ink); }
.newt-eq-note b.apl { color: var(--guia-navy); }

.newt-ctrl-rows { display: grid; gap: 8px; }
.newt-ctrl { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
/* − / valor / + viajan SIEMPRE juntos en una fila (clave a 360px): si algo
 * tiene que envolver, envuelven los presets, nunca el stepper. */
.newt-stepper { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
/* En pantallas angostas la etiqueta toma su propia línea: el stepper completo
 * (− / valor / +) cabe entonces en UNA fila a 360px. */
@media (max-width: 540px) {
  .newt-ctrl { justify-content: flex-start; }
  .newt-ctrl-lbl { flex: 1 0 100%; min-width: 0; text-align: left; }
}
.newt-ctrl-lbl { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; min-width: 72px; text-align: right; color: var(--guia-ink); }
.newt-ctrl-lbl.apl { color: var(--guia-navy); }
.newt-ctrl-lbl.fri { color: #A33B2E; }
.newt-val { font-size: 20px; font-weight: 800; color: var(--guia-ink); min-width: 56px; text-align: center; }
.newt-btn { font: inherit; font-weight: 800; font-size: 18px; min-width: 48px; padding: 8px 14px; border: 2px solid var(--guia-ink); border-radius: 10px; background: #fff; color: var(--guia-ink); cursor: pointer; box-shadow: 2px 2px 0 var(--guia-ink); transition: transform .1s, box-shadow .1s; }
.newt-btn.mini { min-width: 56px; padding: 8px 12px; font-size: 15px; }
.newt-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--guia-ink); }
.newt-btn:active { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--guia-ink); }
.newt-btn.on { background: rgba(28, 122, 58, .14); border-color: var(--guia-green-deep); color: var(--guia-green-deep); box-shadow: 2px 2px 0 var(--guia-green-deep); }
.newt-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.newt-toggle { font: inherit; font-weight: 800; font-size: 15px; padding: 8px 16px; border: 2px solid var(--guia-ink); border-radius: 999px; background: #fff; color: var(--guia-ink); cursor: pointer; box-shadow: 2px 2px 0 var(--guia-ink); }
.newt-toggle.on { background: rgba(163, 59, 46, .12); border-color: #A33B2E; color: #A33B2E; box-shadow: 2px 2px 0 #A33B2E; }

/* ===== Widgets ②③④: escenas, chips y veredicto ===== */
.newt-scene-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.newt-scene-tag { margin: 0; font-size: 16px; font-weight: 700; color: var(--guia-ink); text-align: center; }
.newt-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.newt-chips.center { justify-content: center; }
.newt-chip { font: inherit; font-weight: 700; font-size: 16px; text-align: left; padding: 10px 14px; border: 2px solid var(--guia-ink); border-radius: 10px; background: #fff; color: var(--guia-ink); cursor: pointer; box-shadow: 2px 2px 0 var(--guia-ink); transition: transform .1s, box-shadow .1s; }
.newt-chip small { font-size: 13px; font-weight: 600; color: var(--guia-muted); }
.newt-chip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--guia-ink); }
.newt-chip.on { background: rgba(28, 122, 58, .14); border-color: var(--guia-green-deep); color: var(--guia-green-deep); box-shadow: 2px 2px 0 var(--guia-green-deep); }
.newt-chip.on small { color: var(--guia-green-deep); }
.newt-chip.sel { background: rgba(40, 56, 145, .1); border-color: var(--guia-navy); color: var(--guia-navy); box-shadow: 2px 2px 0 var(--guia-navy); }
.newt-chip.off { background: rgba(160, 18, 67, .08); border-color: #A01243; color: #A01243; box-shadow: 2px 2px 0 #A01243; }
.newt-chip:disabled { cursor: default; }
.newt-chip:disabled:not(.on) { opacity: .55; }
.newt-chip.ley { font-size: 17px; }

.newt-why { margin: 0; font-size: 15px; line-height: 1.5; font-weight: 600; color: var(--guia-green-deep); min-height: 1.5em; opacity: 0; transition: opacity .15s; }
.newt-why.show { opacity: 1; }
.newt-why.bad { color: #A01243; }
.newt-why b { font-weight: 800; }

.newt-verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1.5px solid var(--guia-line); border-radius: 12px; padding: 10px 14px; }
.newt-pill { font-size: 15px; font-weight: 800; letter-spacing: .04em; padding: 3px 14px; border-radius: 999px; border: 2px solid; background: #fff; }
.newt-pill.eq { color: var(--guia-green-deep); border-color: var(--guia-green-deep); }
.newt-pill.mov { color: var(--guia-deep); border-color: var(--guia-deep); }
.newt-verdict-cuenta { font-size: 19px; font-weight: 800; color: var(--guia-ink); }
.newt-verdict-note { font-size: 15px; line-height: 1.5; font-weight: 600; color: var(--guia-muted); flex: 1 1 24ch; }

.newt-pares-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.newt-count { font-size: 15px; font-weight: 700; color: var(--guia-muted); }

/* ===== Impresión: oculta los widgets interactivos ===== */
@media print {
  .newt-sim, .newt-dcl, .newt-pares, .newt-leyes { display: none !important; }
}
