/* tema oscuro siempre (pedido del dueño), sin depender del modo del celular */
:root {
  color-scheme: dark;
  --verde: #10191F; --verde2: #00A884; --boton: #00A884; --fondo: #070C10; --burbuja: #141E25; --mia: #005C4B;
  --texto: #E9EDEF; --suave: #8696A0; --linea: #22313A; --panel: #0C141A; --rojo: #F15C6D; --ambar: #E3A008;
  --sombra: 0 1px 2px rgba(0,0,0,.5);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; } /* cada pantalla tiene su propio scroll */
body { background: var(--fondo); color: var(--texto); font: 16px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--boton); outline-offset: 2px; }
svg { width: 24px; height: 24px; display: block; }
.cargando { display: grid; place-items: center; height: 100dvh; color: var(--suave); }

#app { display: flex; flex-direction: column; height: 100%; overflow-y: auto; overflow-x: hidden; }

/* barra de arriba */
.top { display: flex; align-items: center; gap: 10px; background: var(--verde); color: #fff; padding: calc(env(safe-area-inset-top) + 8px) 8px 8px 12px; flex: none; }
.top .avatar { width: 40px; height: 40px; border-radius: 50%; }
.top .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top .tt b { font-size: 17px; }
.top .tt small { color: rgba(255,255,255,.8); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top select { background: transparent; border: 0; color: #fff; font-weight: 600; padding: 0; max-width: 60vw; }
.top select option { color: var(--texto); background: var(--panel); }
.ib { background: none; border: 0; padding: 8px; border-radius: 50%; color: inherit; display: grid; place-items: center; min-width: 44px; min-height: 44px; }

/* pantalla principal */
.inicio { flex: 1; overflow-y: auto; padding: 14px 14px 12px; }
.pregunta { font-size: 28px; margin: 6px 0 2px; }
.inicio .sub { margin: 0 0 12px; font-size: 15px; }
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--linea); background: var(--burbuja); border-radius: 18px; padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 4px; text-align: left; box-shadow: var(--sombra); }
.card:active { transform: scale(.98); }
.card b { font-size: 18px; line-height: 1.15; }
.card small { color: var(--suave); font-size: 14px; }
.card.bajo { border-color: var(--rojo); }
.card.bajo small { color: var(--rojo); font-weight: 700; }
.ft.gfoto { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; margin-bottom: 4px; font-size: 56px; }
.vacio { text-align: center; color: var(--suave); padding: 40px 10px; font-size: 17px; grid-column: 1 / -1; }
.aviso { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--linea); background: var(--burbuja); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; font-size: 15px; min-height: 44px; }
.aviso span { flex: 1; }
.aviso.rojo { border-color: var(--rojo); background: color-mix(in srgb, var(--rojo) 14%, var(--burbuja)); }
#snack { position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 70px + var(--tabs, 0px)); z-index: 15; display: flex; align-items: center; gap: 10px; background: #22313A; color: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.5); font-size: 15px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
#snack.on { opacity: 1; transform: none; pointer-events: auto; }
#snack span { flex: 1; }
#snack .link { padding: 6px 4px; color: #4FE0B6; }
.grande { font-size: 18px; margin: 8px 0 0; }
.dots { display: inline-flex; gap: 5px; padding: 10px 2px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--boton); animation: rebote 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes rebote { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; } .card:active, .tile:active { transform: none; } }

/* tarjetas chicas (fotos de internet) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.tile { border: 1px solid var(--linea); background: var(--panel); border-radius: 12px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-height: 44px; }
.tile:active { transform: scale(.97); }
.tile span { font-weight: 600; font-size: 14px; line-height: 1.15; }
.tile small, .suave { color: var(--suave); font-size: 12.5px; }
.tile.bajo small, .bajo-txt { color: var(--rojo); font-weight: 600; }
.ft { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.ft.ch { width: 44px; height: 44px; border-radius: 8px; }
.ft.gr { width: 120px; height: 120px; border-radius: 14px; }
.sinfoto { display: grid; place-items: center; font-weight: 700; font-size: 26px; color: #fff; background: var(--verde2); }
.ft.ch.sinfoto { font-size: 18px; }
.link { background: none; border: 0; color: var(--boton); font-weight: 600; padding: 10px 2px 2px; min-height: 44px; }

/* tarjeta para confirmar */
.conf .fila { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--linea); }
.conf .fila:first-of-type { border-top: 0; }
.conf .fila .nom { flex: 1; min-width: 0; font-weight: 600; }
.conf .fila .nom small { display: block; font-weight: 400; }
.conf .fila input.nomedit { width: 100%; border: 1px solid var(--linea); border-radius: 6px; padding: 4px 6px; background: transparent; font-weight: 600; }
.conf .nota { color: var(--suave); font-size: 14px; padding: 6px 0 2px; }
.conf .acciones { display: flex; gap: 8px; margin-top: 8px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; background: var(--ambar); color: #fff; border-radius: 6px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }
.crear { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--suave); }
.crear input { width: 20px; height: 20px; accent-color: var(--boton); }

