/* =========================================
   MOBILE RESPONSIVENESS & FILTERS
   ========================================= */
.mobile-only { display: none; }
.mobile-flex-only { display: none !important; }
.logo-mobile { display: none; }

.mobile-filter-container { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--row-border); width: 100%; }
.mobile-filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.m-filter-btn { 
    background: var(--input-bg); 
    color: var(--text-main); 
    border: 1px solid var(--input-border); 
    border-radius: 6px; 
    padding: 8px 12px; 
    font-size: 12px; 
    font-weight: 600; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    cursor: pointer; 
    transition: background-color .1s ease, border-color .1s ease, color .1s ease, box-shadow .1s ease, opacity .1s ease;
}

.m-filter-btn.active { 
    border-color: var(--brand-primary); 
    color: var(--brand-primary); 
    background: var(--brand-light); 
}

/* =========================================
   MEDIA QUERY: PHONES & SMALL TABLETS
   ========================================= */
/* Device-gated, not width-gated: this block used to be a phone-width
   media query. See html.umx-mobile at the top of mobile.css. */
html.umx-mobile body{ touch-action: manipulation; } /* Disables double-tap to zoom */
html.umx-mobile body.app-page{ padding: 0; }

html.umx-mobile .dash-top-bar{ padding: 10px 15px; flex-direction: column; gap: 10px; align-items: center; height: auto;}
html.umx-mobile .dash-metrics{ gap: 15px; width: 100%; justify-content: space-between; }
html.umx-mobile .dash-banner{ margin: 0; border-radius: 0; }

/* Ensure dash title and logo stay next to each other, centered on mobile */
html.umx-mobile .dash-title{ display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: center !important; width: 100%; gap: 8px !important; }

/* Swap logo variants */
html.umx-mobile .logo-desktop{ display: none !important; }
html.umx-mobile .logo-mobile{ display: inline-block !important; }

html.umx-mobile .desktop-only{ display: none !important; } 
html.umx-mobile .mobile-only{ display: inline-block !important; }
html.umx-mobile .mobile-flex-only{ display: flex !important; }

/* Scale the top bar logo using the mobile variable */
html.umx-mobile .dash-top-bar .black-bar-logo{
    height: var(--logo-size-mobile, 40px) !important;
}

/* Hide settings and action icons on mobile */
html.umx-mobile button[title="Admin Settings"],
html.umx-mobile button[onclick*="toggleActionMenu"],
html.umx-mobile #actionDropdown{
    display: none !important;
}

html.umx-mobile .table-container{ margin: 15px; padding: 10px; background: var(--card-bg); border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); overflow-x: auto; width: calc(100% - 30px); box-sizing: border-box; }

/* Stack the top toolbar so the button rests above the search bar */
html.umx-mobile .app-toolbar{
    flex-direction: column;
    align-items: stretch;
    padding: 15px;
    gap: 15px;
}
html.umx-mobile .toolbar-left, html.umx-mobile .toolbar-center{ width: 100%; flex: none; }
html.umx-mobile .toolbar-left button{ width: 100%; justify-content: center; }
html.umx-mobile .search-wrapper{ width: 100%; }
html.umx-mobile .search-box{ width: 100%; box-sizing: border-box; margin-left: 0 !important; }
html.umx-mobile .pagination-controls{ flex-direction: column; gap: 15px; margin: 15px; padding: 15px; }

   
/* Hide all columns by default on mobile */
html.umx-mobile .table-container table th, html.umx-mobile .table-container table td{ display: none !important; }
 /* Show explicitly selected mobile columns for Projects, and Fallbacks for Directory pages */
html.umx-mobile .table-container table th.mobile-visible,
html.umx-mobile .table-container table td.mobile-visible,
html.umx-mobile .table-container table th.col-role,
html.umx-mobile .table-container table td.col-role,
html.umx-mobile .table-container table th.col-email,
html.umx-mobile .table-container table td.col-email,
html.umx-mobile .table-container table th.col-company_name,
html.umx-mobile .table-container table td.col-company_name,
html.umx-mobile .table-container table th.col-contact_person,
html.umx-mobile .table-container table td.col-contact_person{
    display: table-cell !important;
}

html.umx-mobile .table-container table{ min-width: 100% !important; display: table !important; }
html.umx-mobile .table-container table thead{ display: table-header-group !important; }
html.umx-mobile .table-container table thead tr{ position: static !important; display: table-row !important; }
html.umx-mobile .table-container table tbody{ display: table-row-group !important; }

