/* ============================================================================
   MÓVIL — controles flotantes, hojas inferiores y asistente (movil.js)
   ----------------------------------------------------------------------------
   Solo en #app[data-form="phone"] (las hojas y el asistente viven en
   #m-sheets y también funcionan si otro módulo los abre fuera del teléfono).
   Medidas de iOS 26: botones de vidrio de 44, cápsulas de 44, paleta y barra
   de pasos de 62 a 34 + 8 px del borde inferior, hojas con radio 34.
     --m-st / --m-sb   franjas libres arriba (54) y abajo (34), o el área
                       segura del equipo si es mayor
     --m-top-h         alto ocupado por los controles de arriba (la hoja de
                       solución y la ayuda empiezan debajo)
     --m-bottom-h      alto ocupado por los controles de abajo
   ========================================================================== */

#app {
  --m-st: max(env(safe-area-inset-top, 0px), 54px);
  --m-sb: max(env(safe-area-inset-bottom, 0px), 34px);
  --m-sl: env(safe-area-inset-left, 0px);
  --m-sr: env(safe-area-inset-right, 0px);
}
#app[data-form="phone"] { --m-top-h: calc(var(--m-st) + 96px); --m-bottom-h: calc(var(--m-sb) + 138px); }
#app[data-form="phone"][data-mode="ayuda"] { --m-top-h: calc(var(--m-st) + 48px); }

#m-top, #m-bottom { display: none; }
/* los hijos directos son franjas que el lienzo mide para encuadrar la viga */
#app[data-form="phone"] #m-top, #app[data-form="phone"] #m-bottom { display: contents; }
.mv-probe { position: fixed; top: 0; left: 0; width: 0; height: var(--m-st); visibility: hidden; pointer-events: none; }

/* ----------------------------------------------- vistas de otros módulos */
#app[data-form="phone"] #ws { padding: 0; scroll-padding-top: calc(var(--m-top-h) + 8px); scroll-padding-bottom: calc(var(--m-bottom-h) + 8px); }
#app[data-form="phone"] .sh-ro { top: calc(var(--m-st) + 100px); }
#app[data-form="phone"] #toast { bottom: calc(var(--m-sb) + 132px); max-width: calc(100vw - 32px); }
/* el aviso queda sobre la hoja abierta (o el dibujo): los toques pasan a través
   de su texto, así no se queda con el de un campo o un botón que tapa («Se
   invirtió la forma…» sobre Sentido y Hasta en Propiedades); su botón
   («Deshacer», «Viga», «Datos») sí los recibe                              */
#app[data-form="phone"] #toast { pointer-events: none; }
#app[data-form="phone"] #toast button { pointer-events: auto; }

/* =========================================================== BOTONES BASE */
.mv-circ {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22px; color: var(--ink);
}
.mv-circ:disabled { color: var(--ink3); }
.mv-circ:disabled .ic { opacity: .7; }
.mv-circ:active:not(:disabled), .mv-cap:active { filter: brightness(.94); }
.mv-cap {
  justify-self: center; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; max-width: 100%; height: 44px; padding: 0 16px; border: 0; border-radius: 22px; color: var(--ink);
}
.mv-cap-t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 18px; font-weight: 600; }
.mv-cap-s { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 16px; color: var(--ink2); }

/* ====================================================== CONTROLES DE ARRIBA */
.mv-bar {
  position: absolute; z-index: 30; top: var(--m-st); left: calc(16px + var(--m-sl)); right: calc(16px + var(--m-sr));
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; align-items: center; column-gap: 8px; height: 44px;
  pointer-events: none;
}
.mv-bar button, .mv-bar .mv-cap { pointer-events: auto; }
.mv-l, .mv-r { display: flex; gap: 8px; }
.mv-r { justify-content: flex-end; }

.mv-seg {
  position: absolute; z-index: 30; top: calc(var(--m-st) + 52px); left: 50%; width: 240px; margin-left: -120px; height: 36px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 2px; border-radius: 18px;
}
.mv-seg > button { display: flex; align-items: center; height: 44px; margin: -6px 0; padding: 0; border: 0; background: transparent; color: var(--ink); }
.mv-seg > button > span { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; height: 32px; border-radius: 16px; font-size: 13px; font-weight: 500; }
.mv-seg > button[aria-pressed="true"] > span { background: var(--raised); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); font-weight: 600; }

