/* Shared workspace materials, scoped to on-screen application content. */
@media screen {
  #mainContent {
    --paper: #fcfcfb;
    --canvas: #eff2f3;
    --hairline: #d6dfe1;
    --ink: #182f38;
    --wash: #e6eff0;
    --lift: 0 8px 24px -17px rgb(22 48 58 / 32%);
    background: var(--canvas);
  }
  [data-theme="dark"] #mainContent {
    --paper: #192832;
    --canvas: #101c23;
    --hairline: #334750;
    --ink: #e5eff0;
    --wash: #253b45;
  }
  html body #mainContent .page :is(.co-card,.pr-card-new,.inv-card,.client-type-step-card,.card,.wf-insight-card) {
    background: var(--paper) !important;
    border: 1px solid var(--hairline) !important;
    border-radius: 16px !important;
    box-shadow: var(--lift) !important;
  }
  html body #mainContent .page :is(.card-hdr,.co-hdr,.wf-insight-head) {
    border-color: var(--hairline) !important;
    color: var(--ink);
  }
  html body #mainContent .page :is(.co-actions,.pr-card-new-actions,.inv-card-actions) {
    background: var(--wash) !important;
    padding-block: 10px;
  }
  html body #mainContent .page :is(input.fc,select.fc,textarea.fc) {
    background: var(--paper) !important;
    border: 1px solid var(--hairline) !important;
    border-radius: 10px !important;
  }
  #mainContent .page :is(input,select,textarea,button):focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
  }
  html body #mainContent #page-settings .wf-settings-content>[role="tabpanel"] {
    background: var(--paper) !important;
    border-color: var(--hairline) !important;
    box-shadow: var(--lift) !important;
  }
  @media (max-width:680px) {
    html body #mainContent .page :is(.card,.wf-insight-card) {border-radius: 14px !important}
  }
}

/* Let translated headings and controls use a second line on narrow screens. */
@media screen {
  html body #mainContent .page :is(.card-hdr,.co-hdr,.wf-insight-head) {
    min-width: 0;
    gap: 10px;
  }
  html body #mainContent .page :is(.card-hdr,.co-hdr,.wf-insight-head) > * {
    min-width: 0;
  }
  html body #mainContent .page :is(.co-actions,.pr-card-new-actions,.inv-card-actions) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  html body #mainContent .page :is(.co-grid,.pr-grid-new,.inv-grid) > * {
    min-width: 0;
  }
  @media (max-width: 540px) {
    html body #mainContent .page :is(.card-hdr,.co-hdr,.wf-insight-head) {
      flex-wrap: wrap;
      row-gap: 8px;
    }
    html body #mainContent .page :is(.co-actions,.pr-card-new-actions,.inv-card-actions) > * {
      max-width: 100%;
    }
  }
}

/* Use the workspace width so the grid responds when the drawer opens. */
@media screen {
  #mainContent {
    --workspace-inset: clamp(16px, 2.6vw, 40px);
    --workspace-gap: clamp(16px, 2vw, 28px);
  }
  html body #mainContent.main { padding-inline: var(--workspace-inset) !important; }
  html.wf-section-mode body #mainContent .page :is(.co-page-sticky,.sct-sticky-header,.page-sticky-bar) {
    margin-inline: calc(-1 * var(--workspace-inset)) !important;
    padding-inline: var(--workspace-inset) !important;
    margin-block-end: var(--workspace-gap) !important;
  }
  html body #mainContent .page :is(.co-grid,.pr-grid-new,.inv-grid) {
    grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)) !important;
    gap: var(--workspace-gap) !important;
  }
  html body #mainContent .page .fgrid { gap: 18px 22px !important; }
  html body #mainContent #page-settings .wf-settings-workspace { gap: var(--workspace-gap); }
  html body #mainContent #page-settings [id^="stab-"]>.card + .card {
    margin-top: var(--workspace-gap) !important;
  }
  @media (max-width:680px) {
    html body #mainContent .page .fgrid { gap: 14px !important; }
  }
}

/* Common surfaces and hierarchy for the application shell and section workspaces. */
@media screen {
  html {
    --wf-dock-cutout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10000' height='160' viewBox='0 0 10000 160'%3E%3Cpath fill='white' d='M0 0H4945C4970 0 4969 33 5000 33S5030 0 5055 0H10000V160H0Z'/%3E%3C/svg%3E");
    --wf-dock-shadow: 0 4px 14px color-mix(in srgb, var(--brand-primary) 32%, transparent);
    --wf-section-tint: color-mix(in srgb, var(--brand-primary) 9%, var(--card));
  }
  html:not(.wf-section-mode) body .navbar,
  html.wf-section-mode body #mainContent .page :is(.co-page-sticky,.sct-sticky-header,.page-sticky-bar) {
    border-block-end: 1px solid var(--border) !important;
    background: linear-gradient(105deg, var(--card) 55%, var(--wf-section-tint)) !important;
    box-shadow: 0 5px 18px #142e3c0d !important;
  }
  .navbar .wf-nav-wordmark {
    position: absolute; inset: 50% 142px auto; transform: translateY(-50%);
    margin: 0; text-align: center; font-weight: 800; color: var(--text);
    letter-spacing: .03em; line-height: 1.2; font-size: clamp(13px, 2vw, 19px);
  }
  .wf-nav-wordmark strong { color: var(--ui-accent); }
  html body .navbar .wf-header-controls :is(#desktopSidebarToggle,#headerSettingsBtn,#themeBtn),
  html.wf-section-mode body #mainContent .page .sct-back-btn {
    border-radius: 13px !important; box-shadow: none !important;
  }
  html body .navbar .wf-header-controls :is(#desktopSidebarToggle,#headerSettingsBtn,#themeBtn) .wf-ui-icon {
    width: 21px; height: 21px;
  }
  @media (max-width: 1024px) {
    html body .navbar .wf-header-controls #themeBtn { display: inline-flex !important; }
    .navbar .wf-nav-wordmark { inset-inline: 64px 130px; }
  }

  html body #mainContent .page {
    --section-accent: var(--ui-accent);
  }
  html body #mainContent :is(#page-companies,#page-add-company,#page-select-client-type) {
    --section-accent: color-mix(in srgb, var(--ui-accent) 78%, #2a937c);
  }
  html body #mainContent :is(#page-products,#page-add-product,#page-quick-barcode) {
    --section-accent: color-mix(in srgb, var(--ui-accent) 78%, #7965a8);
  }
  html body #mainContent .page :is(.co-card,.pr-card-new,.inv-card,.client-type-step-card,.pr-type-step-card,.qbl-product-card,.pm-receipt-type) {
    border: 1px solid var(--hairline) !important;
    border-radius: 17px !important;
    box-shadow: var(--lift) !important;
  }
  html body #mainContent .page :is(.co-card,.pr-card-new,.inv-card,.client-type-step-card,.pr-type-step-card,.pm-receipt-type):hover {
    border-color: var(--section-accent) !important;
  }
  html body #mainContent .page :is(.co-logo,.inv-card-avatar,.ctsc-icon,.pr-type-step-icon) {
    color: var(--section-accent) !important;
    background: color-mix(in srgb, var(--section-accent) 13%, var(--paper)) !important;
  }
  html body #mainContent .page .co-stat-pill {
    border-radius: 12px !important; min-height: 42px; box-shadow: none !important;
  }
  html body #mainContent .page .co-stat-pill.active {
    border-color: var(--section-accent) !important;
    background: color-mix(in srgb, var(--section-accent) 12%, var(--paper)) !important;
    color: var(--ink) !important;
  }
  html body #mainContent #page-products .pr-card-new-img {
    background: linear-gradient(145deg,var(--paper),color-mix(in srgb,var(--section-accent) 13%,var(--paper))) !important;
  }
  html body #mainContent .page :is(.co-toolbar-title,.sct-sticky-title h1,.wf-heading-row h1) {
    color: var(--ink) !important; text-wrap: balance;
  }
  html body #mainContent .page :is(.co-toolbar-row,.wf-heading-row) .btn { border-radius: 12px !important; }
  html body #mainContent .page :is(.card-title,.card-header) {
    line-height: 1.4; overflow-wrap: anywhere;
  }
  html body #mainContent .page :is(.fg,.dup-cols,.inv-card-hdr-info,.co-hdr-info) { min-width: 0; }
  html body #mainContent .page :is(.fc, .wf-language-card):focus-visible {
    outline: 2px solid var(--ui-accent); outline-offset: 2px;
  }

  /* The navigation and settings action use the same cutout and raised circle. */
  html.wf-settings-open body #wf-settings-save-footer {
    inset: auto 0 0;
    max-width: none; height: 72px;
    padding: 0 0 env(safe-area-inset-bottom,0px);
    box-sizing: border-box; border-radius: 0; filter: drop-shadow(0 -3px 12px #132d3c20);
    align-items: stretch;
  }
  html body #wf-settings-save-footer::before {
    border-radius: 0;
    mask: var(--wf-dock-cutout) center 0 / 10000px 160px no-repeat;
  }
  html body #wf-settings-save-footer .btn {
    min-height: 0; min-width: 84px; justify-content: flex-end;
    padding: 0 8px 12px !important; color: var(--text2) !important;
    font-size: 11px !important;
  }
  html body #wf-settings-save-footer .wf-settings-save-symbol {
    position: absolute; inset-block-start: -23px; inset-inline-start: calc(50% - 24px);
    width: 48px; height: 48px; background: var(--brand-primary);
    box-shadow: var(--wf-dock-shadow);
  }
  @media (max-width: 1024px) {
    html body #bottomNav::before {
      mask: var(--wf-dock-cutout) calc(var(--nav-x) - 5000px) 0 / 10000px 160px no-repeat;
    }
    html body #bottomNav { filter: drop-shadow(0 -3px 12px #132d3c20); }
    html body #bottomNav #bnavCircle { box-shadow: var(--wf-dock-shadow) !important; }
    html body #bottomNav .bnav-btn:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: -4px; border-radius: 10px; }
    html body #bottomNav .bnav-btn.bnav-active .bnav-label { font-weight: 800 !important; }
  }
}

