.spot-mobile-header-brand, .spot-mobile-robot-toggle { display:none; }
@media (max-width:768px) {
  body .header {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr) !important;
    grid-template-rows:48px !important;
    align-items:center !important;
    gap:8px !important;
    padding:12px 14px !important;
  }
  body .header .header-actions {
    grid-column:1; grid-row:1 !important;
    min-width:0; width:100% !important;
  }
  body .header .user-profile-wrapper, body .header .user-profile { max-width:100% !important; min-width:0 !important; }
  body .header .user-info { overflow:hidden; }
  body .header .user-name, body .header .user-role { max-width:100% !important; }
  body .header .spot-mobile-user-chevron { flex:0 0 14px; width:14px; }
  body .header .spot-mobile-header-brand {
    display:block; grid-column:2; grid-row:1;
    width:42px; height:42px; object-fit:contain; justify-self:center;
  }
  body .header .spot-mobile-robot-toggle {
    display:grid; place-items:center; grid-column:3; grid-row:1;
    justify-self:end; width:48px; height:48px; padding:2px;
    border:0; border-radius:12px; background:transparent; cursor:pointer;
  }
  .spot-mobile-robot-toggle svg { width:44px; height:44px; }
  .spot-mobile-robot-toggle:focus-visible { outline:2px solid #747980; outline-offset:2px; }
  body .header .ai-command-container:not(.bubble-open) { display:none !important; }
  body .header .ai-command-container.spot-mode-bubble.bubble-open {
    display:flex !important; position:fixed !important;
    top:76px !important; bottom:auto !important; right:12px !important; left:auto !important;
    width:calc(100vw - 24px) !important; min-width:0 !important; max-width:420px !important;
    max-height:calc(100dvh - 92px) !important; height:auto !important;
    transform:none !important; margin:0 !important;
  }
  body .header .ai-command-container.bubble-open .ai-response-box {
    max-height:calc(100dvh - 180px) !important;
    overflow:auto !important;
  }
}

@media (max-width:768px) {
  body .header > .spot-module-navigation {
    grid-column:1 / -1;
    grid-row:2;
    min-width:0;
  }
}

/* v22: no mobile existe apenas o robô do cabeçalho; nunca mostrar uma segunda bolinha embaixo. */
@media (max-width:768px) {
  body > .ai-command-container.spot-mode-bubble:not(.bubble-open) {
    display:none !important;
  }
}

/* v23 — botão Voltar no mobile no mesmo padrão visual do desktop. */
@media (max-width:768px) {
  body .main-wrapper:has(> .floating-window.active:not(.is-minimized)) > .header > .spot-module-navigation,
  body .main-wrapper:has(> #spot-chat-shell.open:not([hidden])) > .header > .spot-module-navigation {
    display:flex !important;
    grid-column:1 / -1 !important;
    grid-row:2 !important;
    justify-self:start !important;
    align-self:center !important;
    align-items:center !important;
    justify-content:flex-start !important;
    width:70px !important;
    height:52px !important;
    min-width:70px !important;
    min-height:52px !important;
    margin:2px 0 0 0 !important;
    padding:7px 0 7px 9px !important;
    border:0 !important;
    border-radius:16px !important;
    background:#dfe1e2 !important;
    box-shadow:none !important;
    box-sizing:border-box !important;
    position:static !important;
    transform:none !important;
    overflow:visible !important;
    z-index:20 !important;
  }

  body .header > .spot-module-navigation .spot-module-back {
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    flex:0 0 38px !important;
    width:38px !important;
    height:38px !important;
    min-width:38px !important;
    min-height:38px !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:12px !important;
    background:#fff !important;
    color:#000 !important;
    box-shadow:none !important;
  }

  body .header > .spot-module-navigation .spot-module-back svg {
    width:28px !important;
    height:28px !important;
    min-width:28px !important;
    min-height:28px !important;
    fill:none !important;
    stroke:#000 !important;
    stroke-width:2.35 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
  }
}
