/* Casa Inteligente — tema oscuro "slate + verde de estado" (ui-ux-pro-max), con modo claro. */
:root {
  --bg: #0F172A; --fondo-2: #131C31; --card: #1B2336; --card-2: #222B40; --borde: #33405A;
  --tx: #F8FAFC; --mut: #94A3B8; --acento: #22C55E; --sobre-acento: #0F172A;
  --azul: #60A5FA; --ambar: #FBBF24; --rojo: #F87171; --anillo: #F8FAFC;
  --radio: 16px; --sombra: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .18);
  --nav-h: 64px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F1F5F9; --fondo-2: #E8EEF5; --card: #FFFFFF; --card-2: #F1F5F9; --borde: #D5DEE9;
    --tx: #0F172A; --mut: #526075; --acento: #15803D; --sobre-acento: #FFFFFF;
    --azul: #1D4ED8; --ambar: #B45309; --rojo: #B91C1C; --anillo: #0F172A;
    --sombra: 0 1px 2px rgb(15 23 42 / .06), 0 8px 24px rgb(15 23 42 / .06);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--tx);
  font: 16px/1.5 "Plus Jakarta Sans", system-ui, sans-serif;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--anillo); outline-offset: 2px; border-radius: 8px; }
.mut { color: var(--mut); }
.peq { font-size: .875rem; }

.ico { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--borde);
  background: var(--card-2); color: var(--tx); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s, transform .1s;
}
.btn:hover { border-color: var(--mut); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.primario { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.btn.peligro { color: var(--rojo); }
.btn.ancho { width: 100%; }

/* Formularios */
.campo { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; margin-bottom: 14px; }
.campo input, .campo select, .campo textarea {
  font: inherit; font-weight: 400; color: var(--tx); background: var(--fondo-2);
  border: 1px solid var(--borde); border-radius: 12px; padding: 11px 12px; min-height: 44px; width: 100%;
}
.campo textarea { min-height: 96px; resize: vertical; }
.ayuda { color: var(--mut); font-weight: 400; font-size: .85rem; }
.error { color: var(--rojo); min-height: 1.5em; font-size: .9rem; margin-bottom: 8px; }

/* Acceso */
.acceso { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.acceso-caja { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--borde); border-radius: 20px; padding: 28px 24px; box-shadow: var(--sombra); }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; margin-bottom: 20px; }
.marca .ico { color: var(--acento); width: 28px; height: 28px; }
.pestanas { display: grid; grid-template-columns: 1fr 1fr; background: var(--fondo-2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.pestanas button { min-height: 40px; border: 0; border-radius: 9px; background: none; color: var(--mut); font: inherit; font-weight: 600; cursor: pointer; }
.pestanas button[aria-selected="true"] { background: var(--card); color: var(--tx); box-shadow: var(--sombra); }
.servidor { margin-top: 16px; color: var(--mut); }
.servidor summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.servidor .campo { color: var(--tx); }

/* Estructura: barra inferior en móvil, lateral en escritorio */
.app { min-height: 100dvh; }
.contenido { padding: 20px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; }
.nav {
  position: fixed; inset: auto 0 0 0; z-index: 10; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--card); border-top: 1px solid var(--borde);
}
.nav-marca { display: none; }
.nav a, .nav button {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--mut); text-decoration: none; font: inherit; font-size: .75rem; font-weight: 600; background: none; border: 0; cursor: pointer;
  transition: color .15s;
}
.nav a[aria-current="page"] { color: var(--acento); }
.nav .punto { position: absolute; top: 10px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--rojo); }
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 240px 1fr; }
  .nav { position: sticky; top: 0; height: 100dvh; flex-direction: column; gap: 4px; padding: 20px 12px; border-top: 0; border-right: 1px solid var(--borde); }
  .nav-marca { display: flex; padding: 0 10px; }
  .nav a, .nav button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: .95rem; }
  .nav a:hover, .nav button:hover { background: var(--card-2); color: var(--tx); }
  .nav a[aria-current="page"] { background: var(--card-2); }
  .nav .punto { position: static; margin-left: auto; }
  .nav-salir { margin-top: auto; }
  .contenido { padding: 32px 32px 48px; width: 100%; }
}

/* Encabezado */
.cabecera { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; font-size: .85rem; font-weight: 600; background: var(--card-2); border: 1px solid var(--borde); white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mut); }
.chip.ok::before { background: var(--acento); }
.chip.mal::before { background: var(--rojo); }
.chip.sin::before { display: none; }