@media screen {
  @media (min-width: 1025px) {
    html { --side-w: clamp(244px, 20vw, 286px); }
  }

  html body #sidebar {
    --drawer-tint: color-mix(in srgb, var(--brand-primary) 12%, var(--card));
    display: flex;
    flex-direction: column;
    padding-inline: 14px !important;
    border: 0 !important;
    border-inline-end: 1px solid var(--border) !important;
    border-radius: 0 !important;
    mask: none !important;
    background: var(--card) !important;
    overscroll-behavior: contain;
    box-sizing: border-box;
    transition: transform 200ms cubic-bezier(.2,.7,.25,1) !important;
  }
  html body #sidebar .wf-sidebar-brand {
    position: sticky;
    z-index: 2;
    inset-block-start: 0;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) 44px;
    align-items: center;
    gap: 8px;
    height: auto;
    min-height: 62px;
    margin: 0 0 9px;
    padding: 5px 0;
    color: var(--text);
    background: var(--card);
    border-block-end: 1px solid var(--border);
  }
  #sidebar .wf-sidebar-brand strong {
    justify-self: center;
    font-size: 15px;
    line-height: 1.25;
  }
  #sidebar .wf-sidebar-brand strong span { color: var(--ui-accent); }
  html body #sidebar #wfSidebarLogo {
    width: 42px;
    height: 42px;
    padding: 3px;
    border-radius: 10px;
    box-shadow: none;
  }
  html body #sidebar #wfSidebarClose,
  html body .page .wf-heading-row > .wf-section-menu {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--ui-accent);
    cursor: pointer;
  }
  html body #sidebar #wfSidebarClose {
    position: static;
    transform: none;
    box-shadow: none;
  }
  html body #sidebar #wfSidebarClose::before,
  html body #sidebar #wfSidebarClose::after { display: none; }
  html body .page .wf-heading-row > .wf-section-menu {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
  .wf-section-menu svg {
    width: 21px; height: 21px;
    fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  }
  #sidebar .wf-sidebar-links { display: grid; gap: 10px; }
  #sidebar .wf-nav-group { display: grid; gap: 3px; min-width: 0; }
  #sidebar .wf-nav-group + .wf-nav-group { padding-block-start: 7px; border-block-start: 1px solid var(--border); }
  html body #sidebar .side-sec { margin: 0 !important; padding: 4px 7px !important; letter-spacing: normal !important; font-size: 11px !important; }
  html body #sidebar .nav-item {
    width: 100%;
    min-height: 44px !important;
    gap: 9px !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    text-align: start;
    white-space: normal;
    line-height: 1.3;
    transform: none !important;
    transition: background-color 150ms, border-color 150ms, color 150ms !important;
  }
  html body #sidebar .nav-item > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
  html body #sidebar .nav-item .nav-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    background: var(--drawer-tint);
  }
  html body #sidebar .nav-item .nav-badge {
    flex-shrink: 0;
    margin-inline-start: auto;
    font-variant-numeric: tabular-nums;
  }
  html body #sidebar .nav-item.active {
    background: var(--drawer-tint) !important;
    border-color: color-mix(in srgb,var(--brand-primary) 45%,var(--border)) !important;
    box-shadow: none !important;
  }
  html body #sidebar .nav-item.active::before { content: none; }
  html body #sidebar .nav-item.active { box-shadow: none !important; }
  html body #sidebar .nav-item:focus-visible,
  html body .page .wf-section-menu:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: -2px; }

  @media (max-width: 1024px) {
    html body #sidebar {
      width: min(324px, calc(100vw - 40px)) !important;
      border-start-end-radius: 20px !important;
      border-end-end-radius: 20px !important;
    }
    html body #sideOv.open { animation: wfDrawerShade 160ms ease-out both; }
    html.wf-mobile-menu-open body { overflow: hidden; }
  }
  @keyframes wfDrawerShade { from { opacity: 0; } to { opacity: 1; } }

  html body #mainContent .page :is(.co-toolbar-title,.sct-sticky-title h1,.page-toolbar-title) {
    font-size: clamp(17px, 2.1vw, 24px) !important;
    line-height: 1.35;
  }
  html body #mainContent .page :is(.co-toolbar-title,.sct-sticky-title h1,.page-toolbar-title) .wf-ui-icon {
    color: var(--section-accent) !important;
    width: 1.1em;
    height: 1.1em;
  }
  html body #mainContent .page :is(.co-grid,.pr-grid-new,.inv-grid) {
    grid-template-columns: repeat(auto-fit,minmax(min(100%, 285px),1fr)) !important;
  }
  html body #mainContent :is(#page-add-company,#page-add-product,#page-create-invoice,#page-payment-management) .card {
    border-radius: 18px !important;
    padding: clamp(12px, 2vw, 22px);
  }
  html body #mainContent :is(#page-select-client-type,#page-select-invoice-type,#page-add-product) .client-type-step-card {
    padding: clamp(12px,2vw,20px) !important;
  }
  html body #mainContent #page-payment-management .pm-receipt-type.sel {
    background: var(--wf-section-tint) !important;
    border-color: var(--brand-primary) !important;
  }
  #page-quick-barcode #qblCameraWrap { background: #142d3a !important; }
  #page-reports .wf-dashboard-intelligence { gap: var(--workspace-gap); }
  #page-reports .wf-report-sales { padding: clamp(14px,2vw,24px); }
  #page-reports .wf-report-sales h2 { font-size: 17px; margin-block-end: 12px; }
  #page-reports .wf-report-month {
    display: grid;
    grid-template-columns: minmax(65px,.36fr) minmax(35px,1fr) minmax(70px,auto);
    align-items: center;
    gap: clamp(6px, 2vw, 14px);
    min-height: 42px;
    border-block-end: 1px solid var(--border);
    font-size: 12px;
  }
  #page-reports .wf-report-month:last-child { border-block-end: 0; }
  #page-reports .wf-report-month bdi { text-align: end; font-weight: 750; overflow-wrap: anywhere; }
  #page-reports meter { width: 100%; height: 10px; accent-color: var(--brand-primary); }
  #page-reports meter::-webkit-meter-bar { background: var(--input); border: 0; }
  #page-reports meter::-webkit-meter-optimum-value { background: var(--brand-primary); }
  #page-reports meter::-moz-meter-bar { background: var(--brand-primary); }
  #page-exchange #wfExchangeRates { max-width: 1260px; margin-inline: auto; }
  @media (prefers-reduced-motion: reduce) {
    html body #sidebar,
    html body #sidebar .nav-item,
    html body #sideOv.open { transition: none !important; animation: none !important; }
  }
}

@media screen {
  #page-settings .wf-appearance-help { color: var(--text2); margin-block-end: 14px; }
  #page-settings .wf-appearance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr));
    gap: 10px;
  }
  #page-settings .wf-appearance-control {
    padding: 12px;
    background: var(--wf-section-tint);
    border: 1px solid var(--hairline);
    border-radius: 12px;
  }
  #page-settings .wf-appearance-control .fl { color: var(--ink); }
  html[data-wf-density="compact"] body #mainContent {
    --workspace-inset: clamp(10px,1.6vw,24px);
    --workspace-gap: clamp(9px,1.2vw,16px);
  }
  html[data-wf-density="roomy"] body #mainContent {
    --workspace-inset: clamp(16px,3vw,48px);
    --workspace-gap: clamp(16px,2.5vw,32px);
  }
  html[data-wf-density="compact"] #page-dashboard { --dash-gap: var(--workspace-gap); }
  html[data-wf-density="roomy"] #page-dashboard { --dash-gap: var(--workspace-gap); }
  html[data-wf-density="roomy"] body #sidebar .nav-item { min-height: 51px !important; }
  @media (pointer: coarse) {
    html body #sidebar .nav-item { min-height: 48px !important; }
    html body #page-settings .wf-appearance-control select { min-height: 48px !important; }
  }
  html[data-wf-motion="reduced"] body :is(#sidebar,#sideOv,#mainContent,#bottomNav,#bnavCircle,.wf-settings-panel-enter,.nav-item,.stat-card,.curr-item,.client-type-step-card,.co-card,.pr-card-new,.inv-card) {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

@media screen {
  #page-products .wf-catalog-placeholder {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    color: var(--section-accent);
    background: color-mix(in srgb, var(--section-accent) 10%, var(--paper));
  }
  #page-products .wf-catalog-placeholder .wf-ui-icon {
    width: 48px;
    height: 48px;
    color: inherit !important;
  }
  #page-products .pr-card-type-badge [data-wf-product-type] {
    display: inline-flex;
    vertical-align: middle;
  }
  #page-products .pr-card-type-badge [data-wf-product-type] .wf-ui-icon {
    width: 15px;
    height: 15px;
    color: inherit !important;
    margin: 0;
  }
}

