/* Mercado Rio Paraná 1.5.0 Mobile
   Camada exclusiva do endereço mobile. As regras de negócio continuam no app oficial. */

:root {
  --mobile-green: #08784c;
  --mobile-green-dark: #075f3d;
  --mobile-green-soft: #e7f6ef;
  --mobile-canvas: #f3f7f4;
  --mobile-line: #d7e3dc;
  --mobile-shadow: 0 8px 26px rgba(16, 62, 42, .10);
  --mobile-nav-height: 70px;
  --mobile-vh: 100dvh;
}

html.mobile-interface,
body.mobile-interface {
  width: 100%;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--mobile-canvas);
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

.mobile-interface * {
  -webkit-tap-highlight-color: transparent;
}

.mobile-interface button,
.mobile-interface input,
.mobile-interface select,
.mobile-interface textarea,
.mobile-interface [tabindex="0"] {
  touch-action: manipulation;
}

.mobile-interface .app-shell {
  display: block;
  width: 100%;
  min-height: var(--mobile-vh);
}

/* Cabeçalho e navegação */
.mobile-interface .topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: 58px;
  padding: 7px 10px 7px max(10px, env(safe-area-inset-left));
  color: #17352a;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--mobile-line);
  box-shadow: 0 3px 16px rgba(19, 68, 48, .08);
  backdrop-filter: blur(16px);
}

.mobile-interface .brand { gap: 9px; }
.mobile-interface .brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #fff;
  background: var(--mobile-green);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 5px 13px rgba(8, 120, 76, .18);
}
.mobile-interface .brand-mark svg { width: 22px; height: 22px; }
.mobile-interface .brand-name {
  max-width: 52vw;
  color: #17352a;
  font-size: 15px;
  line-height: 1.1;
}
.mobile-interface .brand-subtitle { display: none; }
.mobile-interface .topbar-actions { gap: 8px; }
.mobile-interface .operator { display: block; max-width: 31vw; }
.mobile-interface .operator strong {
  color: #20352c;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-interface .operator span { display: none; }
.mobile-interface .status-dot { width: 9px; height: 9px; flex: 0 0 9px; }
.mobile-interface .topbar-logout {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  color: #455a50;
  background: #f1f6f3;
  border: 1px solid var(--mobile-line);
  border-radius: 11px;
}
.mobile-interface .topbar-logout svg { width: 20px; height: 20px; }

.mobile-interface .environment-banner {
  position: sticky;
  top: 0;
  z-index: 75;
  font-size: 10px;
}
.mobile-interface .offline-banner {
  top: 58px;
  z-index: 65;
  padding: 7px 10px;
  font-size: 11px;
}
.mobile-interface .workspace { display: block !important; width: 100%; max-width: none; }
.mobile-interface .sidebar { display: none !important; }
.mobile-interface .bottom-nav {
  display: block !important;
  z-index: 80;
  padding: 5px max(4px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  border-top: 1px solid var(--mobile-line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -4px 18px rgba(19, 68, 48, .10);
  backdrop-filter: blur(18px);
}
.mobile-interface .bottom-nav-inner { max-width: none; }
.mobile-interface .bottom-item {
  min-width: 0;
  min-height: 54px;
  flex: 1 1 20%;
  padding: 4px 2px;
  color: #64756d;
  border-radius: 10px;
  font-size: 9px;
  line-height: 1.05;
}
.mobile-interface .bottom-item span:first-child { display: grid; place-items: center; font-size: 18px; }
.mobile-interface .bottom-item svg { width: 20px; height: 20px; }
.mobile-interface .bottom-item.active { color: var(--mobile-green-dark); background: var(--mobile-green-soft); }

/* Conteúdo geral */
.mobile-interface .main {
  width: 100%;
  min-width: 0;
  min-height: calc(var(--mobile-vh) - 58px);
  padding: 13px 10px calc(var(--mobile-nav-height) + 20px + env(safe-area-inset-bottom));
  background: var(--mobile-canvas);
}
.mobile-interface .page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.mobile-interface .page-title { font-size: 23px; line-height: 1.12; }
.mobile-interface .page-subtitle { margin-top: 4px; font-size: 12px; line-height: 1.35; }
.mobile-interface .page-actions {
  display: flex;
  width: 100%;
  gap: 7px;
  justify-content: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}
.mobile-interface .page-actions::-webkit-scrollbar { display: none; }
.mobile-interface .page-actions > * { flex: 1 0 auto; }
.mobile-interface .page-actions .btn { min-height: 44px; }

.mobile-interface .grid,
.mobile-interface .grid-2,
.mobile-interface .grid-3,
.mobile-interface .grid-4,
.mobile-interface .auto-grid,
.mobile-interface .dashboard-compact-grid,
.mobile-interface .rental-admin-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 9px;
}
.mobile-interface .stats-mobile-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.mobile-interface .card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--mobile-line);
  border-radius: 13px;
  box-shadow: 0 5px 18px rgba(20, 65, 47, .055);
}
.mobile-interface .stat { min-height: 94px; padding: 12px; }
.mobile-interface .stat-value { font-size: 19px; line-height: 1.12; }
.mobile-interface .stat-detail { font-size: 10px; }
.mobile-interface .card-title { margin-bottom: 8px; font-size: 13px; }
.mobile-interface .section-head {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
}
.mobile-interface .section-head > .chips { align-self: stretch; }

.mobile-interface .btn,
.mobile-interface .chip,
.mobile-interface .general-toggle,
.mobile-interface .check-row {
  min-height: 44px;
}
.mobile-interface .btn { padding: 9px 12px; border-radius: 10px; }
.mobile-interface .btn-sm { min-height: 40px; padding: 7px 10px; }
.mobile-interface .btn-icon { min-width: 44px; padding-inline: 10px; }
.mobile-interface .kbd,
.mobile-interface .desktop-shortcuts { display: none !important; }
.mobile-interface .desktop-only { display: none !important; }

/* Filtros e campos */
.mobile-interface .toolbar,
.mobile-interface .filter-strip,
.mobile-interface .history-toolbar,
.mobile-interface .sales-lookup-toolbar,
.mobile-interface .receivable-toolbar,
.mobile-interface .promotion-status-toolbar,
.mobile-interface .rental-toolbar-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  align-items: stretch;
}
.mobile-interface .toolbar > *,
.mobile-interface .history-toolbar > *,
.mobile-interface .sales-lookup-toolbar > *,
.mobile-interface .receivable-toolbar > *,
.mobile-interface .filter-strip > * { min-width: 0; max-width: none; width: 100%; }
.mobile-interface .chips,
.mobile-interface .expiry-range-filters,
.mobile-interface .promotion-status-tabs {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 7px;
  padding: 2px 1px 5px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.mobile-interface .chips::-webkit-scrollbar,
.mobile-interface .expiry-range-filters::-webkit-scrollbar,
.mobile-interface .promotion-status-tabs::-webkit-scrollbar { display: none; }
.mobile-interface .chips .chip,
.mobile-interface .expiry-legend-item,
.mobile-interface .promotion-status-tabs .chip {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 13px;
  scroll-snap-align: start;
  white-space: nowrap;
}
.mobile-interface .searchbar { position: relative; width: 100%; min-width: 0; }
.mobile-interface .searchbar .input { width: 100%; }
.mobile-interface .form-grid,
.mobile-interface .compact-form-grid,
.mobile-interface .compact-form-row,
.mobile-interface .purchase-head-compact,
.mobile-interface .purchase-item-line,
.mobile-interface .purchase-item-line-v120,
.mobile-interface .price-review,
.mobile-interface .purchase-preview,
.mobile-interface .payment-entry,
.mobile-interface .branch-entry-pdv,
.mobile-interface .branch-entry-line,
.mobile-interface .rental-customer-line,
.mobile-interface .rental-detail-grid,
.mobile-interface .resale-discount-comparison,
.mobile-interface .discount-final-summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 9px !important;
}
.mobile-interface .field { min-width: 0; gap: 4px; }
.mobile-interface .label { font-size: 11px; }
.mobile-interface .input,
.mobile-interface .select,
.mobile-interface .textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 11px;
  border-radius: 11px;
  font-size: 16px;
}
.mobile-interface .textarea { min-height: 96px; }
.mobile-interface input[type="checkbox"],
.mobile-interface input[type="radio"] { width: 22px; height: 22px; flex: 0 0 22px; }
.mobile-interface .compact-select,
.mobile-interface .compact-input,
.mobile-interface .compact-date { width: 100%; max-width: none; }
.mobile-interface .inline-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  gap: 6px;
}
.mobile-interface .mini-results,
.mobile-interface .promotion-product-results,
.mobile-interface .customer-picker-list {
  max-height: min(48vh, 420px);
  border-radius: 11px;
  overscroll-behavior: contain;
}
.mobile-interface .mini-results button,
.mobile-interface .promotion-product-option,
.mobile-interface .customer-picker-row { min-height: 54px; padding: 10px; }
.mobile-interface .selected-token { display: flex; gap: 8px; align-items: center; }
.mobile-interface .selected-token button { min-width: 40px; min-height: 40px; }
.mobile-interface .mobile-inventory-sort {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 7px;
  margin: 9px 0;
  padding: 2px 1px 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mobile-interface .mobile-inventory-sort::-webkit-scrollbar { display: none; }
.mobile-interface .mobile-inventory-sort > strong {
  position: sticky;
  left: 0;
  z-index: 2;
  flex: 0 0 auto;
  padding: 8px 7px 8px 2px;
  color: #51675c;
  background: var(--mobile-canvas);
  font-size: 10px;
  text-transform: uppercase;
}
.mobile-interface .mobile-inventory-sort .chip { flex: 0 0 auto; min-height: 40px; white-space: nowrap; }

/* Listas já responsivas */
.mobile-interface .list-row,
.mobile-interface .compact-line {
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
}
.mobile-interface .compact-line > span { min-width: 0; }
.mobile-interface .compact-line strong,
.mobile-interface .compact-line small { overflow-wrap: anywhere; }
.mobile-interface .dashboard-table-row { min-height: 52px; }
.mobile-interface .customer-list-row,
.mobile-interface .supplier-list-row,
.mobile-interface .rental-row,
.mobile-interface .purchase-history-row,
.mobile-interface .receivable-customer-title {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  padding: 11px !important;
}
.mobile-interface .customer-list-cell,
.mobile-interface .customer-list-actions,
.mobile-interface .supplier-list-status,
.mobile-interface .supplier-list-row .row-actions,
.mobile-interface .rental-actions {
  grid-column: 1 !important;
  justify-content: flex-start !important;
}
.mobile-interface .customer-list-actions,
.mobile-interface .row-actions,
.mobile-interface .rental-actions {
  display: flex;
  width: 100%;
  gap: 6px;
  flex-wrap: wrap;
}
.mobile-interface .row-actions .btn,
.mobile-interface .customer-list-actions .btn,
.mobile-interface .rental-actions .btn { flex: 1 1 118px; }
.mobile-interface .rental-main { grid-template-columns: 1fr !important; gap: 5px; }
.mobile-interface .rental-main > * { grid-column: 1 !important; text-align: left !important; }
.mobile-interface .rental-finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.mobile-interface .branch-launch-card > summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}
.mobile-interface .branch-launch-meta,
.mobile-interface .branch-launch-totals { grid-column: 1 / -1; }
.mobile-interface .branch-launch-summary-action { grid-column: 2; grid-row: 1; }
.mobile-interface .branch-launch-footer { display: grid; gap: 5px; }

