/* ==================================================
   Armador — modo móvil (pantallas de hasta 900 px, ?movil=1 o la app de Android).
   El editor de escritorio sigue funcionando fuera de la vista (GrapesJS necesita su lienzo);
   esta capa muestra encima una interfaz para el pulgar: lista de secciones, edición por campos,
   vista previa y publicación. Marca Angry Monkey: papel, tinta, amarillo y morado.
   ================================================== */
html.am-mv, html.am-mv body { height: 100%; overflow: hidden; }
html.am-mv .ar-small, html.am-mv .ar-top, html.am-mv #ar-start, html.am-mv .ar-modal, html.am-mv .ar-preview, html.am-mv .ar-toast { display: none !important; }
/* el editor queda vivo fuera de la pantalla, con tamaño de escritorio */
html.am-mv .ar-main { display: grid !important; position: fixed !important; left: -20000px; top: 0; width: 1280px; height: 900px; visibility: hidden; pointer-events: none; }

#mv {
	--mv-ink: #0a0a0a; --mv-paper: #f4f2ee; --mv-card: #ffffff; --mv-yel: #ffe000; --mv-pur: #5f1aa4; --mv-ora: #ff5e00;
	--mv-mut: #6a6572; --mv-soft: #e7e3dc; --mv-ok: #c8f7d4; --mv-bad: #ffd0d0;
	--mv-disp: 'Archivo', 'Arial Black', system-ui, sans-serif; --mv-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --mv-mono: 'Space Mono', ui-monospace, monospace;
	position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; overflow: hidden;
	background: var(--mv-paper); color: var(--mv-ink); font: 15px/1.45 var(--mv-body); color-scheme: light;
	-webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
