/*
 * Storefront UX — account pages and quick order.
 * Owner: Account stream (D). Shared stylesheet: loaded on every route after
 * storefront-ux.css (tokens and components), marked data-style-shared so it
 * survives SPA navigation. Use the --ft-* tokens and .ft-* components from
 * storefront-ux.css; scope every rule to this area's classes and to
 * body:not(:has(.admin-shell)).
 *
 * P2 #17 (round 5): one account frame for the 10 account pages and quick
 * order — same page top, sidebar, header, cards, dividers and overlines.
 */

/* 1. Page and frame ------------------------------------------------------ */
body:not(:has(.admin-shell)):has(.b2b-account-wrapper) { background: var(--ft-bg); }

body:not(:has(.admin-shell)) .b2b-account-wrapper {
    margin-top: var(--ft-page-top);
    color: var(--ft-text);
}

/* Sticky at exactly its resting place (header + page top), so the sidebar never
   jumps when a long page scrolls. --ft-header-h falls back to the 124px header. */
body:not(:has(.admin-shell)) .b2b-account-sidebar {
    top: calc(var(--ft-header-h, 124px) + var(--ft-page-top));
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-lg);
    background: var(--ft-surface);
    box-shadow: none;
}

/* 2. Overlines: 12px, muted, one style (sidebar title, nav groups, labels) - */
body:not(:has(.admin-shell)) .b2b-account-sidebar .b2b-account-title,
body:not(:has(.admin-shell)) .b2b-account-wrapper .b2b-account-nav-group,
body:not(:has(.admin-shell)) .b2b-account-wrapper .b2b-order-state-item dt,
body:not(:has(.admin-shell)) .b2b-account-wrapper .wsp-total-item dt,
body:not(:has(.admin-shell)) .b2b-account-wrapper .wsp-quick-grid-head,
body:not(:has(.admin-shell)) .b2b-account-wrapper .b2b-dashboard-stat-label {
    font: var(--ft-overline);
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ft-text-muted);
}
body:not(:has(.admin-shell)) .b2b-account-wrapper .b2b-account-nav-group {
    border-top-color: var(--ft-divider);
}

/* 3. Sidebar navigation: active item in the one blue, no gradient --------- */
body:not(:has(.admin-shell)) .b2b-account-nav-link { color: var(--ft-text); }
body:not(:has(.admin-shell)) .b2b-account-nav-link svg { color: var(--ft-text-muted); }
body:not(:has(.admin-shell)) .b2b-account-nav-link:is(.active, [aria-current="page"]) {
    border-color: transparent;
    background: var(--ft-primary-soft);
    box-shadow: inset 3px 0 0 var(--ft-primary);
    color: var(--ft-primary-text);
    font-weight: var(--ft-fw-semibold);
}
body:not(:has(.admin-shell)) .b2b-account-nav-link:is(.active, [aria-current="page"]) svg { color: var(--ft-primary); }
@media (hover: hover) and (pointer: fine) {
    body:not(:has(.admin-shell)) .b2b-account-nav-link:hover:not(.active) {
        border-color: transparent;
        background: var(--ft-surface-2);
        color: var(--ft-text);
    }
}

/* 4. One page header on every account page and quick order --------------- */
body:not(:has(.admin-shell)) .b2b-account-main .b2b-account-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;   /* H1 sits at the same height with or without header buttons */
    justify-content: space-between;
    gap: var(--ft-s3) var(--ft-s4);
    margin: 0 0 var(--ft-s5);
    padding: 0 0 var(--ft-s4);
    border-bottom: 1px solid var(--ft-divider);
}
body:not(:has(.admin-shell)) .b2b-account-main .b2b-account-header-text { min-width: 0; }
body:not(:has(.admin-shell)) .b2b-account-main .b2b-account-header h1 {
    margin: 0;
    padding: 0;
    color: var(--ft-text);
    font-size: var(--ft-fs-xl);
    font-weight: var(--ft-fw-semibold);
    line-height: var(--ft-lh-tight);
    letter-spacing: -0.01em;
    text-transform: none;
    overflow-wrap: anywhere;
}
body:not(:has(.admin-shell)) .b2b-account-main .b2b-account-header-text p {
    margin: var(--ft-s1) 0 0;
    color: var(--ft-text-muted);
    font-size: var(--ft-fs-sm);
    line-height: var(--ft-lh-body);
}
body:not(:has(.admin-shell)) .b2b-account-main .b2b-account-header-actions { margin: 0; }
body:not(:has(.admin-shell)) .b2b-account-main .b2b-account-breadcrumb,
body:not(:has(.admin-shell)) .b2b-account-main > .b2b-back-link { display: inline-flex; margin: 0 0 var(--ft-s3); }