.aviso { background: color-mix(in srgb, var(--ambar) 18%, var(--card)); color: var(--tx); border: 1px solid var(--ambar); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-weight: 500; }

/* Tarjetas */
.tarjeta { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.seccion { margin-top: 28px; }
.seccion > h2 { margin-bottom: 12px; }

.disp { display: grid; gap: 14px; align-content: start; }
.disp-cab { display: flex; align-items: center; gap: 12px; }
.disp-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); color: var(--mut); transition: background .2s, color .2s; }
.disp-ico .ico { width: 24px; height: 24px; }
.disp.activo .disp-ico { background: color-mix(in srgb, var(--color, var(--acento)) 18%, transparent); color: var(--color, var(--acento)); }
.disp-valor { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.disp-acciones { display: flex; gap: 8px; }
.disp-acciones .btn { flex: 1; }
.barra { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.barra > span { display: block; height: 100%; background: var(--ambar); border-radius: inherit; transition: width .4s ease-out; }
.pulso { width: 10px; height: 10px; border-radius: 50%; background: var(--acento); box-shadow: 0 0 0 0 var(--acento); animation: pulso 1.6s infinite; }
@keyframes pulso { to { box-shadow: 0 0 0 10px transparent; } }

/* Interruptor */
.interruptor { position: relative; width: 52px; height: 30px; flex: none; }
.interruptor input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.interruptor span { position: absolute; inset: 0; border-radius: 99px; background: var(--borde); transition: background .2s; pointer-events: none; }
.interruptor span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.interruptor input:checked + span { background: var(--acento); }
.interruptor input:checked + span::after { transform: translateX(22px); }
.interruptor input:focus-visible + span { outline: 2px solid var(--anillo); outline-offset: 2px; }
.fila { display: flex; align-items: center; gap: 14px; }
.fila > .crece { flex: 1; min-width: 0; }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--borde); }
.lista li:first-child { border-top: 0; }
.lista .crece { flex: 1; min-width: 0; }
.no-leida { font-weight: 600; }
.no-leida::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--azul); }
.estado { font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.estado.pendiente { background: color-mix(in srgb, var(--ambar) 20%, transparent); color: var(--ambar); }
.estado.aprobada { background: color-mix(in srgb, var(--acento) 20%, transparent); color: var(--acento); }
.estado.rechazada { background: color-mix(in srgb, var(--rojo) 20%, transparent); color: var(--rojo); }
.umbral { width: 96px; font: inherit; color: var(--tx); background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 10px; padding: 8px; min-height: 40px; }

.vacio { text-align: center; padding: 40px 20px; display: grid; gap: 12px; justify-items: center; }
.vacio .ico { width: 44px; height: 44px; color: var(--mut); }

/* Avisos emergentes */
.toasts { position: fixed; z-index: 20; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; width: 100%; background: var(--tx); color: var(--bg); border-radius: 12px; padding: 12px 16px; font-weight: 600; box-shadow: var(--sombra); animation: entra .2s ease-out; }
.toast.mal { background: var(--rojo); color: #fff; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 900px) { .toasts { left: auto; bottom: 24px; justify-items: end; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- v2 ---------- */
@media (max-width: 899px) { .solo-escritorio { display: none !important; } }
.btn.icono { width: 44px; padding: 0; flex: none; }
.btn.chico { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.selector-casa { font: inherit; font-size: 1.5rem; font-weight: 700; color: var(--tx); background: none; border: 0; padding: 0; max-width: 100%; cursor: pointer; }
.selector-casa option { font-size: 1rem; background: var(--card); }
.grupo-hab { margin-top: 24px; }
.grupo-hab > h2 { margin-bottom: 12px; color: var(--mut); font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.rejilla-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }

/* Deslizador de la cortina */
.deslizador { display: grid; gap: 6px; }
.deslizador input[type=range] { width: 100%; accent-color: var(--azul); min-height: 32px; cursor: pointer; }
.deslizador .fila { justify-content: space-between; font-size: .85rem; color: var(--mut); }

/* Formularios en tarjetas */
.form-grid { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.form-grid .completo { grid-column: 1 / -1; }
.oracion { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.oracion select, .oracion input { width: auto; min-width: 0; flex: 1 1 140px; }
.oracion span { color: var(--mut); font-weight: 600; }
details.plegable > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--acento); }
details.plegable > summary::-webkit-details-marker { display: none; }
details.plegable[open] > summary { margin-bottom: 12px; }
.dias { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.dias label { position: relative; }
.dias input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dias span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--borde); font-weight: 600; font-size: .9rem; background: var(--fondo-2); color: var(--mut); transition: background .15s, color .15s; }
.dias input:checked + span { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.dias input:focus-visible + span { outline: 2px solid var(--anillo); outline-offset: 2px; }
.token { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 8px; padding: 4px 8px; word-break: break-all; }
.casa-admin { display: grid; gap: 14px; }
.casa-admin + .casa-admin { margin-top: 16px; }
.chip-ok { color: var(--acento); }

/* Gráficas (dataviz: marcas finas, rejilla tenue, tooltip al pasar) */
.grafica { position: relative; }
.grafica svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafica .rej line { stroke: var(--borde); stroke-width: 1; stroke-dasharray: 2 4; }
.grafica .eje text { fill: var(--mut); font-size: 11px; font-family: inherit; }
.grafica .linea { fill: none; stroke: var(--ambar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grafica .area { fill: var(--ambar); opacity: .12; }
.grafica .barra-g { fill: var(--acento); }
.grafica .barra-g.activa { opacity: .75; }
.grafica .cruz { stroke: var(--mut); stroke-width: 1; }
.grafica .punto-g { fill: var(--ambar); stroke: var(--card); stroke-width: 2; }
.tooltip { position: absolute; pointer-events: none; background: var(--tx); color: var(--bg); font-size: .85rem; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--sombra); }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
.tabla th, .tabla td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--borde); }
.tabla th { color: var(--mut); font-weight: 600; }
.segmento { display: inline-flex; background: var(--fondo-2); border-radius: 12px; padding: 4px; }
.segmento button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--mut); font: inherit; font-weight: 600; cursor: pointer; }
.segmento button[aria-pressed="true"] { background: var(--card); color: var(--tx); box-shadow: var(--sombra); }
.stat { font-size: 1.6rem; font-weight: 700; }