html.umx-mobile .table-container table tr{ display: table-row !important; margin: 0 !important; padding: 0 !important; border: none !important; background-color: var(--row-bg); }
html.umx-mobile .table-container table th, html.umx-mobile .table-container table td{ border-bottom: 1px solid var(--row-border) !important; padding: 12px 10px !important; text-align: left !important; vertical-align: middle !important; }
html.umx-mobile .table-container table td::before{ content: none !important; display: none !important; }
html.umx-mobile .table-container table td.mobile-title{ font-size: 13px !important; font-weight: 600 !important; }
html.umx-mobile .table-container table td.mobile-title > span{ width: auto !important; font-size: 13px !important; }
html.umx-mobile .table-container table td.mobile-badge{ position: static !important; padding: 12px 10px !important; }


html.umx-mobile .table-container table td > span.grade-badge,
html.umx-mobile .table-container table td > span.status-badge{ width: auto !important; min-width: 60px; display: inline-block !important; text-align: center !important; }

html.umx-mobile .form-grid{ grid-template-columns: 1fr; }
html.umx-mobile .form-group[style*="grid-column"]{ grid-column: span 1 !important; }

/* --- RESPONSIVE BOOK PANES FOR MODALS --- */
html.umx-mobile .modal-wrapper{ gap: 0 2px; margin-top: 2vh; grid-template-columns: repeat(4, 1fr); }
html.umx-mobile .pane-tab{ padding: 0 4px; min-width: 0; width: auto; max-width: none; font-size: 11px; gap: 4px; }
html.umx-mobile .pane-tab-icon{ font-size: 16px; }

html.umx-mobile .pane-content{
    width: 95vw !important;
    min-width: 0 !important;
    padding: 15px !important;
}
html.umx-mobile .modal-content.project-modal{
    min-width: 0 !important;
}

/* --- EVERY OTHER MODAL ---------------------------------------------------
   Only the project modal was handled above. Every module modal (catalog
   browse, Offer Maker, reviewer, sub-tasks, trash, notifications…) follows
   the house pattern from CLAUDE.md, which hardcodes `min-width:500px` as an
   INLINE style — on a 375px screen that is a horizontally scrolling dialog
   with its right edge, and often its close button, off the screen.

   Inline styles can only be beaten with !important. Width is clamped to the
   viewport and height to 92% of it, so a long dialog scrolls inside itself
   instead of running off the bottom. UmxWin's title bar and Save/Cancel foot
   are children of .modal-content and stay reachable because the box, not the
   page, is what scrolls. */
html.umx-mobile .modal-content{
    min-width: 0 !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 92dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 18px 16px !important;
    box-sizing: border-box !important;
}
/* Reserve the app footer's strip on the OVERLAY, so a centred dialog is centred
   in the space that is actually free. Doing it here rather than per-dialog means
   every modal clears the footer, not just the ones anyone has looked at on a
   phone. #app-footer is fixed at 40px; box-sizing keeps the overlay full-bleed. */
html.umx-mobile .modal {
    padding-bottom: 40px !important;
    box-sizing: border-box !important;
}
/* Dialogs built without .modal-content (a bare div inside .modal). */
html.umx-mobile .modal > div:not(.modal-content):not(.umx-win-titlebar){
    max-width: calc(100vw - 16px) !important;
    box-sizing: border-box !important;
}

/* Stack the form rows and action buttons vertically */
html.umx-mobile .form-row{ flex-direction: column !important; gap: 10px !important; }
html.umx-mobile .cols-2{ grid-template-columns: 1fr !important; }
html.umx-mobile .modal-actions{ flex-direction: column; }
html.umx-mobile .modal-actions button{ width: 100%; margin-left: 0 !important; margin-bottom: 10px; }

/* Project modal tabs on mobile: Details + Notes (+ Tasks when the module is on);
   Files/Workers are hidden below, so allow up to 3 columns. */
html.umx-mobile body[data-page="projects"] .modal-wrapper{
    grid-template-columns: repeat(3, 1fr) !important;
}
html.umx-mobile body[data-page="projects"] #modalFarLeft,
html.umx-mobile body[data-page="projects"] #modalRightPane{
    display: none !important;
}
/* …and Notes / Tasks move into columns 2 and 3. They kept their desktop columns
   (4 and 5), which on a 3-column phone row put them past the right edge. */
html.umx-mobile body[data-page="projects"] #modalNotesPane .pane-tab{ grid-column: 2; }
html.umx-mobile body[data-page="projects"] #modalTasksPane .pane-tab{ grid-column: 3; }

