/* Foldable product cards: screen workspace. Printed cards remain isolated below. */
#wfProductLabels[hidden],
#wfProductLabels [hidden],
.wf-label-paper [hidden] {
  display: none !important;
}

@media screen {
  #page-products.wf-label-mode > .co-page-sticky,
  #page-products.wf-label-mode > #prGrid { display: none !important; }
  body:has(#page-products.active.wf-label-mode) #wfContextNav { display: none !important; }
  /* The app's pan-y rule otherwise blocks the horizontal card queue. */
  html body #mainContent:has(#page-products.active.wf-label-mode) { touch-action: auto !important; }
  html:has(#page-products.active.wf-label-mode) { scroll-padding-block-end: calc(96px + env(safe-area-inset-bottom, 0px)); }

  html body #mainContent #page-products #wfProductLabels {
    --label-surface: var(--window-surface, var(--paper, var(--card, #fff)));
    --label-muted: var(--window-muted, var(--wash, var(--input, #edf3f4)));
    --label-edge: var(--window-edge, var(--hairline, var(--border, #d7e0e5)));
    --label-accent: var(--brand-primary, #245b6c);
    --label-sticky-top: calc(var(--nav-h, 72px) + 8px);
    container-name: wf-product-labels;
    container-type: inline-size;
    display: grid;
    gap: 16px;
    inline-size: 100%;
    max-inline-size: 1440px;
    min-inline-size: 0;
    margin-inline: auto;
    padding-block-end: max(24px, env(safe-area-inset-bottom, 0px));
    scroll-margin-block-start: var(--label-sticky-top);
    color: var(--text, #213547);
  }
  html.wf-section-mode body #mainContent #page-products #wfProductLabels {
    --label-sticky-top: max(8px, env(safe-area-inset-top, 0px));
  }
  #wfProductLabels,
  #wfProductLabels * { box-sizing: border-box; }
  #wfProductLabels :is(button, summary, input) { font-family: inherit; }
  #wfProductLabels :is(button, summary) { touch-action: manipulation; }
  #wfProductLabels button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-inline-size: 0;
    min-block-size: 44px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
  }
  #wfProductLabels button > svg { inline-size: 19px; block-size: 19px; flex: none; }
  #wfProductLabels :is(button, summary, input):focus-visible {
    outline: 2px solid var(--label-accent);
    outline-offset: 3px;
  }
  #wfProductLabels button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
  #wfProductLabels :is(.wf-label-heading, .wf-label-language, .wf-label-selection, .wf-label-preview-nav, .wf-label-empty, .wf-label-source, .wf-label-guide) :is(h2, h3, p, strong, small, summary) { overflow-wrap: anywhere; }

  #wfProductLabels .wf-label-toolbar {
    position: sticky;
    inset-block-start: var(--label-sticky-top);
    z-index: 30;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--label-edge);
    border-block-start: 3px solid var(--label-accent);
    border-radius: 18px;
    background: var(--label-surface);
    box-shadow: 0 5px 18px rgb(22 48 58 / 5%);
  }
  #wfProductLabels .wf-label-toolbar.wf-notifications-slot {
    grid-template-columns: var(--wf-workspace-control, 44px) minmax(0, 1fr) var(--wf-workspace-control, 44px) auto;
  }
  #wfProductLabels .wf-label-toolbar.wf-notifications-slot > .wf-label-back { grid-column: 1; grid-row: 1; }
  #wfProductLabels .wf-label-toolbar.wf-notifications-slot > .wf-label-heading { grid-column: 2; grid-row: 1; }
  #wfProductLabels .wf-label-toolbar.wf-notifications-slot > .wf-label-print { grid-column: 4; grid-row: 1; }
  #wfProductLabels .wf-label-toolbar > #wfNotificationsButton {
    position: static !important;
    inset: auto !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: center;
    inline-size: var(--wf-workspace-control, 44px);
    min-inline-size: var(--wf-workspace-control, 44px);
    block-size: var(--wf-workspace-control, 44px);
    min-block-size: var(--wf-workspace-control, 44px);
    padding: 0;
    border: 1px solid var(--label-edge);
    border-radius: 13px;
    background: var(--label-surface);
    color: var(--label-accent);
    transform: none !important;
  }
  #wfProductLabels .wf-label-heading { min-inline-size: 0; }
  #wfProductLabels .wf-label-heading h2 {
    margin: 0;
    color: var(--text, #213547);
    font-size: clamp(18px, 2vw, 23px);
    font-weight: 750;
    line-height: 1.4;
  }
  #wfProductLabels .wf-label-heading p {
    margin: 3px 0 0;
    color: var(--text2, #5d6f7d);
    font-size: 13px;
    line-height: 1.55;
  }
  #wfProductLabels :is(.wf-label-back, .wf-label-prev, .wf-label-next) {
    display: inline-grid;
    place-items: center;
    inline-size: 44px;
    min-inline-size: 44px;
    block-size: 44px;
    padding: 9px;
    border: 1px solid var(--label-edge);
    border-radius: 12px;
    background: var(--label-surface);
    color: var(--label-accent);
    line-height: 1;
  }
  #wfProductLabels :is(.wf-label-back, .wf-label-prev, .wf-label-next, .wf-label-choice-preview) > span {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  #wfProductLabels[dir="rtl"] :is(.wf-label-back, .wf-label-prev, .wf-label-next) > svg { transform: rotate(180deg); }
  #wfProductLabels .wf-label-print {
    max-inline-size: 240px;
    padding: 10px 16px;
    border: 1px solid var(--label-accent);
    border-radius: 12px;
    background: var(--label-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
  }
  #wfProductLabels .wf-label-mobile-tabs { display: none; }
  #wfProductLabels .wf-label-body {
    display: grid;
    grid-template-columns: clamp(290px, 29%, 340px) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    min-inline-size: 0;
  }
  #wfProductLabels :is(.wf-label-catalog-panel, .wf-label-preview-panel) {
    display: grid;
    align-content: start;
    gap: 12px;
    min-inline-size: 0;
    scroll-margin-block-start: calc(var(--label-sticky-top) + 145px);
  }
  #wfProductLabels :is(.wf-label-language, .wf-label-selection) {
    min-inline-size: 0;
    padding: 12px;
    border: 1px solid var(--label-edge);
    border-radius: 15px;
    background: var(--label-surface);
  }
  #wfProductLabels > .wf-label-language {
    display: grid;
    grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
    align-items: center;
    gap: 8px 16px;
    padding: 10px 14px;
    border-radius: 14px;
  }
  #wfProductLabels > .wf-label-language .wf-label-preference-note { margin: 0; }
  #wfProductLabels > .wf-label-language .wf-label-language-choices {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-block-start: 0;
  }
  #wfProductLabels .wf-label-language-toggle {
    display: grid;
    grid-template-columns: 19px minmax(0, 1fr) 19px;
    gap: 9px;
    inline-size: 100%;
    padding: 9px 10px;
    border: 1px solid var(--label-edge);
    border-radius: 10px;
    background: var(--label-muted);
    color: var(--text, #213547);
    font-size: 14px;
    font-weight: 700;
    text-align: start;
  }
  #wfProductLabels .wf-label-language-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-block-start: 8px;
  }
  #wfProductLabels .wf-label-language-choices button {
    padding: 8px 5px;
    border: 1px solid var(--label-edge);
    border-radius: 9px;
    background: var(--label-surface);
    color: var(--text2, #5d6f7d);
    font-size: 14px;
    font-weight: 650;
  }
  #wfProductLabels .wf-label-language-choices button[aria-pressed="true"] {
    border-color: var(--label-accent);
    background: var(--label-muted);
    color: var(--text, #213547);
    box-shadow: inset 0 0 0 1px var(--label-accent);
  }
  #wfProductLabels .wf-label-preference-note {
    display: block;
    margin-block-start: 7px;
    color: var(--text2, #5d6f7d);
    font-size: 12px;
    line-height: 1.55;
  }
  #wfProductLabels .wf-label-selection > summary {
    min-block-size: 44px;
    padding: 8px 2px;
    color: var(--text, #213547);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
    cursor: pointer;
  }
  #wfProductLabels .wf-label-selection > summary::marker { color: var(--label-accent); }
  html body #mainContent #page-products #wfProductLabels .wf-label-selection input.fc {
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    min-block-size: 46px;
    margin: 7px 0 10px;
    padding: 10px 11px;
    border-color: var(--label-edge) !important;
    border-radius: 10px;
    background: var(--label-surface) !important;
    color: var(--text, #213547);
    font-size: 16px;
    line-height: 1.5;
  }
  #wfProductLabels :is(.wf-label-filters, .wf-label-view-controls) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--label-edge);
    border-radius: 11px;
    background: var(--label-muted);
  }
  #wfProductLabels :is(.wf-label-filter, .wf-label-view, .wf-label-tab) {
    min-inline-size: 0;
    padding: 8px 5px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text2, #5d6f7d);
    font-size: 14px;
    font-weight: 650;
  }
  #wfProductLabels :is(.wf-label-filter, .wf-label-view)[aria-pressed="true"],
  #wfProductLabels .wf-label-tab[aria-selected="true"] {
    border-color: var(--label-edge);
    background: var(--label-surface);
    color: var(--label-accent);
    box-shadow: 0 2px 5px rgb(22 48 58 / 4%);
  }
  #wfProductLabels .wf-label-selection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-block: 10px 7px;
  }
  #wfProductLabels .wf-label-selection-actions button {
    flex: 1 1 110px;
    padding: 8px;
    border: 1px solid var(--label-edge);
    border-radius: 10px;
    background: var(--label-surface);
    color: var(--text2, #5d6f7d);
    font-size: 12px;
  }
  #wfProductLabels .wf-label-results-count {
    margin: 7px 2px 9px;
    color: var(--text2, #5d6f7d);
    font-size: 12px;
    line-height: 1.5;
  }
  #wfProductLabels .wf-label-product-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 7px;
    max-block-size: clamp(260px, 52dvh, 620px);
    overflow: auto;
    padding: 3px;
    scrollbar-width: thin;
    overscroll-behavior: auto;
    scrollbar-gutter: stable;
  }
  #wfProductLabels .wf-label-product-list > p {
    margin: 0;
    padding: 18px 10px;
    color: var(--text2, #5d6f7d);
    font-size: 13px;
    line-height: 1.65;
    text-align: center;
    min-block-size: 120px;
  }
  #wfProductLabels .wf-label-choice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 5px;
    min-inline-size: 0;
    padding: 5px;
    border: 1px solid var(--label-edge);
    border-radius: 11px;
    background: var(--label-surface);
    color: var(--text, #213547);
  }
  #wfProductLabels .wf-label-choice:has(input:checked) { background: var(--label-muted); }
  #wfProductLabels .wf-label-choice[data-current="true"] {
    border-color: var(--label-accent);
    box-shadow: inset 0 0 0 1px var(--label-accent);
  }
  #wfProductLabels .wf-label-choice:focus-within { outline: 2px solid var(--label-accent); outline-offset: 1px; }
  #wfProductLabels .wf-label-choice-select {
    display: grid;
    grid-template-columns: 20px 40px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-inline-size: 0;
    min-block-size: 54px;
    padding: 4px;
    cursor: pointer;
    touch-action: manipulation;
  }
  #wfProductLabels .wf-label-choice-select input[type="checkbox"] {
    inline-size: 19px;
    block-size: 19px;
    min-block-size: 0;
    margin: 0;
    accent-color: var(--label-accent);
    cursor: pointer;
  }
  #wfProductLabels .wf-label-choice-select > :is(img, svg) {
    inline-size: 40px;
    block-size: 40px;
    border-radius: 8px;
    background: var(--label-surface);
    object-fit: contain;
  }
  #wfProductLabels .wf-label-choice-select > svg { padding: 9px; color: var(--text2, #5d6f7d); }
  #wfProductLabels .wf-label-choice-info { display: grid; gap: 3px; min-inline-size: 0; }
  #wfProductLabels .wf-label-choice-info :is(strong, small) { min-inline-size: 0; overflow-wrap: anywhere; }
  #wfProductLabels .wf-label-choice-info strong { font-size: 14px; font-weight: 700; line-height: 1.45; }
  #wfProductLabels .wf-label-choice-info small { color: var(--text2, #5d6f7d); font-size: 12px; line-height: 1.5; }
  #wfProductLabels .wf-label-choice-preview {
    inline-size: 44px;
    block-size: 44px;
    padding: 10px;
    border: 1px solid var(--label-edge);
    border-radius: 10px;
    background: var(--label-surface);
    color: var(--label-accent);
  }
  #wfProductLabels .wf-label-product-note {
    grid-column: 1 / -1;
    color: var(--text2, #5d6f7d);
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  #wfProductLabels .wf-label-choice > .wf-label-product-note {
    margin: 0 4px 3px;
    padding-inline-start: 7px;
    border-inline-start: 2px solid var(--label-accent);
  }

  #wfProductLabels .wf-label-preview-panel {
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--label-edge);
    border-radius: 18px;
    background: var(--label-surface);
  }
  #wfProductLabels .wf-label-preview-nav {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 2px 10px;
    min-inline-size: 0;
    padding: 0 0 12px;
    border-block-end: 1px solid var(--label-edge);
  }
  #wfProductLabels .wf-label-prev { grid-column: 1; grid-row: 1 / 3; }
  #wfProductLabels .wf-label-next { grid-column: 3; grid-row: 1 / 3; }
  #wfProductLabels .wf-label-current {
    grid-column: 2;
    grid-row: 1;
    min-inline-size: 0;
    color: var(--text, #213547);
    font-size: 18px;
    font-weight: 750;
    line-height: 1.45;
    text-align: center;
  }
  #wfProductLabels .wf-label-page-count {
    grid-column: 2;
    grid-row: 2;
    color: var(--text2, #5d6f7d);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }
  #wfProductLabels .wf-label-queue {
    display: flex;
    align-items: center;
    gap: 6px;
    min-inline-size: 0;
    max-inline-size: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 2px 6px;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
    touch-action: pan-x pan-y pinch-zoom;
  }
  #wfProductLabels .wf-label-queue-item {
    display: block;
    flex: 0 0 auto;
    max-inline-size: 210px;
    padding: 9px 12px;
    border: 1px solid var(--label-edge);
    border-radius: 10px;
    background: var(--label-surface);
    color: var(--text2, #5d6f7d);
    font-size: 12px;
    text-align: start;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  #wfProductLabels .wf-label-queue-item[aria-current="true"] {
    border-color: var(--label-accent);
    background: var(--label-muted);
    color: var(--text, #213547);
    font-weight: 700;
  }
  #wfProductLabels .wf-label-queue-number { margin-inline-end: 8px; font-variant-numeric: tabular-nums; opacity: .75; }
  #wfProductLabels .wf-label-queue-step {
    flex: 0 0 auto;
    max-inline-size: 150px;
    padding: 8px 10px;
    border: 1px solid var(--label-edge);
    border-radius: 10px;
    background: var(--label-muted);
    color: var(--label-accent);
    font-size: 12px;
    font-weight: 650;
  }
  #wfProductLabels .wf-label-view-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    inline-size: min(100%, 360px);
    justify-self: center;
  }
  #wfProductLabels .wf-label-view { font-size: 13px; }
  #wfProductLabels :is(.wf-label-status, .wf-label-error) {
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--label-edge);
    border-radius: 11px;
    background: var(--label-muted);
    color: var(--text2, #5d6f7d);
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
  #wfProductLabels .wf-label-error {
    border-inline-start: 3px solid var(--red, #c34949);
    color: var(--text, #213547);
  }
  #wfProductLabels .wf-label-status[data-state="ready"] { border-inline-start: 3px solid var(--label-accent); color: var(--text, #213547); }
  #wfProductLabels .wf-label-preview {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-inline-size: 0;
    inline-size: 100%;
    padding: 16px;
    border: 1px solid var(--label-edge);
    border-radius: 16px;
    background: var(--label-muted);
    overflow: visible;
    overscroll-behavior-inline: contain;
    touch-action: pan-y pinch-zoom;
  }
  #wfProductLabels .wf-label-preview-stage {
    position: relative;
    flex: none;
    inline-size: 1122.52px;
    block-size: 793.7px;
    background: #fff;
    direction: ltr;
    overflow: hidden;
    box-shadow: 0 3px 18px rgb(15 23 42 / 13%);
  }
  #wfProductLabels .wf-label-preview-stage > .wf-label-paper {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
  }
  #wfProductLabels .wf-label-empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    min-block-size: 310px;
    padding: 30px 20px;
    border: 1px dashed var(--label-edge);
    border-radius: 16px;
    background: var(--label-surface);
    text-align: center;
  }
  #wfProductLabels .wf-label-empty > svg {
    inline-size: 60px;
    block-size: 60px;
    padding: 14px;
    border: 1px solid var(--label-edge);
    border-radius: 16px;
    background: var(--label-muted);
    color: var(--label-accent);
  }
  #wfProductLabels .wf-label-empty :is(h3, p) { max-inline-size: 34ch; margin: 0; }
  #wfProductLabels .wf-label-empty h3 { font-size: 18px; line-height: 1.5; }
  #wfProductLabels .wf-label-empty p { color: var(--text2, #5d6f7d); font-size: 14px; line-height: 1.7; }
  #wfProductLabels .wf-label-empty button { padding: 10px 16px; border-radius: 11px; }
  #wfProductLabels .wf-label-source {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 0 0;
    border-block-start: 1px solid var(--label-edge);
  }
  #wfProductLabels .wf-label-source-note {
    flex: 1 1 220px;
    min-inline-size: 0;
    margin: 0;
    color: var(--text2, #5d6f7d);
    font-size: 12px;
    line-height: 1.6;
  }
  #wfProductLabels .wf-label-source button {
    flex: 0 1 auto;
    padding: 9px 12px;
    border: 1px solid var(--label-edge);
    border-radius: 10px;
    background: var(--label-surface);
    color: var(--text2, #5d6f7d);
    font-size: 12px;
  }
  #wfProductLabels .wf-label-guide {
    min-inline-size: 0;
    padding: 0 12px;
    border: 1px solid var(--label-edge);
    border-radius: 12px;
    background: var(--label-surface);
    color: var(--text2, #5d6f7d);
    font-size: 12px;
    line-height: 1.7;
  }
  #wfProductLabels .wf-label-guide > summary { min-block-size: 44px; padding-block: 10px; font-weight: 650; cursor: pointer; }
  #wfProductLabels .wf-label-guide > summary::marker { color: var(--label-accent); }
  #wfProductLabels .wf-label-guide > p { margin: 0 0 12px; }
  #wfProductLabels .wf-label-preview-panel > .wf-label-source-note { text-align: center; }

  /* Keep the existing product-card action row and make its new action touchable. */
  html body #mainContent #page-products .pr-card-new-actions > .wf-label-card-action {
    display: inline-flex;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    justify-content: center;
    gap: 8px;
    inline-size: 100%;
    min-height: 44px !important;
    min-block-size: 44px !important;
    padding: 8px 10px !important;
    border: 1px solid var(--window-edge, var(--border, #d7e0e5)) !important;
    background: var(--window-muted, var(--input, #f0f5f7)) !important;
    color: var(--text2, #5d6f7d) !important;
    font-size: 13px !important;
    line-height: 1.4;
  }
  html body #mainContent #page-products .wf-label-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-block-size: 44px;
    white-space: normal;
    line-height: 1.4;
  }
  #page-products :is(.wf-label-open, .wf-label-card-action) svg {
    inline-size: 19px;
    block-size: 19px;
    flex: none;
  }

  @container wf-product-labels (max-width: 760px) {
    #wfProductLabels .wf-label-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
    #wfProductLabels .wf-label-mobile-tabs {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 5px;
      padding: 5px;
      border: 1px solid var(--label-edge);
      border-radius: 13px;
      background: var(--label-muted);
    }
    #wfProductLabels .wf-label-tab { gap: 7px; font-size: 14px; }
    #wfProductLabels:not([data-pane="catalog"]) .wf-label-catalog-panel,
    #wfProductLabels[data-pane="catalog"] .wf-label-preview-panel { display: none; }
    #wfProductLabels .wf-label-toolbar { gap: 10px; padding: 12px; }
    #wfProductLabels > .wf-label-language { grid-template-columns: minmax(0, 1fr); gap: 7px; }
    #wfProductLabels > .wf-label-language .wf-label-language-choices { grid-row: auto; }
    #wfProductLabels .wf-label-language-choices { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    #wfProductLabels .wf-label-product-list { max-block-size: none; overflow: visible; scrollbar-gutter: auto; }
    #wfProductLabels .wf-label-choice-select { grid-template-columns: 20px 44px minmax(0, 1fr); gap: 9px; }
    #wfProductLabels .wf-label-choice-select > :is(img, svg) { inline-size: 44px; block-size: 44px; }
    #wfProductLabels .wf-label-choice-info strong { font-size: 14px; }
    #wfProductLabels .wf-label-choice-info small { font-size: 12px; }
    #wfProductLabels .wf-label-preview-panel { padding: 12px; border-radius: 15px; }
    #wfProductLabels .wf-label-preview { padding: 10px; border-radius: 13px; }
    #wfProductLabels .wf-label-preview > .wf-label-empty { min-block-size: 260px; }
  }
  @container wf-product-labels (min-width: 620px) and (max-width: 760px) {
    #wfProductLabels .wf-label-product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wfProductLabels .wf-label-product-list > p { grid-column: 1 / -1; }
    #wfProductLabels .wf-label-choice-select { grid-template-columns: 20px 40px minmax(0, 1fr); gap: 7px; }
    #wfProductLabels .wf-label-choice-select > :is(img, svg) { inline-size: 40px; block-size: 40px; }
    #wfProductLabels .wf-label-choice-info strong { font-size: 13px; }
  }
  @container wf-product-labels (max-width: 460px) {
    #wfProductLabels .wf-label-toolbar { grid-template-columns: 44px minmax(0, 1fr) minmax(80px, 108px); gap: 8px; }
    #wfProductLabels .wf-label-toolbar.wf-notifications-slot { grid-template-columns: var(--wf-workspace-control, 44px) minmax(0, 1fr) repeat(2, var(--wf-workspace-control, 44px)); gap: 6px; }
    #wfProductLabels .wf-label-toolbar.wf-notifications-slot > .wf-label-print { inline-size: var(--wf-workspace-control, 44px); min-inline-size: var(--wf-workspace-control, 44px); padding: 0; gap: 0; }
    #wfProductLabels .wf-label-toolbar.wf-notifications-slot > .wf-label-print > span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    #wfProductLabels .wf-label-heading h2 { font-size: 18px; }
    #wfProductLabels .wf-label-heading p { display: none; }
    #wfProductLabels .wf-label-print { inline-size: 100%; max-inline-size: none; gap: 5px; padding: 9px 7px; }
    #wfProductLabels :is(.wf-label-language, .wf-label-selection) { padding: 10px; border-radius: 13px; }
    #wfProductLabels .wf-label-language-choices,
    #wfProductLabels > .wf-label-language .wf-label-language-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #wfProductLabels .wf-label-preview-panel { padding: 10px; }
    #wfProductLabels .wf-label-preview-nav { padding: 0 0 10px; gap: 2px 7px; }
    #wfProductLabels .wf-label-current { font-size: 16px; }
    #wfProductLabels .wf-label-preview { padding: 7px; }
    #wfProductLabels .wf-label-view-controls { inline-size: 100%; }
    #wfProductLabels .wf-label-source button { flex-grow: 1; }
  }
  @container wf-product-labels (max-width: 330px) {
    #wfProductLabels .wf-label-choice { gap: 3px; padding: 4px; }
    #wfProductLabels .wf-label-choice-select { grid-template-columns: 18px 36px minmax(0, 1fr); gap: 6px; padding: 3px; }
    #wfProductLabels .wf-label-choice-select > :is(img, svg) { inline-size: 36px; block-size: 36px; }
    #wfProductLabels .wf-label-choice-info strong { font-size: 13px; }
    #wfProductLabels .wf-label-choice-info small { font-size: 11px; }
    #wfProductLabels .wf-label-filter { font-size: 12px; }
    #wfProductLabels .wf-label-tab { font-size: 13px; }
  }
  @media (max-height: 420px) {
    #wfProductLabels .wf-label-toolbar { position: static; }
    #wfProductLabels .wf-label-product-list { max-block-size: none; overflow: visible; scrollbar-gutter: auto; }
  }
  html.wf-touch-keyboard-open #wfProductLabels .wf-label-toolbar { position: static; }
  @media (hover: hover) {
    #wfProductLabels :is(.wf-label-choice-preview, .wf-label-queue-item, .wf-label-queue-step, .wf-label-back, .wf-label-prev, .wf-label-next):not(:disabled):hover {
      border-color: var(--label-accent);
      background: var(--label-muted);
    }
    #wfProductLabels .wf-label-choice:hover { border-color: var(--label-accent); }
  }
  @media (prefers-reduced-motion: no-preference) {
    #wfProductLabels :is(.wf-label-choice, .wf-label-queue-item, .wf-label-filter, .wf-label-view, .wf-label-tab) {
      transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
    }
  }
}

