/* Armá tu jardín vertical (17-18/10/2026): pintar la pared con paneles, la alternativa B que eligió Roi.
   Tokens del sistema de diseño del cliente (tokens.css); en celular ningún texto baja de 16 px. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hi-cal); color: var(--hi-grafito); font: 400 16px/1.5 var(--hi-font-text); }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--hi-helecho); outline-offset: 2px; }
/* Los pasos y los grupos de opciones se esconden con hidden aunque su regla les dé display (Ruta B, 2/11) */
[hidden] { display: none !important; }
html { scroll-padding-bottom: var(--next-h, 0px); } /* COMPUERTA 1: el alto de .next (pasos 2 y 4), lo mide armador.js */
svg.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
/* .d solo en escritorio, .m solo en el celular (el texto corto de un botón) */
@media (max-width: 1023px) { .d { display: none !important; } }
@media (min-width: 1024px) { .m { display: none !important; } }
.wrap { width: 100%; max-width: 1232px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

/* ---------- Encabezado ---------- */
.hdr { background: var(--hi-pino); color: var(--hi-cal); }
.hdr__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.hdr__logo img { display: block; width: 150px; height: auto; }
.hdr__back { display: inline-flex; align-items: center; min-height: 44px; color: var(--hi-cal); font-weight: 500; text-underline-offset: 3px; }

/* ---------- Bloques ---------- */
.intro { padding: 28px 0 8px; }
.intro h1 { font: var(--hi-t-h1-weight) var(--hi-t-h1-size)/var(--hi-t-h1-lh) var(--hi-font-display); letter-spacing: var(--hi-t-h1-tracking); color: var(--hi-pino); }
.intro__lead { margin-top: 8px; max-width: 62ch; font-size: var(--hi-t-lead-size); color: var(--hi-piedra); }
.modo { margin-top: 20px; padding: 20px 16px; background: #fff; border-radius: var(--hi-r-5); box-shadow: var(--hi-sh-1); }
@media (min-width: 768px) { .modo { padding: 24px; } }
.paso1 { padding-bottom: 48px; }
.paso { display: flex; align-items: center; gap: 10px; font: 600 var(--hi-t-h3-size)/1.25 var(--hi-font-display); }
.ayuda { margin-top: 8px; color: var(--hi-piedra); font-size: var(--hi-t-meta-size); }
.error { margin-top: 8px; padding: 8px 12px; border-radius: var(--hi-r-3); background: var(--hi-error-suave); color: var(--hi-error); font-weight: 500; }
.hint { margin-top: 6px; color: var(--hi-piedra); }

/* Medidas */
.medidas { margin-top: 20px; }
.medidas__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.campo { display: grid; gap: 4px; font-weight: 600; }
.campo__in { display: flex; align-items: center; height: 52px; width: 132px; padding: 0 14px; border: 1.5px solid var(--hi-control); border-radius: var(--hi-r-3); background: #fff; }
.campo__in:focus-within { border-color: var(--hi-helecho); box-shadow: 0 0 0 3px var(--hi-helecho-suave); }
.campo__in input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: 600 20px/1 var(--hi-font-text); font-variant-numeric: tabular-nums; }
.campo__in i { font-style: normal; color: var(--hi-piedra); }
.campo.is-bad .campo__in { border-color: var(--hi-error); }
.medidas__x { padding-bottom: 12px; font-size: 22px; color: var(--hi-piedra); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
@media (min-width: 768px) { .chips { width: auto; margin-left: 12px; padding-bottom: 6px; } }
.chip { min-height: 44px; padding: 0 16px; border: 1.5px solid var(--hi-control); border-radius: var(--hi-r-full); background: #fff; font-weight: 500; transition: transform var(--hi-motion-fast) var(--hi-motion-ease-out), background-color var(--hi-motion-fast); }
.chip:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .chip:hover { background: var(--hi-cal); } }

/* ---------- Ruta B «Estudio» (2/11/2026, NOTA §2-§3 de armador-toolbar-2026-11-02) ---------- */
/* Barra de arriba de los pasos 2 a 4: volver, el paso, los pasos (escritorio) y la lista */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 4px; min-height: 56px; padding: env(safe-area-inset-top) 8px 0; background: var(--hi-pino); color: #fff; }
.top__logo { display: none; }
.top :focus-visible { outline-color: var(--hi-lima); }
.top__back { flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 48px; padding: 0 8px 0 2px; border: 0; background: none; color: #fff; font-weight: 500; }
.top__where { flex: 1; display: grid; min-width: 0; text-align: center; line-height: 1.2; }
.top__where b { font: 600 17px/1.2 var(--hi-font-display); }
.top__where small { font-size: 16px; color: var(--hi-lima); }
.stepper, .top__tot { display: none; }
.top__lista { flex: none; min-height: 44px; padding: 0 10px 0 16px; background: #fff; color: var(--hi-grafito); }
body:not([data-step="3"]) .top__lista { display: none; }
body:not([data-step="3"]) .top__where { margin-right: 48px; } /* centrado: del otro lado está «‹ Anterior» */
.top__lista[aria-disabled="true"] { background: rgba(255,255,255,.45); color: var(--hi-pino); cursor: not-allowed; }
@media (min-width: 1024px) {
  .top { gap: 16px; padding: 0 16px; }
  .top__logo { display: block; flex: none; }
  .top__logo img { display: block; width: 112px; height: auto; }
  .top__back, .top__where { display: none; }
  .stepper { display: flex; flex: 1; justify-content: center; }
  .stepper ol { display: flex; align-items: center; gap: 4px; }
  .stepper li { display: flex; align-items: center; gap: 4px; }
  .stepper li + li::before { content: ""; width: 7px; height: 7px; margin: 0 6px 0 2px; border: solid rgba(255,255,255,.5); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
  .stepper button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--hi-r-full); background: none; color: rgba(255,255,255,.86); font-weight: 500; }
  .stepper .num { display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid currentColor; border-radius: 50%; font: 600 14px/1 var(--hi-font-display); }
  .stepper .num svg.i { width: 15px; height: 15px; stroke-width: 2.5; }
  .stepper [aria-current="step"] { background: rgba(255,255,255,.12); color: #fff; }
  .stepper [aria-current="step"] .num { background: #fff; border-color: #fff; color: var(--hi-pino); }
  .stepper .done .num { background: var(--hi-lima); border-color: var(--hi-lima); color: var(--hi-pino); }
  .stepper [aria-disabled="true"] { color: rgba(255,255,255,.6); cursor: default; }
  .stepper button:not([aria-current]):not([aria-disabled="true"]):hover { background: rgba(255,255,255,.08); }
  body[data-step="3"] .top__tot { display: grid; text-align: right; line-height: 1.25; }
  .top__tot span { color: var(--hi-lima); font-variant-numeric: tabular-nums; }
  body:not([data-step="3"]) .stepper { margin-right: 128px; } /* centrado bajo el logo */
}

/* Pasos 2 y 4: una pantalla blanca con el contenido al medio y «seguir» pegado abajo */
body:not([data-step="1"]) main { max-width: none; padding: 0; }
.screen { min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); background: #fff; }
.screen__in { max-width: 760px; margin: 0 auto; padding: 20px 16px 0; }
@media (min-width: 768px) { .screen__in { padding: 32px 24px 0; } }
.screen__t { font: 600 24px/1.2 var(--hi-font-display); color: var(--hi-pino); }
.screen__lead { margin-top: 6px; color: var(--hi-piedra); }
.screen__lead:empty { display: none; }
.cortes { margin-top: 24px; }
.cortes__t { margin-bottom: 8px; font-weight: 600; }
.cortes .seg, .ctx .seg { display: inline-flex; background: var(--hi-cal); }
.next { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 24px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--hi-junta); }
@media (min-width: 768px) { .next { margin: 28px 0 0; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); } }
.next p { color: var(--hi-piedra); }
#paso-4 .next { position: static; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.btn svg.i { width: 20px; height: 20px; }
/* Paso 2 con foto en escritorio: la foto a la izquierda y las medidas y el corte a la derecha, así todo entra arriba
   de la barra fija sin desplazar (COMPUERTA 1) */
@media (min-width: 1024px) {
  #paso-2.is-foto .screen__in { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; column-gap: 32px; align-items: start; }
  #paso-2.is-foto .screen__t, #paso-2.is-foto .screen__lead, #paso-2.is-foto .next { grid-column: 1 / -1; }
  #paso-2.is-foto .mk-slot { grid-column: 1; grid-row: 3 / span 2; }
  #paso-2.is-foto .medidas { grid-column: 2; grid-row: 3; margin-top: 16px; }
  #paso-2.is-foto .cortes { grid-column: 2; grid-row: 4; }
}
#a-pintar[aria-disabled="true"] { pointer-events: auto; cursor: not-allowed; } /* tocarlo lleva al campo que falta */
[data-paso] { animation: paso-in 150ms var(--hi-motion-ease-out); }
@keyframes paso-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { [data-paso] { animation: none; } }

/* Paso 3: el editor ocupa la pantalla (100dvh por la barra de direcciones del iPhone) y la página no se desplaza:
   el dedo que pinta no la mueve. Celular, de arriba abajo: pared, opciones, modelos, herramientas. Escritorio: riel a
   la izquierda, opciones arriba de la pared y modelos + vista a la derecha. */
html.is-editor, html.is-editor body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.is-editor body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
html.is-editor .top { flex: none; }
html.is-editor main { flex: 1; min-height: 0; }
.editor { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto auto; grid-template-areas: "stage" "ctx" "pal" "tools"; background: #fff; }
@media (min-width: 1024px) {
  .editor { grid-template-columns: 84px minmax(0, 1fr) 320px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "tools ctx pal" "tools stage pal"; }
}
/* Barra de herramientas: botón con ícono y nombre, esquina de 10 px; la activa es lo único negro de la barra */
.tb { grid-area: tools; position: relative; z-index: 5; display: flex; justify-content: space-between; gap: 2px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--hi-junta); }
.tb__g { display: flex; gap: 2px; }
.tb__sep { flex: none; width: 1px; margin: 10px 2px; background: var(--hi-junta); }
.tool { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 60px; min-height: 56px; padding: 6px; border: 0; border-radius: var(--hi-r-3); background: transparent; color: var(--hi-grafito); font-weight: 500; transition: background-color var(--hi-motion-fast) var(--hi-motion-ease-out); }
.tool__l { font-size: 16px; line-height: 1.1; white-space: nowrap; }
.tool[aria-pressed="true"] { background: var(--hi-grafito); color: #fff; }
.tool[aria-disabled="true"] { color: var(--hi-control); cursor: default; }
.tool:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .tool:not([aria-pressed="true"]):not([aria-disabled="true"]):hover { background: var(--hi-cal); } }
.tb__redo { display: none; }
@media (min-width: 1024px) {
  .tb { flex-direction: column; justify-content: flex-start; padding: 8px; border-top: 0; border-right: 1px solid var(--hi-junta); }
  .tb__g { flex-direction: column; align-items: center; }
  .tb__sep { display: none; }
  .tb__h { margin-top: auto; }
  .tool { width: 68px; min-width: 0; min-height: 60px; }
  .tool__l { font-size: 13px; }
  .tb__h .tool { width: 48px; min-height: 48px; }
  .tb__h .tool__l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tb__redo { display: grid; }
}
/* Tooltip con el nombre y el atajo (escritorio): al pasar el mouse o con el foco del teclado */
@media (min-width: 1024px) {
  .tool[data-tip]::after { content: attr(data-tip); position: absolute; z-index: 30; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: var(--hi-r-2); background: var(--hi-grafito); color: #fff; font: 500 14px/1.3 var(--hi-font-text); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--hi-motion-fast); }
  .tool[data-tip]:focus-visible::after { opacity: 1; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) { .tool[data-tip]:hover::after { opacity: 1; } }
/* Barra contextual: las opciones de la herramienta activa, siempre a la misma altura */
.ctx { grid-area: ctx; display: flex; align-items: center; min-height: 56px; padding: 0 8px 0 14px; background: #fff; border-top: 1px solid var(--hi-junta); overflow-x: auto; scrollbar-width: none; }
.ctx::-webkit-scrollbar { display: none; }
.ctx__g { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ctx .seg button { padding: 0 12px; }
.ctx__t { min-width: 0; color: var(--hi-piedra); }
.ctx__sp { display: none; }
.act { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--hi-control); border-radius: var(--hi-r-3); background: #fff; font-weight: 600; white-space: nowrap; }
.act svg.i { width: 20px; height: 20px; }
.act--danger { color: var(--hi-error); border-color: var(--hi-error); }
@media (hover: hover) and (pointer: fine) { .act:hover { background: var(--hi-cal); } }
.mixsel { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mixsel__img { position: relative; flex: none; width: 36px; height: 36px; overflow: hidden; border-radius: var(--hi-r-2); outline: 2px solid #fff; }
.mixsel__img + .mixsel__img { margin-left: -14px; }
.mixsel b { font-weight: 600; white-space: nowrap; }
@media (min-width: 1024px) {
  .ctx { padding: 0 16px; border-top: 0; border-bottom: 1px solid var(--hi-junta); }
  .ctx__g { justify-content: flex-start; gap: 14px; }
}
/* La columna de la pared: la pared se centra en lo que queda; arriba, en el celular, los botones de vista */
.stage-col { grid-area: stage; position: relative; min-height: 0; display: flex; flex-direction: column; justify-content: center; padding: 60px 8px 44px; overflow: hidden; background: var(--hi-arena); }
@media (min-width: 1024px) { .stage-col { padding: 24px 24px 52px; } }
.vista--m { position: absolute; z-index: 9; top: 8px; right: 8px; display: flex; gap: 6px; }
.vbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--hi-r-full); background: #fff; color: var(--hi-grafito); font-weight: 500; box-shadow: var(--hi-sh-1); }
.vbtn svg.i { width: 20px; height: 20px; }
/* prendido: verde suave (el negro queda solo para la herramienta activa) */
.vbtn[aria-pressed="true"] { background: var(--hi-helecho-suave); color: var(--hi-pino); box-shadow: inset 0 0 0 2px var(--hi-helecho); }
.vista__t, .vista--d { display: none; }
@media (min-width: 1024px) {
  .vista--m { display: none; }
  .vista__t { display: block; margin: 0 0 4px; font: 600 18px/1.3 var(--hi-font-display); }
  .vista--d { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--hi-junta); }
  .vista--d { display: grid; justify-items: start; gap: 2px; }
}
.tog { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border: 0; border-radius: var(--hi-r-3); background: transparent; font-weight: 500; text-align: left; }
.tog__box { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--hi-control); border-radius: 5px; background: #fff; }
.tog__box svg.i { width: 16px; height: 16px; stroke-width: 2.5; opacity: 0; }
.tog[aria-pressed="true"] .tog__box { background: var(--hi-helecho); border-color: var(--hi-helecho); color: #fff; }
.tog[aria-pressed="true"] .tog__box svg.i { opacity: 1; }
/* «Ver mi lista» deshabilitado: el motivo, a la vista sobre la pared vacía (sin tomar el dedo) */
.vacio { position: absolute; z-index: 8; left: 50%; top: 50%; max-width: calc(100% - 32px); padding: 8px 16px; border-radius: var(--hi-r-full); background: #fff; color: var(--hi-grafito); font-weight: 600; text-align: center; box-shadow: var(--hi-sh-1); transform: translate(-50%, -50%); pointer-events: none; }

/* Escenario: la pared a escala, centrada, con aire alrededor para las cotas y el rótulo del corte */
.stage { position: relative; flex: none; overflow: hidden; background: var(--hi-arena); touch-action: none; user-select: none; -webkit-user-select: none; }
/* La pared entera toma el dedo para pintar (también sobre las celdas vacías): fuera de la pared, la página se desplaza */
.wall { position: absolute; touch-action: none; cursor: crosshair; background: #F7F5F0; background-image: radial-gradient(rgba(29,33,31,.035) 1px, transparent 1px); background-size: 6px 6px; box-shadow: 0 1px 0 rgba(29,33,31,.08), 0 10px 30px rgba(29,33,31,.10); }
.wall__layer { position: absolute; inset: 0; }
/* Mezcla del borde entre modelos de jardín (2/11, mezcla.js): arriba de las celdas, sin tomar el dedo. «Ver uniones» la saca */
.wall__mezcla { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wall.show-seams .wall__mezcla { display: none; }
/* Lo que sobra fuera de la pared queda velado (es lo que se corta) */
.wall__dim { position: absolute; inset: 0; pointer-events: none; box-shadow: 0 0 0 4000px rgba(230, 223, 208, .80); outline: 2px dashed rgba(29,33,31,.55); outline-offset: 0; z-index: 3; }

/* Celdas y paneles */
.cell { position: absolute; }
.cell.is-empty { box-shadow: inset 0 0 0 1px rgba(29,33,31,.16); background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(29,33,31,.04) 7px 8px); }
.cell.is-hot { box-shadow: inset 0 0 0 3px var(--hi-helecho); z-index: 1; }
.cell.is-hot .pn { opacity: .85; }
.pn { position: absolute; inset: 0; overflow: hidden; background-color: var(--hi-jardines); background-repeat: repeat; }
/* Placas de revestimiento: la junta sí se ve (18/10, «Probá en tu pared») */
.pn.pn--junta { box-shadow: inset 0 0 0 1px rgba(19,22,20,.30), inset 1px 1px 0 1px rgba(255,255,255,.18); }
/* Sin línea entre placas de jardín: colocadas no se ven. «Ver uniones» las marca para contarlas */
.wall.show-seams .pn { box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), inset 0 0 0 2px rgba(19,22,20,.25); }
.pn__img { position: absolute; left: 50%; top: 50%; background-repeat: no-repeat; pointer-events: none; }
.pn.is-new { animation: pn-in 220ms var(--hi-motion-ease-out); }
@keyframes pn-in { from { opacity: .35; } } /* solo opacidad: con escala se vería la unión al aparecer */
@media (prefers-reduced-motion: reduce) { .pn.is-new { animation: none; } }
.cut-tag { position: absolute; z-index: 6; padding: 2px 8px; border-radius: var(--hi-r-3); background: var(--hi-grafito); color: #fff; font: 600 13px/1.4 var(--hi-font-text); pointer-events: none; }
/* Fantasma que sigue al dedo desde la paleta */
.ghost { position: fixed; z-index: 60; pointer-events: none; overflow: hidden; box-shadow: 0 14px 30px rgba(19,22,20,.35); border-radius: 2px; opacity: .92; }
.ghost.is-out { opacity: .55; }

/* Cotas */
.cota { position: absolute; z-index: 7; display: flex; align-items: center; justify-content: center; pointer-events: none; color: var(--hi-grafito); }
.cota span { padding: 0 8px; background: var(--hi-arena); font: 600 15px/1.4 var(--hi-font-text); font-variant-numeric: tabular-nums; white-space: nowrap; border-radius: var(--hi-r-full); }
.cota--w { height: 22px; border-left: 1.5px solid; border-right: 1.5px solid; }
.cota--w::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid; }
.cota--w span { position: relative; }
.cota--h { width: 22px; border-top: 1.5px solid; border-bottom: 1.5px solid; }
.cota--h::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1.5px solid; }
.cota--h span { position: relative; transform: rotate(-90deg); }

/* Aviso: arriba, fijo (en el editor, debajo de la barra y de los botones de vista) */
.toast { position: fixed; z-index: 80; left: 50%; top: calc(12px + env(safe-area-inset-top)); max-width: calc(100% - 24px); padding: 8px 16px; border-radius: var(--hi-r-3); background: var(--hi-grafito); color: #fff; font-weight: 500; transform: translate(-50%, -8px); opacity: 0; transition: opacity var(--hi-motion-base) var(--hi-motion-ease-out), transform var(--hi-motion-base) var(--hi-motion-ease-out); pointer-events: none; text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
html.is-editor .toast { top: calc(116px + env(safe-area-inset-top)); }
body[data-step="2"] .toast, body[data-step="4"] .toast { top: calc(68px + env(safe-area-inset-top)); }
@media (min-width: 1024px) { html.is-editor .toast { top: 124px; } }
/* Aviso de carga de la textura (22/10, red lenta): sobre el centro de la pared, discreto; el error trae «Reintentar».
   Apagado es solo transparente, sin visibility: hidden, así la región viva queda en el árbol y se anuncia (om-ux).
   Va fuera del escenario (en .stage-col), así el error angosto puede ir abajo de la pared sin taparla (is-abajo) */
.carga { position: absolute; z-index: 8; left: 50%; top: 50%; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 24px); padding: 6px 14px; border-radius: var(--hi-r-full); background: rgba(19,22,20,.88); white-space: nowrap; color: #fff; font: 500 14px/1.4 var(--hi-font-text); transform: translate(-50%, -50%); opacity: 0; transition: opacity var(--hi-motion-base) var(--hi-motion-ease-out); pointer-events: none; }
.carga.is-on { opacity: 1; }
.carga:not(.is-error) .carga__txt::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: currentColor; vertical-align: 1px; animation: carga-pulso 1.1s ease-in-out infinite alternate; }
@keyframes carga-pulso { from { opacity: .25; } }
.carga.is-error { width: min(260px, calc(100% - 24px)); padding: 12px 14px; border-radius: var(--hi-r-3); white-space: normal; flex-wrap: wrap; justify-content: center; text-align: center; }
/* Donde el error no entra sobre la pared sin tapar la cota (320 px): abajo, en una fila, «Reintentar» al lado (Roi 22/10) */
.carga.is-error.is-abajo { position: static; width: auto; max-width: none; margin-top: 8px; transform: none; flex-wrap: nowrap; justify-content: space-between; text-align: left; padding: 6px 6px 6px 14px; }
.carga.is-abajo:not(.is-on) { display: none; }
.carga__btn { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--hi-r-full); background: #fff; color: var(--hi-grafito); font: 600 14px/1 var(--hi-font-text); cursor: pointer; pointer-events: auto; }
.carga__btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.carga__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .carga { transition: none; } .carga:not(.is-error) .carga__txt::before { animation: none; } }

/* ---------- Paleta ---------- */
/* Celular: una fila que se desliza de costado; la primera muestra es el producto y el tamaño (abre una hoja) */
.paleta { grid-area: pal; display: flex; align-items: center; gap: 8px; padding: 8px 14px; overflow-x: auto; background: #fff; border-top: 1px solid var(--hi-junta); scrollbar-width: none; overscroll-behavior-x: contain; }
.paleta::-webkit-scrollbar { display: none; }
.prod { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; min-height: 52px; padding: 0 12px; border: 1.5px solid var(--hi-control); border-radius: var(--hi-r-3); background: #fff; font-weight: 600; white-space: nowrap; }
.prod span { overflow: hidden; text-overflow: ellipsis; }
.prod svg.i { width: 18px; height: 18px; }
.paleta__fmt { display: none; }
.paleta.is-fmt .paleta__fmt { display: block; position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: #fff; border-radius: var(--hi-r-5) var(--hi-r-5) 0 0; box-shadow: 0 -1px 0 var(--hi-junta), 0 -12px 32px rgba(19,22,20,.18); }
.paleta__ok { width: 100%; margin-top: 14px; }
#paleta-ayuda { display: none; }
/* Línea: jardines, placas o wall panel */
.lineas { display: flex; gap: 4px; margin-bottom: 12px; padding: 4px; background: var(--hi-cal); border-radius: var(--hi-r-full); }
.lineas button { flex: 1; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--hi-r-full); background: transparent; font-weight: 600; white-space: nowrap; }
.lineas button[aria-checked="true"] { background: var(--hi-pino); color: #fff; }
.paleta__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.paleta__head h2 { font: 600 18px/1.3 var(--hi-font-display); }
/* Tamaños: todo el ancho, en una fila; con cuatro (jardines, wall panel) en 2 × 2, así entran a 320 px (om-ux, 22/10) */
.fmt { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--hi-cal); border-radius: var(--hi-r-full); }
.fmt[data-n="4"] { grid-auto-flow: row; grid-template-columns: 1fr 1fr; border-radius: var(--hi-r-3); }
.fmt button { min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--hi-r-full); background: transparent; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fmt button[aria-checked="true"] { background: #fff; box-shadow: var(--hi-sh-1); color: var(--hi-pino); }
.paleta__list { display: flex; gap: 8px; }
/* Muestra compacta (celular): foto, nombre y cuántas hay en la pared; arrastrarla hacia arriba la lleva a la pared */
.sw { flex: none; position: relative; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 12px 4px 4px; border: 1.5px solid var(--hi-junta); border-radius: var(--hi-r-3); background: #fff; touch-action: pan-x; cursor: grab; text-align: left; white-space: nowrap; transition: transform var(--hi-motion-fast) var(--hi-motion-ease-out), border-color var(--hi-motion-fast); }
.sw:active { transform: scale(.97); }
.sw[aria-pressed="true"] { border-color: var(--hi-helecho); box-shadow: 0 0 0 2px var(--hi-helecho); }
.sw.is-off { opacity: .5; cursor: not-allowed; }
.sw__img { position: relative; flex: none; overflow: hidden; width: 42px; height: 42px; border-radius: var(--hi-r-2); background: var(--hi-jardines); }
.sw__n { font-weight: 600; line-height: 1.25; }
.sw__m, .sw__p { display: none; }
.sw__q { min-width: 28px; height: 28px; padding: 0 6px; border-radius: var(--hi-r-full); background: var(--hi-grafito); color: #fff; font: 600 16px/28px var(--hi-font-text); text-align: center; }
.sw__mix { position: absolute; top: -6px; left: -6px; width: 28px; height: 28px; border-radius: 50%; background: var(--hi-lima); color: var(--hi-noche); font: 700 16px/28px var(--hi-font-text); text-align: center; }
/* Escritorio: columna de la derecha con todo a la vista; las muestras, tarjetas de a dos */
@media (min-width: 1024px) {
  .paleta { display: block; overflow: auto; padding: 16px; border-top: 0; border-left: 1px solid var(--hi-junta); }
  .prod, .paleta .paleta__ok { display: none; }
  .paleta__fmt { display: block; }
  #paleta-ayuda { display: block; }
  .paleta__list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .sw { display: grid; align-items: start; gap: 6px; width: 100%; padding: 6px 6px 10px; touch-action: auto; white-space: normal; }
  .sw__img { width: auto; height: 64px; }
  .sw__m { display: block; color: var(--hi-piedra); font-size: 15px; line-height: 1.3; font-variant-numeric: tabular-nums; }
  .sw__p { display: block; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .sw__q { position: absolute; top: 2px; right: 2px; min-width: 26px; height: 26px; font-size: 14px; line-height: 26px; }
  .sw__mix { top: 2px; left: 2px; width: 26px; height: 26px; font-size: 14px; line-height: 26px; }
}

/* ---------- Resumen ---------- */
.resumen__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; }
@media (min-width: 900px) { .resumen__grid { grid-template-columns: 300px 1fr; } }
.resumen__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.stat { padding: 12px 14px; border-radius: var(--hi-r-3); background: var(--hi-cal); }
.stat b { display: block; font: 700 24px/1.1 var(--hi-font-display); font-variant-numeric: tabular-nums; color: var(--hi-pino); }
.stat span { color: var(--hi-piedra); }
.meter { grid-column: 1 / -1; height: 10px; border-radius: var(--hi-r-full); background: var(--hi-arena); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--hi-pasto); border-radius: inherit; transition: width var(--hi-motion-base) var(--hi-motion-ease-out); }
#lista li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hi-junta); }
#lista .li__img { position: relative; width: 44px; height: 44px; overflow: hidden; border-radius: var(--hi-r-2); background: var(--hi-jardines); }
#lista .li__n { font-weight: 600; line-height: 1.3; }
#lista .li__d { color: var(--hi-piedra); font-size: var(--hi-t-meta-size); }
#lista .li__p { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#lista .li__vacio { display: block; padding: 16px 0; color: var(--hi-piedra); border: 0; }
.ahorro { color: var(--hi-helecho); font-weight: 600; }
.total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 14px; }
.total span { font-weight: 600; }
.total strong { font: var(--hi-t-price-weight) var(--hi-t-price-size)/1.1 var(--hi-font-display); font-variant-numeric: tabular-nums; }
.resumen__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 1.5px solid transparent; border-radius: var(--hi-r-full); font: 600 16px/1 var(--hi-font-text); text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform var(--hi-motion-fast) var(--hi-motion-ease-out), background-color var(--hi-motion-fast); }
.btn:active { transform: scale(.97); }
.btn--wa { background: var(--hi-grafito); color: #fff; }
@media (hover: hover) and (pointer: fine) { .btn--wa:hover { background: var(--hi-grafito-2); } }
.btn--wa[aria-disabled="true"] { background: var(--hi-arena); color: var(--hi-piedra); pointer-events: none; }
.btn--light { background: #fff; border-color: var(--hi-control); color: var(--hi-grafito); }
.btn--sm { min-height: 44px; padding: 0 18px; }

/* Celular: ningún texto baja de 16 px (regla del sistema), tampoco los rótulos sobre la pared */
@media (max-width: 767px) {
  .cut-tag, .cota span, .carga, .carga__btn { font-size: 16px; }
}