/* 5. Cards and dividers: one level, grey lines, no shadows ---------------- */
body:not(:has(.admin-shell)) .b2b-account-main :is(.b2b-card, .wsp-panel) {
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-lg);
    background: var(--ft-surface);
    box-shadow: none;
}
body:not(:has(.admin-shell)) .b2b-account-main :is(.b2b-address-card, .b2b-order-card, .b2b-return-card, .wsp-list-card) {
    border-color: var(--ft-border);
    border-radius: var(--ft-radius-md);
    box-shadow: none;
}
body:not(:has(.admin-shell)) .b2b-account-main :is(.b2b-card-header, .b2b-card-footer, .wsp-panel-head, .wsp-panel-body,
    .b2b-address-actions, .b2b-order-totals, .wsp-summary, .wsp-totals) { border-color: var(--ft-divider); }
body:not(:has(.admin-shell)) .b2b-account-main :is(.b2b-table, .wsp-table) :is(th, td) { border-color: var(--ft-divider); }
body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-card .b2b-order-states { border-top-color: var(--ft-divider); }
body:not(:has(.admin-shell)) .b2b-account-main .wsp-table th { background: var(--ft-surface-2); color: var(--ft-text-muted); }
body:not(:has(.admin-shell)) .b2b-account-main .wsp-nowrap { white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
    body:not(:has(.admin-shell)) .b2b-account-main :is(.b2b-address-card, .b2b-order-card, .b2b-return-card, .wsp-list-card):hover {
        border-color: var(--ft-border-strong);
        box-shadow: none;
    }
}

/* 5b. Status badges and chips: the .ft-badge spec (12px/600, radius 6px,
   token colour pairs, >= 4.5:1). Order status: completed = success,
   cancelled = neutral, processing = info, awaiting payment = warning. */
body:not(:has(.admin-shell)) .b2b-account-wrapper :is(.wb-badge, .wsp-chip) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 0;
    border-radius: var(--ft-radius-sm);
    font-size: var(--ft-fs-xs);
    font-weight: var(--ft-fw-semibold);
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    background: var(--ft-neutral-bg);
    color: var(--ft-neutral-fg);
}
body:not(:has(.admin-shell)) .b2b-account-wrapper :is(.wb-badge-success, .wsp-chip-ok) { background: var(--ft-success-bg); color: var(--ft-success-fg); }
body:not(:has(.admin-shell)) .b2b-account-wrapper :is(.wb-badge-danger, .wsp-chip-error) { background: var(--ft-danger-bg); color: var(--ft-danger-fg); }
body:not(:has(.admin-shell)) .b2b-account-wrapper :is(.wb-badge-warning, .wsp-chip-warn) { background: var(--ft-warning-bg); color: var(--ft-warning-fg); }
body:not(:has(.admin-shell)) .b2b-account-wrapper :is(.wb-badge-info, .wsp-chip-info) { background: var(--ft-info-bg); color: var(--ft-info-fg); }

/* 6. Dashboard ----------------------------------------------------------- */
body:not(:has(.admin-shell)) .b2b-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ft-s3);
    margin: 0 0 var(--ft-s5);
}
body:not(:has(.admin-shell)) .b2b-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    gap: var(--ft-s4);
    align-items: start;
}
body:not(:has(.admin-shell)) .b2b-dashboard-orders { list-style: none; margin: 0; padding: 0; }
body:not(:has(.admin-shell)) .b2b-dashboard-order {
    display: grid;
    grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--ft-s3);
    padding: var(--ft-s3) var(--ft-s5);
    border-top: 1px solid var(--ft-divider);
    font-size: var(--ft-fs-sm);
}
body:not(:has(.admin-shell)) .b2b-dashboard-order:first-child { border-top: 0; }
body:not(:has(.admin-shell)) .b2b-dashboard-order time { color: var(--ft-text-muted); white-space: nowrap; }
body:not(:has(.admin-shell)) .b2b-dashboard-order strong { white-space: nowrap; text-align: right; }
body:not(:has(.admin-shell)) .b2b-dashboard-stat .b2b-card-body { padding: var(--ft-s5); }
body:not(:has(.admin-shell)) .b2b-dashboard-stat p { margin: 0; }
body:not(:has(.admin-shell)) .b2b-dashboard-stat-value {
    margin-top: var(--ft-s1) !important;
    color: var(--ft-text);
    font-size: var(--ft-fs-xl);
    font-weight: var(--ft-fw-semibold);
    line-height: var(--ft-lh-tight);
}

/* 7. Order detail: payment state and method in one row -------------------- */
body:not(:has(.admin-shell)) .b2b-payment-detail { display: grid; justify-items: start; gap: var(--ft-s1); }
body:not(:has(.admin-shell)) .b2b-payment-detail .b2b-payment-method { color: var(--ft-text-muted); font-size: 13px; }