/* La franja del aviso mide siempre 44 px (lo que mide el lienzo para encuadrar):
   la cápsula es de 32 con una línea y crece a 44 cuando el texto y «Listo» no
   caben en una (p. ej. «Toca donde empieza la viga y luego donde termina»), sin
   que la viga salte al cambiar de herramienta. */
.mv-hint {
  position: absolute; z-index: 29; top: calc(var(--m-st) + 100px); left: 16px; right: 16px; height: 44px;
  display: flex; align-items: flex-start; justify-content: center; pointer-events: none;
}
.mv-hint-c {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; min-height: 32px; max-height: 44px; padding: 6px 12px;
  border-radius: 22px; font-size: 13px; line-height: 16px; color: var(--ink2);
}
.mv-hint-c.has-end { padding-right: 4px; }
.mv-hint-c > p { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; }
.mv-hint-c > p > span { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.mv-hint-c > p > .ic { flex: none; color: var(--ink2); }
/* «Listo»: la única parte del aviso que recibe toques; 24 px a la vista, 44 al dedo */
.mv-hint-end {
  position: relative; flex: none; height: 24px; margin: -2px 0; padding: 0 10px; border: 0; border-radius: 12px; pointer-events: auto;
  background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; line-height: 24px;
}
.mv-hint-end::before { content: ""; position: absolute; top: -10px; bottom: -10px; left: -6px; right: -6px; }
.mv-hint-end:active { background: var(--fill2); }
.mv-hint.is-ghost { visibility: visible; opacity: 0; }
.mv-hint.is-ghost > .mv-hint-c { height: 44px; }

/* ====================================================== CONTROLES DE ABAJO */
.mv-chips {
  position: absolute; z-index: 30; left: calc(16px + var(--m-sl)); right: calc(16px + var(--m-sr)); bottom: calc(var(--m-sb) + 78px);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; pointer-events: none;
}
.mv-chips > * { pointer-events: auto; }
.mv-chip {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 36px; margin: 0; padding: 0 14px;
  border-radius: 18px; font-size: 13px; color: var(--ink); white-space: nowrap;
}
.mv-chip b { font-weight: 600; }
.mv-chip-m { color: var(--ink2); }
.mv-chip .ic { color: var(--ink2); }
.mv-chip.is-bad { color: var(--red-text); }
.mv-chip.is-bad .ic { color: var(--red-text); }
.mv-gh { pointer-events: none; }
.mv-chipbtn { display: flex; align-items: center; min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); }
.mv-chipbtn > .mv-chip { padding: 0 10px 0 14px; font-weight: 500; }
.mv-chipbtn:active > .mv-chip { filter: brightness(.94); }

.mv-dock {
  position: absolute; z-index: 30; left: calc(16px + var(--m-sl)); right: calc(16px + var(--m-sr)); bottom: calc(var(--m-sb) + 8px);
  display: flex; gap: 8px; height: 62px;
}
.mv-pal { flex: 1 1 auto; display: flex; min-width: 0; height: 62px; padding: 4px; border-radius: 31px; }
.mv-pal > button {
  flex: 1 1 0; min-width: 0; height: 54px; padding: 0; border: 0; border-radius: 27px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: transparent; color: var(--ink); font-size: 10px; line-height: 12px; font-weight: 500;
}
.mv-pal > button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-pal > button[aria-pressed="true"] { background: var(--fill); color: var(--accent-text); font-weight: 600; }
.mv-pal > button[aria-expanded="true"] { background: var(--fill); }
.mv-pal > button[aria-disabled="true"] { color: var(--ink2); }
.mv-pal > button[aria-disabled="true"] .ic { opacity: .55; }
.mv-solve {
  flex: none; display: flex; align-items: center; justify-content: center; width: 62px; height: 62px; padding: 0; border: 0; border-radius: 31px;
  background: var(--accent-fill); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 .5px var(--glass-line), var(--float);
}
.mv-solve:active { filter: brightness(1.08); }
.mv-solve .ic { margin-left: 3px; }
.mv-solve.is-ver .ic { margin-left: 0; }   /* «Ver paso a paso»: la hoja, centrada */
.mv-solve[aria-disabled="true"] { background: var(--fill2); color: var(--ink2); box-shadow: 0 0 0 .5px var(--glass-line); }   /* sin viga */

