/* Shared mobile design system. Screen rules preserve desktop and print layouts.
   Consolidated selectors retain cascade order; legacy KPI carousel removed. */
#esb-mobile-nav, #esb-mobile-tools, #esb-mobile-search, .esb-mobile-menu-head, #esb-mobile-menu-shade, #esb-mobile-public-menu, [data-mobile-close-new], .esb-mobile-back-list { display: none; }
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] { --sb-chrome-h: 0px; --sidebar-width: 0px; background: var(--bg,#f3f5f8); }
html body[data-auth-state="authenticated"]:not(.esb-mobile-menu-open) { height: auto !important; max-height: none !important; overflow: clip visible !important; }
html:root body[data-auth-state="authenticated"] main { min-height: 100dvh; margin: 0px !important; padding-top: 0px !important; padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important; width: 100% !important; height: auto !important; max-height: none !important; overflow: visible !important; }
html[data-esb-resume="1"] body[data-auth-state="authenticated"] aside.sidebar, html body[data-auth-state="authenticated"] aside.sidebar { display: none !important; }
html body[data-auth-state="authenticated"] header.topbar { position: sticky !important; top: 0px !important; z-index: 8000 !important; min-height: 56px !important; margin: 0px !important; padding: max(6px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left)) !important; gap: 0px !important; border-bottom: 1px solid var(--line) !important; background: var(--panel) !important; }
html body[data-auth-state="authenticated"] header.topbar > div:first-child { min-height: 44px; display: flex !important; flex-flow: row !important; gap: 8px !important; }
html body[data-auth-state="authenticated"] header.topbar :is(.esb-top-logo, #page-subtitle, #sb-module-forward) { display: none !important; }
html body[data-auth-state="authenticated"] header.topbar :is(h1, #page-title) { flex: 1 1 auto !important; font-size: 18px !important; line-height: 1.25 !important; white-space: nowrap !important; text-overflow: ellipsis !important; overflow: hidden !important; margin: 0px !important; }
html body[data-auth-state="authenticated"] header.topbar :is(#mobile-menu, #sb-module-back, #esb-mobile-tools, #esb-mobile-search) { align-items: center; justify-content: center; display: inline-flex !important; width: 44px !important; min-width: 44px !important; max-width: 44px !important; height: 44px !important; flex: 0 0 44px !important; border: 0px !important; border-radius: 12px !important; background: transparent !important; color: var(--ink) !important; padding: 10px !important; }
#esb-mobile-tools svg, #esb-mobile-search svg { width: 23px; height: 23px; }
html body[data-auth-state="authenticated"] header.topbar .top-actions { display: none !important; }
html body[data-auth-state="authenticated"].esb-mobile-tools-open header.topbar .top-actions { border-top: 1px solid var(--line); display: flex !important; flex-wrap: wrap !important; align-items: center !important; padding: 6px 0px !important; gap: 6px 12px !important; overflow: visible !important; }
html body[data-auth-state="authenticated"] header.topbar .top-actions > *, html body[data-auth-state="authenticated"] header.topbar .sb-search-wrap { min-width: 0px !important; max-width: 100% !important; }
html body[data-auth-state="authenticated"].esb-mobile-tools-open:not(.esb-mobile-search-open) header.topbar :is(#sb-search, .sb-search-wrap) { display: none !important; }
html body[data-auth-state="authenticated"].esb-mobile-search-open header.topbar .top-actions > :not(.sb-search-wrap):not(#sb-search) { display: none !important; }
html body[data-auth-state="authenticated"].esb-mobile-tools-open header.topbar .top-actions :is(.sb-privacy-bar, .theme-toggle, .avatar) { margin: 0px !important; }
html body[data-auth-state="authenticated"] header.topbar :is(.sb-search-wrap, #sb-search) { flex: 1 1 100% !important; width: 100% !important; }
html body[data-auth-state="authenticated"] header.topbar .sb-account-menu { position: fixed !important; top: 65px !important; right: 12px !important; max-width: calc(-24px + 100vw) !important; }
html body[data-auth-state="authenticated"] #app.content { overflow: visible !important; height: auto !important; max-height: none !important; min-height: 0px !important; }
html body[data-auth-state="authenticated"] #esb-mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(5, minmax(0px, 1fr)); left: 0px; right: 0px; bottom: 0px; z-index: 8100; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--panel,#fff); border-top: 1px solid var(--line,#d5dee8); box-shadow: rgba(0, 0, 0, 0.03) 0px -4px 20px; }
#esb-mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0px; min-height: 52px; border: 0px; background: transparent; color: var(--muted,#526579); font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.3; cursor: pointer; border-radius: 12px; }
#esb-mobile-nav button span { font-size: 11px; line-height: 1.3; font-weight: 600; }
#esb-mobile-nav svg { width: 23px; height: 23px; }
#esb-mobile-nav [aria-current="page"] { color: var(--ink,#0c2340); background: var(--books-hover,#eef3f8); }
#esb-mobile-nav [data-mobile-new] svg { background: var(--ink,#0c2340); color: var(--panel,#fff); box-sizing: content-box; border-radius: 12px; padding: 6px; margin-top: -7px; }
html body[data-auth-state="authenticated"] #global-menubar.authmenu-authorized-menu, html body[data-auth-state="authenticated"] #global-menubar { display: none !important; }
html body[data-auth-state="authenticated"].esb-mobile-menu-open { overflow: hidden !important; }
html body[data-auth-state="authenticated"].esb-mobile-menu-open #global-menubar { display: block !important; position: fixed !important; inset: max(12px,env(safe-area-inset-top)) 8px calc(76px + env(safe-area-inset-bottom)) !important; width: auto !important; min-width: 0px !important; height: auto !important; max-height: none !important; overflow: auto !important; padding: 0px 12px 16px !important; border: 1px solid var(--line) !important; border-radius: 20px !important; background: var(--panel) !important; z-index: 8300 !important; white-space: normal !important; }
html body #global-menubar .esb-mobile-menu-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0px; padding: 12px 0px; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--line); }
.esb-mobile-menu-head strong { font-size: 18px; }
.esb-mobile-menu-head button { min-height: 44px; border: 0px; background: transparent; color: var(--ink); font: inherit; padding: 8px 12px; }
html body #global-menubar .global-menu { display: block !important; width: 100% !important; }
html body[data-auth-state="authenticated"].esb-mobile-menu-open #global-menubar .global-menu-button { align-items: center; display: flex !important; width: 100% !important; min-height: 48px !important; padding: 12px !important; border-radius: 10px !important; font-size: 15px !important; }
html body #global-menubar .global-menu-popup :is(.menu-colpack, .menu-col, .menu-lead) { display: block !important; width: auto !important; min-width: 0px !important; }
html body #global-menubar .global-menu-item { min-height: 44px !important; white-space: normal !important; line-height: 1.35 !important; }
html body[data-auth-state="authenticated"].esb-mobile-menu-open #esb-mobile-menu-shade:not([hidden]) { display: block; position: fixed; inset: 0px; border: 0px; background: rgba(7, 24, 43, 0.5); z-index: 8200; }
html body[data-auth-state="authenticated"] #app.route-dashboard :is(.esb-dashboard-grid, .dash-board) { display: grid !important; grid-template-columns: minmax(0px, 1fr) !important; gap: 14px !important; align-items: start !important; }
html body[data-auth-state="authenticated"] #app.route-dashboard .esb-dash-card { height: auto !important; min-height: 0px !important; border-radius: 16px !important; overflow: visible !important; }
html body[data-auth-state="authenticated"] #app.route-dashboard .esb-dash-card-head { grid-template-columns: none !important; }
html body[data-auth-state="authenticated"] #app.route-dashboard .esb-dash-card-head h2 { font-size: 13px !important; line-height: 1.4 !important; letter-spacing: normal !important; white-space: normal !important; word-break: normal !important; max-width: none !important; }
html body #app.route-dashboard .esb-dash-card-body { height: auto !important; min-height: 0px !important; display: block !important; }
html body #app.route-dashboard :is(.esb-dash-big, .esb-hero-value) { overflow-wrap: anywhere; font-size: 26px !important; line-height: 1.25 !important; white-space: normal !important; }
html body #app.route-dashboard :is(.esb-dash-sub, .esb-age-legend, .esb-dash-empty) { font-size: 13px !important; line-height: 1.5 !important; }
html body #app.route-dashboard .esb-stat-grid { grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; }
html body #app.route-dashboard .esb-stat :is(small, b) { overflow-wrap: anywhere; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.4 !important; }
html body #app.route-dashboard :is(.esb-bank-row, .esb-rank) { grid-template-columns: minmax(0px, 1fr) auto !important; gap: 8px !important; min-height: 56px !important; }
html body #app.route-dashboard :is(.esb-bank-row, .esb-rank) :is(b, strong, small, span) { overflow-wrap: anywhere; white-space: normal !important; text-overflow: clip !important; }
html body #app.route-dashboard .esb-dashboard-actions { display: flex !important; }
html body #app.route-dashboard .esb-dash-period-field { flex: 1 1 150px !important; min-width: 0px !important; }
html body #app.route-dashboard .esb-dash-period-field > span { display: none !important; }
html body #app.route-dashboard .esb-dashboard-actions :is(.esb-dash-period, .esb-dash-period-btn) { width: 100% !important; min-width: 0px !important; max-width: 100% !important; }
html body #app.route-dashboard .esb-dashboard-actions .btn { flex: 0 1 auto !important; padding: 8px 12px !important; }
html body #app :is(.page-actions, .docform-actions, .sb-preview-toolbar) > div { display: flex; flex-wrap: wrap !important; gap: 8px !important; min-width: 0px !important; max-width: 100% !important; }
html body #app :is(.page-actions, .docform-actions, .sb-preview-toolbar) :is(button.btn, select) { width: auto !important; max-width: 100% !important; flex: 0 1 auto !important; margin: 0px !important; min-height: 44px !important; font-size: 13px !important; padding: 8px 12px !important; }
html body #app :is(.page-actions, .docform-actions, .sb-preview-toolbar) select { text-overflow: ellipsis; padding-right: 36px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar { display: flex !important; gap: 8px !important; padding: 0px !important; margin: 0px 0px 16px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar-right { flex: 1 1 100% !important; flex-wrap: wrap !important; width: 100% !important; min-width: 0px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar-right > .btn { width: auto !important; flex: 1 1 calc(33% - 8px) !important; min-width: 0px !important; margin: 0px !important; font-size: 13px !important; padding: 8px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar-right > .btn[hidden] { display: none !important; }
html body #app .esb-mobile-document-tools { flex: 1 1 auto; min-width: 0px; }
html body #app .esb-mobile-document-tools > summary { display: flex; align-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; background: var(--panel); cursor: pointer; list-style: none; }
html body #app .esb-mobile-document-tools > summary::after { content: "⌄"; margin-left: auto; padding-left: 12px; }
html body #app .esb-mobile-document-tool-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0px; }
html body #app .esb-mobile-document-tool-list > .btn { width: auto !important; flex: 1 1 40% !important; font-size: 13px !important; min-height: 44px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar-right:has(.esb-mobile-document-tools) { align-items: flex-start !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar-right .sb-bar-template { min-width: 0px !important; }
html body[data-auth-state="authenticated"] #app .sb-bar-template select { flex: 1 1 auto !important; min-width: 0px !important; width: auto !important; height: 44px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-paper { border-radius: 16px !important; min-width: 0px !important; }
html body[data-auth-state="authenticated"] #app :is(.sb-inv-sheet, .sb-inv-party, .sb-inv-meta, .sb-dc-narration) { display: grid !important; grid-template-columns: minmax(0px, 1fr) !important; gap: 12px !important; width: 100% !important; min-width: 0px !important; }
html body[data-auth-state="authenticated"] #app .sb-inv-party > .field { order: 0 !important; }
html body[data-auth-state="authenticated"] #app #sb-desc-slot { order: 1 !important; }
html body[data-auth-state="authenticated"] #app .sb-inv-meta > .field { width: 100% !important; min-width: 0px !important; }
html body[data-auth-state="authenticated"] #app .sb-inv-meta :is(input, select), html body[data-auth-state="authenticated"] #app .sb-inv-party select { width: 100% !important; min-width: 0px !important; max-width: 100% !important; min-height: 44px !important; box-sizing: border-box !important; }
html body #app .center-split { display: grid !important; grid-template-columns: minmax(0px, 1fr) !important; height: auto !important; max-height: none !important; }
html body #app :is(.center-list, .center-detail) { width: 100% !important; min-width: 0px !important; max-height: none !important; }
html body #app .center-list { max-height: 240px !important; overflow: auto !important; }
html body[data-auth-state="authenticated"] #app .center-center :is(.center-split, .center-list, .center-detail, .center-list-rows) { min-height: 0px !important; height: auto !important; max-height: none !important; }
html body[data-auth-state="authenticated"] #app .center-center .center-detail { display: none !important; }
html body[data-auth-state="authenticated"] #app .center-center.esb-mobile-detail-open .center-detail { display: block !important; }
html body[data-auth-state="authenticated"] #app .center-center.esb-mobile-detail-open .center-list { display: none !important; }
html body #app .esb-mobile-back-list { display: inline-flex !important; margin: 12px !important; min-height: 44px !important; }
html body #app .center-toolbar input.search { display: block !important; min-height: 44px !important; }


html body #app :is(.panel, .form-card) { border-radius: 14px !important; }
html body #app :is(.panel-head, .commercial-register-head, .sb-inv-head) { flex-wrap: wrap !important; gap: 10px !important; min-width: 0px !important; }
html body #app :is(.cards, .ex-summary, .dash-kpis, .dash-pulse) { grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; gap: 8px !important; }
html body #app :is(.metric, .ex-summary article) { min-width: 0px !important; height: auto !important; padding: 12px !important; }
html body #app :is(.metric strong, .metric small) { overflow-wrap: anywhere; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
html body[data-auth-state="authenticated"] #app .cards > .metric { display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: center !important; gap: 4px !important; }
html body[data-auth-state="authenticated"] #app .cards > .metric small { font-size: 11px !important; line-height: 1.4 !important; }
html body[data-auth-state="authenticated"] #app .cards > .metric strong { text-align: left !important; }
html body[data-auth-state="authenticated"] #app .cards > .metric em { font-size: 11px !important; line-height: 1.4 !important; }
html body #app :is(.sb-inv-page, .sb-inv-list-page) { padding-top: 0px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) { display: block !important; width: 100% !important; min-width: 0px !important; max-width: 100% !important; table-layout: auto !important; border: 0px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > :is(thead, colgroup) { display: none !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody { display: grid !important; width: 100% !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr { display: grid !important; grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; width: 100% !important; min-width: 0px !important; border: 1px solid var(--line) !important; background: var(--panel) !important; height: auto !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr > td { position: static !important; width: auto !important; min-width: 0px !important; max-width: none !important; height: auto !important; border: 0px !important; padding: 0px !important; white-space: normal !important; overflow-wrap: anywhere !important; text-align: left !important; box-shadow: none !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-record-table > tbody > tr > td.amount { text-align: left !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr > td::before { content: attr(data-mobile-label); display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr > td:is(.esb-mobile-wide-cell, .esb-mobile-cell-actions), html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-record-table > tbody > tr > td:first-child { grid-column: 1 / -1 !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr > td.esb-mobile-cell-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px !important; border-top: 1px solid var(--line) !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) :is(input, select, textarea, .sb-search-select) { width: 100% !important; min-width: 0px !important; max-width: 100% !important; box-sizing: border-box !important; min-height: 44px !important; font-size: 16px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) input:is([type="checkbox"], [type="radio"]) { width: 22px !important; min-height: 22px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) tr.esb-mobile-empty-row { grid-template-columns: minmax(0px, 1fr) !important; }
html body #modal-root .modal { border-radius: 20px !important; }
html body #modal-root .modal.sb-window { position: relative !important; inset: auto !important; transform: none !important; height: auto !important; min-height: 0px !important; max-height: calc(100dvh - 16px) !important; width: calc(-16px + 100vw) !important; margin: 0px !important; }
html body #modal-root .modal-backdrop { position: fixed !important; inset: 0px !important; padding: 8px !important; display: flex !important; align-items: center !important; justify-content: center !important; box-sizing: border-box !important; }
html body #modal-root .modal-head { padding: 12px 16px !important; min-height: 56px !important; }
html body #modal-root .modal-head h2 { font-size: 18px !important; }
html body #modal-root .add-new-modal .modal-head { display: flex !important; justify-content: space-between !important; align-items: center !important; }
html body #modal-root [data-mobile-close-new] { display: block; margin-left: auto; border: 0px; min-height: 44px; background: transparent; color: var(--ink); font: inherit; padding: 8px 12px; }
html body #esb-public .esb-bar { position: relative !important; }
html body #esb-public .esb-bar-inner { grid-template-columns: minmax(0px, 1fr) auto 36px !important; padding: 10px 12px !important; gap: 4px !important; }
#esb-mobile-public-menu { display: flex; align-items: center; justify-content: center; width: 36px; min-height: 44px; border: 0px; background: transparent; color: var(--ink,#0c2340); padding: 6px; grid-area: 1 / 3; }
#esb-mobile-public-menu svg { width: 22px; height: 22px; }
html body #esb-public .esb-nav { display: none !important; }
html body #esb-public .esb-mobile-public-menu-open .esb-nav { grid-area: 2 / 1 / auto / -1; padding-top: 8px; display: flex !important; flex-wrap: wrap !important; }
html body #esb-public .esb-mobile-public-menu-open .esb-nav a { min-height: 44px !important; padding: 10px !important; font-size: 14px !important; }
html body #esb-public .esb-nav-actions a { font-size: 12px !important; min-height: 40px !important; padding: 8px 10px !important; }
html body #esb-public .esb-brand { font-size: 17px !important; }
html body #esb-public .esb-kicker { font-size: 11px !important; line-height: 1.5 !important; letter-spacing: 0.08em !important; }
html body #esb-public .esb-login-page { padding: 0px !important; min-height: calc(100dvh - 64px) !important; background: var(--panel,#fff) !important; }
html body #esb-public .esb-login-showcase { display: none !important; }
html body #esb-public .esb-login-panel { width: 100% !important; min-width: 0px !important; box-shadow: none !important; border: 0px !important; }
html body #esb-public .esb-login-form { width: 100% !important; max-width: 420px !important; }
html body #esb-public .esb-login-form h1 { line-height: 1.2 !important; letter-spacing: -0.5px !important; }
html body #esb-public .esb-login-form input { height: 48px !important; min-height: 48px !important; font-size: 16px !important; }
html body #esb-public .esb-login-form button { min-height: 48px !important; font-size: 15px !important; }
html body[data-auth-state="authenticated"] #app :is(.cards, .ex-summary, .dash-kpis, .dash-pulse, .report-metrics, .sbpay-cost, .paycenter-ss-kpis) { scroll-snap-type: x; overscroll-behavior-x: contain; width: 100% !important; min-width: 0px !important; max-width: 100% !important; padding-bottom: 6px !important; }
html body[data-auth-state="authenticated"] #app :is(.cards, .ex-summary, .dash-kpis, .dash-pulse) > * { scroll-snap-align: start; min-width: 0px !important; }
html body[data-auth-state="authenticated"] #app :is(.page-actions, .commercial-tools, .listpage-actions, .so-order-actions, .center-actions, .esb-dashboard-actions) { overscroll-behavior-x: contain; display: flex !important; flex-wrap: nowrap !important; max-width: 100% !important; min-width: 0px !important; gap: 8px !important; overflow-x: auto !important; }
html body[data-auth-state="authenticated"] #app .page-actions > div { flex-wrap: nowrap !important; min-width: 0px !important; }
html body[data-auth-state="authenticated"] #app :is(.page-actions, .commercial-tools, .listpage-actions, .so-order-actions, .center-actions, .esb-dashboard-actions) .btn { width: auto !important; flex: 0 0 auto !important; white-space: nowrap !important; }
html body[data-auth-state="authenticated"] #app .page-actions > .search { flex: 1 0 150px !important; width: 150px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar { flex-wrap: nowrap !important; align-items: flex-start !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar > .sb-dc-cancel { flex: 0 0 auto !important; width: auto !important; padding: 8px 10px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar .sb-dc-bar-right { flex: 1 1 auto !important; width: auto !important; flex-wrap: nowrap !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar-right:has(.esb-mobile-document-tools) > #save-doc { flex: 0 0 70px !important; }
html body #app .esb-mobile-document-tools > summary { white-space: nowrap; padding: 10px 8px !important; font-size: 13px !important; }
html body #app .esb-mobile-document-tools[open] .esb-mobile-document-tool-list { position: absolute; left: 0px; right: 0px; top: 100%; z-index: 20; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: rgba(0, 0, 0, 0.133) 0px 8px 24px; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar { position: relative !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr > td.esb-mobile-cell-actions { flex-wrap: nowrap !important; overflow-x: auto !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) .esb-mobile-cell-actions button { flex: 0 0 auto !important; }
html body #app.route-dashboard .esb-dash-card { max-width: 100% !important; box-sizing: border-box !important; }
html body #app.route-dashboard .esb-dash-card-body * { min-width: 0px; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
html body #app.route-dashboard .esb-dash-card-body :is(div, p, span):not([class*="bar"]):not([class*="meter"]) { text-overflow: clip; }
html body #app.route-dashboard .esb-dash-card-body :is(.esb-dash-pair, .esb-dash-split, .esb-dash-row, [class*="-row"]):not(.esb-bank-row):not(.esb-rank) { flex-wrap: wrap !important; gap: 4px 12px !important; }
html body :is(#app, #modal-root) select { text-overflow: ellipsis; padding-right: 36px !important; }
html body :is(button, .btn, a, summary, select) { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
html { text-size-adjust: 100%; }
html body #esb-public .esb-login-form :is(.esb-session-note, small, [class*="note"]) { overflow-wrap: anywhere; padding-bottom: max(16px,env(safe-area-inset-bottom)); }
}
@media screen and (max-width: 768px) and (prefers-reduced-motion: reduce) {
html body * { scroll-behavior: auto !important; transition: none !important; animation: auto ease 0s 1 normal none running none !important; }
}
.esb-mobile-template-toggle { display: none; }
@media screen and (max-width: 768px) {
html body[data-auth-state] #sb-form-layer { width: calc(-16px + 100vw); max-width: calc(-16px + 100vw); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); margin: 8px; }
html body[data-auth-state] #sb-form-layer #sb-cust { min-height: 0px; overflow: hidden; padding: 8px; gap: 8px; }
html body[data-auth-state] #sb-form-layer .sb-cust-head { gap: 8px; padding: 0px; flex: 0 0 auto; }
html body[data-auth-state] #sb-form-layer .sb-cust-head > label:first-child { flex: 1 1 100%; min-width: 0px; }
html body[data-auth-state] #sb-form-layer #sb-cust-name { width: 100%; box-sizing: border-box; }
html body[data-auth-state] #sb-form-layer .esb-mobile-template-toggle { display: flex; gap: 8px; flex: 0 0 auto; }
html body[data-auth-state] #sb-form-layer .esb-mobile-template-toggle button { flex: 1 1 0%; }
html body[data-auth-state] #sb-form-layer .esb-mobile-template-toggle [aria-pressed="true"] { font-weight: 700; border-bottom: 3px solid rgb(22, 54, 92); }
html body[data-auth-state] #sb-form-layer #sb-cust-split { display: grid; grid-template-rows: minmax(0px, 1fr); min-height: 0px; overflow: hidden; flex: 1 1 auto; grid-template-columns: minmax(0px, 1fr) !important; }
html body[data-auth-state] #sb-form-layer #sb-cust-split :is(.sb-cust-edit, .sb-cust-view) { min-width: 0px; min-height: 0px; height: 100%; overflow: auto; box-sizing: border-box; padding: 8px; overscroll-behavior: contain; }
html body[data-auth-state] #sb-form-layer #sb-cust-split[data-mobile-template-view="edit"] .sb-cust-view, html body[data-auth-state] #sb-form-layer #sb-cust-split[data-mobile-template-view="preview"] .sb-cust-edit { display: none; }
html body[data-auth-state] #sb-form-layer #sb-cust-split .sb-cust-grip { display: none; }


html body[data-auth-state] #sb-form-layer :is(.sb-cust-edit, .sb-cust-head, .sb-form-win-foot, .esb-mobile-template-toggle) :is(button, input, select, textarea) { font-size: 16px; min-height: 44px; max-width: 100%; box-sizing: border-box; }
html body[data-auth-state] #sb-form-layer :is(.sb-cust-edit, .sb-cust-head) input:is([type="checkbox"], [type="radio"]) { width: 22px; min-width: 22px; height: 22px; min-height: 22px; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit :is(.sb-cust-line, .sb-cust-add) { display: flex; flex-wrap: wrap; gap: 8px; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-add input { width: 100%; min-width: 0px; }
html body[data-auth-state] #sb-form-layer .sb-form-win-foot { gap: 8px; padding: 8px; flex: 0 0 auto; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-table { display: block; width: 100%; min-width: 0px; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-table thead { display: none; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-table tbody { display: grid; gap: 12px; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-table tr { display: grid; grid-template-columns: repeat(2, minmax(0px, 1fr)); gap: 10px; padding: 10px; border: 1px solid rgb(203, 213, 225); border-radius: 10px; min-width: 0px; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-table td { display: block; min-width: 0px; width: auto; padding: 0px; border: 0px; white-space: normal; overflow-wrap: anywhere; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-table td::before { content: attr(data-mobile-label); display: block; font-size: 12px; line-height: 1.4; margin-bottom: 4px; color: rgb(71, 85, 105); }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-table td.esb-mobile-template-wide { grid-column: 1 / -1; }
html body[data-auth-state] #sb-form-layer .sb-cust-edit .sb-cust-table :is(input:not([type="checkbox"]), select) { width: 100%; min-width: 0px; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) :is(tr, td)[hidden] { display: none !important; }
html body #app .esb-mobile-document-tools[open] .esb-mobile-document-tool-list { max-height: 60dvh; overflow-y: auto; overscroll-behavior: contain; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-sortable-table > thead { margin-bottom: 8px; display: block !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-sortable-table > thead > tr { gap: 8px; overflow-x: auto; max-width: 100%; display: flex !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-sortable-table > thead > tr > th { display: block; flex: 0 0 auto; position: static !important; width: auto !important; min-width: 0px !important; max-width: none !important; padding: 0px !important; border: 0px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-sortable-table .sb-col-sort { min-height: 44px; font-size: 13px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; white-space: nowrap; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-sortable-table thead .sb-col-resizer { display: none; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state] #sb-form-layer #sb-cust-preview { height: calc(100% - 96px); min-height: 160px; overflow: auto; scrollbar-gutter: stable; box-sizing: border-box; }
}
.esb-mobile-action-icon, .esb-mobile-kpis { display: none; }
@media screen and (max-width: 768px) {
html body #app .sb-dc-bar { display: block !important; margin-bottom: 10px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar-right { display: flex !important; flex-direction: column !important; gap: 8px !important; align-items: stretch !important; }
html body #app .esb-mobile-document-actions { overscroll-behavior-x: contain; display: flex !important; flex-flow: row !important; gap: 6px !important; min-width: 0px !important; max-width: 100% !important; overflow-x: auto !important; padding: 2px 0px 6px !important; }
html body #app .esb-mobile-document-actions > :is(button, .sb-destructive-actions) { flex: 0 0 44px !important; width: 44px !important; min-width: 44px !important; max-width: 44px !important; margin: 0px !important; }
html body #app .esb-mobile-document-actions :is(button, summary) { display: inline-flex; align-items: center; justify-content: center; height: 44px !important; min-height: 44px !important; padding: 10px !important; }
html body #app .esb-mobile-document-actions [hidden] { display: none !important; }
html body #app .esb-mobile-document-actions .sb-destructive-popup { z-index: 8500; position: fixed !important; inset: 120px 16px auto auto !important; max-width: calc(-32px + 100vw) !important; }
html body #app .esb-mobile-document-actions .sb-destructive-popup button { width: auto !important; max-width: 100% !important; }
html body #app .esb-mobile-action-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; width: 22px; height: 22px; }
html body #app .esb-mobile-action-icon svg { width: 22px; height: 22px; }
html body #app button:has(> .esb-mobile-action-icon) { align-items: center; justify-content: center; gap: 6px; display: inline-flex !important; min-width: 44px !important; padding: 10px !important; flex-shrink: 0 !important; }
html body #app button:has(> .esb-mobile-action-icon) > .esb-mobile-action-text { display: none; }
html body #app button[hidden]:has(> .esb-mobile-action-icon) { display: none !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar-right .sb-bar-template { order: 1; align-items: center; flex: 0 0 auto !important; display: flex !important; gap: 6px !important; width: 100% !important; margin: 0px !important; }
html body #app .sb-bar-template select { flex: 1 1 0px !important; }
html body #app .sb-bar-template button { flex: 0 0 44px !important; }
html body[data-auth-state="authenticated"] #app .sb-inv-meta { grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; padding: 0px !important; }
html body[data-auth-state="authenticated"] #app .sb-inv-meta > .field { grid-column: auto !important; margin: 0px !important; }
html body #app .sb-inv-meta label { font-size: 12px !important; line-height: 1.35 !important; margin-bottom: 4px !important; }
html body #app .sb-inv-meta :is(input, select) { padding: 8px !important; }
html body[data-auth-state="authenticated"] #app :is(.sb-inv-sheet, .sb-inv-party) { gap: 8px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-narration { grid-template-columns: minmax(0px, 1fr) minmax(0px, 1fr) !important; gap: 10px !important; align-items: end !important; }
html body #app .sb-dc-narration .sb-switch-row { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; min-width: 0px !important; font-size: 12px !important; min-height: 44px !important; }
html body #app .sb-dc-address { min-height: 0px !important; padding: 4px 0px !important; margin: 0px !important; }
html body #app .sb-dc-address p { margin: 2px 0px !important; font-size: 12px !important; }
html body :is(#app, #modal-root) .form-grid { grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; }
html body :is(#app, #modal-root) .form-grid > .field { grid-column: auto !important; margin: 0px !important; }
html body :is(#app, #modal-root) .form-grid > .esb-mobile-long-field { grid-column: 1 / -1 !important; }
html body #app .so-order-window :is(.so-main-fields, .so-pricing-fields) { grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; gap: 10px !important; }
html body #app .sb-settings .field.sb-pref-row { align-items: center; grid-template-columns: minmax(0px, 1fr) minmax(0px, 1fr) !important; }
html body #app .sb-scan-row { display: flex !important; flex-wrap: nowrap !important; gap: 6px !important; }
html body #app .sb-scan-row input { flex: 1 1 100px !important; width: 100px !important; }
html body #app .sb-scan-row .btn { flex: 0 0 auto !important; font-size: 12px !important; padding: 8px !important; }
html body #modal-root :is(.add-new-grid, .dash-new-grid, .product-new-grid) { gap: 8px !important; }
html body #modal-root .add-new-card :is(p, small) { margin: 2px 0px !important; }
html body #global-menubar .global-menu.open .global-menu-popup .menu-col { display: block !important; }
html body #global-menubar .global-menu-item { font-size: 13px !important; padding: 8px !important; }
html body #global-menubar .global-menu-group-label { grid-column: 1 / -1; }
html body #app .esb-mobile-kpis { display: grid; grid-template-columns: repeat(2, minmax(0px, 1fr)); gap: 8px; width: 100%; max-width: 100%; overflow: visible; padding: 0px; margin-bottom: 8px; scroll-snap-type: none; }
html body #app .esb-mobile-kpis button { flex: 1 1 auto; min-width: 0px; max-width: none; width: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 76px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); text-align: left; font: inherit; scroll-snap-align: start; }
html body #app .esb-mobile-kpis small { line-height: 1.4; color: var(--muted); }
html body #app .esb-mobile-kpis strong { line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
html body[data-auth-state="authenticated"] #app.route-dashboard .esb-dash-card { scroll-margin-top: 70px; }
html body #app.route-dashboard .esb-stat-grid { display: flex !important; gap: 8px !important; max-width: 100% !important; overflow-x: auto !important; }
html body #app.route-dashboard .esb-stat { flex: 0 0 auto !important; min-width: 116px !important; max-width: 240px !important; padding: 8px 10px !important; }
html body #app.route-dashboard .esb-stat :is(b, small) { white-space: nowrap !important; overflow: visible !important; text-overflow: clip !important; }
html body #app.route-dashboard :is(.esb-pnl-row, .esb-rank, .esb-bank-row) { min-height: 44px !important; padding: 8px 0px !important; }
html body #app.route-dashboard .esb-dashboard-actions { overflow: visible !important; }
html body #esb-public .esb-login-panel { padding: 18px 16px !important; }
html body #esb-public .esb-login-form h1 { font-size: 24px !important; }
html body #esb-public .esb-login-form :is(.esb-field, .field) { margin-bottom: 12px !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] #app .sb-inv-meta > .field { align-self: stretch !important; display: flex !important; flex-direction: column !important; justify-content: flex-end !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] :is(#app, #modal-root) .form-grid { display: grid !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) .form-grid > .field { width: auto !important; max-width: 100% !important; align-self: stretch !important; }
html body #app .sb-report-actions { display: flex !important; flex-flow: row !important; max-width: 100% !important; overflow-x: auto !important; }
html body #app .sb-report-actions button { flex: 0 0 auto !important; min-width: 44px !important; white-space: nowrap !important; }
html body #app .sb-report-result > .panel-head { display: block !important; }
html body #app .sb-report-period-bar { display: grid !important; grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; }
html body #app .sb-report-period-bar :is(label, input, select) { min-width: 0px !important; width: 100% !important; max-width: 100% !important; }
html body #app .sb-report-period-bar input[type="checkbox"] { width: 20px !important; min-width: 20px !important; }
html body #app .sb-report-period-bar :is(.sb-fin-tools, .sb-check) { grid-column: 1 / -1; }


html body #app .sb-report-toolbar-actions { display: flex !important; gap: 8px !important; }
html body #app .sb-report-toolbar-actions .search { flex: 1 1 0px !important; min-width: 0px !important; width: 100px !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"].esb-mobile-menu-open #global-menubar .global-menu { min-width: 0px !important; max-width: 100% !important; width: 100% !important; }
html body #global-menubar .global-menu-popup .global-menu-subheading { grid-column: 1 / -1; }
}
.esb-mobile-kpi-arrow { display: none; }
@media screen and (max-width: 768px) {
html body #app :is(.panel, .form-card) { margin-bottom: 8px !important; }
html body #app :is(.panel-head, .commercial-register-head, .commercial-section-head) { padding: 8px 10px !important; gap: 6px !important; }
html body #app :is(.panel-head, .form-card, .page-actions) :is(h2, h3, p) { margin-top: 0px !important; margin-bottom: 4px !important; }
html body #app :is(.page-actions, .docform-actions, .sb-preview-toolbar) { margin: 0px 0px 8px !important; gap: 6px !important; }
html body :is(#app, #modal-root) .form-grid { gap: 8px !important; align-content: start !important; grid-auto-rows: auto !important; }
html body :is(#app, #modal-root) .field { min-height: 0px !important; }
html body :is(#app, #modal-root) .field > label { font-size: 12px !important; line-height: 1.35 !important; margin: 0px 0px 3px !important; letter-spacing: 0px !important; }
html body :is(#app, #modal-root) .field :is(input:not([type="checkbox"]):not([type="radio"]), select) { min-height: 44px !important; box-sizing: border-box !important; }
html body :is(#app, #modal-root) .field textarea { height: 64px; min-height: 64px !important; }
html body #app .esb-mobile-kpi-arrow svg { width: 20px; height: 20px; }
html body #app .esb-mobile-kpi-arrow:disabled { opacity: 0.4; cursor: default; }
html body #app .esb-mobile-kpis button { gap: 3px; padding: 8px 10px; min-height: 68px !important; }
html body #app .esb-mobile-kpis small { font-size: 11px; }
html body #app .esb-mobile-kpis strong { font-size: 17px; }
html body #app .cards > .metric { min-height: 68px !important; padding: 8px 10px !important; gap: 2px !important; }
html body[data-auth-state="authenticated"] #app.route-dashboard .esb-dashboard-grid { gap: 8px !important; }
html body[data-auth-state="authenticated"] #app.route-dashboard .esb-dash-card { padding: 10px !important; margin: 0px !important; }
html body #app.route-dashboard .esb-dash-card-head { margin: 0px 0px 4px !important; }
html body #app.route-dashboard .esb-dash-card-head h2 { margin: 0px !important; }
html body #app.route-dashboard .esb-dash-sub { margin: 3px 0px 6px !important; line-height: 1.35 !important; font-size: 12px !important; }
html body #app.route-dashboard .esb-dash-empty { min-height: 0px !important; padding: 4px 0px !important; font-size: 12px !important; }
html body #app.route-dashboard :is(.esb-rank-list, .esb-bank-list, .esb-pnl-chart) { margin: 6px 0px !important; gap: 4px !important; }
html body #app.route-dashboard :is(.esb-rank, .esb-bank-row, .esb-pnl-row) { padding: 4px 0px !important; min-height: 44px !important; }
html body #app.route-dashboard .esb-pnl-label span { align-items: center; justify-content: space-between; gap: 8px; display: flex !important; }
html body #app.route-dashboard .esb-pnl-track { height: 5px !important; margin: 3px 0px !important; }
html body #app.route-dashboard .esb-dash-card-foot { margin: 4px 0px 0px !important; padding: 0px !important; }
html body #app.route-dashboard .esb-dash-link { align-items: center; display: inline-flex !important; min-height: 44px !important; padding: 4px 0px !important; }
html body #app.route-dashboard .esb-age-legend { gap: 4px 8px !important; margin: 4px 0px !important; font-size: 11px !important; }
html body #app.route-dashboard .esb-age-bar { height: 6px !important; margin: 6px 0px !important; }
html body #app.route-dashboard .esb-inv-paid { align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0px !important; padding: 4px 0px !important; min-height: 44px !important; display: flex !important; }
html body #app.route-dashboard .esb-inv-paid b { font-size: 16px !important; }
html body #app.route-dashboard .esb-inv-paid-bar { margin: 0px !important; height: 4px !important; }
html body #app.route-dashboard .esb-health-pill { margin: 4px 0px !important; padding: 4px 8px !important; }
html body #app.route-dashboard .esb-dashboard-actions { margin: 0px !important; gap: 6px !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-paper { padding: 10px !important; }
html body[data-auth-state="authenticated"] #app .sb-inv-sheet { margin: 0px !important; }
html body[data-auth-state="authenticated"] #app .sb-inv-meta { gap: 6px 8px !important; margin: 6px 0px !important; }
html body #app .sb-dc-lines { margin-top: 8px !important; }
html body #app .esb-mobile-details { grid-column: 1 / -1; min-width: 0px; width: 100%; border-top: 1px solid var(--line); }
html body #app .esb-mobile-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 4px 0px; box-sizing: border-box; font-size: 13px; font-weight: 600; color: var(--ink); list-style: none; cursor: pointer; }
html body #app .esb-mobile-details > summary::-webkit-details-marker { display: none; }
html body #app .esb-mobile-details > summary::after { content: "+"; font-size: 20px; padding: 0px 8px; }
html body #app .esb-mobile-details[open] > summary::after { content: "−"; }
html body #app .esb-mobile-detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0px, 1fr)); gap: 8px; padding: 4px 0px 8px; }
html body #app .esb-mobile-detail-fields > .field { flex-direction: column; justify-content: flex-end; width: auto !important; min-width: 0px !important; display: flex !important; margin: 0px !important; }
html body #app .esb-mobile-detail-fields > #sb-desc-slot { grid-column: 1 / -1; order: 10 !important; }
html body #app .esb-mobile-detail-fields .sb-dc-narration { margin: 0px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody { gap: 8px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr { padding: 8px !important; gap: 6px 8px !important; border-radius: 10px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-record-table > tbody > tr > td:first-child { grid-column: auto !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-record-table > tbody > tr > td.esb-mobile-wide-cell { grid-column: 1 / -1 !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-record-table > tbody > tr > td.esb-mobile-blank-cell { display: none !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.col-sr { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 12px; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.col-sr::before { margin: 0px; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr > td::before { margin-bottom: 2px; line-height: 1.25; }
html body[data-auth-state="authenticated"] #app .sb-dc-lines .table-wrap:has(> .esb-mobile-entry-table) { padding: 0px !important; border: 0px !important; }
html body #app .sb-dc-bottom { gap: 8px !important; margin-top: 8px !important; }
html body #app .sb-settings :is(.sb-pref-card, .cap-section) { margin-bottom: 8px !important; min-height: 0px !important; }
html body #app .sb-settings :is(.sb-pref-head, .cap-section > h3) { padding: 8px 10px !important; min-height: 0px !important; font-size: 14px !important; margin: 0px !important; }
html body #app .sb-settings .sb-pref-body { display: grid !important; grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; }
html body #app .sb-settings .sb-pref-body > .field { margin: 0px !important; min-width: 0px !important; }
html body #app .sb-settings .sb-pref-body > .field:has(textarea), html body #app .sb-settings .sb-pref-body > .field:only-child { grid-column: 1 / -1 !important; }
html body[data-auth-state="authenticated"] #app .sb-settings .form-grid > .field.sb-pref-row { grid-column: 1 / -1 !important; grid-template-columns: minmax(0px, 1fr) minmax(0px, 1.2fr) !important; padding: 8px 10px !important; gap: 8px !important; }
html body #app .sb-settings .sb-pref-row > small { margin: 0px !important; }
html body #app .sb-settings :is(.sb-settings-title, .sb-settings-lede) { margin: 0px 0px 8px !important; }
html body #app .sb-settings .sb-settings-title { font-size: 18px !important; }
html body #app .sb-settings .sb-settings-main { padding: 10px !important; }
html body #app .sb-settings .check-grid label.sb-pref-row { min-height: 44px; padding: 8px 10px !important; gap: 8px !important; grid-template-columns: minmax(0px, 1fr) auto !important; }
html body #app .sb-settings .sb-pref-row > .sb-search-select { min-width: 0px; }
html body #app .sb-settings .sb-pref-row > .sb-row-label { grid-area: 1 / 1; }
html body #app .sb-report-result > .panel-head { padding: 8px 10px !important; }
html body #app .sb-report-result .sb-report-identity { margin: 4px 0px !important; }
html body #app .sb-report-identity h2 { font-size: 17px !important; margin: 2px 0px !important; }
html body #app .sb-report-actions { gap: 4px !important; }
html body #app .sb-report-period-bar { align-items: end; padding: 8px 10px !important; gap: 6px 8px !important; }
html body #app .sb-report-period-bar > .sb-period-inline { margin: 0px !important; gap: 2px !important; }
html body #app .sb-report-period-bar > .sb-period-inline:has(#sb-report-period) { order: 0; }
html body #app #sb-report-apply-period { order: 1; margin: 0px !important; height: 44px !important; }
html body #app :is(#sb-from-field, #sb-to-field) { order: 2; }
html body #app .sb-report-period-bar > .esb-mobile-details { order: 3; }
html body #app .sb-report-period-bar .esb-mobile-detail-fields > .sb-fin-tools { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
html body #app .sb-report-period-bar [hidden] { display: none !important; }
html body #app .sb-report-toolbar { gap: 6px !important; margin-bottom: 8px !important; }
html body #app .sb-report-list-head { padding: 8px 0px !important; margin: 0px !important; }
html body #app .sb-report-group { margin-bottom: 8px !important; }
}
.esb-mobile-line-toggle { display: none; }
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.col-sr { order: 0; align-self: center; grid-column: auto !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.col-item_code { order: 1; grid-column: auto !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.esb-mobile-wide-cell { order: 2; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.col-quantity { order: 3; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.col-rate { order: 4; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.col-line_total { order: 5; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr > td.esb-mobile-cell-actions { order: 6; align-self: end; grid-column: auto !important; padding: 0px !important; border: 0px !important; }
html body #app button.esb-mobile-line-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-family: inherit; font-size: 12px; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr:has(.esb-mobile-line-toggle) > td.esb-mobile-line-extra { order: 8; display: none !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr.esb-mobile-line-expanded:has(.esb-mobile-line-toggle) > td.esb-mobile-line-extra { display: block !important; }
}
.esb-mobile-widget-toggle { display: none; }
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] #app.route-dashboard .esb-dash-card-head { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 8px !important; margin: 0px !important; }
html body #app .esb-mobile-widget-toggle { align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 10px; border: 0px; background: transparent; color: var(--ink); display: inline-flex !important; }
html body #app .esb-mobile-widget-toggle svg { width: 20px; height: 20px; }
html body #app .esb-mobile-widget-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
html body #app .esb-mobile-widget-collapsed > .esb-dash-card-head { margin: 0px !important; }
html body #app.route-dashboard .esb-mobile-widget-collapsed > :is(.esb-dash-card-body, .esb-dash-card-foot) { display: none !important; }
html body #app .sb-settings-nav { padding: 0px !important; }
html body #app .sb-settings .sb-settings-lede { font-size: 12px !important; line-height: 1.35 !important; }
html body #app .sb-settings .sb-pref-card:has(> .sb-pref-body > .field:only-child) > .sb-pref-head { display: none; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] #app .sb-inv-meta > .field[hidden], html body #app .esb-mobile-detail-fields > [hidden] { display: none !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-entry-table > tbody > tr.esb-mobile-line-expanded:has(.esb-mobile-line-toggle) > td[hidden] { display: none !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] #app .panel-head .btn { height: auto !important; min-height: 44px !important; padding: 8px !important; font-size: 13px !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] { --muted: #475569; --books-muted: #475569; font-size: 16px; line-height: 1.5; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root, #sb-form-layer) { font-size: 16px; line-height: 1.5; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root, #sb-form-layer) :is(p, td, li, .sb-row-label) { font-size: 16px !important; line-height: 1.5 !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root, #sb-form-layer) :is(small, label, th, .side-note, .muted, .panel-subtitle, .sb-settings-lede, .sb-billing-assurance) { font-size: 14px !important; line-height: 1.5 !important; letter-spacing: normal !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root, #sb-form-layer) .field > label { color: var(--ink,#102b46); font-weight: 600; font-size: 14px !important; line-height: 1.5 !important; margin-bottom: 6px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root, #sb-form-layer) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea, .sb-search-select) { color: var(--ink,#102b46); font-size: 16px !important; line-height: 1.5 !important; min-height: 48px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root, #sb-form-layer) :is(input, textarea)::placeholder { color: var(--muted,#475569); opacity: 1; }

html body[data-auth-state="authenticated"] #global-menubar :is(.global-menu-button, .global-menu-item) { font-size: 16px !important; line-height: 1.5 !important; min-height: 48px !important; }
html body[data-auth-state="authenticated"] #esb-mobile-nav button span { font-size: 13px; line-height: 1.4; }
html body[data-auth-state="authenticated"] #app.content { padding: 12px 12px 24px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) .form-grid { gap: 14px !important; }
html body #app.route-dashboard .esb-dash-card-head h2 { font-size: 16px !important; line-height: 1.4 !important; letter-spacing: normal !important; }
html body #app.route-dashboard :is(.esb-dash-sub, .esb-dash-empty, .esb-age-legend) { font-size: 14px !important; line-height: 1.5 !important; color: var(--muted) !important; }
html body #app.route-dashboard .esb-dash-big { font-size: 28px !important; line-height: 1.3 !important; }
html body #app.route-dashboard .esb-stat-grid .esb-stat b { font-size: 19px !important; line-height: 1.4 !important; }
html body #app :is(.cards > .metric, .esb-mobile-kpis) :is(small, em) { font-size: 14px !important; line-height: 1.5 !important; }
html body #app :is(.cards > .metric, .esb-mobile-kpis) strong { font-size: 20px !important; line-height: 1.4 !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table:is(.esb-mobile-record-table, .esb-mobile-entry-table) > tbody > tr > td::before { font-size: 14px !important; line-height: 1.5 !important; }
html body #app .sb-settings .sb-pref-body { gap: 14px !important; padding: 12px !important; }
html body #app .sb-settings .form-grid > .field.sb-pref-row { grid-template-columns: minmax(0px, 1fr) !important; gap: 8px !important; }
html body #app .sb-settings .sb-pref-row > .sb-search-select { grid-column: auto; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root, #sb-form-layer) :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--ink,#102b46) !important; outline-offset: 3px !important; }
html body #esb-public .esb-login-form :is(p, label) { font-size: 16px !important; line-height: 1.5 !important; }
html body #modal-root .add-new-card :is(p, small) { font-size: 14px !important; line-height: 1.5 !important; }
}
@media screen and (max-width: 480px) {
html body #app .sb-settings .sb-pref-body { grid-template-columns: minmax(0px, 1fr) !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] #app :is(.cards, .ex-summary, .dash-kpis, .dash-pulse, .report-metrics, .sbpay-cost, .paycenter-ss-kpis) { display: grid !important; grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; grid-auto-flow: row !important; grid-auto-columns: auto !important; overflow: visible !important; gap: 12px !important; }
html body[data-auth-state="authenticated"] #app .cards > .metric strong { line-height: 1.4 !important; }
html body[data-auth-state="authenticated"] #app :is(.page-actions, .commercial-tools, .listpage-actions, .so-order-actions, .esb-dashboard-actions), html body[data-auth-state="authenticated"] #app .page-actions > div { flex-wrap: wrap !important; overflow: visible !important; }
html body[data-auth-state="authenticated"] #app .sb-dc-bar, html body[data-auth-state="authenticated"] #app .sb-dc-bar .sb-dc-bar-right { flex-wrap: wrap !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] #app .esb-mobile-document-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0px, 1fr)) !important; overflow: visible !important; gap: 8px !important; width: 100% !important; }
html body[data-auth-state="authenticated"] #app .esb-mobile-document-actions > :is(button, .sb-destructive-actions) { width: 100% !important; min-width: 0px !important; max-width: none !important; }
html body[data-auth-state="authenticated"] #app .esb-mobile-document-actions :is(button, summary) { height: auto !important; min-height: 48px !important; padding: 8px !important; }
html body[data-auth-state="authenticated"] #app button:has(> .esb-mobile-action-icon) { flex-wrap: wrap !important; gap: 6px !important; }
html body[data-auth-state="authenticated"] #app button:has(> .esb-mobile-action-icon) > .esb-mobile-action-text { display: inline !important; font-size: 14px !important; line-height: 1.4 !important; white-space: normal !important; }
html body[data-auth-state="authenticated"] #app .esb-mobile-document-actions .sb-destructive-popup button { width: 100% !important; max-width: 100% !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] :is(#app, #modal-root) .form-grid { grid-template-columns: minmax(0px, 1fr) !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) .form-grid > .field { min-width: 0px !important; grid-column: auto !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] #app .center-party b { font-size: 16px !important; line-height: 1.5 !important; }
html body[data-auth-state="authenticated"] #app .center-party :is(span, small), html body[data-auth-state="authenticated"] #app .center-kpis span, html body[data-auth-state="authenticated"] #app .sb-inv-meta label { font-size: 14px !important; line-height: 1.5 !important; }
}
@media screen and (max-width: 768px) {
html body[data-auth-state="authenticated"] #global-menubar .global-menu-popup :is(.menu-colpack, .menu-col, .menu-lead) { display: block !important; grid-template-columns: 1fr !important; columns: auto !important; float: none !important; width: 100% !important; min-width: 0px !important; max-width: 100% !important; padding: 0px !important; box-sizing: border-box !important; }
html body[data-auth-state="authenticated"] #global-menubar .global-menu-popup .global-menu-item { display: flex !important; align-items: center !important; gap: 12px !important; width: 100% !important; max-width: 100% !important; min-width: 0px !important; padding: 12px !important; box-sizing: border-box !important; text-align: left !important; white-space: normal !important; }
html body #global-menubar .global-menu-item svg { flex: 0 0 22px !important; width: 22px !important; height: 22px !important; }
html body #global-menubar .global-menu-item > span { min-width: 0px !important; white-space: normal !important; overflow-wrap: break-word !important; }
html body #modal-root :is(.add-new-grid, .dash-new-grid, .product-new-grid) { grid-template-columns: minmax(0px, 1fr) !important; }
html body #modal-root .add-new-card { display: grid !important; grid-template-columns: 24px minmax(0px, 1fr) !important; align-items: start !important; gap: 4px 12px !important; text-align: left !important; min-height: 0px !important; padding: 14px !important; }
html body #modal-root .add-new-card > svg { grid-row: 1 / 3; width: 24px !important; height: 24px !important; }
html body #modal-root .add-new-card > :not(svg) { grid-column: 2 !important; }
html body #modal-root .add-new-card :is(strong, b) { font-size: 16px !important; line-height: 1.4 !important; }
html body #modal-root .add-new-card :is(p, small, span:not([class])) { font-size: 14px !important; line-height: 1.45 !important; }
html body[data-auth-state="authenticated"] #app :is(.cards, .ex-summary, .dash-kpis, .dash-pulse) { grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; gap: 10px !important; margin-bottom: 14px !important; }
html body[data-auth-state="authenticated"] #app .cards > .metric { padding: 14px !important; min-height: 100px !important; border-radius: 14px !important; }
html body[data-auth-state="authenticated"] #app .cards > .metric :is(small, em) { font-size: 12px !important; line-height: 1.4 !important; }
html body[data-auth-state="authenticated"] #app .cards > .metric strong { font-variant-numeric: tabular-nums; font-size: 20px !important; overflow-wrap: anywhere !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-record-table > tbody > tr { gap: 10px 14px !important; padding: 14px !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-record-table > tbody > tr > td { background: transparent !important; font-size: 14px !important; line-height: 1.45 !important; }
html body[data-auth-state="authenticated"] :is(#app, #modal-root) table.esb-mobile-record-table > tbody > tr > td::before { font-size: 12px !important; margin-bottom: 3px !important; }
html body[data-auth-state="authenticated"] #app .sb-settings { display: flex !important; flex-direction: column !important; height: auto !important; max-height: none !important; overflow: visible !important; border: 0px !important; background: transparent !important; gap: 12px !important; }
html body[data-auth-state="authenticated"] #app .sb-settings-nav { display: flex !important; flex-wrap: nowrap !important; gap: 6px !important; overflow-x: auto !important; border: 0px !important; background: var(--panel) !important; padding: 6px !important; border-radius: 14px !important; }
html body[data-auth-state="authenticated"] #app .sb-settings-nav button { width: auto !important; flex: 0 0 auto !important; border: 0px !important; border-radius: 10px !important; padding: 10px 14px !important; color: var(--ink) !important; }
html body[data-auth-state="authenticated"] #app .sb-settings-nav button.active { box-shadow: rgb(8, 127, 133) 0px -3px inset; background: var(--books-hover,#edf3f8) !important; }
html body[data-auth-state="authenticated"] #app .sb-settings-main { overflow: visible !important; padding: 0px !important; background: transparent !important; }
html body #app .esb-settings-hero { margin-bottom: 12px; border-right-color: ; border-right-style: ; border-right-width: ; border-bottom-color: ; border-bottom-style: ; border-bottom-width: ; border-left-color: ; border-left-style: ; border-left-width: ; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: ; border-radius: 16px; background: var(--panel); border-top: 3px solid rgb(8, 127, 133); padding: 16px !important; }
html body #app .esb-settings-hero .sb-settings-title { font-size: 23px !important; line-height: 1.25 !important; color: var(--ink) !important; margin: 0px 0px 8px !important; }
html body #app .esb-settings-hero .sb-settings-lede { margin: 0px !important; font-size: 14px !important; line-height: 1.6 !important; color: var(--muted) !important; }
html body #app .sb-settings .sb-pref-card { border-radius: 14px !important; margin-bottom: 14px !important; }
html body #app .sb-settings .sb-pref-row > .sb-row-label { grid-area: auto !important; }
html body #app :is(.panel-head, .commercial-register-head, .fs-card header) :is(h2, h3) { min-width: 0px; max-width: 100%; overflow-wrap: anywhere; line-height: 1.35; }
html body #app :is(.sbpay, .sb-emp-center, .center-center, .commercial-register, .sb-inv-list-page) { min-width: 0px; max-width: 100%; }
html body #app :is(.panel-head, .commercial-register-head) { padding: 14px !important; }
html body #app :is(.fs-card, .esb-dash-card) { margin-bottom: 12px !important; }
html body #app .fs-card h2 { font-size: 18px !important; }
html body #app .fs-filters { display: grid !important; grid-template-columns: repeat(2, minmax(0px, 1fr)) !important; gap: 10px !important; }
html body #app .fs-filters .field { min-width: 0px !important; }
html body #app .fs-filters .btn { width: 100% !important; min-width: 0px !important; font-size: 14px !important; padding: 10px !important; }
.esb-time-backdrop { position: fixed; inset: 0px; z-index: 30000; background: rgba(7, 24, 43, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
dialog.esb-time-backdrop { margin: 0; border: 0; width: 100%; height: 100%; max-width: none; max-height: none; color: inherit; }
dialog.esb-time-backdrop::backdrop { background: transparent; }
.esb-time-dialog { width: 100%; max-width: 400px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel,#fff); color: var(--ink,#102b46); padding: 20px; border-radius: 20px; box-sizing: border-box; box-shadow: rgba(0, 0, 0, 0.2) 0px 16px 48px; }
.esb-time-dialog h2 { font-size: 22px; margin: 0px 0px 8px; }
.esb-time-dialog p { font-size: 14px; color: var(--muted,#475569); margin: 0px 0px 20px; }
.esb-time-fields { display: grid; grid-template-columns: minmax(0px, 1fr) auto minmax(0px, 1fr); gap: 10px; align-items: end; }
.esb-time-fields label { display: grid; gap: 6px; font-size: 14px; min-width: 0px; }
.esb-time-fields select { width: 100%; min-width: 0px; min-height: 52px; font: 600 22px system-ui; border: 1px solid var(--line,#cbd5e1); border-radius: 10px; background: var(--panel,#fff); color: inherit; padding: 8px; }
.esb-time-fields > span { padding-bottom: 12px; font-size: 24px; }
.esb-time-dialog footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.esb-time-dialog button { min-height: 48px; padding: 10px 14px; border: 1px solid var(--line,#cbd5e1); border-radius: 10px; font: 600 14px system-ui; color: inherit; background: var(--panel,#fff); }
.esb-time-dialog button.primary { background: rgb(8, 127, 133); color: rgb(255, 255, 255); border-color: rgb(8, 127, 133); }
[data-esb-mobile-time] { cursor: pointer; }
}
@media print {
.esb-mobile-page-hero, .esb-time-backdrop { display: none !important; }
}
@media screen and (max-width: 768px) {
html body #global-menubar .esb-mobile-menu-head { position: relative !important; top: auto !important; }
html body #global-menubar .esb-mobile-menu-logo { object-fit: contain; flex: 0 0 28px; width: 28px !important; height: 28px !important; }
}
@media screen and (max-width:768px) {
html body[data-auth-state="authenticated"].esb-mobile-menu-open #global-menubar .global-menu.open>.global-menu-popup,
html body[data-auth-state="authenticated"].esb-mobile-menu-open #global-menubar .global-menu.open.has-menu-cols>.global-menu-popup {display:block!important;grid-template-columns:minmax(0,1fr)!important;columns:auto!important;}
}

/* ===== Phone hero system — 26 Oct 2026 =====
   Each page: module, title, what the page is for, and its main action in one compact hero.
   Summary figures in two columns, button rows swipeable, lists readable, previews fitted to the screen. */
@media screen and (max-width: 768px) {
  html body #app .esb-hero-mirrored { display: none !important; }

  /* Summary figures: two compact columns with readable labels. */
  html body #app :is(.commercial-register-summary, .cards.dashboard-kpis, .cards.esb-kpis) { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; height: auto !important; }
  html body #app :is(.commercial-register-summary > .commercial-summary-card, .cards.dashboard-kpis > .metric, .cards.esb-kpis > .metric) { min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 10px 12px !important; border-radius: 12px !important; }
  html body #app :is(.commercial-summary-card, .dashboard-kpis .metric, .esb-kpis .metric) :is(span, small, em, p, label) { font-size: 12px !important; line-height: 1.35 !important; }
  html body #app :is(.commercial-summary-card, .dashboard-kpis .metric, .esb-kpis .metric) :is(b, strong, h3, .metric-value) { font-size: 18px !important; line-height: 1.2 !important; }

  /* Rows of buttons: one swipeable row. */
  html body #app .esb-chip-row { display: flex !important; flex-wrap: nowrap !important; gap: 8px !important; overflow-x: auto !important; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; height: auto !important; grid-template-columns: none !important; }
  html body #app .esb-chip-row::-webkit-scrollbar { display: none; }
  html body #app .esb-chip-row > :is(button, .btn, a.btn) { flex: 0 0 auto !important; width: auto !important; min-width: max-content !important; min-height: 40px !important; white-space: nowrap !important; }
  html body #app .esb-mobile-document-actions.esb-chip-row > #save-doc { order: -1; }

  /* Format picker with its Customize button: side by side, never a squeezed vertical button. */
  html body #app [data-cust-open] { writing-mode: horizontal-tb !important; width: auto !important; min-width: max-content !important; white-space: nowrap !important; }
  html body #app :is(.field, div):has(> select#print-template-select) { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 8px !important; }
  html body #app :is(.field, div):has(> select#print-template-select) > select { flex: 1 1 200px !important; min-width: 0 !important; }

  /* Phone lists: sort headings swipe instead of running off the screen, and are hidden when the list is empty. */
  html body #app table.esb-mobile-record-table > thead > tr { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; scrollbar-width: none; gap: 6px; }
  html body #app table.esb-mobile-record-table > thead > tr > th { flex: 0 0 auto !important; width: auto !important; max-width: none !important; }
  html body #app table.esb-mobile-record-table:not(:has(> tbody > tr > td:nth-child(2))) > thead { display: none !important; }

  /* Print previews are scaled to the screen by mobile-app.js; keep them centred and clear of the toolbar. */
  html body #app :is(.sb-inv-paper, .listpage-paper, .vch-paper)[data-esb-fit] { margin: 8px auto !important; }
}

@media screen and (max-width: 768px) {
  /* The Customize button beside the format picker is an icon button (its name stays for screen readers). */
  html body #app .sb-bar-template [data-cust-open] { font-size: 0 !important; gap: 0 !important; writing-mode: horizontal-tb !important; }
  /* Print previews lay out at the real sheet width, then mobile-app.js scales them to the screen. */
  html body[data-auth-state="authenticated"] :is(#app, .sb-fmt-preview) .sb-inv-paper:not(.sb-free) { max-width: none !important; }
}

@media screen and (max-width: 768px) {
  /* Document actions (Save, Print, Email, …): one swipeable row with Save first, not a tall 3-column block. */
  html body[data-auth-state="authenticated"] #app .esb-mobile-document-actions.esb-chip-row { display: flex !important; grid-template-columns: none !important; flex-wrap: nowrap !important; overflow-x: auto !important; gap: 8px !important; height: auto !important; scrollbar-width: none; }
  html body[data-auth-state="authenticated"] #app .esb-mobile-document-actions.esb-chip-row > * { flex: 0 0 auto !important; width: auto !important; min-width: max-content !important; min-height: 42px !important; }
  html body[data-auth-state="authenticated"] #app .sb-bar-template [data-cust-open] .esb-mobile-action-text { display: none !important; }
  /* Document formats page: the heading row wraps to the screen. */
  html body[data-auth-state="authenticated"] #app .sb-form-styles { grid-template-columns: minmax(0, 1fr) !important; max-width: 100% !important; min-width: 0 !important; }
  html body[data-auth-state="authenticated"] #app .sb-form-styles-head { flex-wrap: wrap !important; max-width: 100% !important; min-width: 0 !important; }
  html body[data-auth-state="authenticated"] #app .sb-form-styles-head > * { flex: 1 1 100% !important; min-width: 0 !important; max-width: 100% !important; }
}

/* Bottom bar: labels stay inside their own tab, and tabs a role cannot open leave no hole. */
html body[data-auth-state="authenticated"] #esb-mobile-nav{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
#esb-mobile-nav button[hidden]{display:none!important}
html body[data-auth-state="authenticated"] #esb-mobile-nav button span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