/* Todas as tabelas permanecem acessíveis e viram cartões completos. */
@media screen {
  .mobile-interface .table-wrap {
    display: block !important;
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
    border: 0;
    background: transparent;
  }
  .mobile-interface table.mobile-card-table,
  .mobile-interface table.mobile-card-table tbody {
    display: grid;
    width: 100%;
    min-width: 0 !important;
    gap: 9px;
    background: transparent;
  }
  .mobile-interface table.mobile-card-table thead { display: none; }
  .mobile-interface table.mobile-card-table tbody tr {
    display: grid;
    width: 100%;
    min-width: 0;
    padding: 6px 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--mobile-line);
    border-radius: 12px;
    box-shadow: 0 4px 13px rgba(20, 65, 47, .045);
  }
  .mobile-interface table.mobile-card-table tbody tr[hidden] { display: none !important; }
  .mobile-interface table.mobile-card-table tbody td {
    display: grid;
    grid-template-columns: minmax(88px, .42fr) minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 35px;
    padding: 7px 0;
    overflow: visible;
    white-space: normal !important;
    overflow-wrap: anywhere;
    border: 0;
    border-bottom: 1px solid #e8efeb;
    text-align: left !important;
  }
  .mobile-interface table.mobile-card-table tbody td:last-child { border-bottom: 0; }
  .mobile-interface table.mobile-card-table tbody td::before {
    content: attr(data-label);
    color: #65776d;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
  }
  .mobile-interface table.mobile-card-table tbody td.mobile-table-message {
    display: block;
    min-height: 48px;
    padding: 13px 2px;
    color: #65776d;
    text-align: center !important;
  }
  .mobile-interface table.mobile-card-table tbody td.mobile-table-message::before,
  .mobile-interface table.mobile-card-table tbody td.mobile-empty-cell { display: none; }
  .mobile-interface table.mobile-card-table .row-actions { grid-column: 1 / -1; }
  .mobile-interface table.mobile-card-table td > .btn:only-child { width: 100%; }
  .mobile-interface table.mobile-card-table .inventory-sort-button { min-height: 40px; }
  .mobile-interface #inventory-mobile-results { display: none !important; }
  .mobile-interface #inventory-desktop-results:not([hidden]) { display: block !important; }
}