/* The same materials follow a task from its page into its dialog. */
@media screen {
  :root {
    --window-surface: var(--card);
    --window-edge: var(--border);
    --window-accent: var(--brand-primary);
    --window-muted: color-mix(in srgb, var(--window-accent) 8%, var(--window-surface));
    --window-shadow: 0 18px 56px -24px rgb(10 28 38 / 48%);
    --window-radius: clamp(14px, 2vw, 20px);
  }
  html body :is(.modal-ov, .delete-modal-ov, .deliver-modal-ov, .wf-restore-ov, .wf-share-overlay, .qbl-cart-overlay) {
    background: rgb(13 29 38 / 62%) !important;
  }
  html:root body :is(#currCalcModal, #pdfModal, #scannerModal, #printOptionsModal) > .modal,
  html:root body :is(.wf-restore-modal, .wf-share-panel, .delete-modal, .deliver-modal, #qblTierCard, .qbl-cart-bar) {
    box-sizing: border-box;
    background: var(--window-surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--window-edge) !important;
    border-radius: var(--window-radius) !important;
    box-shadow: var(--window-shadow) !important;
  }
  html:root body :is(.wf-restore-modal, .wf-share-panel, .delete-modal, .deliver-modal, #printOptionsModal > .modal, #scannerModal > .modal) {
    max-block-size: calc(100dvh - 24px);
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
  html:root body :is(#scannerModal > .modal > :first-child, .wf-share-head, .qbl-cart-header, #printOptionsModal .modal-hdr) {
    background: var(--window-muted) !important;
    color: var(--text) !important;
    border-block-end: 1px solid var(--window-edge);
  }
  html:root body :is(.deliver-modal-btn-confirm, .wf-restore-confirm, .qbl-cart-invoice-btn) {
    background: var(--sales-gradient) !important;
    color: white !important;
  }
  html body :is(.dm-title, .deliver-modal-title, .wf-share-title, .wf-restore-title, .modal-title, .qbl-cart-title) {
    color: var(--text) !important;
    font-weight: 750;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  html body :is(.dm-btn-cancel, .deliver-modal-btn-cancel, .wf-restore-cancel, .wf-share-choice, .deliver-modal-inv-card) {
    background: var(--window-muted) !important;
    color: var(--text) !important;
    border: 1px solid var(--window-edge) !important;
    border-radius: 12px;
  }
  html body :is(.modal-ov, .wf-share-panel, .wf-restore-modal, .delete-modal, .deliver-modal, .qbl-cart-bar, #qblTierCard, #mainContent .page) :is(button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--window-accent) !important;
    outline-offset: 2px;
  }
  html body :is(.modal-ov, .delete-modal, .deliver-modal) :is(input.fc, select.fc, textarea.fc, .dm-input) {
    color: var(--text) !important;
    background: var(--input) !important;
    border-radius: 10px !important;
  }
  html body #mainContent .page :is(.page-hdr, .sct-sticky-header) h1 {
    color: var(--text);
    font-weight: 750;
    line-height: 1.3;
  }
}
@media screen {
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) {
    display: block !important;
    max-width: 52rem !important;
  }
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) > .tabs {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)) !important;
    position: static !important;
    gap: 8px !important;
  }
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) .tab-btn {
    min-height: 54px !important;
    justify-content: flex-start !important;
  }
  #wfSettingsDialog {
    box-sizing: border-box; padding: 0; margin: auto;
    width: min(42rem, calc(100% - 24px)); max-height: calc(100dvh - 32px);
    background: var(--card); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--window-radius);
    box-shadow: var(--window-shadow);
  }
  #wfSettingsDialog[open] { display: flex; flex-direction: column; }
  #wfSettingsDialog::backdrop { background: rgb(13 29 38 / 62%); }
  #wfSettingsDialog > header, #wfSettingsDialog > footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: var(--window-muted); flex: none;
  }
  #wfSettingsDialog > header h2 { margin: 0; font-size: 18px; }
  #wfSettingsDialog > header button { font: inherit; font-size: 24px; min-width: 44px; height: 44px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; }
  #wfSettingsDialog > .wf-settings-content { overflow: auto; min-height: 0; padding: 12px; }
  #wfSettingsDialog .wf-settings-panel-title, #wfSettingsDialog .wf-settings-save-symbol { display: none; }
  #wfSettingsDialog > footer > button { margin: 0 !important; width: 100%; min-height: 44px; background: var(--sales-gradient) !important; color: white !important; }
  html.wf-settings-open body #wf-settings-save-footer:empty { display: none !important; }
}

@media screen {
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) > .tabs {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) .tab-btn {
    background: var(--window-surface) !important;
    border: 1px solid var(--window-edge) !important;
    padding: 10px 14px !important;
    gap: 10px;
    text-align: start;
  }
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) .tab-btn:is(:hover,:focus-visible) {
    background: var(--window-muted) !important;
    border-color: var(--window-accent) !important;
  }
  #wfSettingsDialog > header { border-block-end: 1px solid var(--window-edge); gap: 12px; }
  #wfSettingsDialog > footer { border-block-start: 1px solid var(--window-edge); }
  #wfSettingsDialog > .wf-settings-content { overscroll-behavior: contain; }
  @media (max-width: 600px) {
    #wfSettingsDialog {
      width: 100%;
      max-width: none;
      max-height: min(90dvh, calc(100dvh - 12px));
      margin: auto 0 0;
      border-radius: 20px 20px 0 0;
    }
    #wfSettingsDialog > footer { padding-block-end: max(10px, env(safe-area-inset-bottom)); }
  }
}

@media screen {
  html body #mainContent .page .client-type-step-card {
    width: 100%;
    min-height: 80px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    font: inherit;
    text-align: start;
    background: var(--paper) !important;
  }
  html body #mainContent .page .client-type-step-card:is(:hover,:focus-visible) {
    background: color-mix(in srgb, var(--section-accent) 7%, var(--paper)) !important;
    transform: none;
  }
  .client-type-step-card .ctsc-desc { overflow-wrap: anywhere; }
  .client-type-step-card .ctsc-arrow { color: var(--text2); }
  .deliver-modal-top-bar,
  html body :is(.curr-item, .greeting-card)::after { display: none !important; }
}

@media screen {
  #sidebar .wf-sidebar-search { padding: 4px 12px 10px; }
  #sidebar .wf-sidebar-search input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding-inline: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input);
    color: var(--text);
    font: inherit;
    font-size: 16px;
  }
  #sidebar .wf-sidebar-search input:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
  }
  #sidebar .wf-sidebar-empty { color: var(--text2); padding-inline: 14px; }
  html body #sidebar :is(.wf-nav-group,.nav-item,.wf-sidebar-empty)[hidden] { display: none !important; }
  @media (prefers-reduced-motion: no-preference) {
    html:not([data-wf-motion="reduced"]) body #sidebar .nav-item {
      transition: background-color .18s ease, color .18s ease, transform .18s ease;
    }
    html:not([data-wf-motion="reduced"]) body #sidebar .nav-item:active { transform: scale(.98); }
  }
}

@media screen {
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) .tab-btn {
    display: flex !important;
    flex-wrap: wrap;
    align-content: center;
    column-gap: 8px;
    row-gap: 4px;
    min-height: 76px !important;
    overflow-wrap: anywhere;
  }
  .wf-settings-card-description {
    flex: 0 0 100%;
    text-align: start;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
  }
  #wfSettingsDialog > footer[hidden] { display: none; }
  #wfSettingsDialog .wf-settings-content { padding: clamp(12px, 2.5vw, 20px); }
}

@media screen {
  #wfSettingsDialog > footer:not([hidden]) {
    position: relative; isolation: isolate; justify-content: center;
    margin-block-start: 24px; padding: 0 8px env(safe-area-inset-bottom,0px);
    background: transparent; border: 0; min-height: 58px;
  }
  #wfSettingsDialog > footer::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: var(--window-muted);
    mask: var(--wf-dock-cutout) center top / 10000px 160px no-repeat;
  }
  html body #wfSettingsDialog > footer > button {
    display: flex; justify-content: center; align-items: flex-end; position: relative;
    width: auto; min-width: 96px; height: 58px; padding: 0 10px 7px !important;
    border: 0 !important; box-shadow: none !important; background: transparent !important; color: var(--text) !important;
  }
  #wfSettingsDialog > footer .wf-settings-save-symbol {
    display: grid; place-items: center; position: absolute; top: -23px;
    inset-inline-start: calc(50% - 24px); width: 48px; height: 48px; border-radius: 50%;
    color: white; background: var(--sales-gradient); box-shadow: var(--wf-dock-shadow);
  }
  #wfSettingsDialog .wf-settings-save-symbol svg { width: 22px; height: 22px; }
  #wfLogoColor { width: 100%; height: 44px; margin-block-start: 6px; }
  #wfGreetingLogo { background: linear-gradient(145deg,color-mix(in srgb,var(--wf-card-tint) 38%,var(--dash-surface)),var(--dash-surface)); }
  #page-dashboard .stats-grid button.stat-card { font-family: inherit; text-align: start; width: 100%; cursor: pointer; }
  .wf-weather-icon { font-size: 17px; }
  html body :is(#page-dashboard,#page-exchange) .wf-quote-trend { font-variant-numeric: tabular-nums; align-items: center; gap: 3px; }
  .wf-quote-arrow { font-size: 15px; line-height: 1; }
  @media (prefers-reduced-motion: no-preference) {
    html:not([data-wf-motion="reduced"]) :is(#page-dashboard .stat-card,#wfSettingsDialog button,.wf-weather-days > div,#sidebar .nav-item,.qbl-modes button,.curr-item) {
      transition: box-shadow .18s ease, background-color .18s ease, scale .18s ease;
    }
    html:not([data-wf-motion="reduced"]) :is(#page-dashboard .stat-card,#wfSettingsDialog button,.qbl-modes button,.curr-item):active { scale: .975; }
    html:not([data-wf-motion="reduced"]) #wfSettingsDialog[open] { animation: wfPanelReveal .2s ease-out; }
    @keyframes wfPanelReveal { from { opacity: .6; translate: 0 6px; } }
    @media (hover:hover) {
      html:not([data-wf-motion="reduced"]) #page-dashboard .stat-card:hover { box-shadow: 0 4px 16px color-mix(in srgb,var(--brand-primary) 18%,transparent) !important; }
    }
  }
}

@media screen {
  html body #page-create-invoice .wf-heading-actions > div:first-child {
    display: grid !important;
    grid-template-columns: repeat(3,minmax(0,1fr));
    width: min(100%, 38rem);
    margin-inline: auto;
  }
  html body #page-create-invoice .wf-heading-actions :is(button[onclick="saveInvoice()"],button[onclick="previewInvoice()"],#shareMainBtn) {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; min-height: 44px; padding-inline: 5px !important;
    white-space: normal !important; box-shadow: none !important;
  }
  #page-create-invoice .chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
  #invTypeChip { display: inline-flex; align-items: center; gap: 4px; }
  #page-select-invoice-type .ctsc-body { min-width: 0; text-align: start; }
  @media (max-width:1024px) {
    html body #sidebar { width: min(22rem, calc(100vw - 48px)) !important; touch-action: pan-y; }
    html body #sideOv { display: block; opacity: 0; visibility: hidden; pointer-events: none; }
    html body #sideOv.open { opacity: 1; visibility: visible; pointer-events: auto; }
  }
  @media (max-width:1024px) and (prefers-reduced-motion:no-preference) {
    html:not([data-wf-motion="reduced"]) body #sideOv { transition: opacity .22s ease, visibility 0s linear .22s; }
    html:not([data-wf-motion="reduced"]) body #sideOv.open { transition-delay: 0s; animation: none; }
    html:not([data-wf-motion="reduced"]) body #sidebar { transition: transform .26s cubic-bezier(.22,.75,.18,1) !important; }
  }
}

