:root {
    color-scheme: light;
    --store-brand: #1677b8;
    --store-brand-hover: #0f5f98;
    --store-brand-active: #0b4774;
    --store-action: var(--store-brand);
    --store-action-hover: var(--store-brand-hover);
    --store-text: #162c3d;
    --store-text-muted: #536b7c;
    --store-surface: #ffffff;
    --store-surface-subtle: #f2f7fb;
    --store-surface-hover: #e7f1f8;
    --store-border: #c5d9e8;
    --store-border-strong: #91b4cd;
    --store-danger: #b42318;
    --store-danger-hover: #8f1c13;
    --store-danger-surface: #fff1f0;
    --store-success: #16794b;
    --store-success-surface: #ecfdf3;
    --store-warning: #8a5a00;
    --store-warning-surface: #fff8e1;
    --store-info-surface: #e5f2fa;
    --store-space-1: .25rem;
    --store-space-2: .5rem;
    --store-space-3: .75rem;
    --store-space-4: 1rem;
    --store-space-5: 1.5rem;
    --store-space-6: 2rem;
    --store-radius-sm: .375rem;
    --store-radius: .625rem;
    --store-radius-lg: .875rem;
    --store-shadow-sm: 0 1px 2px rgb(38 50 56 / 8%);
    --store-shadow: 0 8px 24px rgb(38 50 56 / 8%);
    --store-focus: 0 0 0 3px rgb(22 119 184 / 28%);
    --store-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --store-content-width: 72rem;
}

* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--store-surface-subtle); color: var(--store-text); font-family: var(--store-font); font-size: 1rem; line-height: 1.55; }
h1, h2, h3 { color: var(--store-text); line-height: 1.2; margin: 0 0 var(--store-space-4); }
h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); letter-spacing: -.025em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 var(--store-space-4); }
a { color: var(--store-brand-hover); text-underline-offset: .15em; }
a:hover { color: var(--store-brand-active); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid transparent; box-shadow: var(--store-focus); }

.store-header, .store-footer { background: var(--store-surface); padding: var(--store-space-4) max(var(--store-space-4), calc((100% - var(--store-content-width)) / 2)); }
.store-header { align-items: center; border-bottom: 1px solid var(--store-border); display: flex; flex-wrap: wrap; gap: var(--store-space-4); justify-content: space-between; box-shadow: var(--store-shadow-sm); }
.store-branding { min-width: 13.75rem; }
.store-logo { color: var(--store-text); font-size: 1.2rem; font-weight: 750; text-decoration: none; }
.store-corporate-logo { display: block; line-height: 0; }
.store-corporate-logo img { display: block; height: auto; max-width: min(24.375rem, 72vw); width: 100%; }
.store-customer-logo { display: block; line-height: 0; }
.store-customer-logo img { display: block; height: auto; max-height: 6.875rem; max-width: min(13.75rem, 72vw); object-fit: contain; width: auto; }
.store-help { color: var(--store-text-muted); font-size: .875rem; }
.store-nav { align-items: center; display: flex; flex-wrap: wrap; gap: var(--store-space-1) var(--store-space-2); }
.store-nav a { border-radius: 999px; color: var(--store-brand-hover); font-weight: 650; padding: .4rem .65rem; text-decoration: none; }
.store-nav a:hover, .store-nav a:focus-visible, .store-nav-current { background: var(--store-info-surface); color: var(--store-brand-active) !important; }
.store-main { margin: 0 auto; max-width: var(--store-content-width); min-height: 60vh; padding: var(--store-space-6) var(--store-space-4); }
.store-main > h1 { margin-bottom: var(--store-space-5); }
.store-footer { border-top: 1px solid var(--store-border); color: var(--store-text-muted); text-align: center; }
.store-footer p { margin: 0; }