/* ---------- v3: solicitudes ---------- */
@media (min-width: 900px) { .solo-movil, .campana-movil { display: none !important; } }
.app { position: relative; }
.campana-movil { position: absolute; z-index: 11; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: var(--card); border: 1px solid var(--borde); color: var(--tx); box-shadow: var(--sombra); }
.campana-movil .punto { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--rojo); }
@media (max-width: 899px) { .cabecera { padding-right: 52px; } }
.canal-sel { font: inherit; font-size: .85rem; color: var(--tx); background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 8px; padding: 6px 8px; margin-top: 4px; min-height: 36px; }

/* lista de solicitudes */
.sol-lista { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.sol-card { display: grid; gap: 10px; animation: sube .35s ease-out both; }
@keyframes sube { from { opacity: 0; transform: translateY(12px); } }
.detalle-sol { display: grid; gap: 10px; }
.chips-disp { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips-disp li { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; padding: 2px 8px 2px 4px; border-radius: 99px; background: var(--fondo-2); border: 1px solid var(--borde); border-top: 1px solid var(--borde) !important; }
.chips-disp .ico { width: 16px; height: 16px; }
.punto-hab { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--c); margin-top: 6px; }
.punto-hab.grande { width: 18px; height: 18px; margin: 0; }

/* asistente */
.asistente { display: grid; gap: 18px; overflow: hidden; }
.asis-titulo { font-size: 1.3rem; }
.pasos { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.pasos li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--mut); font-size: .78rem; font-weight: 600; text-align: center; }
.pasos-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--borde); background: var(--fondo-2); transition: background .3s, border-color .3s, color .3s; }
.pasos-num .ico { width: 16px; height: 16px; }
.pasos li.hecho .pasos-num { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.pasos li.actual { color: var(--tx); }
.pasos li.actual .pasos-num { border-color: var(--acento); color: var(--acento); animation: anillo 1.8s ease-out infinite; }
@keyframes anillo { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acento) 45%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (max-width: 520px) { .pasos-txt { display: none; } .pasos li.actual .pasos-txt { display: block; } }
.progreso { height: 6px; border-radius: 99px; background: var(--fondo-2); overflow: hidden; }
.progreso span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--acento), color-mix(in srgb, var(--acento) 60%, var(--azul))); transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.paso-cuerpo { min-height: 120px; }
.entra-der { animation: entraDer .32s cubic-bezier(.2, .8, .2, 1); }
.entra-izq { animation: entraIzq .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes entraDer { from { opacity: 0; transform: translateX(28px); } }
@keyframes entraIzq { from { opacity: 0; transform: translateX(-28px); } }
.asis-pie { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--borde); padding-top: 16px; }
.asistente > .error:empty { display: none; }
.sacudir { animation: sacudir .4s; }
@keyframes sacudir { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.tarjeta-sub { background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 14px; padding: 16px; display: grid; gap: 12px; align-content: start; }

/* opciones grandes */
.opciones { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.opcion { position: relative; display: grid; gap: 6px; justify-items: start; text-align: left; padding: 18px; min-height: 44px; border-radius: 16px; cursor: pointer;
  background: var(--fondo-2); border: 2px solid var(--borde); color: var(--tx); font: inherit; transition: border-color .2s, transform .2s, box-shadow .2s, background .2s; }
.opcion:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--mut); box-shadow: var(--sombra); }
.opcion:disabled { opacity: .5; cursor: not-allowed; }
.opcion strong { font-size: 1.05rem; }
.opcion-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--card); color: var(--acento); transition: transform .3s; }
.opcion-ico .ico { width: 26px; height: 26px; }
.opcion-check { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--acento); color: var(--sobre-acento); transform: scale(0); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.opcion-check .ico { width: 16px; height: 16px; }
.opcion.elegida { border-color: var(--acento); background: color-mix(in srgb, var(--acento) 10%, var(--fondo-2)); }
.opcion.elegida .opcion-check { transform: scale(1); }
.opcion.elegida .opcion-ico { transform: scale(1.08) rotate(-4deg); }