@media screen {
  html body #sidebar {
    overflow: hidden !important;
    padding-inline-end: 52px !important;
  }
  html body #sidebar .wf-sidebar-links {
    min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding-block-end: max(12px,env(safe-area-inset-bottom));
  }
  html body #sidebar .wf-sidebar-brand { grid-template-columns: 42px minmax(0,1fr); flex-shrink: 0; }
  html body #sidebar > #wfSidebarClose {
    position: absolute !important; inset: auto !important;
    inset-block-start: 50% !important; inset-inline-end: 3px !important;
    transform: translateY(-50%) !important;
    width: 48px !important; height: 48px !important; max-height: none;
    border: 0 !important; border-radius: 50% !important; z-index: 4;
    color: white !important; background: var(--sales-gradient) !important;
    box-shadow: 0 0 0 4px var(--card), var(--wf-dock-shadow) !important;
  }
  html body #sidebar > #wfSidebarClose[hidden] { display: none !important; }
  #sidebar > #wfSidebarClose svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
  html[dir="rtl"] #sidebar > #wfSidebarClose svg { scale: -1 1; }
}

@media screen {
  #wfSidebarSearchToggle {
    width: 100%; display: flex; align-items: center; gap: 9px; min-height: 44px;
    padding-inline: 12px; background: var(--input); color: var(--text);
    border: 1px solid var(--border); border-radius: 12px; font: inherit; cursor: pointer;
  }
  #wfSidebarSearchToggle svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  #wfSidebarSearchToggle[aria-expanded="true"] { background: var(--drawer-tint); }
  #wfSidebarSearchToggle[aria-expanded="true"]::after { content: '×'; margin-inline-start: auto; }
  #wfSidebarSearch:not([hidden]) { margin-block-start: 6px; }
  #wfSidebarSearch[hidden] { display: none !important; }
  @media (prefers-reduced-motion: no-preference) {
    html:not([data-wf-motion="reduced"]) #wfSidebarSearch:not([hidden]) { animation: wfPanelReveal .16s ease-out; }
  }
}

@media screen {
  html body #sidebar {
    --wf-close-center: calc(100% - 27px);
    isolation: isolate;
    background: transparent !important;
    border-inline-end: 0 !important;
  }
  html[dir="rtl"] body #sidebar { --wf-close-center: 27px; }
  html body #sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--card);
    mask: radial-gradient(circle 30px at var(--wf-close-center) 50%, transparent 29px, #000 30px);
    pointer-events: none;
  }
  html body #sidebar > #wfSidebarClose { box-shadow: var(--wf-dock-shadow) !important; }
  html body #sidebar .wf-sidebar-links {
    flex: 1 1 0;
    align-content: start;
    overflow: hidden;
    padding-block-end: 0;
  }
  #sidebar .wf-nav-paged { gap: 2px; }
  #sidebar .wf-nav-paged .wf-nav-group { display: contents; }
  #sidebar .wf-nav-paged .side-sec { display: none; }
  #sidebar .wf-sidebar-brand { flex-shrink: 0; }
  #sidebar .wf-sidebar-search { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
  #wfSidebarSearchToggle[aria-expanded="true"] { flex: 0 0 44px; justify-content: center; padding: 0; }
  #wfSidebarSearchToggle[aria-expanded="true"] :is(svg,span) { display: none; }
  #wfSidebarSearchToggle[aria-expanded="true"]::after { margin: 0; font-size: 22px; }
  #sidebar #wfSidebarSearch:not([hidden]) { min-width: 0; margin: 0; }
  #wfSidebarPager { display: flex; min-height: 44px; align-items: center; justify-content: space-between; flex-shrink: 0; color: var(--text2); }
  #wfSidebarPager[hidden] { display: none; }
  #wfSidebarPager button { width: 44px; height: 40px; border: 1px solid var(--border); border-radius: 9px; background: var(--input); color: var(--text); font-size: 22px; cursor: pointer; }
  #wfSidebarPager button:disabled { opacity: .38; cursor: default; }
  #wfSidebarPage { direction: ltr; font-variant-numeric: tabular-nums; }
  html[dir="rtl"] #wfSidebarPager button { scale: -1 1; }
  @media (max-height: 440px) {
    html body #sidebar .wf-sidebar-brand { height: 52px !important; min-height: 52px; }
    #sidebar .wf-sidebar-search { padding-block: 2px 4px; }
  }
}

@media screen and (max-width:1024px) {
  html body #wfSettingsDialog:has(> #bottomNav) > footer { display:none!important }
  html body #wfSettingsDialog > #bottomNav {
    position:relative!important; inset:auto!important; width:100%!important;
    display:flex!important; flex:none; margin-block-start:26px;
  }
  html.wf-settings-open body #bottomNav.settings-close-action #bnavCircleIcon::after {
    mask:none; background:none; content:"×"; font:26px/23px sans-serif; text-align:center;
  }
}

@media screen {
  #page-settings .settings-group-title {
    grid-column:1/-1; margin:12px 0 2px; color:var(--text2); font-size:13px; font-weight:700;
  }
  #page-settings .settings-group-title:first-child {margin-block-start:0}
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) > .tabs {
    grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:6px!important;
  }
  html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) .tab-btn {
    min-width:0; min-height:66px!important; border-radius:14px!important; padding:8px 10px!important;
    line-height:1.3; font-weight:650; white-space:normal;
  }
  html body #page-settings .wf-settings-card-description { line-height:1.35; font-size:11px; }
  html body #sidebar .nav-item {
    display:grid!important; grid-template-columns:32px minmax(0,1fr) auto; align-items:center;
  }
  html body #sidebar .nav-item .nav-icon { display:grid; place-items:center; color:var(--brand-primary); }
  html body #sidebar .nav-item.active .nav-icon { background:var(--sales-gradient); color:white; }
  html body #sidebar .nav-item .nav-badge { padding:2px 6px; min-width:22px; text-align:center; border-radius:7px; }
  html body #sidebar .wf-sidebar-links:not(.wf-nav-paged) .wf-nav-group {
    border:0; padding:4px; border-radius:14px; background:color-mix(in srgb,var(--brand-primary) 4%,var(--card));
  }
  html body #sidebar .wf-sidebar-links:not(.wf-nav-paged) { gap:5px; }
  html body #sidebar .nav-item[hidden] {display:none!important}
  @media(max-width:330px){html body #mainContent #page-settings .wf-settings-workspace:has(> #wfSettingsDialog) > .tabs {grid-template-columns:1fr!important}}
}

@media screen {
  html body #sidebar .wf-sidebar-links {grid-auto-rows:max-content; overflow:hidden!important;}
  html body #sidebar .wf-nav-paged .wf-nav-group:not([hidden]) {display:contents!important}
  html body #sidebar .wf-nav-paged .nav-item {align-self:start; height:auto!important;}
  html body #sidebar .nav-item > span:nth-child(2) {white-space:normal!important; text-overflow:clip; overflow:visible; line-height:1.3;}
}
@media screen and (max-width:1024px) {
  html body #sidebar {max-height:min(100dvh,var(--drawer-viewport,100dvh))!important;box-sizing:border-box;}
}
@media screen and (max-height:450px) and (max-width:1024px) {
  html body #sidebar .wf-sidebar-brand {min-height:28px!important; padding-block:0!important; grid-template-columns:24px 1fr!important;}
  html body #sidebar .wf-sidebar-brand img {width:24px!important;height:24px!important;}
  html body #sidebar {padding-block:4px!important;}
}

@media screen and (min-width:1025px) {
  html.wf-sidebar-collapsed body #sidebar {
    width:68px!important; transform:none!important; pointer-events:auto!important; visibility:visible!important;
    padding:8px 6px!important; align-items:stretch;
  }
  html.wf-sidebar-collapsed body #sidebar::before {mask:none;}
  html.wf-sidebar-collapsed body #mainContent {margin-inline-start:68px!important;margin-inline-end:0!important;}
  html.wf-sidebar-collapsed body #sidebar :is(.wf-sidebar-brand,.wf-sidebar-search,.side-sec,.nav-badge,.nav-item > span:nth-child(2)) {display:none!important;}
  html.wf-sidebar-collapsed body #sidebar .wf-nav-group {padding:0!important;background:transparent!important;}
  html.wf-sidebar-collapsed body #sidebar .nav-item:not([hidden]) {
    grid-template-columns:1fr!important;justify-items:center;padding:3px!important;
  }
  html.wf-sidebar-collapsed body #wfSidebarPager:not([hidden]) {display:grid;grid-template-columns:1fr 1fr;gap:1px;}
  html.wf-sidebar-collapsed body #wfSidebarPager button {width:100%;min-width:0;}
  html.wf-sidebar-collapsed body #wfSidebarPage {grid-column:1/-1;grid-row:2;text-align:center;}
}
@media screen and (max-width:1024px) {
  html body #sidebar {width:min(360px,calc(100vw - 12px))!important;}
  html body #sidebar .nav-item .nav-badge {justify-self:end;}
}

