/* SABSUS mobile density 2026-11-27. Native app behavior is preserved. */


/* BEGIN shell-density.css */
/* Mobile density: one safe area, scrolling chrome, and icon-sized disclosures.
   All rules are <=760px. Native actions, hidden-panel state and values remain authoritative. */
.mobile-density-filter-badge { display:none; }
@media (max-width:760px) {
  html:root.orders-crystal {
    --orders-safe-top:max(env(safe-area-inset-top,0px),var(--sabsus-safe-top,0px));
    --orders-safe-bottom:max(env(safe-area-inset-bottom,0px),var(--sabsus-safe-bottom,0px));
    --orders-section-gap:12px;
  }
  /* The native suite previously added this inset to body AND app-frame.
     The frame now owns it once, for both a browser and an iOS webview. */
  html:root.orders-crystal[data-sabsus-runtime="ios"] body {
    padding-top:0!important;
    padding-bottom:0!important;
  }
  html:root.orders-crystal body .app-frame {
    padding-top:calc(var(--orders-safe-top) + 8px)!important;
    padding-bottom:calc(84px + var(--orders-safe-bottom))!important;
  }
  html:root.orders-crystal body .app-header {
    position:relative!important;
    top:auto!important;
    min-height:52px!important;
    height:auto!important;
    padding:4px 6px!important;
    gap:6px!important;
    border-radius:var(--orders-radius-control,999px)!important;
  }
  html:root.orders-crystal body .app-header :is(.brand.sabsus-suite-trigger,.brand.sabsus-module-trigger) {
    min-width:0!important;
    min-height:44px!important;
    height:44px!important;
    padding:0 28px 0 6px!important;
    gap:7px!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    color:var(--text)!important;
  }
  html:root.orders-crystal body .app-header .brand > :is(canvas,.sg-pane) { display:none!important; }
  html:root.orders-crystal body .app-header .brand > .orders-dropdown-arrow { inset-inline-end:7px!important; }
  html:root.orders-crystal body .app-header :is(.suite-brand-mark,.brand-mark,.sabsus-company-mark) {
    width:28px!important;
    height:28px!important;
    min-width:28px!important;
    flex:0 0 28px!important;
  }
  html:root.orders-crystal body .app-header .suite-brand-copy {
    display:flex!important;
    flex-direction:row!important;
    align-items:center;
    gap:4px!important;
    max-width:none!important;
    min-width:0!important;
    overflow:hidden;
  }
  html:root.orders-crystal body .app-header .suite-brand-copy .suite-current-label {
    min-width:0;
    font-size:14px!important;
    line-height:20px!important;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  html:root.orders-crystal body .app-header .suite-brand-copy small {
    display:inline!important;
    flex:0 0 auto;
    font-size:10px!important;
    line-height:20px!important;
    white-space:nowrap;
    color:var(--muted)!important;
  }
  html:root.orders-crystal body .app-header .suite-brand-copy small::before { content:'· '; }
  html:root.orders-crystal body .app-header .header-actions { gap:2px!important; }
  html:root.orders-crystal body .app-header .header-actions > :is(.icon-btn,.profile-trigger) {
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    flex:0 0 44px!important;
  }
  html:root.orders-crystal body .layout { margin-top:10px!important; }
  html:root.orders-crystal body .main { padding-top:0!important; }
  html:root.orders-crystal body #page-content > .page-heading {
    padding-top:0!important;
    padding-bottom:10px!important;
    margin-top:0!important;
    gap:8px!important;
  }
  html:root.orders-crystal body #page-content > .page-heading h1 { margin-block:0!important; }
  html:root.orders-crystal body .order-mobile-nav {
    bottom:max(8px,var(--orders-safe-bottom))!important;
  }

  /* A real 44px button stays next to search. Existing flow toggle owns its
     expanded state, aria-controls and every original toolbar action. */
  html:root.orders-crystal body #page-content.flow-orders-layout .flow-orders-toolbar {
    gap:8px!important;
    margin-bottom:10px!important;
  }
  html:root.orders-crystal body #page-content.flow-orders-layout .flow-orders-toolbar .flow-order-search {
    order:0!important;
    flex:1 1 calc(100% - 52px)!important;
    width:calc(100% - 52px)!important;
    max-width:calc(100% - 52px)!important;
    min-width:0!important;
    margin:0!important;
  }
  html:root.orders-crystal body #page-content.flow-orders-layout .flow-orders-toolbar > .flow-mobile-tools-toggle {
    order:0!important;
    flex:0 0 44px!important;
    width:44px!important;
    max-width:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    height:44px!important;
  }
  html:root.orders-crystal body #page-content.flow-orders-layout .flow-orders-toolbar .flow-mobile-secondary {
    order:1!important;
  }
  html:root.orders-crystal body #page-content.flow-orders-layout .flow-order-search > input { min-width:0!important; }
  html:root.orders-crystal body #page-content.flow-orders-layout .flow-orders-list .empty {
    min-height:160px!important;
    padding:24px 18px!important;
    gap:8px!important;
  }
  html:root.orders-crystal body #page-content.flow-orders-layout .flow-orders-list .empty :is(h3,p) { margin-block:0!important; }

  /* Every icon has a native text label (visually clipped, still accessible),
     a native disclosure action, and a visible selected-filter count. */
  html:root.orders-crystal body #page-content .mobile-density-filter-control {
    position:relative!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    box-sizing:border-box!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0!important;
    margin:0!important;
    gap:0!important;
    border:0!important;
    border-radius:var(--orders-radius-control,999px)!important;
    background:var(--orders-control-fill,var(--control-surface))!important;
    box-shadow:var(--orders-control-shadow,none)!important;
    color:var(--text)!important;
    list-style:none!important;
    overflow:visible!important;
  }
  html:root.orders-crystal body #page-content .mobile-density-filter-control::before {
    content:''!important;
    /* The shared dropdown decorator owns an inline 44px end padding.
       Center against the button box, not its zero-width padded content box.
       Keeping that native padding avoids observer/style-write competition. */
    position:absolute!important;
    top:50%!important;
    left:50%!important;
    right:auto!important;
    bottom:auto!important;
    display:block!important;
    width:20px!important;
    height:20px!important;
    flex:0 0 20px!important;
    background:currentColor!important;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h5m4 0h7M4 17h11m4 0h1M9 4v6m6 4v6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/20px 20px no-repeat!important;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h5m4 0h7M4 17h11m4 0h1M9 4v6m6 4v6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/20px 20px no-repeat!important;
    transform:translate(-50%,-50%)!important;
    border:0!important;
    box-shadow:none!important;
  }
  html:root.orders-crystal body #page-content .mobile-density-filter-control::after { content:none!important; display:none!important; }
  html:root.orders-crystal body #page-content .mobile-density-filter-control > :not(.mobile-density-filter-badge) {
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    min-width:0!important;
    min-height:0!important;
    margin:-1px!important;
    padding:0!important;
    overflow:hidden!important;
    clip-path:inset(50%)!important;
    white-space:nowrap!important;
  }
  html:root.orders-crystal body #page-content .mobile-density-filter-control > :is(.orders-dropdown-arrow,.sg-pane,canvas) { display:none!important; }
  html:root.orders-crystal body #page-content .mobile-density-filter-control:is([aria-expanded="true"],.mobile-density-has-filters),
  html:root.orders-crystal body #page-content details[open] > .mobile-density-filter-control {
    background:var(--orders-control-selected,var(--control-surface))!important;
    box-shadow:var(--orders-control-selected-shadow,var(--orders-control-shadow,none))!important;
  }
  html:root.orders-crystal body #page-content .mobile-density-filter-control:focus-visible {
    outline:2px solid var(--orders-focus,var(--accent))!important;
    outline-offset:2px!important;
  }
  html:root.orders-crystal body #page-content .mobile-density-filter-control .mobile-density-filter-badge:not(:empty) {
    position:absolute;
    display:grid;
    place-items:center;
    top:0;
    inset-inline-end:0;
    min-width:16px;
    height:16px;
    padding:0 3px;
    border-radius:999px;
    background:var(--accent,#1761f5);
    color:white;
    font-size:10px;
    line-height:16px;
    font-weight:650;
    pointer-events:none;
  }

  /* Tasks: keep search + tools icon + refresh in the same positions when
     native details opens. Its body still occupies a full row in normal flow. */
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-tasks .ts-task-search.compact-workflow-search {
    order:2!important;
    flex:1 1 calc(100% - 104px)!important;
    width:calc(100% - 104px)!important;
    max-width:calc(100% - 104px)!important;
    min-width:0!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-tasks .ts-task-surface > details.compact-workflow-mobile-tools:not([open]) {
    order:3!important;
    flex:0 0 44px!important;
    width:44px!important;
    max-width:44px!important;
    min-width:44px!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-tasks .ts-task-surface > details.compact-workflow-mobile-tools[open] {
    order:5!important;
    flex:1 0 100%!important;
    width:100%!important;
    max-width:100%!important;
    position:relative!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-tasks .ts-task-surface > details.compact-workflow-mobile-tools[open] > summary.mobile-density-filter-control {
    position:absolute!important;
    /* The native flex root has a 10px row gap. Anchor back to the preceding
       44px search row, before refresh, without changing display:contents. */
    top:-54px!important;
    inset-inline-start:auto!important;
    inset-inline-end:52px!important;
    bottom:auto!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-tasks .ts-task-surface > details.compact-workflow-mobile-tools[open] > .compact-workflow-disclosure-body {
    margin-top:0!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-tasks .ts-task-surface:has(> details.compact-workflow-mobile-tools[open]) .ts-task-filters > [data-act="tasks-refresh"] {
    margin-inline-start:52px!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-tasks .ts-task-filters > [data-act="tasks-refresh"] { order:4!important; }

  /* Purchases / supplier requests reuse the existing, fully functional details. */
  html:root.orders-crystal body #page-content.procurement-page .procurement-toolbar {
    position:relative!important;
  }
  html:root.orders-crystal body #page-content.procurement-page .procurement-search {
    flex:1 1 calc(100% - 104px)!important;
    width:calc(100% - 104px)!important;
    max-width:calc(100% - 104px)!important;
    min-width:0!important;
  }
  html:root.orders-crystal body #page-content.procurement-page :is(.procurement-stock-disclosure,.procurement-request-filters):not([open]) {
    flex:0 0 44px!important;
    width:44px!important;
    max-width:44px!important;
    min-width:44px!important;
  }
  html:root.orders-crystal body #page-content.procurement-page :is(.procurement-stock-disclosure,.procurement-request-filters)[open] {
    flex:1 0 100%!important;
    width:100%!important;
    max-width:100%!important;
    position:static!important;
  }
  html:root.orders-crystal body #page-content.procurement-page :is(.procurement-stock-disclosure,.procurement-request-filters)[open] > summary.mobile-density-filter-control {
    position:absolute!important;
    top:0!important;
    inset-inline-start:auto!important;
    inset-inline-end:0!important;
    bottom:auto!important;
  }
  html:root.orders-crystal body #page-content.procurement-page :is(.procurement-stock-disclosure,.procurement-request-filters)[open] > :is(.procurement-filter-body,.journal-advanced-content) {
    margin-top:0!important;
  }
  html:root.orders-crystal body #page-content.procurement-page .procurement-stock-disclosure[open] > .procurement-filter-body {
    padding-top:0!important;
  }
  html:root.orders-crystal body #page-content.procurement-page .procurement-filter-body { padding-top:8px!important; }
}
@media (max-width:359px) {
  html:root.orders-crystal body .app-header .suite-brand-copy small { display:none!important; }
}