.store-card { background: var(--store-surface); border: 1px solid var(--store-border); border-radius: var(--store-radius); box-shadow: var(--store-shadow-sm); margin-bottom: var(--store-space-4); padding: var(--store-space-5); }
.store-card h2:first-child, .store-card p:last-child { margin-top: 0; }
.store-card p:last-child { margin-bottom: 0; }
.store-auth-main { max-width: 32rem; }
.store-auth-card .store-button { width: 100%; }
.store-auth-register { margin-top: var(--store-space-2); }
.store-auth-help { margin-top: calc(-1 * var(--store-space-2)); text-align: right; }
.eco-recovery-shell { margin: var(--store-space-6) auto; max-width: 32rem; padding: 0 var(--store-space-4); }
.store-field-error { color: var(--store-danger); display: block; font-size: .875rem; margin-top: var(--store-space-1); }
.store-empty { color: var(--store-text-muted); padding: var(--store-space-6); text-align: center; }
.store-actions, .cart-actions { align-items: center; display: flex; flex-wrap: wrap; gap: var(--store-space-2); margin-top: var(--store-space-4); }

.store-button { align-items: center; appearance: none; background: var(--store-action); border: 1px solid transparent; border-radius: var(--store-radius-sm); color: #fff !important; cursor: pointer; display: inline-flex; font: inherit; font-weight: 700; justify-content: center; line-height: 1.25; min-height: 2.625rem; padding: .625rem 1rem; text-decoration: none; transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 80ms ease; }
.store-button-primary { background: var(--store-action); }
.store-button:hover, .store-button-primary:hover { background: var(--store-action-hover); }
.store-button:active { background: var(--store-brand-active); transform: translateY(1px); }
.store-button-secondary { background: var(--store-surface); border-color: var(--store-border-strong); color: var(--store-text) !important; }
.store-button-secondary:hover { background: var(--store-surface-hover); border-color: var(--store-brand); }
.store-button-danger { background: var(--store-danger); }
.store-button-danger:hover { background: var(--store-danger-hover); }
.store-button-quiet { background: transparent; border-color: transparent; color: var(--store-brand-hover) !important; }
.store-button-quiet:hover { background: var(--store-info-surface); color: var(--store-brand-active) !important; }
.store-button-small { font-size: .875rem; min-height: 2rem; padding: .35rem .65rem; }
.store-button:disabled, .store-button[aria-disabled="true"], .store-button.is-submitting { cursor: not-allowed; opacity: .55; pointer-events: none; }
.store-button.is-submitting { cursor: progress; }
.store-icon-button-danger { align-items: center; appearance: none; background: transparent; border: 0; border-radius: var(--store-radius-sm); color: var(--store-danger); cursor: pointer; display: inline-flex; font-size: 1.35rem; justify-content: center; line-height: 1; min-height: 2rem; min-width: 2rem; padding: .25rem; }
.store-icon-button-danger:hover { background: var(--store-danger-surface); color: var(--store-danger-hover); }
.store-visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

form p { margin-bottom: var(--store-space-4); }
label { color: var(--store-text); display: inline-block; font-weight: 650; max-width: 100%; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea { background: var(--store-surface); border: 1px solid var(--store-border-strong); border-radius: var(--store-radius-sm); color: var(--store-text); font: inherit; margin-top: var(--store-space-1); max-width: 100%; min-height: 2.625rem; padding: .55rem .7rem; width: 100%; }
textarea { min-height: 7rem; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--store-action); height: 1rem; margin-right: var(--store-space-1); width: 1rem; }
input:disabled, select:disabled, textarea:disabled { background: #edf1f3; color: var(--store-text-muted); cursor: not-allowed; }
input[readonly], textarea[readonly] { background: var(--store-surface-subtle); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--store-danger); }
.store-field-compact { width: 7rem !important; }
.store-field-country { width: 5rem !important; }
.store-form-inline { display: inline; }
.store-action-link { background: none; border: 0; color: var(--store-brand-hover); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.store-action-link:hover { color: var(--store-brand-active); }
.store-action-link-danger { color: var(--store-danger); }
.store-action-link-danger:hover { color: var(--store-danger-hover); }
.store-form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: var(--store-space-2); margin: var(--store-space-5) 0 0; }
.store-result-summary { color: var(--store-text-muted); font-size: .9rem; }
.store-pagination { align-items: center; display: flex; flex-wrap: wrap; gap: .35rem; margin-top: var(--store-space-4); }
.store-pagination a, .store-pagination span { border: 1px solid var(--store-border); border-radius: var(--store-radius-sm); min-width: 2.25rem; padding: .4rem .65rem; text-align: center; }
.store-pagination .current { background: var(--store-brand); border-color: var(--store-brand); color: #fff; font-weight: 700; }
.store-pagination .disabled { color: var(--store-text-muted); opacity: .65; }

.store-flash, .store-alert { border: 1px solid; border-left-width: .3rem; border-radius: var(--store-radius-sm); margin-bottom: var(--store-space-4); padding: .85rem 1rem; }
.store-flash-error, .store-alert-error { background: var(--store-danger-surface); border-color: var(--store-danger); color: #7a1b14; }
.store-flash-success, .store-alert-success { background: var(--store-success-surface); border-color: var(--store-success); color: #105c39; }
.store-flash-warning, .store-alert-warning { background: var(--store-warning-surface); border-color: var(--store-warning); color: #684400; }
.store-flash-info, .store-alert-info { background: var(--store-info-surface); border-color: var(--store-brand); color: #174f67; }

.store-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
table { border-collapse: separate; border-spacing: 0; min-width: 36rem; width: 100%; }
th, td { border-bottom: 1px solid var(--store-border); padding: .7rem .75rem; text-align: left; vertical-align: top; }
thead th { background: var(--store-surface-subtle); color: var(--store-text-muted); font-size: .78rem; font-weight: 750; letter-spacing: .035em; position: sticky; text-transform: uppercase; top: 0; }
tbody tr:hover { background: var(--store-surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
tfoot th { background: var(--store-surface-subtle); }
.store-table-actions { white-space: nowrap; }
.store-sort-heading { color: inherit; display: inline-block; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: .18em; }
.store-sort-heading:hover { color: var(--store-brand-hover); text-decoration-color: currentColor; }
.store-status { border-radius: 999px; display: inline-block; font-size: .78rem; font-weight: 750; padding: .2rem .55rem; white-space: nowrap; }
.store-status-active, .store-status-paid, .store-status-completed { background: var(--store-success-surface); color: var(--store-success); }
.store-status-inactive, .store-status-cancelled { background: #edf1f3; color: var(--store-text-muted); }
.store-status-pending, .store-status-submitted { background: var(--store-warning-surface); color: var(--store-warning); }

.dashboard-stats, .dashboard-grid { display: grid; gap: var(--store-space-4); grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr)); }
.dashboard-stat strong { display: block; font-size: 2.25rem; line-height: 1.1; margin-top: var(--store-space-1); }
.dashboard-stat-label, .catalog-kicker, .product-sku { color: var(--store-text-muted); font-size: .78rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.catalog-hero { background: linear-gradient(135deg, var(--store-brand), #8fc5e8); border-radius: var(--store-radius-lg); margin-bottom: var(--store-space-4); padding: 3px; }
.catalog-branding { align-items: center; background: var(--store-surface); border-radius: calc(var(--store-radius-lg) - 2px); display: flex; gap: var(--store-space-5); padding: var(--store-space-5); }
.catalog-logo { max-height: 6.875rem; max-width: 13.75rem; object-fit: contain; }
.catalog-kicker, .product-sku { margin: 0 0 var(--store-space-1); }
.catalog-branding h2 { margin: var(--store-space-1) 0; }
.customer-setup-steps { list-style: none; margin: var(--store-space-5) 0; padding: 0; }
.customer-setup-steps li { align-items: flex-start; border-top: 1px solid var(--store-border); display: flex; gap: var(--store-space-3); padding: var(--store-space-4) 0; }
.customer-setup-marker { align-items: center; background: var(--store-warning-surface); border-radius: 50%; color: var(--store-warning); display: inline-flex; flex: 0 0 2rem; font-weight: 800; height: 2rem; justify-content: center; }
.customer-setup-steps .is-complete .customer-setup-marker { background: var(--store-success-surface); color: var(--store-success); }
.customer-setup .store-status { margin-left: var(--store-space-2); }
.catalog-hero-home .catalog-branding h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.product-grid { display: grid; gap: var(--store-space-4); grid-template-columns: repeat(auto-fit, minmax(14.375rem, 1fr)); }
.product-card { background: var(--store-surface); border: 1px solid var(--store-border); border-radius: var(--store-radius); box-shadow: var(--store-shadow-sm); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow 150ms ease, transform 150ms ease; }
.product-card:hover { box-shadow: var(--store-shadow); transform: translateY(-2px); }
.product-image-link { background: #eef2f3; display: block; }
.product-image { aspect-ratio: 4 / 3; display: block; height: auto; object-fit: cover; width: 100%; }
.product-image-placeholder { align-items: center; color: var(--store-text-muted); display: flex; justify-content: center; min-height: 11.25rem; }
.product-card-body { display: flex; flex: 1; flex-direction: column; padding: var(--store-space-4); }
.product-excerpt { color: var(--store-text-muted); flex: 1; margin-top: 0; }
.product-price { font-size: 1.25rem; font-weight: 750; margin: var(--store-space-1) 0 var(--store-space-4); }
.product-price-large { font-size: 1.6rem; }
.add-cart-form { align-items: end; display: flex; gap: var(--store-space-3); justify-content: space-between; margin-top: auto; }
.add-cart-form input, .cart-quantity-input { width: 5.5rem !important; }
.product-detail { background: var(--store-surface); border: 1px solid var(--store-border); border-radius: var(--store-radius); box-shadow: var(--store-shadow-sm); display: grid; gap: var(--store-space-6); grid-template-columns: minmax(15rem, 1fr) minmax(17.5rem, 1.2fr); padding: var(--store-space-5); }
.product-detail-image { border-radius: var(--store-radius); max-height: 30rem; object-fit: contain; width: 100%; }
.product-description { border-top: 1px solid var(--store-border); margin: var(--store-space-4) 0; padding-top: var(--store-space-4); }
.add-cart-form-detail { justify-content: flex-start; }
.cart-thumbnail { height: 4rem; object-fit: cover; width: 4rem; }
.cart-summary { text-align: right; }
.checkout-summary-notice { align-items: baseline; display: flex; gap: var(--store-space-4); justify-content: space-between; }
.checkout-summary-notice p { margin-bottom: 0; }
.checkout-quote-link { color: var(--store-text-muted); flex: 0 0 auto; font-size: .82rem; margin-left: auto; }
.checkout-quote-link:hover { color: var(--store-brand-hover); }
.order-detail-list { display: grid; gap: .35rem var(--store-space-4); grid-template-columns: max-content 1fr; }
.order-detail-list dt { font-weight: 700; }
.order-detail-list dd { margin: 0; }
.order-addresses { display: grid; gap: var(--store-space-4); grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.admin-list-image { height: auto; max-height: 5rem; max-width: 5.625rem; object-fit: contain; width: auto; }
.admin-preview-image { height: auto; max-height: 11.25rem; max-width: 11.25rem; object-fit: contain; width: auto; }
.customer-selector-list { display: grid; gap: var(--store-space-4); }
.customer-selector-card, .customer-selector-details { align-items: center; display: flex; gap: var(--store-space-4); }
.customer-selector-card { justify-content: space-between; }
.customer-selector-logo { max-height: 4rem; max-width: 6rem; object-fit: contain; }
.customer-management-heading { align-items: center; display: flex; flex-wrap: wrap; gap: var(--store-space-3); justify-content: space-between; margin-bottom: var(--store-space-4); }
.customer-management-heading h1 { margin: 0; }
.customer-user-add-form { align-items: center; display: flex; flex-wrap: wrap; gap: var(--store-space-3); }
.customer-user-add-form select { flex: 1 1 18rem; }

/* Normalize the existing jQuery UI tabs without changing their behavior. */
#customer-tabs.ui-widget { font-family: var(--store-font); font-size: 1rem; margin-bottom: var(--store-space-4); }
#customer-tabs.ui-widget-content { background: transparent; border: 0; color: var(--store-text); }
#customer-tabs .ui-tabs-nav { background: transparent; border: 0; border-bottom: 1px solid var(--store-border); border-radius: 0; overflow-x: auto; padding: 0; white-space: nowrap; }
#customer-tabs .ui-tabs-nav li { background: transparent; border: 0; border-radius: var(--store-radius-sm) var(--store-radius-sm) 0 0; display: inline-block; float: none; margin: 0 var(--store-space-1) 0 0; }
#customer-tabs .ui-tabs-nav .ui-tabs-anchor { color: var(--store-text-muted); font: inherit; font-weight: 700; padding: .7rem .9rem; }
#customer-tabs .ui-tabs-nav li.ui-tabs-active { background: var(--store-surface); border: 1px solid var(--store-border); border-bottom-color: var(--store-surface); margin-bottom: -1px; }
#customer-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { color: var(--store-brand-hover); }
#customer-tabs > ul > li.customer-tab-active > a { color: var(--store-brand-hover); text-decoration: underline; text-decoration-thickness: .15em; }
#customer-tabs .ui-tabs-nav .ui-tabs-anchor:focus-visible { box-shadow: inset var(--store-focus); outline: 0; }
#customer-tabs .ui-tabs-panel { background: var(--store-surface); border: 1px solid var(--store-border); border-radius: 0 0 var(--store-radius) var(--store-radius); padding: var(--store-space-5); }
.store-tabs.ui-widget { font-family: var(--store-font); font-size: 1rem; margin-bottom: var(--store-space-4); }
.store-tabs.ui-widget-content { background: transparent; border: 0; color: var(--store-text); }
.store-tabs .ui-tabs-nav { background: transparent; border: 0; border-bottom: 1px solid var(--store-border); border-radius: 0; padding: 0; }
.store-tabs .ui-tabs-nav li { background: transparent; border: 0; }
.store-tabs .ui-tabs-nav .ui-tabs-anchor { color: var(--store-text-muted); font: inherit; font-weight: 700; padding: .7rem .9rem; }
.store-tabs .ui-tabs-nav li.ui-tabs-active { background: var(--store-surface); border: 1px solid var(--store-border); border-bottom-color: var(--store-surface); }
.store-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { color: var(--store-brand-hover); }
.store-tabs .ui-tabs-nav .ui-tabs-anchor:focus-visible { box-shadow: inset var(--store-focus); outline: 0; }
.store-tabs .ui-tabs-panel { background: var(--store-surface); border: 1px solid var(--store-border); padding: var(--store-space-5); }
.account-payment-options { display: grid; gap: var(--store-space-3); }
.account-payment-disabled { color: var(--store-text-muted); }
.account-payment-request { align-items: center; display: flex; flex-wrap: wrap; gap: var(--store-space-3); margin-top: var(--store-space-5); }

@media (max-width: 700px) {
    .store-header { align-items: stretch; }
    .store-nav { width: 100%; }
    .store-main { padding: var(--store-space-4); }
    .catalog-branding, .add-cart-form, .customer-selector-card { align-items: stretch; flex-direction: column; }
    .catalog-logo { max-width: 100%; }
    .product-detail { grid-template-columns: minmax(0, 1fr); }
    .order-detail-list { grid-template-columns: 1fr; }
    .store-corporate-logo img { max-width: min(19.375rem, 82vw); }
}

.store-filter-form { align-items: end; display: flex; flex-wrap: wrap; gap: var(--store-space-3); margin-bottom: var(--store-space-4); }
.store-filter-form > label { flex: 1 1 13rem; }
.store-filter-actions { align-items: center; display: flex; flex-wrap: wrap; gap: var(--store-space-2); }
.ui-autocomplete { max-height: 18rem; overflow-y: auto; overflow-x: hidden; z-index: 1100 !important; }
#crm-search-status { color: var(--store-text-muted); margin-top: var(--store-space-2); min-height: 1.5em; }