.step { display: flex; align-items: center; gap: 2px; flex: none; }
.step button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--linea); font-size: 20px; font-weight: 700; display: grid; place-items: center; }
.step input { width: 52px; text-align: center; border: 0; background: transparent; font-weight: 700; font-size: 17px; }
.step.grande button { width: 56px; height: 56px; font-size: 28px; }
.step.grande input { width: 90px; font-size: 32px; }
.x { background: none; border: 0; color: var(--suave); font-size: 18px; width: 36px; height: 36px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips button { border: 1px solid var(--linea); background: var(--panel); border-radius: 18px; padding: 7px 13px; white-space: nowrap; min-height: 38px; font-size: 14.5px; }
.chips button.on { background: var(--boton); border-color: var(--boton); color: #fff; font-weight: 600; }

.btn { border: 0; border-radius: 22px; padding: 11px 18px; font-weight: 700; background: var(--boton); color: #fff; min-height: 44px; flex: 1; }
.btn.sec { background: var(--linea); color: var(--texto); }
.btn.peligro { background: none; color: var(--rojo); }
.btn:disabled { opacity: .5; }

/* barra de abajo, como WhatsApp */
.bar { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px); flex: none; }
.campo { flex: 1; display: flex; align-items: center; background: var(--burbuja); border-radius: 24px; min-height: 48px; padding: 0 4px 0 16px; box-shadow: var(--sombra); }
.campo input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 10px 0; }
.campo .ib { color: var(--suave); }
.mic { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--boton); color: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--sombra); }
.mic:active { transform: scale(.94); }
.grabando { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--burbuja); border-radius: 24px; min-height: 48px; padding: 0 6px 0 4px; box-shadow: var(--sombra); }
.grabando .rec { color: var(--rojo); font-weight: 700; font-variant-numeric: tabular-nums; }
.grabando .rec::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--rojo); margin-right: 6px; animation: titila 1s infinite; }
@keyframes titila { 50% { opacity: .2; } }
.grabando .ib { color: var(--suave); }

/* pantallas del admin */
#panel { position: fixed; inset: 0; background: var(--panel); z-index: 20; display: flex; flex-direction: column; }
#panel[hidden] { display: none; }
#panel .top { gap: 4px; }
.cont { flex: 1; overflow-y: auto; padding: 12px 16px calc(env(safe-area-inset-bottom) + 90px); }
.cont h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--verde2); margin: 18px 0 6px; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.lista li > .nom { flex: 1; min-width: 0; }
.lista li > .nom > b { display: block; }
.lista li > .num { text-align: right; font-weight: 700; font-size: 18px; white-space: nowrap; }
.lista li > .num small { display: block; font-weight: 400; font-size: 12px; color: var(--suave); }
.lista li.tap { cursor: pointer; }
.alerta { background: color-mix(in srgb, var(--rojo) 12%, transparent); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.alerta b { color: var(--rojo); }
.barras { display: flex; align-items: flex-end; gap: 1px; height: 34px; margin: 4px 0; }
.barras i { flex: 1; background: var(--verde2); border-radius: 1px 1px 0 0; min-height: 1px; opacity: .85; }
.fab { position: fixed; right: 20px; bottom: calc(env(safe-area-inset-bottom) + 16px + var(--tabs, 0px)); z-index: 21; box-shadow: 0 3px 10px rgba(0,0,0,.25); flex: none; }
.buscar { width: 100%; border: 1px solid var(--linea); background: var(--fondo); border-radius: 20px; padding: 10px 14px; margin-bottom: 6px; }
.dia { position: sticky; top: 0; background: var(--panel); color: var(--suave); font-size: 13px; font-weight: 600; padding: 8px 0 4px; }

/* formularios */
.form label { display: block; font-size: 13px; color: var(--suave); margin: 12px 0 4px; }
.form input:not([type=checkbox]), .form select { width: 100%; border: 1px solid var(--linea); border-radius: 10px; padding: 11px 12px; background: var(--fondo); font-size: 16px; }
.porlugar { display: grid; grid-template-columns: 1fr 52px 52px 58px 58px; gap: 6px 8px; align-items: center; }
.porlugar input { text-align: center; padding: 9px 4px !important; }
.porlugar .cab { font-size: 12px; color: var(--suave); text-align: center; }

/* login */
.entrada { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
.entrada .logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 12px; }
.entrada h1 { text-align: center; margin: 0 0 4px; }
.entrada p { text-align: center; color: var(--suave); margin: 0 0 12px; }
.entrada .btn { width: 100%; margin-top: 18px; flex: none; }
.instalar .btn { font-size: 19px; min-height: 56px; }
.pasos { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.pasos li { display: flex; align-items: center; gap: 12px; background: var(--burbuja); border: 1px solid var(--linea); border-radius: 14px; padding: 12px; font-size: 17px; }
.pasos .n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--boton); color: #fff; font-weight: 800; display: grid; place-items: center; }
.ico-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--boton); border-radius: 6px; color: var(--boton); font-weight: 700; }