/* Catalog Filters */
html.umx-mobile #catalogAdvancedFilters{
    display: none !important;
}
html.umx-mobile #catalogAdvancedFilters.force-show-mobile{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    margin-top: 0px;
}
html.umx-mobile #catalogAdvancedFilters.force-show-mobile > div{
    width: 100% !important;
    box-sizing: border-box;
}

/* Compact Grid View for Catalog (Mobile) */
html.umx-mobile #catalogGrid.compact-grid{
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-card{
    padding: 8px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-header{
    margin-bottom: 5px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-cat-btn{
    font-size: 8px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-cat span{
    display: none !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-card img{
    height: 60px !important;
    margin-bottom: 5px !important;
    padding: 5px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-title{
    font-size: 9px !important;
    line-height: 1.2 !important;
    height: 22px !important;
    margin-bottom: 4px !important;
    -webkit-line-clamp: 2 !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-ean{
    font-size: 8px !important;
    margin-bottom: 4px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-desc{
    -webkit-line-clamp: 2 !important;
    font-size: 8px !important;
    line-height: 1.2 !important;
    margin-bottom: 5px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-footer{
    padding-top: 5px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-footer-price{
    font-size: 11px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-footer-stock{
    font-size: 8px !important;
}
html.umx-mobile #catalogGrid.compact-grid .catalog-hist,
html.umx-mobile #catalogGrid.compact-grid .catalog-actions{
    display: none !important;
}

/* Un-hide the black bar filters on mobile */
.force-show-mobile {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    margin-top: 15px;
    gap: 15px;
}

/* Fix Footer on Mobile to ensure chat button is visible */
.footer-left { display: none !important; }
.footer-center { flex: 1 1 auto !important; justify-content: flex-start !important; overflow-x: auto; gap: 5px !important; min-width: 0 !important; scrollbar-width: none; }
/* .footer-center::-webkit-scrollbar { display:none } already set in body.css */
.footer-center > span { white-space: nowrap; }
.footer-right { flex: 0 0 auto !important; margin-left: auto !important; }
#app-footer { padding: 0 10px !important; display: flex !important; width: 100vw !important; box-sizing: border-box !important; }

/* --- PREMIUM SIDE PANEL MENU --- */
/* Device-gated, not width-gated: this block used to be a phone-width
   media query. See html.umx-mobile at the top of mobile.css. */
html.umx-mobile .nav-dropdown{
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 0;
    left: -260px;
    width: 220px;
    height: 100vh;
    margin-top: 0;
    border-radius: 0 16px 16px 0;
    border: none;
    border-right: 1px solid var(--row-border);
    box-shadow: none;
    z-index: 10000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    padding: 40px 20px;
    background-color: var(--card-bg);
    gap: 8px;
}

html.umx-mobile .nav-dropdown > *{
    justify-content: center !important;
    text-align: center !important;
}

html.umx-mobile .nav-dropdown.show{
    left: 0;
    box-shadow: 10px 0 25px rgba(0,0,0,0.5);
}

/* The dim behind the open menu. It sits BELOW .nav-dropdown (10000) — but
   `backdrop-filter` made this pseudo-element its own compositing layer, and
   mobile browsers then painted it over the menu as well, so opening the menu
   greyed out the menu itself. The blur is not worth that: a plain translucent
   black dims the page and leaves the menu readable. */
html.umx-mobile body.menu-open::after{
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
/* Belt and braces: whatever else is on the page, the OPEN menu outranks the
   dim. Stated here so a future overlay cannot quietly bury it again. */
html.umx-mobile body.menu-open .nav-dropdown.show{ z-index: 10000; }
/* ═══════════════════════════════════════════════════════════════════════════
   PANELLED MODALS ON A PHONE
   A dashboard built as [fixed-width nav | content] is a desktop shape. On a
   375px screen a 210px nav leaves ~165px for the content, so the panel it is
   navigating is unreadable — the Analytics dashboard showed a full-height menu
   beside a sliver of cut-off numbers. Below 768px the two stack: the nav
   becomes a short horizontal strip you swipe, and the content gets the width.

   !important is needed, and is not laziness: the widths are inline styles on
   the elements (built in analytics.js), so a stylesheet cannot outrank them
   any other way.
   ═══════════════════════════════════════════════════════════════════════════ */
/* Device-gated, not width-gated: this block used to be a phone-width
   media query. See html.umx-mobile at the top of mobile.css. */
/* The row that holds [nav | body] — target it through its children. */
html.umx-mobile .an-shell .an-nav{
    width: 100% !important;
    max-height: 96px;
    border-right: none !important;
    border-bottom: 1px solid var(--row-border);
    display: flex; flex-wrap: wrap; gap: 6px;
    overflow-x: auto; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
html.umx-mobile .an-shell .an-nav .an-nav-item{
    margin-bottom: 0 !important;
    white-space: nowrap;
    flex: 0 0 auto;
}
/* Stack the nav above the body instead of beside it. */
html.umx-mobile .an-shell > div[style*="flex:1"][style*="display:flex"],
html.umx-mobile .an-shell > div[style*="flex: 1"][style*="display: flex"]{
    flex-direction: column !important;
}
html.umx-mobile .an-shell #anBody{ padding: 14px 12px !important; }
/* No width rule here on purpose: .an-shell IS a .modal-content, which is
   already sized for the phone above (min-width:0, width:100vw-16px,
   max-height:92dvh). Restating it would be a second opinion about the same
   box, and the two would drift. */
/* Charts and stat cards: one per row rather than squeezed side by side. */
html.umx-mobile .an-shell #anBody canvas{ max-width: 100% !important; height: auto !important; }

/* Reviewer: same shape, same fix. A 320px field pane beside the captured
   page leaves ~55px of a 375px screen for what you are meant to be
   reviewing, so the two stack and each gets the full width. */
html.umx-mobile .rev-split{ flex-direction: column !important; overflow-y: auto !important; }
html.umx-mobile .rev-pane-fields{
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--row-border);
}

/* Catalog browse has TWO density controls and they belong to different
   screens. 1x/3x (setCatalogView) is the PHONE's — it toggles .compact-grid
   for one card per row or three. 3/5 (setCatalogGridCols) is the desk's, and
   it writes `repeat(N, minmax(0, 1fr))` straight onto the element with a
   zero minimum, then remembers it in localStorage — so picking 5 at a desk
   followed the user onto the phone and gave five ~60px cards.

   So the phone ignores the DESK's inline value while leaving 1x/3x in
   charge: :not(.compact-grid) is the 1x case and pins one card per row;
   .compact-grid (below) is the 3x case and keeps its three. Neither reads
   the inline style, which is the whole point. */
html.umx-mobile #catalogGrid:not(.compact-grid){
    grid-template-columns: 1fr !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CATALOG FILTERS ON A SMALL LAPTOP (not just a phone)
   The filter row is a flex line of selects; it needs real width. A 14" screen
   does not have it once the browse modal is 90vw with its own chrome, so the
   filters wrapped into a tall block that pushed the products off the screen.
   Same treatment as the phone from 1280px down: filters collapse behind the ▼,
   which reveals them as a full-width column.

   Deliberately NOT done by widening `.mobile-only` — that class is global and
   would drag every other page's phone-only control onto laptops with it.
   ═══════════════════════════════════════════════════════════════════════════ */
/* 2026-10-28: retired. The filters now sit in a sidebar beside the products
   (appDrawer/catalog/css/catalog.css), which fits a laptop without folding them
   away, so only the PHONE still hides them behind ▼ (html.umx-mobile above). */

/* Catalog browse window on a phone: one column — search on top, the sidebar's
   filters fold behind ▼. (Here, not in catalog.css: module CSS is scoped under
   .mod-catalog, so it can't reach html.umx-mobile.) */
html.umx-mobile .cat-browse-body { flex-direction: column !important; gap: 10px; }
html.umx-mobile .cat-side {
    width: 100% !important;
    overflow: visible !important;
    padding-right: 0 !important;
    border-right: none !important;
}
html.umx-mobile #catalogAdvancedFilters.force-show-mobile {
    max-height: 50vh;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORCED MOBILE — html.umx-mobile
   ═══════════════════════════════════════════════════════════════════════════
   The phone rules in this file (and in settings.css, and the modal-split block in
   body.css) used to sit behind `@media (max-width: 768px)`. That is exactly what
   a browser's "Request desktop site" takes away: it rewrites the user agent and
   reports a ~980px viewport, so every width query stopped matching and a phone
   got the desktop layout it cannot use.

   They are now gated on this class instead — ONE trigger, no duplicated rules to
   keep in sync. `window._umxSyncMobileClass()` (init.js) sets it when EITHER the
   DEVICE is mobile — sticky, backed by the server's Connected Devices record, so
   desktop mode cannot shake it — OR the viewport really is ≤768px, which is what
   the query used to mean. It re-runs on resize, so dragging a desktop window
   across the breakpoint behaves exactly as before.

   Two consequences worth knowing:
     • JS must ask `window.umxMobileLayout()`, never `innerWidth <= 768`, or it
       will disagree with the stylesheet on a phone in desktop mode.
     • The phone layout now needs init.js to have run. It is the first core script
       on every page, and nothing else in the app works without it either.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Offer Maker on a phone ────────────────────────────────────────────────
   An offer is BUILT at a desk: ten price columns, drag-to-reorder rows, bulk
   paste, catalog browsing. None of that is workable with a thumb, and half of
   it moves money. So the phone gets the offer's identity and its actions, and
   the line table stays behind.

   The table is hidden by its CONTAINER, never by its rows: saveOfferMaker() and
   readCurrentOffer() (the PDF/Excel pipeline) walk #om_table_body and skip any
   `tr` whose own inline display is none. Hiding the wrapper leaves every row
   readable to them, so what a phone saves and exports is the whole offer — not
   the part it happens to be showing. */
html.umx-mobile .offer-maker-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    /* Minus the 40px #app-footer, which is fixed to the VIEWPORT: at a full 100vh
       the dialog's last row lands under it. dvh, not vh, so a phone's collapsing
       address bar does not push the bottom off-screen. */
    height: calc(100dvh - 40px) !important;
    max-height: calc(100dvh - 40px) !important;
    border-radius: 0 !important;
}

/* The offer BODY: line table, the add/paste/catalog/basket/request bar, and the
   deleted-items list. */
html.umx-mobile .offer-maker-modal .om-table-scroll,
html.umx-mobile .offer-maker-modal .om-actions-bar,
html.umx-mobile .offer-maker-modal .om-deleted-container,
html.umx-mobile .offer-maker-modal #om_deleted_items_container {
    display: none !important;
}

/* Pricing controls come off too. They rewrite every line's money, and a control
   that changes what you cannot see is worse than one that is absent. */
html.umx-mobile .offer-maker-modal #om_global_disc_group,
html.umx-mobile .offer-maker-modal #om_commission_group,
html.umx-mobile .offer-maker-modal #om_minprice_group {
    display: none !important;
}

/* An offer is READ-ONLY on a phone. So the editable header — offer name, status,
   valid-until — goes with the table: there is nothing here to change, and a field
   you can type into but not save is a trap.
   NOTE: this is presentation, not permission. What actually stops a mobile edit
   is the server (save authorization, price floors, the review lock); hiding a
   field is a simplification, and would not stop anyone determined. */
html.umx-mobile .offer-maker-modal .om-controls-row {
    display: none !important;
}

/* The header bar states everything in one sentence — project, client, code,
   revision, contact — which at 375px wraps into a block nobody can read. Replaced
   by #om_mobile_head: the same facts, one per line, offer name first. */
html.umx-mobile .offer-maker-modal .om-subtitle {
    display: none !important;
}
html.umx-mobile .offer-maker-modal .om-mobile-head {
    display: block !important;
    padding: 4px 2px 2px;
}
html.umx-mobile .offer-maker-modal .offer-body {
    overflow-y: auto;
    padding-bottom: 8px;
}

/* Footer: Preview · PDF · Excel, full width and thumb-sized. Save, Send and
   Cancel are hidden — nothing is editable, so there is nothing to save or send
   from here, and the window's own × closes the dialog. */
/* column-reverse, because the DOM has the total first: the three exports sit on
   ONE row and the grand total lands under them, right-aligned. */
html.umx-mobile .offer-maker-modal .offer-footer {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 8px;
    padding: 10px 12px;
}
html.umx-mobile .offer-maker-modal .om-footer-buttons {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    width: 100%;
}
/* flex:1 with min-width:0 is what keeps them on one line — without the min-width
   override a flex item refuses to shrink below its content and the last button
   is pushed off the screen edge, which is how "Send Offer" ended up sliced. */
html.umx-mobile .offer-maker-modal .om-footer-buttons button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    padding: 12px 4px !important;   /* ≥44px tall — a real tap target */
    font-size: 13px !important;
    white-space: nowrap;
    overflow: hidden;
    justify-content: center;
}
html.umx-mobile .offer-maker-modal .om-btn-save,
html.umx-mobile .offer-maker-modal .om-btn-send,
html.umx-mobile .offer-maker-modal .om-btn-cancel,
html.umx-mobile .offer-maker-modal .om-footer-sep {
    display: none !important;
}
/* Preview first — it is what you open the offer for. A disabled export stays
   visible and greyed rather than absent: an unsaved offer cannot be exported, and
   that has to be legible instead of looking like a missing feature. */
html.umx-mobile .offer-maker-modal .om-btn-preview { order: 1; }
html.umx-mobile .offer-maker-modal .om-btn-pdf     { order: 2; }
html.umx-mobile .offer-maker-modal .om-footer-buttons button[disabled] {
    opacity: 0.45;
}
/* The footer's own total is dropped on a phone: #app-footer is position:fixed at
   the bottom of the VIEWPORT, so the dialog's last row lands underneath it and the
   total was sliced in half — which is why this looked wrong on a real phone and
   fine on a narrowed desktop window, where there is enough height that the two
   never meet. The number now lives in the summary at the top (#om_mh_total),
   where nothing can cover it. */
html.umx-mobile .offer-maker-modal .om-grand-total {
    display: none !important;
}

/* The header row's selects (language / print layout) are desk settings. */
html.umx-mobile .offer-maker-modal .om-header-actions .om-select { display: none !important; }

/* Full-screen CRM on a phone (appDrawer/crm/js/crmApp.js): the list fills the
   screen; choosing a client swaps to the client, with ‹ back to the list. */
html.umx-mobile .cr-app { flex-direction: column; }
html.umx-mobile .cr-list { width: 100%; border-right: none; flex: 1; }
html.umx-mobile .cr-detail { display: none; }
html.umx-mobile .cr-app.cr-show-detail .cr-list { display: none; }
html.umx-mobile .cr-app.cr-show-detail .cr-detail { display: flex; }
html.umx-mobile .cr-back { display: inline-block !important; margin-bottom: 6px; }
html.umx-mobile .cr-head { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
html.umx-mobile .cr-head-actions { justify-content: flex-end; }
html.umx-mobile .cr-back { align-self: flex-start; }
html.umx-mobile .cr-kv { grid-template-columns: 100px minmax(0, 1fr); }
html.umx-mobile .cr-overview { grid-template-columns: 1fr; }
html.umx-mobile .cr-form, html.umx-mobile .cr-cform { grid-template-columns: 1fr; }
html.umx-mobile .cr-body { padding: 12px; }

/* What's New on a phone (appDrawer/whatsnew/js/whatsnew.js): the section nav
   becomes a row of tabs on top; in Meetings the list fills the screen and a
   meeting swaps in with ‹ back, like the CRM. */
html.umx-mobile .wn-app { flex-direction: column; }
html.umx-mobile .wn-nav { width: 100%; flex-direction: row; gap: 4px; padding: 6px 8px; border-right: none; border-bottom: 1px solid var(--row-border); overflow-x: auto; flex-shrink: 0; }
html.umx-mobile .wn-nav-btn { flex: 1 1 auto; justify-content: center; gap: 4px; padding: 8px 6px; font-size: 13px; }
html.umx-mobile .wn-nav-ico { display: none; }   /* four labels + counts must fit one row */
html.umx-mobile .wn-nav-label { flex: 0 0 auto; overflow: visible; }
html.umx-mobile .wn-nav-n { white-space: nowrap; }
html.umx-mobile .wn-next { display: none; }
html.umx-mobile .wn-scroll { padding: 12px; }
html.umx-mobile .wn-split { flex-direction: column; }
html.umx-mobile .wn-list { width: 100%; border-right: none; flex: 1; }
html.umx-mobile .wn-detail { display: none; }
html.umx-mobile .wn-split.wn-show-detail .wn-list { display: none; }
html.umx-mobile .wn-split.wn-show-detail .wn-detail { display: flex; }
html.umx-mobile .wn-back { display: inline-flex !important; align-self: flex-start; margin-bottom: 6px; }
html.umx-mobile .wn-head { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
html.umx-mobile .wn-head-actions { justify-content: flex-end; flex-wrap: wrap; }
html.umx-mobile .wn-body { padding: 12px; }
html.umx-mobile .wn-form, html.umx-mobile .wn-comp-link { grid-template-columns: 1fr; }
html.umx-mobile .wn-bar { padding: 10px 12px; }
html.umx-mobile .wn-chat-head, html.umx-mobile .wn-chat-msgs, html.umx-mobile .wn-chat-form { padding-left: 12px; padding-right: 12px; }
html.umx-mobile .wn-chat-head .wn-small { display: none; }
html.umx-mobile .wn-modal { padding: 18px 16px; }

/* Task Manager on a phone (appDrawer/tasks/js/tmApp.js). The module's rules are
   scoped (.mod-tasks …), so these go through #sec-tasks to outrank them. The
   project list becomes the select in the header; the list keeps name · person ·
   status; the task panel covers the screen. */
html.umx-mobile #sec-tasks .tm-app, html.umx-mobile #sec-tasks .tm-app.with-detail { grid-template-columns: minmax(0, 1fr); }
html.umx-mobile #sec-tasks .tm-side { display: none; }
html.umx-mobile #sec-tasks .tm-head { flex-wrap: wrap; gap: 8px; padding: 10px 12px 8px; }
html.umx-mobile #sec-tasks .tm-head h2, html.umx-mobile #sec-tasks .tm-openproj { display: none; }
html.umx-mobile #sec-tasks .tm-scope-sel { display: block; width: 100%; margin-bottom: 4px; font-size: 15px; font-weight: 600; }
html.umx-mobile #sec-tasks .tm-views { width: 100%; }
html.umx-mobile #sec-tasks .tm-views button { flex: 1; justify-content: center; padding: 7px 6px; }
html.umx-mobile #sec-tasks .tm-toolbar { padding: 0 12px 8px; }
html.umx-mobile #sec-tasks .tm-body { padding: 10px 12px 18px; }
html.umx-mobile #sec-tasks .tm-body.tm-v-timeline { padding: 0; }
html.umx-mobile #sec-tasks .tm-list, html.umx-mobile #sec-tasks .tm-list.tm-with-proj { --cols: minmax(0, 1fr) 64px 108px; }
html.umx-mobile #sec-tasks .tm-row .c-proj, html.umx-mobile #sec-tasks .tm-row .c-prio, html.umx-mobile #sec-tasks .tm-row .c-date, html.umx-mobile #sec-tasks .tm-row .c-time { display: none; }
html.umx-mobile #sec-tasks .tm-board { grid-template-columns: repeat(4, 80vw); }
html.umx-mobile #sec-tasks .tm-app.with-detail .tm-detail { position: fixed; inset: 0; z-index: 3200; width: auto; border-left: none; }
html.umx-mobile #sec-tasks .tm-tl { --lw: 150px; }
html.umx-mobile #sec-tasks .tm-tl-label { padding-left: 10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   One line per label on a phone (2026-11-10). An audit of every app page and
   settings section at 375px found the same few causes everywhere: labels that
   broke onto two or three lines inside buttons, tabs, pagers and table cells.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Top bar: the back arrow alone means "App Chooser" — the word broke onto two
   lines beside any longer app name. Its text stays in the link for screen
   readers. The Settings page's version label and user name are desk details. */
html.umx-mobile .launcher-topbar-left > a.launcher-topbar-btn:first-child { font-size: 0; gap: 0; padding: 6px 8px !important; }
html.umx-mobile #settings-username, html.umx-mobile #umx-core-version { display: none !important; }

/* A button's label never breaks ("📥 Import / stock / report"): a row of
   buttons wraps as a whole instead. Card-like buttons (a block inside) keep
   their own layout. */
html.umx-mobile button:not(:has(div, p, br, ul, table)),
html.umx-mobile a.btn-primary-solid, html.umx-mobile a.btn-gray { white-space: nowrap; max-width: 100%; }
html.umx-mobile .umx-set-nav button { overflow: hidden; text-overflow: ellipsis; }

/* Tab rows. The CRM / Team tabs (4, with counts) scroll sideways in one row;
   the tabbed-app-shell rows (<module>-tab-* buttons: Availability, Production,
   Pricing & Deals, the time report) wrap as a row, never inside a label. */
html.umx-mobile .cr-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 8px; }
html.umx-mobile .cr-tabs::-webkit-scrollbar { display: none; }
html.umx-mobile .cr-tab { flex: 0 0 auto; padding: 9px 10px; }
html.umx-mobile div:has(> button[id*="tab-"]) { flex-wrap: wrap !important; row-gap: 4px; }
html.umx-mobile button[id*="tab-"] { flex: 0 0 auto; padding: 9px 12px !important; }

/* Pager (◀ Prev · Page 1 of 27 (396 items) · Next ▶): one row; only the
   middle text gives way. */
html.umx-mobile .page-navigation { gap: 8px; flex-wrap: nowrap; width: 100%; justify-content: space-between; }
html.umx-mobile .page-navigation > button { flex: 0 0 auto; padding: 6px 10px; }
html.umx-mobile .page-navigation > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; font-size: 12px; }

/* Tables: umxUtil.js puts each one in its own sideways scroller (.umx-tscroll),
   so the page never scrolls sideways and a column is never squeezed to one
   letter. Cells stay on one line; a long free-text cell (.umx-tlong) wraps in
   a readable width. */
html.umx-mobile .umx-tscroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
html.umx-mobile .umx-tscroll > table { min-width: 100%; }
html.umx-mobile table.umx-tfit th, html.umx-mobile table.umx-tfit td { white-space: nowrap; }
html.umx-mobile table.umx-tfit td.umx-tlong { white-space: normal; width: 220px; min-width: 220px; }

/* A settings section never grows wider than the screen: its content column may
   shrink, and long unbroken values (addresses, codes) break instead of pushing. */
html.umx-mobile .umx-set-content { min-width: 0; max-width: 100%; }
html.umx-mobile .umx-set-content .settings-card { min-width: 0; max-width: 100%; box-sizing: border-box; overflow-wrap: break-word; }

/* Filter bars (.umx-filterbar): a two-column grid instead of six stacked rows
   with the € and date ranges running off the screen. Search and range pairs
   take a full row; selects and buttons sit two to a row. */
html.umx-mobile .umx-filterbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html.umx-mobile .umx-filterbar > * { min-width: 0; width: 100% !important; max-width: 100%; box-sizing: border-box; margin: 0; }
html.umx-mobile .umx-filterbar > .umx-fb-grow, html.umx-mobile .umx-filterbar > .umx-fb-group { grid-column: 1 / -1; }
html.umx-mobile .umx-fb-group { display: flex; align-items: center; gap: 6px; }
html.umx-mobile .umx-fb-group > input, html.umx-mobile .umx-fb-group > select { flex: 1 1 0; min-width: 0; width: auto !important; }

/* The /quotes list on a phone: the long offer number (still in the offer, and
   search finds it) and "made by" give their room to the offer and its client. */
html.umx-mobile #q_off_table th:nth-child(1), html.umx-mobile #q_off_table td:nth-child(1):not([colspan]),
html.umx-mobile #q_off_table th:nth-child(5), html.umx-mobile #q_off_table td:nth-child(5):not([colspan]) { display: none; }

/* Catalog Automation (standalone page): a card's title + its buttons wrap as a
   row instead of pushing the page sideways. */
html.umx-mobile .auto-card-hd { flex-wrap: wrap; gap: 8px; }
html.umx-mobile .auto-card-hd > div { flex-wrap: wrap; max-width: 100%; }
html.umx-mobile .auto-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html.umx-mobile .auto-stat { min-width: 0; padding: 10px 12px; }
html.umx-mobile .auto-stat-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.umx-mobile .basket-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Settings on a phone: 40px page margins + 30px card padding left a 234px text
   column on a 375px screen, and every sentence broke into many short lines. */
html.umx-mobile body.settings-page .settings-page-body { padding: 14px 10px 72px !important; }
html.umx-mobile .settings-card { padding: 16px 14px; }

/* "Text on the left, controls on the right" rows (a module row with its status
   and button, a heading with its action): when both don't fit, the controls go
   under the text instead of squeezing it into a one-word column. */
html.umx-mobile .settings-card [style*="justify-content:space-between"],
html.umx-mobile .settings-card [style*="justify-content: space-between"] { flex-wrap: wrap; row-gap: 8px; }
html.umx-mobile .settings-card [style*="justify-content:space-between"] > :first-child,
html.umx-mobile .settings-card [style*="justify-content: space-between"] > :first-child { flex: 1 1 200px; min-width: 0; }
html.umx-mobile #premium_modules_list [id^="status_mod_"] span { white-space: nowrap; }

/* A switch with a long hint: the hint takes its own line under the label. */
html.umx-mobile label:has(> #dev_require_approval) { flex-wrap: wrap; }
html.umx-mobile label:has(> #dev_require_approval) > span { flex: 1 1 100%; padding-left: 26px; }

/* Widgets (Settings → UI & Layout): a widget's slot chips go under its name
   instead of squeezing it to a few letters a line ("Client / s / Butto / n"). */
html.umx-mobile #wg-library div[style*="display:flex"], html.umx-mobile #wg-pages div[style*="display:flex"] { flex-wrap: wrap; }
html.umx-mobile #wg-library div[style*="margin-left:auto"], html.umx-mobile #wg-pages div[style*="margin-left:auto"] { flex: 1 1 100%; margin-left: 25px !important; justify-content: flex-start !important; }
html.umx-mobile #wg-pages div[style*="display:flex"] > span:nth-child(2) { white-space: nowrap; }

/* Filter bar actions grouped at the end (.umx-fb-push — the catalog sheet's
   Download / Upload Excel) take their own row instead of overflowing one cell. */
html.umx-mobile .umx-filterbar > .umx-fb-push { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
html.umx-mobile .umx-filterbar > .umx-fb-push > * { flex: 1 1 auto; }

/* Catalog Overview header: title + "Open Catalog" on one row, the one-line
   summary under them (it was squeezed between them into four lines). */
html.umx-mobile #catalog-stats-grid { order: 3; flex: 1 1 100% !important; }
html.umx-mobile #catalog-stats-grid ~ button { margin-left: auto; }