@media screen {
 html body #page-dashboard #currBar .curr-bar-top,
 html body #page-exchange #currBar .curr-bar-top {
   padding-block-end:8px!important; margin-block-end:8px!important;border-block-end:1px solid var(--border);
 }
 html body #sidebar {padding-inline-end:42px!important;--wf-close-center:calc(100% - 21px);}
 html[dir="rtl"] body #sidebar {--wf-close-center:21px;}
 html body #sidebar > #wfSidebarClose {width:38px!important;height:42px!important;inset-inline-end:2px!important}
 #page-cashboxes .cashboxes {width:min(100%,46rem);margin:12px auto;padding:clamp(12px,2vw,22px);}
 #page-cashboxes .cashboxes form {grid-template-columns:repeat(2,minmax(0,1fr));margin:0;gap:12px;}
 #page-cashboxes .cashbox-overview {grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:12px;background:var(--wash);border-radius:12px;padding:12px;}
 #page-cashboxes :is(input,select) {min-width:0;width:100%;min-height:44px;border:1px solid var(--border);background:var(--card);color:var(--text);padding:7px;border-radius:9px;font:inherit;}
 #page-cashboxes output {text-align:center;overflow-wrap:anywhere;}
 #page-cashboxes ol {padding:0;list-style:none;max-height:none;}
 #page-cashboxes li {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;padding:9px 0;border-block-end:1px solid var(--border);}
 #page-cashboxes li small {grid-column:1/-1;color:var(--text2);}
 #page-cashboxes .cashboxes form button {min-height:44px;}
}
@media screen and (max-width:1024px){
 html body #sidebar {width:min(286px,82vw)!important;}
 html.wf-settings-open:not(:has(#wfSettingsDialog[open])) body #bottomNav[data-task-mode="settings"] {display:none!important;}
 html body #wfSettingsDialog > #bottomNav {margin-block-start:30px!important;}
}
@media screen and (max-width:350px){#page-cashboxes .cashboxes form,#page-cashboxes .cashbox-overview {grid-template-columns:minmax(0,1fr);}}

@media screen and (min-width:1025px) {
  html:not(.wf-section-mode) body nav.navbar {
    display:grid!important; grid-template-columns:104px minmax(0,1fr) 48px 48px;
    align-items:center; gap:8px; padding-inline:16px!important;
    inset-inline:0!important; width:auto!important; box-sizing:border-box;
  }
  html body nav.navbar .wf-header-controls {display:contents!important;}
  html body nav.navbar .wf-nav-wordmark {
    position:static; transform:none; grid-area:1 / 2; white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis;
  }
  html body nav.navbar .wf-header-controls :is(#desktopSidebarToggle,#themeBtn,#headerSettingsBtn),
  html body nav.navbar .wf-header-controls :is(#desktopSidebarToggle,#themeBtn,#headerSettingsBtn):is(:hover,:active) {
    display:inline-flex!important; position:static!important; transform:none!important;
    align-items:center; justify-content:center; pointer-events:auto; grid-row:1;
  }
  html body nav.navbar #desktopSidebarToggle {grid-column:1;justify-self:start;}
  html body nav.navbar #themeBtn {grid-column:3;}
  html body nav.navbar #headerSettingsBtn {grid-column:4;}
}

@media screen {
 html body #sidebar {padding-inline:8px!important;}
 html body #sidebar::before {mask:none!important;}
 html body #sidebar .wf-sidebar-brand {position:relative;display:grid;grid-template-columns:32px minmax(0,1fr) 40px!important;padding-inline-end:44px!important;}
 html body #sidebar #wfSidebarSearchToggle,html body #sidebar > #wfSidebarClose {
  width:38px!important;height:38px!important;min-height:38px!important;border-radius:11px!important;display:grid;place-items:center;padding:0!important;background:var(--input)!important;color:var(--text)!important;border:1px solid var(--border)!important;box-shadow:none!important;
 }
 html body #sidebar > #wfSidebarClose {inset-block-start:12px!important;inset-inline-end:8px!important;transform:none!important;}
 #wfSidebarSearchToggle span,#wfSidebarSearchToggle::after {display:none!important;}
 html body #sidebar .wf-sidebar-links {overflow:auto!important;align-content:start;}
 #sidebar .wf-nav-group>.side-sec {display:none!important;}
 .wf-group-toggle,#wfDevCredit {font:inherit;color:var(--text);background:transparent;border:0;cursor:pointer;}
 .wf-group-toggle {display:flex;justify-content:space-between;align-items:center;min-height:44px;font-weight:750;padding:7px 12px;}
 .wf-group-toggle::after {content:'';width:7px;height:7px;border:solid currentColor;border-width:0 1.6px 1.6px 0;transform:rotate(45deg);}
 .wf-group-toggle[aria-expanded=true]::after {transform:rotate(225deg);}
 #sidebar.wf-icon-rail .wf-group-toggle {display:none;}
 #wfDevCredit {display:flex;gap:9px;align-items:center;text-align:start;padding:9px;border-top:1px solid var(--border);margin-top:auto;flex:none;}
 #wfDevCredit small,#wfDevCredit b {display:block;}
 #wfDevCredit small {color:var(--text2);}
 #wfDevCredit svg {flex:none;width:32px;height:32px;padding:6px;border-radius:10px;stroke:var(--ui-accent);stroke-width:1.7;fill:none;background:var(--input);}
 .wf-icon-rail #wfDevCredit span {position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden;}
 .wf-nav-dialog {margin:auto;width:min(380px,calc(100vw - 28px));max-height:80dvh;overflow:auto;box-sizing:border-box;padding:18px;color:var(--text);background:var(--card);border:1px solid var(--border);border-radius:18px;box-shadow:0 18px 60px #15293838;}
 .wf-nav-dialog::backdrop {background:#172a3699;}
 .wf-nav-dialog header {display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
 .wf-nav-dialog button,.wf-nav-dialog input {font:inherit;color:var(--text);background:var(--input);border:1px solid var(--border);border-radius:10px;padding:8px;min-height:40px;}
 .wf-nav-dialog header button {width:40px;font-size:20px;}
 #wfSidebarSearch,#wfSearchResults button {width:100%;}
 #wfSearchResults {display:grid;gap:4px;margin-top:8px;}
 #wfSearchResults button {text-align:start;cursor:pointer;}
 #wfDevDialog {text-align:center;}
 #wfDevDialog img {border-radius:50%;object-fit:cover;}
 #wfDevDialog p {color:var(--text2);line-height:1.65;}
}
@media screen and (min-width:1025px) {
 html:not(.wf-section-mode) body nav.navbar {border-radius:var(--wf-header-radius,0 0 23px 23px)!important;}
 html body #sidebar .nav-item > span:nth-child(2),#sidebar .wf-group-toggle {white-space:nowrap!important;}
}
@media screen and (min-width:1025px) {
 html.wf-sidebar-collapsed body #sidebar.wf-icon-rail .wf-sidebar-brand {display:flex!important;justify-content:center;padding:0!important;min-height:42px!important;}
 #sidebar.wf-icon-rail .wf-sidebar-brand :is(img,strong) {display:none!important;}
}
@media screen {
 html body #sidebar.wf-searching :is(#wf-nav-main,#wfSidebarPager,#wfSidebarEmpty) {display:none!important;}
 .wf-search-pane[hidden] {display:none!important;}
 .wf-search-pane {padding:8px;min-height:0;overflow:auto;overscroll-behavior:contain;}
 .wf-search-pane header {display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;color:var(--text);}
 .wf-search-pane button,.wf-search-pane input {box-sizing:border-box;font:inherit;color:var(--text);background:var(--input);border:1px solid var(--border);border-radius:10px;padding:8px;min-height:42px;}
 .wf-search-pane header button {width:40px;font-size:18px;}
 #sidebar .wf-search-pane #wfSidebarSearch {display:block;width:100%;margin-bottom:8px;}
 #sidebar.wf-searching #wfSidebarSearchToggle svg {display:block;}
 #sidebar.wf-searching #wfSidebarSearchToggle::after {content:none;}
 @media(prefers-reduced-motion:no-preference){
 html:not([data-wf-motion="reduced"]) .wf-search-pane:not([hidden]) {animation:wfSearchReveal .17s ease-out;}
 @keyframes wfSearchReveal {from {opacity:.25;transform:translateY(5px);}to {opacity:1;transform:none;}}
 }
}

/* Align the desktop drawer and the content with the dashboard header. */
@media screen and (min-width:1025px) {
 html:not(.wf-section-mode) body {--nav-h:72px;}
 html:not(.wf-section-mode) body aside#sidebar {top:72px!important;bottom:0!important;height:auto!important;max-height:calc(100dvh - 72px)!important;}
}
@media screen {
 html body #sidebar > #wfSidebarSearchToggle {
  display:flex!important;position:static!important;align-self:stretch;width:auto!important;min-height:42px!important;
  margin:4px 6px 8px;padding:0 12px!important;align-items:center;justify-content:flex-start;gap:8px;
 }
 #sidebar > #wfSidebarSearchToggle span {display:inline!important;}
 html body #sidebar.wf-searching > #wfSidebarSearchToggle {display:none!important;}
 #sidebar .wf-context-actions {display:grid;gap:3px;margin-inline-start:16px;padding-inline-start:8px;border-inline-start:2px solid var(--border);}
 #sidebar .wf-context-actions[hidden] {display:none!important;}
 .wf-context-actions button {font:inherit;text-align:start;background:var(--card);color:var(--text);border:0;border-radius:8px;min-height:40px;padding:6px 10px;cursor:pointer;}
 .wf-context-actions button:is(:hover,:focus-visible) {background:var(--wash);}
 #sidebar:not(.wf-icon-rail) .nav-item[aria-expanded] {grid-template-columns:32px minmax(0,1fr) auto 8px!important;}
 #sidebar:not(.wf-icon-rail) .nav-item[aria-expanded]::after {content:'';position:static;width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);}
 #sidebar:not(.wf-icon-rail) .nav-item[aria-expanded=true]::after {transform:rotate(225deg);}
 @media(prefers-reduced-motion:no-preference){html:not([data-wf-motion="reduced"]) .wf-context-actions:not([hidden]) {animation:wfSearchReveal .16s ease-out;}}
}
@media screen and (min-width:1025px) {
 html.wf-sidebar-collapsed body #sidebar.wf-icon-rail .wf-sidebar-brand {display:none!important;}
 html.wf-sidebar-collapsed body #sidebar > #wfSidebarSearchToggle {justify-content:center;margin-inline:0;}
 html.wf-sidebar-collapsed body #sidebar > #wfSidebarSearchToggle span {display:none!important;}
}
@media screen {
 html body #sidebar #wfDevCredit {display:grid;grid-template-columns:38px minmax(0,1fr) 8px;align-items:center;gap:9px;margin: auto 4px 2px;padding:9px 10px;border:1px solid var(--border);border-radius:13px;background:linear-gradient(115deg,var(--card) 42%,var(--wash));}
 #wfDevCredit svg {width:38px;height:38px;padding:7px;box-sizing:border-box;background:var(--card);border:1px solid var(--border);stroke-linejoin:round;stroke-linecap:round;}
 #wfDevCredit small {font-size:10px;line-height:1.4;color:var(--ui-accent);font-weight:700;}
 #wfDevCredit b {font-size:12px;line-height:1.5;}
 #wfDevCredit::after {content:'';width:6px;height:6px;border:solid var(--ui-accent);border-width:1.5px 1.5px 0 0;transform:rotate(45deg);}
 html[dir=rtl] #wfDevCredit::after {transform:rotate(-135deg);}
 #wfDevCredit:focus-visible {outline:2px solid var(--ui-accent);outline-offset:1px;}
 html body #sidebar.wf-icon-rail #wfDevCredit {grid-template-columns:1fr;justify-items:center;padding:3px;margin-inline:0;}
 #sidebar.wf-icon-rail #wfDevCredit::after {display:none;}
}
@media screen {
 #wfDevDialog {width:min(560px,calc(100vw - 24px));text-align:start;}
 #wfDevDialog header {border-bottom:1px solid var(--border);padding-bottom:9px;}
 .wf-dev-profile {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:stretch;}
 .wf-dev-photo,.wf-dev-bio {min-width:0;border-radius:13px;display:flex;flex-direction:column;justify-content:center;padding:12px;}
 .wf-dev-photo {align-items:center;background:linear-gradient(140deg,var(--wash),var(--card));border:1px solid var(--border);}
 #wfDevDialog .wf-dev-photo img {width:min(100%,160px);height:auto;aspect-ratio:1;object-fit:cover;border-radius:12px;}
 .wf-dev-bio {padding-inline:4px;}
 #wfDevDialog h2 {margin:0;font-size:clamp(16px,3vw,23px);line-height:1.45;}
 #wfDevDialog p {margin:6px 0 0;font-size:clamp(12px,2vw,14px);}
}

@media screen {
 .wf-search-shade:not([hidden]) {position:fixed;inset:0;z-index:1000;background:rgb(24 47 56 / 34%);}
 [data-theme="dark"] .wf-search-shade {background:rgb(4 13 20 / 62%);}
 html body #sidebar.wf-searching {z-index:1250!important;}
 #sidebar .wf-search-pane header button {display:grid;place-items:center;border-radius:11px;color:var(--text);background:var(--card);font-size:24px;line-height:1;}
 #wfSearchResults button {display:flex;align-items:center;gap:8px;background:var(--card);}
 #wfSearchResults button:is(:focus-visible,:hover) {background:var(--wash);outline:2px solid var(--ui-accent);outline-offset:-2px;}
 .wf-result-icon {display:grid;place-items:center;width:30px;height:30px;background:var(--input);color:var(--ui-accent);border-radius:9px;}
 .wf-result-icon svg {width:18px;height:18px;}
 @media(prefers-reduced-motion:no-preference){html:not([data-wf-motion="reduced"]) .wf-search-shade:not([hidden]) {animation:wfShadeIn .16s ease-out;}@keyframes wfShadeIn {from{opacity:0}to{opacity:1}}}
}

@media screen {
 html body #sidebar:not(.wf-icon-rail) {padding-inline:10px!important;}
 html body #sidebar:not(.wf-icon-rail) .wf-sidebar-links:not(.wf-nav-paged) {
   gap:9px;padding:4px 2px 9px;scroll-padding-block:8px;
 }
 html body #sidebar:not(.wf-icon-rail) .wf-sidebar-links .wf-nav-group {
   gap:3px;padding:4px!important;background:var(--card)!important;
   border:1px solid var(--border);border-radius:14px;
 }
 #sidebar .wf-group-toggle {text-align:start;padding-inline:12px;gap:10px;color:var(--text2);}
 #sidebar .wf-group-toggle[aria-expanded=true] {color:var(--text);}
 html body #sidebar:not(.wf-icon-rail) .nav-item {
   margin:0!important;min-height:44px;border:1px solid transparent!important;border-radius:10px!important;
 }
 html body #sidebar:not(.wf-icon-rail) .nav-item.active {
   border-color:color-mix(in srgb,var(--ui-accent) 35%,var(--border))!important;
   background:var(--wash)!important;color:var(--ink,var(--text))!important;
 }
 html body #sidebar:not(.wf-icon-rail) .wf-context-actions {
   margin-inline:18px 5px;padding:2px 8px;gap:4px;margin-block-end:5px;
 }
 #sidebar .wf-context-actions button {background:var(--input);padding-inline:10px;}
 html body #sidebar:not(.wf-icon-rail) #wfDevCredit {margin-block-start:8px;}
 @media (max-height:500px) {
   html body #sidebar:not(.wf-icon-rail) .wf-sidebar-links:not(.wf-nav-paged) {gap:5px;}
 }
}

