/*
 * MSNBOT Luz 4.8.9 - refinamento responsivo exclusivo para smartphone.
 * CSS sem dependencias, escopo <=600px. Nao altera tablet/desktop/login.
 * Evitar opacidade do body zerada no WebKit (diagnostico iPhone 390x651).
 */
@media screen and (max-width:600px) {
  html body:not(:has(main.auth-page)) {
    opacity:1!important;
    visibility:visible!important;
    -webkit-filter:none!important;
    filter:none!important;
    min-width:0!important;
  }
  html body:not(:has(main.auth-page)) > .mac-topbar,
  html body:not(:has(main.auth-page)) > main.page:not(.auth-page),
  html body:not(:has(main.auth-page)) > #msnbot-mobile-dock.mobile-dock {
    opacity:1!important;
    visibility:visible!important;
  }

  /* Base do aplicativo: respiro lateral, superficies claras, tipografia menor. */
  html body:not(:has(main.auth-page)) {font-size:13px!important;}
  html body:not(:has(main.auth-page)) > main.page:not(.auth-page) {
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:10px!important;
    padding-right:10px!important;
  }
  html body:not(:has(main.auth-page)) > main.page:not(.auth-page) > * {
    min-width:0;
    max-width:100%;
  }
  html body:not(:has(main.auth-page)) main.page :is(h1,h2,h3) {
    line-height:1.22;
    overflow-wrap:break-word;
  }
  html body:not(:has(main.auth-page)) main.page h1 {font-size:21px!important;letter-spacing:-.035em;}
  html body:not(:has(main.auth-page)) main.page h2 {font-size:16px!important;letter-spacing:-.025em;}
  html body:not(:has(main.auth-page)) main.page h3 {font-size:14px!important;}
  html body:not(:has(main.auth-page)) main.page :is(.muted,.field-help,small) {
    line-height:1.4;
  }
  html body:not(:has(main.auth-page)) main.page :is(input,select,textarea) {
    box-sizing:border-box;max-width:100%;font-size:13px;min-height:39px;
    border-radius:10px;padding:9px 10px;
  }
  html body:not(:has(main.auth-page)) main.page :is(.primary,.button,.small-btn) {
    border-radius:11px;
    font-size:12px;
    line-height:1.25;
    padding:10px 12px;
  }

  /* Barra superior discreta, sem perder os botoes. */
  html body:not(:has(main.auth-page)) > .mac-topbar {
    height:44px!important;min-height:44px!important;max-height:44px!important;
    padding-left:8px!important;padding-right:8px!important;
  }
  html body:not(:has(main.auth-page)) .mac-top-right {gap:2px!important;}
  html body:not(:has(main.auth-page)) .top-icon,
  html body:not(:has(main.auth-page)) .top-avatar {
    min-width:32px!important;min-height:32px!important;
    width:32px!important;height:32px!important;
  }

  /* Dock compacto de 7 apps; preservar clicabilidade e safe area. */
  html body:not(:has(main.auth-page)) > #msnbot-mobile-dock.mobile-dock {
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    width:calc(100vw - 12px)!important;max-width:510px!important;
    gap:3px!important;
    padding:6px 6px max(6px,env(safe-area-inset-bottom,0px))!important;
    border-radius:19px!important;
    bottom:max(7px,env(safe-area-inset-bottom,0px))!important;
  }
  #msnbot-mobile-dock .dock-item {min-width:0!important;gap:2px!important;}
  #msnbot-mobile-dock .dock-icon {
    width:clamp(30px,8.4vw,35px)!important;
    height:clamp(30px,8.4vw,35px)!important;
    border-radius:11px!important;
    font-size:clamp(16px,4.6vw,20px)!important;
  }
  #msnbot-mobile-dock .dock-item small {font-size:8px!important;line-height:1.05!important;}

  /* Painel: metricas em mosaico, leitura condensada, graficos fluidos. */
  html body:not(:has(main.auth-page)) .d43-dashboard.d44-dashboard {
    display:grid!important;gap:10px!important;
    font-size:12px!important;min-width:0!important;
  }
  .d43-dashboard .d42-period {
    padding:12px!important;border-radius:15px!important;
    gap:9px!important;
  }
  .d43-dashboard .d42-period-form,
  .d43-dashboard .d42-period nav {min-width:0;max-width:100%;}
  .d43-dashboard .d42-overview.d44-overview {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    gap:9px!important;min-width:0!important;
  }
  .d43-dashboard .d42-overview.d44-overview article {
    box-sizing:border-box!important;min-height:0!important;
    width:100%!important;margin:0!important;
    padding:12px!important;border-radius:16px!important;
  }
  .d43-dashboard .d441-audience-trend {min-height:165px!important;overflow:hidden!important;}
  .d43-dashboard .d441-audience-trend header {
    gap:8px!important;align-items:flex-start!important;
  }
  .d43-dashboard .d441-area-chart {min-height:0!important;max-height:170px!important;}
  .d43-dashboard .d441-area-chart svg {max-height:155px!important;width:100%!important;}
  .d43-dashboard .d471-dashboard-kpis {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:100%!important;gap:7px!important;margin:0!important;
    justify-content:stretch!important;
  }
  .d43-dashboard .d471-kpi {
    aspect-ratio:auto!important;
    width:auto!important;min-width:0!important;min-height:74px!important;
    padding:9px 5px!important;gap:4px!important;
    border-radius:14px!important;box-shadow:0 4px 16px rgba(27,42,76,.06)!important;
  }
  .d43-dashboard .d471-kpi span {
    max-width:100%!important;overflow-wrap:anywhere!important;
    text-align:center!important;font-size:10px!important;line-height:1.15!important;
  }
  .d43-dashboard .d471-kpi strong {
    font-size:20px!important;line-height:1.1!important;letter-spacing:-.03em!important;
  }
  .d43-dashboard .d44-comparison,
  .d43-dashboard .d44-sales {
    border-radius:16px!important;padding:12px!important;min-width:0!important;
  }
  .d43-dashboard .d44-comparison>header {gap:8px!important;flex-wrap:wrap!important;}
  .d43-dashboard .d44-comparison-stage {
    display:grid!important;
    grid-template-columns:minmax(0,58px) minmax(0,1fr) minmax(0,58px)!important;
    min-width:0!important;gap:4px!important;min-height:132px!important;
  }
  .d43-dashboard .d44-edge-number {min-width:0!important;padding-bottom:12px!important;}
  .d43-dashboard .d44-edge-number strong {font-size:20px!important;overflow-wrap:anywhere!important;}
  .d43-dashboard .d44-edge-number small,
  .d43-dashboard .d44-edge-number span {font-size:8px!important;line-height:1.2!important;}
  .d43-dashboard .d44-line-chart {min-width:0!important;}
  .d43-dashboard .d44-line-chart svg {width:100%!important;height:114px!important;}
  .d43-dashboard .d44-sales>header {
    display:flex!important;gap:8px!important;flex-wrap:wrap!important;
  }
  .d43-dashboard .d44-sales-actions {width:100%!important;display:flex!important;justify-content:space-between!important;}
  .d43-dashboard .d44-sales-actions :is(a,button) {font-size:10px!important;padding:8px!important;}
  .d43-dashboard .d44-sales-summary {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .d43-dashboard .d44-sales-summary>div,
  .d43-dashboard .d44-sales-summary .received {
    grid-column:auto!important;min-width:0!important;min-height:67px!important;
    padding:8px!important;border-radius:12px!important;
  }
  .d43-dashboard .d44-sales-summary strong,
  .d43-dashboard .d44-sales-summary .received strong {
    font-size:clamp(13px,4vw,17px)!important;
    overflow-wrap:anywhere!important;
  }
  .d43-dashboard .d44-date-tile strong {font-size:19px!important;}
  .d43-dashboard .d44-sales-main {padding:10px!important;border-radius:12px!important;}
  .d43-dashboard .d44-stack-chart {height:140px!important;}
  .d43-dashboard .d44-sales-insights {grid-template-columns:minmax(0,1fr)!important;gap:8px!important;}
  .d43-dashboard .d44-sales-insights>article {
    min-height:0!important;padding:11px!important;border-radius:12px!important;
  }
  .d43-dashboard .d44-sales-insights svg {height:95px!important;}
  .d43-dashboard .d44-movement {height:100px!important;}

  /* Agenda: calendario denso e barra de acoes em tres linhas controladas. */
  html body:not(:has(main.auth-page)) .schedule-toolbar {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;
    width:100%!important;padding:10px!important;margin-bottom:9px!important;
    border-radius:16px!important;min-width:0!important;
  }
  .schedule-toolbar .schedule-view-tabs {
    grid-column:1!important;display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    width:100%!important;gap:3px!important;overflow:visible!important;
  }
  .schedule-toolbar .schedule-view-tabs a {
    min-width:0!important;padding:8px 2px!important;
    border-radius:10px!important;text-align:center!important;
    font-size:12px!important;
  }
  .schedule-toolbar .schedule-nav {
    grid-column:1!important;margin:0!important;
    display:flex!important;gap:5px!important;align-items:center!important;
    overflow:hidden!important;
  }
  .schedule-toolbar .schedule-nav a {
    display:grid!important;place-items:center!important;
    min-width:34px!important;min-height:36px!important;
    padding:7px 9px!important;font-size:13px!important;border-radius:10px!important;
  }
  .schedule-toolbar .schedule-actions {
    grid-column:1!important;width:100%!important;
    display:grid!important;grid-template-columns:1fr 1.45fr!important;
    gap:6px!important;min-width:0!important;
  }
  .schedule-toolbar .schedule-actions button {
    width:100%!important;min-width:0!important;min-height:38px!important;
    padding:8px 5px!important;font-size:11px!important;
    border-radius:10px!important;line-height:1.15!important;
    white-space:normal!important;
  }
  html body:not(:has(main.auth-page)) .schedule-calendar-card {
    min-height:0!important;width:100%!important;
    border-radius:16px!important;overflow:hidden!important;
  }
  .schedule-calendar-card .month-weekdays span {
    padding:8px 0!important;font-size:10px!important;white-space:nowrap!important;
  }
  .schedule-calendar-card .month-grid {
    width:100%!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;
  }
  .schedule-calendar-card .month-day {
    min-width:0!important;min-height:55px!important;padding:3px!important;
  }
  .schedule-calendar-card .month-day header {margin:0 0 2px!important;gap:0!important;}
  .schedule-calendar-card .month-day header span {
    display:grid!important;place-items:center!important;
    width:23px!important;height:23px!important;
    font-size:12px!important;font-weight:750!important;border-radius:7px!important;
  }
  .schedule-calendar-card .month-day header b {font-size:7px!important;letter-spacing:0!important;}
  .schedule-calendar-card .month-events {gap:2px!important;overflow:hidden!important;}
  .schedule-calendar-card .schedule-event {
    box-sizing:border-box!important;min-width:0!important;
    height:5px!important;min-height:5px!important;
    padding:0!important;border-radius:8px!important;
    font-size:0!important;line-height:0!important;
    border-left:0!important;overflow:hidden!important;
  }
  .schedule-calendar-card .schedule-event :is(span,time,em) {display:none!important;}
  .schedule-stats {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;}
  .schedule-stats article {min-width:0!important;padding:11px!important;border-radius:12px!important;}
  .schedule-stats strong {font-size:18px!important;}
  .schedule-stats span {font-size:10px!important;}
  .schedule-side {grid-template-columns:minmax(0,1fr)!important;gap:8px!important;}
  .schedule-side > section {padding:12px!important;border-radius:14px!important;}

  /* Outros modulos: titulos e cartoes proporcionais. */
  .utilities-hero,.campaign-hero,.broadcast-hero,.schedule-hero,.audience-hero {
    padding:14px!important;gap:10px!important;border-radius:16px!important;
  }
  .utilities-stats,.campaign-stats,.broadcast-stats,.audience-stats {
    gap:7px!important;
  }
  .utilities-stats article,.campaign-stats article,.broadcast-stats article {
    min-width:0!important;padding:11px!important;border-radius:12px!important;
  }
  .settings-content,.settings-personal-card,.settings-card {
    min-width:0!important;padding:12px!important;border-radius:14px!important;
  }
  .settings-nav {gap:5px!important;}
  .settings-nav a {min-width:125px!important;padding:9px 10px!important;font-size:11px!important;}
  .launchpad-grid {padding-inline:5px!important;gap:8px!important;}
  .launchpad-app {min-width:0!important;}
  .msn-v33-topbar,.msn-v33-chat-head {gap:6px!important;}
  .msn-v33-inbox-tabs>a {min-width:0!important;padding:8px 7px!important;font-size:11px!important;}

  /* Respeitar todos os efeitos de areas de toque e areas seguras. */
  html body:not(:has(main.auth-page)) main.page :is(button,a,input,select,textarea) {touch-action:manipulation;}
}

