/* Site no celular com cara de aplicativo (includes/mobile.php). Só abaixo de 992 px. */
.stbm-shell { display: none; }

@media (max-width: 991.98px) {
  html.stbm {
    --stbm-azul-50: #E6F1F8; --stbm-azul: #0068A9; --stbm-azul-700: #004775; --stbm-azul-800: #003659;
    --stbm-verde: #45AD4B; --stbm-verde-600: #389A3E;
    --stbm-tinta: #111A2B; --stbm-texto: #2A3850; --stbm-cinza: #677591; --stbm-linha: #D6DCE8; --stbm-fundo: #F4F7FB;
    --stbm-grad: linear-gradient(100deg, #0B1424 0%, #0A3D66 45%, #0068A9 100%);
    --stbm-safe-t: env(safe-area-inset-top, 0px); --stbm-safe-b: env(safe-area-inset-bottom, 0px);
    --stbm-appbar-h: 62px; --stbm-barra-h: 64px;
    --stbm-baixo: calc(var(--stbm-barra-h) + var(--stbm-safe-b));
    --stbm-ease: cubic-bezier(.2, 0, 0, 1); --stbm-ease-in: cubic-bezier(.05, .7, .1, 1);
    --stbm-e3: 0 -1px 0 var(--stbm-linha), 0 -8px 24px rgba(17, 26, 43, .06);
    --stbm-e4: 0 -12px 40px rgba(17, 26, 43, .22);
    -webkit-tap-highlight-color: transparent;
  }
  html.stbm body { padding-bottom: var(--stbm-baixo) !important; }
  html.stbm { scroll-padding-top: calc(var(--stbm-appbar-h) + var(--stbm-safe-t)); overflow-x: clip; }
  html.stbm-locked { overflow: hidden; }

  /* Um fixo em cima e um embaixo: aposenta os antigos */
  html.stbm header.header,
  html.stbm .nav-menu-mobile,
  html.stbm .top-container.d-sm-none,
  html.stbm .cky-btn-revisit-wrapper,
  html.stbm .stb-chat-launch,
  html.stbm .stb-chat-teaser { display: none !important; }

  .stbm .stbm-shell { display: block; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; }
  .stbm-shell svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

  /* ---------- Barra do app ---------- */
  .stbm-appbar {
    position: fixed; inset: 0 0 auto; z-index: 1000;
    height: calc(var(--stbm-appbar-h) + var(--stbm-safe-t)); padding: var(--stbm-safe-t) 8px 0 16px;
    display: flex; align-items: center; gap: 4px; background: var(--stbm-grad); color: #fff;
    transition: height .22s var(--stbm-ease), box-shadow .22s var(--stbm-ease);
  }
  .stbm-scrolled .stbm-appbar { height: calc(52px + var(--stbm-safe-t)); box-shadow: 0 4px 16px rgba(0, 30, 60, .22); }
  .stbm-appbar__marca { display: flex; align-items: center; min-height: 44px; }
  .stbm-appbar__logo { height: 30px; width: auto; transform-origin: left center; transition: transform .22s var(--stbm-ease); }
  .stbm-scrolled .stbm-appbar__logo { transform: scale(.88); }
  .stbm-appbar__sp { flex: 1; }
  .stbm-iconbtn {
    width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 999px;
    background: transparent; color: inherit; cursor: pointer; padding: 0;
  }
  .stbm-iconbtn:active { background: rgba(255, 255, 255, .16); }

  /* ---------- Abas ---------- */
  .stbm-tabbar {
    position: fixed; inset: auto 0 0; z-index: 1010; display: flex;
    height: var(--stbm-baixo); padding-bottom: var(--stbm-safe-b);
    background: rgba(255, 255, 255, .97); box-shadow: var(--stbm-e3);
    transition: transform .22s var(--stbm-ease);
  }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .stbm-tabbar { background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
  }
  .stbm-tab {
    flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; padding: 0; margin: 0; color: var(--stbm-cinza); font: 600 11px/14px 'Montserrat', sans-serif;
    text-decoration: none !important; cursor: pointer; position: relative;
  }
  .stbm-tab:hover, .stbm-tab:focus { color: var(--stbm-cinza); }
  .stbm-tab__ic { position: relative; width: 56px; height: 32px; display: grid; place-items: center; border-radius: 999px; }
  .stbm-tab__ic::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--stbm-azul-50);
    transform: scaleX(.6); opacity: 0; transition: transform .22s var(--stbm-ease), opacity .22s;
  }
  .stbm-tab__ic svg { position: relative; }
  .stbm-tab__txt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .stbm-tab[aria-current="page"] { color: var(--stbm-azul-700); font-weight: 700; }
  .stbm-tab[aria-current="page"] .stbm-tab__ic { color: var(--stbm-azul); }
  .stbm-tab[aria-current="page"] .stbm-tab__ic::before { transform: none; opacity: 1; }
  .stbm-tab[aria-current="page"] svg { stroke-width: 2; }
  .stbm-tab:active .stbm-tab__ic::before { opacity: .7; transform: none; }
  .stbm-ponto {
    position: absolute; top: 3px; right: 14px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--stbm-verde); box-shadow: 0 0 0 2px #fff;
  }
  @keyframes stbm-pulso { 0%, 100% { transform: scale(1); } 25%, 75% { transform: scale(1.15); } 50% { transform: scale(1); } }
  .stbm-tab--pulso .stbm-tab__ic { animation: stbm-pulso .9s var(--stbm-ease) 2; }
  .stbm-teclado .stbm-tabbar, html.stbm-teclado.stbm-produto .stbp-barra { transform: translateY(110%); }

  /* ---------- Produto: a barra de orçamento ocupa o lugar das abas ---------- */
  html.stbm-produto .stbm-tabbar { display: none; }
  html.stbm .stbp { padding-bottom: 0 !important; }
  html.stbm-produto .stbp-barra {
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; z-index: 1010 !important;
    display: flex !important; align-items: center; gap: 8px; margin: 0 !important;
    height: var(--stbm-baixo); padding: 8px 12px calc(8px + var(--stbm-safe-b)) !important;
    background: rgba(255, 255, 255, .97) !important; border-radius: 0 !important; box-shadow: var(--stbm-e3) !important; border: 0 !important;
    transition: transform .22s var(--stbm-ease);
  }
  html.stbm-produto .stbp-barra .stbp-btn {
    flex: 1; order: 2; min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--stbm-verde); color: #fff; font: 700 15px/1.1 'Montserrat', sans-serif;
    box-shadow: 0 6px 16px rgba(69, 173, 75, .32); text-align: center; padding: 0 16px; text-decoration: none;
  }
  html.stbm-produto .stbp-barra .stbp-btn:active { background: var(--stbm-verde-600); transform: scale(.97); }
  html.stbm-produto .stbp-barra .stbp-barra-pdf {
    order: 1; flex: none; width: 48px; height: 48px; display: grid; place-items: center;
    border: 1px solid var(--stbm-linha); border-radius: 999px; background: #fff; color: var(--stbm-azul);
  }

  /* ---------- Assistente: folha de baixo, acima de tudo ---------- */
  html.stbm .stb-chat { right: 0; bottom: 0; }
  html.stbm .stb-chat-panel {
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100% !important; max-width: 100% !important; height: calc(100dvh - var(--stbm-safe-t) - 24px) !important; max-height: none !important;
    border-radius: 28px 28px 0 0 !important; padding-bottom: var(--stbm-safe-b);
  }

  /* ---------- Folhas (dialog na camada do topo) ---------- */
  .stbm-sheet {
    position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; border: 0; padding: 0;
    max-height: calc(100dvh - var(--stbm-safe-t) - 48px); background: #fff; color: var(--stbm-texto);
    border-radius: 28px 28px 0 0; box-shadow: var(--stbm-e4); flex-direction: column;
    transform: translateY(100%); transition: transform .22s cubic-bezier(.3, 0, .8, .15), overlay .22s allow-discrete, display .22s allow-discrete;
  }
  .stbm-sheet[open] { display: flex; transform: none; transition-duration: .32s; transition-timing-function: var(--stbm-ease-in); }
  @starting-style { .stbm-sheet[open] { transform: translateY(100%); } }
  .stbm-sheet--full { height: calc(100dvh - var(--stbm-safe-t) - 8px); max-height: none; }
  .stbm-sheet::backdrop { background: rgba(17, 26, 43, .48); opacity: 0; transition: opacity .22s, overlay .22s allow-discrete, display .22s allow-discrete; }
  .stbm-sheet[open]::backdrop { opacity: 1; }
  @starting-style { .stbm-sheet[open]::backdrop { opacity: 0; } }
  .stbm-sheet__handle { flex: none; height: 24px; display: grid; place-items: center; touch-action: none; cursor: grab; }
  .stbm-sheet__handle::before { content: ""; width: 36px; height: 4px; border-radius: 999px; background: #C1CBD9; }
  .stbm-sheet__head {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 0 8px 8px 20px; font: 700 18px/24px 'Montserrat', sans-serif; color: var(--stbm-tinta);
  }
  .stbm-sheet__head span { font-weight: 700; }
  .stbm-lista a > span, .stbm-lista button > span { font-weight: 600; }
  .stbm-sheet__x { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--stbm-fundo); color: var(--stbm-tinta); padding: 0; }
  .stbm-sheet__x svg { width: 20px; height: 20px; }
  /* flex 1 1 auto + min-height 0: no Safari, "flex: 1" (base 0) espremia a lista em 24 px e a folha "travava" */
  .stbm-sheet__body { flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; overflow: auto; overscroll-behavior: contain; padding: 4px 16px calc(20px + var(--stbm-safe-b)); }

  /* Listas das folhas */
  .stbm-rotulo {
    display: flex; align-items: center; gap: 6px; margin: 16px 4px 6px; color: var(--stbm-cinza);
    font: 700 11px/14px 'Montserrat', sans-serif; letter-spacing: .12em; text-transform: uppercase;
  }
  .stbm-rotulo svg { width: 16px; height: 16px; }
  .stbm-lista { list-style: none; margin: 0 0 4px; padding: 0; background: #fff; border: 1px solid var(--stbm-linha); border-radius: 16px; overflow: hidden; }
  .stbm-lista li + li { border-top: 1px solid var(--stbm-linha); }
  .stbm-lista a, .stbm-lista button {
    width: 100%; min-height: 54px; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 16px;
    border: 0; background: #fff; color: var(--stbm-tinta); font: 600 15px/20px 'Montserrat', sans-serif; text-align: left; text-decoration: none; cursor: pointer;
  }
  .stbm-lista a:active, .stbm-lista button:active { background: var(--stbm-fundo); }
  .stbm-lista a > span:not(.stbm-lista__ic), .stbm-lista button > span:not(.stbm-lista__ic) { flex: 1; }
  .stbm-lista small { display: block; color: var(--stbm-cinza); font-weight: 500; font-size: 13px; }
  .stbm-lista svg:last-child { width: 18px; height: 18px; color: #A3AEC2; }
  .stbm-lista__ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--stbm-azul-50); color: var(--stbm-azul); }
  .stbm-lista__ic svg { width: 20px; height: 20px; }
  .stbm-linguas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stbm-linguas a {
    min-height: 44px; display: grid; place-items: center; border: 1px solid var(--stbm-linha); border-radius: 999px;
    color: var(--stbm-texto); font: 600 14px/1 'Montserrat', sans-serif; text-decoration: none; background: #fff;
  }
  .stbm-linguas a[aria-current] { background: var(--stbm-azul-50); border-color: var(--stbm-azul); color: var(--stbm-azul-700); }
  .stbm-btn {
    margin-top: 12px; width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; font: 700 15px/1 'Montserrat', sans-serif; text-decoration: none;
  }
  .stbm-btn--sec { border: 1.5px solid var(--stbm-azul); color: var(--stbm-azul); background: #fff; }

  /* Busca */
  .stbm-busca {
    display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px; border: 1.5px solid var(--stbm-linha);
    border-radius: 999px; background: var(--stbm-fundo); color: var(--stbm-cinza);
  }
  .stbm-busca:focus-within { border-color: var(--stbm-azul); background: #fff; }
  .stbm-busca input { flex: 1; min-width: 0; border: 0; background: transparent; font: 500 16px/1 'Montserrat', sans-serif; color: var(--stbm-tinta); outline: none; -webkit-appearance: none; appearance: none; }

  /* Foco e toque */
  .stbm-shell :focus-visible, .stbp-barra :focus-visible { outline: 3px solid var(--stbm-verde); outline-offset: 2px; }
  .stbm-linguas a:active, .stbm-btn:active { transform: scale(.97); }
}

@media (max-width: 991.98px) and (prefers-reduced-motion: reduce) {
  .stbm-appbar, .stbm-appbar__logo, .stbm-tabbar, .stbm-tab__ic::before, html.stbm-produto .stbp-barra { transition: none; }
  .stbm-sheet, .stbm-sheet[open] { transform: none; transition: opacity .12s linear; }
  @starting-style { .stbm-sheet[open] { transform: none; opacity: 0; } }
  .stbm-tab--pulso .stbm-tab__ic { animation: none; }
  .stbm-linguas a:active, .stbm-btn:active, html.stbm-produto .stbp-barra .stbp-btn:active { transform: none; }
}