/* reglas base sin especificidad (:where) para que las clases de cada pieza ganen */
:where(#mv) *, :where(#mv) *::before, :where(#mv) *::after { box-sizing: border-box; }
:where(#mv) :is(button, input, select, textarea) { font: inherit; color: inherit; margin: 0; }
:where(#mv) button { cursor: pointer; }
#mv [hidden] { display: none !important; }
#mv :focus-visible { outline: 3px solid var(--mv-pur); outline-offset: 2px; }
:where(#mv) svg { width: 20px; height: 20px; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { #mv *, #mv *::before, #mv *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* piezas */
.mv-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); background: var(--mv-ink); color: #fff; border-bottom: 3px solid var(--mv-yel); flex-shrink: 0; }
.mv-top__title { flex: 1; min-width: 0; padding: 6px 4px; border: 0; background: none; text-align: left; font: 800 17px/1.15 var(--mv-disp); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-ibtn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #4b4458; background: none; color: #fff; flex-shrink: 0; }
.mv-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid #4b4458; background: none; color: #fff; font: 700 11px/1 var(--mv-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; text-decoration: none; }
.mv-chip b { color: var(--mv-yel); }
.mv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 2px solid var(--mv-ink); background: var(--mv-card); color: var(--mv-ink); font: 700 12.5px/1.1 var(--mv-mono); letter-spacing: .05em; text-transform: uppercase; text-decoration: none; text-align: center; }
.mv-btn--yel { background: var(--mv-yel); color: var(--mv-ink); box-shadow: 4px 4px 0 var(--mv-ink); }
.mv-btn--yel:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--mv-ink); }
.mv-btn--dark { background: var(--mv-ink); color: #fff; }
.mv-btn--sm { min-height: 38px; padding: 0 12px; font-size: 11px; box-shadow: none; }
.mv-btn--block { width: 100%; }
.mv-btn:disabled { opacity: .45; cursor: default; }
.mv-pill { display: inline-block; padding: 4px 7px; border: 1px solid var(--mv-ink); font: 700 10px/1 var(--mv-mono); letter-spacing: .08em; text-transform: uppercase; background: var(--mv-soft); white-space: nowrap; }
.mv-pill[data-state="ok"] { background: var(--mv-ok); }
.mv-pill[data-state="err"] { background: var(--mv-bad); }
.mv-pill[data-state="busy"] { background: #fff7b3; }
.mv-eyebrow { font: 700 11px/1 var(--mv-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mv-pur); }
.mv-h1 { margin: 6px 0 0; font: 900 28px/1.02 var(--mv-disp); letter-spacing: -.01em; text-wrap: balance; }
.mv-h2 { margin: 0; font: 900 20px/1.08 var(--mv-disp); text-wrap: balance; }
.mv-muted { color: var(--mv-mut); font-size: 13.5px; margin: 0; }
.mv-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; }
.mv-scr { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--mv-paper); }
.mv-center { flex: 1; display: grid; place-content: center; gap: 16px; padding: 32px 24px; text-align: center; justify-items: center; }
.mv-logo { width: 64px; height: 64px; border-radius: 50%; background: var(--mv-yel); border: 2px solid var(--mv-ink); display: grid; place-items: center; font: 900 22px/1 var(--mv-disp); }
.mv-spin { width: 34px; height: 34px; border: 4px solid var(--mv-soft); border-top-color: var(--mv-pur); border-radius: 50%; animation: mv-spin .8s linear infinite; }
@keyframes mv-spin { to { transform: rotate(360deg); } }

/* nuevo sitio */
.mv-seg { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--mv-ink); background: var(--mv-card); }
.mv-seg button { min-height: 44px; border: 0; background: none; font: 700 12px/1 var(--mv-mono); letter-spacing: .06em; text-transform: uppercase; }
.mv-seg button.is-on { background: var(--mv-ink); color: var(--mv-yel); }
.mv-field { display: grid; gap: 6px; }
.mv-field > span { font: 700 11px/1.2 var(--mv-mono); letter-spacing: .1em; text-transform: uppercase; }
.mv-field textarea, .mv-field input, .mv-field select, .mv-tf textarea { width: 100%; padding: 11px 12px; border: 2px solid var(--mv-ink); background: var(--mv-card); border-radius: 0; font-size: 16px; line-height: 1.4; }
.mv-field textarea { resize: vertical; min-height: 70px; }
.mv-cost { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--mv-ink); color: #fff; font: 700 12px/1.3 var(--mv-mono); }
.mv-cost b { color: var(--mv-yel); font-size: 15px; }
.mv-tpls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mv-tpl { padding: 0; border: 2px solid var(--mv-ink); background: var(--mv-card); text-align: left; display: flex; flex-direction: column; }
.mv-tpl img, .mv-tpl i { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 2px solid var(--mv-ink); background: #111; }
.mv-tpl span { padding: 8px 10px; display: grid; gap: 3px; }
.mv-tpl small { font: 700 9.5px/1 var(--mv-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mv-pur); }
.mv-tpl b { font: 800 14px/1.15 var(--mv-disp); }
.mv-busy { position: absolute; inset: 0; z-index: 30; background: var(--mv-ink); color: #fff; display: grid; place-content: center; gap: 20px; padding: 32px; text-align: center; }
.mv-busy__msg { font: 800 20px/1.25 var(--mv-disp); min-height: 2.5em; }
.mv-busy small { font: 700 11px/1.4 var(--mv-mono); letter-spacing: .08em; text-transform: uppercase; color: #b9b1c6; }
.mv-busy .mv-spin { margin: 0 auto; border-color: #3a3346; border-top-color: var(--mv-yel); }

/* editor */
.mv-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mv-tip { margin: 0; padding: 12px 14px; border: 2px dashed var(--mv-pur); background: #efe7f8; font-size: 13.5px; }
.mv-secs { display: grid; gap: 10px; }
.mv-sec { display: grid; grid-template-columns: 1fr 44px; background: var(--mv-card); border: 2px solid var(--mv-ink); }
.mv-sec.is-hidden { opacity: .55; }
.mv-sec.is-new { animation: mv-pop .6s ease; }
@keyframes mv-pop { 0% { background: var(--mv-yel); } 100% { background: var(--mv-card); } }
.mv-sec__open { display: grid; grid-template-columns: 84px 1fr; padding: 0; border: 0; background: none; text-align: left; min-width: 0; }
.mv-thumb { position: relative; width: 84px; height: 100px; overflow: hidden; border-right: 2px solid var(--mv-ink); background: #18151d; }
.mv-thumb iframe { position: absolute; top: 0; left: 0; width: 390px; height: 470px; border: 0; transform: scale(.2154); transform-origin: 0 0; pointer-events: none; background: #fff; }
.mv-thumb b { position: absolute; left: 6px; bottom: 6px; padding: 2px 5px; background: var(--mv-ink); color: var(--mv-yel); font: 700 10px/1 var(--mv-mono); }
.mv-sec__txt { padding: 10px 10px 10px 12px; min-width: 0; display: grid; gap: 4px; align-content: center; }
.mv-sec__txt b { font: 800 14.5px/1.15 var(--mv-disp); overflow-wrap: anywhere; }
.mv-sec__txt span { font-size: 12.5px; color: var(--mv-mut); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mv-sec__acts { display: grid; grid-template-rows: 1fr 1fr 1fr; border-left: 2px solid var(--mv-ink); }
.mv-sec__acts button { border: 0; background: none; display: grid; place-items: center; }
.mv-sec__acts button + button { border-top: 1px solid var(--mv-soft); }
.mv-sec__acts button:disabled { opacity: .25; cursor: default; }
.mv-sec__acts svg { width: 18px; height: 18px; }
.mv-bar { flex-shrink: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); background: var(--mv-card); border-top: 2px solid var(--mv-ink); }
.mv-bar .mv-btn { padding: 0 6px; font-size: 11px; }

/* hojas */
.mv-shade { position: absolute; inset: 0; z-index: 20; background: rgba(10, 10, 10, .55); display: flex; align-items: flex-end; }
.mv-sheet { width: 100%; max-height: 92%; display: flex; flex-direction: column; background: var(--mv-paper); border-top: 3px solid var(--mv-ink); animation: mv-up .26s ease; }
.mv-sheet--full { height: 94%; }
@keyframes mv-up { from { transform: translateY(35%); opacity: .4; } to { transform: none; opacity: 1; } }
.mv-sheet__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; border-bottom: 2px solid var(--mv-ink); }
.mv-sheet__head .mv-h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mv-x { width: 40px; height: 40px; display: grid; place-items: center; border: 2px solid var(--mv-ink); background: var(--mv-card); flex-shrink: 0; }
.mv-sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.mv-sheet__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 2px solid var(--mv-ink); background: var(--mv-card); display: grid; gap: 8px; }
.mv-menu { display: grid; }
.mv-menu button { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--mv-soft); background: none; text-align: left; font-weight: 600; }
.mv-menu button small { margin-left: auto; color: var(--mv-mut); font-weight: 400; font-size: 12.5px; }
.mv-menu .is-bad { color: #b3261e; }
.mv-cat { margin: 6px 0 0; font: 700 11px/1 var(--mv-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mv-pur); }

/* editar sección */
.mv-prev { margin: -16px -16px 0; height: 200px; overflow: hidden; border-bottom: 2px solid var(--mv-ink); background: #18151d; position: relative; }
.mv-prev iframe { position: absolute; top: 0; left: 0; width: 390px; height: 1200px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.mv-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--mv-ink); background: var(--mv-card); }
.mv-tabs button { min-height: 42px; border: 0; background: none; font: 700 11px/1 var(--mv-mono); letter-spacing: .08em; text-transform: uppercase; }
.mv-tabs button + button { border-left: 2px solid var(--mv-ink); }
.mv-tabs button.is-on { background: var(--mv-yel); }
.mv-ai { display: grid; gap: 10px; padding: 14px; background: var(--mv-ink); color: #fff; }
.mv-ai .mv-field > span { color: var(--mv-yel); }
.mv-ai select, .mv-ai textarea, .mv-ai input { border-color: #4b4458 !important; background: #1d1922 !important; color: #fff !important; }
.mv-ai select { padding: 9px 10px; font-size: 15px; }
.mv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mv-chips button { padding: 8px 10px; border: 1px solid #4b4458; background: none; color: #fff; font-size: 13px; }
.mv-chips button.is-on { border-color: var(--mv-yel); color: var(--mv-yel); }
.mv-tf { display: grid; gap: 6px; }
.mv-tf__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mv-tf__head span { font: 700 10.5px/1 var(--mv-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mv-mut); }
.mv-tf__ai { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid var(--mv-pur); background: #efe7f8; color: var(--mv-pur); font: 700 10.5px/1 var(--mv-mono); text-transform: uppercase; }
.mv-tf__ai svg { width: 13px; height: 13px; }
.mv-tf textarea { resize: vertical; min-height: 46px; }
.mv-tf.is-busy textarea { background: linear-gradient(90deg, #fff 0%, #fff7b3 50%, #fff 100%); background-size: 200% 100%; animation: mv-shine 1s linear infinite; }
@keyframes mv-shine { to { background-position: -200% 0; } }
.mv-tf.is-changed textarea { border-color: var(--mv-pur); }
.mv-photos { display: grid; gap: 12px; }
.mv-photo { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 8px; background: var(--mv-card); border: 2px solid var(--mv-ink); }
.mv-photo img { width: 96px; height: 72px; object-fit: cover; border: 1px solid var(--mv-soft); background: #eee; }
.mv-photo div { display: grid; gap: 6px; min-width: 0; }
.mv-photo small { color: var(--mv-mut); font-size: 12px; overflow-wrap: anywhere; }

/* estilo del sitio */
.mv-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mv-theme { padding: 10px; border: 2px solid var(--mv-ink); background: var(--mv-card); text-align: left; display: grid; gap: 8px; }
.mv-theme.is-on { box-shadow: 4px 4px 0 var(--mv-pur); border-color: var(--mv-pur); }
.mv-theme i { display: flex; height: 26px; border: 1px solid var(--mv-ink); }
.mv-theme i span { flex: 1; }
.mv-theme b { font: 800 13.5px/1.1 var(--mv-disp); }

/* vista previa */
.mv-pv { position: absolute; inset: 0; z-index: 25; background: #07070a; display: flex; flex-direction: column; }
.mv-pv__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: var(--mv-ink); border-bottom: 3px solid var(--mv-yel); }
.mv-pv iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* publicar */
.mv-addr { display: flex; border: 2px solid var(--mv-ink); background: var(--mv-card); }
.mv-addr input { flex: 1; min-width: 0; border: 0; padding: 12px; font-size: 16px; background: none; }
.mv-addr span { padding: 12px 10px 12px 0; color: var(--mv-mut); white-space: nowrap; font-size: 13.5px; align-self: center; }
.mv-msg { margin: 0; font-size: 13.5px; font-weight: 600; }
.mv-msg[data-ok="1"] { color: #1d6b35; }
.mv-msg[data-ok="0"] { color: #b3261e; }
.mv-done { text-align: center; display: grid; gap: 12px; justify-items: center; }
.mv-done__mark { width: 72px; height: 72px; display: grid; place-items: center; background: var(--mv-yel); border: 2px solid var(--mv-ink); box-shadow: 4px 4px 0 var(--mv-ink); }
.mv-done__mark svg { width: 36px; height: 36px; }
.mv-url { width: 100%; font: 700 13px/1.4 var(--mv-mono); word-break: break-all; padding: 10px 12px; background: var(--mv-card); border: 2px solid var(--mv-ink); user-select: all; color: var(--mv-ink); text-decoration: none; }
.mv-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }

/* aviso */
.mv-toast { position: absolute; left: 12px; right: 12px; top: calc(70px + env(safe-area-inset-top, 0px)); z-index: 40; padding: 12px 14px; background: var(--mv-ink); color: #fff; border: 2px solid var(--mv-yel); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; animation: mv-up .2s ease; }
.mv-toast button { border: 0; background: none; color: var(--mv-yel); font: 700 12px/1 var(--mv-mono); text-transform: uppercase; letter-spacing: .06em; }
