/* Shared internal-page rhythm. Business data, print layouts and the dashboard
   retain their existing owners; the original curved navigation stays intact. */
@media screen {
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) {
    --wf-workspace-space: clamp(16px, 2vw, 24px);
    --wf-workspace-radius: 16px;
    min-inline-size: 0;
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row {
    min-block-size: 48px;
    align-content: start;
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-centered-heading :is(h1,h2) {
    font-size: clamp(20px, 2.2vw, 26px) !important;
    line-height: 1.45 !important;
    font-weight: 750;
    margin-block: 0;
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-centered-heading p {
    font-size: 13px !important;
    line-height: 1.65;
    margin-block: 4px 0;
    color: var(--text2);
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-actions {
    gap: 10px;
    align-items: center;
    margin-block: 0;
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-actions > .wf-smart-search.open {
    order: -1;
    flex: 1 1 100% !important;
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: none;
    min-block-size: 46px;
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) :is(.fl,.fg > label) {
    font-size: 14px !important;
    line-height: 1.55;
    color: var(--text2);
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) :is(.fg,.card-body,.fgrid) {
    min-inline-size: 0;
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) :is(input.fc,select.fc,textarea.fc) {
    min-inline-size: 0;
    max-inline-size: 100%;
    min-block-size: 46px;
    line-height: 1.5;
    box-sizing: border-box;
    scroll-margin-block: 100px 130px;
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) :is(.btn,.wf-search-toggle) {
    min-block-size: 44px;
    line-height: 1.45;
    touch-action: manipulation;
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) .co-empty-state {
    padding: clamp(28px, 5vw, 56px) 20px !important;
    line-height: 1.7;
    color: var(--text2);
  }
  html body #mainContent .page:not(#page-dashboard):not(#page-settings) .co-empty-state h3 {
    font-size: 20px;
    color: var(--text);
  }
  html body #page-exchange #dashRatesTitle {display: none;}

  /* Barcode selection uses the same readable surfaces as the rest of WOW. */
  html body #page-quick-barcode :is(.qbl-modes button,.qbl-dd-item-name) {
    font-size: 14px !important;
    line-height: 1.5;
  }
  html body #page-quick-barcode :is(.qbl-dd-item-type,#qblFinalTypeLbl,#qblQtyPriceLabel,#qblStatus) {
    font-size: 12px !important;
    line-height: 1.5;
  }
  html body #page-quick-barcode .qbl-dd-item {
    min-block-size: 64px;
    gap: 12px;
    padding: 12px 14px;
  }
  html body #page-quick-barcode #qblDdTabs {
    grid-template-columns: repeat(auto-fit,minmax(100px,1fr)) !important;
    gap: 8px !important;
  }
  html body #page-quick-barcode #qblDdTabs button {
    min-block-size: 64px;
    font-size: 13px !important;
  }
  html body #page-quick-barcode #qblDdTabs .wf-category-barcode-tab {
    display: grid;
    grid-template-columns: minmax(0,1fr) 32px;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 6px;
    padding: 8px !important;
  }
  html body #page-quick-barcode #qblDdTabs .wf-category-barcode-tab strong {
    grid-column: 1;
    grid-row: 1;
    text-align: start;
    font-size: 13px;
  }
  html body #page-quick-barcode #qblDdTabs .wf-category-barcode-tab > .wf-category-count {
    grid-column: 1;
    grid-row: 2;
    text-align: start;
    font-size: 12px;
  }
  html body #page-quick-barcode #qblDdTabs .wf-category-barcode-tab > .wf-category-photo {
    grid-column: 2;
    grid-row: 1 / 3;
    inline-size: 32px;
    block-size: 36px;
    height: 36px;
    margin: 0;
    border-radius: 6px;
  }
  html body #page-quick-barcode #qblDdList > [onclick^="qblPickFromDropdown("] {
    min-block-size: 64px;
    padding: 12px 14px !important;
    box-sizing: border-box;
  }
  html body #page-quick-barcode #qblDdList > [onclick^="qblPickFromDropdown("] > span {
    font-size: 14px !important;
    line-height: 1.5;
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }
  html body #page-quick-barcode #qblTierCard {
    padding: clamp(18px,4vw,28px);
    max-block-size: calc(100dvh - 48px);
    overflow: auto;
    overscroll-behavior: contain;
  }
  html body #page-quick-barcode #qblFoundName {
    color: var(--text) !important;
    text-shadow: none !important;
    font-size: clamp(20px,4vw,26px) !important;
    line-height: 1.5 !important;
    overflow-wrap: anywhere;
  }
  html body #page-quick-barcode #qblChooseLabel {
    color: var(--text2) !important;
    font-size: 14px !important;
    letter-spacing: normal !important;
    line-height: 1.6;
  }
  html body #page-quick-barcode #qblTierBtns {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 10px !important;
  }
  html body #page-quick-barcode #qblTierBtns button {
    min-inline-size: 0;
    min-block-size: 88px !important;
    padding: 18px 8px !important;
    color: var(--text) !important;
    background: var(--input) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    transform: none !important;
    touch-action: manipulation;
  }
  html body #page-quick-barcode #qblTierBtns button > span {
    font-size: 34px !important;
    color: var(--brand-primary) !important;
    text-shadow: none !important;
  }
  html body #page-quick-barcode #qblTierBtns button:is(:hover,:focus-visible) {
    border-color: var(--brand-primary) !important;
    background: color-mix(in srgb,var(--brand-primary) 10%,var(--card)) !important;
  }
  html body #page-quick-barcode #qblCancelTierBtn {
    min-block-size: 44px;
    color: var(--text) !important;
    background: var(--input) !important;
    border-color: var(--border) !important;
    font-size: 14px !important;
    border-radius: 12px !important;
  }
  html body #page-quick-barcode #qblFinalDetails > div {
    min-inline-size: 0;
    overflow-wrap: anywhere;
    padding: 10px !important;
    line-height: 1.5;
  }
  html body #page-quick-barcode #qblFinalDetails > div > :first-child {
    font-size: 12px !important;
  }
  html body #page-quick-barcode #qblFinalDetails > div > :last-child {
    font-size: 14px !important;
  }
  html body #page-quick-barcode #qblQtyWrap {
    display: grid !important;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 12px !important;
    padding: 12px !important;
  }
  html body #page-quick-barcode #qblQtyWrap > div:first-of-type {
    justify-self: center;
    direction: ltr;
  }
  html body #page-quick-barcode #qblQtyWrap button {
    min-inline-size: 44px;
    min-block-size: 44px;
  }
  html body #page-quick-barcode #qblQtyLabel {font-size: 14px !important;}
  html body #page-quick-barcode #qblQtyTotal {
    font-size: 16px !important;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  html body #page-cart .wf-cart-summary dt {font-size: 14px;}
  html body #page-cart .wf-cart-item-info h3 {font-size: 16px;}
  html body #page-cart .wf-cart-item-meta {font-size: 13px;}
  html body #page-cart :is(.wf-cart-item-total,.wf-cart-grand-total) {unicode-bidi: plaintext;}

  @media (max-width: 680px) {
    /* Reserve only the controls that are present on a compact screen. */
    html.wf-section-mode:not(.wf-speech-toolbar-active) body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row.wf-notifications-slot {
      grid-template-columns: var(--wf-workspace-control,44px) minmax(0,1fr) var(--wf-workspace-control,44px) var(--wf-workspace-control,44px) !important;
      column-gap: 6px !important;
    }
    html.wf-section-mode:not(.wf-speech-toolbar-active) body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row.wf-notifications-slot > .wf-centered-heading {grid-column: 2 !important;}
    html.wf-section-mode:not(.wf-speech-toolbar-active) body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row.wf-notifications-slot > #wfNotificationsButton {grid-column: 3 !important;}
    html.wf-section-mode:not(.wf-speech-toolbar-active) body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row.wf-notifications-slot > .wf-section-menu {grid-column: 4 !important;}
    html.wf-section-mode:not(.wf-speech-toolbar-active) body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row.wf-notifications-slot:has(> .sct-back-btn[data-wf-shared-dock-source="back"]) {
      grid-template-columns: minmax(0,1fr) var(--wf-workspace-control,44px) var(--wf-workspace-control,44px) !important;
    }
    html.wf-section-mode:not(.wf-speech-toolbar-active) body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row.wf-notifications-slot:has(> .sct-back-btn[data-wf-shared-dock-source="back"]) > .wf-centered-heading {grid-column: 1 !important;}
    html.wf-section-mode:not(.wf-speech-toolbar-active) body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row.wf-notifications-slot:has(> .sct-back-btn[data-wf-shared-dock-source="back"]) > #wfNotificationsButton {grid-column: 2 !important;}
    html.wf-section-mode:not(.wf-speech-toolbar-active) body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-heading-row.wf-notifications-slot:has(> .sct-back-btn[data-wf-shared-dock-source="back"]) > .wf-section-menu {grid-column: 3 !important;}
    html body #page-create-invoice .chip-row .chip {
      white-space: nowrap;
      flex-wrap: nowrap;
      min-inline-size: max-content;
    }
    html body #mainContent .page:not(#page-dashboard):not(#page-settings) :is(input.fc,select.fc,textarea.fc) {
      font-size: 16px !important;
    }
    html body #mainContent .page:not(#page-dashboard):not(#page-settings) .wf-centered-heading :is(h1,h2) {
      font-size: 20px !important;
    }
    html body #page-cart .wf-cart-item {
      grid-template-columns: 56px minmax(0,1fr);
      gap: 10px 12px;
      padding: 16px;
    }
    html body #page-cart .wf-cart-item-total {
      grid-column: 2;
      grid-row: 2;
      text-align: start;
      font-size: 17px;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    html body #page-cart .wf-cart-quantity {grid-column: 1 / -1;grid-row: 3;}
    html body #page-cart .wf-cart-remove {grid-column: 2;grid-row: 3;}
    html body #page-cart .wf-cart-content {padding-block-end: 100px;}
  }
  @media (max-width: 420px) {
    html body #page-quick-barcode #qblQtyWrap {grid-template-columns: minmax(0,1fr) auto;}
    html body #page-quick-barcode #qblQtyWrap > div:first-of-type {grid-column: 1 / -1;grid-row: 2;justify-self: stretch;justify-content: center;}
    html body #page-quick-barcode #qblQtyWrap > div:last-child {grid-column: 2;grid-row: 1;}
    html body #page-quick-barcode #qblDdTabs {grid-template-columns: repeat(2,minmax(0,1fr)) !important;}
  }
  @media (prefers-reduced-motion: reduce) {
    html body #page-quick-barcode #qblTierBtns button {animation: none !important;transition: none !important;}
  }
}
