/* Phone presentation only. Never participates in desktop or printed documents. */
@media screen and (max-width: 767.98px) {
  .app-body { --mobile-ink: #17283e; --mobile-muted: #63758a; --mobile-line: #e2e8f0; background: #f4f6fa; font-size: 16px; line-height: 1.5; }
  .app-body .app-main, .app-body .app-content, .app-body .app-content > *, .app-body .row > * { min-width: 0; max-width: 100%; }
  .app-body .app-content { padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
  .app-body .app-content :is(.d-flex, .module-card-header, .dashboard-section-head) { flex-wrap: wrap; gap: 10px; }
  .app-body .app-content :is(h1,h2,h3,h4,p,small,.text-muted,.subtext) { overflow-wrap: anywhere; }
  .app-body .app-content :is(h2.h5,h3.h6) { line-height: 1.3; }
  .app-body .panel-card { padding: 18px 16px; border: 1px solid var(--mobile-line); border-radius: 18px; box-shadow: 0 4px 18px rgb(23 40 62 / 4%); }
  .app-body .app-content :is(.card,.order-card,.quote-card,.sales-item-row) { border-radius: 16px; box-shadow: 0 3px 14px rgb(23 40 62 / 4%); }
  .app-body :is(.btn,.mobile-menu-btn,.icon-btn,.dropdown-item,.choice-btn,.nav-link,.sub-link) { min-height: 44px !important; min-width: 44px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .app-body :is(.btn,.choice-btn) { padding: 10px 14px !important; font-size: .9rem !important; line-height: 1.35 !important; border-radius: 12px; white-space: normal; font-weight: 600; }
  .app-body :is(.btn,.icon-btn,.mobile-menu-btn,.choice-btn) { transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
  .app-body :is(.btn,.icon-btn,.mobile-menu-btn,.choice-btn):active { transform: scale(.98); }
  .app-body :is(button,a,input,select,textarea):focus-visible { outline: 3px solid #80aef0; outline-offset: 3px; }
  .app-body :is(.btn:disabled,.btn.disabled) { opacity: .55; transform: none; }
  .app-body :is(.form-control,.form-select):not(.erp-date-native) { min-height: 48px !important; font-size: 16px !important; line-height: 1.5 !important; border-radius: 12px; padding: 10px 12px !important; max-width: 100%; min-width: 0; }
  .app-body .erp-date-field > .erp-date-display { padding-right: 40px !important; }
  .app-body textarea.form-control { min-height: 96px !important; resize: vertical; }
  .app-body .form-label { font-size: .85rem !important; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
  .app-body :is(.form-text,.invalid-feedback) { font-size: .85rem; line-height: 1.5; }
  .app-body :is(.toggle-pill-btn,.email-action-pill,.email-btn-icon,.employee-debt-icon-btn) { min-width: 44px; min-height: 44px !important; font-size: .9rem !important; touch-action: manipulation; }
  .app-body .email-layout-wrapper { grid-template-columns: minmax(0,1fr); }
  .app-body :is(.email-list-pane,.email-reading-pane,.email-title-search) { min-width: 0; max-width: 100%; }
  .app-body .erp-date-field > .erp-date-native { width: 44px; min-height: 44px; }
  .app-body .filter-grid { grid-template-columns: minmax(0,1fr) !important; }
  .app-body .filter-grid > * { min-width: 0; max-width: 100%; }
  .app-body .filter-grid :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select) { width: 100%; max-width: 100%; min-width: 0; min-height: 48px; font-size: 16px; border-radius: 12px; padding: 10px 12px; }
  .app-body .filter-grid label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
  .app-body .form-check-input { width: 22px; height: 22px; }
  .app-body .form-check-label { min-height: 44px; padding: 4px 0; }
  .app-body .app-topbar { position: sticky; top: 0; min-height: 64px; height: auto; padding: 10px 14px; gap: 8px; background: #fff; border-bottom: 1px solid var(--mobile-line); box-shadow: 0 2px 10px rgb(23 40 62 / 3%); z-index: 900; }
  .app-body .topbar-left { min-width: 0; flex: 1; gap: 8px; }
  .app-body .page-title { font-size: 1.05rem; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
  .app-body .topbar-right { flex: 0 0 auto; gap: 6px; }
  .app-body .topbar-action-group { display: flex; gap: 4px; }
  .app-body :is(.topbar-site-links,.topbar-catalog-btn,.topbar-email-btn,.profile-name) { display: none; }
  .app-body .topbar-action-group .dropdown:has(.topbar-email-btn) { display: none; }
  .app-body .todo-notification-menu { position: fixed !important; top: 72px !important; left: 14px !important; right: 14px !important; transform: none !important; width: auto; min-width: 0; max-width: none; max-height: calc(100dvh - 164px); }
  .app-body .todo-notification-list { max-height: min(340px,calc(100dvh - 220px)); overscroll-behavior: contain; }
  .app-body .profile-chip { min-width: 44px; min-height: 44px; padding: 4px; }
  .app-body .profile-panel-wrap { top: 76px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 164px); overflow-y: auto; overscroll-behavior: contain; }
  .app-body .profile-panel { padding: 18px; }
  .app-body .app-sidebar, .app-body .app-sidebar:hover, .app-body .app-sidebar:focus-within { width: min(310px, 86vw); height: 100dvh; left: -100vw; transition: left 180ms ease; }
  .app-body .app-sidebar.mobile-open { left: 0; }
  .app-body .app-sidebar .sidebar-label { display: inline; opacity: 1; visibility: visible; }
  .app-body .sidebar-nav { overscroll-behavior: contain; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .app-body .sidebar-nav :is(.nav-link,.sub-link) { padding: 12px 16px; font-size: .95rem; }
  .app-body.mobile-drawer-open { overflow: hidden; }
  .app-body .mobile-dock { position: fixed; bottom: 0; left: 0; right: 0; z-index: 940; display: flex; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--mobile-line); background: #fff; box-shadow: 0 -4px 20px rgb(23 40 62 / 5%); }
  .app-body .mobile-dock-item { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; min-height: 48px; border: 0; border-radius: 12px; background: transparent; color: var(--mobile-muted); font-size: .72rem; font-weight: 600; text-decoration: none; touch-action: manipulation; }
  .app-body .mobile-dock-item i { font-size: 1.25rem; }
  .app-body .mobile-dock-item[aria-current=page] { background: var(--theme-accent-soft); color: var(--theme-accent); }
  .app-body.mobile-keyboard-open .mobile-dock, .app-body:has(.modal.show) .mobile-dock { display: none; }
  .app-body .mobile-category-picker { margin-bottom: 18px; }
  .app-body .mobile-category-picker + #settingsTabs { display: none !important; }
  .app-body .app-content table:not(.quotation-sheet table) :is(td,th) { font-size: .9rem !important; }
  .app-body .app-content [class*="mobile-label"] { font-size: .8rem !important; line-height: 1.4; }
  .app-body .reports-shell, .app-body .reports-shell > * { min-width: 0; max-width: 100%; }
  .app-body .reports-shell :is(.profit-grid-two,.cash-grid-two,.reports-filter-bar) { grid-template-columns: minmax(0,1fr) !important; }
  .app-body .reports-shell :is(.profit-chart,.cash-chart,.table-wrap) { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .app-body .reports-shell .reports-head > * { min-width: 0; max-width: 100%; }
  .app-body .reports-range-pill { white-space: normal; overflow-wrap: anywhere; padding: 8px 12px; }
  .app-body .order-layouts-page .layout-workspace { grid-template-columns: minmax(0,1fr); }
  .app-body .order-layouts-page .layout-canvas { min-height: 360px; max-width: 100%; overflow: auto; }
  .app-body .table-responsive { max-width: 100%; overscroll-behavior-x: contain; }
  .app-body .mobile-record-table { display: block; width: 100% !important; min-width: 0 !important; border: 0; background: transparent; }
  .app-body .mobile-record-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .app-body .mobile-record-table > tbody { display: grid; gap: 14px; }
  .app-body .mobile-record-table > tbody > tr { display: grid; grid-template-columns: minmax(0,1fr); border: 1px solid var(--mobile-line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 3px 12px rgb(23 40 62 / 3%); }
  .app-body .mobile-record-table > tbody > tr > :is(td,th) { display: block; width: auto !important; min-width: 0 !important; padding: 10px 14px !important; border: 0; border-bottom: 1px solid #eef2f6; background: transparent; white-space: normal !important; text-align: left !important; overflow-wrap: anywhere; font-size: .95rem !important; }
  .app-body .mobile-record-table > tbody > tr > :last-child { border-bottom: 0; }
  .app-body .mobile-record-table [data-mobile-label]::before { content: attr(data-mobile-label); display: block; margin-bottom: 4px; color: var(--mobile-muted); font-size: .75rem; font-weight: 600; }
  .app-body .mobile-record-table tfoot { display: block; width: 100%; }
  .app-body .mobile-record-table tfoot tr { display: flex; flex-wrap: wrap; }
  .app-body .mobile-role-hidden { display: none !important; }
  .app-body .mobile-permission-table { display: table; width: 100%; min-width: 0 !important; table-layout: fixed; }
  .app-body .mobile-permission-table > thead { display: table-header-group; position: static; clip-path: none; width: auto; height: auto; }
  .app-body .mobile-permission-table > tbody { display: table-row-group; }
  .app-body .mobile-permission-table tr { display: table-row; }
  .app-body .mobile-permission-table :is(td,th) { overflow-wrap: anywhere; min-width: 0 !important; white-space: normal; padding: 12px 8px !important; }
  .app-body .mobile-permission-table :is(td,th):not(:first-child):not(.mobile-role-hidden) { width: 80px; }
  .app-body .mobile-permission-table input[type=checkbox] { width: 32px; height: 32px; margin: 0; }
  .app-body .mobile-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border-radius: 12px; }
  .app-body .dashboard-hero { padding: 20px 16px; display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
  .app-body .dashboard-hero-title { font-size: 1.7rem; line-height: 1.2; }
  .app-body .dashboard-hero-subtitle { font-size: .95rem; line-height: 1.5; }
  .app-body .dashboard-meta-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .app-body .dashboard-mini-card { padding: 14px; }
  .app-body .dashboard-mini-card-cashier { order: -1; }
  .app-body .app-content:has(.quotation-print-page,.quote-shell,.quotation-list-card) { padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important; }
  .app-body .dashboard-weather-card { display: none !important; }
  .app-body .mobile-quote-preview-toggle { width: 100%; margin-bottom: 12px; position: sticky; top: 0; left: 0; z-index: 1; background: #fff; }
  .app-body .app-content .quotation-print-page .quotation-sheet-column.mobile-quote-zoom { overflow: auto; max-height: 75dvh; overscroll-behavior: contain; }
  .app-body .mobile-quote-zoom .quotation-preview-page { width: max-content !important; height: auto !important; }
  .app-body .mobile-quote-zoom .quotation-sheet { transform: none !important; }
  .app-body .mobile-filter-toggle { width: 100%; margin-bottom: 14px; text-align: left; justify-content: flex-start; }
  .app-body .mobile-filter-panel:not(.mobile-filters-open) { display: none !important; }
  .app-body .mobile-nav-loading { background: var(--theme-accent-soft); color: var(--theme-accent); }
  .app-body .mobile-nav-loading i { animation: mobile-nav-pulse .6s ease-in-out infinite alternate; }
  @keyframes mobile-nav-pulse { to { opacity: .35; } }
  .app-body .quotation-print-page .quotation-workbench { grid-template-columns: minmax(0,1fr); }
  .app-body .app-content .quotation-print-page .quotation-side-left { grid-row: 1; }
  .app-body .app-content .quotation-print-page .quotation-sheet-column { grid-row: 2; overflow: hidden; }
  .app-body .app-content .quotation-print-page .quotation-side-right { grid-row: 3; }
  .app-body .quotation-print-page .quotation-summary-title { padding-right: 0; }
  .app-body .app-content .quotation-print-page .quotation-status-row { position: static; margin-top: 8px; }
  .app-body :is(.dashboard-create-grid,.dashboard-task-grid,.dashboard-shortcuts-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .app-body .dashboard-sales-grid { grid-template-columns: minmax(0,1fr); }
  .app-body :is(.dashboard-create-card,.dashboard-shortcut-card) { flex-direction: column; justify-content: center; text-align: center; min-height: 110px; gap: 10px; }
  .app-body :is(.dashboard-create-card,.dashboard-shortcut-card) :is(strong,span) { font-size: .9rem; line-height: 1.4; }
  .app-body :is(.dashboard-create-card,.dashboard-task-card,.dashboard-shortcut-card) { padding: 16px; border-radius: 14px; }
  .app-body :is(.dashboard-section-head h3,.dashboard-sales-money-value) { font-size: 1.15rem; }
  .app-body :is(.dashboard-sales-legend,.dashboard-sales-breakdown-item small,.dashboard-sales-money-code) { font-size: .8rem; }
  .app-body :is(.sales-item-grid,.order-item-grid,.quote-line-row,.order-pay-grid,.sales-payment-grid,.confirm-summary-grid) { grid-template-columns: minmax(0,1fr) !important; gap: 12px !important; }
  .app-body :is(.sales-item-grid,.order-item-grid,.quote-line-row) > * { grid-column: auto !important; grid-row: auto !important; min-width: 0; }
  .app-body :is(.sales-item-head,.order-item-head,.quote-line-head) { display: none; }
  .app-body :is(.sales-item-row,.quote-line-row) { padding: 16px !important; margin-bottom: 16px !important; }
  .app-body :is(.order-item-photo-field .sales-photo-thumb-wrap,.sales-photo-thumb-wrap) { max-width: 160px; }
  .app-body :is(.order-top-row,.products-filter-row,.finance-dashboard-filters) { grid-template-columns: minmax(0,1fr) !important; }
  .app-body :is(.order-delivery-location-col,.order-delivery-date-col,.order-delivery-time-col) { flex: 0 0 100% !important; width: 100% !important; }
  .app-body .order-top-row > * { grid-column: auto !important; grid-row: auto !important; }
  .app-body :is(.customers-list-actions,.orders-list-actions,.sales-list-actions) { display: flex !important; flex-wrap: wrap; gap: 8px !important; }
  .app-body :is(.customers-list-actions,.orders-list-actions,.sales-list-actions) > * { flex: 1 1 130px; }
  .app-body .modal-dialog { margin: 8px; max-width: calc(100% - 16px); }
  .app-body .modal-content { border-radius: 20px; max-height: calc(100dvh - 16px); }
  .app-body .modal-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px; }
  .app-body .modal-footer { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); gap: 8px; }
  .app-body .modal-footer > .btn { flex: 1; }
  .app-body .pagination { flex-wrap: wrap; gap: 4px; }
  .app-body .page-link { min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 10px; }
  .app-body .app-connection-toast { bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); }
  .auth-page { padding: 24px 16px; min-height: 100dvh; }
  .auth-panel { width: 100%; max-width: 100%; padding: 24px 20px; border-radius: 20px; }
  .auth-form :is(input,select,textarea) { font-size: 16px; min-height: 48px; max-width: 100%; }
  .auth-form button { min-height: 48px; touch-action: manipulation; }
  :is(.public-shell,.marketing-site,.pet-store-shell) { min-width: 0; max-width: 100%; }
  :is(.public-page,.pet-store-page) :is(.btn,button,input,select) { min-height: 44px; font-size: 16px; touch-action: manipulation; }
}
@media screen and (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .app-body *, .app-body *::before, .app-body *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
