/* XMARTS LAB · Header móvil V3.
   Reutiliza cabecera Marketing de PC, SIN duplicar botones ni eventos.
   Sólo media móvil; no afecta a mapa, LiveKit, permisos o escritorio. */
@media (max-width:700px) {
  /* Evitar las dos salidas y el nombre de equipo usados por el prototipo móvil. */
  body.xm-mkt-ui .app-header > .brand-shell > :not(#xmMktBrandTitle):not(#xmMktBrandExit) {
    display:none!important;
  }
  body.xm-mkt-ui .app-header > .brand-shell {
    position:fixed!important;
    top:calc(12px + env(safe-area-inset-top,0px))!important;
    left:10px!important;right:auto!important;
    width:auto!important;min-width:0!important;
    max-width:calc(100vw - 145px)!important;
    height:49px!important;min-height:49px!important;
    padding:4px 7px 4px 5px!important;gap:8px!important;
    display:flex!important;flex-wrap:nowrap!important;
    align-items:center!important;justify-content:flex-start!important;
    border-radius:999px!important;
    background:var(--vo-light-surface,rgba(32,35,34,.97))!important;
    border:1px solid rgba(255,255,255,.10)!important;
  }
  /* Mismo isotipo blanco sobre círculo lima de la versión de escritorio. */
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandTitle {
    order:1!important;
    display:flex!important;flex:0 1 auto!important;align-items:center!important;
    min-width:0!important;gap:9px!important;
    margin:0!important;padding:0!important;
    color:var(--vo-light-primary,#f3f4ef)!important;
    font:800 0.75rem/1.15 "Segoe UI",system-ui,sans-serif!important;
    letter-spacing:-.015em!important;white-space:nowrap!important;
    overflow:hidden!important;text-overflow:ellipsis!important;
  }
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandTitle::before {
    content:""!important;
    flex:0 0 36px!important;width:36px!important;height:36px!important;
    display:block!important;border-radius:50%!important;
    background-color:#93c362!important;
    background-image:url("/marketing-icons/x-isotipo-blanco.svg")!important;
    background-position:center!important;background-repeat:no-repeat!important;
    background-size:23px 26px!important;
    box-shadow:0 0 0 1px rgba(255,255,255,.10)!important;
  }
  /* UN solo salir, rojo y con el mismo handler de #logout de escritorio. */
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandExit {
    order:2!important;
    display:grid!important;place-items:center!important;
    flex:0 0 34px!important;width:34px!important;min-width:34px!important;
    height:34px!important;min-height:34px!important;
    padding:6px!important;margin:0!important;
    border:1px solid rgba(244,124,111,.38)!important;
    border-radius:50%!important;
    background:var(--vo-light-surface,rgba(227,81,75,.22))!important;
    color:var(--vo-light-primary,#ff978b)!important;
    box-sizing:border-box!important;
    cursor:pointer!important;
  }
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandExit:hover {
    background:var(--vo-light-hover,rgba(227,81,75,.34))!important;
  }
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandExit[hidden],
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandExit.xm-mobile-duplicate-exit {
    display:none!important;
  }
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandExit > svg {
    display:block!important;width:20px!important;height:20px!important;
    stroke:currentColor!important;
  }
  /* Derecha: avisos, avatar y los TRES PUNTOS NATIVOS SOLO PARA ADMINS.
     El JS existente (#xmMktMore) controla hidden según #adminBtn/#buildBtn. */
  body.xm-mkt-ui .app-header > .header-actions {
    position:fixed!important;
    right:8px!important;left:auto!important;
    top:calc(12px + env(safe-area-inset-top,0px))!important;
    width:max-content!important;min-width:0!important;
    max-width:140px!important;height:49px!important;min-height:49px!important;
    padding:4px 5px!important;gap:3px!important;
    display:flex!important;flex-wrap:nowrap!important;align-items:center!important;
    justify-content:flex-end!important;overflow:visible!important;
    border-radius:999px!important;background:var(--vo-light-surface,rgba(32,35,34,.97))!important;
  }
  body.xm-mkt-ui .app-header > .header-actions > .xm-mkt-more {
    display:flex!important;position:relative!important;align-items:center!important;
    justify-content:center!important;flex:0 0 32px!important;
    height:38px!important;min-width:32px!important;
    margin:0!important;padding:0!important;
    overflow:visible!important;
  }
  body.xm-mkt-ui .app-header > .header-actions > .xm-mkt-more[hidden] {
    display:none!important;
  }
  body.xm-mkt-ui .app-header > .header-actions .xm-mkt-more-trigger {
    display:grid!important;place-items:center!important;
    width:32px!important;min-width:32px!important;height:36px!important;
    padding:0!important;margin:0!important;
    border:1px solid rgba(255,255,255,.10)!important;
    border-radius:50%!important;
    color:var(--vo-light-primary,#e6ebe3)!important;background:var(--vo-light-surface,rgba(255,255,255,.055))!important;
    font-size:1.5rem!important;line-height:1!important;cursor:pointer!important;
  }
  body.xm-mkt-ui .app-header > .header-actions .xm-mkt-more-menu {
    display:flex!important;flex-direction:column!important;
    position:absolute!important;z-index:8000!important;
    top:calc(100% + 13px)!important;right:-4px!important;left:auto!important;
    width:193px!important;min-width:193px!important;
    padding:7px!important;gap:3px!important;box-sizing:border-box!important;
    border:1px solid rgba(255,255,255,.14)!important;border-radius:15px!important;
    background:var(--vo-light-surface,#242826)!important;box-shadow:0 14px 35px rgba(0,0,0,.50)!important;
  }
  body.xm-mkt-ui .app-header > .header-actions .xm-mkt-more-menu[hidden]{
    display:none!important;
  }
  body.xm-mkt-ui .app-header > .header-actions .xm-mkt-more-menu button {
    display:block!important;width:100%!important;min-height:41px!important;
    padding:9px 12px!important;border:0!important;border-radius:9px!important;
    text-align:left!important;background:transparent!important;
    color:var(--vo-light-primary,#f0f4ec)!important;font-size:0.8125rem!important;font-weight:750!important;
  }
  body.xm-mkt-ui .app-header > .header-actions .xm-mkt-more-menu button[hidden]{
    display:none!important;
  }
  body.xm-mkt-ui .app-header > .header-actions .xm-mkt-more-menu button:not([hidden]):active{
    background:var(--vo-light-selection,rgba(155,203,96,.15))!important;
  }
}
@media (max-width:380px) {
  body.xm-mkt-ui .app-header > .brand-shell {
    left:6px!important;max-width:calc(100vw - 133px)!important;
    padding:4px!important;gap:5px!important;
  }
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandTitle {
    gap:6px!important;font-size:0.6875rem!important;
  }
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandTitle::before {
    width:32px!important;height:32px!important;flex-basis:32px!important;
    background-size:21px 24px!important;
  }
  body.xm-mkt-ui .app-header > .brand-shell > #xmMktBrandExit {
    width:31px!important;min-width:31px!important;height:31px!important;min-height:31px!important;
    flex-basis:31px!important;
  }
  body.xm-mkt-ui .app-header > .header-actions {
    right:5px!important;gap:1px!important;padding:4px 3px!important;
    max-width:127px!important;
  }
  body.xm-mkt-ui .app-header > .header-actions > .xm-mkt-more {
    flex-basis:29px!important;min-width:29px!important;
  }
  body.xm-mkt-ui .app-header > .header-actions .xm-mkt-more-trigger {
    width:29px!important;min-width:29px!important;
  }
}