/* 8. Order lists: visible name label above the create row ----------------- */
body:not(:has(.admin-shell)) .wsp-list-create { display: grid; gap: 6px; max-width: 520px; }
body:not(:has(.admin-shell)) .wsp-list-create-row { display: flex; flex-wrap: wrap; gap: var(--ft-s3); }
body:not(:has(.admin-shell)) .wsp-list-create-row .wsp-input { flex: 1 1 220px; min-height: var(--ft-control-h); box-sizing: border-box; }

/* 9. Quick order inside the account layout -------------------------------- */
body:not(:has(.admin-shell)) .b2b-account-main .wsp-dispatch-slot:not(:empty) { margin-top: var(--ft-s3); }
body:not(:has(.admin-shell)) .wsp-input-mono:placeholder-shown { text-transform: none; }
body:not(:has(.admin-shell)) .wsp-input-mono::placeholder { font-family: var(--ft-font); text-transform: none; }
body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-grid :is(input) { min-height: var(--ft-control-h); box-sizing: border-box; }
/* Results scroll into view below the sticky header, not under it. */
body:not(:has(.admin-shell)) #qo-results-title { scroll-margin-top: calc(var(--ft-header-h, 124px) + var(--ft-s4)); }
@media (max-width: 800px) {
    body:not(:has(.admin-shell)) #qo-results-title { scroll-margin-top: calc(var(--ft-header-h-mobile) + var(--ft-s4)); }
}
body:not(:has(.admin-shell)) #qo-results-title:focus { outline: none; }
body:not(:has(.admin-shell)) #qo-results-title:focus-visible { outline: 3px solid var(--ft-focus-color); outline-offset: 3px; }

