/* Shopify supplies the order's customer classification; the table never infers it. */
@layer apple-proportions {
  html body #orders-content .orders-table th.order-name-column { width: 140px !important; min-width: 140px !important; }
  html body #orders-content .orders-table th.order-customer-column { width: 72px !important; min-width: 72px !important; }
  html body #orders-content .orders-table td.order-customer-cell { white-space: nowrap !important; }
  html body #orders-content .orders-table tr[data-order-management-row]:focus-visible { outline: 2px solid var(--ar-link, #1677ff) !important; outline-offset: -2px !important; }
  html body #orders-content .orders-table td.order-number-cell { -webkit-user-select: text !important; user-select: text !important; }
  html body #orders-content .orders-table td.order-number-cell > .order-number-text { max-width: 100% !important; font-size: 12px !important; font-weight: 600 !important; font-variant-numeric: tabular-nums !important; -webkit-user-select: text !important; user-select: text !important; }
  html body #orders-content .order-customer-badge { --order-customer-ink: #1762b5; --order-customer-line: #a5c9f4; --order-customer-fill: #dbeafe; display: inline-flex !important; position: static !important; flex: 0 0 auto !important; align-items: center !important; justify-content: center !important; box-sizing: border-box !important; min-height: 22px !important; height: 22px !important; min-width: 0 !important; width: auto !important; margin: 0 !important; padding: 2px 7px !important; border: 0 !important; border-radius: 999px !important; background: var(--order-customer-fill) !important; color: var(--order-customer-ink) !important; box-shadow: none !important;
  font-family: var(--ads-font-sans) !important;
  font-size: 11px !important; font-weight: 700 !important; line-height: 18px !important; white-space: nowrap !important; cursor: pointer !important; pointer-events: auto !important; touch-action: manipulation; transition: background-color 120ms ease; }
  html body #orders-content .order-customer-badge.is-returning { --order-customer-ink: #7043b6; --order-customer-line: #c7b4e8; --order-customer-fill: #ede9fe; }
  html body #orders-content .order-customer-badge.is-unknown { --order-customer-ink: #69717d; --order-customer-line: #d5d9df; --order-customer-fill: #e5e7eb; }
}
.order-customer-popover { position: fixed; z-index: 165; box-sizing: border-box; width: min(350px, calc(100vw - 24px)); max-height: min(470px, calc(100dvh - 24px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--ar-border, #d8dce5); border-radius: 10px; background: var(--ar-surface, #fff); color: var(--ar-ink, #243044); box-shadow: 0 10px 32px rgba(20, 33, 55, .16);
  font-family: var(--ads-font-sans);
  font-size: 12px; line-height: 1.5; }
.order-customer-popover-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 8px 12px; border-bottom: 1px solid var(--ar-border, #e4e7ed); }
.order-customer-popover-head > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.order-customer-popover-head strong { min-width: 0; overflow: hidden; overflow-wrap: anywhere; color: inherit; font-size: 13px; font-weight: 600; }
.order-customer-close { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 26px; margin: 0; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ar-muted, #626c7c);
  font-family: var(--ads-font-sans);
  font-size: 20px; line-height: 1; cursor: pointer; }
.order-customer-close:hover { background: var(--ar-surface-muted, #f2f4f7); }
.order-customer-close:focus-visible { outline: 2px solid var(--ar-link, #1677ff); outline-offset: 2px; }
.order-customer-type { flex: 0 0 auto; padding: 1px 5px; border: 1px solid #a5c9f4; border-radius: 4px; background: #f5f9ff; color: #1762b5; font-size: 10px; white-space: nowrap; }
.order-customer-type.is-returning { border-color: #c7b4e8; background: #faf7ff; color: #7043b6; }
.order-customer-type.is-unknown { border-color: #d5d9df; background: #f8f9fa; color: #69717d; }
.order-customer-popover-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 12px; }
.order-customer-id, .order-customer-location { overflow-wrap: anywhere; color: var(--ar-secondary, #59677b); }
.order-customer-location { margin-top: 3px; }
.order-customer-order-index { margin: 9px 0; }
.order-customer-order-index strong { color: var(--ar-link, #1677ff); font-weight: 600; }
.order-customer-email { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.order-customer-email > span { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; -webkit-user-select: text !important; user-select: text !important; }
.order-customer-details { display: grid; gap: 0; margin: 10px 0 0; border-top: 1px solid var(--ar-border, #e4e7ed); }
.order-customer-detail-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 0; }
.order-customer-detail-row + .order-customer-detail-row { border-top: 1px solid var(--ar-border, #e4e7ed); }
.order-customer-detail-row dt { color: var(--ar-secondary, #59677b); }
.order-customer-timezone { display: block; color: var(--ar-muted, #69717d); font-size: 10px; line-height: 1.35; white-space: nowrap; }
.order-customer-detail-row dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.order-customer-unavailable { margin: 8px 0 0; color: var(--ar-muted, #69717d); font-size: 11px; }
.order-customer-loading, .order-customer-load-error { margin: 0; padding: 16px 12px; }
.order-customer-load-error { color: var(--ar-danger, #b4233a); }
.order-customer-popover button { font-family: var(--ads-font-sans); touch-action: manipulation; }
.order-customer-history-open { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; min-height: 28px; padding: 2px 4px; border: 0; border-radius: 5px; background: transparent; color: var(--ar-link, #1677ff); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.order-customer-history-open > span { font-size: 11px; }
.order-customer-history-open > span:last-child { font-size: 17px; line-height: 1; }
.order-customer-history-open:hover, .order-customer-history-back:hover, .order-customer-history-order:hover { background: var(--ar-surface-muted, #f2f4f7); }
.order-customer-popover button:focus-visible { outline: 2px solid var(--ar-link, #1677ff); outline-offset: 2px; }
.order-customer-popover.is-history { width: min(560px, calc(100vw - 24px)); max-height: min(650px, calc(100dvh - 24px)); }
.order-customer-history-head { padding-left: 8px; }
.order-customer-history-head > div { gap: 10px; }
.order-customer-history-back { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 1px 5px; border: 0; border-radius: 5px; background: transparent; color: var(--ar-secondary, #59677b); font: inherit; cursor: pointer; }
.order-customer-history-summary { flex: 0 0 auto; padding: 10px 12px; border-bottom: 1px solid var(--ar-border, #e4e7ed); background: var(--ar-surface-muted, #f7f8fa); }
.order-customer-history-summary p { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin: 0 0 4px; }
.order-customer-history-summary strong { color: var(--ar-ink, #243044); font-size: 12px; font-weight: 600; }
.order-customer-history-summary p > span, .order-customer-history-summary small { color: var(--ar-secondary, #59677b); }
.order-customer-history-summary small { display: block; font-size: 11px; line-height: 1.5; }
.order-customer-history-body { flex: 1 1 auto; padding: 0 12px; }
.order-customer-history-record { padding: 10px 0 12px; }
.order-customer-history-record + .order-customer-history-record { border-top: 1px solid var(--ar-border, #e4e7ed); }
.order-customer-history-order { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: calc(100% + 8px); min-height: 28px; margin: -2px -4px 2px; padding: 2px 4px; border: 0; border-radius: 5px; background: transparent; color: var(--ar-link, #1677ff); font: inherit; text-align: left; cursor: pointer; }
.order-customer-history-order strong, .order-customer-history-order-name { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }
.order-customer-history-order > span { flex: 0 0 auto; font-size: 11px; }
.order-customer-history-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; color: var(--ar-secondary, #59677b); font-variant-numeric: tabular-nums; }
.order-customer-history-meta time { overflow-wrap: anywhere; }
.order-customer-history-meta strong { flex: 0 0 auto; color: var(--ar-ink, #243044); font-weight: 600; }
.order-customer-history-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.order-customer-history-tags span { padding: 1px 6px; border-radius: 999px; font-size: 11px; line-height: 18px; }
.order-customer-history-products { display: grid; gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; }
.order-customer-history-products li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.order-customer-history-products li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.order-customer-history-quantity { flex: 0 0 auto; color: var(--ar-secondary, #59677b); font-variant-numeric: tabular-nums; }
.order-customer-history-note { margin: 6px 0 0; color: var(--ar-muted, #69717d); font-size: 11px; }
.order-customer-history-empty { margin: 0; padding: 32px 0; color: var(--ar-secondary, #59677b); text-align: center; }
.order-customer-history-pagination { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--ar-border, #e4e7ed); color: var(--ar-secondary, #59677b); font-variant-numeric: tabular-nums; }
.order-customer-history-pagination > div { display: flex; gap: 6px; }
.order-customer-history-pagination button, .order-customer-history-error > button { min-height: 28px; padding: 3px 9px; border: 1px solid var(--ar-border, #d8dce5); border-radius: 6px; background: var(--ar-surface, #fff); color: var(--ar-ink, #243044); font: inherit; cursor: pointer; }
.order-customer-history-pagination button:hover:not(:disabled), .order-customer-history-error > button:hover { background: var(--ar-surface-muted, #f2f4f7); }
.order-customer-history-pagination button:disabled { opacity: .5; cursor: default; }
.order-customer-history-loading { min-height: 130px; }
.order-customer-history-error { padding: 4px 12px 16px; }
.order-customer-history-error .order-customer-load-error { padding: 12px 0; overflow-wrap: anywhere; }
html[data-ads-theme="dark"] .order-customer-history-summary { background: #292e36; }
html[data-ads-theme="dark"] .order-customer-popover :is(.order-customer-history-summary strong, .order-customer-history-meta strong) { color: #e8edf5; }
html[data-ads-theme="dark"] .order-customer-popover :is(.order-customer-history-back, .order-customer-history-summary p > span, .order-customer-history-summary small, .order-customer-history-meta, .order-customer-history-quantity, .order-customer-history-empty, .order-customer-history-pagination) { color: #bdc7d5; }
html[data-ads-theme="dark"] .order-customer-popover :is(.order-customer-history-summary, .order-customer-history-record, .order-customer-history-pagination) { border-color: #3b414b; }
html[data-ads-theme="dark"] .order-customer-history-tags span:not(.order-management-badge) { color: #bdc7d5; background: #303640; }
html[data-ads-theme="dark"] .order-customer-history-note { color: #adb8c8; }
html[data-ads-theme="dark"] .order-customer-history-pagination button, html[data-ads-theme="dark"] .order-customer-history-error > button { color: #e8edf5; background: #24272d; border-color: #505866; }
html[data-ads-theme="dark"] .order-customer-popover :is(.order-customer-history-open, .order-customer-history-order) { color: #a9ccff; }
html[data-ads-theme="dark"] .order-customer-popover :is(.order-customer-history-open, .order-customer-history-back, .order-customer-history-order):hover { background: #303640; }
@media (max-width: 440px) { .order-customer-history-meta { flex-wrap: wrap; } }
@media (pointer: coarse) { .order-customer-popover :is(.order-customer-close, .order-customer-history-open, .order-customer-history-back, .order-customer-history-order, .order-customer-history-pagination button, .order-customer-history-error > button) { min-height: 44px; } .order-customer-close { flex-basis: 44px; width: 44px; } }
html[data-ads-theme="dark"] .order-customer-popover { border-color: #454b55; background: #24272d; color: #e8edf5; }
html[data-ads-theme="dark"] .order-customer-popover :is(.order-customer-id, .order-customer-location, dt) { color: #bdc7d5; }
html[data-ads-theme="dark"] .order-customer-popover :is(.order-customer-details, .order-customer-detail-row) { border-color: #3b414b; }
html[data-ads-theme="dark"] .order-customer-popover :is(.order-customer-unavailable, .order-customer-timezone) { color: #adb8c8; }
html[data-ads-theme="dark"] .order-customer-type { border-color: #426b99; background: #24364d; color: #a9ccff; }
html[data-ads-theme="dark"] .order-customer-type.is-returning { border-color: #756098; background: #362b49; color: #d5bcff; }
html[data-ads-theme="dark"] .order-customer-type.is-unknown { border-color: #505866; background: #303640; color: #c2cbd9; }
html[data-ads-theme="dark"] body #orders-content .order-customer-badge { --order-customer-ink: #a9ccff; --order-customer-line: #426b99; --order-customer-fill: #24364d; }
html[data-ads-theme="dark"] body #orders-content .order-customer-badge.is-returning { --order-customer-ink: #d5bcff; --order-customer-line: #756098; --order-customer-fill: #362b49; }
html[data-ads-theme="dark"] body #orders-content .order-customer-badge.is-unknown { --order-customer-ink: #c2cbd9; --order-customer-line: #505866; --order-customer-fill: #303640; }
@media (prefers-reduced-motion: reduce) { html body #orders-content .order-customer-badge { transition: none; } }

/* Purchase history uses a fixed drawer; customer information stays a compact card. */
#order-customer-popover.order-customer-popover.is-history { position:fixed; z-index:510; top:0!important; right:0!important; bottom:0!important; left:auto!important; width:min(480px,100vw)!important; max-width:100vw!important; height:auto!important; max-height:none!important; margin:0!important; border-top:0!important; border-right:0!important; border-bottom:0!important; border-radius:var(--ar-radius-modal,18px) 0 0 var(--ar-radius-modal,18px)!important; box-shadow:-8px 4px 30px rgba(26,45,74,.15); font-family:var(--ads-font-sans,"Microsoft YaHei","微软雅黑",sans-serif); }
#order-customer-popover *, #order-customer-popover *::before, #order-customer-popover *::after { box-sizing:border-box; }
#order-customer-popover.is-history .order-customer-popover-head { min-height:60px; padding:12px 16px; }
#order-customer-popover.is-history .order-customer-popover-head strong { font-size:18px; font-weight:700; line-height:1.45; }
#order-customer-popover.is-history .order-customer-popover-head > div { gap:10px; }
#order-customer-popover.is-history .order-customer-popover-body { flex:1 1 auto; padding:12px 16px 16px; }
#order-customer-popover .order-customer-history-back { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:28px; padding:3px 6px; }
#order-customer-popover .order-customer-history-back svg { display:block; flex:0 0 12px; width:12px; height:12px; }
#order-customer-popover .order-customer-history-summary { padding:10px 16px; }
#order-customer-popover .order-customer-history-body { padding:0 12px; background:var(--ar-canvas,#f5f5f7); }
#order-customer-popover .order-customer-history-record { margin:8px 0; padding:10px 12px 12px; border:1px solid var(--ar-border,#d8dce5); border-radius:var(--ar-radius-panel,14px); background:var(--ar-surface,#fff); }
#order-customer-popover .order-customer-history-products li { align-items:center; }
#order-customer-popover .order-customer-product-title { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; }
.order-customer-product-media { position:relative; display:inline-flex; flex:0 0 40px; align-items:center; justify-content:center; width:40px; height:40px; overflow:hidden; border:1px solid var(--ar-border,#d8dce5); border-radius:6px; background:var(--ar-surface-muted,#f2f4f7); color:var(--ar-muted,#69717d); }
.order-customer-product-media > svg { display:block; }
.order-customer-product-media > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.order-customer-product-media > img[hidden] { display:none!important; }
html[data-ads-theme="dark"] #order-customer-popover .order-customer-history-body { background:#1c2026; }
html[data-ads-theme="dark"] #order-customer-popover .order-customer-history-record { border-color:#3b414b; background:#24272d; }
html[data-ads-theme="dark"] .order-customer-product-media { border-color:#505866; background:#303640; color:#adb8c8; }
@media(max-width:760px) { #order-customer-popover.order-customer-popover.is-history { border-radius:var(--ar-radius-modal,18px) 0 0 var(--ar-radius-modal,18px)!important; } #order-customer-popover.is-history .order-customer-popover-head { padding:10px 12px; } #order-customer-popover.is-history .order-customer-popover-head strong { font-size:16px; } #order-customer-popover .order-customer-history-head > div { gap:6px; flex-wrap:wrap; } #order-customer-popover.is-history .order-customer-popover-body { padding-left:12px; padding-right:12px; } }
