/* Shared tokens. Explicit theme choices take precedence over the system theme. */
:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-subtle: #f0f3ef;
  --surface-hover: #e9eee8;
  --text: #202d25;
  --muted: #606e64;
  --border: #dce3da;
  --control-border: #839083;
  --accent: #285c45;
  --accent-hover: #1c4935;
  --on-accent: #ffffff;
  --accent-soft: #e7f0e5;
  --success: #2d6142;
  --success-bg: #e9f2e9;
  --warning: #805514;
  --warning-bg: #fbf1da;
  --danger: #a13934;
  --danger-bg: #fbecea;
  --info: #455d8e;
  --info-bg: #edf0f9;
  --focus: #275fd2;
  --overlay: #10211766;
  --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 #14241906;
  --shadow-lg: 0 16px 56px #10211726;
  --sidebar-width: 204px;
  --topbar-height: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121914;
    --surface: #1a231d;
    --surface-subtle: #202c24;
    --surface-hover: #2b3a2e;
    --text: #edf2e9;
    --muted: #a9b7aa;
    --border: #344337;
    --control-border: #718571;
    --accent: #b5d8ad;
    --accent-hover: #c9e7c1;
    --on-accent: #193823;
    --accent-soft: #2c412e;
    --success: #b4d9b7;
    --success-bg: #273c2d;
    --warning: #efd08c;
    --warning-bg: #362e1d;
    --danger: #ffb5ab;
    --danger-bg: #402a26;
    --info: #bfcdf5;
    --info-bg: #293249;
    --focus: #a3c5ff;
    --overlay: #070e0bcc;
    --shadow-sm: 0 1px 2px #00000018;
    --shadow-lg: 0 16px 56px #00000055;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121914;
  --surface: #1a231d;
  --surface-subtle: #202c24;
  --surface-hover: #2b3a2e;
  --text: #edf2e9;
  --muted: #a9b7aa;
  --border: #344337;
  --control-border: #718571;
  --accent: #b5d8ad;
  --accent-hover: #c9e7c1;
  --on-accent: #193823;
  --accent-soft: #2c412e;
  --success: #b4d9b7;
  --success-bg: #273c2d;
  --warning: #efd08c;
  --warning-bg: #362e1d;
  --danger: #ffb5ab;
  --danger-bg: #402a26;
  --info: #bfcdf5;
  --info-bg: #293249;
  --focus: #a3c5ff;
  --overlay: #070e0bcc;
  --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(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, a { transition: background-color .15s, color .15s; }
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; }
.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; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; min-height: 36px; border: 1px solid var(--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); }
.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: var(--warning); border-color: currentColor; background: transparent; }
.banner-error { color: var(--danger); background: var(--danger-bg); }
.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-heading { display: flex; align-items: center; gap: 11px; padding: 12px 17px; }
.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); }
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); }
.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; }
.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); }
.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; }
.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; }
.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; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.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); }
.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) {
  :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; }
  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%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