/* BEGIN brand-density-retake.css */
/* The shared workspace selector contains #workspace-apps in :is(), giving its
   dark gradient ID specificity even when it matches a plain brand link.
   Keep the mobile brand inside the single header surface in both themes. */
@media (max-width:760px) {
  html:root.orders-crystal body #app .app-header :is(.brand.sabsus-suite-trigger,.brand.sabsus-module-trigger) {
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    color:var(--text)!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
  html:root.orders-crystal body #app .app-header :is(.brand.sabsus-suite-trigger,.brand.sabsus-module-trigger) .suite-current-label {
    color:var(--text)!important;
    -webkit-text-fill-color:var(--text)!important;
  }
}


/* BEGIN order-density.css */
/* Mobile Order density. Append after workspace-audit-followup.css.
   The new controls reveal existing native nodes; desktop is unchanged. */
html:root.orders-crystal body .order-mobile-toggle { display:none!important; }
@media (max-width:760px) {
  html:root.orders-crystal body #page-content.order-mobile-density > .detail-heading {
    display:flex!important; flex-direction:column!important; align-items:stretch!important;
    gap:8px!important; padding:0!important; margin:0 0 10px!important;
  }
  html:root.orders-crystal body #page-content.order-mobile-density > .detail-heading > div:first-child {
    display:flex!important; flex-direction:column!important; align-items:stretch!important;
    gap:8px!important; width:100%!important; min-width:0;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .detail-heading .detail-title {
    display:grid!important; grid-template-columns:44px minmax(0,1fr) auto 44px!important;
    gap:6px!important; align-items:center; width:100%!important; min-width:0;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .detail-title > h1 {
    grid-column:2!important; grid-row:1; margin:0!important; min-width:0!important;
    font-size:clamp(20px,5.4vw,25px)!important; line-height:1.15!important;
    letter-spacing:-.6px; overflow-wrap:anywhere!important; white-space:normal!important;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .detail-title > [data-act="back-orders"] {
    grid-column:1; grid-row:1; width:44px!important; min-width:44px!important; height:44px!important; padding:0!important;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .detail-title > :is(.state-pill,.status-badge,.status-pill,.badge) {
    grid-column:3!important; grid-row:1; margin:0!important; max-width:90px;
    font-size:11px!important; line-height:1.25; padding:6px 8px!important; white-space:normal; overflow-wrap:anywhere;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .detail-title > .subline {
    grid-column:1 / -1; font-size:12px; margin:0;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-toggle {
    display:inline-flex!important; box-sizing:border-box; align-items:center; justify-content:center;
    width:44px!important; min-width:44px!important; height:44px!important; min-height:44px!important;
    flex:0 0 44px!important; margin:0!important; padding:0!important; border:0;
    border-radius:var(--orders-radius-control,999px)!important;
    background:var(--orders-control-fill,var(--control-surface))!important;
    color:var(--text)!important; box-shadow:var(--orders-control-shadow,none)!important;
    backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
  }
  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-toggle-heading { grid-column:4; grid-row:1; }
  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-toggle > svg { width:20px; height:20px; flex:none; }
  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-toggle:is([aria-expanded="true"],:focus-visible) {
    outline:2px solid var(--orders-focus,var(--text)); outline-offset:2px;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-toggle:not(.order-mobile-toggle-hint)[aria-expanded="true"] > svg { transform:rotate(180deg); }

  html:root.orders-crystal body #page-content.order-mobile-density:not(.order-mobile-heading-open) > .detail-heading .detail-meta,
  html:root.orders-crystal body #page-content.order-mobile-density:not(.order-mobile-heading-open) > .detail-heading > .heading-actions,
  html:root.orders-crystal body #page-content.order-mobile-density:not(.order-mobile-heading-open) > .timeline-steps { display:none!important; }
  html:root.orders-crystal body #page-content.order-mobile-density.order-mobile-heading-open .detail-meta {
    display:flex!important; flex-wrap:wrap; gap:6px!important; width:100%!important; margin:0!important;
  }
  html:root.orders-crystal body #page-content.order-mobile-density.order-mobile-heading-open > .detail-heading > .heading-actions {
    display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px!important; width:100%!important; margin:0!important;
  }
  html:root.orders-crystal body #page-content.order-mobile-density > .timeline-steps { margin:0 0 10px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .detail-tabs { margin:0 0 10px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .content-grid,
  html:root.orders-crystal body #page-content.order-mobile-density .content-grid > div > .vstack,
  html:root.orders-crystal body #page-content.order-mobile-density .side-summary { gap:10px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .content-grid .panel { padding:14px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .content-grid .section-top { min-height:44px; margin:0 0 8px!important; gap:8px; }
  html:root.orders-crystal body #page-content.order-mobile-density .section-top > h2 { min-width:0; flex:1; font-size:17px; line-height:1.3; }
  html:root.orders-crystal body #page-content.order-mobile-density .section-top > :is(.button,.icon-btn,.link-button) { min-height:44px!important; }

  /* Reveal the original calculation, including fees and editable discount.
     Final total, paid/due value and the native blue Pay remain visible. */
  html:root.orders-crystal body #page-content.order-mobile-density:not(.order-mobile-breakdown-open) .summary-panel > [data-order-mobile-breakdown] { display:none!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel { scroll-margin-top:12px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel > .summary-total { margin:0!important; padding:8px 0!important; border-top:0; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel > .summary-total strong { font-size:26px; line-height:1.25; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel > .summary-due { margin:6px 0 10px!important; padding:10px 12px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel > [data-act="pay"] { margin:0!important; min-height:44px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel > .summary-lines { gap:4px!important; margin:0 0 8px; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel > .summary-lines > div { min-height:24px; align-items:center; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel .summary-lines button { min-height:44px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel > .commercial-order-summary { margin:6px 0!important; padding:6px 0!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .summary-panel > .commercial-order-summary > div { min-height:44px; margin:0; gap:8px; }

  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-empty-customer > .section-top { margin:0!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-empty-customer > .empty { min-height:0!important; padding:4px 0 0!important; gap:4px!important; align-items:flex-start; text-align:start; }
  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-empty-customer > .empty h3 { margin:0!important; font-size:14px; line-height:1.4; }
  html:root.orders-crystal body #page-content.order-mobile-density .order-mobile-empty-customer > .empty p { margin:4px 0 0!important; font-size:12px; line-height:1.45; }
  html:root.orders-crystal body #page-content.order-mobile-density:not(.order-mobile-hint-open) .order-mobile-empty-customer [data-order-mobile-hint] { display:none!important; }

  html:root.orders-crystal body #page-content.order-mobile-density .flow-summary-shortcut { min-height:52px!important; padding:8px 14px!important; }
  html:root.orders-crystal body #page-content.order-mobile-density.order-mobile-summary-reached .flow-summary-shortcut { display:none!important; }
  html:root.orders-crystal body #page-content.order-mobile-density .flow-comments-panel { padding:8px 14px!important; }
}
@media (max-width:370px) {
  html:root.orders-crystal body #page-content.order-mobile-density .detail-title > :is(.state-pill,.status-badge,.status-pill,.badge) { max-width:70px; font-size:10px!important; padding-inline:6px!important; }
}
@media print {
  html:root.orders-crystal body .order-mobile-toggle { display:none!important; }
}


/* BEGIN order-density-retake.css */
/* V24 live retake: short mobile viewports and compact collapsed comments.
   Only the duplicate shortcut is suppressed; native totals and Pay stay in flow. */
@media (max-width:760px) and (max-height:500px) {
  html:root.orders-crystal body #page-content.order-mobile-density .flow-summary-shortcut { display:none!important; }
}
@media (max-width:760px) {
  /* iOS keyboards can reduce visualViewport without changing the layout-media
     height. Avoid a second fixed bar while editing a native page field. */
  html:root.orders-crystal body #page-content.order-mobile-density:has(:is(input,textarea,[contenteditable="true"]):focus) .flow-summary-shortcut { display:none!important; }

  /* The generic .content-grid .panel padding and section-top margin outranked
     the earlier comments rule, yielding ~80px for one collapsed44px control. */
  html:root.orders-crystal body #page-content.order-mobile-density .content-grid .flow-comments-panel:not(.flow-comments-open) {
    padding:0 14px!important;
    min-height:44px!important;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .content-grid .flow-comments-panel:not(.flow-comments-open) > .section-top {
    margin:0!important;
    padding:0!important;
    min-height:44px!important;
  }
  html:root.orders-crystal body #page-content.order-mobile-density .content-grid .flow-comments-panel:not(.flow-comments-open) .flow-comments-toggle {
    min-height:44px!important;
    padding:6px 0!important;
  }
}


/* BEGIN picker-density.css */
/* Mobile product / customer pickers. Presentation only; native action nodes stay intact. */
@media (max-width:760px) {
  html:root.orders-crystal body #dialog-scrim:has(> .density-picker-dialog, > .density-customer-dialog) {
    --picker-dialog-top:max(8px,var(--orders-safe-top,env(safe-area-inset-top,0px)));
    --picker-dialog-bottom:max(8px,var(--orders-safe-bottom,env(safe-area-inset-bottom,0px)));
    --picker-dialog-height:calc(var(--orders-viewport-height,100dvh) - var(--picker-dialog-top) - var(--picker-dialog-bottom));
    box-sizing:border-box!important;
    align-items:start!important;
    padding:var(--picker-dialog-top) max(8px,env(safe-area-inset-right,0px)) var(--picker-dialog-bottom) max(8px,env(safe-area-inset-left,0px))!important;
  }
  html:root.orders-crystal body #dialog-scrim > :is(.density-picker-dialog,.density-customer-dialog) {
    width:100%!important; max-width:none!important; min-width:0!important;
    max-height:var(--picker-dialog-height)!important;
    margin:0!important; border-radius:24px!important;
  }
  html:root.orders-crystal body #dialog-scrim > :is(.density-picker-dialog,.density-customer-dialog) > .dialog-scroll {
    display:flex!important; flex-direction:column!important; box-sizing:border-box!important;
    height:var(--picker-dialog-height)!important; max-height:var(--picker-dialog-height)!important;
    min-height:0!important; gap:0!important;
    padding:12px!important; overflow:hidden!important; scrollbar-gutter:auto!important;
  }
  html:root.orders-crystal body #dialog-scrim > :is(.density-picker-dialog,.density-customer-dialog) > .dialog-close {
    inset-inline-end:12px!important; top:12px!important; width:44px!important; height:44px!important; min-width:44px!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .modal-head {
    display:grid!important; grid-template-columns:minmax(0,1fr) 44px!important; align-items:center!important;
    flex:0 0 auto!important; gap:0 4px!important; min-height:44px!important;
    padding:0 48px 0 0!important; margin:0 0 8px!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .modal-head > h2 {
    min-width:0!important; margin:0!important; padding:0!important;
    font-size:20px!important; line-height:1.2!important; letter-spacing:-.35px!important;
    overflow-wrap:anywhere!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .density-dialog-info,
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .density-picker-tools-toggle {
    display:inline-flex!important; align-items:center!important; justify-content:center!important;
    box-sizing:border-box!important; position:relative!important;
    width:44px!important; height:44px!important; min-width:44px!important; min-height:44px!important;
    padding:0!important; margin:0!important; border:0!important; border-radius:999px!important;
    background:var(--orders-control-fill,var(--control-surface))!important;
    color:var(--text)!important; box-shadow:var(--orders-control-shadow,var(--card-edge))!important;
    flex:0 0 44px!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-dialog-info,.density-picker-tools-toggle) > svg {
    width:20px!important; height:20px!important; min-width:20px!important; flex:none!important;
    color:inherit!important; stroke:currentColor!important; pointer-events:none!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .modal-head > .density-dialog-hint {
    grid-column:1 / -1!important; margin:8px -48px 0 0!important; padding:10px 12px!important;
    font-size:12px!important; line-height:1.45!important; color:var(--muted)!important;
    border:0!important; border-radius:16px!important; background:var(--orders-control-fill,var(--control-surface))!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-dialog-hint[hidden],
  html:root.orders-crystal body #dialog-scrim .density-picker-tools-popup[hidden] { display:none!important; }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .mobile-tab-switch {
    min-height:44px!important; height:44px!important; padding:3px!important; margin:0 0 8px!important; gap:3px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .mobile-tab-switch > button {
    min-width:0!important; min-height:38px!important; height:38px!important; padding:6px 10px!important;
    font-size:13px!important; line-height:1.2!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-grid {
    min-height:0!important; min-width:0!important; flex:1 1 auto!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.picker-catalog,.picker-selected) {
    min-width:0!important; padding:8px!important; gap:0!important; border-radius:20px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .density-picker-search-row {
    display:flex!important; align-items:center!important; position:relative!important;
    gap:6px!important; flex:0 0 auto!important; min-width:0!important; margin:0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .density-picker-search-row > .search-shell {
    flex:1 1 0!important; min-width:0!important; width:0!important; max-width:none!important; margin:0!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .search-shell {
    display:flex!important; align-items:center!important; box-sizing:border-box!important;
    min-width:0!important; min-height:44px!important; height:44px!important;
    gap:8px!important; padding:0 0 0 12px!important; border-radius:999px!important;
    overflow:hidden!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .search-shell > input {
    position:relative!important; flex:1 1 0!important; width:0!important; min-width:0!important;
    height:44px!important; margin:0!important; padding:0!important; font-size:16px!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .search-shell > .icon {
    flex:0 0 18px!important; width:18px!important; height:18px!important; min-width:18px!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .search-shell > :is(.history-trigger,.icon-btn) {
    position:relative!important; inset:auto!important; display:inline-flex!important;
    align-items:center!important; justify-content:center!important; flex:0 0 44px!important;
    width:44px!important; min-width:44px!important; height:44px!important; min-height:44px!important;
    margin:0!important; padding:0!important; border:0!important; border-radius:999px!important;
    color:var(--text)!important; background:transparent!important; box-shadow:none!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .density-picker-tools-popup {
    position:absolute!important; z-index:15!important; top:calc(100% + 6px)!important; inset-inline-end:0!important;
    box-sizing:border-box!important; width:min(280px,100%)!important; padding:6px!important;
    border:0!important; border-radius:20px!important; background:var(--card-surface)!important;
    box-shadow:var(--card-edge),0 12px 28px #0003!important;
    backdrop-filter:blur(28px)!important; -webkit-backdrop-filter:blur(28px)!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-tools {
    display:flex!important; flex-direction:column!important; align-items:stretch!important;
    min-width:0!important; gap:4px!important; margin:0!important; padding:0!important;
    background:transparent!important; border:0!important; border-radius:16px!important; box-shadow:none!important;
    backdrop-filter:none!important; -webkit-backdrop-filter:none!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-tools > button {
    display:flex!important; align-items:center!important; justify-content:flex-start!important; gap:10px!important;
    width:100%!important; min-height:44px!important; padding:8px 12px!important; margin:0!important;
    font-size:13px!important; line-height:1.3!important; color:var(--text)!important; border-radius:14px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .catalog-category-nav {
    display:flex!important; align-items:center!important; gap:4px!important; min-width:0!important;
    flex:0 0 auto!important; margin:6px 0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .catalog-category-nav > .icon-btn {
    width:44px!important; min-width:44px!important; height:44px!important; min-height:44px!important;
    flex:0 0 44px!important; padding:0!important; margin:0!important; border-radius:999px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .catalog-categories {
    min-width:0!important; margin:6px 0!important; padding:0!important; gap:6px!important;
    min-height:44px!important; align-items:center!important; flex:0 0 auto!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .catalog-category-nav > .catalog-categories {
    flex:1 1 0!important; width:0!important; margin:0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .catalog-categories > .category {
    box-sizing:border-box!important; flex:0 0 auto!important; min-height:44px!important; height:44px!important;
    padding:9px 12px!important; font-size:13px!important; line-height:1.2!important;
    border-radius:999px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.catalog-scroll,.selected-scroll) {
    min-width:0!important; min-height:0!important; overflow-y:auto!important; overflow-x:hidden!important;
    overscroll-behavior:contain!important; scrollbar-gutter:auto!important; padding-inline:0!important;
  }
  /* The live paged catalog differs from the old .catalog-row markup. Reserve
     a real 44px action column and put price below the name on narrow screens. */
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.paged-product-row,.catalog-row) {
    display:grid!important; grid-template-columns:32px minmax(0,1fr) 44px!important;
    grid-template-areas:"thumb name add" "thumb price add"!important;
    align-items:center!important; gap:3px 8px!important; min-width:0!important; min-height:72px!important;
    padding:9px 0!important; margin:0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.paged-product-row,.catalog-row) > :is(.catalog-thumb,.product-image) {
    grid-area:thumb!important; display:flex!important; width:32px!important; height:36px!important; min-width:32px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.paged-product-name,.catalog-row > div) {
    grid-area:name!important; min-width:0!important; width:auto!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.paged-product-name > strong,.catalog-row .product-name) {
    display:block!important; font-size:14px!important; line-height:1.3!important; overflow-wrap:anywhere!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.paged-product-name > small,.catalog-row .subline) {
    display:block!important; margin-top:2px!important; font-size:11px!important; line-height:1.3!important;
    white-space:normal!important; overflow-wrap:anywhere!important; color:var(--muted)!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.paged-product-row,.catalog-row) > .catalog-price {
    grid-area:price!important; margin:0!important; min-width:0!important; padding:0!important;
    font-size:13px!important; line-height:1.3!important; text-align:start!important;
    white-space:normal!important; overflow-wrap:anywhere!important; color:var(--text)!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog :is(.paged-product-row,.catalog-row) > [data-act="picker-add"] {
    grid-area:add!important; box-sizing:border-box!important;
    width:44px!important; min-width:44px!important; height:44px!important; min-height:44px!important;
    padding:0!important; margin:0!important; border-radius:999px!important; color:var(--text)!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .mobile-picker-next {
    flex:0 0 auto!important; padding:8px 0 0!important; margin:0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .mobile-picker-next > button {
    min-height:44px!important; padding:9px 12px!important; gap:8px!important;
    font-size:13px!important; white-space:normal!important; line-height:1.3!important;
  }
  /* A small selection does not need an almost-empty, full-height sheet. */
  html:root.orders-crystal body #dialog-scrim > .density-picker-dialog:has(.picker-grid[data-mobile="selected"]) > .dialog-scroll {
    height:auto!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-grid[data-mobile="selected"] {
    flex:0 1 auto!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-grid[data-mobile="selected"] > .picker-selected {
    height:auto!important; max-height:calc(var(--picker-dialog-height) - 116px)!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .product-row {
    position:relative!important; grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-areas:"product product" "quantity price" "amount amount"!important;
    gap:8px!important; min-height:0!important; padding:10px 0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .product-cell {
    min-height:44px!important; padding-inline-end:52px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .row-menu {
    grid-area:auto!important; position:absolute!important; inset-inline-end:0!important; top:10px!important;
    width:44px!important; height:44px!important; min-width:44px!important; min-height:44px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .product-name {
    font-size:14px!important; line-height:1.3!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .product-cell small {
    font-size:11px!important; margin-top:2px!important; line-height:1.3!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .product-image {
    width:32px!important; height:36px!important; flex:0 0 32px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected :is(.qty,.price-entry) {
    display:grid!important; box-sizing:border-box!important; min-width:0!important; width:100%!important;
    height:44px!important; min-height:44px!important; overflow:hidden!important; border-radius:999px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .qty {
    grid-template-columns:44px minmax(0,1fr) 44px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .price-entry {
    grid-template-columns:minmax(0,1fr) 44px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected :is(.qty,.price-entry) > :is(input,button) {
    box-sizing:border-box!important; position:static!important; width:100%!important; min-width:0!important;
    height:44px!important; min-height:44px!important; margin:0!important; padding:0!important;
    border:0!important; background:transparent!important; box-shadow:none!important;
    color:var(--text)!important; -webkit-text-fill-color:var(--text)!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .price-entry > input {
    padding-inline:10px 0!important; font-size:16px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .price-source {
    margin-top:3px!important; font-size:10px!important; line-height:1.2!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-selected .amount {
    padding:0!important; font-size:14px!important; line-height:1.3!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog #picker-error:empty { display:none!important; }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-footer {
    display:grid!important; grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr)!important;
    align-items:center!important; gap:8px!important; margin-top:8px!important; padding:8px 0 0!important;
    border-top:1px solid var(--line)!important; border-radius:0!important;
    background:transparent!important; box-shadow:none!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-footer .total-block {
    min-width:0!important; margin:0!important; padding:0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-footer .total-block > span,
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-footer .picker-cancel { display:none!important; }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-footer .total-block > strong {
    display:block!important; font-size:21px!important; line-height:1.2!important; overflow-wrap:anywhere!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-footer [data-act="picker-save"] {
    grid-column:2!important; min-width:0!important; width:100%!important; min-height:44px!important;
    padding:9px 10px!important; font-size:13px!important; line-height:1.25!important;
    gap:6px!important; white-space:normal!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .scrolling-content {
    flex:1 1 auto!important; min-height:0!important; max-height:none!important;
    margin:8px 0 0!important; padding:0!important; overflow-y:auto!important; overflow-x:hidden!important;
    overscroll-behavior:contain!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .history-choice {
    box-sizing:border-box!important; display:flex!important; align-items:center!important; gap:10px!important;
    width:100%!important; min-width:0!important; min-height:60px!important; padding:10px!important; margin:0 0 6px!important;
    color:var(--text)!important; border:0!important; border-radius:18px!important;
    background:var(--orders-control-fill,var(--control-surface))!important;
    box-shadow:var(--orders-control-shadow,var(--card-edge))!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .customer-cell {
    display:flex!important; align-items:center!important; gap:10px!important; min-width:0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .customer-cell > div {
    min-width:0!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .avatar-square {
    width:32px!important; height:32px!important; min-width:32px!important; flex:0 0 32px!important;
    border:0!important; border-radius:50%!important; background:var(--orders-control-fill,var(--control-surface))!important;
    color:var(--muted)!important; box-shadow:var(--orders-control-shadow,var(--card-edge))!important;
    font-size:11px!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .history-choice strong {
    display:block!important; min-width:0!important; font-size:14px!important; line-height:1.3!important; overflow-wrap:anywhere!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .history-choice small {
    font-size:12px!important; line-height:1.3!important; margin-top:3px!important; overflow-wrap:anywhere!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .history-choice small:is(:empty,.density-duplicate-contact) { display:none!important; }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .history-choice > .icon {
    flex:0 0 18px!important; width:18px!important; height:18px!important; color:var(--muted)!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .modal-footer {
    display:flex!important; flex:0 0 auto!important; gap:8px!important; padding:8px 0 0!important; margin:6px 0 0!important;
    background:transparent!important; border-top:1px solid var(--line)!important; box-shadow:none!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-customer-dialog .modal-footer > button {
    flex:1 1 0!important; min-width:0!important; min-height:44px!important; padding:9px 10px!important;
    font-size:13px!important; line-height:1.25!important; gap:6px!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-dialog-info,.density-picker-tools-toggle):focus-visible {
    outline:2px solid var(--orders-focus,var(--text))!important; outline-offset:2px!important;
  }
}


/* BEGIN picker-density-v25.css */
/* Follow-up from actual V24 screenshots: readable tools and a scrollable
   fallback when a short viewport cannot hold search, categories and a list. */
@media (max-width:760px) {
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .density-picker-tools-popup {
    background:rgba(31,32,35,.98)!important;
    color:var(--text)!important; opacity:1!important; isolation:isolate!important;
    box-shadow:var(--card-edge),0 12px 28px #0005!important;
  }
  html:root.orders-crystal[data-orders-theme="light"] body #dialog-scrim .density-picker-dialog .density-picker-tools-popup {
    background:rgba(250,249,246,.98)!important;
    box-shadow:var(--card-edge),0 12px 28px #27231b26!important;
  }
  html:root.orders-crystal body #dialog-scrim :is(.density-picker-dialog,.density-customer-dialog) .search-shell > :is(.history-trigger,.icon-btn) > :is(.icon,svg),
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .price-entry > .history-trigger > :is(.icon,svg) {
    color:inherit!important; stroke:currentColor!important;
    width:20px!important; height:20px!important; min-width:20px!important; flex:0 0 20px!important;
  }
}
@media (max-width:760px) and (max-height:500px) {
  /* Keep a usable two-row list instead of allowing flexbox to shrink it to
     zero. The outer sheet scrolls to every control, while Close stays outside
     that scroller. Scroll chaining makes the footer reachable from the list. */
  html:root.orders-crystal body #dialog-scrim > .density-picker-dialog:has(.picker-grid[data-mobile="catalog"]) > .dialog-scroll {
    height:auto!important; max-height:var(--picker-dialog-height)!important;
    overflow-y:auto!important; overflow-x:hidden!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-grid[data-mobile="catalog"] {
    flex:0 0 auto!important; min-height:0!important; height:auto!important; overflow:visible!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-grid[data-mobile="catalog"] > .picker-catalog {
    height:auto!important; min-height:0!important; max-height:none!important;
  }
  html:root.orders-crystal body #dialog-scrim .density-picker-dialog .picker-catalog .catalog-scroll {
    flex:0 0 auto!important; height:clamp(144px,42dvh,220px)!important;
    min-height:144px!important; max-height:220px!important;
    overflow-y:auto!important; overscroll-behavior-y:auto!important;
  }
}


/* BEGIN writeoffs-density.css */
/* Mobile Write-offs only. The original filter section stays in place;
   its original refresh group is restored at desktop width by the enhancer. */
@media (max-width:760px) {
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page {
    row-gap:10px!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .page-heading {
    display:flex!important;
    align-items:center!important;
    flex:1 0 100%!important;
    width:100%!important;
    min-width:0!important;
    order:10!important;
    gap:8px!important;
    margin:0!important;
    padding:0!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .page-heading > div:first-child {
    flex:1 1 auto!important;
    min-width:0!important;
    width:auto!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .page-heading > .mobile-writeoffs-filter-trigger {
    flex:0 0 44px!important;
    order:15!important;
    align-self:center!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .page-heading > .heading-actions {
    display:flex!important;
    flex:0 1 auto!important;
    min-width:0!important;
    max-width:calc(100% - 150px)!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .page-heading > .heading-actions > [data-act="writeoff-new"] {
    min-width:0!important;
    max-width:100%!important;
    width:auto!important;
    height:auto!important;
    min-height:44px!important;
    padding:10px 12px!important;
    white-space:normal!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > [data-stock-journal="writeoffs"].mobile-writeoffs-filter-panel {
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:8px!important;
    order:30!important;
    flex:1 0 100%!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:12px!important;
    border-radius:var(--orders-radius-card,24px)!important;
    background:var(--card-surface)!important;
    box-shadow:var(--card-edge)!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > [data-stock-journal="writeoffs"].mobile-writeoffs-filter-panel[hidden] {
    display:none!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .mobile-writeoffs-filter-panel > :is(.stock-date-filters,label:has(> [data-stock-warehouse])) {
    flex:1 1 calc(50% - 4px)!important;
    min-width:0!important;
    max-width:none!important;
    width:calc(50% - 4px)!important;
    order:0!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .mobile-writeoffs-filter-panel > .stock-date-filters[open] {
    flex-basis:100%!important;
    width:100%!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .mobile-writeoffs-filter-panel > .stock-date-filters > summary {
    box-sizing:border-box;
    width:100%!important;
    min-height:44px!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .mobile-writeoffs-filter-panel > label > [data-stock-warehouse] {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .mobile-writeoffs-filter-panel > :is([data-act="stock-period-apply"],[data-act="stock-period-reset"]) {
    flex:1 1 calc((100% - 60px) / 2)!important;
    min-width:0!important;
    max-width:none!important;
    width:auto!important;
    order:1!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .mobile-writeoffs-filter-panel > .writeoff-toolbar {
    display:flex!important;
    flex:0 0 44px!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    min-height:44px!important;
    order:1!important;
    gap:0!important;
    margin:0!important;
    padding:0!important;
  }
  html:root.orders-crystal body #page-content.mobile-writeoffs-density.compact-ops-page > .mobile-writeoffs-filter-panel > .writeoff-toolbar > [data-act="writeoff-refresh"] {
    flex:0 0 44px!important;
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
    padding:0!important;
  }
}


/* BEGIN inventory-density.css */
/* Mobile inventory: search and two 44px tools; existing native filter disclosure. */
@media (max-width:760px) {
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .stock-toolbar.inventory-density-toolbar {
    position:relative!important; display:grid!important;
    grid-template-columns:minmax(0,1fr) 44px 44px!important;
    align-items:center!important; gap:8px!important;
    flex:1 0 100%!important; order:2!important; box-sizing:border-box!important;
    width:100%!important; max-width:100%!important; min-width:0!important;
    margin:0!important; padding:0!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-toolbar > .search-shell {
    grid-column:1!important; grid-row:1!important; order:0!important;
    width:100%!important; max-width:none!important; min-width:0!important;
    height:44px!important; min-height:44px!important; margin:0!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-toolbar > .search-shell > input {
    min-width:0!important; width:100%!important; font-size:16px!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-toolbar > .inventory-filter-disclosure,
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-toolbar > .inventory-filter-disclosure[open] {
    position:static!important; display:block!important; grid-column:2!important; grid-row:1!important;
    box-sizing:border-box!important; flex:0 0 44px!important;
    width:44px!important; min-width:44px!important; max-width:44px!important;
    height:44px!important; min-height:44px!important; margin:0!important; padding:0!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-toolbar > [data-act="inventory-refresh"] {
    grid-column:3!important; grid-row:1!important;
    width:44px!important; min-width:44px!important; height:44px!important; min-height:44px!important;
    margin:0!important; padding:0!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-summary {
    position:relative!important; display:block!important; box-sizing:border-box!important;
    width:44px!important; min-width:44px!important; max-width:44px!important;
    height:44px!important; min-height:44px!important; margin:0!important; padding:0!important;
    border:0!important; border-radius:999px!important; font-size:0!important; line-height:0!important;
    overflow:hidden!important; list-style:none!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-summary::after,
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-summary > .orders-dropdown-arrow { display:none!important; content:none!important; }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-summary > .inventory-density-filter-icon {
    position:absolute!important; left:50%!important; top:50%!important; right:auto!important; bottom:auto!important;
    transform:translate(-50%,-50%)!important; width:20px!important; height:20px!important;
    min-width:20px!important; margin:0!important; padding:0!important;
    color:var(--text)!important; stroke:currentColor!important; fill:none!important;
    pointer-events:none!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-summary:focus-visible {
    outline:2px solid var(--orders-focus,var(--text))!important; outline-offset:2px!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-toolbar .inventory-filter-disclosure[open] > .inventory-filter-content {
    position:absolute!important; z-index:50!important; display:grid!important;
    inset:calc(100% + 8px) 0 auto 0!important; width:100%!important; max-width:100%!important;
    max-height:min(60dvh,430px)!important; overflow-y:auto!important; overflow-x:hidden!important;
    overscroll-behavior:contain!important; box-sizing:border-box!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:10px!important;
    margin:0!important; padding:12px!important; border-radius:20px!important;
    background:rgba(31,32,35,.98)!important; color:var(--text)!important;
    box-shadow:var(--card-edge),0 12px 28px #0005!important;
    backdrop-filter:blur(26px)!important; -webkit-backdrop-filter:blur(26px)!important;
  }
  html:root.orders-crystal[data-orders-theme="light"] body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-toolbar .inventory-filter-disclosure[open] > .inventory-filter-content {
    background:rgba(250,249,246,.98)!important;
    box-shadow:var(--card-edge),0 12px 28px #27231b26!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-toolbar .inventory-filter-disclosure:not([open]) > .inventory-filter-content { display:none!important; }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-filter-content > .inventory-density-storage {
    position:relative!important; display:block!important; grid-column:1 / -1!important; grid-row:auto!important; order:-1!important;
    flex:none!important; width:100%!important; max-width:100%!important; min-width:0!important;
    margin:0!important; padding:0!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-storage > .field-label {
    display:block!important; margin:0 0 6px!important; padding:0!important;
    font-size:12px!important; line-height:1.3!important; color:var(--muted)!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-storage > [data-act="inventory-storage"] {
    display:flex!important; align-items:center!important; justify-content:flex-start!important; gap:8px!important;
    box-sizing:border-box!important; width:100%!important; min-width:0!important; height:44px!important; min-height:44px!important; margin:0!important;
    padding-inline-end:44px!important;
  }
  /* The native warehouse chevron is a sibling of its button. Keep that
     original node over the final 44px field, outside the label's flow. */
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-storage > [data-act="inventory-storage"] + svg {
    position:absolute!important; display:block!important;
    top:auto!important; bottom:14px!important; inset-inline-start:auto!important; inset-inline-end:14px!important;
    width:16px!important; min-width:16px!important; height:16px!important;
    margin:0!important; padding:0!important; transform:none!important;
    color:var(--text)!important; stroke:currentColor!important; fill:none!important;
    pointer-events:none!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-density-storage > [data-act="inventory-storage"] > span {
    min-width:0!important; overflow:hidden!important; text-overflow:ellipsis!important; white-space:nowrap!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-filter-content > :is(div,label) {
    min-width:0!important; max-width:100%!important;
  }
  html:root.orders-crystal body #page-content.inventory-density-page.inventory-consistency-page .inventory-filter-content > div > button {
    max-width:100%!important; min-width:0!important;
  }
}


/* BEGIN section-density.css */
/* Mobile settings navigation: one search row plus the native category chooser.
   Load after workspace-audit-followup.css. No DOM or settings values change. */
@media (max-width: 760px) {
  html:root.orders-crystal body #page-content.settings-redesign-layout > .page-heading {
    margin-bottom: 8px!important;
  }
  html:root.orders-crystal body #page-content.settings-redesign-layout > .settings-redesign-nav {
    margin-bottom: 10px!important;
  }
  html:root.orders-crystal body #page-content .ops-settings-nav.settings-redesign-nav > .ops-settings-tools {
    display: grid!important;
    grid-template-columns: minmax(0,1fr) 44px!important;
    align-items: center;
    gap: 8px!important;
    width: 100%;
    min-width: 0;
  }
  html:root.orders-crystal body #page-content .settings-redesign-nav > .ops-settings-tools > .ops-settings-search {
    grid-column: 1;
    grid-row: 1;
    width: 100%!important;
    min-width: 0!important;
    margin: 0!important;
  }
  html:root.orders-crystal body #page-content .settings-redesign-nav > .ops-settings-tools > .ops-settings-switch {
    grid-column: 2;
    grid-row: 1;
    display: block!important;
    position: relative!important;
    box-sizing: border-box!important;
    width: 44px!important;
    min-width: 44px!important;
    max-width: 44px!important;
    height: 44px!important;
    min-height: 44px!important;
    max-height: 44px!important;
    padding-block: 0!important;
    padding-inline-start: 0!important;
    border: 0!important;
    margin: 0!important;
    /* The shared dropdown enhancer owns inline padding-inline-end:44px.
       With no border/start padding, that padding fits this 44px control.
       The current category icon is centered independently of the content box. */
  }
  html:root.orders-crystal body #page-content .settings-redesign-nav > .ops-settings-tools > .ops-settings-switch > .ops-category-icon {
    position: absolute!important;
    inset: 0!important;
    display: grid!important;
    place-items: center;
    width: 100%!important;
    min-width: 0!important;
    height: 100%!important;
    margin: 0!important;
    pointer-events: none;
  }
  html:root.orders-crystal body #page-content .settings-redesign-nav > .ops-settings-tools > .ops-settings-switch > .ops-category-icon svg {
    width: 20px!important;
    height: 20px!important;
    margin: 0!important;
  }
  html:root.orders-crystal body #page-content .settings-redesign-nav > .ops-settings-tools > .ops-settings-switch > [data-selected-label] {
    position: absolute!important;
    width: 1px!important;
    height: 1px!important;
    margin: -1px!important;
    padding: 0!important;
    overflow: hidden!important;
    clip: rect(0,0,0,0)!important;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0!important;
  }
  html:root.orders-crystal body #page-content .settings-redesign-nav > .ops-settings-tools > .ops-settings-switch > svg {
    display: none!important;
  }
  html:root.orders-crystal body #page-content .settings-redesign-nav > .ops-settings-tools > .ops-settings-switch[aria-expanded="true"] {
    color: var(--accent, #1766f5)!important;
    box-shadow: inset 0 0 0 2px currentColor;
  }
  html:root.orders-crystal body #page-content .settings-redesign-nav > .ops-settings-tools > .ops-settings-switch:focus-visible {
    outline: 2px solid var(--accent, #1766f5)!important;
    outline-offset: 3px;
  }
}


/* BEGIN shifts-density.css */
/* Mobile Shifts: existing tabs and native filter disclosure share one row.
   Original End shift / Add shift actions remain visible and unchanged. */
.shift-mobile-filter-count { display:none; }
@media (max-width:760px) {
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .shift-journal-toolbar {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 44px;
    align-items:start;
    gap:8px!important;
    flex:1 0 100%!important;
    order:3!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .shift-journal-toolbar > .tabs.compact-workflow-types {
    grid-column:1!important;
    grid-row:1!important;
    align-self:start;
    position:relative;
    z-index:1;
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:44px!important;
    margin:0!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .shift-journal-toolbar > .tabs.compact-workflow-types > .tab {
    flex:1 1 0;
    min-width:0;
    min-height:44px;
    padding-inline:8px!important;
    font-size:13px!important;
    white-space:normal;
    text-align:center;
    line-height:1.25;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .shift-journal-filters > .journal-advanced-filters {
    display:block!important;
    grid-column:2!important;
    grid-row:1!important;
    align-self:start;
    width:44px!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .shift-journal-filters > .journal-advanced-filters[open] {
    /* Open details span both columns; their summary stays in the right column.
       The tabs overlap only the empty left side of that 44px summary row. */
    grid-column:1 / -1!important;
    width:100%!important;
  }
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-journal-filters > .journal-advanced-filters > .shift-mobile-filter-toggle {
    position:relative!important;
    display:block!important;
    box-sizing:border-box!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    padding-block:0!important;
    padding-inline-start:0!important;
    margin:0 0 0 auto!important;
    border:0!important;
    border-radius:var(--orders-radius-control,999px)!important;
    font-size:0!important;
    list-style:none!important;
    color:var(--text)!important;
    background:var(--orders-control-fill,var(--control-surface))!important;
    box-shadow:var(--orders-control-shadow,none)!important;
    overflow:visible!important;
  }
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-mobile-filter-toggle::-webkit-details-marker { display:none; }
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-mobile-filter-toggle::before {
    content:''!important;
    position:absolute!important;
    inset:12px!important;
    display:block!important;
    width:20px!important;
    height:20px!important;
    background:currentColor!important;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h5m4 0h7M4 17h11m4 0h1M9 4v6m6 4v6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/20px 20px no-repeat!important;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h5m4 0h7M4 17h11m4 0h1M9 4v6m6 4v6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/20px 20px no-repeat!important;
    pointer-events:none;
  }
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-mobile-filter-toggle::after,
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-mobile-filter-toggle > :is(svg,canvas,.sg-pane) { display:none!important; content:none!important; }
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-mobile-filter-toggle[aria-expanded="true"],
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-mobile-filter-toggle.shift-mobile-has-filters {
    color:var(--accent,#1766f5)!important;
    background:var(--orders-control-selected,var(--control-surface))!important;
    box-shadow:var(--orders-control-selected-shadow,var(--orders-control-shadow,none))!important;
  }
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-mobile-filter-toggle:focus-visible {
    outline:2px solid var(--orders-focus,var(--accent,#1766f5))!important;
    outline-offset:2px;
  }
  html:root.orders-crystal body #page-content.shift-mobile-density .shift-mobile-filter-count:not([hidden]) {
    position:absolute;
    display:grid;
    place-items:center;
    top:-2px;
    inset-inline-end:-2px;
    min-width:16px;
    height:16px;
    padding:0 3px;
    box-sizing:border-box;
    border-radius:999px;
    font-size:10px;
    font-weight:600;
    color:var(--on-accent,#fff);
    background:var(--accent,#1766f5);
    pointer-events:none;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .journal-advanced-filters:not([open]) > .journal-advanced-content {
    display:none!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .journal-advanced-filters[open] > .journal-advanced-content {
    position:static!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px!important;
    box-sizing:border-box;
    width:100%!important;
    max-width:100%!important;
    margin-top:8px!important;
    padding:12px!important;
    border-radius:var(--orders-radius-panel,22px);
    background:var(--orders-panel-fill,var(--card-surface));
    box-shadow:var(--orders-panel-shadow,var(--card-edge));
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .journal-advanced-content > label {
    display:grid!important;
    grid-column:auto!important;
    grid-row:auto!important;
    gap:6px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:13px!important;
  }
  html:root.orders-crystal body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-shifts.shift-mobile-density .journal-advanced-content > .shift-mobile-period {
    grid-column:1 / -1!important;
  }
  html:root.orders-crystal body #page-content.shift-mobile-density .journal-advanced-content :is(select,input,button) {
    box-sizing:border-box;
    min-width:0!important;
    max-width:100%!important;
    min-height:44px!important;
  }
  html:root.orders-crystal body #page-content.shift-mobile-density .journal-advanced-content :is(select,input) { width:100%!important; font-size:16px!important; }
  html:root.orders-crystal body #page-content.shift-mobile-density .journal-advanced-content > .shift-filter-summary {
    grid-column:1 / -1!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    font-size:12px;
    text-align:start;
  }
}


/* BEGIN catalog-density.css */
/* Products only, mobile only. Original CW groups and popup owners stay put. */
@media (max-width:760px) {
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px!important;
    align-items:start!important;
    gap:8px!important;
    margin-bottom:10px!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .cw-search.toolbar {
    grid-column:1 / 3!important;
    grid-row:1!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .mobile-catalog-filter-trigger {
    grid-column:3!important;
    grid-row:1!important;
    justify-self:end!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density[data-mobile-catalog-expanded="false"] > :is(.cw-type-group,.cw-category-picker,.cw-advanced) {
    display:none!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .cw-type-group {
    grid-column:1!important;
    grid-row:2!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .cw-category-picker {
    grid-column:2!important;
    grid-row:2!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .cw-advanced {
    grid-column:3!important;
    grid-row:2!important;
  }
  /* The original advanced summary is a 44px control as well. The shared
     dropdown owns inline end-padding, so center its original SVG absolutely. */
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .cw-advanced > summary.cw-trigger {
    position:relative!important;
    box-sizing:border-box!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    gap:0!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .cw-advanced > summary.cw-trigger > .cw-filter-icon {
    position:absolute!important;
    left:50%!important;
    top:50%!important;
    width:20px!important;
    height:20px!important;
    margin:0!important;
    transform:translate(-50%,-50%)!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .cw-advanced > summary.cw-trigger > :is(.orders-dropdown-arrow,.cw-chevron,.cw-filter-label) {
    display:none!important;
  }
  html:root.orders-crystal body #page-content.cw-catalog-page #catalog-workspace.mobile-catalog-density > .cw-advanced > summary.cw-trigger > .cw-filter-count {
    position:absolute!important;
    top:0!important;
    inset-inline-end:0!important;
    min-width:16px!important;
    height:16px!important;
    padding:0 3px!important;
    font-size:10px!important;
    line-height:16px!important;
  }
}


/* BEGIN final-sections.css */
/* Mobile-only Promotions and Documents retake. Load after the existing audit
   and density styles. Native nodes, labels, permissions and actions are intact. */
@media (max-width:760px) {
  /* Counter the old <=680px container rule that makes search a full row. */
  html:root.orders-crystal body #page-content.compact-ops-page.compact-ops-promotions > .promotion-toolbar.compact-ops-tools:not([hidden]) {
    display:flex!important;
    flex:1 1 100%!important;
    flex-wrap:nowrap!important;
    align-items:center;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  html:root.orders-crystal body #page-content.compact-ops-page.compact-ops-promotions > .promotion-toolbar.compact-ops-tools > .search-shell {
    flex:1 1 0!important;
    width:0!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
  }
  html:root.orders-crystal body #page-content.compact-ops-page.compact-ops-promotions > .promotion-toolbar.compact-ops-tools > .search-shell > #promotion-search {
    flex:1 1 0!important;
    width:100%!important;
    min-width:0!important;
    font-size:16px!important;
  }
  html:root.orders-crystal body #page-content.compact-ops-page.compact-ops-promotions > .promotion-toolbar.compact-ops-tools > [data-act="promotion-filter"] {
    flex:0 0 132px!important;
    box-sizing:border-box!important;
    width:132px!important;
    min-width:0!important;
    max-width:132px!important;
    min-height:44px!important;
    padding-inline-start:12px!important;
    font-size:13px!important;
    /* The common dropdown enhancer retains its inline end-padding and arrow. */
  }
  html:root.orders-crystal body #page-content.compact-ops-page.compact-ops-promotions > .promotion-toolbar.compact-ops-tools > [data-act="promotion-filter"] > span {
    min-width:0!important;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  html:root.orders-crystal body #page-content.compact-ops-page.compact-ops-promotions > .promotion-toolbar.compact-ops-tools > [data-act="promotion-refresh"] {
    flex:0 0 44px!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    margin:0!important;
  }

  /* Native document-library cards: compact illustration beside title/format,
     then the original Preview and Edit/Open actions. Long titles stay readable. */
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid {
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
  }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card:not([hidden]) {
    display:grid!important;
    grid-template-columns:44px minmax(0,1fr);
    grid-template-rows:auto auto auto;
    align-items:start;
    align-content:start;
    gap:4px 12px;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    padding:14px!important;
  }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card > .document-thumb {
    grid-column:1;
    grid-row:1 / 3;
    align-self:center;
    box-sizing:border-box;
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    margin:0!important;
    padding:0!important;
    border-radius:12px!important;
  }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card > .document-thumb > .mini-paper {
    box-sizing:border-box;
    width:24px!important;
    height:32px!important;
    padding:4px 3px!important;
    border-radius:3px;
  }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card .mini-paper > .line {
    height:1px;
    margin-top:2px;
    border-radius:1px;
  }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card .mini-paper > .line:first-child { height:2px; }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card > h3 {
    grid-column:2;
    grid-row:1;
    min-width:0;
    margin:0!important;
    font-size:15px!important;
    line-height:1.35!important;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card > .doc-card-format {
    grid-column:2;
    grid-row:2;
    min-width:0;
    margin:0!important;
    font-size:12px!important;
    line-height:1.4;
  }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card > .doc-card-actions:not([hidden]) {
    grid-column:1 / -1;
    grid-row:3;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px!important;
    min-width:0;
    margin-top:8px!important;
  }
  html:root.orders-crystal body #page-content > .document-grid.doc-library-grid > .document-card > .doc-card-actions > .button {
    box-sizing:border-box;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:44px!important;
    padding:8px 10px!important;
    gap:6px!important;
    font-size:13px!important;
    line-height:1.3;
    white-space:normal!important;
    overflow-wrap:normal;
    text-align:center;
  }
}

/* Keep the primary Orders action at the end of the desktop toolbar. */
@media screen and (min-width:761px){
  html:root body #page-content.compact-workflow-page.compact-workflow-on.compact-workflow-orders .heading-actions > [data-act="new-order"].compact-workflow-action{
    order:10!important;
    margin-inline-start:auto!important;
  }
}

.cash-dashboard .modal-footer .cash-submit-feedback:not(:empty){flex:1 1 15rem;text-align:start;margin:0 auto 0 0}