/* stepper y medidas */
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper .btn.icono { font-size: 1.3rem; line-height: 1; }
.stepper-valor { min-width: 56px; text-align: center; font-weight: 700; font-size: 1.05rem; }
.medidas { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.mini-marco { display: grid; place-items: center; height: 170px; padding: 10px; }
.mini-casa { max-width: 100%; max-height: 100%; width: 100%; display: grid; place-items: center; border: 2px solid var(--acento); border-radius: 8px;
  background-color: color-mix(in srgb, var(--acento) 8%, transparent);
  background-image: linear-gradient(var(--borde) 1px, transparent 1px), linear-gradient(90deg, var(--borde) 1px, transparent 1px); background-size: 12px 12px;
  font-weight: 700; transition: aspect-ratio .3s; animation: entraEsc .3s ease-out; }
.mini-casa span { background: var(--card); padding: 2px 10px; border-radius: 99px; }
@keyframes entraEsc { from { transform: scale(.94); opacity: .6; } }

/* editor del plano */
.editor { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .editor { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; } }
.editor-plano { display: grid; gap: 12px; min-width: 0; }
.paleta, .chips-habs { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-hab { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--borde); background: var(--fondo-2); color: var(--tx); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.chip-hab .punto-hab { margin: 0; width: 10px; height: 10px; border-radius: 50%; }
.chip-hab.elegida { border-color: var(--c); background: color-mix(in srgb, var(--c) 20%, var(--fondo-2)); transform: translateY(-1px); }
.chip-hab .cuenta { background: var(--c); color: #0F172A; border-radius: 99px; padding: 0 7px; font-size: .75rem; }
.marco-plano { background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 14px; padding: 8px; overflow: hidden; }
.plano { display: block; width: 100%; height: auto; max-height: 70vh; user-select: none; -webkit-user-select: none; }
.plano.modo-dibujar { touch-action: none; cursor: crosshair; }
.plano .cuadricula line { stroke: var(--borde); stroke-width: 1; opacity: .7; }
.plano .cuadricula line.mayor { opacity: 1; stroke-width: 1.5; }
.plano .borde { fill: none; stroke: var(--mut); stroke-width: 2; }
.plano .cota { fill: var(--mut); font: 600 13px "Plus Jakarta Sans", system-ui, sans-serif; }
.plano .hab { cursor: pointer; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.plano.modo-dibujar .hab { cursor: grab; }
.plano.solo-ver .hab { cursor: default; }
.plano .hab-fondo { fill: var(--c); fill-opacity: .22; stroke: var(--c); stroke-width: 2; transition: fill-opacity .2s; }
.plano .hab:hover .hab-fondo { fill-opacity: .32; }
.plano .hab.sel .hab-fondo { fill-opacity: .36; stroke-width: 3; stroke-dasharray: 8 5; animation: hormigas .8s linear infinite; }
@keyframes hormigas { to { stroke-dashoffset: -13; } }
.plano .hab.destino .hab-fondo { fill-opacity: .5; stroke-width: 4; }
.plano .hab.mala .hab-fondo, .plano .vista-previa.mala { fill: var(--rojo); stroke: var(--rojo); }
.plano .hab.nueva { animation: aparece .35s cubic-bezier(.3, 1.4, .5, 1); transform-box: fill-box; }
@keyframes aparece { from { opacity: 0; } }
.plano .hab.sacudir { animation: none; }
.plano .hab-nombre { fill: var(--tx); font: 700 13px "Plus Jakarta Sans", system-ui, sans-serif; pointer-events: none; }
.plano .hab-area { fill: var(--mut); font: 500 11px "Plus Jakarta Sans", system-ui, sans-serif; pointer-events: none; }
.plano .vista-previa { fill: var(--c, var(--acento)); fill-opacity: .25; stroke: var(--c, var(--acento)); stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.plano .insignia { pointer-events: none; }
.plano .insignia > circle:first-child { fill: var(--card); stroke: var(--c); stroke-width: 2; }
.plano .insignia-ico { fill: none; stroke: var(--tx); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.plano .insignia-n { fill: var(--acento); }
.plano .insignia-txt { fill: var(--sobre-acento); font: 700 10px system-ui, sans-serif; }
.plano .insignia.pop { animation: pop .45s cubic-bezier(.3, 1.8, .5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes pop { 0% { transform: scale(.2); } 60% { transform: scale(1.25); } }
.panel-hab { min-width: 0; }
.panel-anim { animation: entraDer .25s ease-out; border-left: 4px solid var(--c); }
.panel-hab h3 { font-size: 1rem; }
.cruceta { display: grid; grid-template-areas: ". a ." "i . d" ". b ."; grid-template-columns: repeat(3, 44px); gap: 4px; }

/* catálogo */
.catalogo { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.editor .catalogo { grid-template-columns: 1fr; max-height: 70vh; overflow: auto; padding-right: 4px; }
.cat-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--fondo-2); border: 1px solid var(--borde); animation: sube .3s ease-out both; transition: border-color .2s, background .2s; }
.cat-item.con { border-color: var(--acento); background: color-mix(in srgb, var(--acento) 8%, var(--fondo-2)); }
.cat-ico { position: relative; width: 48px; height: 48px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--card); color: var(--acento); }
.cat-ico .ico { width: 24px; height: 24px; }
.cat-ico.asa { cursor: grab; touch-action: none; }
.cat-ico.asa:active { cursor: grabbing; }
.cat-agarre { position: absolute; left: -2px; top: 50%; transform: translateY(-50%); color: var(--mut); }
.cat-agarre .ico { width: 14px; height: 14px; }
.cat-nombre { font-weight: 700; }
.cat-item .mut.peq { font-size: .8rem; }
.etiqueta { display: inline-block; margin-top: 4px; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--ambar) 18%, transparent); color: var(--ambar); }
.etiqueta.ok { background: color-mix(in srgb, var(--acento) 18%, transparent); color: var(--acento); }
.cat-item .stepper-valor { min-width: 28px; }
.fantasma { position: fixed; z-index: 50; left: 0; top: 0; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px;
  border-radius: 12px; background: var(--acento); color: var(--sobre-acento); font-weight: 700; box-shadow: 0 10px 30px rgb(0 0 0 / .35); }

/* resumen y éxito */
.resumen-cifras { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.cifra { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--fondo-2); border: 1px solid var(--borde); animation: sube .3s ease-out both; }
.cifra strong { font-size: 1.15rem; overflow-wrap: anywhere; }
.exito { justify-items: center; text-align: center; padding: 36px 20px; }
.exito-check { width: 88px; height: 88px; }
.exito-check circle { fill: none; stroke: var(--acento); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: traza .6s ease-out forwards; }
.exito-check path { fill: none; stroke: var(--acento); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: traza .35s .5s ease-out forwards; }
@keyframes traza { to { stroke-dashoffset: 0; } }
.exito h2 { font-size: 1.4rem; animation: sube .4s .4s ease-out both; }
@media (max-width: 999px) {
  .editor-plano.pegajoso { position: sticky; top: 0; z-index: 3; background: var(--card); padding: 8px 0; margin: -8px 0 0; box-shadow: 0 12px 16px -12px rgb(0 0 0 / .4); }
  .editor-plano.pegajoso > p:first-child { display: none; }
  .editor-plano.pegajoso .plano { max-height: 34vh; }
  .editor-plano.pegajoso .chips-habs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .editor-plano.pegajoso .chip-hab { flex: none; }
}
.asistente { overflow: clip; } /* clip no rompe el sticky del plano */