.mv-steps { flex: 1 1 auto; display: grid; grid-template-columns: 54px minmax(0, 1fr) 54px; align-items: center; min-width: 0; height: 62px; padding: 4px; border-radius: 31px; }
.mv-steps > button { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 27px; background: transparent; color: var(--ink); }
.mv-steps > button:active:not(:disabled) { background: var(--fill); }
.mv-steps > button:disabled { color: var(--ink3); }
.mv-steps-c { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.mv-steps-t { font-size: 15px; line-height: 20px; font-weight: 600; }
.mv-steps-s { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 16px; color: var(--ink2); }
.mv-steps-s i { font-family: var(--math); font-size: 13px; }
.mv-steps-s sub { font-size: .75em; line-height: 0; }

.mv-fade { position: absolute; z-index: 29; left: 0; right: 0; bottom: 0; height: calc(var(--m-sb) + 138px); background: linear-gradient(to bottom, transparent, var(--desk) 55%); pointer-events: none; }
.mv-pad { position: absolute; left: 0; right: 0; bottom: 0; opacity: 0; pointer-events: none; }

/* ============================================ SELECTOR DE TIPO (paleta) */
.mv-pop { position: fixed; z-index: 66; min-width: 220px; padding: 6px; border-radius: 22px; }
.mv-pop-h { margin: 0; padding: 6px 12px 4px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.mv-pop > button {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 20px; align-items: center; column-gap: 12px; width: 100%; height: 48px;
  padding: 0 12px; border: 0; border-radius: 16px; background: transparent; color: var(--ink); font-size: 17px; text-align: left;
}
.mv-pop > button:active, .mv-pop > button:focus-visible { background: var(--fill); outline: none; }
.mv-pop > button[aria-checked="true"] { color: var(--accent-text); font-weight: 600; }
.mv-pop-ic { display: flex; justify-content: center; }
.mv-pop-ck { display: flex; color: var(--accent-text); }

/* ================================================================= HOJAS */
.mv-scrim { position: fixed; inset: 0; z-index: 64; background: var(--backdrop); transition: opacity .28s ease; }
.mv-scrim.is-enter, .mv-scrim.is-off { opacity: 0; }
.mv-scrim.is-off { pointer-events: none; }
.mv-sheet {
  position: fixed; z-index: 65; left: 0; right: 0; bottom: 0; top: 124px;
  display: flex; flex-direction: column; border-radius: 34px 34px 0 0; color: var(--ink);
  transition: transform .34s cubic-bezier(.2, .8, .2, 1), top .34s cubic-bezier(.2, .8, .2, 1);
  will-change: transform; font-size: 17px; line-height: 22px;
}
.mv-sheet.is-enter { transform: translateY(100%); }
.mv-sheet.is-drag, .mv-sheet.is-measure { transition: none; }
.mv-sheet.is-measure { visibility: hidden; }
.mv-sh-top { flex: none; position: relative; padding: 16px 16px 0; touch-action: none; cursor: grab; }
.mv-grab { position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 2.5px; background: var(--ink3); }
.mv-sh-h { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 8px; height: 44px; }
.mv-sh-h > :first-child { justify-self: start; }
.mv-sh-title { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none; }
/* Datos | Propiedades: segmentado de 36 px en el centro de la cabecera (44 al dedo) */
.mv-sh-h.has-tabs { grid-template-columns: auto minmax(0, 1fr) auto; }
.mv-tabs {
  justify-self: center; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 248px; height: 36px;
  padding: 2px; border-radius: 18px; background: var(--fill);
}
.mv-tabs > button { display: flex; align-items: center; min-width: 0; height: 44px; margin: -6px 0; padding: 0; border: 0; border-radius: 16px; background: transparent; color: var(--ink); }
.mv-tabs > button > span {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-width: 0; height: 32px; padding: 0 6px; border-radius: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500;
}
.mv-tabs > button[aria-selected="true"] > span { background: var(--raised); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); font-weight: 600; }
.mv-done {
  justify-self: end; height: 44px; padding: 0 20px; border: 0; border-radius: 22px;
  background: var(--accent-fill); color: #fff; font-size: 17px; font-weight: 600; box-shadow: var(--float);
}
.mv-done:active { filter: brightness(1.08); }
.mv-sh-b { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--m-sb) + 16px); }
.mv-sheet.is-measure .mv-sh-b { flex: none; }
.mv-stack { display: flex; flex-direction: column; gap: 24px; padding-top: 16px; }
.mv-stack > .mv-sec, .mv-namebox { padding: 0 16px; }
.mv-lists .pn-m { padding-top: 0; }
.mv-insp .pn-m { padding-top: 0; }

/* secciones y listas agrupadas (mismo aspecto que las de paneles.js) */
.mv-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mv-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 0 16px; }
.mv-sec-h h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; }
.mv-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--fill); color: var(--ink2); font-size: 12px; font-weight: 600; }
.mv-link { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--accent-text); font-size: 15px; font-weight: 500; }
.mv-namecard {
  display: block; height: 44px; margin: 0; padding: 0 16px; border-radius: 22px; background: var(--raised);
  box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0, 0, 0, .04); font-size: 17px; line-height: 44px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mv-card { border-radius: 22px; overflow: hidden; background: var(--raised); box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0, 0, 0, .04); }
.mv-foot { margin: 0; padding: 0 16px; font-size: 13px; line-height: 18px; color: var(--ink2); }
.mv-foot i, .mv-row small i { font-family: var(--math); }
.mv-foot-17 { font-size: 15px; line-height: 20px; }
.mv-ink { color: var(--ink); }
.mv-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.mv-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 16px;
  border: 0; background: transparent; color: var(--ink); font-size: 17px; line-height: 22px; text-align: left; text-decoration: none;
}
.mv-row.two { min-height: 56px; }
.mv-card > .mv-row + .mv-row::before, .mv-card > .mv-wz-row + .mv-wz-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep);
}
.mv-card > .mv-row.has-ic + .mv-row::before, .mv-card > .mv-row + .mv-row.has-ic::before { left: 56px; }
button.mv-row:active, a.mv-row:active { background: var(--sel); }
button.mv-row:disabled { color: var(--ink3); }
button.mv-row:disabled .mv-row-ic { color: var(--ink3); }
.mv-row.danger { color: var(--red-text); }
.mv-row.danger .mv-row-ic { color: var(--red-text); }
.mv-row-ic { flex: none; display: flex; align-items: center; justify-content: center; width: 28px; color: var(--accent-text); }
.mv-row-t { flex: 1 1 auto; min-width: 0; }
.mv-row-t small { display: block; font-size: 13px; line-height: 18px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-row-ck { flex: none; display: flex; width: 20px; color: var(--accent-text); }
.mv-row-chev { flex: none; display: flex; color: var(--ink2); }
.mv-row[role="radio"][aria-checked="true"] .mv-row-t { font-weight: 600; }
.mv-row[role="radio"][aria-checked="true"] .mv-row-t small { font-weight: 400; }
.mv-row-seg .mv-row-t { flex: 0 0 auto; }
.mv-mseg { flex: 1 1 auto; min-width: 0; max-width: 240px; margin-left: auto; }
/* Salviati en un marco o una armadura (aria-disabled): atenuado; tocarlo avisa */
.mv-mseg > button[aria-disabled="true"] { opacity: .45; }
.mv-mseg > button { padding: 0 6px; min-width: 0; font-size: 13px; }
.mv-mseg > button[aria-disabled="true"] { color: var(--ink3); }   /* Fracción sin nada que convertir */
/* segmentados (32 px) e interruptores (31 px) de iOS en las hojas (también los de
   las listas e inspector del teléfono): el dibujo no cambia, pero el área que
   responde al dedo llega a 44 px de alto (sus filas miden 44–56) */
#m-sheets .m-seg > button { position: relative; }
#m-sheets .m-seg > button::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
#m-sheets .m-switch::before { content: ""; position: absolute; top: -7px; bottom: -7px; left: -4px; right: -4px; }
.mv-row-stack { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.mv-row-stack .mv-mseg { max-width: none; margin-left: 0; }
.mv-mseg-6 > button { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mv-acc { color: var(--accent-text); }

/* ==================================================== ASISTENTE PASO A PASO */
.mv-wiz {
  position: fixed; inset: 0; z-index: 60; overflow: hidden; color: var(--ink); font-size: 17px; line-height: 22px;
  background-color: var(--canvas);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 12px 12px; background-position: 40px 0;
}
.mv-wz-prev {
  position: absolute; top: calc(var(--m-st) + 102px); left: 0; right: 84px; height: 152px;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.mv-wz-prev svg { display: block; overflow: visible; }
.mv-wz-prevtxt { margin: 0; padding: 0 16px; font-size: 15px; color: var(--ink2); text-align: center; }
.mv-wz-units { position: absolute; top: calc(var(--m-st) + 102px); right: calc(16px + var(--m-sr)); }
.mv-wz-nav {
  position: absolute; top: var(--m-st); left: calc(16px + var(--m-sl)); right: calc(16px + var(--m-sr)); height: 44px;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; column-gap: 8px; align-items: center;
}
.mv-wz-stages {
  position: absolute; top: calc(var(--m-st) + 52px); left: calc(16px + var(--m-sl)); right: calc(16px + var(--m-sr)); height: 44px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 8px; padding: 0 16px; border-radius: 22px;
}
.mv-wz-stages > button { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; text-align: left; }
.mv-wz-bar { display: block; height: 4px; border-radius: 2px; background: var(--fill2); }
.mv-wz-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 16px; color: var(--ink2); }
.mv-wz-stages > .is-done .mv-wz-bar { background: var(--accent); }
.mv-wz-stages > .is-cur .mv-wz-bar { background: linear-gradient(90deg, var(--accent) 50%, var(--fill2) 50%); }
.mv-wz-stages > .is-cur .mv-wz-lbl { color: var(--ink); font-weight: 600; }

.mv-wz-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--m-st) + 254px);
  display: flex; flex-direction: column; border-radius: 34px 34px 0 0;
}
.mv-wz-scroll {
  flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 12px; padding: 20px 16px 16px;
}
.mv-wz-title { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; height: 34px; }
.mv-wz-title h1 { margin: 0; font-family: var(--disp); font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: .005em; outline: none; }
.mv-wz-title span { font-size: 15px; line-height: 20px; color: var(--ink2); white-space: nowrap; }
.mv-wz-q { margin: 4px 0 0; font-size: 17px; line-height: 20px; font-weight: 600; }
.mv-wz-q i { font-family: var(--math); font-weight: 500; }
.mv-wz-grp { display: flex; flex-direction: column; gap: 8px; }
.mv-wz-full { flex: none; max-width: none; margin: 0; }

