@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url("/fuentes/cormorant-500.woff2") format("woff2") }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: swap; src: url("/fuentes/cormorant-600.woff2") format("woff2") }
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("/fuentes/lato-400.woff2") format("woff2") }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("/fuentes/lato-700.woff2") format("woff2") }

:root {
  --bg: #F5F5F3; --panel: #FFFFFF; --mesa: #EAEAE6; --tx: #1B1A19; --tx2: #6E6C68; --tx3: #9B9893;
  --ln: #E4E3E0; --campo: #F5F5F3; --sel: #1B1A19; --sobre-sel: #FFFFFF; --err: #B3261E;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --panel: #1D1D1B; --mesa: #0E0E0D; --tx: #F1F0EC; --tx2: #A5A39E; --tx3: #77756F;
    --ln: #2C2B29; --campo: #262624; --sel: #F1F0EC; --sobre-sel: #141413; --err: #F2B8B5;
    color-scheme: dark;
  }
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 15px/1.45 var(--ui); padding-top: env(safe-area-inset-top, 0px); -webkit-font-smoothing: antialiased }
button, input, textarea { font: inherit; color: inherit }
[hidden] { display: none !important }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px }
h1, h2 { margin: 0 }

body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 31 }
.barra { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); border-bottom: 1px solid var(--ln) }
.barra-in { max-width: 1240px; margin: 0 auto; height: 52px; display: flex; align-items: center; justify-content: space-between; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.logo { display: flex; align-items: center; gap: 8px; color: var(--tx); text-decoration: none; font-weight: 600; font-size: 16px }
.logo svg { width: 34px; height: 28px; color: var(--tx) }
.txt-btn { border: 0; background: none; padding: 8px 4px; font-size: 15px; font-weight: 500; color: var(--tx2); cursor: pointer }
.txt-btn:hover { color: var(--tx) }

.inicio { max-width: 1240px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)) }
.inicio h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 18px }
.tipos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px }
@media (max-width: 860px) { .tipos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px } }
.tipo { display: grid; gap: 2px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer }
.tipo canvas { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 8px; background: var(--mesa); margin-bottom: 8px; box-shadow: 0 0 0 1px var(--ln) }
.tipo b { font-size: 15px; font-weight: 600 }
.tipo span { font-size: 13px; color: var(--tx2) }
@media (hover: hover) { .tipo:hover canvas { box-shadow: 0 0 0 2px var(--sel) } }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: calc(100dvh - 52px - env(safe-area-inset-top, 0px)) }
.vista { background: var(--mesa); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 24px 96px; position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); height: calc(100dvh - 52px - env(safe-area-inset-top, 0px)); min-width: 0 }
.vista-cab { width: 100%; display: flex; align-items: center; gap: 12px }
.vista-cab h1 { font-size: 17px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.nav { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tx2); font-variant-numeric: tabular-nums }
.flecha { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--ln); background: var(--panel); font-size: 18px; line-height: 1; cursor: pointer; color: var(--tx) }
.flecha:disabled { opacity: .35; cursor: default }
.lienzo-caja { flex: 1 1 0; min-height: 0; width: 100%; position: relative }
#lienzo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .14)); touch-action: pan-y; user-select: none; -webkit-user-select: none }
#lienzo.movible { touch-action: none }
.pista { margin: 0; font-size: 13px; color: var(--tx2); text-align: center }
.tira { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; padding: 2px }
.mini { flex: none; padding: 0; border: 0; border-radius: 3px; background: none; cursor: pointer; line-height: 0; opacity: .55; outline-offset: 1px }
.mini canvas { width: 40px; height: 50px; border-radius: 3px }
.mini[aria-current="true"] { opacity: 1; outline: 2px solid var(--sel) }

.panel { background: var(--panel); border-left: 1px solid var(--ln); padding-bottom: 96px; min-width: 0 }
.bloque { padding: 18px 20px; border-bottom: 1px solid var(--ln); display: grid; gap: 12px; min-width: 0 }
.bloque h2 { font-size: 13px; font-weight: 600; color: var(--tx); display: flex; justify-content: space-between }
.valor { font-weight: 400; color: var(--tx2) }