@media screen and (max-width:355px) {
  .d43-dashboard .d471-dashboard-kpis {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .schedule-toolbar .schedule-actions {
    grid-template-columns:1fr 1.2fr!important;
  }
  .d43-dashboard .d44-comparison-stage {
    grid-template-columns:48px minmax(0,1fr) 48px!important;
  }
}


/* MSNBOT 4.8.9 - correcoes cirurgicas dos tres modulos no smartphone.
   A correção global de opacidade do iOS permanece inalterada. */
@media screen and (max-width:600px){
  /* Fluxos: somente o carrossel de pastas deve rolar na horizontal. */
  html body:has(.flows-hero) > main.page:not(.auth-page) {
    box-sizing:border-box!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    padding-inline:10px!important;overflow-x:clip!important;
  }
  main.page:has(.flows-hero) :is(.flows-hero,.flows-toolbar,.flows-search,.flows-actions,.flow-folder-strip,.flow-list-card,.flow-table) {
    box-sizing:border-box!important;min-width:0!important;
    max-width:100%!important;
  }
  main.page:has(.flows-hero) .flows-hero {
    padding:12px!important;border-radius:16px!important;gap:10px!important;
  }
  main.page:has(.flows-hero) .flows-hero h1 {font-size:19px!important;margin:0!important;}
  main.page:has(.flows-hero) .flow-stats {
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;min-width:0!important;
  }
  main.page:has(.flows-hero) .flow-stats>div {
    min-width:0!important;min-height:56px!important;
    padding:7px 4px!important;border-radius:12px!important;
  }
  main.page:has(.flows-hero) .flow-stats strong {font-size:17px!important;line-height:1.1!important;}
  main.page:has(.flows-hero) .flow-stats small {font-size:10px!important;line-height:1.15!important;}
  main.page:has(.flows-hero) .flows-toolbar {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;overflow:visible!important;
    padding:10px!important;margin:10px 0!important;
    border-radius:15px!important;
  }
  main.page:has(.flows-hero) .flows-toolbar .flows-search {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;gap:7px!important;flex:auto!important;
  }
  main.page:has(.flows-hero) .flows-search label {
    min-width:0!important;width:100%!important;margin:0!important;
    font-size:11px!important;display:block!important;
  }
  main.page:has(.flows-hero) .flows-search :is(input,select) {
    box-sizing:border-box!important;width:100%!important;min-width:0!important;
    max-width:100%!important;min-height:36px!important;height:38px!important;
    padding:7px 10px!important;font-size:12px!important;
    border-radius:10px!important;
  }
  main.page:has(.flows-hero) .flows-actions {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;width:100%!important;min-width:0!important;
  }
  main.page:has(.flows-hero) .flows-actions details {min-width:0!important;max-width:100%!important;}
  main.page:has(.flows-hero) .flows-actions summary {
    box-sizing:border-box!important;width:100%!important;min-height:37px!important;
    padding:8px 5px!important;font-size:11px!important;border-radius:10px!important;
    white-space:normal!important;
  }
  main.page:has(.flows-hero) .flows-actions .popup-form {
    box-sizing:border-box!important;width:min(300px,calc(100vw - 32px))!important;
    max-width:calc(100vw - 32px)!important;
  }
  main.page:has(.flows-hero) .flow-folder-strip {
    display:flex!important;width:100%!important;min-width:0!important;
    max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;
    overscroll-behavior-x:contain;gap:6px!important;
    padding:5px 1px 8px!important;margin:8px 0!important;
    -webkit-overflow-scrolling:touch;
  }
  main.page:has(.flows-hero) .flow-folder-tile {
    box-sizing:border-box!important;flex:0 0 88px!important;
    width:88px!important;min-height:79px!important;max-width:88px!important;
    padding:7px 3px!important;border-radius:13px!important;
  }
  main.page:has(.flows-hero) .flow-folder-tile .folder-icon {font-size:17px!important;}
  main.page:has(.flows-hero) .flow-folder-tile strong {font-size:11px!important;}
  main.page:has(.flows-hero) .flow-folder-tile small {font-size:9px!important;}
  main.page:has(.flows-hero) .flow-list-card {
    width:100%!important;padding:0!important;overflow:hidden!important;
    margin-top:9px!important;border-radius:15px!important;
  }
  main.page:has(.flows-hero) .flow-list-head {padding:10px 12px!important;}
  main.page:has(.flows-hero) .flow-list-head strong {font-size:14px!important;}
  main.page:has(.flows-hero) .flow-table {gap:6px!important;padding:7px!important;}
  main.page:has(.flows-hero) .flow-row {
    box-sizing:border-box!important;width:100%!important;min-width:0!important;
    grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;
    padding:9px!important;border-radius:12px!important;
  }
  main.page:has(.flows-hero) .flow-main {grid-column:1/-1!important;min-width:0!important;gap:8px!important;}
  main.page:has(.flows-hero) .flow-symbol {width:32px!important;height:32px!important;border-radius:10px!important;font-size:15px!important;}
  main.page:has(.flows-hero) .flow-main strong {font-size:13px!important;}
  main.page:has(.flows-hero) .flow-main small {font-size:10px!important;}
  main.page:has(.flows-hero) .flow-row :is(.small-btn,.flow-state-badge) {
    font-size:10px!important;min-height:30px!important;padding:6px 7px!important;
  }

  /* Bate-Papo: painel de contato lateral, no maximo metade da largura. */
  html body:has(.msn-v33-shell) .msn-v33-contact-card {
    box-sizing:border-box!important;
    position:fixed!important;
    top:44px!important;right:0!important;left:auto!important;
    bottom:calc(67px + env(safe-area-inset-bottom,0px))!important;
    inset:44px 0 calc(67px + env(safe-area-inset-bottom,0px)) auto!important;
    width:52vw!important;min-width:0!important;max-width:52vw!important;
    height:auto!important;max-height:none!important;
    padding:7px 8px 16px!important;border-radius:16px 0 0 16px!important;
    z-index:2147482500!important;
    overflow-x:hidden!important;overflow-y:auto!important;
    overscroll-behavior:contain;
    transition:transform .23s cubic-bezier(.2,.8,.2,1)!important;
    box-shadow:-10px 2px 34px rgba(20,34,65,.25)!important;
    -webkit-overflow-scrolling:touch;
  }
  html body:has(.msn-v33-shell) .msn-v33-shell.v479-contact-card-open .msn-v33-contact-card {
    display:block!important;transform:translateX(0)!important;
  }
  html body:has(.msn-v33-shell) .msn-v33-shell:not(.v479-contact-card-open) .msn-v33-contact-card {
    display:block!important;transform:translateX(calc(100% + 12px))!important;
    pointer-events:none!important;
  }
  .msn-v33-contact-card .msn-mobile-contact-close {
    position:sticky!important;display:grid!important;place-items:center!important;
    top:0!important;z-index:20!important;margin:0 0 0 auto!important;
    width:32px!important;height:32px!important;min-height:32px!important;
    padding:0!important;border-radius:50%!important;
    background:var(--surface-solid,#fff)!important;
    color:var(--text,#203047)!important;
    box-shadow:0 2px 8px rgba(0,0,0,.13)!important;
    font-size:21px!important;cursor:pointer!important;
  }
  /* A abertura do painel fica exclusivamente no nome do cabecalho. */
  .msn-v33-chat-head .msn-mobile-contact-toggle {display:none!important;}
  .msn-v33-chat-head .grow h2 {
    display:inline-block!important;max-width:100%!important;
    cursor:pointer!important;text-decoration:underline;
    text-decoration-color:color-mix(in srgb,var(--accent,#2878f5) 35%,transparent);
    text-underline-offset:3px;
  }
  .msn-v33-chat-head .grow h2:focus-visible {
    outline:2px solid var(--accent,#2878f5);
    outline-offset:3px;border-radius:4px;
  }
  .msn-v33-contact-card :is(.contact-card-top h2,.contact-core,.ticket-state,.automation-card,.assignment-card) {
    font-size:11px!important;overflow-wrap:anywhere!important;
  }
  .msn-v33-contact-card .contact-card-top {padding:2px 0 8px!important;}
  .msn-v33-contact-card .contact-card-top .contact-avatar.profile {
    width:43px!important;height:43px!important;font-size:17px!important;
    margin-bottom:5px!important;
  }
  .msn-v33-contact-card .contact-card-top h2 {font-size:13px!important;}
  .msn-v33-contact-card .ticket-state {
    display:flex!important;flex-wrap:wrap!important;gap:5px!important;padding:6px 0!important;
  }
  .msn-v33-contact-card .contact-core>div {
    display:block!important;padding:7px 0!important;overflow-wrap:anywhere!important;
  }
  .msn-v33-contact-card .contact-core :is(dt,dd) {
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin:0!important;text-align:left!important;overflow-wrap:anywhere!important;
    font-size:10px!important;
  }
  .msn-v33-contact-card :is(.ticket-state button,.automation-card button,.assignment-card button) {
    box-sizing:border-box!important;max-width:100%!important;
    white-space:normal!important;min-height:30px!important;
    padding:6px!important;font-size:10px!important;
  }
  .msn-v33-contact-card select {max-width:100%!important;font-size:11px!important;}
  .msn-v33-contact-card .contact-card-section {padding:7px 0!important;}

  /* Cobranças: cabeçalho enxuto, botao sem flex-basis de 140px na vertical. */
  main.page:has(.billing-hero) .billing-hero {
    box-sizing:border-box!important;width:100%!important;
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;gap:9px!important;
    padding:13px!important;border-radius:16px!important;
  }
  main.page:has(.billing-hero) .billing-hero .eyebrow {font-size:9px!important;margin:0 0 2px!important;}
  main.page:has(.billing-hero) .billing-hero h1 {font-size:20px!important;margin:0!important;}
  main.page:has(.billing-hero) .billing-hero-actions {
    display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;
    align-items:center!important;justify-content:flex-end!important;
    gap:0!important;width:auto!important;min-width:0!important;
    flex:0 0 auto!important;
  }
  main.page:has(.billing-hero) .billing-hero-actions>.primary {
    box-sizing:border-box!important;display:inline-flex!important;
    align-items:center!important;justify-content:center!important;
    flex:0 0 auto!important;align-self:center!important;
    width:auto!important;min-width:0!important;max-width:100%!important;
    height:38px!important;min-height:38px!important;max-height:38px!important;
    padding:8px 10px!important;border-radius:11px!important;
    font-size:11px!important;line-height:1.1!important;
    white-space:nowrap!important;
  }
  main.page:has(.billing-hero) .billing-stats {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;gap:7px!important;margin:9px 0!important;
  }
  main.page:has(.billing-hero) .billing-stats article {
    min-height:70px!important;min-width:0!important;
    padding:10px!important;border-radius:13px!important;
  }
  main.page:has(.billing-hero) .billing-stats :is(strong,article strong) {
    font-size:clamp(15px,4vw,19px)!important;
    line-height:1.12!important;overflow-wrap:anywhere!important;
  }
  main.page:has(.billing-hero) .billing-stats :is(span,small) {
    font-size:10px!important;line-height:1.2!important;
  }
  main.page:has(.billing-hero) .billing-period-bar {
    box-sizing:border-box!important;width:100%!important;min-width:0!important;
    padding:6px!important;margin:7px 0!important;gap:5px!important;
    border-radius:12px!important;overflow-x:auto!important;
  }
  main.page:has(.billing-hero) .billing-period-bar :is(a,strong) {
    flex:0 0 auto!important;padding:7px!important;font-size:10px!important;
  }
  main.page:has(.billing-hero) .billing-filterbar {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;gap:6px!important;margin:7px 0!important;
  }
  main.page:has(.billing-hero) .billing-filterbar :is(input,select,button) {
    min-width:0!important;max-width:100%!important;
    min-height:36px!important;padding:7px 9px!important;font-size:12px!important;
  }
  main.page:has(.billing-hero) :is(.billing-list,.billing-detail,.billing-table-card) {
    box-sizing:border-box!important;min-width:0!important;max-width:100%!important;
    border-radius:14px!important;
  }
  main.page:has(.billing-hero) .billing-table-wrap {
    width:100%!important;max-width:100%!important;overflow-x:auto!important;
    overscroll-behavior-x:contain;
  }
  main.page:has(.billing-hero) .billing-list :is(th,td) {
    padding:8px 6px!important;font-size:10px!important;
  }
  main.page:has(.billing-hero) .billing-detail {padding:11px!important;}
  main.page:has(.billing-hero) .billing-nando-fab {transform:scale(.78)!important;transform-origin:right bottom!important;}
}


/* Mobile 4.8.9 - contact field spacing refinement */
@media screen and (max-width:600px) {
  html body:has(.msn-v33-shell) .msn-v33-contact-card dl.contact-core {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-auto-rows:max-content!important;
    gap:3px!important;
    align-content:start!important;
    justify-content:stretch!important;
    height:auto!important;
    min-height:0!important;
    margin:6px 0 9px!important;
    padding:0!important;
  }
  html body:has(.msn-v33-shell) .msn-v33-contact-card dl.contact-core>div {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-auto-rows:max-content!important;
    align-items:start!important;
    gap:2px!important;
    min-height:0!important;
    height:auto!important;
    margin:0!important;
    padding:3px 0!important;
    line-height:1.18!important;
  }
  html body:has(.msn-v33-shell) .msn-v33-contact-card dl.contact-core>div :is(dt,dd) {
    display:block!important;
    min-height:0!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
    font-size:10px!important;
    line-height:1.2!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  html body:has(.msn-v33-shell) .msn-v33-contact-card .ticket-state {
    padding-bottom:7px!important;
    margin-bottom:0!important;
  }
}

/* Exclusivo iPhone: recorta visualmente o Dock sem alterar seu layout ou altura.
   Nao usar display:none, visibility:hidden nem opacity:0: o script antigo
   mede a geometria do Dock para preservar a barra de escrita visivel. */
@media screen and (max-width:600px) {
  html body:has(.msn-v33-shell.has-contact) > #msnbot-mobile-dock.mobile-dock {
    -webkit-clip-path:inset(100% 0 0 0)!important;
    clip-path:inset(100% 0 0 0)!important;
    pointer-events:none!important;
  }
}


/* MSNBOT 4.8.9 | full viewport chat layout - mobile only
   A conversa nao subtrai altura de Dock oculto. Mantem o compositor DENTRO
   da grade original de tres linhas, sem alterar elementos ou interacoes.
   O restante do site (e a lista de conversas) usa o layout anterior. */
@media screen and (max-width:600px) {
  html body:has(.msn-v33-shell.has-contact) {
    overflow:hidden!important;
  }
  /* A barra superior tem 44px no mobile; o chat usa toda a area abaixo dela. */
  html body:has(.msn-v33-shell.has-contact) > main.page:not(.auth-page) {
    position:fixed!important;
    top:44px!important;
    bottom:0!important;
    left:0!important;
    right:0!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    height:calc(100dvh - 44px)!important;
    max-height:calc(100dvh - 44px)!important;
    margin:0!important;
    padding:0 8px!important;
    overflow:hidden!important;
  }
  /* Supera a altura antiga calculada ate o teto do Dock (sem tocar no JS). */
  html body:has(.msn-v33-shell.has-contact) > main.page:not(.auth-page) .msn-v33-shell.has-contact {
    box-sizing:border-box!important;
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
    min-height:0!important;
    margin:0!important;
    overflow:hidden!important;
  }
  html body:has(.msn-v33-shell.has-contact) > main.page:not(.auth-page) .msn-v33-chat {
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
    position:relative!important;
  }
  html body:has(.msn-v33-shell.has-contact) > main.page:not(.auth-page) .msn-v33-chat > .msn-v33-composer {
    position:relative!important;
    inset:auto!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
    flex:0 0 auto!important;
    z-index:12!important;
    padding:5px 6px max(6px,env(safe-area-inset-bottom,0px))!important;
  }
  html body:has(.msn-v33-shell.has-contact) > main.page:not(.auth-page) .msn-v33-chat > .msn-v33-messages {
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding-bottom:10px!important;
    scroll-padding-bottom:10px!important;
  }
  /* Header menor, seta de voltar visivel e sem sobreposicao com a foto. */
  html body:has(.msn-v33-shell.has-contact) .msn-v33-chat-head {
    min-height:54px!important;
    padding:6px 8px 6px 43px!important;
    gap:6px!important;
  }
  html body:has(.msn-v33-shell.has-contact) .msn-v33-chat-head .contact-avatar.large {
    width:35px!important;
    height:35px!important;
    min-width:35px!important;
  }
  html body:has(.msn-v33-shell.has-contact) .msn-v33-chat-head h2 {
    font-size:14px!important;
    line-height:1.17!important;
  }
  html body:has(.msn-v33-shell.has-contact) .msn-v33-chat-head p {
    font-size:10px!important;
  }
  html body:has(.msn-v33-shell.has-contact) .msn-v33-chat > a.msn-v479-back[data-chat-back] {
    position:absolute!important;
    top:11px!important;
    left:5px!important;
    display:grid!important;
    place-items:center!important;
    width:32px!important;
    height:32px!important;
    min-width:32px!important;
    border:1px solid rgba(64,78,103,.25)!important;
    border-radius:50%!important;
    background:#fff!important;
    color:#17233a!important;
    font-size:0!important;
    opacity:1!important;
    visibility:visible!important;
    text-decoration:none!important;
    z-index:120!important;
    pointer-events:auto!important;
  }
  html body:has(.msn-v33-shell.has-contact) .msn-v33-chat > a.msn-v479-back[data-chat-back]::before {
    content:"←";
    font-family:system-ui,-apple-system,Arial,sans-serif;
    font-size:23px!important;
    font-weight:700!important;
    line-height:1!important;
    color:#17233a!important;
  }
  /* Controles um pouco menores, sem modificar botoes ou estrutura do HTML. */
  html body:has(.msn-v33-shell.has-contact) .composer-tool {
    width:28px!important;
    height:28px!important;
    min-width:28px!important;
    min-height:28px!important;
    font-size:16px!important;
  }
  html body:has(.msn-v33-shell.has-contact) .composer-popovers {
    gap:3px!important;
  }
  html body:has(.msn-v33-shell.has-contact) #composer-form #msn-message-input {
    box-sizing:border-box!important;
    min-height:36px!important;
    max-height:108px!important;
    padding:7px 10px!important;
    font-size:16px!important;
  }
  html body:has(.msn-v33-shell.has-contact) #composer-form .send-button {
    width:32px!important;
    height:32px!important;
    min-height:32px!important;
    font-size:15px!important;
  }
  html body:has(.msn-v33-shell.has-contact) #composer-form .msn-audio-button {
    flex:0 0 35px!important;
    width:35px!important;
    height:35px!important;
    min-width:35px!important;
    min-height:35px!important;
    font-size:17px!important;
  }
}