.mv-wz-tiles { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mv-wz-tiles.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mv-wz-tiles > button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 72px; padding: 0 4px;
  border: 0; border-radius: 16px; background: var(--raised); box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0, 0, 0, .04);
  color: var(--ink); font-size: 13px; line-height: 16px; font-weight: 500;
}
.mv-wz-tiles > button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-wz-tiles > button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-text); font-weight: 600; }

.mv-wz-chips { flex: none; display: flex; gap: 8px; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.mv-wz-chips::-webkit-scrollbar { display: none; }
.mv-wz-chips > button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; margin: 4px 0; padding: 0 14px; border: 0; border-radius: 18px;
  background: var(--raised); box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0, 0, 0, .04); color: var(--ink); font-size: 15px; white-space: nowrap;
}
.mv-wz-chips > button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-text); font-weight: 600; }
.mv-wz-chips > button .math { font-size: 17px; }
.mv-wz-chips > button sub { font-size: .7em; line-height: 0; }
.mv-wz-chips > button.mv-defl .math { color: var(--defl); }
.mv-wz-chips .bubble { min-width: 22px; height: 22px; border-radius: 11px; font-size: 15px; }
.mv-wz-n { color: var(--ink2); font-variant-numeric: tabular-nums; }

.mv-wz-card { flex: none; }
.mv-wz-row {
  position: relative; display: grid; grid-template-columns: 108px minmax(0, 1fr); column-gap: 12px; align-items: center;
  min-height: 56px; padding: 6px 16px; font-size: 17px; line-height: 22px;
}
.mv-wz-row > label, .mv-wz-row > span { min-width: 0; }
.mv-wz-row i { font-family: var(--math); font-size: 18px; }
.mv-wz-row sub { font-family: var(--math); font-size: 11px; line-height: 0; }
.mv-wz-row.is-sw { grid-template-columns: minmax(0, 1fr) auto; }
.mv-wz-row-stack { grid-template-columns: minmax(0, 1fr); row-gap: 8px; padding-top: 10px; padding-bottom: 12px; }
.mv-wz-row-stack .mv-mseg { max-width: none; margin: 0; }
.mv-wz-ctl { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.mv-wz-in {
  flex: 0 1 auto; width: 72px; min-width: 0; height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--fill);
  color: var(--ink); font-family: var(--mono); font-size: 17px; text-align: right; outline: none;
}
.mv-wz-in.is-wide { width: auto; flex: 1 1 auto; }
.mv-wz-in:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.mv-wz-in.is-error { box-shadow: inset 0 0 0 1.5px var(--red); }
.mv-wz-u { flex: none; font-size: 15px; line-height: 20px; color: var(--ink2); white-space: nowrap; }
.mv-wz-sel {
  flex: none; -webkit-appearance: none; appearance: none; height: 36px; padding: 0 12px; border: 0; border-radius: 10px;
  background: var(--fill); color: var(--ink); font-size: 15px;
}
.mv-wz-sel:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.mv-wz-stp { flex: none; display: flex; height: 44px; }
.mv-wz-stp > button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); }
.mv-wz-stp > button > span { display: grid; place-items: center; width: 44px; height: 36px; background: var(--fill); }
.mv-wz-stp > button:first-child > span { border-radius: 18px 0 0 18px; }
.mv-wz-stp > button:last-child > span { border-radius: 0 18px 18px 0; background: linear-gradient(var(--sep2), var(--sep2)) left center / 1px 18px no-repeat, var(--fill); }
.mv-wz-stp > button:active > span { background: var(--fill2); }