.ideas { display: flex; flex-wrap: wrap; gap: 6px }
.idea { border: 1px solid var(--ln); background: var(--panel); border-radius: 8px; padding: 7px 12px; font-size: 14px; cursor: pointer }
.idea[aria-checked="true"] { background: var(--sel); color: var(--sobre-sel); border-color: var(--sel) }

.fotos { display: grid; gap: 8px }
.ft { display: flex; align-items: center; gap: 10px }
.ft-sel { flex: 1; display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0 }
.ft-img { width: 52px; height: 52px; flex: none; border-radius: 8px; background: var(--campo) center / cover no-repeat; border: 1px dashed var(--tx3) }
.ft.con .ft-img { border: 0 }
.ft-info { display: grid; min-width: 0 }
.ft-info b { font-size: 14px; font-weight: 500 }
.ft-info span { font-size: 13px; color: var(--tx2) }
.ft-sel:focus-within .ft-img { outline: 2px solid var(--sel); outline-offset: 2px }
.quitar { font-size: 13px }

.fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.fondos { display: flex; gap: 10px }
.fondo { width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: linear-gradient(135deg, var(--c1) 50%, var(--c2) 50%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12) }
.fondo[aria-checked="true"] { outline: 2px solid var(--sel); outline-offset: 3px }
.interruptor { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx2); cursor: pointer }
.interruptor input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--ln); position: relative; margin: 0; cursor: pointer; transition: background .15s }
.interruptor input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #FFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s }
.interruptor input:checked { background: var(--sel) }
.interruptor input:checked::after { transform: translateX(16px); background: var(--sobre-sel) }

.campos { display: grid; gap: 12px }
.campos label, dialog label { display: grid; gap: 5px; min-width: 0 }
.campos label > span, dialog label > span { font-size: 12px; color: var(--tx2) }
.campos small { font-size: 12px; color: var(--tx3) }
input[type=text], input[type=tel], textarea { width: 100%; background: var(--campo); border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; font-size: 16px; line-height: 1.4 }
textarea { resize: vertical }
input:focus, textarea:focus { outline: none; border-color: var(--tx3); background: var(--panel) }

.msg { margin: 0; font-size: 13px; color: var(--tx2) }
.msg:empty { display: none }
.msg.err { color: var(--err) }

.acciones { position: fixed; right: 0; bottom: 0; width: 400px; z-index: 20; background: var(--panel); border-top: 1px solid var(--ln); border-left: 1px solid var(--ln); padding-bottom: env(safe-area-inset-bottom, 0px) }
.acciones-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px max(20px, env(safe-area-inset-right, 0px)) 12px 20px }
.acciones-in .msg { flex: 1 0 100%; order: -1 }
.btn { flex: 1; white-space: nowrap; height: 44px; border-radius: 10px; border: 1px solid var(--ln); background: var(--panel); font-size: 15px; font-weight: 600; cursor: pointer; padding: 0 14px }
.btn.pri { flex: 1.5; background: var(--sel); color: var(--sobre-sel); border-color: var(--sel) }
.btn:disabled { opacity: .5; cursor: wait }

dialog { border: 0; border-radius: 14px; padding: 0; background: var(--panel); color: var(--tx); width: min(400px, calc(100% - 32px)) }
dialog::backdrop { background: rgba(0, 0, 0, .4) }
dialog form { display: grid; gap: 14px; padding: 20px }
dialog h2 { font-size: 18px; font-weight: 600 }
.nota { margin: -6px 0 0; font-size: 13px; color: var(--tx2) }
.dlg-btns { display: flex; gap: 8px; margin-top: 4px }

@media (max-width: 860px) {
  .editor { grid-template-columns: minmax(0, 1fr); min-height: 0 }
  .vista { position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 10; height: auto; padding: 10px 16px 10px; gap: 8px; border-bottom: 1px solid var(--ln) }
  .lienzo-caja { flex: none; height: 40svh }
  .tira { display: none }
  .pista { font-size: 12px }
  .panel { border-left: 0; padding-bottom: 110px }
  .bloque { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)) }
  .acciones { width: auto; left: 0; border-left: 0 }
  .acciones-in { padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)) }
}
@media (prefers-reduced-motion: reduce) { .interruptor input, .interruptor input::after { transition: none } }