/* Inline sidebar search: exact same footprint as the search trigger. */
@media screen {
 html body #sidebar > .wf-search-inline[hidden] {display:none!important;}
 html body #sidebar > .wf-search-inline {
   display:flex!important;flex:0 0 auto;align-items:center;gap:6px;
   min-width:0;box-sizing:border-box;margin:4px 6px 8px;
   padding:4px 5px 4px 10px;min-height:44px;
   border:1px solid var(--border);border-radius:12px;background:var(--input);
 }
 html body #sidebar > .wf-search-inline #wfSidebarSearch {
   display:block!important;flex:1 1 auto;min-width:0;width:100%;height:36px;min-height:36px;
   border:0!important;outline:0!important;box-shadow:none!important;
   background:transparent!important;margin:0!important;padding:0 5px!important;
   color:var(--text);font:inherit;font-size:16px;
 }
 html body #sidebar > .wf-search-inline:focus-within {outline:2px solid var(--ui-accent);outline-offset:1px;}
 html body #sidebar > .wf-search-inline .wf-search-inline-clear {
   flex:0 0 32px;width:32px;height:32px;min-height:32px;border:0;
   border-radius:9px;font:24px/1 sans-serif;color:var(--text);background:var(--card);cursor:pointer;
 }
 html body #sidebar.wf-searching > #wfSidebarSearchToggle {display:none!important;}
 html body #sidebar.wf-searching > #wfSearchDialog {
   flex:1 1 0;min-height:0;overflow:auto;padding:6px 8px;
   background:transparent;border:0;box-shadow:none;
 }
 html body #sidebar.wf-searching > #wfSearchDialog header {display:none!important;}
 html body #sidebar.wf-searching #wfSearchResults {margin-top:0;}
 html body #sidebar.wf-searching #wfSearchResults button {min-height:44px;}
}

/* WOW shared rounded controls. Keep circular controls, dock and edge grip intact. */
@media screen {
 html {--wf-control-radius:14px;}
 html body #mainContent .page :is(.btn,.btn-p,.btn-g,.btn-s,.btn-b,.co-stat-pill,.co-details-toggle,.tab-btn,.wf-search-toggle,.qbl-modes button,.tg-opt) {
   border-radius:var(--wf-control-radius)!important;
 }
 html body #mainContent .page :is(.co-actions,.pr-card-new-actions,.inv-card-actions,.co-toolbar-row,.page-toolbar-row,.wf-heading-actions) :is(button,.btn) {
   border-radius:var(--wf-control-radius)!important;
 }
 html body #sidebar :is(.nav-item,.wf-group-toggle,.wf-context-actions button,#wfSidebarSearchToggle),
 html body #sidebar #wfSearchResults button,
 html body #sidebar > .wf-search-inline,
 html body #sidebar .wf-search-inline-clear {
   border-radius:var(--wf-control-radius)!important;
 }
 html body #mainContent .page :is(.btn,.co-stat-pill,.stat-card,.wf-sales-action,.wf-search-toggle):focus-visible {
   outline:2px solid var(--brand-primary);outline-offset:2px;
 }
 @media(prefers-reduced-motion:no-preference) {
  html:not([data-wf-motion="reduced"]) body #mainContent .page :is(.btn,.co-stat-pill,.stat-card,.wf-sales-action) {
    transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease,translate .18s ease!important;
  }
 }
}
@media screen {
 html body #mainContent .page .wf-page-position,
 html body .wf-nav-wordmark .wf-page-position {
   display:inline-flex;align-items:center;justify-content:center;max-width:100%;
   min-width:0;margin-inline:7px;padding:2px 8px;box-sizing:border-box;
   border:1px solid color-mix(in srgb,var(--brand-primary) 18%,var(--border));
   border-radius:999px;background:color-mix(in srgb,var(--brand-primary) 7%,var(--card));
   color:var(--text2);font-size:10px!important;font-weight:700!important;
   line-height:1.5;white-space:normal;overflow-wrap:anywhere;text-align:center;
 }
 html body .wf-nav-wordmark .wf-page-position {display:flex;margin:3px auto 0;width:max-content;max-width:100%;font-size:9px!important;}
 html body #mainContent .page > .wf-page-position {display:flex;width:max-content;margin:0 0 9px;}
 @media(max-width:480px) {
  html body #mainContent .page .wf-page-position {font-size:9px!important;padding-inline:5px;margin-inline:4px;}
 }
}
@media screen and (max-width:1024px) {
 html body #toastBox {max-width:min(92vw,330px);box-sizing:border-box;}
 html body #toastBox .toast {max-width:100%;overflow-wrap:anywhere;}
}

/* Final consistent bottom-nav identity after dashboard style overrides. */
@media screen and (max-width:1024px) {
 html:root body #bottomNav #bnavCircle {
   background:var(--brand-primary)!important;
   border-color:var(--brand-primary)!important;
   color:white!important;
 }
 html:root body #bottomNav #bnavCircleIcon,
 html:root body #bottomNav #bnavCircleIcon svg {color:#fff!important;}
 html[data-theme="dark"] body #bottomNav .bnav-btn.bnav-active .bnav-label {
   color:#8ccfe2!important;
 }
}

/* The bottom HOME slot itself follows scroll; never add a floating button. */
@media screen and (max-width:1024px) {
 html body #bottomNav #bnav-2.wf-home-up .bnav-icon svg {
   display:block;width:24px;height:24px;fill:none;stroke:currentColor;
 }
 html body #bottomNav #bnav-2.wf-home-up:not(.bnav-active) {
   background:color-mix(in srgb,var(--brand-primary) 9%,transparent)!important;
   border-radius:14px!important;
 }
 html body #bottomNav #bnav-2.wf-home-up:not(.bnav-active) .bnav-icon {
   color:var(--brand-primary)!important;
   opacity:1!important;
 }
 html body #bottomNav #bnav-2.wf-home-up .bnav-label {
   color:var(--brand-primary)!important;
 }
 html body #bottomNav #bnavCircleIcon [data-wf-home-up] {
   display:block;width:24px;height:24px;fill:none;
   stroke:#fff!important;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round;
 }
}