/* Modais em formato de tela/bandeja */
.mobile-interface .modal-overlay {
  z-index: 110;
  align-items: end;
  padding: 0;
  background: rgba(18, 36, 28, .58);
}
.mobile-interface .modal,
.mobile-interface .modal.wide,
.mobile-interface .modal.xwide {
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(94dvh, var(--mobile-vh)) !important;
  margin: 0;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 46px rgba(0, 0, 0, .25);
}
.mobile-interface .modal-head {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 58px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .98);
}
.mobile-interface .modal-title { min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
.mobile-interface .modal-head .btn-icon { min-width: 42px; width: 42px; height: 42px; font-size: 22px; }
.mobile-interface .modal-body {
  max-height: calc(min(94dvh, var(--mobile-vh)) - 58px);
  padding: 11px 10px calc(16px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-interface .modal-actions {
  position: sticky;
  bottom: calc(-16px - env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 14px -10px calc(-16px - env(safe-area-inset-bottom));
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .98);
  border-top: 1px solid var(--mobile-line);
  box-shadow: 0 -5px 16px rgba(19, 68, 48, .07);
}
.mobile-interface .modal-actions .btn { width: 100%; min-width: 0; white-space: normal; }
.mobile-interface .modal-actions > :only-child { grid-column: 1 / -1; }
.mobile-interface .modal-actions > .btn-primary:last-child:nth-child(odd) { grid-column: 1 / -1; }

.mobile-interface .mobile-more-modal { height: min(92dvh, var(--mobile-vh)); }
.mobile-interface .mobile-more-modal .modal-body { padding: 9px 10px calc(18px + env(safe-area-inset-bottom)); }
.mobile-interface .mobile-more-modal .nav-list {
  position: static;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: auto;
  gap: 8px;
  overflow: visible;
}
.mobile-interface .mobile-more-modal .nav-item {
  min-width: 0;
  min-height: 62px;
  padding: 10px;
  color: #29483a;
  background: #f5f9f6;
  border: 1px solid var(--mobile-line);
  border-radius: 11px;
  font-size: 11px;
  line-height: 1.2;
}
.mobile-interface .mobile-more-modal .nav-icon { flex: 0 0 22px; }

/* PDV mobile com Produtos e Carrinho separados */
.mobile-interface .view-pdv { padding-top: 8px; }
.mobile-interface .view-pdv .pdv-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px;
  height: auto !important;
  min-height: 0 !important;
}
.mobile-interface .mobile-pdv-switcher {
  position: sticky;
  top: 62px;
  z-index: 58;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--mobile-line);
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(19, 68, 48, .10);
  backdrop-filter: blur(14px);
}
.mobile-interface .mobile-pdv-switcher button {
  min-height: 44px;
  padding: 7px 9px;
  color: #60736a;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-weight: 800;
}
.mobile-interface .mobile-pdv-switcher button.active { color: #fff; background: var(--mobile-green); }
.mobile-interface .mobile-pdv-switcher b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 5px;
  color: var(--mobile-green-dark);
  background: #fff;
  border-radius: 999px;
  font-size: 10px;
}
.mobile-interface .mobile-panel-products > .receipt,
.mobile-interface .mobile-panel-cart > .pos-products { display: none !important; }
.mobile-interface .view-pdv .pos-products,
.mobile-interface .view-pdv .receipt { min-width: 0; width: 100%; }
.mobile-interface .view-pdv .pdv-local-head { margin: 2px 0 9px; }
.mobile-interface .view-pdv .pdv-local-head .page-title { font-size: 21px; }
.mobile-interface .view-pdv .pdv-local-head .page-subtitle { font-size: 11px; }
.mobile-interface .view-pdv .pdv-head-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.mobile-interface .view-pdv .pdv-head-actions .btn { min-height: 42px; padding: 7px 9px; font-size: 11px; }
.mobile-interface .view-pdv .pos-search-toolbar { display: grid; grid-template-columns: 1fr; gap: 7px; }
.mobile-interface .view-pdv .pos-cancel-sale { width: 100%; min-height: 42px; justify-content: center; }
.mobile-interface .view-pdv .search-results { max-height: none; overflow: visible; }
.mobile-interface .view-pdv .search-result {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 80px;
  padding: 10px;
  border-radius: 12px;
}
.mobile-interface .view-pdv .result-main { min-width: 0; }
.mobile-interface .view-pdv .result-title-row { gap: 5px; }
.mobile-interface .view-pdv .result-title-row > strong { font-size: 12px; line-height: 1.25; }
.mobile-interface .view-pdv .result-meta { display: grid; gap: 4px; }
.mobile-interface .view-pdv .result-presentation-detail,
.mobile-interface .view-pdv .stock-badge { white-space: normal; overflow-wrap: anywhere; }
.mobile-interface .view-pdv .result-prices { min-width: 74px; align-items: flex-end; }
.mobile-interface .view-pdv .result-prices b { font-size: 17px; }
.mobile-interface .view-pdv .result-prices small { font-size: 9px; }
.mobile-interface .view-pdv .pos-result-context { align-items: flex-start; flex-direction: column; gap: 3px; }
.mobile-interface .view-pdv .pdv-idle { min-height: 31vh; padding: 24px 15px; text-align: center; }
.mobile-interface .view-pdv .receipt {
  position: static !important;
  top: auto;
  height: auto !important;
  min-height: 0;
  max-height: none !important;
  padding: 11px;
  overflow: visible !important;
  border-radius: 13px;
}
.mobile-interface .view-pdv .receipt-title { margin-bottom: 5px; }
.mobile-interface .view-pdv .cart-list {
  min-height: 125px !important;
  max-height: none !important;
  overflow: visible !important;
}
.mobile-interface .view-pdv .cart-item {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 10px 0;
}
.mobile-interface .view-pdv .cart-item-name { font-size: 12px; }
.mobile-interface .view-pdv .cart-item-meta,
.mobile-interface .view-pdv .promotion-cart-meta { font-size: 10px; }
.mobile-interface .view-pdv .cart-item > .money { font-size: 13px; }
.mobile-interface .view-pdv .receipt-fixed,
.mobile-interface .view-pdv .receipt-payment-scroll {
  max-height: none !important;
  overflow: visible !important;
}
.mobile-interface .view-pdv .cart-total { font-size: 16px; }
.mobile-interface .view-pdv .payment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mobile-interface .view-pdv .payment-grid .chip { min-height: 46px; justify-content: center; font-size: 13px; }
.mobile-interface .view-pdv .payment-summary { grid-template-columns: 1fr 1fr; gap: 7px; }
.mobile-interface .view-pdv .payment-summary .change-highlight { grid-column: 1 / -1; }
.mobile-interface .view-pdv .desktop-finalize { display: none !important; }
.mobile-interface .view-pdv .mobile-cart-actions {
  position: sticky;
  bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  z-index: 55;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px -5px -5px;
  padding: 8px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid var(--mobile-line);
  border-radius: 12px;
  box-shadow: 0 -5px 18px rgba(19, 68, 48, .10);
}
.mobile-interface .view-pdv .mobile-cart-actions button { min-height: 44px; }
.mobile-interface .view-pdv .mobile-cart-actions .primary { grid-column: 1 / -1; background: var(--mobile-green); }

/* Compras, estoque, caixa, relatórios e demais módulos */
.mobile-interface .purchase-entry,
.mobile-interface .purchase-items,
.mobile-interface .purchase-summary,
.mobile-interface .payable-box { padding: 10px; border-radius: 12px; }
.mobile-interface .purchase-product,
.mobile-interface .branch-product-field { grid-column: 1 !important; }
.mobile-interface .purchase-item-row,
.mobile-interface .cost-confirm-row,
.mobile-interface .purchase-price-review-row,
.mobile-interface .cash-ledger-head,
.mobile-interface .cash-ledger-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 7px !important;
}
.mobile-interface .purchase-item-row > *,
.mobile-interface .cost-confirm-row > *,
.mobile-interface .purchase-price-review-row > *,
.mobile-interface .cash-ledger-row > * { grid-column: auto !important; }
.mobile-interface .purchase-item-row > strong,
.mobile-interface .cost-confirm-row > strong,
.mobile-interface .purchase-price-review-row > strong { grid-column: 1 / -1 !important; }
.mobile-interface .purchase-expanded-head { align-items: stretch; flex-direction: column; }
.mobile-interface .purchase-detail-head,
.mobile-interface .purchase-detail-meta { display: grid; grid-template-columns: 1fr; gap: 6px; }
.mobile-interface .summary-totals { justify-content: flex-start; gap: 9px; }
.mobile-interface .promotion-reference,
.mobile-interface .purchase-history-preview,
.mobile-interface .payable-payment-summary,
.mobile-interface .product-analysis-stats {
  grid-template-columns: minmax(0, 1fr) !important;
}
.mobile-interface .promotion-product-option { grid-template-columns: minmax(0, 1fr); }
.mobile-interface .promotion-option-footer { align-items: flex-start; flex-direction: column; }
.mobile-interface .promotion-selected-stock { font-size: 14px; }
.mobile-interface .receivable-selected-list { max-height: 32vh; }
.mobile-interface .receivable-customer-title > * { grid-column: 1 !important; }
.mobile-interface .payment-lines { gap: 7px; }
.mobile-interface .payment-line { grid-template-columns: minmax(0, 1fr) auto 36px; min-height: 48px; }
.mobile-interface .payment-line button { width: 36px; height: 36px; }
.mobile-interface .payable-calculation { display: grid; gap: 6px; }
.mobile-interface .cash-history-card { padding: 10px; }
.mobile-interface .cash-ledger-head { display: none; }
.mobile-interface .cash-ledger-row {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--mobile-line);
  border-radius: 10px;
  margin-bottom: 7px;
}
.mobile-interface .dre-expanded { max-width: none; }
.mobile-interface .month-chart { height: 190px; gap: 3px; overflow-x: auto; }
.mobile-interface .month-col { min-width: 34px; }
.mobile-interface .resale-discount-total { width: 100%; gap: 8px; padding: 12px; }
.mobile-interface .resale-discount-total strong { font-size: 21px; }
.mobile-interface .receipt-document { max-width: 100%; overflow-wrap: anywhere; }
.mobile-interface .sale-screen-detail { min-width: 0; }
.mobile-interface .photo-actions { display: grid; grid-template-columns: 1fr 1fr; }

.mobile-interface .mobile-inventory-compact-list { display: grid; gap: 8px; }
.mobile-interface .mobile-inventory-compact-list .list-card { min-width: 0; padding: 10px 11px; overflow: visible; }
.mobile-interface .mobile-inventory-compact-list .list-card-head { align-items: flex-start; gap: 8px; }
.mobile-interface .mobile-inventory-compact-list .list-card-head > div { min-width: 0; overflow-wrap: anywhere; }
.mobile-interface .mobile-inventory-compact-list .list-card-footer { flex-wrap: wrap; gap: 6px; }
.mobile-interface .mobile-inventory-compact-list details.action-menu[open] > div { position: static; width: 100%; margin-top: 6px; box-shadow: none; }

