/* =====================================================================
   TOTEM · interfaz de la app (iPhone y iPad)
   Solo actúa con <html class="en-app"> (la pone la app nativa al cargar).
   La web en el navegador y los paneles a medida no cambian.

   Esqueleto:  barra de arriba fija · contenido que se desplaza · barra de
   abajo pegada al borde. La página entera nunca se mueve: solo el contenido.
   ===================================================================== */

@media (max-width: 860px) {
html.en-app {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --app-h: 100dvh;                 /* app.js la ajusta al abrir el teclado */
  --app-bar: 58px;                 /* alto útil de la barra de abajo */
  --app-pie: calc(var(--app-bar) + var(--sab));
}
html.en-app.kb-abierto { --app-pie: 0px; }

/* ------------------------------------------------------------ esqueleto */
html.en-app { -webkit-text-size-adjust: 100%; }
html.en-app:has(> body.totem > .tt-app), html.en-app:has(> body.login-totem),
html.en-app body.totem:has(> .tt-app) { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.en-app body.totem:has(> .tt-app) { position: fixed; inset: 0 0 auto 0; height: var(--app-h); margin: 0; padding: 0 !important; }
html.en-app body.totem .tt-app {
  display: flex !important; flex-direction: column; height: 100%; min-height: 0; grid-template-columns: none;
}
html.en-app body.totem .tt-cuerpo {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain; scroll-padding-top: 64px; position: relative;
}
html.en-app body.totem .tt-main,
html.en-app body.totem.panel-totem main.tt-main {
  padding: 16px 16px calc(var(--app-pie) + 28px) !important; max-width: none;
}

/* ------------------------------------------------------- barra de arriba */
html.en-app body.totem .tt-app > .tt-side {
  position: relative !important; top: auto; flex: none; z-index: 40; min-height: 0; height: auto;
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  padding: calc(var(--sat) + 6px) 12px 8px; max-width: none; overflow: visible;
  background:
    radial-gradient(120% 140% at 85% -40%, rgba(142,127,242,.38) 0%, transparent 55%),
    linear-gradient(180deg, #221E36 0%, var(--tt-noche) 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 12px 28px -20px rgba(22,21,29,.9);
}
html.en-app body.totem .tt-side .tt-side-cab,
html.en-app body.totem .tt-side .tt-marca { flex: 1 1 auto; min-width: 0; padding: 0; gap: 10px; }
html.en-app body.totem .tt-side .tt-negocio-logo {
  width: 34px; height: 34px; border-radius: 11px; font-size: 15px; flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px -6px rgba(108,85,232,.9);
}
html.en-app body.totem .tt-side .tt-negocio-txt b { font-size: 16px; letter-spacing: -.02em; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.en-app body.totem .tt-side .tt-negocio-txt small { display: block !important; font-size: 11.5px; color: rgba(255,255,255,.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
html.en-app body.totem .tt-side .tt-marca .tt-logo { width: 30px; height: 30px; }
html.en-app body.totem .tt-side > a.tt-side-item,
html.en-app body.totem .tt-side > .tt-side-sec { display: none !important; }
html.en-app body.totem .tt-side-pie { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; gap: 4px; order: 2; }
html.en-app body.totem .tt-side-pie .tt-side-item,
html.en-app body.totem .tt-side-pie .tt-tema,
html.en-app body.totem .tt-side-pie [data-nuevo-negocio] {
  width: 38px; height: 38px; min-height: 38px; padding: 0; gap: 0; font-size: 0; justify-content: center; border-radius: 12px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); border: 0;
}
html.en-app body.totem .tt-side-pie [data-nuevo-negocio] { background: var(--tt-azul-3d); color: #fff; }
html.en-app body.totem .tt-side-pie .tt-ico { width: 19px; height: 19px; margin: 0; }
html.en-app body.totem .tt-side-pie .tt-side-item span { display: none; }
html.en-app body.totem .tt-powered { display: contents !important; }
html.en-app body.totem .tt-powered > :not(.tt-tema) { display: none; }

/* secciones de la pantalla (Wallet, socios): pastillas bajo el nombre */
html.en-app body.totem .tt-side .tt-sub-nav,
html.en-app body.totem.superadmin .tt-side .menu {
  position: static; order: 3; flex: 1 1 100%; display: flex; flex-direction: row; gap: 6px;
  margin: 4px -12px 0; padding: 2px 12px 0; overflow-x: auto; scrollbar-width: none; background: none; box-shadow: none;
  scroll-snap-type: x proximity; mask-image: linear-gradient(90deg, #000 88%, transparent);
}
html.en-app body.totem .tt-side .tt-sub-nav::-webkit-scrollbar,
html.en-app body.totem.superadmin .tt-side .menu::-webkit-scrollbar { display: none; }
html.en-app body.totem .tt-side .tt-sub-nav .nav-item,
html.en-app body.totem.superadmin .tt-side .menu button {
  flex: none; width: auto; min-height: 34px; display: inline-flex; flex-direction: row; align-items: center; gap: 6px;
  padding: 0 13px; font-size: 13.5px; font-weight: 600; border-radius: 999px; border: 0; scroll-snap-align: start;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.75); box-shadow: none; position: relative;
}
html.en-app body.totem .tt-side .tt-sub-nav .nav-item .tt-ico,
html.en-app body.totem.superadmin .tt-side .menu button .tt-ico { width: 16px; height: 16px; }
html.en-app body.totem .tt-side .tt-sub-nav .nav-item.activa,
html.en-app body.totem.superadmin .tt-side .menu button.activa { background: #fff; color: var(--tt-noche); }
html.en-app body.totem .tt-side .tt-sub-nav .nav-item .contador { position: static; margin-left: 2px; }
/* negocio solo con Wallet: sus secciones hacen de barra de abajo, igual que la de servicios */
html.en-app body.totem .tt-sub-nav.tt-sub-nav-movil {
  position: fixed !important; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; border-radius: 0;
  height: var(--app-pie); padding: 0 6px var(--sab); gap: 0; align-items: stretch; justify-content: space-around;
  background: rgba(17,16,23,.94); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 -1px 0 rgba(255,255,255,.07); transform: none; transition: transform .25s cubic-bezier(.2,.9,.3,1);
}
html.en-app.kb-abierto body.totem .tt-sub-nav.tt-sub-nav-movil { transform: translateY(110%); pointer-events: none; }
html.en-app body.totem .tt-sub-nav.tt-sub-nav-movil .nav-item {
  height: var(--app-bar); min-height: 0; padding: 6px 0 4px; gap: 3px; border-radius: 0; background: none !important;
  color: rgba(255,255,255,.52); font-size: 10.5px; box-shadow: none;
}
html.en-app body.totem .tt-sub-nav.tt-sub-nav-movil .nav-item .tt-ico { width: 46px; height: 30px; padding: 4px 12px; border-radius: 999px; box-sizing: border-box; }
html.en-app body.totem .tt-sub-nav.tt-sub-nav-movil .nav-item.activa { color: #fff; }
html.en-app body.totem .tt-sub-nav.tt-sub-nav-movil .nav-item.activa .tt-ico {
  background: linear-gradient(180deg, #8E7FF2 0%, #6C55E8 65%, #5640D0 100%); box-shadow: 0 8px 18px -8px rgba(108,85,232,1), inset 0 1px 0 rgba(255,255,255,.35);
}
html.en-app body.totem .tt-sub-nav.tt-sub-nav-movil .nav-item .contador { position: absolute; top: 4px; right: calc(50% - 26px); }

/* cabecera de escritorio y migas: fuera */
html.en-app body.totem.superadmin .tt-cuerpo > header.tt-top { display: none; }
/* Wallet: el buscador de clientes siempre a mano, pegado arriba */
html.en-app body.totem.panel-totem .tt-cuerpo > header.panel-top {
  position: sticky !important; top: 0; z-index: 30; display: block; padding: 10px 12px !important; margin: 0;
  background: color-mix(in srgb, var(--tt-crema) 86%, transparent); border-bottom: 1px solid var(--tt-linea);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
html.en-app[data-tema="oscuro"] body.totem.panel-totem .tt-cuerpo > header.panel-top { background: color-mix(in srgb, #0C0B11 86%, transparent); }
html.en-app body.totem.panel-totem header.panel-top .saludo { display: none; }
html.en-app body.totem.panel-totem header.panel-top .buscador-envoltorio { margin: 0 !important; max-width: none; width: 100%; }
html.en-app body.totem.panel-totem header.panel-top .buscador-envoltorio input { min-height: 46px; border-radius: 14px; font-size: 16px; }

/* pestañas de cada servicio (Booking, Connect, Flow, AI…): fijas arriba del contenido */
html.en-app body.totem .bk-top {
  position: sticky !important; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  padding: 8px 12px; margin: 0; border-bottom: 1px solid var(--tt-linea);
  background: color-mix(in srgb, var(--tt-crema) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
html.en-app body.totem .bk-top .bk-titulo { display: none; }
html.en-app body.totem .bk-pestanas { flex: 1 1 auto; min-width: 0; padding: 3px; gap: 2px; border-radius: 14px; }
html.en-app body.totem .bk-pestanas button, html.en-app body.totem .bk-pestanas a {
  padding: 0 12px; min-height: 34px; font-size: 13.5px; border-radius: 11px; }
html.en-app body.totem .bk-pestanas .tt-ico { width: 16px; height: 16px; }
html.en-app body.totem .bk-qr-accion { width: 40px; height: 40px; min-height: 40px; border-radius: 13px; flex: none; padding: 0; }
html.en-app[data-tema="oscuro"] body.totem .bk-top { background: color-mix(in srgb, #0C0B11 86%, transparent); }

/* ----------------------------------------------- barra de abajo (servicios) */
html.en-app body.totem .tt-mbar {
  position: fixed !important; left: 0; right: 0; bottom: 0; top: auto; z-index: 50;
  display: flex; gap: 0; margin: 0; border-radius: 0; height: var(--app-pie);
  padding: 0 6px var(--sab); align-items: stretch;
  background: rgba(17,16,23,.94); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 -1px 0 rgba(255,255,255,.07), 0 -14px 30px -22px rgba(0,0,0,.6);
  transform: none; will-change: auto; animation: none;
  transition: transform .25s cubic-bezier(.2,.9,.3,1);
}
html.en-app.kb-abierto body.totem .tt-mbar { transform: translateY(110%); pointer-events: none; }
html.en-app body.totem .tt-mbar > a, html.en-app body.totem .tt-mbar > button {
  flex: 1 1 0; min-width: 0; min-height: 0; height: var(--app-bar); padding: 6px 0 4px; gap: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 0; border-radius: 0; background: none !important; box-shadow: none !important;
  color: rgba(255,255,255,.52); font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
}
html.en-app body.totem .tt-mbar .tt-ico {
  width: 46px; height: 30px; padding: 4px 12px; border-radius: 999px; box-sizing: border-box;
  transition: background .25s, box-shadow .25s, color .25s;
}
html.en-app body.totem .tt-mbar .on { color: #fff; }
html.en-app body.totem .tt-mbar .on .tt-ico {
  background: linear-gradient(180deg, #8E7FF2 0%, #6C55E8 65%, #5640D0 100%);
  box-shadow: 0 8px 18px -8px rgba(108,85,232,1), inset 0 1px 0 rgba(255,255,255,.35);
}
html.en-app body.totem .tt-mbar > :active { transform: scale(.92); }
html.en-app body.totem .tt-mas:popover-open {
  inset: auto 10px calc(var(--app-pie) + 10px) 10px; border-radius: 22px;
}
html.en-app body.totem .tt-toasts { bottom: calc(var(--app-pie) + 14px); }

/* ------------------------------------------------- tipografía y piezas */
html.en-app body.totem .tt-h1 { font-size: 24px; letter-spacing: -.035em !important; }
html.en-app body.totem .tt-h2 { font-size: 17px; }
html.en-app body.totem .tt-lead { font-size: 14px; margin-top: 4px; line-height: 1.45; }
html.en-app body.totem .tt-card { padding: 16px; border-radius: 20px; }
html.en-app body.totem .tt-card-cab { margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
html.en-app body.totem .tt-card-cab p { font-size: 12.5px; }
html.en-app body.totem .tt-cabecera { gap: 10px; margin-bottom: 14px; }
html.en-app body.totem .tt-rejilla { gap: 12px; }
html.en-app body.totem .tt-btn { min-height: 44px; border-radius: 14px; }
html.en-app body.totem .tt-btn.peq { min-height: 36px; border-radius: 11px; }
html.en-app body.totem a, html.en-app body.totem button, html.en-app body.totem label,
html.en-app body.totem .tt-side, html.en-app body.totem .tt-mbar { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.en-app body.totem { -webkit-tap-highlight-color: transparent; }

/* números: rejilla compacta de 3 en vez de tira que se desliza */
html.en-app body.totem .tt-kpis, html.en-app body.totem.panel-totem .metricas, html.en-app body.totem .bk-kpis {
  display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible;
  margin: 0 0 14px; padding: 0; scroll-snap-type: none;
}
html.en-app body.totem .tt-kpis > *, html.en-app body.totem.panel-totem .metricas > *, html.en-app body.totem .bk-kpis > * {
  min-width: 0; max-width: none; margin: 0;
}
html.en-app body.totem .tt-kpi {
  padding: 12px; border-radius: 16px; gap: 6px; flex-direction: column; align-items: flex-start; min-height: 0;
}
html.en-app body.totem .tt-kpi .tt-kpi-ico { width: 30px; height: 30px; border-radius: 10px; }
html.en-app body.totem .tt-kpi .tt-kpi-ico .tt-ico { width: 17px; height: 17px; }
html.en-app body.totem .tt-kpi b { font-size: 21px; }
html.en-app body.totem .tt-kpi span { font-size: 11.5px; line-height: 1.25; display: block; }
html.en-app body.totem .tt-kpi small { font-size: 11px; }
html.en-app body.totem.panel-totem .metricas .metrica { padding: 12px; border-radius: 16px; }
html.en-app body.totem.panel-totem .metricas .valor { font-size: 22px; }
html.en-app body.totem.panel-totem .metricas .etiqueta { font-size: 11.5px; line-height: 1.25; }

/* portadas grandes (hero): una línea de saludo, sin escena 3D */
html.en-app body.totem .tt-hero {
  background: none !important; box-shadow: none !important; border: 0; color: var(--tt-texto);
  padding: 2px 2px 0 !important; margin: 0 0 14px; min-height: 0; display: block; overflow: visible;
}
html.en-app body.totem .tt-hero::before, html.en-app body.totem .tt-hero::after { display: none; }
html.en-app body.totem .tt-hero .tt-escena, html.en-app body.totem .tt-hero-tag { display: none !important; }
html.en-app body.totem .tt-hero .tt-h1 { color: var(--tt-texto); font-size: 26px; text-shadow: none; }
html.en-app body.totem .tt-hero .tt-lead { color: var(--tt-gris); }
html.en-app body.totem .tt-hero-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
html.en-app body.totem .tt-hero-acc .tt-btn { width: 100%; justify-content: center; font-size: 14px; padding: 0 10px; }
html.en-app body.totem .tt-hero-acc .tt-btn.cristal {
  background: var(--tt-sup); color: var(--tt-texto) !important; border: 1px solid var(--tt-linea); box-shadow: var(--tt-sombra);
}
html.en-app body.totem .tt-hero-acc .tt-btn.cristal .tt-ico { color: var(--tt-azul); }

/* ventanas: hoja desde abajo por encima de la barra */
html.en-app body.totem dialog.tt-dialogo { max-height: calc(var(--app-h) - var(--sat) - 20px); padding-bottom: var(--sab); }
html.en-app body.totem dialog.tt-dialogo > form { padding: 24px 16px 16px; }

/* ------------------------------------------------------------- Inicio */
html.en-app body.totem.inicio-totem .tt-hero .tt-lead { display: none; }
html.en-app body.totem .tt-servicios {
  display: flex; flex-direction: column; gap: 0; padding: 4px; margin: 0; list-style: none;
  background: var(--tt-sup); border-radius: 22px; box-shadow: var(--tt-sombra); border: 1px solid rgba(22,21,29,.04);
}
html.en-app body.totem .tt-servicios > li { animation-duration: .35s; }
html.en-app body.totem .tt-servicios > li + li .tt-servicio { border-top: 1px solid var(--tt-linea); border-radius: 0; }
html.en-app body.totem .tt-servicios > li + li .tt-servicio::after { display: none; }
html.en-app body.totem .tt-servicio {
  display: flex; align-items: center; gap: 12px; padding: 12px 10px; min-height: 0; border-radius: 18px;
  background: none !important; box-shadow: none !important; border: 0; transform: none !important;
}
html.en-app body.totem .tt-servicio-ico { width: 42px; height: 42px; border-radius: 13px; flex: none; }
html.en-app body.totem .tt-servicio-ico .tt-ico { width: 21px; height: 21px; }
html.en-app body.totem .tt-servicio-txt { min-width: 0; flex: 1; }
html.en-app body.totem .tt-servicio-txt strong { font-size: 15.5px; display: block; }
html.en-app body.totem .tt-servicio-txt span { font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
html.en-app body.totem .tt-servicio-ir { width: 28px; height: 28px; flex: none; opacity: .5; }
html.en-app body.totem .tt-servicio:active { background: var(--tt-hueco) !important; }

/* ------------------------------------------------------------- Wallet */
html.en-app body.totem.panel-totem .panel-top { padding: 0 0 4px; }
html.en-app body.totem.panel-totem .panel-top .tt-h1 { font-size: 24px; }
html.en-app body.totem.panel-totem .tarjeta { padding: 16px; border-radius: 20px; margin-bottom: 12px; }
html.en-app body.totem.panel-totem .cab-tarjeta { gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
html.en-app body.totem.panel-totem .cab-tarjeta h2 { font-size: 17px; }
html.en-app body.totem.panel-totem .buscador-envoltorio { margin: 12px 0; }
html.en-app body.totem.panel-totem .buscador-envoltorio input { min-height: 48px; border-radius: 15px; }
html.en-app body.totem.panel-totem .premio-fila { padding: 12px; gap: 8px 10px; }
html.en-app body.totem.panel-totem .premio-fila > .btn { min-height: 42px; }

/* ------------------------------------------------------------ Booking */
html.en-app body.totem .bk-main { padding-top: 12px !important; }
html.en-app body.totem .bk-acciones [data-nueva-cita] { bottom: calc(var(--app-pie) + 14px); right: 14px; }

/* ------------------------------------------------------------- Connect */
html.en-app body.totem .cn-paso { padding: 16px 14px; }
html.en-app body.totem .cn-enviar { bottom: calc(var(--app-pie) + 10px); }

/* ---------------------------------------------------------------- Flow */
html.en-app body.totem .fl-hero { padding: 16px; gap: 12px; border-radius: 20px; }
html.en-app body.totem .fl-hero p { display: none; }
html.en-app body.totem .fl-hero h2 { font-size: 20px; margin: 4px 0 0; }
html.en-app body.totem .fl-kpis { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; overflow: visible; }
html.en-app body.totem .fl-kpi { min-width: 0; padding: 10px 12px; }
html.en-app body.totem .fl-receta { padding: 14px; }

/* ------------------------------------------------------------ socios */
html.en-app body.totem.superadmin .tt-hero .tt-lead { display: none; }
html.en-app body.totem.superadmin .tt-tabla td.cargando { padding: 16px !important; }

/* ===================================================================
   TOTEM AI: chat a pantalla completa
   El contenido se desplaza y la caja de escribir va pegada abajo, encima
   de la barra o, con el teclado abierto, justo encima del teclado.
   =================================================================== */
html.en-app body.totem.ai-totem .tt-cuerpo { display: flex; flex-direction: column; }
html.en-app body.totem.ai-totem .bk-top { flex: none; }
html.en-app body.totem.ai-totem .ai-top-der { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
html.en-app body.totem.ai-totem .ai-main {
  flex: 1 0 auto; min-height: 0 !important; display: flex; flex-direction: column;
  padding: 0 14px 0 !important; max-width: none;
}
html.en-app body.totem.ai-totem .ai-hilo { flex: 1 0 auto; padding: 14px 0 12px; gap: 14px; }
html.en-app body.totem.ai-totem .ai-bienvenida { padding: 8px 4px 0; }
html.en-app body.totem.ai-totem .ai-orbe { width: 76px; height: 76px; margin-bottom: 12px; }
html.en-app body.totem.ai-totem .ai-orbe img { width: 50px; height: 50px; }
html.en-app body.totem.ai-totem .ai-bienvenida h2 { font-size: 22px; margin-bottom: 6px; }
html.en-app body.totem.ai-totem .ai-bienvenida > p { font-size: 14px; line-height: 1.45; margin-bottom: 14px; }
html.en-app body.totem.ai-totem .ai-aviso { font-size: 13px; padding: 10px 12px; margin-bottom: 14px; }
html.en-app body.totem.ai-totem .ai-sugerencias { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
html.en-app body.totem.ai-totem .ai-sugerencias button {
  text-align: left; padding: 12px; border-radius: 16px; font-size: 13.5px; line-height: 1.3; min-height: 62px;
  display: flex; align-items: flex-start;
}
html.en-app body.totem.ai-totem .ai-escribir {
  position: sticky; bottom: 0; z-index: 20; margin: 0 -14px; gap: 8px; align-items: flex-end;
  padding: 10px 12px calc(var(--app-pie) + 10px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tt-crema) 0%, transparent) 0%, var(--tt-crema) 22%);
}
html.en-app body.totem.ai-totem .ai-escribir textarea {
  min-height: 46px; padding: 12px 16px; border-radius: 23px; font-size: 16px; line-height: 1.35; max-height: 130px;
}
html.en-app body.totem.ai-totem .ai-enviar { width: 46px; height: 46px; min-height: 46px; border-radius: 50%; padding: 0; flex: none; }
html.en-app[data-tema="oscuro"] body.totem.ai-totem .ai-escribir {
  background: linear-gradient(180deg, rgba(12,11,17,0) 0%, #0C0B11 22%);
}

/* ===================================================================
   Entrar: una sola pantalla, sin desplazarse
   =================================================================== */
html.en-app body.totem.login-totem {
  display: flex !important; flex-direction: column; grid-template-columns: none; min-height: 0;
  height: var(--app-h); overflow-y: auto; overflow-x: hidden; background: var(--tt-noche);
}
html.en-app body.totem.login-totem .escena {
  flex: none; padding: calc(var(--sat) + 18px) 22px 26px; min-height: 0;
  transition: padding .3s cubic-bezier(.2,.9,.3,1);
}
html.en-app body.totem.login-totem .escena .tt-escena { inset: calc(var(--sat) - 6px) -30px auto auto; width: 150px; height: 150px; left: auto; }
html.en-app body.totem.login-totem .escena .texto { margin-top: 18px; padding: 0; }
html.en-app body.totem.login-totem .escena h1 { font-size: 30px; max-width: 11ch; margin-bottom: 8px; }
html.en-app body.totem.login-totem .escena p { font-size: 14px; max-width: 30ch; }
html.en-app body.totem.login-totem .escena .piezas { display: none; }
html.en-app body.totem.login-totem .lado {
  flex: 1 0 auto; display: block; padding: 18px 16px calc(var(--sab) + 16px); margin-top: -14px;
  background: var(--tt-crema); border-radius: 26px 26px 0 0; position: relative; z-index: 3;
  box-shadow: 0 -18px 40px -24px rgba(0,0,0,.6);
}
html.en-app body.totem.login-totem .caja { max-width: none; }
html.en-app body.totem.login-totem .pestanas { margin-bottom: 14px; }
html.en-app body.totem.login-totem .tt-card { padding: 18px 16px; }
html.en-app body.totem.login-totem .tt-card h2 { font-size: 21px; }
html.en-app body.totem.login-totem .tt-card .tt-lead { margin-bottom: 8px; }
html.en-app body.totem.login-totem form label { margin-top: 10px; }
html.en-app body.totem.login-totem .entrar { margin-top: 16px; min-height: 50px; }
html.en-app body.totem.login-totem .teclado { gap: 8px; }
html.en-app body.totem.login-totem .teclado button { height: 54px; }
html.en-app body.totem.login-totem .pie { margin-top: 12px; }
html.en-app body.totem.login-totem .pie + .tt-tema, html.en-app body.totem.login-totem .lado > .tt-tema { display: none; }
/* con el teclado abierto, la portada se recoge para dejar sitio */
html.en-app.kb-abierto body.totem.login-totem .escena { padding-bottom: 18px; }
html.en-app.kb-abierto body.totem.login-totem .escena .texto,
html.en-app.kb-abierto body.totem.login-totem .escena .tt-escena { display: none; }
html.en-app[data-tema="oscuro"] body.totem.login-totem .lado { background: #0C0B11; }

@media (prefers-reduced-motion: reduce) {
  html.en-app body.totem .tt-mbar { transition: none; }
}

/* ajustes finos: portada sin márgenes interiores y números de 4 en 2×2 */
html.en-app body.totem .tt-hero-txt { padding: 0 !important; max-width: none !important; }
html.en-app body.totem .tt-kpis:has(> :nth-child(4):last-child),
html.en-app body.totem .bk-kpis:has(> :nth-child(4):last-child),
html.en-app body.totem .fl-kpis:has(> :nth-child(4):last-child),
html.en-app body.totem .tt-kpis:has(> :nth-child(2):last-child),
html.en-app body.totem .bk-kpis:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
html.en-app body.totem .tt-kpis:has(> :nth-child(4):last-child) .tt-kpi,
html.en-app body.totem .tt-kpis:has(> :nth-child(2):last-child) .tt-kpi { flex-direction: row; align-items: center; gap: 10px; }
html.en-app body.totem.panel-totem .premio-fila { flex-direction: column; align-items: stretch; }
html.en-app body.totem.panel-totem .premio-fila > :first-child { align-self: flex-start; }

}

/* =====================================================================
   iPad en horizontal (y pantallas anchas): el diseño de escritorio, con el
   menú a la izquierda, dentro del mismo armazón fijo. Una franja oscura
   arriba deja legible la hora y la batería.
   ===================================================================== */
@media (min-width: 861px) {
html.en-app {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --app-h: 100dvh; --app-pie: 0px;
  -webkit-text-size-adjust: 100%;
}
html.en-app:has(> body.totem > .tt-app), html.en-app:has(> body.login-totem),
html.en-app body.totem:has(> .tt-app) { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.en-app body.totem:has(> .tt-app) { position: fixed; inset: 0 0 auto 0; height: var(--app-h); margin: 0; }
html.en-app body.totem .tt-app { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); }
html.en-app body.totem .tt-app > .tt-side {
  position: relative; top: auto; height: 100%; min-height: 0; overflow-y: auto; scrollbar-width: none;
  padding-top: calc(var(--sat) + 18px); padding-bottom: calc(var(--sab) + 14px);
  padding-left: calc(env(safe-area-inset-left, 0px) + 14px);
}
html.en-app body.totem .tt-app > .tt-side::-webkit-scrollbar { display: none; }
html.en-app body.totem .tt-cuerpo {
  height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain; position: relative; border-top: var(--sat) solid var(--tt-noche);
}
html.en-app body.totem .tt-main { padding-bottom: calc(var(--sab) + 60px); }
/* dedos, no ratón: objetivos algo más grandes */
html.en-app body.totem .tt-side-item, html.en-app body.totem .tt-side .menu button, html.en-app body.totem .tt-side .nav-item { min-height: 46px; }
html.en-app body.totem .tt-btn.peq { min-height: 40px; }
html.en-app .app-tirar { top: calc(var(--sat) + 12px); left: calc(50% + var(--tt-side, 252px) / 2); }
/* chat de TOTEM AI: ocupa el alto justo, con la caja de escribir siempre a la vista */
html.en-app.kb-abierto body.totem .tt-main { padding-bottom: 16px; }
/* entrada */
html.en-app body.totem.login-totem { position: fixed; inset: 0 0 auto 0; height: var(--app-h); min-height: 0; overflow: hidden; }
html.en-app body.totem.login-totem .escena { padding-top: calc(var(--sat) + 40px); }
html.en-app body.totem.login-totem .lado { padding-top: calc(var(--sat) + 24px); padding-bottom: calc(var(--sab) + 24px); overflow-y: auto; }
}

/* Entre 861 y 1300 px (iPad en horizontal): Wallet con dos columnas holgadas */
@media (min-width: 861px) and (max-width: 1300px) {
html.en-app body.totem.panel-totem .tt-r-inicio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
html.en-app body.totem.panel-totem .metricas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.en-app body.totem.panel-totem .premio-fila { flex-wrap: wrap; }
}
@media (min-width: 861px) {
/* franja oscura bajo la hora también en la entrada */
html.en-app body.totem.login-totem .lado::before { content: ''; position: fixed; top: 0; right: 0; width: 100%; height: var(--sat); background: var(--tt-noche); z-index: 5; }
html.en-app body.totem.login-totem .lado > .tt-tema { top: calc(var(--sat) + 14px); }
}

/* =====================================================================
   iPad en vertical (700–860 px): el armazón del iPhone con más aire —
   contenido centrado, números en una fila, servicios en dos columnas y la
   barra de abajo como una cápsula flotante.
   ===================================================================== */
@media (min-width: 700px) and (max-width: 860px) {
html.en-app { --app-bar: 64px; --app-pie: calc(var(--app-bar) + var(--sab) + 14px); }
html.en-app.kb-abierto { --app-pie: 0px; }
html.en-app body.totem .tt-main,
html.en-app body.totem.panel-totem main.tt-main { padding: 22px 28px calc(var(--app-pie) + 34px) !important; max-width: 820px; margin: 0 auto; }
html.en-app body.totem .tt-app > .tt-side { padding: calc(var(--sat) + 8px) 24px 10px; }
html.en-app body.totem .tt-side .tt-negocio-logo { width: 40px; height: 40px; font-size: 17px; }
html.en-app body.totem .tt-side .tt-negocio-txt b { font-size: 18px; }
html.en-app body.totem .tt-side .tt-sub-nav, html.en-app body.totem.superadmin .tt-side .menu { margin: 6px -24px 0; padding: 2px 24px 0; }
html.en-app body.totem .tt-side .tt-sub-nav .nav-item, html.en-app body.totem.superadmin .tt-side .menu button { min-height: 40px; font-size: 14.5px; padding: 0 16px; }

/* barra de abajo: cápsula centrada */
html.en-app body.totem .tt-mbar,
html.en-app body.totem .tt-sub-nav.tt-sub-nav-movil {
  left: 50%; right: auto; width: min(560px, calc(100% - 48px)); margin-left: calc(min(560px, 100% - 48px) / -2);
  bottom: calc(var(--sab) + 12px); height: var(--app-bar); padding: 0 10px; border-radius: 999px;
  box-shadow: 0 20px 44px -18px rgba(14,13,20,.75), inset 0 1px 0 rgba(255,255,255,.1), 0 0 0 1px rgba(255,255,255,.06);
}
html.en-app body.totem .tt-mbar > a, html.en-app body.totem .tt-mbar > button,
html.en-app body.totem .tt-sub-nav.tt-sub-nav-movil .nav-item { font-size: 11.5px; }
html.en-app body.totem .tt-mas:popover-open { inset: auto auto calc(var(--app-pie) + 10px) 50%; width: 520px; margin-left: -260px; }
html.en-app body.totem .bk-acciones [data-nueva-cita] { right: 28px; }

/* números en una sola fila */
html.en-app body.totem .tt-kpis, html.en-app body.totem .bk-kpis, html.en-app body.totem .fl-kpis,
html.en-app body.totem .tt-kpis:has(> :nth-child(4):last-child),
html.en-app body.totem .bk-kpis:has(> :nth-child(4):last-child),
html.en-app body.totem .fl-kpis:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px; }
html.en-app body.totem .tt-kpis:has(> :nth-child(4):last-child) .tt-kpi { flex-direction: column; align-items: flex-start; }
html.en-app body.totem.panel-totem .metricas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
html.en-app body.totem.panel-totem .premio-fila { flex-direction: row; align-items: center; flex-wrap: wrap; }

/* inicio: servicios en dos columnas de tarjetas */
html.en-app body.totem .tt-servicios { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0; background: none; box-shadow: none; border: 0; }
html.en-app body.totem .tt-servicios > li + li .tt-servicio { border-top: 0; border-radius: 20px; }
html.en-app body.totem .tt-servicio { background: var(--tt-sup) !important; box-shadow: var(--tt-sombra) !important; border-radius: 20px; padding: 18px 16px; }
html.en-app body.totem .tt-servicio-txt span { white-space: normal; }
html.en-app body.totem .tt-h1 { font-size: 28px; }

/* entrada: tarjeta centrada bajo una portada más alta */
html.en-app body.totem.login-totem .escena { padding: calc(var(--sat) + 34px) 44px 54px; }
html.en-app body.totem.login-totem .escena .tt-escena { width: 300px; height: 300px; inset: calc(var(--sat) + 4px) 10px auto auto; }
html.en-app body.totem.login-totem .escena .texto { margin-top: 70px; }
html.en-app body.totem.login-totem .escena h1 { font-size: 46px; max-width: 12ch; }
html.en-app body.totem.login-totem .escena p { font-size: 17px; max-width: 38ch; }
html.en-app body.totem.login-totem .lado { padding: 34px 24px calc(var(--sab) + 30px); border-radius: 34px 34px 0 0; }
html.en-app body.totem.login-totem .caja { max-width: 520px; margin: 0 auto; }
html.en-app body.totem.login-totem .tt-card { padding: 28px 26px; }
html.en-app.kb-abierto body.totem.login-totem .escena .texto,
html.en-app.kb-abierto body.totem.login-totem .escena .tt-escena { display: revert; }
}


/* =====================================================================
   Hojas (ventanas): una sola zona que se desplaza, pie siempre a la vista,
   botón de cerrar, se arrastran hacia abajo y se apoyan sobre el teclado.
   ===================================================================== */
html.en-app body.totem dialog.tt-dialogo {
  position: fixed; overflow: hidden; padding: 0 !important; max-width: 100%;
  transform: translateY(var(--arrastre, 0px)); transition: transform .26s cubic-bezier(.2,.9,.3,1), opacity .2s;
}
html.en-app body.totem dialog.tt-dialogo[open] { display: flex; flex-direction: column; }
html.en-app body.totem dialog.tt-dialogo.arrastrando { transition: none; }
html.en-app body.totem dialog.tt-dialogo::backdrop { transition: opacity .22s; }
html.en-app body.totem dialog.tt-dialogo.saliendo::backdrop { opacity: 0; }
html.en-app body.totem dialog.tt-dialogo > form {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
html.en-app body.totem dialog.tt-dialogo > form::before { display: none; }
html.en-app body.totem dialog.tt-dialogo h2 { padding-right: 46px; }
html.en-app body.totem dialog.tt-dialogo .tt-dialogo-pie {
  position: sticky; bottom: 0; z-index: 3; background: var(--tt-sup); border-top: 1px solid var(--tt-linea); flex-wrap: wrap;
}
html.en-app .app-x {
  position: absolute; top: 14px; right: 14px; z-index: 6; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; background: var(--tt-hueco); color: var(--tt-gris);
  -webkit-tap-highlight-color: transparent; transition: transform .15s, background .2s;
}
html.en-app .app-x::after { content: ''; position: absolute; inset: -8px; }
html.en-app .app-x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; }
html.en-app .app-x:active { transform: scale(.88); background: var(--tt-linea); }

@media (max-width: 860px) {
html.en-app body.totem dialog.tt-dialogo {
  inset: auto 0 var(--kb, 0px) 0; margin: 0 auto; width: min(640px, 100%); height: auto;
  max-height: calc(var(--app-h) - var(--sat) - 12px); border-radius: 26px 26px 0 0;
  box-shadow: 0 -24px 60px -20px rgba(14,13,20,.55);
}
html.en-app body.totem dialog.tt-dialogo.saliendo { transform: translateY(105%); }
html.en-app body.totem dialog.tt-dialogo::before {
  content: ''; flex: none; width: 44px; height: 5px; margin: 9px auto 0; border-radius: 9px; background: var(--tt-linea);
}
html.en-app body.totem dialog.tt-dialogo > form { padding: 12px 16px calc(var(--sab) + 16px); }
html.en-app body.totem dialog.tt-dialogo > form:has(.tt-dialogo-pie) { padding-bottom: 0; }
html.en-app body.totem dialog.tt-dialogo .tt-dialogo-pie { margin: 16px -16px 0; padding: 12px 16px calc(12px + var(--sab)); }
html.en-app.kb-abierto body.totem dialog.tt-dialogo .tt-dialogo-pie { padding-bottom: 12px; }
html.en-app body.totem dialog.tt-dialogo .tt-dialogo-pie .tt-btn { flex: 1 1 auto; min-height: 48px; }
}
@media (min-width: 700px) and (max-width: 860px) {
html.en-app body.totem dialog.tt-dialogo > form { padding-inline: 24px; }
html.en-app body.totem dialog.tt-dialogo .tt-dialogo-pie { margin-inline: -24px; padding-inline: 24px; }
}
@media (min-width: 861px) {
html.en-app body.totem dialog.tt-dialogo {
  inset: var(--sat) 0 var(--kb, 0px) 0; margin: auto; height: fit-content;
  max-height: calc(var(--app-h) - var(--sat) - var(--kb, 0px) - 32px); border-radius: 24px;
}
html.en-app body.totem dialog.tt-dialogo.saliendo { opacity: 0; transform: scale(.96); }
html.en-app body.totem dialog.tt-dialogo > form { padding: 26px 26px 0; }
html.en-app body.totem dialog.tt-dialogo .tt-dialogo-pie { margin: 22px -26px 0; padding: 14px 26px; }
html.en-app body.totem dialog.tt-dialogo .tt-dialogo-pie .tt-btn { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) { html.en-app body.totem dialog.tt-dialogo { transition: none; } }
html.en-app body.totem dialog.tt-dialogo .bk-ver-cab { padding-right: 46px; }
html.en-app body.totem dialog.tt-dialogo .bk-ver-cab h2 { padding-right: 0; }
