.reference-shell .reference-order-table:has(th.order-refresh-column){min-width:1840px!important}

.order-image-hover-preview {
  position: fixed;
  z-index: 79;
  box-sizing: border-box;
  width: min(350px, calc(100vw - 24px), calc(100vh - 24px));
  aspect-ratio: 1;
  object-fit: contain;
  padding: 4px;
  background: #fff;
  border: 1px solid #dce5f2;
  border-radius: 6px;
  box-shadow: 0 6px 20px #142d6430;
  pointer-events: none;
}

.reference-shell .reference-order-table th.order-finance-column,.reference-shell .reference-order-table td.order-finance-column{width:220px!important;min-width:220px;white-space:normal!important;overflow:visible;line-height:1.45!important;position:sticky;right:104px;background:#fff;z-index:2}
.reference-shell .reference-order-table th.order-finance-column{background:#f5f8fc}
.reference-order-table .order-finance-column small{display:block;font-size:11px!important;color:#718198}
.reference-order-table .order-finance-column strong{display:block;color:#16375d}
.reference-shell .reference-order-table th.order-refresh-column,.reference-shell .reference-order-table td.order-refresh-column{width:104px!important;min-width:104px!important;box-sizing:border-box;padding:8px!important;overflow:hidden!important;position:sticky;right:0;background:#fff;z-index:2;text-align:center;box-shadow:-2px 0 5px #dbe3ef}
.reference-shell .reference-order-table th.order-refresh-column{background:#f5f8fc}
.order-refresh-button{padding:5px 10px;border:1px solid #cbdcf9;border-radius:5px;background:#f5f9ff;color:#165dff;cursor:pointer;white-space:nowrap}
.order-refresh-button:disabled{opacity:.55;cursor:wait}
.order-finance-detail{padding:12px;background:#f5f8fc;border-radius:6px}.order-finance-detail strong{display:block;margin-top:5px}.order-amazon-finance small{color:#718198}

.reference-shell .reference-order-table .order-refresh-button{box-sizing:border-box;width:80px;max-width:100%;min-width:0;padding:5px 6px;font-size:12px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Fit the full order list to its available content width. */
html body .reference-shell .reference-orders{min-width:0;max-width:100%}
html body .reference-shell .reference-order-table:has(th.order-refresh-column){width:100%!important;min-width:0!important;table-layout:fixed!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th{width:auto!important;min-width:0!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th:first-child{width:2.6%!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th:nth-child(2){width:5%!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th:nth-child(3){width:4%!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th.account-owner-column{width:6%!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th.order-finance-column{width:13%!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th.order-refresh-column{width:6%!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) td,
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th{padding:8px 6px!important;white-space:normal!important;overflow-wrap:anywhere;min-width:0!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) td.order-finance-column,
html body .reference-shell .reference-order-table:has(th.order-refresh-column) td.order-refresh-column{width:auto!important;min-width:0!important;position:static;box-shadow:none}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th.order-finance-column,
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th.order-refresh-column{position:static;box-shadow:none}
html body .reference-shell .reference-order-table .order-refresh-button{width:100%;max-width:80px;padding:5px 2px}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) .order-thumb,
html body .reference-shell .reference-order-table:has(th.order-refresh-column) .order-thumb img{max-width:100%;object-fit:contain}

.order-exchange-bar{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-height:28px;font-size:12px;color:#718198}.order-exchange-bar button{border:0;background:transparent;color:#165dff;font-size:12px;cursor:pointer;padding:3px 0}.order-exchange-bar button:disabled{opacity:.55;cursor:wait}.reference-order-table .order-rmb-estimate{display:block;color:#718198;font-size:11px!important;line-height:17px;margin-top:1px}

html body .reference-shell .reference-order-table:has(th.order-refresh-column) th.order-money-column{width:8%!important}
html body .reference-shell .reference-order-table:has(th.order-refresh-column) th.order-rmb-column{width:7%!important}
.reference-order-table td.order-rmb-column{font-variant-numeric:tabular-nums;color:#16375d}
/* Order tables size to their rows instead of stretching to the content viewport. */
html body .reference-shell .reference-orders .reference-order-table{height:auto!important;min-height:0!important;max-height:none!important}
html body .reference-shell .reference-orders .reference-order-table thead,
html body .reference-shell .reference-orders .reference-order-table tbody{height:auto!important;min-height:0!important}
html body .reference-shell .reference-orders .reference-order-table thead tr,
html body .reference-shell .reference-orders .reference-order-table thead th{height:44px!important;min-height:0!important;padding:8px 6px!important}
html body .reference-shell .reference-orders .reference-order-table tbody tr,
html body .reference-shell .reference-orders .reference-order-table tbody td{height:78px!important;min-height:0!important;padding:8px 6px!important}
html body .reference-shell .reference-orders .reference-order-table td>div{height:auto!important;min-height:0!important;margin:0;line-height:21px}
html body .reference-shell .reference-orders .order-exchange-bar{height:28px!important;min-height:28px!important;flex:none;margin:0}
/* Supersede legacy nth-column widths on both header and body cells. */
html body #app .reference-shell .reference-orders .reference-order-table th,
html body #app .reference-shell .reference-orders .reference-order-table td{width:auto!important;min-width:0!important}
html body #app .reference-shell .reference-orders .reference-order-table th:first-child{width:2.5%!important}
html body #app .reference-shell .reference-orders .reference-order-table th:nth-child(2){width:4.5%!important}
html body #app .reference-shell .reference-orders .reference-order-table th:nth-child(3){width:4%!important}
html body #app .reference-shell .reference-orders .reference-order-table th.order-money-column{width:8%!important}
html body #app .reference-shell .reference-orders .reference-order-table th.order-rmb-column{width:7%!important}
html body #app .reference-shell .reference-orders .reference-order-table th.order-refresh-column{width:6%!important}
html body #app .reference-shell .reference-orders .reference-order-table th,
html body #app .reference-shell .reference-orders .reference-order-table td{white-space:normal!important;overflow-wrap:anywhere;line-height:21px!important}
html body #app .reference-shell .reference-orders .reference-order-table td>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body #app .reference-shell .reference-orders .reference-order-table th.order-date-column,
html body #app .reference-shell .reference-orders .reference-order-table th.order-updated-column{width:7%!important}
html body #app .reference-shell .reference-orders .reference-order-table th.order-number-column{width:12%!important}
html body #app .reference-shell .reference-orders .reference-order-table th{white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
html body #app .reference-shell .reference-orders .reference-order-table td>div{line-height:20px!important}

.order-stats-panel .reference-stat-grid strong{font-size:19px!important;line-height:1.4;padding:14px 18px;font-weight:400}.order-stats-panel .reference-stat-grid article{height:96px}.order-stats-panel .reference-stat-grid article header{height:38px;font-size:13px}

/* Cost editing must respect the available order table width. */
html body #app .reference-shell .reference-orders .reference-order-table{width:100%!important;min-width:0!important;max-width:100%!important}
html body #app .reference-shell .reference-orders .reference-order-table th.order-workbench-cost-column{width:8%!important}
html body #app .reference-shell .reference-orders .reference-order-table .order-workbench-costs{display:flex;flex-direction:column;align-items:flex-start;gap:3px;white-space:normal;overflow:visible}
html body #app .reference-shell .reference-orders .reference-order-table .order-workbench-costs button{max-width:100%;white-space:normal;overflow-wrap:anywhere;padding:3px 5px}
html body .reference-shell .reference-orders .reference-order-table tbody td.order-plain-status-cell {
  padding-inline-start: 11px !important;
}
.reference-order-table .order-amazon-status {
  display: inline-block;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.25;
}
.reference-order-table .order-amazon-status[data-status-tone="unshipped"] {
  background: #ffedd4;
  color: #8e440c;
  font-weight: 600;
}
.reference-order-table .order-amazon-status[data-status-tone="payment"] {
  background: #eef1f5;
  color: #475569;
}
.reference-order-table .order-amazon-status[data-status-tone="partial"] {
  background: #e6f0ff;
  color: #1d4f9f;
}
.reference-order-table .order-amazon-status[data-status-tone="shipped"] {
  background: #e4f5ea;
  color: #17603d;
}
.reference-order-table .order-amazon-status[data-status-tone="exception"] {
  background: #fde7e9;
  color: #a02637;
}
.reference-order-table td:is(.order-ship-due,.order-ship-late) > .order-amazon-status[data-status-tone]:not([data-status-tone="exception"]) {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 3px;
  background: #ff6565;
  color: #fff;
  line-height: 1.25;
  white-space: nowrap;
}
.reference-order-table td.order-ship-late > .order-amazon-status[data-status-tone]:not([data-status-tone="exception"]) {
  background: #bd354b;
}
.order-shipping-batch{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:4px 0}
.order-shipping-batch>.order-exchange-bar{margin-inline-start:auto!important;max-width:100%}
.order-shipping-batch>button{min-height:32px;padding:0 12px;border:1px solid #d5e2f6;border-radius:6px;background:#fff;color:#245ac1;white-space:nowrap}
.order-shipping-batch>button:hover{background:#edf4ff}
.reference-order-table [data-sync-shipping]{margin-top:4px}
.order-shipping-dialog {
 box-sizing:border-box;
 width:min(560px, calc(100% - 24px));
 max-width:none;
 max-height:calc(100dvh - 24px);
 padding:0;
 border:1px solid #dce5f2;
 border-radius:16px;
 background:#fff;
 color:#172e4e;
 box-shadow:0 24px 64px #142d6433;
 font-size:14px;
 line-height:1.5;
}
.order-shipping-results[open] { display:flex; flex-direction:column; }
.order-shipping-results > :is(header,footer) { flex:none; }
.order-shipping-results .order-shipping-content {
 display:flex;
 flex-direction:column;
 min-height:0;
}
.order-shipping-dialog::backdrop { background:#152c4b66; }
.order-shipping-dialog > header {
 display:flex;
 align-items:center;
 justify-content:space-between;
 gap:12px;
 padding:18px 24px;
 border-bottom:1px solid #e5ecf6;
}
.order-shipping-dialog h3 { margin:0; font-size:18px; line-height:1.4; }
.order-shipping-dialog .order-shipping-content { padding:20px 24px 24px; }
.order-shipping-dialog .order-shipping-progress {
 margin:7px 0 0;
 color:#48617e;
 font-size:13px;
}
.order-shipping-dialog footer {
 display:flex;
 justify-content:flex-end;
 gap:10px;
 padding:14px 24px;
 border-top:1px solid #e5ecf6;
 background:#f7faff;
}
.order-shipping-dialog :is(.order-shipping-close,.order-shipping-action) {
 box-sizing:border-box;
 flex:none;
 margin:0;
 border:1px solid #ccd9ea;
 border-radius:8px;
 background:#fff;
 color:#254871;
 font:inherit;
 font-weight:600;
 cursor:pointer;
 white-space:nowrap;
}
.order-shipping-dialog .order-shipping-close {
 display:grid;
 place-items:center;
 width:34px;
 height:34px;
 padding:0;
 font-size:20px;
 line-height:1;
}
.order-shipping-dialog .order-shipping-action { min-height:40px; padding:0 16px; }
.order-shipping-dialog button:hover:not(:disabled) { background:#edf4ff; }
.order-shipping-dialog button:focus-visible { outline:2px solid #2563d4; outline-offset:2px; }
.order-shipping-dialog button:disabled { opacity:.55; cursor:default; }
.order-shipping-results .order-shipping-counts {
 display:grid;
 flex:none;
 grid-template-columns:repeat(3,minmax(0,1fr));
 gap:8px;
 margin:0;
}
.order-shipping-counts > div {
 padding:9px 11px;
 border:1px solid var(--shipping-tint);
 border-radius:9px;
 background:var(--shipping-bg);
 color:var(--shipping-ink);
}
.order-shipping-success { --shipping-tint:#cbe7d9; --shipping-bg:#edf8f2; --shipping-ink:#176345; }
.order-shipping-pending { --shipping-tint:#f1dfb5; --shipping-bg:#fff7e6; --shipping-ink:#80530d; }
.order-shipping-failed { --shipping-tint:#f2d4d9; --shipping-bg:#fff1f3; --shipping-ink:#9e2940; }
.order-shipping-counts dt { font-size:12px; font-weight:600; }
.order-shipping-counts dd { margin:1px 0 0; font-size:22px; font-weight:700; line-height:1.15; font-variant-numeric:tabular-nums; }
.order-shipping-dialog .order-shipping-announcement {
 position:absolute;
 width:1px;
 height:1px;
 overflow:hidden;
 clip-path:inset(50%);
 white-space:nowrap;
}
.order-shipping-results .order-shipping-list {
 display:grid;
 gap:8px;
 min-height:0;
 max-height:330px;
 overflow:auto;
 margin:14px 0 0;
 padding:0;
 list-style:none;
}
.order-shipping-results .order-shipping-list:empty { margin:0; }
.order-shipping-list li {
 display:grid;
 gap:3px;
 margin:0;
 padding:9px 12px;
 border:1px solid #e4ebf5;
 border-inline-start:3px solid var(--shipping-tint);
 border-radius:8px;
 background:#f8fafd;
 overflow-wrap:anywhere;
}
.order-shipping-list li span { color:var(--shipping-ink); font-size:13px; }
@media (max-width:480px) {
 .order-shipping-dialog > header,
 .order-shipping-dialog .order-shipping-content,
 .order-shipping-dialog footer { padding-inline:16px; }
}
@media (max-height:320px) {
 .order-shipping-results[open],
 .order-shipping-results .order-shipping-content { display:block; }
}

.product-original-hover-preview {
  position: fixed;
  z-index: 100100;
  display: block;
  max-width: none;
  max-height: none;
  background: #fff;
  box-shadow: 0 3px 16px #182f5133;
  pointer-events: none;
}

.reference-order-table td.order-profit-loss{background:#fff1f0!important;color:#c62828!important;font-weight:700}.reference-order-table td.order-profit-loss small{color:#c62828!important;font-weight:600}.reference-order-table td.order-profit-loss button{color:#c62828}