/* Sidebar width, logo and selected-state modernization. */
@media screen and (min-width:1025px) {
 html:root {--side-w:clamp(260px,21vw,306px);}
 html body #sidebar:not(.wf-icon-rail){width:var(--side-w)!important;}
}
@media screen and (max-width:1024px) {
 html body #sidebar:not(.wf-icon-rail){
   width:min(308px,86vw)!important;
   max-width:calc(100vw - 32px)!important;
 }
}
@media screen {
 html body #sidebar:not(.wf-icon-rail) .wf-sidebar-brand {
   display:grid!important;grid-template-columns:60px minmax(0,1fr)!important;
   align-items:center!important;gap:10px!important;
   min-height:80px!important;height:auto!important;
   padding:8px 46px 8px 7px!important;margin:0 4px 8px!important;
   box-sizing:border-box;
 }
 html body #sidebar:not(.wf-icon-rail) #wfSidebarLogo {
   display:block;width:60px!important;height:60px!important;min-width:60px!important;
   padding:5px!important;object-fit:contain!important;
   background:var(--logo-surface,#fff)!important;
   border:1px solid color-mix(in srgb,var(--brand-primary) 22%,var(--border))!important;
   border-radius:16px!important;
   box-shadow:0 3px 12px color-mix(in srgb,var(--brand-primary) 12%,transparent)!important;
   box-sizing:border-box;
 }
 html body #sidebar:not(.wf-icon-rail) .wf-sidebar-brand strong {
   display:block;min-width:0;max-width:100%;font-size:clamp(13px,1.3vw,15px)!important;
   font-weight:800!important;line-height:1.3!important;overflow-wrap:anywhere;text-align:start;
 }
 html body #sidebar:not(.wf-icon-rail) .nav-item.active {
   background:linear-gradient(130deg,#276c7a,#355f78)!important;
   border:1px solid rgba(30,96,117,.75)!important;
   color:#fff!important;
   box-shadow:0 5px 14px rgba(30,76,94,.14)!important;
 }
 html body #sidebar:not(.wf-icon-rail) .nav-item.active > :is(span,.nav-icon),
 html body #sidebar:not(.wf-icon-rail) .nav-item.active .wf-ui-icon {color:#fff!important;}
 html body #sidebar:not(.wf-icon-rail) .nav-item.active .nav-icon {
   background:rgb(255 255 255 / 17%)!important;box-shadow:none!important;
 }
 html body #sidebar:not(.wf-icon-rail) .nav-item.active .nav-badge {
   color:#fff!important;background:rgb(255 255 255 / 19%)!important;
   border-color:rgb(255 255 255 / 27%)!important;
 }
 html[data-theme="dark"] body #sidebar:not(.wf-icon-rail) .nav-item.active {
   background:linear-gradient(130deg,#276a7e,#3e7790)!important;
   border-color:#5a8f9e!important;box-shadow:0 5px 16px rgba(0,0,0,.2)!important;
 }
 html body #sidebar:not(.wf-icon-rail) .nav-item.active:focus-visible {
   outline:2px solid #8bd5db!important;outline-offset:2px!important;
 }
 @media(max-width:380px) {
  html body #sidebar:not(.wf-icon-rail) .wf-sidebar-brand {grid-template-columns:54px minmax(0,1fr)!important;gap:8px!important;}
  html body #sidebar:not(.wf-icon-rail) #wfSidebarLogo {width:54px!important;height:54px!important;min-width:54px!important;}
 }
 @media(max-height:450px) and (max-width:1024px) {
  html body #sidebar:not(.wf-icon-rail) .wf-sidebar-brand {min-height:54px!important;padding-block:3px!important;}
  html body #sidebar:not(.wf-icon-rail) #wfSidebarLogo {width:44px!important;height:44px!important;min-width:44px!important;}
 }
}

/* Modern barcode workbench with a permanent safe-area mobile dock.
   Only spacing/surfaces are changed; camera, search, tier and cart handlers stay intact. */
@media screen {
 #page-quick-barcode .qbl-workbench {
   width:min(100%,720px)!important;max-width:100%;margin:clamp(12px,2.5vw,22px) auto 20px!important;
   display:grid;gap:11px;min-width:0;
 }
 #page-quick-barcode .qbl-modes {
   display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));
   gap:8px;padding:5px;background:var(--input);
   border:1px solid var(--border);border-radius:17px;
 }
 #page-quick-barcode .qbl-modes button {
   display:flex;align-items:center;justify-content:center;gap:6px;
   min-width:0;min-height:46px!important;
   padding:8px 10px!important;font:inherit;font-weight:750!important;font-size:13px!important;
   line-height:1.3;white-space:normal!important;cursor:pointer;
   color:var(--text2)!important;background:transparent!important;
   border:1px solid transparent!important;border-radius:13px!important;
   box-shadow:none!important;
 }
 #page-quick-barcode .qbl-modes button[aria-pressed="true"] {
   color:#fff!important;background:linear-gradient(140deg,#276b7c,#365f78)!important;
   border-color:transparent!important;box-shadow:none!important;
 }
 #page-quick-barcode .qbl-panel {
   min-width:0;padding:clamp(9px,1.8vw,14px)!important;
   background:var(--card);border:1px solid var(--border);
   border-radius:21px;box-shadow:0 6px 25px rgba(19,50,63,.055);
 }
 #page-quick-barcode .qbl-view {
   position:relative!important;isolation:isolate;min-width:0;
   height:clamp(230px,42dvh,390px)!important;
   overflow:hidden;border-radius:17px!important;
   background:#142f3d;
 }
 #page-quick-barcode #qblCameraWrap,
 #page-quick-barcode #qblDropdown {
   border-radius:17px!important;overflow:hidden!important;
 }
 #page-quick-barcode #qblCameraWrap video {object-fit:cover!important;}
 #page-quick-barcode #qblInput {
   min-width:0;width:100%;min-height:50px!important;font-size:16px!important;
   border-radius:13px!important;background:var(--input)!important;
   border:1px solid var(--border)!important;
 }
 #page-quick-barcode .qbl-search-trigger {
   flex:0 0 auto;min-height:50px!important;
   border-radius:13px!important;padding-inline:16px!important;
   background:var(--brand-primary)!important;color:#fff!important;
 }
 #page-quick-barcode .qbl-view + div {padding:12px 2px 2px!important;}
 #page-quick-barcode .qbl-view + div > div {min-width:0;}
 #page-quick-barcode #qblDdTabs {
   display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;
 }
 #page-quick-barcode #qblDdTabs button {min-width:0;overflow-wrap:anywhere;border-radius:11px!important;}
 #page-quick-barcode #qblPhase3 > div {
   max-width:680px!important;padding-inline:clamp(0px,2vw,18px)!important;
 }
 #page-quick-barcode #qblProductCard {
   border:1px solid var(--border)!important;border-radius:19px!important;
   box-shadow:0 7px 26px rgba(19,50,63,.08)!important;
 }
 #page-quick-barcode #qblFinalDetails {gap:8px!important;min-width:0;}
 #page-quick-barcode #qblFinalPriceBox {
   border-color:color-mix(in srgb,var(--brand-primary) 46%,var(--border))!important;
   background:color-mix(in srgb,var(--brand-primary) 7%,var(--card))!important;
   border-radius:14px!important;
 }
 #page-quick-barcode :is(#qblQtyWrap,.qbl-search-trigger,#qblNotFound button) {border-radius:14px!important;}
 @media(max-width:480px) {
  #page-quick-barcode .qbl-workbench {gap:8px;}
  #page-quick-barcode .qbl-panel {padding:8px!important;border-radius:17px;}
  #page-quick-barcode .qbl-view {height:clamp(220px,35dvh,320px)!important;}
  #page-quick-barcode .qbl-view + div {padding:10px 1px 1px!important;}
  #page-quick-barcode .qbl-search-trigger {padding-inline:11px!important;}
  #page-quick-barcode #qblPhase3 > div {padding:9px 3px 110px!important;}
  #page-quick-barcode #qblFinalDetails {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  #page-quick-barcode #qblQtyWrap {flex-wrap:wrap!important;gap:9px!important;}
  #page-quick-barcode #qblQtyWrap > :last-child {margin-inline-start:auto;}
 }
 @media(prefers-reduced-motion:reduce) {
  #page-quick-barcode .qbl-modes button,
  #page-quick-barcode #qblCameraWrap * {animation:none!important;transition:none!important;}
 }
}
/* Shadow-only correction: retain the original raised circle, carved curve,
   geometry, backgrounds, accents and adaptive icon. */
@media screen and (max-width:1024px) {
 html body #bottomNav {
   box-shadow:none!important;
   filter:none!important;
 }
 html body #bottomNav #bnavCircle,
 html body #bottomNav .bnav-btn,
 html body #bottomNav .bnav-btn.bnav-active,
 html body #bottomNav .bnav-btn.bnav-active::before,
 html body #bottomNav .bnav-btn.bnav-active .bnav-icon::before,
 html body #bottomNav .wf-task-action,
 html body #bottomNav .wf-task-action > span:first-child {
   box-shadow:none!important;
   filter:none!important;
   text-shadow:none!important;
 }
}

/* Compact brand-colored dock. Keep the cutout, floating circle and adaptive icon;
   cast one soft shadow from the shaped surface, never from the circular button. */
