/* Estilos del EDITOR: lienzo a pantalla completa y controles flotantes mínimos.
   Tokens y botones base en /estilos/base.css; la hoja del catálogo publica --sheet-h. Propietario: EDITOR. */

#stage { position: fixed; inset: 0; }
#plan, #view3d { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
#view3d canvas.gl { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }

/* ---------- etiquetas 3D ---------- */
.etiquetas3d { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.l3 { position: absolute; left: 0; top: 0; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; color: #fff; background: var(--ok); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.l3.naranja { background: var(--warn); } .l3.rojo { background: var(--bad); } .l3.sel { background: var(--accent); }
.l3.area { background: color-mix(in srgb, var(--c) 90%, #000); font-size: 12px; letter-spacing: .05em; opacity: .92; }
/* Icono «mover» sobre el mueble seleccionado: ya se puede arrastrar con un dedo. */
.l3.mover { padding: 7px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #fff, 0 3px 10px rgba(0,0,0,.25); }
.l3.mover svg { display: block; }
/* Anillo que se llena al mantener el dedo sobre un mueble sin seleccionar (al completarse, se agarra). */
.presion3d { position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; pointer-events: none; z-index: 6; opacity: 0; animation: presion3d-ver 0s linear .15s forwards; }
.presion3d circle { fill: rgba(37, 99, 235, .12); stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 126; stroke-dashoffset: 126; transform: rotate(-90deg); transform-origin: 50% 50%; animation: presion3d-llenar calc(var(--ms, 600ms) - 150ms) linear .15s forwards; }
@keyframes presion3d-ver { to { opacity: 1; } }
@keyframes presion3d-llenar { to { stroke-dashoffset: 0; } }

/* ---------- barra superior ---------- */
.topbar { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; pointer-events: none; z-index: 20; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 0; border-radius: 999px; padding: 6px 16px 6px 6px; box-shadow: var(--shadow); min-height: var(--tap); text-align: left; max-width: 320px; }
.brand .logo { width: 36px; height: 36px; flex: none; border-radius: 50%; background: #1f2328; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.brand-texto { display: grid; min-width: 0; }
.brand b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.brand small [data-estado="pendiente"], .brand small [data-estado="guardando"] { color: #a85a00; }
.brand small [data-estado="sin_conexion"], .brand small [data-estado="error"] { color: var(--bad); }
.brand .version { color: var(--accent); font-weight: 700; margin-left: 4px; }
.summary { margin: 0 auto; min-width: 48px; display: flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 18px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; white-space: nowrap; min-width: 0; overflow: hidden; }
.summary .sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 6px; background: var(--ok); flex: none; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.ok { background: var(--ok); }
.right { display: flex; gap: 10px; align-items: center; position: relative; }
.seg { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.seg button { min-width: 64px; min-height: 44px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 16px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #1f2328; color: #fff; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; }
.menu { position: absolute; right: 0; top: 56px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; min-width: 270px; display: flex; flex-direction: column; z-index: 30; }
.menu button { text-align: left; min-height: 46px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; }
.menu button:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* ---------- riel de herramientas ---------- */
.rail { position: fixed; left: 12px; top: 84px; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); z-index: 15; max-height: calc(100% - var(--sheet-h) - 100px); overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail button { width: 68px; min-height: 54px; flex: none; border: 0; border-radius: 12px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #3a3f47; }
.rail button span { font-size: 10.5px; font-weight: 600; line-height: 1.1; text-align: center; }
.rail button[aria-pressed="true"] { background: #e8efff; color: var(--accent); }
.rail button:disabled { opacity: .3; cursor: default; }
.rail hr { width: 70%; border: 0; border-top: 1px solid var(--line); margin: 4px auto; flex: none; }
.rail-mas { position: fixed; z-index: 30; display: grid; grid-template-columns: repeat(3, 72px); gap: 4px; padding: 8px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.rail-mas[hidden] { display: none; }
.rail-mas button { width: 72px; }
.rail [data-acc=mas-herramientas][aria-pressed="true"] { background: #e8efff; color: var(--accent); }
.rail [data-acc=catalogo][aria-expanded="true"] { background: #e8efff; color: var(--accent); }

/* ---------- avisos ---------- */
.banner { position: fixed; top: 76px; left: 0; right: 0; margin: 0 auto; width: fit-content; z-index: 18; max-width: min(760px, calc(100% - 200px)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: #fff7ec; border: 1px solid #f3c58a; color: #7a4100; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 14px; }
.previa-ia { position: fixed; top: 76px; left: 0; right: 0; margin: 0 auto; width: fit-content; z-index: 19; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; background: #f3efff; border: 1px solid #c9b8ff; color: #3b1f8f; border-radius: 999px; box-shadow: var(--shadow); font-size: 14px; }
.resumen-ia { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge-ia { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: #7c3aed; color: #fff; border-radius: 999px; padding: 4px 10px; }
.toast { position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content; top: 146px; z-index: 40; max-width: min(640px, calc(100% - 32px)); padding: 10px 16px; border-radius: 999px; background: #1f2328; color: #fff; font-size: 14px; box-shadow: var(--shadow); pointer-events: none; text-align: center; }
.toast.con-accion { display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 20px; text-align: left; }
.toast-accion { pointer-events: auto; flex: none; min-height: 48px; min-width: 112px; padding: 0 20px; border: 0; border-radius: 999px; background: #fff; color: #1f2328; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.toast-accion:active { background: #e6e8eb; }
.toast.destacado { font-size: 16px; font-weight: 600; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #1f2328, var(--shadow); }
.toast[data-nivel="naranja"] { background: #a85a00; } .toast[data-nivel="rojo"] { background: #b42323; } .toast[data-nivel="ok"] { background: #1e7a4a; }
.dato { position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none; padding: 4px 10px; border-radius: 8px; background: #1f2328; color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- tarjeta inicial ---------- */
.hint { position: fixed; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 12; width: min(540px, calc(100% - 48px)); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; text-align: center; }
.hint h2 { margin: 0 0 6px; font-size: 22px; } .hint p { margin: 0 0 18px; color: var(--muted); }
.hint-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- barra contextual ---------- */
.ctx { position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: calc(var(--sheet-h) + 12px); z-index: 16; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); max-width: min(980px, calc(100% - 24px)); max-height: calc(100% - var(--sheet-h) - 110px); overflow-y: auto; transition: bottom .2s ease; }
body[data-view="3d"] .ctx { max-width: min(860px, calc(100% - 140px)); }
/* La barra se centra en el hueco libre: a la derecha del riel y a la izquierda del dock de IA (el módulo IA
   publica --reserva-dock con lo que ocupa el dock y, si está abierto, el panel). */
@media (min-width: 701px) { .ctx { left: 104px; right: var(--reserva-dock, 12px); } .previa-ia { left: 104px; } }
.ctx.bajo-hoja { display: none; }
.ctx .fila, .fila { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.ctx-titulo { font-weight: 600; padding: 0 8px; font-size: 14px; }
.campo { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 4px 0 10px; min-height: var(--tap); }
.campo span { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.campo input, .campo select { width: 78px; min-height: 40px; border: 0; background: #fff; border-radius: 8px; padding: 0 8px; font-size: 17px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.campo.corto input, .campo.corto select { width: 64px; }
.campo.ancho input { width: 180px; text-align: left; }
.campo input[type=color] { width: 44px; padding: 2px; }
.campo input:focus, .campo select:focus { outline: 2px solid var(--accent); }
.campo output { font-size: 11px; color: var(--muted); min-width: 52px; }
.ctx-item { display: flex; align-items: center; gap: 10px; padding: 0 8px; max-width: 440px; }
.ctx-item b { display: block; font-size: 14px; } .ctx-item small { color: var(--muted); font-size: 12px; display: block; }
.ctx-item em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--ok); display: block; }
.ctx-item em.warn { color: #b16100; } .ctx-item em.bad { color: var(--bad); }
.chips.en-linea { display: flex; gap: 6px; flex-wrap: wrap; flex: initial; padding: 0; overflow: visible; }
.chips.en-linea .chip[style*="--c"].on { background: var(--c); border-color: var(--c); }
.pildora { display: inline-flex; align-items: center; gap: 4px; padding: 0 0 0 10px; min-height: 36px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.btn.mini { min-height: 32px; width: 32px; }
.btn.icon span:empty { display: none; }
.btn span { pointer-events: none; }
.aviso-cierre { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fff7ec; border: 1px solid #f3c58a; color: #7a4100; font-size: 14px; }
.muestras { display: flex; gap: 6px; flex-wrap: wrap; }
.muestra { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); }
.muestra.on { border-color: var(--accent); box-shadow: 0 0 0 2px #fff inset; }

/* ---------- interruptor «Problemas» (antes leyenda + semáforo + botón Holguras) ---------- */
.leyenda { position: fixed; right: 12px; top: 72px; z-index: 14; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); }
.leyenda button { display: flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.leyenda button:hover { background: var(--surface-2); }
.leyenda .dot { margin: 0; width: 12px; height: 12px; }
.leyenda .interruptor { font-weight: 600; font-size: 13px; color: #3a3f47; }
.leyenda .interruptor .llave { position: relative; width: 30px; height: 18px; border-radius: 999px; background: #c9ced6; flex: none; transition: background .15s; }
.leyenda .interruptor .llave::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.leyenda .interruptor[aria-pressed="true"] .llave { background: var(--accent); }
.leyenda .interruptor[aria-pressed="true"] .llave::after { transform: translateX(12px); }
.leyenda .interruptor small { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #eef0f3; color: #5b6472; font-size: 11px; font-weight: 700; }
.leyenda .todo-bien { display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 13px; font-weight: 600; color: #1e7a4a; }
.leyenda button.sin-evaluar { background: #eef0f3; }
.leyenda button.sin-evaluar span { display: inline !important; color: #39404b; font-weight: 650; font-size: 12px; }
.dot.gris { background: #5b6472; }
.sin-evaluar-txt { color: #a85a00; font-weight: 650; margin-left: 4px; flex: none; }
.summary[data-sin-paso] .muted { display: none; }

/* ---------- barra 3D ---------- */
.barra3d { position: fixed; right: 12px; top: 124px; z-index: 15; display: flex; flex-direction: column; gap: 6px; }
.barra3d::-webkit-scrollbar { display: none; }
.barra3d .grupo-camaras { position: relative; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.menu-camaras { position: absolute; right: calc(100% + 8px); top: 0; display: flex; gap: 2px; padding: 4px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.barra3d button { width: 76px; min-height: 52px; flex: none; border: 0; border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #3a3f47; }
.barra3d > button { box-shadow: var(--shadow); }
.barra3d button span { font-size: 10.5px; font-weight: 600; line-height: 1.1; text-align: center; }
.barra3d button[aria-pressed="true"] { background: #e8efff; color: var(--accent); }
.barra3d button.primario { background: var(--accent); color: #fff; }
.barra3d button.cargando { animation: latido 1s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .5; } }

/* ---------- TOMA para el render: ángulo de visión, altura de la cámara y marco de la foto ---------- */
.barra3d .grupo-camaras { z-index: 2; } /* el menú de cámaras queda sobre el panel de la toma mientras se elige */
.barra3d .grupo-toma { display: flex; flex-direction: column; } /* el panel se ancla a la barra (posición fija) */
.barra3d .grupo-toma > button { box-shadow: var(--shadow); }
.panel-toma { position: absolute; z-index: 1; right: calc(100% + 8px); top: 0; width: 232px; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.panel-toma header { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; }
.barra3d .panel-toma button { width: auto; min-height: 52px; }
.barra3d .panel-toma .toma-x { width: 48px; min-height: 48px; margin: -6px -6px -6px 0; }
.toma-ajuste { display: flex; flex-direction: column; gap: 4px; }
.toma-rot { font-size: 12px; font-weight: 650; color: var(--muted, #5b6472); }
.toma-fila { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 6px; }
.barra3d .toma-fila button { background: var(--surface-2, #f1f2f4); border: 1px solid var(--line, #e3e5e8); }
.barra3d .toma-fila button b { font-size: 22px; line-height: 1; }
.barra3d .toma-fila button:disabled, .barra3d .panel-toma button:disabled { opacity: .4; }
.toma-fila output { text-align: center; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text, #1f2328); }
.barra3d .panel-toma .toma-ancho { flex-direction: row; gap: 8px; padding: 0 12px; background: var(--surface-2, #f1f2f4); border: 1px solid var(--line, #e3e5e8); }
.barra3d .panel-toma .toma-ancho span { font-size: 13px; }
.barra3d .panel-toma .toma-ancho.primario { background: var(--accent); color: #fff; border-color: transparent; }
/* Marco de la foto (exactamente lo que sale) con los tercios; fuera de él, en vertical, se oscurece. */
.marco-toma { position: absolute; z-index: 3; pointer-events: none; box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 9999px rgba(15,18,22,.42); }
.marco-toma i { position: absolute; background: rgba(255,255,255,.55); box-shadow: 0 0 1px rgba(0,0,0,.35); }
.marco-toma .v1, .marco-toma .v2 { top: 0; bottom: 0; width: 1px; }
.marco-toma .h1, .marco-toma .h2 { left: 0; right: 0; height: 1px; }
.marco-toma .v1 { left: 33.333%; } .marco-toma .v2 { left: 66.667%; }
.marco-toma .h1 { top: 33.333%; } .marco-toma .h2 { top: 66.667%; }
/* Mientras se encuadra la toma no se ve lo que tapa la vista (el carrito se oculta en carrito.css). */
body.en-toma .rail, body.en-toma .leyenda, body.en-toma .ctx, body.en-toma .porque, body.en-toma .elegido,
body.en-toma .ia-dock, body.en-toma .previa-ia, body.en-toma #montaje-catalogo { visibility: hidden !important; pointer-events: none !important; }
/* Tablet vertical: el marco es la franja apaisada del centro. La barra 3D pasa a una fila en la franja de arriba y el
   panel de la toma, en tres columnas, a la franja de abajo: ninguno tapa el marco de la foto (17-11). */
@media (orientation: portrait) and (min-width: 701px) {
  body.en-toma .barra3d { top: 76px; flex-direction: row; align-items: flex-start; }
  body.en-toma .barra3d .grupo-toma { position: static; }
  body.en-toma .menu-camaras { right: auto; left: 0; top: calc(100% + 8px); } /* hacia abajo, dentro de la franja */
  body.en-toma .panel-toma { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 8px 12px 10px; }
  body.en-toma .panel-toma header { grid-column: 1 / -1; }
  body.en-toma .panel-toma .toma-ajuste:nth-of-type(1) { grid-column: 1; grid-row: 2 / span 2; }
  body.en-toma .panel-toma .toma-ajuste:nth-of-type(2) { grid-column: 2; grid-row: 2 / span 2; }
  body.en-toma .panel-toma > button:nth-of-type(1) { grid-column: 3; grid-row: 2; }
  body.en-toma .panel-toma > button:nth-of-type(2) { grid-column: 3; grid-row: 3; }
  body.en-toma .joystick { top: 80px; bottom: auto; left: 20px; } /* caminando: el control, en la franja de arriba */
}

/* ---------- barra 3D plegada (17-11): queda la cámara y la flecha para volver a abrirla ---------- */
.barra3d button.plegar-barra { min-height: 44px; box-shadow: var(--shadow); color: #5b6472; }
.barra3d.plegada button.plegar-barra { background: #e8efff; color: var(--accent); }

/* ---------- VISTA LIMPIA (17-11): sin controles flotantes; sólo «Mostrar controles» ---------- */
body.vista-limpia .topbar, body.vista-limpia .rail, body.vista-limpia .rail-mas, body.vista-limpia .leyenda,
body.vista-limpia .barra3d, body.vista-limpia .ctx, body.vista-limpia .porque, body.vista-limpia .elegido,
body.vista-limpia .banner, body.vista-limpia .previa-ia, body.vista-limpia .hint, body.vista-limpia .ia-dock,
body.vista-limpia .ia-barra-previa, body.vista-limpia .ia-trazos-info, body.vista-limpia .panel-lateral,
body.vista-limpia .sheet, body.vista-limpia .enc-presupuesto, body.vista-limpia .barra-acciones.respaldo,
body.vista-limpia #montaje-catalogo { visibility: hidden !important; pointer-events: none !important; }
.salir-limpia { position: fixed; top: 12px; right: 12px; z-index: 50; display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: rgba(31,35,40,.82); color: #fff; font-weight: 700; font-size: 15px; box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.salir-limpia[hidden] { display: none; }
/* Tablet vertical: la barra superior no tiene sitio para el botón (el nombre del proyecto se cortaba); queda en «•••». */
@media (max-width: 900px) { #limpia-btn { display: none; } }
.salir-limpia:active { background: #1f2328; }

/* ---------- recorrido ---------- */
.joystick { position: absolute; left: 28px; bottom: calc(var(--sheet-h) + 28px); width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.55); border: 2px solid rgba(31,35,40,.15); backdrop-filter: blur(6px); touch-action: none; display: grid; place-items: center; z-index: 5; }
.joystick .mando { width: 52px; height: 52px; border-radius: 50%; background: #1f2328; opacity: .8; transition: transform .05s linear; pointer-events: none; }

/* ---------- diálogos ---------- */
.dialogo-proyectos { width: min(760px, calc(100% - 24px)); max-height: calc(100% - 48px); padding: 0; }
.dialogo-proyectos > header { position: sticky; top: 0; background: var(--surface); padding: 12px 12px 8px 16px; margin: 0; border-bottom: 1px solid var(--line); z-index: 1; }
.dialogo-proyectos .cuerpo { padding: 12px 16px 18px; display: grid; gap: 10px; }
.dialogo-proyectos .fila input { flex: 1; min-height: var(--tap); border-radius: 12px; border: 1px solid var(--line); padding: 0 12px; font-size: 15px; }
.pestanas { display: flex; gap: 6px; }
.pestanas button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pestanas button[aria-selected="true"] { background: #1f2328; color: #fff; border-color: #1f2328; }
.tarjetas-proyecto { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tarjetas-proyecto li { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.tarjetas-proyecto li.actual { border-color: var(--accent); box-shadow: 0 0 0 2px #dbe7ff; }
.tarjetas-proyecto .abrir { display: grid; width: 100%; border: 0; background: transparent; padding: 0; text-align: left; }
.tarjetas-proyecto img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #f4f3ef; display: block; }
.tarjetas-proyecto .abrir span { padding: 8px 10px 10px; display: grid; }
.tarjetas-proyecto small { color: var(--muted); }
.tarjetas-proyecto .acciones { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.tarjetas-proyecto .acciones .btn { background: rgba(255,255,255,.9); }
.historial { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.historial li { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.historial li.actual { border-color: var(--accent); background: #f5f8ff; }
.historial .num { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.historial .info { display: grid; } .historial small { color: var(--muted); }
.historial .acciones { display: flex; gap: 6px; align-items: center; }
.historial .vista-rev { grid-column: 1 / -1; width: 100%; max-width: 480px; border-radius: 10px; }
.dialogo-foto { width: min(820px, calc(100% - 24px)); }
.dialogo-foto img { width: 100%; border-radius: 12px; background: #eceae4; display: block; }
.dialogo-foto a.btn { text-decoration: none; }
.error { color: var(--bad); }
.dialogo-atajos { width: min(620px, calc(100% - 24px)); }
.atajos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 6px 0 4px; font-size: 14px; }
.atajos dt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.atajos dd { margin: 0; color: var(--muted); }

/* ---------- pantallas estrechas y retrato ---------- */
/* Tablet horizontal (1280): la barra lleva además la píldora de presupuesto; el nombre del proyecto se acorta y el
   resumen suelta el área (m²) para que el semáforo (incluido el rojo «No cumple») no quede cortado. */
@media (max-width: 1400px) and (min-width: 1001px) {
  .brand { max-width: 210px; }
  .summary .muted { display: none; }
  .summary .sep { margin: 0 2px; }
  .summary { min-width: 48px; } /* nunca un botón de menos de 44 px aunque la barra se llene */
}
@media (max-width: 1000px) {
  .brand-texto small { display: none; }
  .brand { max-width: 220px; }
  .summary .muted { display: none; }
}
@media (max-width: 900px) {
  .banner, .previa-ia { max-width: calc(100% - 24px); top: 128px; }
  .toast { top: 184px; }
  .leyenda button.sin-evaluar span { display: none !important; }
  .oculto-estrecho { display: none; }
  .summary .sep { display: none; }
}
@media (max-width: 700px) {
  .brand-texto { display: none; } .brand { padding-right: 6px; }
  .summary { padding: 0 12px; font-size: 13px; }
  .rail { top: auto; left: 12px; right: 12px; bottom: calc(var(--sheet-h) + 10px); flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; }
  .rail hr { display: none; }
  .rail button { width: 60px; }
  .ctx { bottom: calc(var(--sheet-h) + 84px); }
  .barra3d { top: auto; bottom: calc(var(--sheet-h) + 84px); flex-direction: row; right: 12px; }
  .menu-camaras { right: auto; left: 0; top: auto; bottom: calc(100% + 8px); }
  .panel-toma { right: 0; top: auto; bottom: calc(100% + 8px); }
}
@media (max-width: 600px) {
  .topbar { gap: 6px; left: 8px; right: 8px; }
  .summary { display: none; }
  .right { gap: 6px; margin-left: auto; }
  .seg button { min-width: 46px; font-size: 15px; }
  .leyenda { top: 68px; right: 8px; }
  .ctx { padding: 6px; gap: 6px; }
  .ctx-item { max-width: 100%; }
}

.menu .menu-rotulo { display: block; padding: 6px 14px 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ---------- barra contextual COMPACTA del mueble (15-11, pedido de Carlos) ----------
   Una fila: nombre y estado corto · iconos con texto corto · plegar y ✕. El detalle largo vive en «¿Por qué?». */
.ctx.compacta { flex-wrap: wrap; gap: 4px; padding: 4px 6px; border-radius: 16px; max-width: min(900px, calc(100% - 24px)); }
.ctx.compacta .ctx-cab { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 360px; padding-left: 4px; }
.ctx.compacta .ctx-cab .dot { margin: 0; }
.ctx-modelo { display: grid; min-width: 0; text-align: left; border: 0; background: transparent; padding: 2px 6px; border-radius: 10px; min-height: 44px; align-content: center; color: inherit; font: inherit; }
button.ctx-modelo:hover { background: var(--surface-2); }
.ctx-modelo .ctx-nombre { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ctx-modelo .ctx-estado { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--ok); }
.ctx-modelo .ctx-estado.warn { color: #b16100; } .ctx-modelo .ctx-estado.bad { color: var(--bad); }
/* Etiqueta de problema en la barra del mueble: abre la explicación (una cosa a la vez). */
.ctx-etiqueta { flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.ctx-etiqueta.warn { background: #fff1dc; color: #9a5300; } .ctx-etiqueta.bad { background: #fde8e8; color: #b42323; }
.ctx-etiqueta[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor; }
.ctx-etiqueta .ctx-estado { font: inherit; color: inherit; }
.ctx-modelo .ctx-modelo-marca { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--accent); }
.ctx-modelo .ctx-modelo-marca svg { width: 13px; height: 13px; }
.ctx-acciones { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.btn.ic-txt { flex-direction: column; gap: 1px; min-width: 54px; min-height: 50px; padding: 4px 4px 3px; border-radius: 12px; border: 0; background: transparent; box-shadow: none; color: #3a3f47; }
.btn.ic-txt span { font-size: 10.5px; font-weight: 650; line-height: 1.1; white-space: nowrap; }
.btn.ic-txt:hover { background: var(--surface-2); }
.btn.ic-txt.danger { color: var(--bad); }
.btn.ic-txt[aria-pressed="true"], .btn.ic-txt[aria-expanded="true"] { background: #e8efff; color: var(--accent); }
.btn.ic-txt.aviso.bad { color: var(--bad); } .btn.ic-txt.aviso.warn { color: #b16100; }
.btn.ic-txt.aviso.bad svg, .btn.ic-txt.aviso.warn svg { animation: latido 1.6s ease-in-out 3; }
.btn.ic-txt.g90 svg { display: none; } .btn.ic-txt.g90 span { font-size: 15px; font-weight: 750; line-height: 34px; }
.ctx-fin { display: flex; align-items: center; gap: 0; margin-left: auto; }
.ctx-fin .btn, .ctx-plegada .btn.icon { min-width: 44px; min-height: 44px; width: 44px; }
.ctx-paso { display: flex; align-items: center; gap: 2px; padding: 0 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.ctx-paso .mini-paso { width: 40px; min-height: 44px; font-size: 22px; font-weight: 700; border: 0; background: transparent; box-shadow: none; }
.ctx-paso-valor { display: grid; justify-items: center; min-width: 34px; line-height: 1.05; }
.ctx-paso-valor b { font-size: 17px; } .ctx-paso-valor small { font-size: 10px; color: var(--muted); font-weight: 650; }
.ctx-mas { flex-basis: 100%; display: grid; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--line); }
/* Mover por medida (18-11): un botón grande por lado del mueble (flecha + lo libre) y, elegido uno, la distancia en cm. */
.ctx-medida { flex-basis: 100%; display: grid; gap: 8px; padding: 2px 4px; min-width: min(560px, 100%); }
.ctx-medida-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctx-medida-cab .ctx-titulo b { font-weight: 700; }
.lados-medida { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.lado-medida { flex: 1 1 104px; min-height: 56px; gap: 8px; padding: 0 10px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; border: 2px solid var(--accent); color: var(--accent); background: #fff; border-radius: 14px; }
.btn.lado-medida .flecha { flex: none; }
.btn.lado-medida.on { background: var(--accent); color: #fff; }
.btn.lado-medida.sin, .btn.lado-medida.sin.on { border-color: var(--line); color: var(--muted); background: var(--surface-2); }
.campo.medida input { width: 104px; min-height: 44px; font-size: 20px; }
.campo.medida output { min-width: 26px; font-size: 13px; font-weight: 600; }
.ctx.plegada { padding: 2px 4px; border-radius: 999px; }
.ctx-plegada { display: flex; align-items: center; gap: 2px; }
.ctx-plegada .ctx-cab { max-width: 300px; }
.ctx-plegada .ctx-modelo-marca { display: none !important; }
@media (max-width: 900px) {
  .ctx.compacta .ctx-cab { max-width: 180px; }
  .btn.ic-txt { min-width: 50px; }
}
@media (max-width: 600px) {
  .ctx.compacta .ctx-cab { flex-basis: 100%; max-width: none; }
  .btn.ic-txt { min-width: 46px; } .btn.ic-txt span { font-size: 9.5px; }
}

/* ---------- MODO NAVEGACIÓN: al orbitar, panear o arrastrar se apagan paneles y barras; vuelven al soltar ---------- */
body.navegando .ctx, body.navegando .rail, body.navegando .leyenda, body.navegando .barra3d, body.navegando .porque,
body.navegando .topbar, body.navegando #montaje-catalogo, body.navegando .ia-dock, body.navegando .toast, body.navegando .previa-ia,
body.navegando .ia-barra-previa, body.navegando .etiquetas3d .l3:not(.sel):not(.cuello) {
  opacity: .06; pointer-events: none !important; transition: opacity .16s ease;
}
.rail, .leyenda, .barra3d, .porque, .topbar, #montaje-catalogo { transition: opacity .25s ease .05s; }
.ctx { transition: bottom .2s ease, opacity .25s ease .05s; }

/* ---------- tarjeta «¿Por qué?» ---------- */
.porque { position: fixed; left: 104px; top: 84px; z-index: 17; width: min(372px, calc(100% - 128px)); max-height: calc(100% - 84px - var(--sheet-h) - var(--ctx-alto, 0px) - 20px); overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 0 0 10px; font-size: 14px; overscroll-behavior: contain; }
.porque > header { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.porque > header div { display: grid; flex: 1; min-width: 0; } .porque > header b { font-size: 15px; }
.porque > header small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.porque > header .dot { margin: 0; }
.pq-cuerpo { padding: 8px 14px 0; display: grid; gap: 10px; }
.porque h4 { margin: 6px 0 4px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.porque section { display: grid; gap: 6px; }
.pq-escenarios { display: flex; gap: 6px; flex-wrap: wrap; }
.pq-esc { display: grid; justify-items: start; gap: 0; min-height: 48px; padding: 4px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); text-align: left; line-height: 1.15; }
.pq-esc span { font-size: 11.5px; font-weight: 650; color: var(--muted); } .pq-esc b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pq-esc.rojo b { color: var(--bad); } .pq-esc.naranja b { color: #b16100; } .pq-esc.verde b { color: var(--ok); }
.pq-esc[aria-pressed="true"] { border-color: #1f2328; background: #fff; box-shadow: 0 0 0 2px #1f232822; }
.pq-titular { margin: 0; font-size: 15px; line-height: 1.4; padding: 8px 10px; border-radius: 12px; background: #fdecec; color: #7a1d1d; }
.pq-titular.naranja { background: #fff4e3; color: #6b3d00; } .pq-titular.verde { background: #e8f6ee; color: #14532d; }
.pq-titular u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pq-leyenda { margin: 0; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.pq-leyenda span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pq-seg { display: inline-block; width: 22px; height: 4px; border-radius: 2px; background: var(--bad); position: relative; }
.pq-seg.naranja { background: var(--warn); } .pq-seg.verde { background: var(--ok); }
.pq-persona { display: inline-block; width: 16px; height: 9px; border-radius: 50%; border: 2px solid #1f2328; background: #fff; }
.pq-camino { display: inline-block; width: 22px; border-top: 2.5px dotted #1f2328; }
.pq-mancha { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: rgba(232,137,12,.45); vertical-align: -1px; }
.pq-mancha.verde { background: rgba(47,158,98,.35); }
.pq-lista { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 13px; line-height: 1.35; }
.pq-lista li { display: flex; gap: 6px; align-items: baseline; } .pq-lista .dot { margin: 0; flex: none; transform: translateY(1px); }
.pq-frases li::before { content: "·"; font-weight: 800; color: var(--muted); }
.pq-nota { margin: 0; font-size: 12.5px; color: var(--muted); } .pq-nota.rojo { color: var(--bad); }
.pq-sug { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
.pq-sug li { padding: 4px 0; } .pq-sug li.viendo { background: #f5f8ff; border-radius: 8px; }
.pq-sug li > span:first-child { display: block; line-height: 1.35; }
.pq-sug em { font-style: normal; font-weight: 700; font-size: 12px; } .pq-sug em.ok { color: var(--ok); } .pq-sug em.warn { color: #b16100; }
.pq-sug-acc { display: flex; gap: 6px; margin-top: 4px; } .pq-sug-acc .btn { min-height: 40px; }
.pq-arreglar { justify-self: start; }
.pq-calculando { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.pq-calculando .ia-giro { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: pq-giro .8s linear infinite; display: inline-block; }
@keyframes pq-giro { to { transform: rotate(360deg); } }
.pq-ok { margin: 4px 0; display: flex; gap: 8px; align-items: center; } .pq-ok .dot { margin: 0; }
@media (max-width: 900px) {
  .porque { left: 12px; right: 12px; width: auto; top: auto; bottom: calc(var(--sheet-h) + var(--ctx-alto, 0px) + 12px); max-height: 34vh; }
}
@media (max-width: 700px) { .porque { bottom: calc(var(--sheet-h) + var(--ctx-alto, 0px) + 84px); } }
.l3.sel.rojo, .l3.sel.naranja { background: var(--accent); box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0,0,0,.2); }
.l3.cuello { background: #1f2328; border: 2px solid var(--bad); font-size: 13px; }
.l3.cuello.naranja { border-color: var(--warn); } .l3.cuello.verde { border-color: var(--ok); }
body[data-view="3d"] .ctx.compacta { max-width: min(980px, calc(100% - 210px)); }
@media (max-width: 900px) { body[data-view="3d"] .ctx.compacta { max-width: min(980px, calc(100% - 24px)); } }
/* «¿Por qué?» con un arreglo en vista previa: la tarjeta explica la escena real; esta franja dice lo que quedaría. */
.pq-previa { border: 2px dashed var(--sel, #2563eb); border-radius: 10px; padding: 6px 10px; margin: 0 0 8px; background: #eef3fe; position: sticky; top: 62px; z-index: 3; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); }
.pq-previa p { margin: 0 0 2px; }
.pq-previa.ok { border-color: #2f9e62; } .pq-previa.warn { border-color: #e8890c; } .pq-previa.bad { border-color: #d64545; }

/* Producto elegido con «Usar» (catálogo lateral): junto al riel, dice qué hace el dedo y se suelta con la ✕. */
.elegido { position: fixed; left: 104px; top: 84px; z-index: 15; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100% - 220px)); padding: 6px 6px 6px 8px; background: var(--surface); border: 2px solid var(--accent); border-radius: 16px; box-shadow: var(--shadow); }
.elegido[hidden] { display: none; }
.elegido-img { width: 52px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #f3f2ee; overflow: hidden; color: var(--accent); }
.elegido-img img { width: 100%; height: 100%; object-fit: contain; }
.elegido-txt { min-width: 0; display: flex; flex-direction: column; }
.elegido-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elegido-txt small { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .elegido { top: 132px; } }

/* ═════════ UN PROBLEMA A LA VEZ (15-11): la explicación va a la DERECHA (horizontal) o abajo (vertical); la escena,
   2D o 3D, queda a la izquierda enfocada en el sitio. La barra del mueble y la barra 3D se apartan mientras tanto. ═════════ */
.porque { left: auto; right: 12px; top: 136px; width: min(400px, 38vw); max-height: calc(100% - 136px - 104px); scroll-padding-bottom: 76px; }
.pq-etiqueta { flex: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pq-etiqueta.warn { background: #fff1dc; color: #9a5300; } .pq-etiqueta.bad { background: #fde8e8; color: #b42323; } .pq-etiqueta.ok { background: #e8f6ee; color: #1e7a4a; }
.pq-pie { position: sticky; bottom: -10px; display: flex; gap: 8px; padding: 10px 14px 0; background: var(--surface); }
.pq-pie .btn { flex: 1; min-height: 46px; font-weight: 700; }
.pq-ideas { border-top: 1px solid var(--line); padding-top: 6px; }
.pq-ideas > summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--accent); min-height: 36px; display: flex; align-items: center; }
body.explicando #barra3d { display: none; }
@media (max-width: 900px) {
  .porque { left: 12px; right: 96px; width: auto; top: auto; bottom: 12px; max-height: 42vh; }
}

/* ═════════ «Una frase y un dibujo» (crítica de Carlos del 15-11): la frase sencilla, UN botón de arreglo con vista
   previa y lo técnico plegado en «Detalles técnicos». ═════════ */
.pq-cuerpo { grid-template-columns: minmax(0, 1fr); }
.pq-frase { margin: 0; font-size: 16.5px; line-height: 1.5; padding: 12px 14px; border-radius: 14px; background: #fdecec; color: #4a1212; white-space: normal; overflow-wrap: anywhere; }
.pq-frase b { color: inherit; } .pq-frase > b:first-child { display: block; margin-bottom: 4px; font-size: 17px; }
.pq-frase.naranja { background: #fff4e3; color: #4d2c00; } .pq-frase.verde { background: #e8f6ee; color: #14532d; }
.pq-arreglar { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; height: auto; padding: 10px 14px; text-align: left; white-space: normal; line-height: 1.3; font-size: 15px; font-weight: 700; border-radius: 14px; }
.pq-arreglar > svg { flex: none; }
.pq-arreglar span { display: grid; gap: 2px; min-width: 0; }
.pq-arreglar small { font-size: 12px; font-weight: 600; opacity: .85; }
.pq-arreglo-nota { font-size: 13px; color: #8a4a00; margin-top: -4px; }
.pq-tecnico { border-top: 1px solid var(--line); padding-top: 4px; }
.pq-tecnico > summary { cursor: pointer; font-size: 13.5px; font-weight: 650; color: var(--muted); min-height: 40px; display: flex; align-items: center; }
.pq-tecnico-cuerpo { display: grid; gap: 6px; padding-bottom: 6px; }
.pq-previa { position: static; padding: 10px 12px; font-size: 14.5px; line-height: 1.45; }
.pq-previa .pq-sug-acc .btn { min-height: 48px; flex: 1; font-weight: 700; }
.l3.cuello.grande { font-size: 16px; padding: 6px 14px; background: var(--bad); border-color: #fff; }
.l3.cuello.grande.naranja { background: var(--warn); } .l3.cuello.grande.verde { background: var(--ok); }
.l3.puerta3d { background: #1f2328; font-size: 13px; }
body.navegando .etiquetas3d .l3.puerta3d { opacity: 1; }

/* ---------- acabados (O10): visor de pisos y color de cada pared ---------- */
.acab { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 100%; }
.acab-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acab-resumen { font-weight: 600; color: var(--muted); }
.acab-fila { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.acab-rotulo { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-left: 4px; }
.acab-nota { color: var(--muted); font-size: 12px; padding-left: 4px; }
.piso-tarjetas { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.piso-tarjetas::-webkit-scrollbar { display: none; }
.piso-tarjeta { flex: none; width: 104px; display: grid; justify-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.piso-tarjeta img { width: 76px; height: 76px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.piso-tarjeta b { font-size: 12.5px; line-height: 1.15; text-align: center; }
.piso-tarjeta small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.piso-tarjeta.on { border-color: var(--accent); background: #eef3ff; }
.acab .chip { min-height: 48px; }
.acab .muestras .muestra, .acab .muestra { width: 48px; height: 48px; }
.muestra { cursor: pointer; }
.muestra.libre { position: relative; display: inline-grid; place-items: center; font-size: 22px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-style: dashed; overflow: hidden; }
.muestra.libre input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.acab-paredes .muestras { max-width: 100%; }
/* Recuadro (O11): qué hace cada sentido, con el mismo trazo que se ve en la planta. */
.ctx-recuadro { display: grid; gap: 4px; padding: 2px 8px; font-size: 13.5px; }
.ctx-recuadro > b { font-size: 14px; }
.ctx-recuadro span { display: flex; align-items: center; gap: 8px; }
.ctx-recuadro i { flex: none; width: 34px; height: 18px; border-radius: 3px; }
.ctx-recuadro .trazo-continuo { border: 2px solid var(--accent); background: rgba(37,99,235,.08); }
.ctx-recuadro .trazo-discontinuo { border: 2px dashed #1f8a5b; background: rgba(31,138,91,.08); }
@media (max-width: 700px) { .piso-tarjeta { width: 92px; } .piso-tarjeta img { width: 66px; height: 66px; } }

/* ---------- Recuadro en 3D (O11): el mismo trazo que en la planta, sobre el lienzo 3D ---------- */
.recuadro3d { position: absolute; inset: 0; pointer-events: none; z-index: 6; --c: #2563eb; --f: rgba(37, 99, 235, .07); --fc: rgba(37, 99, 235, .16); }
.recuadro3d[hidden] { display: none; }
.recuadro3d[data-modo="toca"] { --c: #1f8a5b; --f: rgba(31, 138, 91, .07); --fc: rgba(31, 138, 91, .16); }
.recuadro3d svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.recuadro3d .cand { fill: var(--fc); stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.recuadro3d .marco { fill: var(--f); stroke: var(--c); stroke-width: 2; }
.recuadro3d[data-modo="toca"] .marco { stroke-dasharray: 9 6; }
.recuadro3d-pastilla { position: absolute; left: 0; top: 0; max-width: min(460px, calc(100% - 24px)); padding: 4px 10px; border-radius: 999px; background: var(--c); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }

/* ---------- interruptor «Imán» (guías de centrado de la planta, G2) ---------- */
/* Las guías son de la planta: en 3D el interruptor no se muestra (las guías 3D son de la fase G3). */
body[data-view="3d"] .leyenda [data-acc="iman"] { display: none; }
.leyenda [data-acc="iman"][aria-pressed="true"] .llave { background: #d0208f; }

/* ---------- elementos por superficie: revestimientos y repisas (CARPINTERIA-0450 Parte 2) ---------- */
/* Sólo los usa la barra de la herramienta «Revestimiento» y la de un elemento elegido (ui/superficies.js). Compacta: la
   tableta debe seguir viendo el muro que se reviste sobre la barra. */
.sup-form { display: flex; flex-direction: column; gap: 6px; max-width: 900px; }
.sup-form .fila { gap: 6px; }
.sup-form .campo { min-height: 44px; padding-left: 8px; }
.sup-form .campo input { width: 62px; min-height: 36px; font-size: 16px; }
.sup-form .campo output { min-width: 0; }
.sup-form .chip { min-height: 40px; }
.sup-form small.muted, .sup-inactivo { font-size: 12px; color: var(--muted); }
.sup-etq { font-size: 12px; color: var(--muted); font-weight: 600; padding-left: 2px; }
.sup-referencia .campo.ancho select { width: min(330px, 48vw); text-align: left; font-size: 14px; }
.sup-sep { width: 1px; align-self: stretch; background: var(--line); margin: 4px 2px; }
.sup-resumen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 8px; background: var(--surface-2); border-radius: 12px; }
.sup-resumen-txt { display: flex; flex-direction: column; gap: 2px; min-width: 200px; flex: 1 1 260px; }
.sup-resumen-txt b { font-size: 13px; }
.sup-resumen-txt .sup-precio { font-size: 14px; font-weight: 650; }
.sup-resumen-txt small { font-size: 11.5px; line-height: 1.3; }
.sup-resumen-txt small.error { color: var(--bad); }
.sup-resumen-txt small.aviso { color: #9a5300; }
.sup-alzado { width: 180px; flex: none; }
.sup-alzado svg { width: 100%; height: auto; display: block; max-height: 96px; }
.sup-acciones { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }
