/* Visor de tours 360 — estilos propios (los de Photo Sphere Viewer van en vendor/psv) */
:root {
  color-scheme: dark; /* interfaz oscura a propósito: va sobre la foto 360 */
  --acento: #e0a458;
  --texto-acento: #1a1408; /* el visor lo cambia a blanco si el color de acento del tour es oscuro */
  --fondo-ui: rgba(18, 20, 24, 0.88); /* sin desenfoque detrás: el desenfoque encima de la foto 360 hacía que arrastrar se sintiera trabado */
  --fondo-ui-solido: #16181c;
  --borde-ui: rgba(255, 255, 255, 0.14);
  --texto-ui: #f4f2ee;
  --texto-ui-suave: #b9b4ab;
  --radio: 12px;
  --sombra: 0 8px 30px rgba(0, 0, 0, 0.35);
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0d0e10; color: var(--texto-ui); font-family: var(--fuente); overflow: hidden; }
#visor { position: fixed; inset: 0; }

/* Cabecera y acciones */
#cabecera {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); z-index: 120;
  display: flex; align-items: center; gap: 10px; max-width: min(60vw, 520px);
  padding: 8px 14px 8px 10px; border-radius: var(--radio);
  background: var(--fondo-ui);
  border: 1px solid var(--borde-ui); box-shadow: var(--sombra); pointer-events: none;
}
#cabecera[hidden], #acciones[hidden] { display: none; }
#logo { height: 34px; width: auto; border-radius: 6px; }
.cabecera-textos { min-width: 0; }
#titulo { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#subtitulo { margin: 1px 0 0; font-size: 12px; color: var(--texto-ui-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#subtitulo:empty { display: none; }
body:has(.psv-panel--open) #acciones, body:has(#vista3d) #acciones, body:has(#vista3d) #cabecera,
body:has(.psv-gallery--open) #acciones, body:has(.psv-gallery--open) #cabecera { display: none; }
/* con botón de contacto, título y botón se reparten el ancho para no taparse (también en horizontal y tablets) */
body:has(#acciones:not([hidden])) #cabecera { max-width: min(55vw, 520px); }
#contacto { display: block; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#acciones { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 120; display: flex; gap: 8px; }
.boton-acento {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  background: var(--acento); color: var(--texto-acento); font-weight: 650; font-size: 14px; text-decoration: none; border: 0; cursor: pointer;
  box-shadow: var(--sombra);
}
.boton-acento:hover { filter: brightness(1.07); }
.boton-acento:focus-visible, .pin-etiqueta:focus-visible, button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Barra de navegación de PSV con nuestros colores */
.psv-navbar { background: var(--fondo-ui) !important; }
.psv-button svg { width: 100%; height: 100%; }
.psv-caption-content { font-family: var(--fuente); font-weight: 600; }
.psv-panel { font-family: var(--fuente); background: var(--fondo-ui-solido) !important; }
.psv-panel-content { color: var(--texto-ui); }
.psv-tooltip { font-family: var(--fuente); }
.psv-virtual-tour-arrow { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }

/* Pines de etiquetas */
.pin-etiqueta {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--pin) 35%, transparent); border: 2px solid #fff;
  display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  animation: latido 2.6s ease-in-out infinite;
}
.pin-etiqueta span { width: 12px; height: 12px; border-radius: 50%; background: var(--pin); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
@keyframes latido { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pin) 55%, transparent), 0 2px 10px rgba(0,0,0,.45); } 50% { box-shadow: 0 0 0 10px transparent, 0 2px 10px rgba(0,0,0,.45); } }
@media (prefers-reduced-motion: reduce) { .pin-etiqueta { animation: none; } }

.panel-etiqueta { padding: 6px 4px 20px; line-height: 1.55; font-size: 15px; }
.panel-etiqueta h2 { margin: 6px 0 12px; font-size: 20px; line-height: 1.25; }
.panel-etiqueta img { width: 100%; border-radius: 10px; margin: 4px 0 12px; display: block; }
.panel-etiqueta p { margin: 0 0 12px; color: #dcd8d0; }
.panel-etiqueta h3 { margin: 22px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-ui-suave); }

/* ---------- Botones del negocio y marca (capa dentro de #visor: también se ve en pantalla completa) ---------- */
/* sin z-index propio: los botones quedan debajo de la barra y del plano de PSV (si algo se cruzara, PSV sigue usable)
   y la hoja de contacto queda encima de todo */
.negocio { position: absolute; inset: 0; pointer-events: none; font-family: var(--fuente); }
/* mientras llega una foto 360, la capa «Cargando…» de PSV (z-index 80) cubre todo el visor: que no se trague los toques,
   así WhatsApp, Contactar y la marca responden aunque la foto tarde minutos con datos lentos */
.psv-loader-container { pointer-events: none; }
.neg-botones, .neg-marca { z-index: 30; }
.neg-hoja-fondo { z-index: 200; }
.neg-hoja { z-index: 201; }
.neg-marca:has(.neg-marca-pop:not([hidden])) { z-index: 202; } /* la ventanita de la marca, encima de todo */
.negocio [hidden] { display: none !important; }
.neg-tapado { visibility: hidden !important; }
/* lo que no se debe tapar: galería, plano ampliado, vista 3D, error y el modo de capturar un clic del editor */
body.ed-capturando .negocio, body:has(#vista3d) .negocio, body:has(#error:not([hidden])) .negocio,
#visor:has(.psv-gallery--open) .negocio, #visor:has(.psv-map--maximized) .negocio { display: none; }
#visor:has(.psv-panel--open) .neg-botones { display: none; }
/* escena sin lugar en el plano (sector aparte o toma suelta: ver js/visor.js) */
.sin-lugar-en-plano .psv-map { display: none !important; }

/* recorrido libre (js/recorrido.js): círculos en el piso donde están las otras tomas, el cursor sobre el piso y el
   paso hacia adelante. Los círculos y el cursor no reciben clics: el clic lo lee el visor y elige la toma. */
.psv-marker.recorrido-toma, .psv-marker.recorrido-cursor { pointer-events: none !important; }
.psv-marker.recorrido-toma { transition: fill 0.15s ease; }
.psv-marker.recorrido-toma.recorrido-resaltada { fill: rgba(255, 255, 255, 0.6); stroke-width: 4; }
.psv-marker.recorrido-cursor.recorrido-sin-destino { fill: rgba(255, 255, 255, 0.05); stroke: rgba(255, 255, 255, 0.4); }
.recorrido-libre.recorrido-apunta .psv-canvas-container { cursor: pointer; }
.recorrido-paso {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none;
  transition: filter 0.3s ease;
}
.recorrido-paso--cargando { filter: brightness(0.8); }
.neg-botones {
  position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: var(--neg-abajo, 50px);
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: min(320px, calc(100% - 24px)); pointer-events: auto;
}
.neg-boton {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%; padding: 8px 16px 8px 12px;
  border-radius: 999px; border: 1px solid var(--borde-ui); background: var(--fondo-ui); color: var(--texto-ui);
  font: 650 14px/1.2 var(--fuente); text-decoration: none; cursor: pointer; box-shadow: var(--sombra);
  transition: filter .12s, transform .12s;
}
.neg-boton:hover { filter: brightness(1.15); }
.neg-boton:active { transform: scale(.97); }
.neg-boton.principal { background: var(--acento); color: var(--texto-acento); border-color: transparent; }
.neg-boton:not(.principal)[data-tipo="whatsapp"] .neg-icono { color: #25d366; }
.neg-icono { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.neg-icono svg { display: block; width: 100%; height: 100%; }
.neg-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.negocio a:focus-visible, .negocio button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.neg-marca {
  position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: var(--neg-abajo-izq, 50px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; pointer-events: auto;
}
.neg-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; max-width: min(300px, calc(50vw - 24px)); padding: 4px 12px 4px 5px;
  border-radius: 999px; border: 1px solid var(--borde-ui); background: var(--fondo-ui); color: var(--texto-ui);
  font: 600 12px/1.2 var(--fuente); text-decoration: none; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
 
}
.neg-chip:hover { filter: brightness(1.15); }
.neg-chip > .neg-icono { width: 22px; height: 22px; color: var(--acento); }
.neg-logo { display: block; height: 22px; width: auto; max-width: 110px; border-radius: 4px; object-fit: contain; }
.neg-credito { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neg-palabra { font: 750 12px/1.2 var(--fuente); letter-spacing: .02em; white-space: nowrap; padding: 0 4px; }
button.neg-chip { padding: 4px 10px; }
.neg-quiero {
  padding: 2px 6px; font: 500 11.5px/1.3 var(--fuente); color: var(--texto-ui); opacity: .85; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 2px; text-shadow: 0 1px 4px rgba(0, 0, 0, .9);
}
.neg-quiero:hover { opacity: 1; }
.neg-marca-pop {
  position: absolute; left: 0; bottom: calc(100% + 10px); width: min(270px, calc(100vw - 24px)); display: grid; gap: 2px; padding: 6px;
  background: var(--fondo-ui-solido); border: 1px solid var(--borde-ui); border-radius: 12px; box-shadow: var(--sombra);
}
.neg-marca-pop a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 8px;
  color: var(--texto-ui); text-decoration: none; font: 600 14px/1.25 var(--fuente);
}
.neg-marca-pop a:hover { background: rgba(255, 255, 255, .08); }
.neg-marca-pop .neg-pop-quiero { color: var(--acento); }
.neg-marca-pop .neg-icono { width: 16px; height: 16px; color: var(--texto-ui-suave); }
/* hoja de contacto (teléfono y tablet) */
.neg-hoja-fondo { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .2s; pointer-events: auto; }
.neg-hoja-fondo.abierta { opacity: 1; }
.neg-hoja {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: 100%; max-width: 460px; max-height: calc(100% - 16px); overflow: auto;
  padding: 4px 14px calc(16px + env(safe-area-inset-bottom)); background: var(--fondo-ui-solido); color: var(--texto-ui);
  border: 1px solid var(--borde-ui); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .45);
  transform: translateY(105%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); pointer-events: auto;
}
.neg-hoja.abierta { transform: none; }
.neg-hoja::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); margin: 6px auto 4px; }
.neg-hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.neg-hoja-cab h2 { margin: 0; font: 700 17px var(--fuente); }
.neg-hoja-cerrar { width: 38px; height: 38px; padding: 8px; flex: none; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: var(--texto-ui); cursor: pointer; }
.neg-hoja-cerrar svg { display: block; width: 100%; height: 100%; }
.neg-hoja-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.neg-opcion {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 9px 14px 9px 10px; border-radius: 14px;
  background: #20242a; border: 1px solid var(--borde-ui); color: var(--texto-ui); text-decoration: none; font: 650 15px/1.25 var(--fuente);
}
.neg-opcion:hover { background: #272c33; }
.neg-opcion > .neg-icono:first-child { width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: color-mix(in srgb, var(--acento) 22%, transparent); color: var(--acento); }
.neg-opcion[data-tipo="whatsapp"] > .neg-icono:first-child { background: rgba(37, 211, 102, .16); color: #25d366; }
.neg-opcion > .neg-icono:last-child:not(:first-child) { width: 18px; height: 18px; color: var(--texto-ui-suave); }
.neg-opcion-textos { display: grid; gap: 1px; min-width: 0; flex: 1; }
.neg-detalle { font: 400 12.5px/1.3 var(--fuente); color: var(--texto-ui-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.neg-hoja-abierta #cabecera { display: none; }
body:has(.neg-botones:not([hidden])) #aviso { bottom: 104px; }
@media (prefers-reduced-motion: reduce) { .neg-hoja, .neg-hoja-fondo, .neg-boton { transition: none; } }

/* Error */
#error { position: fixed; inset: 0; z-index: 950; display: grid; place-content: center; padding: 24px; text-align: center; background: #0d0e10; }
#error[hidden] { display: none; }
#error h2 { margin: 0 0 8px; }
#error p { max-width: 560px; margin: 6px auto; color: var(--texto-ui-suave); line-height: 1.5; }
#error code { background: #24272c; padding: 2px 6px; border-radius: 6px; color: #fff; }

/* Aviso flotante */
#aviso {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 12px); z-index: 900;
  background: var(--fondo-ui-solido); color: var(--texto-ui); border: 1px solid var(--borde-ui);
  padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--sombra);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); word-break: break-all;
}
#aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Vista 3D ---------- */
#vista3d { position: fixed; inset: 0; z-index: 300; background: radial-gradient(ellipse at 50% 30%, #2a2e35, #0f1013 70%); }
#vista3d canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.v3d-barra {
  position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 6px; width: max-content; max-width: calc(100vw - 24px);
  background: var(--fondo-ui); border: 1px solid var(--borde-ui); border-radius: 999px;
}
.v3d-barra button, .v3d-barra label {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--texto-ui); border: 0;
  padding: 8px 12px; border-radius: 999px; font: 600 13px var(--fuente); cursor: pointer; white-space: nowrap;
}
.v3d-barra button:hover { background: rgba(255,255,255,.1); }
.v3d-barra button[aria-pressed="true"] { background: var(--acento); color: #1a1408; }
.v3d-barra[hidden], .v3d-barra [hidden] { display: none; }
.v3d-barra input[type="range"] { width: 110px; accent-color: var(--acento); }
.v3d-cerrar { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; }
.v3d-ayuda { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; font-size: 13px; color: var(--texto-ui-suave); max-width: 52vw; line-height: 1.4; pointer-events: none; }
.v3d-ayuda strong { color: var(--texto-ui); display: block; font-size: 15px; }
.v3d-punto {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; color: #fff;
}
.v3d-punto span { background: var(--fondo-ui-solido); border: 1px solid var(--borde-ui); padding: 4px 10px; border-radius: 999px; font: 600 12px var(--fuente); white-space: nowrap; box-shadow: var(--sombra); }
.v3d-punto i { width: 14px; height: 14px; border-radius: 50%; background: var(--acento); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.v3d-punto.actual span { background: var(--acento); color: #1a1408; border-color: transparent; }
.v3d-punto:hover span { filter: brightness(1.15); }
.v3d-medida { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); background: #fff; color: #111; font: 700 13px var(--fuente); padding: 3px 9px; border-radius: 999px; pointer-events: none; box-shadow: var(--sombra); }
.v3d-cargando { position: absolute; inset: 0; display: grid; place-content: center; color: var(--texto-ui-suave); font-size: 15px; }

/* ---------- Editor ---------- */
#editor {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); z-index: 200;
  background: var(--fondo-ui-solido); color: var(--texto-ui); border-left: 1px solid var(--borde-ui);
  display: flex; flex-direction: column; box-shadow: var(--sombra); font-size: 14px;
  transition: transform .25s ease;
}
#editor.oculto { transform: translateX(100%); }
body.con-editor #acciones { right: calc(min(380px, 100vw) + 12px); }
body.con-editor #visor { right: min(380px, 100vw); }
@media (max-width: 760px) { body.con-editor #visor { right: 0; bottom: 55%; } body.con-editor #acciones { right: 12px; } #editor { top: 45%; width: 100vw; border-left: 0; border-top: 1px solid var(--borde-ui); } #editor.oculto { transform: translateY(100%); } }
.ed-cabecera { padding: 14px 16px 10px; border-bottom: 1px solid var(--borde-ui); }
.ed-cabecera h2 { margin: 0; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ed-cabecera p { margin: 6px 0 0; color: var(--texto-ui-suave); font-size: 12.5px; line-height: 1.45; }
.ed-cuerpo { overflow: auto; padding: 4px 16px 16px; flex: 1; }
.ed-seccion { border-bottom: 1px solid var(--borde-ui); padding: 14px 0; }
.ed-seccion:last-child { border-bottom: 0; }
.ed-seccion h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-ui-suave); }
.ed-campo { display: grid; gap: 4px; margin-bottom: 10px; }
.ed-campo span { font-size: 12.5px; color: var(--texto-ui-suave); }
.ed-campo input, .ed-campo textarea, .ed-campo select {
  width: 100%; background: #0e1013; color: var(--texto-ui); border: 1px solid var(--borde-ui); border-radius: 8px; padding: 8px 10px; font: 14px var(--fuente);
}
.ed-campo textarea { min-height: 70px; resize: vertical; }
.ed-campo input[type="color"] { padding: 2px; height: 36px; }
.ed-fila { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ed-boton {
  background: #262a30; color: var(--texto-ui); border: 1px solid var(--borde-ui); border-radius: 8px; padding: 8px 12px;
  font: 600 13px var(--fuente); cursor: pointer;
}
.ed-boton:hover { background: #30353c; }
.ed-boton.primario { background: var(--acento); color: #1a1408; border-color: transparent; }
.ed-boton.peligro { color: #ffb4a8; }
.ed-boton.chico { padding: 4px 8px; font-size: 12px; }
.ed-herramientas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ed-herramientas button[aria-pressed="true"] { background: var(--acento); color: #1a1408; border-color: transparent; }
.ed-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ed-lista li { display: flex; align-items: center; gap: 8px; background: #1e2126; border: 1px solid var(--borde-ui); border-radius: 8px; padding: 6px 8px; }
.ed-lista li .nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-lista li.actual { border-color: var(--acento); }
.ed-vacio { color: var(--texto-ui-suave); font-size: 13px; margin: 0; }
.ed-pista { background: color-mix(in srgb, var(--acento) 18%, transparent); border: 1px solid color-mix(in srgb, var(--acento) 50%, transparent); padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; margin: 10px 0 0; }
.ed-plano { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--borde-ui); cursor: crosshair; background: #fff; }
.ed-plano img { display: block; width: 100%; height: auto; }
.ed-plano .punto { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #8a8f98; border: 2px solid #fff; pointer-events: none; }
.ed-plano .punto.actual { background: var(--acento); width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.ed-borrador { background: #3a2f1d; color: #ffe2b0; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.4; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ed-borrador.alerta { background: #4a2a1a; border: 1px solid #c9773c; }
.ed-borrador[hidden] { display: none; }
/* Ajustes de la foto */
.ed-ajustes summary, .ed-negocio-sec summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ed-marca { font: 600 11px var(--fuente); background: color-mix(in srgb, var(--acento) 25%, transparent); color: var(--texto-ui); padding: 2px 8px; border-radius: 999px; }
.ed-marca-aviso { background: #4a2a1a; border: 1px solid #c9773c; color: #ffe2b0; }
.ed-marca[hidden] { display: none; }
.ed-ajustes-estado { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--texto-ui-suave); }
.ed-ajustes-estado.alerta { background: #4a2a1a; border: 1px solid #c9773c; color: #ffe2b0; padding: 8px 10px; border-radius: 8px; }
.ed-ajustes h4 { margin: 14px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-ui-suave); }
.ed-ajuste { display: grid; gap: 0; margin-bottom: 4px; }
.ed-ajuste-cab { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--texto-ui-suave); }
.ed-ajuste-cab .nombre { cursor: default; user-select: none; -webkit-user-select: none; }
.ed-ajuste output { font-variant-numeric: tabular-nums; color: var(--texto-ui); font-size: 12.5px; }
.ed-ajuste input[type="range"] { width: 100%; height: 26px; margin: 0; accent-color: var(--acento); touch-action: pan-y; cursor: pointer; }
.ed-ajustes-cuerpo > .ed-fila:first-of-type { margin-top: 12px; }
.ed-igualar { margin-top: 8px; }
.ed-igualar select { flex: 1; min-width: 0; background: #0e1013; color: var(--texto-ui); border: 1px solid var(--borde-ui); border-radius: 8px; padding: 7px 8px; font: 13px var(--fuente); }
.ed-boton[aria-pressed="true"] { background: var(--acento); color: #1a1408; border-color: transparent; }
.ed-boton:disabled { opacity: .55; cursor: progress; }
#editor .ed-ajustes .ed-boton { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ed-ayuda-ajustes p { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--texto-ui-suave); }
.ed-ayuda-ajustes code { background: #24272c; padding: 1px 5px; border-radius: 5px; color: var(--texto-ui); font-size: 12px; overflow-wrap: anywhere; }
/* Guardar en el Mac y aplicar a las fotos */
.ed-boton[hidden] { display: none; }
.ed-estado-mac { margin: 8px 0 0 !important; font-size: 12.5px; line-height: 1.4; }
.ed-estado-mac[hidden], .ed-trabajo[hidden] { display: none; }
.ed-estado-mac.ok { color: #9fd8b4 !important; }
.ed-estado-mac.pendiente { color: #ffe2b0 !important; }
.ed-estado-mac.alerta { background: #4a2a1a; border: 1px solid #c9773c; color: #ffe2b0 !important; padding: 8px 10px; border-radius: 8px; }
.ed-trabajo { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #1e2126; border: 1px solid var(--borde-ui); font-size: 12.5px; line-height: 1.4; display: grid; gap: 6px; justify-items: start; }
.ed-trabajo p { margin: 0 !important; color: var(--texto-ui) !important; display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.ed-trabajo.ok { border-color: #3f8a5c; }
.ed-trabajo.alerta { background: #4a2a1a; border-color: #c9773c; }
.ed-trabajo.alerta p { color: #ffe2b0 !important; }
.ed-trabajo.aviso { background: #3a2f1d; border-color: #c9a03c; }
.ed-trabajo.aviso p { color: #ffe2b0 !important; }
.ed-trabajo pre { margin: 0; max-height: 180px; overflow: auto; width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; background: #0e1013; border-radius: 6px; padding: 6px 8px; font: 11.5px/1.4 ui-monospace, Menlo, monospace; color: #e8e3da; }
.ed-girando { flex: none; width: 12px; height: 12px; margin-top: 2px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--acento) 35%, transparent); border-top-color: var(--acento); animation: ed-girar .8s linear infinite; }
@keyframes ed-girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ed-girando { animation: none; } }
.ed-aplicar-fila { margin-top: 10px; }
.ed-aplicar-fila .ed-vacio { flex: 1; min-width: 160px; font-size: 12px; }
.ed-por-publicar p { margin: 0 0 6px; }
.ed-por-publicar ul { margin: 0 0 8px; padding-left: 18px; }
.ed-por-publicar code, .ed-vacio code { background: #24272c; padding: 1px 5px; border-radius: 5px; font-size: 12px; overflow-wrap: anywhere; }
/* Botones y marca (una sola columna del ancho del panel: un tipo desconocido de nombre largo no la ensancha) */
.ed-botones { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ed-bn { background: #1e2126; border: 1px solid var(--borde-ui); border-radius: 10px; padding: 8px 10px 10px; }
.ed-bn-cab { margin-bottom: 8px; flex-wrap: nowrap; }
.ed-bn-cab select { flex: 1; width: 0; min-width: 0; text-overflow: ellipsis; background: #0e1013; color: var(--texto-ui); border: 1px solid var(--borde-ui); border-radius: 8px; padding: 6px 8px; font: 13px var(--fuente); }
.ed-negocio > .ed-fila select { flex: 1; min-width: 0; background: #0e1013; color: var(--texto-ui); border: 1px solid var(--borde-ui); border-radius: 8px; padding: 7px 8px; font: 13px var(--fuente); }
.ed-bn-num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--acento) 30%, transparent); font: 700 12px var(--fuente); }
.ed-bn .ed-campo { margin-bottom: 8px; }
.ed-ayuda { font-size: 11.5px; color: var(--texto-ui-suave); line-height: 1.35; }
.ed-bn-previa { margin: 2px 0 0; font-size: 12px; line-height: 1.45; color: var(--texto-ui-suave); overflow-wrap: anywhere; }
.ed-bn-previa a { color: var(--acento); }
.ed-bn-previa.alerta { background: #4a2a1a; border: 1px solid #c9773c; color: #ffe2b0; padding: 6px 8px; border-radius: 8px; }
.ed-bn-aviso { display: block; margin-top: 4px; color: #ffe2b0; }
.ed-check { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 6px; font-size: 13.5px; cursor: pointer; }
.ed-check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--acento); flex: none; }
.ed-negocio h4, .ed-incrustar h4 { margin: 14px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-ui-suave); }
.ed-codigo { width: 100%; margin-top: 6px; background: #0e1013; color: var(--texto-ui); border: 1px solid var(--borde-ui); border-radius: 8px; padding: 8px 10px; font: 12px/1.4 ui-monospace, Menlo, monospace; resize: vertical; }
body.ed-capturando .psv-canvas-container { cursor: crosshair !important; }
/* mientras se captura un clic (enlace o etiqueta), las flechas no navegan: el clic va a la foto */
body.ed-capturando .psv-virtual-tour-arrows, body.ed-capturando .psv-virtual-tour-link { pointer-events: none !important; }

@media (max-width: 640px) {
  #cabecera { max-width: calc(100vw - 24px); padding: 6px 10px 6px 8px; }
  #titulo { font-size: 13px; }
  #subtitulo { font-size: 11px; }
  .boton-acento { padding: 8px 12px; font-size: 13px; }
  .neg-boton { min-height: 42px; font-size: 14px; }
  /* con botón de contacto, título y botón se reparten el ancho para no taparse */
  body:has(#acciones:not([hidden])) #cabecera { max-width: 52vw; }
  #contacto { max-width: calc(48vw - 30px); }
  /* en el teléfono los paneles ocupan todo el ancho: la cabecera no debe tapar su título */
  body:has(.psv-panel--open) #cabecera { display: none; }
  .v3d-ayuda { display: none; }
  .v3d-barra { border-radius: 18px; }
}