.mv-wz-pseg { flex: 1 1 auto; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; align-items: center; min-width: 0; height: 36px; padding: 2px; border-radius: 18px; background: var(--fill); }
.mv-wz-pseg > button { display: flex; align-items: center; min-width: 0; height: 44px; margin: -6px 0; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 15px; }
.mv-wz-pseg > button > span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; height: 32px; padding: 0 4px; border-radius: 16px; overflow: hidden; white-space: nowrap; }
.mv-wz-pseg > button[aria-pressed="true"] > span { background: var(--raised); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); font-weight: 600; }
.mv-wz-pseg > button[aria-disabled="true"] { color: var(--ink3); }
.mv-wz-pseg i { font-size: 17px; }

.mv-wz-del { width: 100%; display: flex; gap: 12px; min-height: 44px; border: 0; background: transparent; color: var(--red-text); text-align: left; }
.mv-wz-del:active { background: var(--sel); }
.mv-wz-add {
  flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0; border-radius: 22px;
  background: var(--raised); box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0, 0, 0, .04); color: var(--accent-text); font-size: 17px; line-height: 22px; text-align: left;
}
.mv-wz-add:disabled { color: var(--ink3); }
.mv-wz-add i { font-family: var(--math); }
.mv-wz-two { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv-wz-errs { flex: none; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 16px; background: var(--defl-soft); }
.mv-wz-errs p { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 15px; line-height: 20px; color: var(--ink); }
.mv-wz-errs .ic { flex: none; margin-top: 2px; color: var(--red-text); }

.mv-wz-foot {
  flex: none; display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 12px;
  padding: 12px 16px var(--m-sb);
}
.mv-wz-back { height: 50px; padding: 0; border: 0; border-radius: 25px; color: var(--ink); font-size: 17px; font-weight: 600; }
.mv-wz-next {
  display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; height: 50px; padding: 0 16px; border: 0; border-radius: 25px;
  background: var(--accent-fill); color: #fff; font-size: 17px; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 113, 227, .28);
}
.mv-wz-next > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-wz-next:active, .mv-wz-back:active { filter: brightness(1.06); }
/* sin viga, «Siguiente» espera a que se escriba L (sigue enfocable: al tocarlo dice qué falta) */
.mv-wz-next[aria-disabled="true"] { background: var(--fill2); color: var(--ink2); box-shadow: none; }

/* pantallas anchas (asistente abierto desde una tableta): columna centrada */
@media (min-width: 600px) {
  .mv-sheet { left: 50%; right: auto; width: 520px; margin-left: -260px; }
  .mv-wiz { left: 50%; right: auto; width: 480px; margin-left: -240px; box-shadow: 0 0 0 100vmax var(--backdrop), var(--float); }
}

@media (prefers-reduced-motion: reduce) {
  .mv-sheet, .mv-scrim { transition: none !important; }
}
@media print {
  .mv-wiz, .mv-sheet, .mv-scrim, .mv-pop { display: none !important; }
}