@media screen and (max-width:1024px) {
 html:root body #bottomNav {
   height:calc(64px + env(safe-area-inset-bottom,0px))!important;
   padding-top:0!important;
 }
 html:root body #bottomNav .bnav-btn {padding-top:7px!important;gap:3px!important;}
 html:root body #bottomNav::before {
   filter:none!important;box-shadow:none!important;
 }
 html:root body #bottomNav .bottom-nav-bg {
   display:block!important;z-index:-1;pointer-events:none;
   background:transparent!important;box-shadow:none!important;border:0!important;
   backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
   filter:drop-shadow(0 -2px 12px rgb(18 42 55 / 6%))!important;
 }
 html:root body #bottomNav .bottom-nav-bg::before {
   content:"";position:absolute;inset:0;background:var(--card);
   mask:var(--wf-dock-cutout) calc(var(--nav-x) - 5000px) 0 / 10000px 160px no-repeat;
   -webkit-mask:var(--wf-dock-cutout) calc(var(--nav-x) - 5000px) 0 / 10000px 160px no-repeat;
 }
 html[data-theme="dark"] body #bottomNav .bottom-nav-bg {
   filter:drop-shadow(0 -2px 12px rgb(0 0 0 / 15%))!important;
 }
 html:root body #bottomNav #bnavCircle {
   background:var(--brand-primary)!important;
   color:#fff!important;
   border:0!important;outline:0!important;
   box-shadow:none!important;filter:none!important;
 }
 html:root body #bottomNav #bnavCircleIcon,
 html:root body #bottomNav #bnavCircleIcon svg,
 html:root body #bottomNav #bnavCircleIcon [data-wf-home-up] {
   color:#fff!important;stroke:currentColor!important;
 }
 html[data-theme="dark"] body #bottomNav #bnavCircleIcon,
 html[data-theme="dark"] body #bottomNav #bnavCircleIcon svg,
 html[data-theme="dark"] body #bottomNav #bnavCircleIcon [data-wf-home-up] {
   color:#fff!important;stroke:currentColor!important;
 }
 html:root body #bottomNav .bnav-btn.bnav-active {
   background:transparent!important;
 }
 html:root body #bottomNav .bnav-btn.bnav-active .bnav-label {
   color:var(--ui-accent)!important;
 }
 html:root body #bottomNav[data-task-mode="action"] .wf-task-action > span:first-child {
   background:var(--brand-primary)!important;color:#fff!important;
   border:0!important;
   box-shadow:none!important;
 }
 html:root body #bottomNav #bnavCircle::before,
 html:root body #bottomNav #bnavCircle::after {
   content:none!important;display:none!important;
 }
 html body #mainContent .page {padding-bottom:calc(82px + env(safe-area-inset-bottom,0px))!important;}
 html body .co-form-sticky-bar {bottom:calc(64px + env(safe-area-inset-bottom,0px))!important;}
 html body .qbl-cart-fab {bottom:calc(80px + env(safe-area-inset-bottom,0px))!important;}
}

/* A complete outlined grip and a viewport-aware, naturally scrollable panel. */
@media screen {
 html body .dash-visibility[data-side] {
   left:var(--wf-dock-left,0px)!important;right:auto!important;
   width:14px!important;min-width:14px!important;max-width:14px!important;
 }
 html body .dash-visibility[data-side] summary {
   position:relative;background:transparent!important;border:0!important;
   width:14px!important;min-width:14px!important;max-width:14px!important;
   border-radius:0!important;box-shadow:none!important;overflow:visible!important;
   clip-path:none!important;-webkit-clip-path:none!important;touch-action:none;
 }
 html body .dash-visibility summary::after {
   content:"";position:absolute;inset:-10px 0;background:transparent;
 }
 html body .dash-visibility summary svg:not(.wf-dock-shape) {width:10px!important;}
 html body .dash-visibility summary svg.wf-dock-shape {
   position:absolute!important;inset:0!important;z-index:0!important;
   width:100%!important;height:100%!important;flex:none!important;
   color:var(--brand-primary)!important;fill:var(--card)!important;
   stroke:var(--brand-primary)!important;pointer-events:none;
 }
 html body .dash-visibility[data-side="right"] summary svg.wf-dock-shape {transform:scaleX(-1);}
 html body .dash-visibility[open] summary svg.wf-dock-shape {fill:var(--input)!important;}
 html body .dash-visibility summary:focus-visible {
   outline:2px solid var(--ui-accent)!important;outline-offset:3px!important;
 }
 html body .dash-visibility .dash-dock-panel {
   display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;
   padding:12px!important;gap:8px;
   border:1px solid color-mix(in srgb,var(--brand-primary) 35%,var(--border));
   background:var(--card)!important;
   box-shadow:0 8px 26px rgb(18 42 55 / 10%)!important;
 }
 html body .dash-visibility .dash-dock-toolbar {
   display:grid;grid-template-columns:minmax(0,1fr) 32px 32px;
   flex:none;align-items:center;gap:4px;margin:0;padding:0 0 8px;
   border-bottom:1px solid var(--border);background:var(--card);
   transition:box-shadow .2s ease;
 }
 html body .dash-visibility .dash-dock-toolbar strong {
   min-width:0;font-size:13px;line-height:1.5;overflow-wrap:anywhere;
 }
 html body .dash-visibility .dash-dock-toolbar button {min-width:32px;min-height:36px;padding:0;}
 html body .dash-visibility .dash-dock-layout {
   flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;
   overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;
   padding:0 2px;scroll-padding-block:8px;scrollbar-width:thin;
   scrollbar-color:color-mix(in srgb,var(--brand-primary) 35%,transparent) transparent;
 }
 html body .dash-visibility .dash-dock-layout label {
   min-height:44px;gap:8px;padding:7px 3px;font-size:14px;line-height:1.5;
 }
 html body .dash-visibility .dash-dock-layout input {flex:none;}
 html body .dash-visibility .dash-dock-panel[data-scroll-top="true"] .dash-dock-toolbar {
   box-shadow:0 5px 10px -8px rgb(18 42 55 / 30%);
 }
 html body .dash-visibility .dash-dock-layout[data-scroll-bottom="true"] {
   box-shadow:inset 0 -10px 10px -12px color-mix(in srgb,var(--brand-primary) 40%,transparent);
 }
 html[data-theme="dark"] body .dash-visibility .dash-dock-panel {box-shadow:0 8px 26px rgb(0 0 0 / 20%)!important;}
}
@media screen and (max-width:1024px) and (prefers-reduced-motion:no-preference) {
 html:not([data-wf-motion="reduced"]) body #bottomNav {transition:--nav-x .36s cubic-bezier(.22,.61,.36,1)!important;}
 html:not([data-wf-motion="reduced"]) body #bottomNav #bnavCircle {transition:left .36s cubic-bezier(.22,.61,.36,1)!important;}
}
@media screen and (prefers-reduced-motion:no-preference) {
 html:not([data-wf-motion="reduced"]) body .dash-visibility:not([data-dragging="true"]) {
   transition:left .24s cubic-bezier(.22,.61,.36,1);
 }
 html:not([data-wf-motion="reduced"]) body .dash-visibility[open] .dash-dock-panel {
   animation:wfDockReveal .2s cubic-bezier(.22,.61,.36,1) both!important;
 }
}
@keyframes wfDockReveal {
 from {opacity:0;transform:translateY(4px);}
 to {opacity:1;transform:translateY(0);}
}

/* Desktop content keeps a useful reading width; mobile controls keep their space. */
@media screen and (min-width:1025px) {
 html body #mainContent :is(#coGrid,#prGrid,#invListContainer) {
   max-width:1440px!important;margin-inline:auto!important;
   grid-template-columns:repeat(auto-fill,minmax(min(100%,285px),1fr))!important;
 }
 html body #mainContent #page-add-company > .card,
 html body #mainContent #page-add-product #pr-form-view > :is(.card,#prSelectedTypeBanner) {
   box-sizing:border-box;width:100%;max-width:1040px!important;margin-inline:auto!important;
 }
 html body #mainContent #page-create-invoice > .inv-builder,
 html body #mainContent #page-reports > :is(#wfReportsOverview,.wf-report-sales) {
   box-sizing:border-box;width:100%;max-width:1120px!important;margin-inline:auto!important;
 }
 html body #mainContent :is(#page-select-client-type,#page-select-invoice-type) > div:has(> .client-type-step-card) {
   max-width:1024px!important;display:grid!important;
   grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))!important;
   gap:16px;align-items:stretch;
 }
 html body #mainContent :is(#page-select-client-type,#page-select-invoice-type) > div > .client-type-step-card {
   min-width:0;margin:0!important;
 }
}
@media screen and (min-width:1100px) {
 html body #mainContent #page-add-company #coFormFields {
   grid-template-columns:repeat(3,minmax(0,1fr))!important;
 }
}

/* A parent row expands its actions; the first child explicitly opens the page. */
@media screen {
 html body #sidebar .wf-destination-row {
   display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:3px;align-items:stretch;min-width:0;
 }
 html body #sidebar .wf-destination-row[hidden] {display:none!important;}
 html body #sidebar .wf-destination-row .nav-item {min-width:0;width:100%;}
 html body #sidebar:not(.wf-icon-rail) .wf-destination-row>.nav-item[aria-expanded] {grid-template-columns:32px minmax(0,1fr) auto!important;}
 html body #sidebar:not(.wf-icon-rail) .wf-destination-row>.nav-item[aria-expanded]::after {display:none!important;}
 html body #sidebar .wf-destination-toggle {
   display:grid;place-items:center;min-width:44px;min-height:44px;margin:0;padding:0;
   border:1px solid transparent;border-radius:10px;background:transparent;
   color:var(--text2);cursor:pointer;touch-action:manipulation;
 }
 html body #sidebar .wf-destination-toggle svg {
   width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
 }
 html body #sidebar .wf-destination-toggle[aria-expanded="true"] {background:var(--wash);color:var(--ui-accent);}
 html body #sidebar .wf-destination-toggle[aria-expanded="true"] svg {transform:rotate(180deg);}
 html body #sidebar .wf-destination-toggle:focus-visible {outline:2px solid var(--ui-accent);outline-offset:-2px;}
 html body #sidebar.wf-icon-rail .wf-destination-row {grid-template-columns:minmax(0,1fr);}
 html body #sidebar .wf-destination-toggle[hidden] {display:none!important;}
 html body #sidebar .wf-context-actions button {min-height:44px;}
 html body #sidebar .wf-context-actions button[aria-current="page"] {background:var(--wash);color:var(--ui-accent);font-weight:700;}
 @media(prefers-reduced-motion:no-preference) {html:not([data-wf-motion="reduced"]) body #sidebar .wf-destination-toggle svg {transition:transform .18s ease;}}
}