/* 10. Phones and tablets ------------------------------------------------- */
@media (max-width: 768px) {
    body:not(:has(.admin-shell)) .b2b-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    /* One 16px phone gutter: the page container gets --ft-gutter globally
       (storefront-ux.css section 23); the wrapper adds no second inset. */
    body:not(:has(.admin-shell)) .b2b-account-wrapper { padding-inline: 0; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-account-header { align-items: stretch; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-account-header-actions { width: 100%; }
    body:not(:has(.admin-shell)) .b2b-dashboard-actions > .b2b-btn { flex: 1 1 100%; }
    body:not(:has(.admin-shell)) .b2b-dashboard-order {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: var(--ft-s3) var(--ft-s4);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-grid { grid-template-columns: minmax(0, 1fr) 64px 32px; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-row-remove { width: 32px; height: 44px; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-panel-body { padding: var(--ft-s4); }
}

/* 11. Integration: the Documenten filters use the shared select (.ft-select).
       b2b-workspace.css '.wsp-field select' resets the background shorthand and
       is more specific, so restate the chevron and size here. */
body:not(:has(.admin-shell)) .b2b-account-wrapper .wsp-field select.ft-select {
    min-height: var(--ft-control-h);
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--ft-border-strong);
    border-radius: var(--ft-radius-md);
    font-size: var(--ft-fs-base);
    background-color: var(--ft-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6779' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}

/* ==========================================================================
   Review round 1 (integration, 14 Nov 2026)
   ========================================================================== */
/* One page gutter: the account wrapper added 16-24px on top of the global
   gutter (x=40 at 768 and x=48 at 1280, while header, catalogue and cart sit at 24). */
@media (min-width: 768px) {
    body:not(:has(.admin-shell)) .b2b-account-wrapper.container { padding-left: 0; padding-right: 0; }
}

/* Non-interactive values in normal text colour (payment looked like a link). */
body:not(:has(.admin-shell)) .b2b-payment-schedule strong { color: var(--ft-text); }

/* Order history: the latest event (the current state) is highlighted, not the oldest. */
body:not(:has(.admin-shell)) .b2b-timeline-item .b2b-timeline-point { background: #94a3b8; }
body:not(:has(.admin-shell)) .b2b-timeline-item.is-current .b2b-timeline-point { background: var(--ft-primary); box-shadow: 0 0 0 4px var(--ft-primary-soft); }
body:not(:has(.admin-shell)) .b2b-timeline-item.is-current .b2b-timeline-desc strong { color: var(--ft-text); }

/* Quick order: the next dispatch date is information, not a button-like chip. */
body:not(:has(.admin-shell)) .b2b-account-wrapper .wsp-dispatch-next {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ft-text-muted);
    font-weight: var(--ft-fw-regular);
}
/* Quick order: 'Wissen' sits with the row actions and stays hidden while there is nothing to clear. */
body:not(:has(.admin-shell)) #qo-clear[hidden] { display: none !important; }

/* ==========================================================================
   Review round 2 (integration, 14 Nov 2026)
   ========================================================================== */
/* One filter-control token on account pages (orders, documents), the same as
   the catalogue: 44px high, 10px radius, 14px text (16px on phones, no iOS zoom). */
body:not(:has(.admin-shell)) .b2b-account-wrapper :is(.b2b-order-filters :is(input, select, button), select.ft-select) {
    height: var(--ft-control-h) !important;
    min-height: var(--ft-control-h) !important;
    border-radius: var(--ft-radius-md) !important;
    font-size: var(--ft-fs-sm) !important;
}
@media (max-width: 768px) {
    body:not(:has(.admin-shell)) .b2b-account-wrapper :is(.b2b-order-filters :is(input, select), select.ft-select) { font-size: var(--ft-fs-base) !important; }
}
body:not(:has(.admin-shell)) .b2b-order-filters [data-order-filter-clear][hidden] { display: none !important; }

/* Order cards: 'Details' (order, invoice, returns) is the main 44px action;
   'Opnieuw bestellen' is a quieter text action under it. Labels in sentence
   case like the filter labels above them; the order number is a 44px target. */
body:not(:has(.admin-shell)) .b2b-account-wrapper .b2b-order-card .b2b-order-state-item dt {
    font: var(--ft-fw-semibold) 13px/1.3 var(--ft-font);
    letter-spacing: 0;
    text-transform: none;
    color: var(--ft-text-muted);
}
body:not(:has(.admin-shell)) .b2b-order-card { min-height: 0 !important; }
body:not(:has(.admin-shell)) .b2b-order-card .b2b-order-number {
    display: inline-flex;
    align-items: center;
    min-height: var(--ft-control-h);
    margin: -10px 0 -8px;
    padding-right: var(--ft-s3);
}
body:not(:has(.admin-shell)) .b2b-order-card .b2b-order-card-actions { gap: var(--ft-s1) !important; }
body:not(:has(.admin-shell)) .b2b-order-card .b2b-order-open {
    display: inline-flex !important;
    align-items: center;
    justify-content: center !important;
    gap: var(--ft-s1);
    min-height: var(--ft-control-h) !important;
    padding: 0 var(--ft-s4) !important;
    border: 1px solid var(--ft-border-strong) !important;
    border-radius: var(--ft-radius-md) !important;
    background: var(--ft-surface) !important;
    color: var(--ft-text) !important;
    font-size: 15px !important;
    font-weight: var(--ft-fw-semibold) !important;
    text-decoration: none !important;
}
body:not(:has(.admin-shell)) .b2b-order-card .b2b-order-open:hover { border-color: var(--ft-primary) !important; background: var(--ft-primary-soft) !important; }
body:not(:has(.admin-shell)) .b2b-order-card .b2b-order-reorder {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: var(--ft-s1);
    height: auto !important;
    min-height: var(--ft-control-h) !important;
    padding: 0 var(--ft-s3) !important;
    border: 0 !important;
    border-radius: var(--ft-radius-md) !important;
    background: transparent !important;
    color: var(--ft-primary-text) !important;
    font-size: var(--ft-fs-sm) !important;
    font-weight: var(--ft-fw-semibold) !important;
    box-shadow: none !important;
    cursor: pointer;
}
body:not(:has(.admin-shell)) .b2b-order-card .b2b-order-reorder:hover { background: var(--ft-primary-soft) !important; }
@media (max-width: 600px) {
    body:not(:has(.admin-shell)) .b2b-order-card .b2b-order-card-actions { flex-direction: row !important; justify-content: flex-start !important; }
    body:not(:has(.admin-shell)) .b2b-order-card .b2b-order-open { flex: 1 1 auto; }
}

/* Quick order column headings: the shared field-label style (sentence case). */
body:not(:has(.admin-shell)) .b2b-account-wrapper .wsp-quick-grid-head,
body:not(:has(.admin-shell)) .wsp-quick-grid-head {
    font: var(--ft-fw-semibold) var(--ft-fs-sm)/1.3 var(--ft-font) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: var(--ft-text) !important;
}

/* Order/return line tables: column labels in the muted token (not the old
   #64748b) and readable at 13px, sentence case. */
body:not(:has(.admin-shell)) .b2b-account-wrapper .b2b-table th {
    color: var(--ft-text-muted) !important;
    font-size: 13px !important;
    font-weight: var(--ft-fw-semibold) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* Quick order on phones: 44px tabs and row-remove buttons. */
body:not(:has(.admin-shell)) .wsp-tab { min-height: var(--ft-control-h); }
body:not(:has(.admin-shell)) .wsp-quick-row-remove { min-width: var(--ft-control-h) !important; width: var(--ft-control-h) !important; min-height: var(--ft-control-h); }

/* ==========================================================================
   UX6 (S5, 14 Nov 2026) — account and quick order
   Every rule carries .b2b-account-main or .b2b-account-wrapper so it wins on
   specificity, whatever the stylesheet order (this sheet may move to the
   account group, before search-layout.css).
   ========================================================================== */

/* DJ-04: one empty state (.ux-empty) on every account page ---------------- */
body:not(:has(.admin-shell)) .b2b-account-wrapper .ux-empty {
    display: grid;
    justify-items: center;
    gap: var(--ft-s2);
    padding: var(--ft-s6) var(--ft-s5);
    text-align: center;
    color: var(--ft-text-muted);
}
body:not(:has(.admin-shell)) .b2b-account-wrapper .ux-empty-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--ft-s1);
    border-radius: 50%;
    background: var(--ft-surface-2);
    color: var(--ft-text-muted);
}
body:not(:has(.admin-shell)) .b2b-account-wrapper .ux-empty-title {
    margin: 0;
    color: var(--ft-text);
    font-size: var(--ft-fs-base);
    font-weight: var(--ft-fw-semibold);
    line-height: var(--ft-lh-tight);
}
body:not(:has(.admin-shell)) .b2b-account-wrapper .ux-empty-text {
    max-width: 46ch;
    margin: 0;
    font-size: var(--ft-fs-sm);
    line-height: var(--ft-lh-body);
}
body:not(:has(.admin-shell)) .b2b-account-wrapper .ux-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ft-s3);
    margin-top: var(--ft-s3);
}
body:not(:has(.admin-shell)) .b2b-account-wrapper .b2b-order-no-results { margin-bottom: var(--ft-s4); border: 1px solid var(--ft-border); border-radius: var(--ft-radius-md); background: var(--ft-surface); }

/* DJ-05: orders as a table from 768px, compact cards below ---------------- */
body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list-head { display: none; }
body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list .b2b-order-reference {
    max-width: 100%;
    overflow-wrap: anywhere;
}
@media (min-width: 768px) {
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table {
        gap: 0;
        overflow: hidden;
        border: 1px solid var(--ft-border);
        border-radius: var(--ft-radius-md);
        background: var(--ft-surface);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table :is(.b2b-order-list-head, .b2b-order-card) {
        display: grid;
        grid-template-areas: none;
        align-items: center;
        gap: var(--ft-s4);
        padding: var(--ft-s3) var(--ft-s4);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-list-head {
        border-bottom: 1px solid var(--ft-divider);
        background: var(--ft-surface-2);
        color: var(--ft-text-muted);
        font-size: 13px;
        font-weight: var(--ft-fw-semibold);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-list-head-total { text-align: right; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card {
        min-height: 0 !important;
        border: 0 !important;
        border-top: 1px solid var(--ft-divider) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-list-head + .b2b-order-card,
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card[hidden] + .b2b-order-card { border-top: 0 !important; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card:hover { background: var(--ft-surface-2); }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card-id { grid-area: auto; grid-column: 1; gap: 0; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-number { min-height: 32px; margin: -6px 0 -4px; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-reference {
        overflow: hidden;
        margin-top: 2px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow-wrap: normal;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-states {
        grid-area: auto;
        grid-column: 2 / 4;
        display: grid;
        grid-template-columns: subgrid;
        gap: var(--ft-s4);
        margin: 0;
        padding: 0;
        border: 0;
    }
    /* The header row names the columns; the per-cell labels stay for screen readers. */
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-state-item dt {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card-total { grid-area: auto; grid-column: 4; justify-self: end; align-self: center; font-size: var(--ft-fs-sm); }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card-actions {
        grid-area: auto;
        grid-column: 5;
        display: flex;
        justify-content: flex-end !important;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-open {
        min-height: 36px !important;
        padding: 0 var(--ft-s3) !important;
        font-size: var(--ft-fs-sm) !important;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-reorder-label {
        white-space: nowrap;
    }
}
@media (max-width: 767.98px) {
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table { gap: var(--ft-s2); }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card {
        grid-template-columns: minmax(0, 1fr) max-content;
        grid-template-areas: "identity total" "states states" "actions actions";
        gap: var(--ft-s3);
        min-height: 0 !important;
        padding: var(--ft-s3) var(--ft-s4);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-states {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--ft-s3);
        padding-top: var(--ft-s3);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-card-actions {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-open { flex: 1 1 auto; }
    /* Filters: search and status each take the full width. */
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-filters { grid-template-columns: minmax(0, 1fr); }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-filters label:first-child { grid-column: auto; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-filters [data-order-filter-clear] { justify-self: start; }
}

/* DJ-13 / F15: address cards at 14px; long user text wraps, never overflows -- */
body:not(:has(.admin-shell)) .b2b-account-main .b2b-address-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
body:not(:has(.admin-shell)) .b2b-account-main .b2b-address-card { min-width: 0; }
body:not(:has(.admin-shell)) .b2b-account-main .b2b-address-header { gap: var(--ft-s2); min-width: 0; }
body:not(:has(.admin-shell)) .b2b-account-main .b2b-address-label {
    min-width: 0;
    margin: 0;
    color: var(--ft-text);
    font-size: var(--ft-fs-sm);
    font-weight: var(--ft-fw-semibold);
    line-height: 1.35;
}
body:not(:has(.admin-shell)) .b2b-account-main .b2b-address-body {
    font-size: var(--ft-fs-sm);
    line-height: var(--ft-lh-body);
    color: var(--ft-text);
}
body:not(:has(.admin-shell)) .b2b-account-main .b2b-address-company { color: var(--ft-text); }
body:not(:has(.admin-shell)) .b2b-account-main :is(.b2b-address-label, .b2b-address-body, .b2b-order-address, .b2b-user-text,
    .b2b-order-item-sku, .b2b-account-breadcrumb, .b2b-account-header-text h1, .b2b-timeline-note,
    .wsp-list-card h3, .wsp-cell-product-text, .wsp-code, .b2b-order-items strong) {
    overflow-wrap: anywhere;
    min-width: 0;
}

/* F14: in-page confirmation and rename dialogs ---------------------------- */
:is(.wsp-dialog-form, .b2b-confirm) { display: grid; gap: var(--ft-s4); }
:is(.wsp-dialog-form, .b2b-confirm) :is(.wsp-dialog-text, .b2b-confirm-text) { margin: 0; color: var(--ft-text); font-size: var(--ft-fs-base); line-height: var(--ft-lh-body); overflow-wrap: anywhere; }
.wsp-dialog-form .wsp-field { display: grid; gap: 6px; font-size: var(--ft-fs-sm); font-weight: var(--ft-fw-semibold); }
.wsp-dialog-form .wsp-input { width: 100%; min-height: var(--ft-control-h); box-sizing: border-box; font-size: var(--ft-fs-base); }
.wsp-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ft-s3); margin: 0; }
.wsp-dialog-actions .wsp-btn { min-height: var(--ft-control-h); }
/* Same destructive style as .b2b-btn-danger (storefront-ux.css): outlined red. */
html body .modal-overlay .wsp-btn.wsp-btn-danger { border: 1px solid color-mix(in srgb, var(--ft-danger-fg) 40%, #fff) !important; background: var(--ft-surface) !important; color: var(--ft-danger-fg) !important; }
html body .modal-overlay .wsp-btn.wsp-btn-danger:hover:not(:disabled) { background: var(--ft-danger-bg) !important; border-color: var(--ft-danger-fg) !important; }
@media (max-width: 480px) {
    .wsp-dialog-actions, .b2b-confirm .b2b-modal-actions { flex-direction: column-reverse; align-items: stretch; }
}

/* DJ-16: billing log note inside the panel padding, empty state below it -- */
body:not(:has(.admin-shell)) .b2b-account-main .wsp-billing-log-body { padding-top: 0; padding-bottom: 0; border: 0; }
body:not(:has(.admin-shell)) .b2b-account-main .wsp-billing-log-body + .ux-empty { padding-top: var(--ft-s5); }
body:not(:has(.admin-shell)) .b2b-account-main .wsp-billing-log-body + .wsp-table-wrap { margin-top: var(--ft-s4); }

/* F05: quick-order results as stacked cards on phones (ux7: up to 767px, the
   five-column table needs about 755px and scrolled sideways from 641px). */
@media (max-width: 767px) {
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results,
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results tbody { display: block; width: 100%; min-width: 0; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--ft-s2) var(--ft-s3);
        padding: var(--ft-s3) var(--ft-s4);
        border-bottom: 1px solid var(--ft-divider);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results tr:last-child { border-bottom: 0; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results td {
        display: block;
        padding: 0 !important;
        border: 0 !important;
        min-width: 0;
        text-align: left !important;
        background: transparent !important;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results td.wsp-quick-product,
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results td.wsp-quick-status { grid-column: 1 / -1; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results td[data-label]:not(.wsp-quick-status)::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: var(--ft-text-muted);
        font-size: var(--ft-fs-xs);
        font-weight: var(--ft-fw-semibold);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results td.wsp-quick-status { order: 1; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results .wsp-row-error { background: var(--ft-danger-bg); }
    body:not(:has(.admin-shell)) .b2b-account-main #qo-results .wsp-table-wrap { overflow: visible; }
    body:not(:has(.admin-shell)) .b2b-account-main #qo-results .wsp-summary { flex-direction: column; align-items: stretch; gap: var(--ft-s3); }
    body:not(:has(.admin-shell)) .b2b-account-main #qo-add-slot { justify-content: stretch; }
    body:not(:has(.admin-shell)) .b2b-account-main #qo-add-slot > .wsp-btn { flex: 1 1 100%; justify-content: center; }
}
/* ux7: tablets keep the table but let it fit: headers may wrap and the
   product cell drops its 240px minimum, so Status stays in view. */
@media (min-width: 768px) and (max-width: 1023px) {
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results th { white-space: normal; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results .wsp-cell-product { min-width: 0; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-results .wsp-cell-product-text { min-width: 0; overflow-wrap: anywhere; }
}
/* F06: confirmation after adding, with the cart link next to it. */
body:not(:has(.admin-shell)) .b2b-account-main #qo-add-slot { align-items: center; flex-wrap: wrap; }
body:not(:has(.admin-shell)) .b2b-account-main .wsp-quick-added {
    margin: 0;
    color: var(--ft-success-fg);
    font-size: var(--ft-fs-sm);
    font-weight: var(--ft-fw-semibold);
}

/* Billing log on phones: one card per delivery instead of a sideways-scrolling table. */
@media (max-width: 640px) {
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-stack-table,
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-stack-table tbody { display: block; width: 100%; min-width: 0; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-stack-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--ft-s2) var(--ft-s3);
        padding: var(--ft-s3) var(--ft-s4);
        border-top: 1px solid var(--ft-divider);
    }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-stack-table td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; font-size: var(--ft-fs-sm); }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-stack-table td.wsp-stack-full { grid-column: 1 / -1; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-stack-table td.wsp-stack-full .wsp-code { overflow-wrap: anywhere; }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-stack-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: var(--ft-text-muted);
        font-size: var(--ft-fs-xs);
        font-weight: var(--ft-fw-semibold);
    }
}
@media (max-width: 640px) {
    /* Documents filters: one full-width control per row, like the order filters. */
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-filters { grid-template-columns: minmax(0, 1fr); }
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-filters .wsp-field,
    body:not(:has(.admin-shell)) .b2b-account-main .wsp-filters :is(select, input) { width: 100%; max-width: none; }
}

/* ==========================================================================
   ux6 review round 1 (14 Nov 2026)
   ========================================================================== */
/* One data-table head style (the overline, as in the catalogue, documents
   and quick order) for the orders list and the order lines. */
body:not(:has(.admin-shell)) .b2b-account-main :is(.b2b-order-list-head > span, .b2b-order-items thead th) {
    color: var(--ft-text-muted) !important;
    font: var(--ft-overline) !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
}
/* Orders list from 768px: 'Opnieuw bestellen' is a labelled text button,
   as on the order page (no unlabeled circular-arrow icon). */
@media (min-width: 768px) {
    /* Head and rows are separate grids: every track has a fixed or fr width so
       the columns line up. Details and the text button stack in a 156px cell. */
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table :is(.b2b-order-list-head, .b2b-order-card) {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1fr) 96px 156px;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: var(--ft-s1) !important;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-open { justify-content: center; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-reorder {
        width: auto;
        min-height: 36px !important;
        padding: 0 var(--ft-s2) !important;
        justify-content: center;
        text-align: center;
        line-height: 1.2;
    }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-card .b2b-order-reorder svg { display: none; }
    body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-list--table .b2b-order-reorder-label {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
        font-size: var(--ft-fs-sm);
    }
}
/* Order lines link to the product page while it is still sold. */
body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-item-link { color: var(--ft-primary-text); text-decoration: none; }
body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-item-link:hover { text-decoration: underline; }

/* ==========================================================================
   Design review (14 Nov 2026)
   The account sheets (b2b-account.css, account-workspace-redesign.css) can be
   added to the page after this file on in-app navigation, so these rules carry
   'html body' and one extra class to win on specificity, not on order.
   ========================================================================== */
/* DR-04: form fields in a section (new/edit address dialog, personal details)
   had two spacings: 44px between single fields (section gap 24px + field
   margin 20px) and 20px inside the two-column rows. Now 24px everywhere,
   from the section gap alone. */
html body:not(:has(.admin-shell)) .b2b-form-section > :is(.b2b-form-group, .b2b-form-grid-2, .b2b-details),
html body:not(:has(.admin-shell)) .b2b-form-section > .b2b-form-grid-2 > .b2b-form-group { margin-block: 0; }
html body:not(:has(.admin-shell)) .b2b-form-section > .b2b-form-grid-2 { row-gap: var(--ft-s5); }
/* The 'Set as default address' line was styled as a 12px grey field label
   (.b2b-form-group label). It is a choice, so it reads like the register
   checkboxes: 14px normal text on a 44px row with a 20px box. */
html body:not(:has(.admin-shell)) .b2b-form-group label.b2b-checkbox-label {
    min-height: var(--ft-control-h);
    color: var(--ft-text);
    font-size: var(--ft-fs-sm);
    font-weight: var(--ft-fw-regular);
}
html body:not(:has(.admin-shell)) .b2b-checkbox-label .b2b-checkbox { width: 20px; height: 20px; margin: 0; accent-color: var(--ft-primary); }

/* DR-05: order detail: the delivery address was 16px next to the 14px order
   information card. One text size for both cards. */
html body:not(:has(.admin-shell)) .b2b-account-main .b2b-order-address {
    font-size: var(--ft-fs-sm);
    line-height: var(--ft-lh-body);
    color: var(--ft-text);
}

/* DR-05b: account cards with a title bar (order information, delivery
   address, order history): the content started 8px right of the title
   (body 28px, title bar 20px). Both use the 20px edge now. */
html body:not(:has(.admin-shell)) .b2b-account-main .b2b-card > .b2b-card-header + .b2b-card-body { padding: var(--ft-s5) 20px; }

/* DR-06: quick order: '+ Zeile hinzufügen' (36px, 14px) stood next to the
   44px 'Verfügbarkeit prüfen'. One button height and text size in the row. */
html body:not(:has(.admin-shell)) #qo-grid-panel .wsp-actions > .wsp-btn-sm {
    min-height: var(--ft-control-h);
    padding: 0 18px;
    font-size: 15px;
}

/* "Save to list" dialog (18 Nov 2026). It also opens on the product page, where the account
   stylesheet is not loaded: without these rules its fields were bare browser inputs on one line. */
#wsp-list-picker { display: grid; gap: 14px; margin: 0; }
#wsp-list-picker .wsp-field { display: grid; gap: 6px; font-size: var(--ft-fs-sm); font-weight: var(--ft-fw-semibold); }
#wsp-list-picker .wsp-field[hidden] { display: none; }
#wsp-list-picker .wsp-field :is(input, select) {
    width: 100%; min-height: var(--ft-control-h); box-sizing: border-box; padding: 0 12px;
    border: 1px solid var(--ft-border-strong); border-radius: var(--ft-radius-md);
    background: var(--ft-surface); color: inherit; font: inherit; font-weight: 400; font-size: 16px;
}
#wsp-list-picker .wsp-field :is(input, select):focus-visible { outline: 2px solid var(--ft-focus-color); outline-offset: 1px; }
#wsp-list-picker .wsp-note { margin: 0; color: var(--ft-text-muted); font-size: var(--ft-fs-sm); }
#wsp-list-picker .wsp-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0; }

/* Cancel an unpaid order (29 Nov 2026): a quiet text button, red only on hover. */
.b2b-order-card .b2b-order-cancel { border: 0; background: none; padding: .25rem 0; color: var(--ft-text-muted, #5b6470); font: inherit; font-size: .92rem; text-decoration: underline; cursor: pointer; }
.b2b-order-card .b2b-order-cancel:hover, .b2b-order-detail-actions .b2b-order-cancel:hover { color: #b42318; border-color: #b42318; }
.b2b-order-cancel[disabled] { opacity: .5; cursor: default; }

/* Pick-up number (30 Nov 2026): the code the customer shows at the counter */
.b2b-pickup-box { margin-top: 12px; padding: 12px 16px; border: 1px dashed #2f6fed; border-radius: 12px; background: #f3f7ff; display: inline-block; max-width: 100%; }
.b2b-pickup-box > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #48607f; }
.b2b-pickup-box > p { margin: 6px 0 0; font-size: 13px; color: #334155; }
.b2b-pickup-code { font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: .12em; color: #0f2a4f; font-variant-numeric: tabular-nums; }
dd .b2b-pickup-code { font-size: 22px; }
.b2b-order-pickup strong { letter-spacing: .08em; color: #0f2a4f; }
.checkout-pickup-number { padding: 12px 14px; border: 1px dashed #2f6fed; border-radius: 10px; background: #f3f7ff; }
.checkout-pickup-number-text { margin: 4px 0 0; font-size: 13px; color: #334155; }
html body .b2b-account-main .b2b-pickup-box .b2b-pickup-code { display: block; margin-top: 2px; font-size: 32px !important; line-height: 1.1; font-weight: 800; letter-spacing: .14em; color: #0f2a4f; }
html body .b2b-account-main dd .b2b-pickup-code { font-size: 22px !important; letter-spacing: .12em; font-weight: 800; color: #0f2a4f; }