/* hoja de abajo */
#sheet { position: fixed; inset: 0; z-index: 30; }
#sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-width: 620px; margin: 0 auto; background: var(--panel); border-radius: 18px 18px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px); max-height: 90dvh; overflow-y: auto; }
.sheet-card .centro { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.sheet-card .acciones { display: flex; gap: 8px; margin-top: 16px; }
.menu button { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; padding: 14px 6px; font-size: 17px; border-bottom: 1px solid var(--linea); text-align: left; }
.menu button:last-child { border-bottom: 0; }

#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 80px + var(--tabs, 0px)); transform: translateX(-50%); background: #323232; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 15px; z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); text-align: center; }
#toast.on { opacity: 1; }

/* admin: menú a la izquierda (fijo en compu, se desliza en el celular) */
.admin { display: flex; height: 100%; }
.lado { width: 260px; flex: none; background: var(--panel); border-right: 1px solid var(--linea); display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 14px) 12px calc(env(safe-area-inset-bottom) + 12px); overflow-y: auto; }
.marca { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 0 4px 14px; }
.marca .avatar { width: 36px; height: 36px; border-radius: 10px; }
.local-sel { position: relative; margin-bottom: 16px; }
.local-btn { width: 100%; display: flex; align-items: center; gap: 8px; background: var(--burbuja); border: 1px solid var(--linea); border-radius: 12px; padding: 12px; font-weight: 700; font-size: 16px; text-align: left; min-height: 48px; }
#localNom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 25; background: var(--burbuja); border: 1px solid var(--linea); border-radius: 12px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.local-menu[hidden] { display: none; }
.fila-local { display: flex; align-items: center; }
.fila-local > button:first-child { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 10px; border-radius: 8px; min-height: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-local > button.on { color: #4FE0B6; font-weight: 700; }
.lapiz { flex: none; width: 44px; height: 44px; background: none; border: 0; border-radius: 8px; opacity: .7; }
.fila-local > button:hover, .lapiz:hover, .nav button:hover { background: var(--linea); opacity: 1; }
.local-menu form.ren { border-top: 0; margin: 0; padding: 4px 0; width: 100%; }
.local-menu form { display: flex; gap: 6px; padding: 8px 4px 4px; border-top: 1px solid var(--linea); margin-top: 4px; }
.local-menu input { flex: 1; min-width: 0; border: 1px solid var(--linea); background: var(--fondo); border-radius: 8px; padding: 8px 10px; }
.local-menu .btn { flex: none; padding: 8px 12px; min-height: 40px; font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav button { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 11px 12px; border-radius: 10px; font-size: 16px; text-align: left; min-height: 44px; }
.nav button.on { background: color-mix(in srgb, var(--boton) 18%, transparent); color: #4FE0B6; font-weight: 700; }
.quien { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--linea); padding-top: 10px; margin-top: 10px; color: var(--suave); font-size: 14px; }
.quien button { background: none; border: 0; color: var(--suave); padding: 8px; min-height: 44px; }
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.vista { flex: 1; overflow-y: auto; }
.vista .cont { max-width: 1100px; }
.bar[hidden] { display: none; }
.velo { display: none; }
@media (min-width: 900px) { .solo-cel { display: none !important; } .principal .top { padding-left: 20px; } }
@media (max-width: 899px) {
  .lado { position: fixed; top: 0; bottom: 0; left: 0; z-index: 27; width: 284px; transform: translateX(-100%); transition: transform .2s; }
  .admin.abierto .lado { transform: none; }
  .admin.abierto .velo { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 26; }
}
@media (prefers-reduced-motion: reduce) { .lado { transition: none; } }

/* panel principal */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.kpi { background: var(--burbuja); border: 1px solid var(--linea); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 44px; }
.kpi b { font-size: 32px; line-height: 1.1; }
.kpi span { color: var(--suave); font-size: 14px; }
.kpi.rojo { border-color: var(--rojo); }
.kpi.rojo b { color: var(--rojo); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.caja { background: var(--burbuja); border: 1px solid var(--linea); border-radius: 16px; padding: 4px 14px 10px; min-width: 0; }
.caja.ancha { grid-column: 1 / -1; }
.caja .lista li:last-child { border-bottom: 0; }
.invitacion { white-space: pre-wrap; font: inherit; font-size: 15px; background: var(--burbuja); border: 1px solid var(--linea); border-radius: 12px; padding: 12px; margin: 12px 0 0; overflow-wrap: anywhere; }
.locales { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 4px 0 8px; }
.loc { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; background: var(--panel); border: 1px solid var(--linea); border-radius: 14px; padding: 12px 14px; min-height: 44px; }
.loc b { font-size: 17px; }
.loc span { color: var(--suave); font-size: 14px; }
.loc.rojo { border-color: var(--rojo); }
.loc.rojo span:first-of-type { color: var(--rojo); font-weight: 600; }
.loc:hover { border-color: var(--boton); }
.nov-ico { font-size: 22px; flex: none; width: 32px; text-align: center; }

/* que no se seleccione texto al mantener apretado (como una app), salvo donde se escribe */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, .invitacion { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.mic { touch-action: none; transition: transform .15s, box-shadow .15s; }
.mic.activo { transform: scale(1.35); box-shadow: 0 0 0 10px color-mix(in srgb, var(--boton) 25%, transparent); }
.bar.grabandoAudio .campo { display: none; }
#grabInfo[hidden] { display: none; }
#grabInfo { padding: 0 14px; }
.desliza { flex: 1; text-align: center; color: var(--suave); transition: opacity .1s; }
@media (prefers-reduced-motion: reduce) { .mic { transition: none; } }

/* chat corto al mandar audio o mensaje */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.bb { max-width: 85%; padding: 8px 10px 5px; border-radius: 12px; box-shadow: var(--sombra); font-size: 16px; overflow-wrap: anywhere; }
.bb.yo { align-self: flex-end; background: var(--mia); border-top-right-radius: 3px; color: #fff; }
.bb.bot { align-self: flex-start; background: var(--burbuja); border: 1px solid var(--linea); border-top-left-radius: 3px; }
.bb.ancha { align-self: stretch; max-width: none; }
.bb .h { display: block; text-align: right; font-size: 11px; color: var(--suave); margin-top: 3px; }
.bb.yo .h { color: rgba(255,255,255,.65); }
.bb.audio .txt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bb.audio .txt svg { width: 20px; height: 20px; }
.bb .dur { font-variant-numeric: tabular-nums; opacity: .8; }
.bb .dijo { flex-basis: 100%; font-style: italic; }
.bb img.adj { display: block; max-width: 200px; max-height: 240px; border-radius: 8px; }
.bb .dots { padding: 4px 2px; }
#chatAcc[hidden] { display: none; }

/* guía de instalación: dibujos simples del celular, lo que hay que tocar en rojo titilando */
.guia { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 84px); /* abajo queda lugar para la flecha */ max-width: 460px; margin: 0 auto; text-align: center; }
.guia.arriba { padding-top: calc(env(safe-area-inset-top) + 72px); }
.guia-tit { font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.guia-puntos { display: flex; gap: 8px; margin-bottom: 6px; }
.guia-puntos i { width: 10px; height: 10px; border-radius: 50%; background: var(--linea); }
.guia-puntos i.ya { background: var(--boton); opacity: .5; }
.guia-puntos i.on { background: var(--boton); transform: scale(1.3); }
.guia-paso { color: var(--suave); font-size: 15px; margin-bottom: 14px; }
.guia-dibujo { width: 100%; display: flex; justify-content: center; margin-bottom: 18px; }
.guia-txt { font-size: 24px; line-height: 1.3; font-weight: 600; margin: 0 0 22px; }
.guia-txt small { font-size: 17px; font-weight: 400; color: var(--suave); }
.guia-nav { display: flex; gap: 10px; width: 100%; margin-top: auto; }
.guia-nav .btn { font-size: 20px; min-height: 60px; }
.guia-nav .btn.sec { flex: 0 0 72px; }
.guia-ayuda { margin-top: 14px; font-size: 15px; }
.guia-ayuda a { color: #4FE0B6; }
.instalar-ya { width: 100%; font-size: 24px; min-height: 84px; margin: 20px 0 22px; flex: none; }

/* dibujo del celular */
.mock { width: 100%; max-width: 340px; background: #F2F2F7; color: #111; border-radius: 22px; padding: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.45); font-family: -apple-system, Roboto, sans-serif; text-align: left; border: 6px solid #2A2F35; }
.mock svg { width: 26px; height: 26px; }
.mock .mweb { height: 70px; border-radius: 10px; background: #fff; color: #888; font-size: 13px; padding: 8px; margin-bottom: 10px; }
.mock .mbarra { display: flex; align-items: center; justify-content: space-around; gap: 6px; background: #fff; border-radius: 14px; padding: 8px 6px; font-size: 22px; color: #0A84FF; }
.mock .mbarra.arriba { margin-bottom: 10px; justify-content: space-between; }
.mock .mdir { flex: 1; background: #E5E5EA; border-radius: 10px; color: #333; font-size: 14px; padding: 8px 10px; }
.mock .gris { color: #bbb; }
.mock .puntos { font-size: 18px; letter-spacing: 1px; color: #333; padding: 2px 6px; }
.mock .puntos.v { font-size: 26px; }
.mock .mlista { background: #fff; border-radius: 12px; overflow: visible; }
.mock .mfila { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border-bottom: 1px solid #E5E5EA; font-size: 17px; }
.mock .mfila:last-child { border-bottom: 0; }
.mock .mico { color: #333; display: flex; }
.mock .mapps { display: flex; gap: 12px; margin-bottom: 10px; }
.mock .mapps span { width: 48px; height: 48px; border-radius: 12px; background: #D1D1D6; }
.mock .mcab { display: flex; justify-content: space-between; align-items: center; font-size: 16px; padding: 4px 2px 12px; }
.mock .azul { color: #0A84FF; }
.mock .mapp { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px; padding: 12px; font-size: 18px; margin-bottom: 10px; }
.mock .mapp img { width: 54px; height: 54px; border-radius: 13px; }
.mock .switch { width: 46px; height: 28px; border-radius: 14px; background: #34C759; position: relative; }
.mock .switch::after { content: ""; position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.mock.and { border-radius: 16px; }
.mock .mdialogo { background: #fff; border-radius: 20px; padding: 16px; }
.mock .mdialogo .mapp { padding: 0 0 14px; }
.mock .mbotones { display: flex; justify-content: flex-end; gap: 22px; font-size: 17px; padding-right: 6px; }
.mock.inicio { background: linear-gradient(160deg, #3B5BDB, #9C36B5); border-color: #2A2F35; padding: 22px 18px 16px; }
.mock.inicio .iconos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; justify-items: center; }
.mock.inicio .ap { display: flex; flex-direction: column; align-items: center; gap: 5px; font-style: normal; }
.mock.inicio .ap > span:not(.rojo) { width: 54px; height: 54px; border-radius: 14px; background: rgba(255,255,255,.35); }
.mock.inicio .ap small { color: #fff; font-size: 13px; font-weight: 600; }
.mock.inicio img { width: 54px; height: 54px; border-radius: 14px; display: block; }

/* el recuadro rojo que titila */
.rojo { display: inline-flex; align-items: center; justify-content: center; outline: 4px solid #FF2D2D; outline-offset: 4px; border-radius: 10px; animation: titilaRojo 1s ease-in-out infinite; }
.mlista > .rojo { display: block; border-radius: 6px; outline-offset: 0; position: relative; z-index: 1; }
@keyframes titilaRojo { 50% { outline-color: rgba(255,45,45,.25); box-shadow: 0 0 0 8px rgba(255,45,45,.18); } }
.rojo-btn { outline: 5px solid #FF2D2D; outline-offset: 5px; animation: titilaRojo 1s ease-in-out infinite; }

/* flecha sobre la pantalla real, apuntando al botón del navegador */
.flecha-real { position: fixed; font-size: 56px; z-index: 50; pointer-events: none; animation: saltaFlecha .9s ease-in-out infinite; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); }
.flecha-real.abajo { bottom: calc(env(safe-area-inset-bottom) + 2px); left: 50%; margin-left: -28px; }
.flecha-real.abajo-der { bottom: calc(env(safe-area-inset-bottom) + 2px); right: 10px; }
.flecha-real.arriba-der { top: 2px; right: 4px; }
@keyframes saltaFlecha { 50% { transform: translateY(12px); } }
.flecha-real.arriba-der { animation-name: saltaFlechaArriba; }
@keyframes saltaFlechaArriba { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .rojo, .rojo-btn, .flecha-real { animation: none; } }

/* candado para grabar sin apretar (deslizando para arriba, como WhatsApp) */
.bar { position: relative; }
.candado { position: absolute; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 78px + var(--tabs, 0px)); width: 40px; padding: 10px 0 6px; border-radius: 20px; background: var(--burbuja); border: 1px solid var(--linea); box-shadow: var(--sombra); color: var(--suave); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; animation: subeCandado 1.2s ease-in-out infinite; }
.candado svg { width: 20px; height: 20px; }
.candado span { font-size: 14px; line-height: 1; }
.candado[hidden], .basura { display: none; }
.bar.bloqueado .basura { display: grid; color: var(--rojo); }
.bar.bloqueado .mic.activo { transform: none; }
.bar.bloqueado .desliza { text-align: left; }
@keyframes subeCandado { 50% { margin-bottom: 6px; } }
@media (prefers-reduced-motion: reduce) { .candado { animation: none; } }

/* en el celu el menú se abre con un botón que dice "Menú" (antes solo eran tres rayitas) */
.btn-menu { display: flex; align-items: center; gap: 6px; border: 1px solid var(--linea); border-radius: 12px; padding: 6px 12px 6px 8px; min-width: 0; font-weight: 700; font-size: 15px; }
.btn-menu svg { width: 22px; height: 22px; }

/* barra de abajo en el celular (admin), como una app */
.tabs { display: flex; flex: none; background: var(--verde); border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 7px 2px 6px; min-height: 54px; font-size: 11px; color: var(--suave); }
.tabs button span { font-size: 21px; line-height: 1.1; filter: grayscale(1); opacity: .7; }
.tabs button.on { color: #4FE0B6; font-weight: 700; }
.tabs button.on span { filter: none; opacity: 1; }
@media (max-width: 899px) {
  body:has(.tabs) { --tabs: 55px; }
  .principal .bar { padding-bottom: 6px; } /* el borde de abajo ahora lo cubre la barra */
  .principal .top { padding-left: 16px; }
}
/* cambio de pantalla: entra deslizando */
@keyframes entra { from { opacity: 0; transform: translateX(14px); } }
@keyframes sube { from { opacity: 0; transform: translateY(24px); } }
.vista.entra { animation: entra .18s ease-out; }
#panel:not([hidden]) { animation: entra .2s ease-out; }
#sheet:not([hidden]) .sheet-card { animation: sube .2s ease-out; }
@media (prefers-reduced-motion: reduce) { .vista.entra, #panel:not([hidden]), #sheet:not([hidden]) .sheet-card { animation: none; } }

/* Stock: botón para cargar la factura con una foto */
.btn.factura { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; margin: 4px 0 10px; border-radius: 14px; }
.btn.factura small { font-weight: 400; font-size: 12px; opacity: .8; }

/* Android que dibuja la app debajo de sus barras (ver app.js): la dejo entre el reloj y los botones.
   shortcut: márgenes fijos (36 y 48 px) porque esos teléfonos no informan el tamaño de sus barras */
html.tapada { background: var(--verde); }
html.tapada body { position: fixed; top: 36px; left: 0; right: 0; bottom: 0; height: auto; transform: translateZ(0); }
html.tapada.abajo body { bottom: 48px; }