/* Câmera e avisos */
.mobile-interface .mobile-scanner-field { position: relative; }
.mobile-interface .searchbar.mobile-scanner-field .input { padding-right: 68px; }
.mobile-interface .mobile-scan-button {
  min-width: 54px;
  min-height: 40px;
  padding: 5px 8px;
  color: var(--mobile-green-dark);
  background: var(--mobile-green-soft);
  border: 1px solid #b9dfcd;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
}
.mobile-interface .searchbar > .mobile-scan-button {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 4;
  transform: translateY(-50%);
}
.mobile-interface .mobile-scan-button span { display: block; line-height: 1.05; }
.mobile-interface .mobile-scan-button span:first-child { font-size: 15px; }
/* 1.5.0 — câmera explícita na Venda e na Saída para filial. */
.mobile-interface .inline-search.mobile-scanner-field {
  display: flex !important;
  align-items: stretch;
  gap: 6px;
}
.mobile-interface .inline-search.mobile-scanner-field > .input {
  flex: 1 1 150px;
  min-width: 0;
}
.mobile-interface .inline-search.mobile-scanner-field > .mobile-scan-button {
  flex: 0 0 auto;
  min-width: 68px;
}
.mobile-interface .mobile-scanner-sale .mobile-scan-button,
.mobile-interface .mobile-scanner-branch .mobile-scan-button {
  color: #075f3d;
  background: #e4f5ec;
  border-color: #9fd8bb;
}
.mobile-notice {
  position: fixed;
  z-index: 220;
  left: 10px;
  right: 10px;
  bottom: calc(var(--mobile-nav-height) + 14px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  color: #fff;
  background: #29463a;
  border-radius: 11px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  font-size: 12px;
  font-weight: 700;
}
.mobile-notice-success { background: var(--mobile-green); }
.mobile-notice-warning { background: #9a6814; }
.mobile-scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: end center;
  padding: 0;
  background: rgba(7, 18, 13, .82);
}
.mobile-scanner-dialog {
  width: 100%;
  max-width: 620px;
  padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  color: #203a2f;
  background: #fff;
  border-radius: 18px 18px 0 0;
}
.mobile-scanner-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mobile-scanner-dialog header div { display: grid; gap: 3px; }
.mobile-scanner-dialog header strong { font-size: 17px; }
.mobile-scanner-dialog header span { color: #65776d; font-size: 11px; }
.mobile-scanner-dialog header button {
  width: 44px;
  height: 44px;
  color: #31483e;
  background: #eef4f0;
  border: 0;
  border-radius: 10px;
  font-size: 25px;
}
.mobile-scanner-video {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 11px;
  overflow: hidden;
  background: #07120d;
  border-radius: 12px;
}
.mobile-scanner-video video { width: 100%; height: 100%; object-fit: cover; }
.mobile-scanner-guide {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 35%;
  height: 30%;
  border: 2px solid #70e1a7;
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .28);
}
.mobile-scanner-dialog p { margin: 9px 0; color: #65776d; font-size: 11px; text-align: center; }
.mobile-scanner-continuous { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px; font-size: 13px; font-weight: 700; }
.mobile-scanner-continuous input { width: 20px; height: 20px; }

/* Login */
.mobile-interface .login-page {
  min-height: var(--mobile-vh);
  padding: max(18px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 20% 5%, #dff5e9 0, transparent 38%), linear-gradient(155deg, #eff9f3, #d9f0e4);
}
.mobile-interface .login-card {
  width: min(100%, 430px);
  padding: 22px 17px;
  border-radius: 19px;
  box-shadow: var(--mobile-shadow);
}
.mobile-interface .login-card h1 { font-size: 25px; }
.mobile-interface .login-logo { width: 50px; height: 50px; }
.mobile-interface #login-submit { min-height: 50px; font-size: 16px; }

/* Telas pequenas e paisagem */
@media (max-width: 370px) {
  .mobile-interface .brand-name { max-width: 42vw; font-size: 13px; }
  .mobile-interface .operator { display: none; }
  .mobile-interface .bottom-item { font-size: 8px; }
  .mobile-interface .stats-mobile-2 { grid-template-columns: 1fr !important; }
  .mobile-interface .mobile-more-modal .nav-list { grid-template-columns: 1fr; }
  .mobile-interface table.mobile-card-table tbody td { grid-template-columns: 78px minmax(0, 1fr); }
}

@media (min-width: 600px) {
  .mobile-interface .main { padding-inline: 16px; }
  .mobile-interface .stats-mobile-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mobile-interface .dashboard-compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mobile-interface .form-grid,
  .mobile-interface .compact-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mobile-interface .modal { width: min(620px, 100%) !important; border-radius: 18px 18px 0 0; }
  .mobile-interface .modal.wide,
  .mobile-interface .modal.xwide { width: min(760px, 100%) !important; }
  .mobile-interface .mobile-scanner-dialog { border-radius: 18px 18px 0 0; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .mobile-interface .topbar { min-height: 50px; padding-block: 5px; }
  .mobile-interface .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .mobile-interface .offline-banner { top: 50px; }
  .mobile-interface .main { padding-top: 8px; }
  .mobile-interface .mobile-pdv-switcher { top: 53px; }
  .mobile-interface .modal,
  .mobile-interface .modal.wide,
  .mobile-interface .modal.xwide { max-height: var(--mobile-vh) !important; }
  .mobile-interface .modal-body { max-height: calc(var(--mobile-vh) - 54px); }
  .mobile-scanner-dialog { max-width: 760px; }
  .mobile-scanner-video { aspect-ratio: 16 / 6; }
}

@media print {
  .mobile-interface .bottom-nav,
  .mobile-interface .mobile-pdv-switcher,
  .mobile-interface .mobile-cart-actions,
  .mobile-interface .mobile-scan-button,
  .mobile-notice { display: none !important; }
  .mobile-interface table.mobile-card-table,
  .mobile-interface table.mobile-card-table thead { display: table !important; }
  .mobile-interface table.mobile-card-table tbody { display: table-row-group !important; }
  .mobile-interface table.mobile-card-table tbody tr { display: table-row !important; padding: 0; border: 0; box-shadow: none; }
  .mobile-interface table.mobile-card-table tbody td { display: table-cell !important; padding: 6px; border-bottom: 1px solid #ddd; }
  .mobile-interface table.mobile-card-table tbody td::before { display: none !important; }
}

/* 1.4.5 — prioridade gerencial: contas a pagar, compras e estoque */
.mobile-interface .mobile-manager-priorities {
  margin: 0 0 12px;
  padding: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf8 100%);
  border: 1px solid var(--mobile-line);
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(20, 65, 47, .055);
}
.mobile-interface .mobile-manager-priorities-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.mobile-interface .mobile-manager-priorities-head > div { display: grid; gap: 2px; }
.mobile-interface .mobile-manager-priorities-head strong { color: #18372b; font-size: 14px; }
.mobile-interface .mobile-manager-priorities-head span { color: #687a71; font-size: 10px; }
.mobile-interface .mobile-manager-priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.mobile-interface .mobile-manager-priority-grid button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 68px;
  padding: 9px;
  text-align: left;
  color: #244a3a;
  background: #f0f8f4;
  border: 1px solid #cfe2d8;
  border-radius: 11px;
}
.mobile-interface .mobile-manager-priority-grid button:first-child {
  color: #fff;
  background: var(--mobile-green);
  border-color: var(--mobile-green);
}
.mobile-interface .mobile-manager-priority-grid button:first-child small { color: rgba(255,255,255,.82); }
.mobile-interface .mobile-manager-priority-grid button > span:last-child { display: grid; min-width: 0; gap: 2px; }
.mobile-interface .mobile-manager-priority-grid strong { font-size: 11px; line-height: 1.15; }
.mobile-interface .mobile-manager-priority-grid small { color: #6a7c73; font-size: 9px; line-height: 1.2; }
.mobile-interface .mobile-priority-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
}
.mobile-interface .mobile-priority-icon svg { width: 22px; height: 22px; }
.mobile-interface .view-dashboard .page-actions { grid-template-columns: 1fr 1fr; overflow: visible; }
.mobile-interface .view-dashboard .page-actions > * { flex: initial; min-width: 0; }

/* Barra inferior gerencial */
.mobile-interface .bottom-item > span:last-child {
  display: -webkit-box;
  min-height: 19px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-align: center;
}
.mobile-interface .bottom-nav-inner { gap: 2px; }
.mobile-interface .bottom-item { font-size: 8.5px; font-weight: 750; }

/* Contas a pagar: leitura rápida e prioridade visual */
.mobile-interface .view-payables .page-head { margin-bottom: 9px; }
.mobile-interface .view-payables .payable-alert {
  margin: 10px 0;
  padding: 10px;
  border-radius: 12px;
}
.mobile-interface .view-payables .payable-alert-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.mobile-interface .view-payables .payable-alert-list button {
  min-height: 62px;
  padding: 9px;
  border-radius: 10px;
}
.mobile-interface .view-payables .payables-card { padding: 10px; }
.mobile-interface .view-payables .payables-filters {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px !important;
  margin-bottom: 8px;
}
.mobile-interface .view-payables .payables-filters .chip {
  flex: 1 0 auto;
  width: auto;
  min-width: 84px;
}
.mobile-interface .view-payables .payables-filters .select,
.mobile-interface .view-payables .payables-filters .input { flex: 1 1 100%; width: 100%; }
.mobile-interface .view-payables .payable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0 0 8px;
  padding: 11px;
  background: #fff;
  border: 1px solid var(--mobile-line);
  border-radius: 11px;
}
.mobile-interface .view-payables .payable-row.overdue,
.mobile-interface .view-payables .payable-row.due-today { border-left: 4px solid #b42318; }
.mobile-interface .view-payables .payable-row.due-soon { border-left: 4px solid #d97706; }
.mobile-interface .view-payables .payable-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  width: 100%;
}
.mobile-interface .view-payables .payable-status > strong { font-size: 17px; text-align: right; }
.mobile-interface .view-payables .payable-status .btn { grid-column: 1 / -1; width: 100%; }

/* Compras: filtros compactos e histórico fácil de conferir */
.mobile-interface .view-purchases .purchase-history-card { margin-top: 11px; padding: 10px; }
.mobile-interface .view-purchases .history-toolbar {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}
.mobile-interface .view-purchases .history-toolbar .history-search { grid-column: 1 / -1; }
.mobile-interface .view-purchases .purchase-history-row {
  position: relative;
  min-height: 112px;
  background: #fff;
  border: 1px solid var(--mobile-line);
  border-radius: 11px;
  box-shadow: 0 3px 10px rgba(20, 65, 47, .04);
}
.mobile-interface .view-purchases .purchase-history-row strong { color: #173c2d; font-size: 13px; }
.mobile-interface .view-purchases .purchase-history-row b { color: var(--mobile-green-dark); font-size: 17px; }
.mobile-interface .view-purchases .purchase-history-row .history-open { color: var(--mobile-green-dark); font-weight: 800; }

/* Estoque: consulta acima de ações administrativas */
.mobile-interface .view-inventory .toolbar { gap: 7px; }
.mobile-interface .view-inventory #inventory-search { min-height: 48px; font-size: 15px; }
.mobile-interface .view-inventory .mobile-inventory-sort { margin-top: 6px; }
.mobile-interface .view-inventory table.mobile-card-table tbody tr { padding: 8px 11px; }
.mobile-interface .view-inventory table.mobile-card-table tbody td:first-child strong { color: #173c2d; font-size: 13px; }
.mobile-interface .view-inventory table.mobile-card-table tbody td:nth-child(2) { font-weight: 750; }

/* Menu Mais: ordem alfabetica unica; os mais usados pelo login recebem apenas destaque visual. */
.mobile-interface .mobile-more-modal .more-nav-item {
  position: relative;
}
.mobile-interface .mobile-more-modal .more-nav-item.is-frequent {
  color: var(--mobile-green-dark);
  background: var(--mobile-green-soft);
  border-color: #8fc9ad;
  box-shadow: inset 3px 0 0 var(--mobile-green);
}
.mobile-interface .mobile-more-modal .more-used-mark {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--mobile-green);
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 370px) {
  .mobile-interface .mobile-manager-priority-grid { grid-template-columns: 1fr; }
  .mobile-interface .view-purchases .history-toolbar { grid-template-columns: 1fr !important; }
  .mobile-interface .view-purchases .history-toolbar .history-search { grid-column: 1; }
}

/* 1.4.5 — rolagem mobile estável e independente do body.
   O conteúdo principal passa a ser o único scroller da tela; a barra inferior fica fixa. */
html.mobile-interface,
body.mobile-interface {
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.mobile-interface {
  position: relative;
}

.mobile-interface .app-shell {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
}

.mobile-interface .topbar,
.mobile-interface .environment-banner,
.mobile-interface .offline-banner {
  flex: 0 0 auto;
}

.mobile-interface .workspace {
  display: block !important;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: hidden !important;
}

.mobile-interface .main {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  max-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  touch-action: pan-y pinch-zoom;
  scroll-behavior: auto;
  padding-bottom: calc(var(--mobile-nav-height) + 30px + env(safe-area-inset-bottom));
}

/* Garante área livre abaixo do último cartão, sem a barra inferior cobrir conteúdo. */
.mobile-interface .main::after {
  content: "";
  display: block;
  width: 100%;
  height: max(18px, env(safe-area-inset-bottom));
  pointer-events: none;
}

/* Modais, inclusive Mais, rolam por conta própria mesmo com o body travado. */
.mobile-interface .modal-body,
.mobile-interface .mobile-more-modal .modal-body,
.mobile-interface .mobile-more-modal .nav-list {
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}

.mobile-interface .mobile-more-modal .modal-body {
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
}

/* Login também continua rolável em aparelhos baixos/teclado aberto. */
.mobile-interface .login-page {
  height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}


/* 1.5.0 — Compras: voz removida; busca e leitor de código são o fluxo rápido */
.mobile-interface [data-action="purchase-voice"],
.mobile-interface .purchase-voice-status,
.mobile-interface .voice-choice { display: none !important; }
.mobile-interface .purchase-product .inline-search.mobile-purchase-product-search {
  display: flex !important;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 7px;
}
.mobile-interface .purchase-product .mobile-purchase-product-search > .input {
  flex: 1 1 180px;
  min-width: 150px;
}
.mobile-interface .purchase-product .mobile-purchase-product-search > button {
  flex: 0 0 auto;
}
.mobile-interface .purchase-product .mobile-purchase-product-search .mobile-scan-button {
  min-width: 62px;
}

/* 1.5.0 — Compras: preenchimento contínuo sem salto para o início.
   O modal preserva a posição ao recalcular/re-renderizar campos e mantém o
   controle ativo dentro da área visível quando o teclado do Android abre. */
.mobile-interface .mobile-purchase-modal .modal-body {
  scroll-padding-top: 18px;
  scroll-padding-bottom: 132px;
  overflow-anchor: none;
}
.mobile-interface .mobile-purchase-scroll-overlay {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y pinch-zoom;
}
.mobile-interface .mobile-purchase-scroll-overlay .mobile-purchase-modal {
  max-height: none !important;
  overflow: visible !important;
}
.mobile-interface .mobile-purchase-scroll-overlay .mobile-purchase-modal .modal-body {
  max-height: none;
  overflow: visible;
}
.mobile-interface .mobile-purchase-scroll-overlay,
.mobile-interface .mobile-purchase-scroll-overlay .mobile-purchase-modal,
.mobile-interface .mobile-purchase-scroll-overlay .mobile-purchase-modal .modal-body,
.mobile-interface .mobile-purchase-scroll-overlay .purchase-layout,
.mobile-interface .mobile-purchase-scroll-overlay .purchase-layout > *,
.mobile-interface .mobile-purchase-scroll-overlay .purchase-head-compact,
.mobile-interface .mobile-purchase-scroll-overlay .purchase-item-line,
.mobile-interface .mobile-purchase-scroll-overlay .purchase-summary-line {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.mobile-interface .mobile-purchase-scroll-overlay .inline-search,
.mobile-interface .mobile-purchase-scroll-overlay .purchase-decision-line,
.mobile-interface .mobile-purchase-scroll-overlay .shortcut-strip {
  max-width: 100%;
  min-width: 0;
}
.mobile-interface .mobile-purchase-scroll-overlay .purchase-decision-line > span {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.mobile-interface .mobile-purchase-modal input,
.mobile-interface .mobile-purchase-modal select,
.mobile-interface .mobile-purchase-modal textarea {
  scroll-margin-top: 18px;
  scroll-margin-bottom: 132px;
}
.mobile-interface .mobile-purchase-modal .purchase-entry,
.mobile-interface .mobile-purchase-modal .purchase-items,
.mobile-interface .mobile-purchase-modal .purchase-summary {
  gap: 9px;
}
.mobile-interface .mobile-purchase-modal .field,
.mobile-interface .mobile-purchase-modal .form-field {
  margin-bottom: 10px;
}
.mobile-interface .mobile-purchase-modal .modal-actions {
  box-shadow: 0 -7px 22px rgba(19, 68, 48, .11);
}

/* 1.5.0 — Compras: fluxo sequencial, lista de itens legível e conferência rápida. */
.mobile-interface .mobile-purchase-modal .purchase-items {
  max-height: none !important;
  overflow: visible !important;
}
.mobile-interface .mobile-purchase-modal .purchase-items .section-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
}
.mobile-interface .mobile-purchase-modal .mobile-purchase-expand-button {
  min-width: 132px;
  min-height: 42px;
  color: var(--mobile-green-dark);
  border-color: #bdd8ca;
  background: #f0f8f4;
  font-weight: 800;
}
.mobile-interface .mobile-purchase-modal .mobile-purchase-items-list {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  max-height: min(36dvh, 310px);
  padding: 2px 1px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.mobile-interface .mobile-purchase-review-row {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) auto auto !important;
  grid-template-areas:
    "number info total total"
    "number info edit remove" !important;
  gap: 5px 7px !important;
  width: 100%;
  min-width: 0;
  min-height: 92px;
  padding: 10px !important;
  align-items: center !important;
  border: 1px solid #d4e2da !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 3px 12px rgba(19, 68, 48, .055);
}
.mobile-interface .mobile-purchase-review-row > span:first-child {
  grid-area: number !important;
  align-self: start;
  color: var(--mobile-green);
  font-weight: 900;
}
.mobile-interface .mobile-purchase-review-row > div {
  grid-area: info !important;
  min-width: 0;
}
.mobile-interface .mobile-purchase-review-row > div strong {
  display: block;
  color: #17352a;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.mobile-interface .mobile-purchase-review-row > div small {
  display: block;
  margin-top: 4px;
  color: #64756d;
  font-size: 10.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.mobile-interface .mobile-purchase-review-row > b {
  grid-area: total !important;
  justify-self: end;
  color: #17352a;
  font-size: 14px;
  white-space: nowrap;
}
.mobile-interface .mobile-purchase-review-row [data-action="purchase-edit-item"] {
  grid-area: edit !important;
  justify-self: end;
  min-width: 66px;
  min-height: 38px;
}
.mobile-interface .mobile-purchase-review-row [data-action="purchase-remove-item"] {
  grid-area: remove !important;
  justify-self: end;
  width: 40px;
  min-width: 40px;
  min-height: 38px;
  padding-inline: 0;
}
.mobile-interface .mobile-purchase-expanded-modal .modal-body {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.mobile-interface .mobile-purchase-expanded-modal .purchase-expanded-head {
  position: sticky;
  top: -1px;
  z-index: 2;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 9px;
  padding: 4px 0 10px;
  background: #fff;
}
.mobile-interface .mobile-purchase-expanded-modal .purchase-expanded-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 18px;
}
.mobile-interface .mobile-purchase-expanded-modal .purchase-expanded-list .mobile-purchase-review-row {
  min-height: 104px;
}

/* 1.5.0 — Regra geral: toda gravação/confirmação mostra processamento e
   bloqueia novos toques até a resposta ou mudança de etapa. */
.mobile-global-processing {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 31, 24, .28);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .12s ease, visibility .12s ease;
}
.mobile-global-processing.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}
.mobile-action-pending { opacity: .72; }
.mobile-global-processing-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: min(360px, 92vw);
  padding: 16px 17px;
  color: #17352a;
  background: rgba(255, 255, 255, .98);
  border: 1px solid #cfe0d7;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(9, 45, 31, .22);
}
.mobile-global-processing-card > div {
  display: grid;
  gap: 3px;
}
.mobile-global-processing-card strong {
  font-size: 15px;
  line-height: 1.2;
}
.mobile-global-processing-card > div > span {
  color: #61746b;
  font-size: 11px;
  line-height: 1.35;
}
.mobile-global-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #d8ebe1;
  border-top-color: var(--mobile-green);
  border-radius: 50%;
  animation: mobile-global-spin .72s linear infinite;
}
@keyframes mobile-global-spin { to { transform: rotate(360deg); } }

@media (max-width: 390px) {
  .mobile-interface .mobile-purchase-review-row {
    grid-template-columns: 26px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "number info total"
      "number info info"
      ". edit remove" !important;
  }
  .mobile-interface .mobile-purchase-modal .purchase-items .section-head {
    grid-template-columns: 1fr !important;
  }
  .mobile-interface .mobile-purchase-modal .mobile-purchase-expand-button { width: 100%; }
}

/* 1.5.0 — Estoque leve: cartões gerados só por CSS, sem varrer todas as células
   no JavaScript a cada abertura/filtro. Mantém os preços completos do gerente. */
@media (max-width: 1024px) {
  .mobile-interface #inventory-desktop-results {
    overflow: visible !important;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards,
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards thead {
    display: none !important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody {
    display: grid !important;
    gap: 9px;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody tr.key-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    width: 100%;
    padding: 9px 11px;
    background: #fff;
    border: 1px solid var(--mobile-line);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(20, 65, 47, .04);
    content-visibility: auto;
    contain-intrinsic-size: 280px;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody tr[hidden] {
    display: none !important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td {
    display: grid !important;
    grid-template-columns: minmax(82px, .42fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 7px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #e8efeb !important;
    white-space: normal !important;
    overflow: visible !important;
    text-align: left !important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td:last-child {
    border-bottom: 0 !important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td::before {
    color: #65776d;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(1)::before { content: "Produto"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(2)::before { content: "Estoque"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(3)::before { content: "Custo"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(4)::before { content: "Último fornecedor"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(5)::before { content: "Varejo"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(6)::before { content: "Revenda"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(7)::before { content: "CX varejo"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(8)::before { content: "CX revenda"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(9)::before { content: "Balança / caixa"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-manager tbody td:nth-child(10)::before { content: "Ações"; }

  .mobile-interface #inventory-desktop-results table.mobile-inventory-cashier tbody td:nth-child(1)::before { content: "Produto"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-cashier tbody td:nth-child(2)::before { content: "Estoque"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-cashier tbody td:nth-child(3)::before { content: "Preço un."; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-cashier tbody td:nth-child(4)::before { content: "Preço caixa"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-cashier tbody td:nth-child(5)::before { content: "Balança / caixa"; }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-cashier tbody td:nth-child(6)::before { content: "Ações"; }

  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .row-actions .btn {
    min-width: 0;
    width: 100%;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tr[data-filter-empty] {
    display: block !important;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--mobile-line);
    border-radius: 12px;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tr[data-filter-empty][hidden] {
    display: none !important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tr[data-filter-empty] td {
    display: block !important;
    border: 0 !important;
    padding: 0 !important;
    color: #65776d;
    text-align: center !important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tr[data-filter-empty] td::before {
    content: none !important;
  }

  /* Campo ativo sempre visível. Em navegação por Próximo, valores numéricos
     já preenchidos ficam selecionados e prontos para substituir. */
  .mobile-interface input:focus,
  .mobile-interface select:focus,
  .mobile-interface textarea:focus {
    scroll-margin-top: 84px;
    scroll-margin-bottom: 150px;
  }
}
@media (min-width: 600px) and (max-width: 1024px) {
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody tr.key-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td:first-child,
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td:last-child {
    grid-column: 1 / -1;
  }
}



/* Mobile 1.5.1 — proteção de cache/estado vazio e atualização segura do shell */

/* Mobile 1.5.3 — edição financeira, estorno seguro e filtros gerenciais */
.mobile-interface .offline-banner {
  min-height: 0 !important;
  max-height: 26px;
  padding: 4px 8px !important;
  line-height: 1.15 !important;
  font-size: 9.5px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-interface .purchase-installment-schedule {
  grid-column: 1 / -1;
  width: 100%;
  padding: 10px;
  gap: 8px;
}
.mobile-interface .purchase-installment-title {
  display: grid;
  gap: 2px;
}
.mobile-interface .purchase-installment-title small {
  font-size: 11px;
  line-height: 1.35;
}
.mobile-interface .purchase-installment-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}
.mobile-interface .purchase-installment-row > .field:last-child { grid-column: 2; }
.mobile-interface .purchase-installment-row .input { min-width: 0; }

/* Mobile 1.5.3 — controles gerenciais novos */
.mobile-interface .view-payables .payable-supplier-select { width:100% !important; min-width:0 !important; }
.mobile-interface .view-payables .payable-actions { grid-column:1 / -1; display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
.mobile-interface .view-payables .payable-actions .btn { width:100%; min-height:44px; }
.mobile-interface .cash-report-controls { display:grid !important; grid-template-columns:1fr; gap:10px; width:100%; }
.mobile-interface .cash-operator-filter { display:grid !important; grid-template-columns:1fr; gap:5px; width:100%; font-weight:800; }
.mobile-interface .cash-operator-filter .select { width:100% !important; min-width:0 !important; }
.mobile-interface .purchase-installment-edit-list { display:grid; gap:10px; }
.mobile-interface .purchase-installment-edit-row { display:grid !important; grid-template-columns:1fr !important; gap:8px; padding:12px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.mobile-interface .purchase-installment-edit-row label { display:grid; gap:5px; }
.mobile-interface .purchase-installment-edit-row label > span { font-size:12px; font-weight:800; color:var(--muted); }
.mobile-interface .cash-close-actions { grid-template-columns:1fr 1fr !important; }
.mobile-interface .cash-close-actions .btn-primary { grid-column:1 / -1 !important; }
.mobile-interface form[data-form="purchase-void"] .alert-danger,
.mobile-interface form[data-form="purchase-payables-edit"] .alert-warning { line-height:1.4; }
@media(max-width:430px){.mobile-interface .view-payables .payable-actions{grid-template-columns:1fr}.mobile-interface .cash-close-actions{grid-template-columns:1fr !important}.mobile-interface .cash-close-actions .btn-primary{grid-column:auto !important}}


/* ===== Mobile 1.5.5 — ajuda de compras rápida + estoque ainda mais compacto ===== */
.mobile-interface .mobile-purchase-help-quick{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;padding:12px 14px;margin:0 0 9px;border:1px solid #b8dccb;border-radius:12px;background:#eaf7f0;color:#174d37}.mobile-interface .mobile-purchase-help-quick>span:nth-child(2){display:grid;gap:2px}.mobile-interface .mobile-purchase-help-quick strong{font-size:14px}.mobile-interface .mobile-purchase-help-quick small{font-size:10px;color:#587467}.mobile-interface .mobile-purchase-help-quick>b{font-size:11px;color:#08784c}.mobile-interface .view-purchasehelp .page-head{margin-bottom:8px}.mobile-interface .view-purchasehelp .purchase-help-search-card,.mobile-interface .view-purchasehelp .purchase-help-summary,.mobile-interface .view-purchasehelp .purchase-help-offer{padding:10px;margin-bottom:8px}.mobile-interface .view-purchasehelp .purchase-help-search-head{margin-bottom:6px}.mobile-interface .view-purchasehelp .purchase-help-search-head strong{font-size:14px}.mobile-interface .view-purchasehelp .purchase-help-search-head small{font-size:10px}.mobile-interface .mobile-purchase-help-searchbar{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto auto;gap:5px;align-items:center}.mobile-interface .mobile-purchase-help-searchbar .search-icon{position:static!important;transform:none!important}.mobile-interface .mobile-purchase-help-searchbar input{padding-left:10px!important;min-height:44px}.mobile-interface .mobile-purchase-help-searchbar .mobile-scan-button,.mobile-interface .mobile-purchase-help-searchbar .mobile-voice-button{position:static!important;min-height:42px;padding:0 9px;border-radius:9px}.mobile-interface .mobile-voice-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;border:1px solid #b9d8c9;background:#eef8f2;color:#17643f;font-weight:850;font-size:11px}.mobile-interface .mobile-voice-button>span:first-child{width:8px;height:8px;border-radius:50%;background:#d33;overflow:hidden;text-indent:-999px}.mobile-interface .purchase-help-voice-status{margin-top:6px;padding:6px 8px;font-size:10px}.mobile-interface .purchase-help-voice-status[data-status-type="listening"]{background:#fff6d9;color:#6b5412}.mobile-interface .purchase-help-voice-status[data-status-type="error"]{background:#fff0ee;color:#8c2821}.mobile-interface .purchase-help-voice-status[data-status-type="choice"]{background:#eef3ff;color:#2f4f83}.mobile-interface .purchase-help-results{gap:4px;margin-top:6px}.mobile-interface .purchase-help-results>button{padding:8px 9px;border-radius:8px}.mobile-interface .purchase-help-results>button strong{font-size:12px}.mobile-interface .purchase-help-results>button small{font-size:9px}.mobile-interface .purchase-help-results>button>b{font-size:13px}.mobile-interface .purchase-help-product-head h2{font-size:15px}.mobile-interface .purchase-help-product-head .btn{min-height:34px;padding:5px 8px}.mobile-interface .purchase-help-facts{gap:4px;margin-top:7px}.mobile-interface .purchase-help-facts>div{padding:7px 8px;border-radius:8px}.mobile-interface .purchase-help-facts strong{font-size:12px}.mobile-interface .purchase-help-facts small{font-size:9px}.mobile-interface .purchase-help-reference{margin-top:6px;padding:6px 8px}.mobile-interface .purchase-help-offer-grid{gap:6px}.mobile-interface .purchase-help-offer .field{margin:0}.mobile-interface .purchase-help-offer .input{min-height:44px}.mobile-interface .purchase-help-verdict,.mobile-interface .purchase-help-empty-verdict{margin-top:7px;padding:9px 10px}.mobile-interface .purchase-help-verdict strong{font-size:13px}
@media(max-width:1024px){
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody{gap:5px!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody tr.key-row{padding:6px 8px!important;border-radius:9px!important;contain-intrinsic-size:205px!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td{grid-template-columns:76px minmax(0,1fr)!important;gap:5px!important;padding:3px 0!important;font-size:11px!important;line-height:1.22!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td::before{font-size:8px!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td:first-child{display:block!important;padding:2px 0 5px!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td:first-child::before{display:none!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td:first-child strong{font-size:12px!important;line-height:1.25!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards tbody td:first-child .muted{font-size:9px!important;line-height:1.2!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .badge{padding:2px 6px!important;font-size:9px!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .inventory-last-supplier{
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    align-items:start!important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .inventory-last-supplier-value{
    min-width:0!important;
    display:grid!important;
    gap:2px!important;
    align-content:start!important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .inventory-last-supplier-value strong{
    min-width:0!important;
    font-size:11px!important;
    line-height:1.2!important;
    font-weight:700!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .inventory-last-supplier-value .muted{
    display:block!important;
    margin:0!important;
    font-size:8px!important;
    line-height:1.2!important;
    white-space:normal!important;
  }
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .row-actions{display:flex!important;gap:4px!important;flex-wrap:wrap!important}
  .mobile-interface #inventory-desktop-results table.mobile-inventory-native-cards .row-actions .btn{width:auto!important;min-height:30px!important;padding:4px 7px!important;font-size:9px!important;flex:1 1 auto!important}
}

/* ===== Mobile 1.5.6 — Assistente mestre por voz, câmera e texto ===== */
.mobile-interface .mobile-assistant-quick{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;padding:12px 14px;margin:0 0 8px;border:1px solid #a9cde9;border-radius:12px;background:#eef6fd;color:#173f62}.mobile-interface .mobile-assistant-quick>span:nth-child(2){display:grid;gap:2px}.mobile-interface .mobile-assistant-quick strong{font-size:14px}.mobile-interface .mobile-assistant-quick small{font-size:10px;color:#557083;line-height:1.25}.mobile-interface .mobile-assistant-quick>b{font-size:11px;color:#17609a}.mobile-interface .view-assistant .page-head{margin-bottom:7px}.mobile-interface .view-assistant .assistant-layout{gap:7px}.mobile-interface .view-assistant .assistant-chat,.mobile-interface .view-assistant .assistant-workflow{padding:9px;margin-bottom:0;border-radius:11px}.mobile-interface .view-assistant .assistant-messages{max-height:34vh;gap:5px;padding-bottom:5px}.mobile-interface .view-assistant .assistant-message{max-width:94%;padding:7px 8px;border-radius:9px;font-size:11px}.mobile-interface .view-assistant .assistant-message>span{font-size:8px}.mobile-interface .view-assistant .assistant-candidates{gap:4px;margin:5px 0}.mobile-interface .view-assistant .assistant-candidates button{padding:7px 8px;border-radius:8px}.mobile-interface .view-assistant .assistant-candidates strong{font-size:11px}.mobile-interface .view-assistant .assistant-candidates small{font-size:8.5px}.mobile-interface .mobile-assistant-commandbar{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto auto;gap:5px;align-items:center}.mobile-interface .mobile-assistant-commandbar .search-icon{position:static!important;transform:none!important}.mobile-interface .mobile-assistant-commandbar input{padding-left:8px!important;min-height:43px}.mobile-interface .mobile-assistant-commandbar .mobile-scan-button,.mobile-interface .mobile-assistant-commandbar .mobile-assistant-voice-button{position:static!important;min-height:41px;padding:0 8px;border-radius:8px}.mobile-interface .view-assistant .assistant-command-row{display:grid;grid-template-columns:1fr;gap:5px;margin-top:6px}.mobile-interface .view-assistant .assistant-command-row>.btn{min-height:40px;width:100%}.mobile-interface .view-assistant .assistant-quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.mobile-interface .view-assistant .assistant-quick-actions .btn{min-height:37px;padding:5px 7px;font-size:10px}.mobile-interface .view-assistant .assistant-quick-actions .btn:last-child{grid-column:1 / -1}.mobile-interface .assistant-voice-status{margin-top:5px;padding:5px 7px;font-size:9.5px}.mobile-interface .mobile-assistant-continuous{min-height:34px;padding:4px 7px;font-size:9px}.mobile-interface .mobile-assistant-voice-settings{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:end;margin-top:7px;padding-top:7px;border-top:1px solid var(--mobile-line)}.mobile-interface .mobile-assistant-voice-settings>label:first-child{display:grid;gap:3px}.mobile-interface .mobile-assistant-voice-settings span{font-size:8px;font-weight:900;text-transform:uppercase;color:#65776d}.mobile-interface .mobile-assistant-voice-settings .select{min-width:0;width:100%;min-height:36px;font-size:10px}.mobile-interface .mobile-assistant-voice-settings .check-row{font-size:9px;white-space:nowrap}.mobile-interface .view-assistant .assistant-summary-grid{grid-template-columns:1fr 1fr;gap:5px;margin:6px 0}.mobile-interface .view-assistant .assistant-summary-grid>div{padding:6px 7px}.mobile-interface .view-assistant .assistant-summary-grid span{font-size:7.5px}.mobile-interface .view-assistant .assistant-summary-grid strong{font-size:10.5px}.mobile-interface .view-assistant .assistant-inventory-list,.mobile-interface .view-assistant .assistant-installments{gap:4px;margin:6px 0}.mobile-interface .view-assistant .assistant-inventory-list>div,.mobile-interface .view-assistant .assistant-installments>div{padding:6px 7px;font-size:10px}.mobile-interface .view-assistant .help{font-size:9px;line-height:1.3;margin:6px 0 0}
@media(max-width:390px){.mobile-interface .view-assistant .assistant-quick-actions{grid-template-columns:1fr}.mobile-interface .view-assistant .assistant-quick-actions .btn:last-child{grid-column:auto}.mobile-interface .mobile-assistant-voice-settings{grid-template-columns:1fr}.mobile-interface .mobile-assistant-voice-settings .check-row{white-space:normal}}

/* ===== Mobile 1.5.8 — câmera alinhada, voz por turnos e assistente seguro ===== */
.mobile-interface .mobile-purchase-help-searchbar,.mobile-interface .mobile-assistant-commandbar{align-items:stretch!important}.mobile-interface .mobile-purchase-help-searchbar .search-icon,.mobile-interface .mobile-assistant-commandbar .search-icon{align-self:center!important}.mobile-interface .mobile-purchase-help-searchbar input,.mobile-interface .mobile-assistant-commandbar input{height:44px!important;min-height:44px!important;padding-right:10px!important}.mobile-interface .mobile-purchase-help-searchbar .mobile-scan-button,.mobile-interface .mobile-purchase-help-searchbar .mobile-voice-button,.mobile-interface .mobile-assistant-commandbar .mobile-scan-button,.mobile-interface .mobile-assistant-commandbar .mobile-assistant-voice-button{position:static!important;transform:none!important;top:auto!important;right:auto!important;height:44px!important;min-height:44px!important;margin:0!important;align-self:stretch!important;display:inline-flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;gap:5px!important;line-height:1!important;white-space:nowrap!important}.mobile-interface .mobile-purchase-help-searchbar .mobile-scan-button span,.mobile-interface .mobile-assistant-commandbar .mobile-scan-button span{display:inline-block!important;line-height:1!important}.mobile-interface .mobile-purchase-help-searchbar .mobile-scan-button span:first-child,.mobile-interface .mobile-assistant-commandbar .mobile-scan-button span:first-child{font-size:13px!important}.mobile-interface .view-assistant .assistant-capabilities{gap:4px;padding:6px;margin:5px 0}.mobile-interface .view-assistant .assistant-capabilities>strong{font-size:9px}.mobile-interface .view-assistant .assistant-capabilities button{padding:5px 7px;font-size:9px}.mobile-interface .view-assistant .assistant-product-change{padding:8px}.mobile-interface .view-assistant .assistant-change-summary{padding:7px}.mobile-interface .view-assistant .assistant-change-summary strong{font-size:11px}.mobile-interface .view-assistant .assistant-change-summary span{font-size:9px}

/* 1.5.8 refinamento: câmera e voz realmente alinhadas */
.mobile-interface .mobile-purchase-help-searchbar .mobile-scan-button,.mobile-interface .mobile-purchase-help-searchbar .mobile-voice-button,.mobile-interface .mobile-assistant-commandbar .mobile-scan-button,.mobile-interface .mobile-assistant-commandbar .mobile-assistant-voice-button{box-sizing:border-box!important;flex:0 0 74px!important;width:74px!important;min-width:74px!important;max-width:74px!important;padding:0 6px!important;font-size:10px!important;border-radius:9px!important}
.mobile-interface .mobile-purchase-help-searchbar .mobile-scan-button span,.mobile-interface .mobile-purchase-help-searchbar .mobile-voice-button span,.mobile-interface .mobile-assistant-commandbar .mobile-scan-button span,.mobile-interface .mobile-assistant-commandbar .mobile-assistant-voice-button span{display:inline-flex!important;align-items:center!important;line-height:1!important;margin:0!important}
.mobile-interface .view-assistant .assistant-price-choices{grid-template-columns:1fr 1fr;gap:5px}.mobile-interface .view-assistant .assistant-price-choices .btn{min-height:38px;padding:5px 7px;font-size:9px}
@media(max-width:390px){.mobile-interface .mobile-purchase-help-searchbar .mobile-scan-button,.mobile-interface .mobile-purchase-help-searchbar .mobile-voice-button,.mobile-interface .mobile-assistant-commandbar .mobile-scan-button,.mobile-interface .mobile-assistant-commandbar .mobile-assistant-voice-button{flex-basis:68px!important;width:68px!important;min-width:68px!important;max-width:68px!important;font-size:9px!important}.mobile-interface .view-assistant .assistant-price-choices{grid-template-columns:1fr}}

/* ===== Mobile 1.5.8 — voz por turnos e botão iniciar/parar ===== */
.mobile-interface .mobile-voice-button.is-listening,
.mobile-interface .mobile-assistant-voice-button.is-listening{
  background:#fff0ee!important;
  border-color:#d95b52!important;
  color:#8c2821!important;
  box-shadow:0 0 0 2px rgba(217,91,82,.08) inset;
}
.mobile-interface .mobile-voice-button.is-listening>span:first-child,
.mobile-interface .mobile-assistant-voice-button.is-listening>span:first-child{
  background:#b51f18!important;
}
.mobile-interface .purchase-help-voice-status[data-status-type="speaking"],
.mobile-interface .assistant-voice-status[data-status-type="speaking"]{
  background:#eef3ff;
  color:#2f4f83;
}

/* 1.5.16 neural */
.mobile-neural-voice-info{display:flex!important;flex-direction:column;gap:.2rem}.mobile-neural-voice-info span{font-size:.78rem;color:var(--muted,#64748b)}.mobile-assistant-voice-button{min-width:112px}.mobile-assistant-voice-button.is-listening span:last-child{font-weight:700}

/* 1.5.16 — histórico do Assistente rolável sem auto-scroll forçado */
.mobile-assistant-jump-latest{position:sticky;bottom:6px;z-index:4;margin:-38px 8px 8px auto;display:block;width:max-content;box-shadow:0 4px 14px rgba(0,0,0,.18)}
.mobile-assistant-jump-latest[hidden]{display:none!important}

/* 1.5.16 — Realtime neural UX */
.mobile-interface .view-assistant .assistant-neural-strip{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:center!important;gap:2px 7px!important;min-height:0!important;margin:0 0 5px!important;padding:6px 8px!important;border-radius:8px!important;font-size:9px!important;line-height:1.22!important}
.mobile-interface .view-assistant .assistant-neural-strip b{font-size:9px!important;line-height:1.2!important;white-space:normal!important}
.mobile-interface .view-assistant .assistant-neural-strip span{min-width:0!important;font-size:8.5px!important;line-height:1.25!important}
.mobile-interface .view-assistant .assistant-messages{scroll-behavior:auto!important;overscroll-behavior:contain;overflow-anchor:none;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.mobile-interface .mobile-neural-voice-settings{grid-template-columns:1fr!important;align-items:stretch!important}
.mobile-interface .mobile-neural-voice-settings small{display:block;font-size:8.5px;line-height:1.3;color:#65776d}

/* ===== COMPRA-1 — compactação física iPad ===== */
@media (min-width:700px) and (max-width:1024px) {
  .mobile-interface .mobile-purchase-modal .modal-body {
    background:#fff !important;
    padding:8px 10px calc(12px + env(safe-area-inset-bottom)) !important;
    scroll-padding-bottom:80px !important;
  }

  .mobile-interface .mobile-purchase-modal .purchase-layout {
    gap:5px !important;
  }

  .mobile-interface .mobile-purchase-modal .purchase-entry,
  .mobile-interface .mobile-purchase-modal .purchase-items,
  .mobile-interface .mobile-purchase-modal .purchase-summary {
    margin:0 !important;
    padding:7px 9px !important;
    border-radius:10px !important;
  }

  .mobile-interface .mobile-purchase-modal .purchase-entry h3,
  .mobile-interface .mobile-purchase-modal .purchase-items h3 {
    margin:0 0 4px !important;
  }

  .mobile-interface .mobile-purchase-modal .field,
  .mobile-interface .mobile-purchase-modal .form-field {
    margin-bottom:3px !important;
    gap:2px !important;
  }

  .mobile-interface .mobile-purchase-modal .purchase-head-compact,
  .mobile-interface .mobile-purchase-modal .purchase-item-line {
    gap:4px !important;
  }

  .mobile-interface .mobile-purchase-modal .purchase-items .section-head {
    gap:5px !important;
    margin:0 !important;
    min-height:0 !important;
  }

  .mobile-interface .mobile-purchase-modal .purchase-items > .section-head + * {
    min-height:0 !important;
    margin:0 !important;
    padding-top:6px !important;
    padding-bottom:6px !important;
  }

  .mobile-interface .mobile-purchase-modal .purchase-summary .help,
  .mobile-interface .mobile-purchase-modal .purchase-inline-validation,
  .mobile-interface .mobile-purchase-modal .purchase-finalize-hint {
    margin-top:3px !important;
    margin-bottom:0 !important;
  }

  .mobile-interface .mobile-purchase-modal .modal-actions {
    position:static !important;
    margin:4px 0 0 !important;
    padding:6px 0 0 !important;
    box-shadow:none !important;
    background:#fff !important;
  }
}


/* ===== RELATORIO-1 — meses clicaveis + revenda compacta iPad ===== */
.mobile-interface .report-month-column {
  cursor:pointer;
  border-radius:8px;
}
.mobile-interface .report-month-column.selected {
  box-shadow:inset 0 0 0 2px var(--mobile-green);
}
.mobile-interface .report-month-column:active {
  transform:translateY(1px);
}

@media (min-width:700px) and (max-width:1024px) {
  .mobile-interface .reseller-monthly-card {
    padding:10px !important;
  }

  .mobile-interface .reseller-monthly-card > .toolbar {
    margin:5px 0 7px !important;
    gap:6px !important;
    flex-wrap:nowrap !important;
  }

  .mobile-interface .reseller-monthly-card #report-reseller {
    min-height:36px !important;
  }

  .mobile-interface .reseller-report-stats {
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    gap:5px !important;
    margin:5px 0 7px !important;
  }

  .mobile-interface .reseller-report-stats .stat-card,
  .mobile-interface .reseller-report-stats > * {
    min-width:0 !important;
    padding:7px !important;
  }

  .mobile-interface .reseller-report-stats strong {
    font-size:14px !important;
  }

  .mobile-interface .reseller-report-stats small {
    font-size:8px !important;
    line-height:1.15 !important;
  }

  .mobile-interface .reseller-monthly-card .compact-line {
    padding:5px 2px !important;
  }

  .mobile-interface .reseller-monthly-card .report-total {
    margin-top:6px !important;
    padding:7px 2px !important;
    font-size:13px !important;
  }
}


/* 1.5.21 — iPad/Safari: evita camadas com backdrop-filter sobre controles fixos/sticky.
   A rotação não deve ser necessária para recalcular a área tocável. */
.mobile-interface.mobile-ios-touch-stable .topbar,
.mobile-interface.mobile-ios-touch-stable .bottom-nav,
.mobile-interface.mobile-ios-touch-stable .modal-head,
.mobile-interface.mobile-ios-touch-stable .modal-actions,
.mobile-interface.mobile-ios-touch-stable .mobile-global-processing {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* 1.5.33 v2 — Compra: teclado virtual estável sem disputar o viewport com o Safari.
   A correção usa um único scroller interno no modal em telefones e no iOS.
   Nenhum JS reposiciona VisualViewport/foco no iPad/iPhone. */
@media (max-width: 699px) {
  .mobile-interface .mobile-purchase-scroll-overlay {
    display: flex;
    align-items: flex-end;
    overflow: hidden;
  }
  .mobile-interface .mobile-purchase-scroll-overlay .mobile-purchase-modal {
    display: flex;
    flex-direction: column;
    height: min(94dvh, var(--mobile-vh));
    max-height: min(94dvh, var(--mobile-vh)) !important;
    overflow: hidden !important;
  }
  .mobile-interface .mobile-purchase-scroll-overlay .mobile-purchase-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scroll-padding-bottom: max(180px, 34dvh);
  }
}

html.mobile-ios-touch-stable .mobile-purchase-scroll-overlay {
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
html.mobile-ios-touch-stable .mobile-purchase-scroll-overlay .mobile-purchase-modal {
  display: flex;
  flex-direction: column;
  height: min(94dvh, var(--mobile-vh));
  max-height: min(94dvh, var(--mobile-vh)) !important;
  overflow: hidden !important;
}
html.mobile-ios-touch-stable .mobile-purchase-scroll-overlay .mobile-purchase-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scroll-padding-bottom: max(180px, 34dvh);
}

.mobile-interface .mobile-purchase-modal #purchase-real-total,
.mobile-interface .mobile-purchase-modal #purchase-freight {
  scroll-margin-top: 18px;
  scroll-margin-bottom: max(180px, 34dvh);
}
