/* Shared tokens. Explicit theme choices take precedence over the system theme. */
:root {
  color-scheme: light;
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-subtle: #f7f7f7;
  --surface-hover: #eeeeee;
  --text: #303030;
  --muted: #616161;
  --border: #e3e3e3;
  --control-border: #8a8a8a;
  --accent: #303030;
  --accent-hover: #1a1a1a;
  --on-accent: #ffffff;
  --accent-soft: #f1f1f1;
  --success: #0c5132;
  --success-bg: #e3f1df;
  --warning: #714b00;
  --warning-bg: #fff8db;
  --danger: #b5260b;
  --danger-bg: #fee9e8;
  --info: #24578f;
  --info-bg: #eaf2ff;
  --focus: #275fd2;
  --link: #24578f;
  --overlay: #00000066;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-lg: 16px;
  --text-xl: 22px;
  --text-2xl: 30px;
  --shadow-sm: 0 1px 2px #0000000a;
  --shadow-lg: 0 16px 56px #00000026;
  --sidebar-width: 204px;
  --topbar-height: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111318;
    --surface: #191b20;
    --surface-subtle: #22252b;
    --surface-hover: #2b2f36;
    --text: #f3f4f6;
    --muted: #b4bac4;
    --border: #3a4048;
    --control-border: #7d8794;
    --accent: #f3f4f6;
    --accent-hover: #ffffff;
    --on-accent: #16181d;
    --accent-soft: #2b2f36;
    --success: #a9ddb7;
    --success-bg: #1e3326;
    --warning: #f1cf83;
    --warning-bg: #312719;
    --danger: #ffb4ab;
    --danger-bg: #3a2423;
    --info: #adcfff;
    --info-bg: #1e2e45;
    --focus: #a8c7ff;
  --link: #9ec5ff;
    --overlay: #000000cc;
    --shadow-sm: 0 1px 2px #00000018;
    --shadow-lg: 0 16px 56px #00000055;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318;
  --surface: #191b20;
  --surface-subtle: #22252b;
  --surface-hover: #2b2f36;
  --text: #f3f4f6;
  --muted: #b4bac4;
  --border: #3a4048;
  --control-border: #7d8794;
  --accent: #f3f4f6;
  --accent-hover: #ffffff;
  --on-accent: #16181d;
  --accent-soft: #2b2f36;
  --success: #a9ddb7;
  --success-bg: #1e3326;
  --warning: #f1cf83;
  --warning-bg: #312719;
  --danger: #ffb4ab;
  --danger-bg: #3a2423;
  --info: #adcfff;
  --info-bg: #1e2e45;
  --focus: #a8c7ff;
  --link: #9ec5ff;
  --overlay: #000000cc;
  --shadow-sm: 0 1px 2px #00000018;
  --shadow-lg: 0 16px 56px #00000055;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: var(--text-base); line-height: 1.5; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; font-variant-numeric: tabular-nums; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, select, textarea { border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); padding: 9px 11px; min-height: 38px; max-width: 100%; }
input[type="number"] { text-align: right; }
input[type="checkbox"] { width: 16px; height: 16px; min-height: auto; accent-color: var(--accent); }
textarea { width: 100%; resize: vertical; min-height: 78px; }
label { font-weight: 600; }
::placeholder { color: var(--muted); opacity: 1; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: var(--text-2xl); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
h2 { font-size: var(--text-lg); letter-spacing: -.015em; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.muted, .help { color: var(--muted); }
.help { font-size: var(--text-sm); font-weight: 400; }
.number { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 20; background: var(--surface); padding: 12px; border: 1px solid var(--accent); }
.skip-link:focus { top: 12px; }
.topbar { height: var(--topbar-height); display: flex; align-items: center; position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { width: var(--sidebar-width); padding: 0 24px; display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 18px; letter-spacing: -.7px; font-weight: 700; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 22px; height: 21px; }
.brand-mark::before, .brand-mark::after { content: ""; background: var(--accent); border-radius: 2px 2px 0 0; width: 9px; height: 14px; transform: skewY(-18deg); }
.brand-mark::after { height: 21px; }
.store { display: flex; align-items: center; gap: 10px; padding-left: 30px; border-left: 1px solid var(--border); font-weight: 600; }
.store-icon { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px; display: grid; place-items: center; background: var(--surface-subtle); }
.topbar-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; padding-right: 28px; }
.preview-label { color: var(--muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; }
.avatar { display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; width: 29px; height: 29px; background: var(--surface-subtle); font-size: 10px; font-weight: 700; }
.sidebar { position: fixed; top: var(--topbar-height); bottom: 0; width: var(--sidebar-width); border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; padding: 26px 14px 18px; }
.nav-label { margin: 0 12px 12px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .13em; text-transform: uppercase; }
.nav-items { display: grid; gap: 5px; }
.desktop-navigation { display: grid; gap: 5px; }
.mobile-navigation, .merchant-page .mobile-row-action { display: none; }
.nav-link { display: flex; gap: 11px; align-items: center; padding: 10px 12px; color: var(--muted); font-size: var(--text-base); font-weight: 500; text-decoration: none; border: 0; background: transparent; border-radius: var(--radius-sm); width: 100%; text-align: left; white-space: nowrap; }
.nav-link:hover { background: var(--surface-subtle); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-count { margin-left: auto; border: 1px solid var(--border); border-radius: 4px; font-size: 10px; min-width: 20px; padding: 0 5px; text-align: right; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 14px; }
.store-note { margin: 0 10px; padding: 13px 0; border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--muted); }
.store-note strong { display: block; color: var(--text); font-weight: 500; margin-bottom: 3px; }
main { margin-left: var(--sidebar-width); padding: 24px 32px; min-width: 0; }
.breadcrumb { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: var(--text-sm); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb .slash { color: var(--control-border); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-header p { margin-top: 7px; color: var(--muted); }
.header-actions, .button-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-upload { position: relative; }
.plan-upload > form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(420px, calc(100vw - 48px)); display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.plan-upload > form p { margin: 0; }
.plan-upload input { min-width: 0; max-width: 100%; }
[data-plan-confirm] .decision-card { overflow-wrap: anywhere; }
[data-plan-confirm] > .button-row { margin-top: 16px; }
@media (max-width: 640px) {
  .plan-upload { width: 100%; }
  .plan-upload > summary { justify-content: center; }
  .plan-upload > form { position: static; width: 100%; margin-top: 8px; }
}
.supplier-card > .button-row { padding: 0 17px 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; min-height: 36px; border: 1px solid var(--control-border); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); font-weight: 600; font-size: var(--text-sm); text-decoration: none; white-space: nowrap; }
.button:hover { background: var(--surface-hover); }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.button-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.button-small { min-height: 29px; padding: 5px 10px; font-size: var(--text-xs); }
.icon-button { display: inline-grid; place-items: center; padding: 7px; width: 34px; height: 34px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--surface-hover); color: var(--text); }
.sales-history { padding: 20px; }
.sales-history h2 { margin: 0 0 8px; }
.sales-history-scroll { position: relative; overflow-x: auto; }
.merchant-page .sales-history table { width: 100%; min-width: 0; }
.merchant-page .sales-history th, .merchant-page .sales-history td { position: static; white-space: normal; padding: 12px 10px; }
.sales-history tbody th { text-align: left; font-weight: 500; }
.sales-history .number { text-align: right; font-variant-numeric: tabular-nums; }
.history-through, .history-note { display: block; }
.history-note { color: var(--muted); font-size: var(--text-sm); font-weight: 400; }
.history-stockout { color: var(--warning); }
.sku-po-history { margin: 24px 0; }
.sku-po-list { list-style: none; padding: 0; }
.sku-po-list > li { padding: 18px; margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow-wrap: anywhere; }
.sku-po-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.sku-po-heading h3, .sku-po-heading p { margin: 0; }
.sku-po-list dl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin: 16px 0 0; }
.sku-po-list dt { color: var(--muted); font-size: var(--text-sm); }
.sku-po-list dd { margin: 4px 0 0; font-variant-numeric: tabular-nums; }
@media (max-width: 800px) {
  .sku-po-list dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .sales-history { padding: 12px; }
  .merchant-page .sales-history th, .merchant-page .sales-history td { padding: 10px 4px; font-size: 11px; }
  .sales-history .history-note { font-size: 10px; }
  .sales-history th:first-child { width: 29%; }
}
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 17px 12px; box-shadow: var(--shadow-sm); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: var(--text-sm); margin-bottom: 9px; }
.stat-label svg { width: 15px; height: 15px; }
.stat-value { text-align: right; font-size: var(--text-2xl); line-height: 1.25; font-weight: 600; letter-spacing: -.035em; }
.stat-value.small { font-size: var(--text-xl); padding-top: 7px; }
.stat-foot { display: flex; justify-content: flex-end; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--muted); margin-top: 7px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--success); display: inline-block; flex: none; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--warning-bg); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 16px; color: var(--warning); }
.banner p { font-size: var(--text-sm); }
.banner strong { font-weight: 650; }
.banner .banner-copy { flex: 1; }
.banner .button { color: inherit; border-color: currentColor; background: transparent; }
.banner.banner-error, .banner.banner-warning, .banner.banner-success { border-color: currentColor; border-left-width: 4px; align-items: flex-start; flex-wrap: nowrap; padding: 16px; margin-top: 16px; }
.banner.banner-error { color: var(--danger); background: var(--danger-bg); }
.banner.banner-warning { color: var(--warning); background: var(--warning-bg); }
.banner.banner-success { color: var(--success); background: var(--success-bg); }
.ledger-changed { outline: 2px solid var(--success); outline-offset: -2px; background: var(--success-bg); }
.banner .banner-icon { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border: 2px solid currentColor; border-radius: 50%; font-weight: 700; }
.banner:is(.banner-error, .banner-warning, .banner-success) .banner-copy { min-width: 0; overflow-wrap: anywhere; }
.banner:is(.banner-error, .banner-warning, .banner-success) .banner-copy p { margin: 4px 0 0; color: inherit; font-size: var(--text-base); }
.banner-success a { display: inline-block; margin-top: 12px; color: inherit; font-weight: 600; }
.banner:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.banner[hidden], .polaris-ready .banner[hidden] { display: none; }
.main:not(:has(.account-card, [data-billing])) .banner[aria-label="Email verification"] { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 6px 12px; }
.main:not(:has(.account-card, [data-billing])) .banner[aria-label="Email verification"] p { flex: 1; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main .banner[aria-label="Email verification"] form { flex-shrink: 0; margin: 0; }
.main .banner[aria-label="Email verification"] .button { margin: 0; min-height: 44px; }
.sync-connection #shopify-progress { margin-top: 22px; border: 0; border-top: 1px solid var(--border); padding: 22px 0 0; }
.sync-connection .banner { margin-bottom: 0; }
.sync-connection #shopify-progress > .banner:first-child { margin-top: 0; }
.sync-stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.sync-stepper li { display: flex; align-items: flex-start; gap: 8px; padding: 12px 8px; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--muted); font-size: var(--text-sm); }
.sync-stepper [aria-current="step"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.sync-step-icon { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border: 1px solid currentColor; border-radius: 50%; font-size: var(--text-xs); }
.sync-stepper [aria-current="step"] .sync-step-icon { border: 3px dotted currentColor; font-size: 0; animation: sync-activity 2s linear infinite; }
.sync-count { display: block; margin-top: 6px; font-variant-numeric: tabular-nums; }
.guide-panel .sync-message { color: var(--text); font-weight: 600; }
.sync-timing { font-size: var(--text-sm); }
.merchant-page .sync-reconciliation table { min-width: 0; table-layout: fixed; }
.merchant-page .sync-reconciliation th, .merchant-page .sync-reconciliation td { padding: 12px 8px; white-space: normal; overflow-wrap: anywhere; }
.merchant-page .sync-reconciliation th:first-child { width: 46%; }
.sync-reconciliation caption { text-align: left; font-weight: 600; padding: 16px 0 8px; }
.sync-reconciliation details { margin-top: 16px; }
@keyframes sync-activity { to { transform: rotate(360deg); } }
@media (max-width: 1000px) {
  .sync-stepper { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sync-stepper li { align-items: center; padding: 8px 12px; }
  .sync-stepper li > span:last-child { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .sync-count { margin: 0 0 0 auto; }
}
.account-card { overflow-wrap: anywhere; }
.account-service-level { margin-top: 24px; }
.service-level-options { border: 0; padding: 0; margin: 0; min-width: 0; }
.service-level-options legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.service-level-options .checkbox-label { min-height: 44px; }
.service-level-options input[type="radio"] { width: 16px; height: 16px; min-height: auto; padding: 0; flex: 0 0 16px; accent-color: var(--accent); }
.account-notifications { margin-top: 24px; }
.account-notifications fieldset { border: 0; padding: 0; margin: 0; }
.account-notifications legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.account-notifications .checkbox-label { min-height: 44px; }
.account-notifications input[type="checkbox"] { width: 16px; flex: 0 0 16px; }
.account-actions { margin: 20px 0; }
.account-signout { justify-items: start; }
.account-support { margin-top: 24px; }
.auth-card.account-danger { margin-top: 24px; border-top: 3px solid var(--danger); }
.account-danger h2 { margin-top: 0; color: var(--danger); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 14px 0 10px; }
.section-heading p { color: var(--muted); font-size: var(--text-sm); margin-top: 3px; }
.toolbar { display: flex; align-items: center; gap: 9px; }
.search-field { position: relative; }
.search-field svg { position: absolute; top: 10px; left: 10px; color: var(--muted); width: 16px; height: 16px; }
.search-field input { padding-left: 33px; width: 202px; border-color: var(--border); font-size: var(--text-sm); }
.supplier-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.supplier-import-review { overflow-wrap: anywhere; }
.supplier-import-review .guide-panel { margin-bottom: 16px; }
.supplier-import-review h3 { font-size: var(--text-sm); color: var(--muted); margin-bottom: 8px; }
.supplier-heading { display: flex; align-items: center; gap: 11px; padding: 12px 17px; }
.supplier-heading a[download] { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.supplier-monogram { display: grid; place-items: center; width: 31px; height: 31px; flex: none; border: 1px solid var(--border); background: var(--surface-subtle); color: var(--muted); border-radius: 6px; font-size: 10px; font-weight: 600; }
.supplier-name { flex: 1; min-width: 0; }
.supplier-name h3 { font-size: var(--text-base); }
.supplier-name p { color: var(--muted); font-size: var(--text-xs); margin-top: 1px; }
.supplier-total { text-align: right; font-weight: 650; font-size: 14px; margin-right: 8px; }
.supplier-total small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.table-scroll { overflow: auto; max-height: 760px; scrollbar-color: var(--control-border) var(--surface-subtle); }
.po-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 20px 0; }
.merchant-page .po-filters .field { margin: 0; }
.po-filters .field:has(input) { width: min(320px, 100%); }
.po-list { max-height: none; }
.po-list > table > tbody > tr[data-po-row] > th { white-space: normal; overflow-wrap: anywhere; }
.po-list .po-detail-row > td { padding-top: 0; white-space: normal; }
.po-detail-row summary { cursor: pointer; padding: 8px 0; color: var(--accent); }
.po-detail-row .button-row { margin: 12px 0; }
.supplier-card .table-scroll { max-height: none; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1040px; font-size: var(--text-sm); }
th { font-size: 10px; font-weight: 500; color: var(--muted); background: var(--surface-subtle); position: sticky; top: 0; z-index: 2; padding: 8px 9px; text-align: right; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child { text-align: left; padding-left: 17px; }
td { padding: 8px 9px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
td:first-child { padding-left: 17px; text-align: left; }
tr:last-child td { border-bottom: 0; }
.product-cell { width: 235px; }
.product-name { font-weight: 550; font-size: var(--text-sm); color: var(--text); white-space: normal; overflow-wrap: anywhere; }
.sku { color: var(--muted); font-size: 10px; margin-top: 2px; letter-spacing: .035em; }
.unit { color: var(--muted); }
.status-col { text-align: left; width: 146px; }
.why-col { width: 36px; padding-left: 0; }
.why-toggle { width: 26px; height: 28px; padding: 4px; }
.why-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.quantity-button { min-width: 46px; border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; color: var(--text); background: var(--surface); text-align: right; font-weight: 600; }
.quantity-button:hover { border-color: var(--accent); }
.row-refused { background: var(--warning-bg); }
.row-refused .product-cell { box-shadow: inset 3px 0 0 var(--warning); }
.row-overridden .quantity-button { background: var(--info-bg); border-color: var(--info); color: var(--info); }
.row-check .cover { color: var(--warning); font-weight: 650; }
.reorder-desk .coverage-note { margin-top: 8px; white-space: normal; color: var(--warning); font-size: var(--text-xs); }
.reorder-desk .coverage-note strong, .reorder-desk .coverage-note a { display: block; }
.reorder-desk .coverage-summary summary { margin-top: 8px; cursor: pointer; font-weight: 600; }
.reorder-desk .coverage-summary li + li { margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 4px; font-size: 10px; line-height: 1.45; font-weight: 550; white-space: nowrap; }
.pill-ok { color: var(--success); background: var(--success-bg); }
.pill-check, .pill-decision { color: var(--warning); background: var(--warning-bg); }
.pill-overridden { color: var(--info); background: var(--info-bg); }
.pill-stale { color: var(--danger); background: var(--danger-bg); }
.detail-row td { padding: 0; text-align: left; white-space: normal; }
.detail-content { padding: 12px 20px 14px; background: var(--surface-subtle); border-left: 3px solid var(--accent); }
.buffer-explanation { max-width: min(65ch, calc(100vw - 80px)); }
.why-title { display: flex; align-items: center; gap: 7px; font-weight: 600; margin-bottom: 9px; font-size: var(--text-xs); }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.why-step { border-right: 1px solid var(--border); padding-right: 20px; }
.why-step:last-child { border: 0; }
.why-step span { color: var(--muted); font-size: 10px; display: block; }
.why-step strong { font-size: var(--text-sm); display: block; margin: 4px 0 2px; font-weight: 600; text-align: right; }
.why-step p { color: var(--muted); font-size: 10px; }
.override-note { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border); font-size: var(--text-xs); }
.override-form { padding-top: 14px; display: grid; grid-template-columns: 150px 120px 1fr auto; gap: 14px; align-items: end; }
.override-form > .banner-error { grid-column: 1 / -1; order: 1; }
.field { display: grid; gap: 6px; font-size: var(--text-sm); min-width: 0; }
.override-form input, .override-form select { width: 100%; font-size: var(--text-sm); }
.supplier-footer { display: flex; gap: 10px; justify-content: space-between; padding: 10px 17px; color: var(--muted); font-size: var(--text-xs); background: var(--surface-subtle); border-top: 1px solid var(--border); }
.table-caption { font-size: var(--text-xs); color: var(--muted); margin-bottom: 8px; }
.page-footer { display: flex; gap: 15px; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 16px; color: var(--muted); font-size: var(--text-xs); margin-top: 26px; }
.page-footer a { color: var(--muted); }
.narrow { max-width: 940px; margin: 0 auto; }
.stepper { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 28px; max-width: 650px; }
.stepper li { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--muted); font-size: var(--text-sm); }
.stepper li:not(:last-child)::after { content: ""; height: 1px; background: var(--border); flex: 1; margin: 0 18px 0 10px; }
.step-number { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--control-border); font-size: 10px; text-align: right; flex: none; }
.stepper [aria-current="step"] { color: var(--accent); font-weight: 600; }
.stepper [aria-current="step"] .step-number { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.upload-intro { max-width: 620px; margin-bottom: 27px; }
.upload-intro h1 { margin-bottom: 10px; }
.upload-intro p { color: var(--muted); line-height: 1.7; }
.upload-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 22px; display: grid; grid-template-columns: minmax(0, 1fr) 295px; gap: 24px; align-items: center; margin-bottom: 12px; }
.upload-copy h2 { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 7px; }
.file-number { color: var(--muted); font-size: 11px; width: 18px; font-weight: 400; text-align: right; }
.upload-copy p { color: var(--muted); font-size: var(--text-sm); margin-left: 27px; line-height: 1.7; }
.dropzone { position: relative; border: 1px dashed var(--control-border); border-radius: var(--radius-md); background: var(--bg); min-height: 94px; display: grid; place-items: center; text-align: center; padding: 16px; font-weight: 400; cursor: pointer; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.dropzone input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; cursor: pointer; }
.dropzone svg { margin: 0 auto 7px; display: block; color: var(--muted); }
.dropzone strong { color: var(--accent); font-weight: 600; }
.dropzone small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.privacy-note { display: flex; gap: 9px; align-items: flex-start; padding: 18px 0; color: var(--muted); font-size: var(--text-sm); }
.privacy-note svg { width: 15px; height: 15px; margin-top: 1px; }
.upload-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); padding-top: 19px; }
details { color: var(--muted); font-size: var(--text-sm); }
summary { cursor: pointer; }
details p { margin: 9px 0; max-width: 540px; }
.upload-action { margin-top: 23px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.upload-action .button { padding: 11px 18px; }
.decision-section { margin-bottom: 25px; scroll-margin-top: 85px; }
.decision-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.decision-card { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: var(--radius-md); }
.decision-card .pill { margin-bottom: 10px; }
.decision-card h3 { margin-bottom: 6px; }
.decision-card p { color: var(--muted); font-size: var(--text-sm); line-height: 1.6; margin: 6px 0 12px; }
.decision-card .next-step { color: var(--text); }
.report-heading { display: flex; gap: 10px; align-items: center; }
.report-heading svg { width: 22px; height: 22px; color: var(--success); }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.shopify-cost-suggestion { padding: 16px 0; border-top: 1px solid var(--border); }
.shopify-cost-suggestion > div { min-width: 0; overflow-wrap: anywhere; }
.shopify-cost-suggestion .field { margin-bottom: 8px; }
.ledger-import code { overflow-wrap: anywhere; }
.import-mapping select { width: 100%; min-width: 0; }
.import-mapping .guide-grid { gap: 0 24px; }
.import-mapping .mapping-field { align-content: start; margin-bottom: 20px; }
.mapping-field .mapping-fixed, .mapping-field .mapping-derivation { display: none; }
.mapping-field:has(.mapping-mode option[value="fixed"]:checked) .mapping-fixed,
.mapping-field:has(.mapping-mode option[value="derive"]:checked) .mapping-derivation { display: grid; }
.mapping-field:has(.mapping-mode option[value="fixed"]:checked) .mapping-column,
.mapping-field:has(.mapping-mode option[value="derive"]:checked) .mapping-column:not(.mapping-name-column) { display: none; }
.import-mapping h2:not(:first-child) { margin-top: 28px; }
.import-preview { margin: 16px 0; }
.import-preview table { min-width: 700px; }
.import-preview th, .import-preview td { max-width: 240px; white-space: normal; overflow-wrap: anywhere; }
.import-references { padding-left: 20px; }
.guide-panel { border: 1px solid var(--border); background: var(--surface); padding: 22px; border-radius: var(--radius-md); margin-bottom: 18px; min-width: 0; }
.guide-panel h2 { margin-bottom: 16px; }
.guide-panel h3 { margin: 18px 0 9px; }
.guide-panel p { color: var(--muted); margin: 9px 0; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.swatch { height: 48px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; }
.swatch-bg { background: var(--bg); }
.swatch-surface { background: var(--surface); }
.swatch-text { background: var(--text); }
.swatch-accent { background: var(--accent); }
.swatch-warning { background: var(--warning); }
.swatch-danger { background: var(--danger); }
.token-name { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; }
.token-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; margin: 0; font-size: var(--text-sm); }
.token-list dt { color: var(--muted); }
.token-list dd { margin: 0; text-align: right; }
.sample-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.order-sources .source-choice-list { border: 0; padding: 0; margin: 16px 0; min-width: 0; }
.source-choice-list legend { font-weight: 600; margin-bottom: 8px; }
.source-choice-list .source-choice { min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.source-choice input { flex: 0 0 16px; }
.order-sources .source-name { flex: 1; overflow-wrap: anywhere; min-width: 130px; }
.order-sources .source-counts { color: var(--muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }

.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.switch-page .checkbox-label { align-items: flex-start; margin: 16px 0; }
.switch-page .checkbox-label input { flex: 0 0 auto; margin-top: 4px; }
.switch-page #notice-date { max-width: 280px; }
.sync-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 16px 0; }
.sync-summary dt { color: var(--muted); font-size: var(--text-sm); }
.sync-summary dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.switch-page .banner h2 { margin: 0 0 8px; color: inherit; }
.switch-page .banner a { color: inherit; }
.empty-state { text-align: center; padding: 36px 20px; border: 1px dashed var(--control-border); border-radius: var(--radius-md); }
.empty-state svg { width: 30px; height: 30px; color: var(--muted); margin-bottom: 12px; }
.empty-state p { margin: 7px auto 16px; color: var(--muted); max-width: 370px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius-md); padding: 13px 16px; box-shadow: var(--shadow-lg); font-size: var(--text-sm); }
.toast svg { color: var(--success); }
.live-toast { position: fixed; z-index: 30; bottom: 22px; left: calc(50% + 102px); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); }
dialog { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(480px, 100%); max-width: 100%; border: 0; border-left: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: var(--overlay); }
.receipt-confirmation { margin: auto; height: fit-content; max-height: calc(100dvh - 32px); width: min(440px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; overflow: auto; }
.receipt-confirmation p { overflow-wrap: anywhere; }
.receipt-confirmation form, #notice-date-step { display: grid; gap: 8px; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 24px; }
.drawer-body p { margin-bottom: 15px; color: var(--muted); }
.drawer-body .decision-card { margin-bottom: 15px; }
.drawer-body .override-form { grid-template-columns: 1fr 1fr; }
.drawer-body .reason-field { grid-column: 1 / -1; }
.drawer-body .override-form .button { grid-column: 1 / -1; }
.drawer-list { list-style: none; padding: 0; margin: 0; }
.drawer-list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.drawer-list strong { text-align: right; }
.drawer-total { display: flex; align-items: center; justify-content: space-between; margin: 24px 0; padding: 16px 0; border-top: 1px solid var(--border); }
.drawer-total strong { font-size: 22px; text-align: right; }
.full-width { width: 100%; }
.theme-options { display: grid; gap: 10px; }
.theme-options .button { justify-content: flex-start; }
.theme-options [aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

@media (min-width: 1700px) { main { max-width: 1580px; } }
@media (max-width: 1200px) and (min-width: 761px) {
  :root { --sidebar-width: 178px; }
  .brand { padding-left: 18px; }
  main { padding-left: 24px; padding-right: 24px; }
  .stat { padding: 15px; }
  .upload-card { grid-template-columns: 1fr 250px; }
}
@media (max-width: 760px) {
  .sync-summary { grid-template-columns: minmax(0, 1fr); }
  :root { --topbar-height: 58px; }
  .topbar { position: relative; }
  .brand { width: auto; padding: 0 16px; font-size: 16px; }
  .brand-mark { transform: scale(.8); width: 18px; }
  .store { margin-left: auto; padding-left: 13px; font-size: 11px; gap: 6px; }
  .store-icon { display: none; }
  .topbar-actions { margin-left: 7px; padding-right: 10px; gap: 0; }
  .preview-label, .avatar { display: none; }
  .sidebar { position: static; width: 100%; padding: 9px 12px; border-right: 0; border-bottom: 1px solid var(--border); display: block; }
  .nav-label, .sidebar-bottom { display: none; }
  .nav-items { display: flex; gap: 4px; overflow-x: auto; padding: 2px 1px 5px; }
  .nav-link { width: auto; padding: 8px 10px; font-size: 11px; flex: none; gap: 6px; }
  .nav-link svg { width: 14px; height: 14px; }
  .nav-count { display: none; }
  .sidebar .desktop-navigation { display: none; }
  .sidebar .mobile-navigation { display: block; width: 100%; }
  .mobile-navigation summary { cursor: pointer; padding: 10px 12px; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); font-weight: 650; }
  .mobile-navigation summary span { float: right; font-weight: 400; }
  .mobile-navigation-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding-top: 8px; }
  .mobile-navigation-links .nav-link { white-space: normal; min-height: 44px; }
  .merchant-page .mobile-row-action { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 10px; }
  .button-small { min-height: 44px; }
  .mobile-row-action .pill { white-space: normal; text-align: left; }
  .merchant-page .po-lines table { min-width: 0; width: 100%; }
  .po-filters .field, .po-filters .field:has(input) { width: 100%; }
  .merchant-page .po-list > table { min-width: 0; width: 100%; }
  .po-list > table > thead { display: none; }
  .po-list > table > tbody > tr[data-po-row] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 12px; }
  .po-list > table > tbody > tr[data-po-row] > th { grid-column: 1 / -1; }
  .po-list > table > tbody > tr[data-po-row] > :is(th, td) { padding: 0; border: 0; white-space: normal; }
  .po-list td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
  .po-list .po-detail-row > td { display: block; padding: 0 12px 12px; }
  .merchant-page .po-lines thead { display: none; }
  .merchant-page .po-lines tbody tr:has(th) > td { display: none; }
  .merchant-page .po-lines .product-cell:has(.mobile-row-action) { width: auto; max-width: none; }
  .merchant-page .product-cell:has(.mobile-row-action) { min-width: 0; width: 220px; max-width: 240px; white-space: normal; overflow-wrap: anywhere; }
  main { margin-left: 0; padding: 23px 16px; }
  .breadcrumb { margin-bottom: 18px; font-size: 11px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 17px; margin-bottom: 21px; }
  h1 { font-size: 27px; }
  .page-header p { max-width: 330px; font-size: 12px; line-height: 1.6; }
  .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
  .stat { padding: 13px; }
  .stat-label { font-size: 11px; gap: 4px; }
  .stat-value { font-size: 27px; }
  .stat-value.small { font-size: 20px; }
  .stat-foot { font-size: 10px; }
  .banner { align-items: flex-start; flex-wrap: wrap; gap: 9px; padding: 14px; margin-bottom: 20px; }
  .banner > svg { margin-top: 2px; }
  .banner .banner-copy { min-width: 230px; }
  .banner .button { margin-left: 27px; }
  .section-heading { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .toolbar { width: 100%; }
  .search-field { flex: 1; min-width: 0; }
  .search-field input { width: 100%; }
  .toolbar .button { padding: 9px; }
  .supplier-heading { flex-wrap: wrap; gap: 9px; padding: 13px; }
  .supplier-name { flex: 1 1 calc(100% - 48px); }
  .supplier-name h3 { font-size: 12px; }
  .supplier-name p { font-size: 10px; }
  .supplier-total { margin-left: 40px; margin-right: auto; font-size: 13px; }
  .supplier-total small { display: inline; margin-left: 5px; }
  .supplier-footer { flex-direction: column; gap: 3px; padding: 10px 13px; }
  .table-caption { font-size: 10px; }
  .stepper { margin-bottom: 26px; }
  .stepper li { font-size: 10px; gap: 5px; }
  .stepper li:not(:last-child)::after { margin: 0 8px; }
  .step-number { width: 20px; height: 20px; font-size: 9px; }
  .upload-intro h1 { font-size: 26px; }
  .upload-card { grid-template-columns: 1fr; padding: 17px; gap: 14px; }
  .upload-copy p { margin-left: 0; }
  .upload-copy h2 { font-size: 13px; }
  .dropzone { min-height: 108px; }
  .upload-bottom, .upload-action { align-items: flex-start; flex-direction: column; }
  .upload-action .button { width: 100%; }
  .decision-cards, .guide-grid, .sample-fields { grid-template-columns: 1fr; }
  .guide-panel { padding: 17px; }
  .page-footer { flex-wrap: wrap; gap: 8px; }
  .live-toast { left: 50%; }
}
.home { max-width: 1200px; margin: 0 auto; }
.home-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 36px; align-items: center; }
.home .home-eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.home h1 { font-size: clamp(32px, 3.1vw, 46px); line-height: 1.12; margin: 18px 0; }
.home .home-lede { color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 46ch; }
.home-signup { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 24px 0; }
.home-signup .button { min-height: 44px; font-size: 14px; }
.home .home-signup p { margin: 0; }
.home-signup strong { display: block; font-size: 16px; }
.home-signup span:not([aria-hidden]) { display: block; color: var(--muted); font-size: 12px; }
.home .home-fit { max-width: 48ch; color: var(--muted); }
.home-preview { min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.home-preview-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px; background: var(--accent-soft); }
.home .home-preview-heading p, .home .home-preview-heading h2 { margin: 0; }
.home .home-preview-heading h2 { margin-top: 6px; font-size: 18px; }
.home-supplier { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.home .home-supplier p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.home-preview table { min-width: 0; table-layout: fixed; }
.home-preview th, .home-preview td { padding: 12px 16px; font-size: 12px; white-space: normal; position: static; }
.home-preview thead th:first-child { width: 44%; }
.home-preview th[scope="row"] { color: var(--text); background: var(--surface); font-weight: 600; }
.home-preview thead { color: var(--muted); background: var(--surface-subtle); }
.home-sku { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.home-quantity { font-size: 22px; color: var(--accent); }
.home-reason { background: var(--surface-subtle); }
.home .home-preview td p { margin: 5px 0 0; }
.home-decision { color: var(--warning); background: var(--warning-bg); }
.home-preview figcaption { padding: 12px 20px; color: var(--muted); font-size: 12px; }
.home-workflow { margin-top: 36px; }
.home .home-workflow h2 { margin: 0 0 18px; font-size: 22px; }
.home-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.home-benefits li { border-top: 2px solid var(--border); padding-top: 14px; }
.home-benefits h3 { margin-top: 8px; font-size: 16px; }
.home .home-benefits p { color: var(--muted); margin: 8px 0 0; line-height: 1.7; }
.home .home-trust { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .home-hero { grid-template-columns: 1fr; gap: 24px; } .home .home-lede { max-width: 65ch; } }
@media (max-width: 760px) {
  .home-benefits { grid-template-columns: 1fr; gap: 20px; }
  .home-preview-heading, .home-supplier { padding: 16px; }
  .home-preview th, .home-preview td { padding: 10px; }
  .home-preview figcaption { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Dated buyer forecast inputs. */
.seasonal-form { max-width: 48rem; }
.seasonal-form .field { margin-block: 1rem; }
.seasonal-form label { display: block; margin-bottom: .4rem; }
.seasonal-form input:not([type=checkbox]), .seasonal-form select { width: 100%; min-height: 2.75rem; }
.seasonal-form input[type=checkbox] { margin-right: .5rem; }
.seasonal-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.seasonal-list { list-style: none; padding: 0; }
.seasonal-list > li { padding-block: 1rem; border-bottom: 1px solid var(--border); }
.seasonal-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.seasonal-actions form { margin: 0; }
.seasonal-preview { margin-block: 1.5rem; }
.seasonal-explanation ~ p > a { display: inline-block; min-height: 24px; padding-block: 3px; }
.merchant-page .seasonal-preview table { min-width: 0; table-layout: fixed; }
.merchant-page .seasonal-preview th, .merchant-page .seasonal-preview td { position: static; padding: 12px 8px; white-space: normal; overflow-wrap: anywhere; }
.seasonal-preview th:first-child { width: 55%; }
.merchant-page .seasonal-preview tbody th { color: var(--text); background: var(--surface); font-size: var(--text-sm); font-weight: 600; }
@media (max-width: 480px) { .seasonal-dates { grid-template-columns: 1fr; gap: 0; } }

.terms-document { white-space: pre-wrap; overflow-wrap: anywhere; }