/* Card geometry is shared by the scaled preview and the isolated print frame. */
.wf-label-paper,
.wf-label-paper *,
.wf-label-paper::before,
.wf-label-paper::after,
.wf-label-paper *::before,
.wf-label-paper *::after {
  box-sizing: border-box;
}

.wf-label-paper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: none;
  width: 297mm;
  height: 210mm;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: #0f172a;
  color-scheme: light;
  direction: ltr;
  font-family: 'Segoe UI', 'Cairo', 'Tajawal', Arial, sans-serif;
  line-height: 1.3;
  isolation: isolate;
}

.wf-label-paper .wf-label-sheet-guide {
  position: absolute;
  top: 8mm;
  left: 16mm;
  right: 16mm;
  margin: 0;
  padding: 0;
  color: #475569;
  font-size: 3mm;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.wf-label-paper .wf-label-pair {
  position: relative;
  display: grid;
  grid-template-columns: 100mm 100mm;
  gap: 0;
  flex: none;
  width: 200mm;
  height: 150mm;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  direction: ltr;
  overflow: visible;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Overlay the cut boundary so its stroke cannot change the face dimensions. */
.wf-label-paper .wf-label-pair::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 0.35mm solid #17212f;
  pointer-events: none;
}

.wf-label-paper .wf-label-pair::after {
  content: '';
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 100mm;
  border-left: 0.3mm dashed #64748b;
  transform: translateX(-50%);
  pointer-events: none;
}

.wf-label-paper .wf-label-face {
  --wf-label-photo-height: 45mm;
  --wf-label-face-gap: 1.5mm;
  display: flex;
  flex-direction: column;
  gap: var(--wf-label-face-gap);
  width: 100mm;
  height: 150mm;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 2.8mm;
  border: 0;
  background: #fff;
  color: #0f172a;
  direction: ltr;
  text-align: left;
  overflow: visible;
  transform: none;
}

.wf-label-paper .wf-label-face > * {
  flex-shrink: 0;
  min-width: 0;
}

.wf-label-paper .wf-label-card-header {
  display: grid;
  grid-template-columns: 17mm minmax(0, 1fr);
  align-items: center;
  gap: 2mm;
  min-height: 20mm;
  margin: 0;
  padding: 1.5mm 2mm;
  border: 0;
  border-radius: 2.5mm;
  background: linear-gradient(125deg, #1e293b, #334155);
  color: #fff;
  direction: ltr;
}

.wf-label-paper .wf-label-card-header > div {
  min-width: 0;
  text-align: center;
}

.wf-label-paper .wf-label-logo {
  display: block;
  width: 17mm;
  height: 17mm;
  margin: 0;
  padding: 0.5mm;
  border: 0.25mm solid #dbe4ef;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.wf-label-paper .wf-label-product-caption {
  display: block;
  margin: 0;
  color: #d3deeb;
  font-size: 2.15mm;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.16mm;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.wf-label-paper .wf-label-product-name {
  display: block;
  margin: 0.65mm 0 0;
  color: #fff;
  font-size: 5.2mm;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.wf-label-paper .wf-label-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--wf-label-photo-height);
  width: 100%;
  height: var(--wf-label-photo-height);
  min-height: 0;
  margin: 0;
  padding: 1mm;
  border: 0.2mm solid #e2e8f0;
  border-radius: 2.5mm;
  background: #fff;
}

.wf-label-paper .wf-label-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: contain;
  object-position: center;
}

.wf-label-paper .wf-label-no-photo {
  padding: 2mm;
  color: #64748b;
  font-size: 3mm;
  line-height: 1.5;
  text-align: center;
}

.wf-label-paper .wf-label-divider {
  height: 0.8mm;
  min-height: 0.8mm;
  border: 0;
  border-radius: 1mm;
  background: linear-gradient(90deg, #6366f1, #3b82f6, #06b6d4, #10b981, #f59e0b, #ef4444);
}

.wf-label-paper .wf-label-sizes {
  width: 100%;
  margin: 0;
  border: 0.2mm solid #cbd5e1;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: #0f172a;
  direction: ltr;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.wf-label-paper .wf-label-sizes :is(th, td) {
  width: 33.333333%;
  padding: 0.65mm 0.8mm;
  border: 0.2mm solid #cbd5e1;
  color: #0f172a;
  font-size: 3.5mm;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

.wf-label-paper .wf-label-sizes th {
  padding-block: 1mm;
  background: #25364a;
  color: #fff;
  font-size: 3mm;
  line-height: 1.2;
}

.wf-label-paper .wf-label-sizes tbody tr:nth-child(odd) td {
  background: #f1f5f9;
}

.wf-label-paper .wf-label-facts {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 1.5mm;
  margin: 0;
  direction: ltr;
}

.wf-label-paper .wf-label-facts > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6mm;
  min-width: 0;
  padding: 1.3mm 1.8mm;
  border: 0.2mm solid #cbd5e1;
  border-radius: 2mm;
  background: #fff;
  text-align: center;
}

.wf-label-paper .wf-label-facts span {
  max-width: 100%;
  color: #475569;
  font-size: 2.3mm;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.wf-label-paper .wf-label-facts bdi {
  max-width: 100%;
  color: #0f172a;
  font-size: 3.4mm;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.wf-label-paper .wf-label-barcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6mm;
  min-height: 18mm;
  margin-top: auto;
  padding: 1mm 3mm;
  border: 0.2mm solid #cbd5e1;
  border-radius: 2mm;
  background: #fff;
  color: #0f172a;
  direction: ltr;
  text-align: center;
}

.wf-label-paper .wf-label-barcode > svg {
  display: block;
  flex: none;
  width: 100%;
  max-width: 100%;
  height: 13mm;
  margin: 0;
  background: #fff;
  shape-rendering: crispEdges;
}

.wf-label-paper .wf-label-barcode .wf-label-qr {
  display: grid;
  place-items: center;
  flex: none;
  width: 18mm;
  height: 18mm;
  margin: 0;
  padding: 0;
  background: #fff;
}

.wf-label-paper .wf-label-qr > svg {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
}

.wf-label-paper .wf-label-barcode-value {
  display: block;
  max-width: 100%;
  color: #0f172a;
  font-size: 2.3mm;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.08mm;
  overflow-wrap: anywhere;
}

.wf-label-paper .wf-label-website {
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: #0f172a;
  direction: ltr;
  font-size: 2.6mm;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: 0.22mm;
  text-align: center;
  overflow-wrap: anywhere;
}

/* Keep every dimension row; gain space from the photo before reducing type. */
.wf-label-paper .wf-label-face:is([data-rows="4"], [data-rows="5"], [data-rows="6"]) {
  --wf-label-photo-height: 35mm;
  --wf-label-face-gap: 1.25mm;
}

.wf-label-paper .wf-label-face:is([data-rows="7"], [data-rows="8"], [data-rows="9"], [data-rows="10"], [data-rows="11"], [data-rows="12"]) {
  --wf-label-photo-height: 25mm;
  --wf-label-face-gap: 1.1mm;
}

.wf-label-paper .wf-label-face:is([data-rows="7"], [data-rows="8"], [data-rows="9"], [data-rows="10"], [data-rows="11"], [data-rows="12"]) .wf-label-sizes :is(th, td) {
  padding: 0.25mm 0.7mm;
  font-size: 3mm;
  line-height: 1.1;
}

.wf-label-paper .wf-label-face:is([data-rows="7"], [data-rows="8"], [data-rows="9"], [data-rows="10"], [data-rows="11"], [data-rows="12"]) .wf-label-sizes th {
  padding-block: 0.7mm;
}

/* Named pages prevent this stylesheet from changing invoice or app printing. */
@page wf-product-label {
  size: A4 landscape;
  margin: 6mm;
}

@media print {
  body.wf-label-print-document {
    display: block;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    color: #0f172a;
    overflow: visible;
  }

  body.wf-label-print-document > .wf-label-paper {
    page: wf-product-label;
    position: relative;
    width: 285mm;
    height: 198mm;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none !important;
    overflow: visible;
    break-inside: avoid;
    break-after: page;
    page-break-inside: avoid;
    page-break-after: always;
  }

  body.wf-label-print-document > .wf-label-paper:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.wf-label-print-document .wf-label-paper,
  body.wf-label-print-document .wf-label-paper * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.wf-label-print-document .wf-label-sheet-guide {
    top: 2mm;
    left: 10mm;
    right: 10mm;
  }
}
