/* Inter, the same typeface as the HBS store. Self-hosted so the portal does not depend on a font CDN. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700 900; font-display: swap; src: url('fonts/inter-700.woff2') format('woff2'); }
/* HBS Distributor Portal — data-dense wholesale account surface.
 *
 * Palette is HBS: deep navy ink, brand navy with a burnt orange accent, and warm paper neutrals.
 * Both themes are authored explicitly rather than filtered, so the dark theme
 * is a real surface (raised panels, muted borders) instead of an inversion.
 */

:root {
  color-scheme: light;

  /* Neutrals — warm, so the tables read as paper rather than screen grey */
  --paper: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --surface-3: #f2f0ec;
  --line: #e3e0d9;
  --line-strong: #cfcbc1;

  /* Ink */
  --ink: #14202b;
  --ink-2: #3d4d5c;
  --ink-3: #6b7a88;

  /* Brand */
  --navy: #041e42;            /* HBS Shopify theme --color-primary */
  --brand: #041e42;
  --brand-ink: #003a70;       /* links: HBS theme --color-header-text */
  --brand-wash: #e6edf6;
  --accent: #b34700;          /* burnt orange: focus, hover and highlights only */

  /* Semantic */
  --ok: #1f6f4a;
  --ok-wash: #e6f2eb;
  --warn: #8a5a12;
  --warn-wash: #fbf1de;
  --danger: #9c2c2c;
  --danger-wash: #f8e9e7;
  --info-wash: #eaeff5;

  --focus: #b34700;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(20, 32, 43, 0.06), 0 1px 1px rgba(20, 32, 43, 0.04);
  --shadow-md: 0 4px 16px rgba(20, 32, 43, 0.10);
  --shadow-lg: 0 24px 60px rgba(20, 32, 43, 0.22);

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;

  --header-h: 60px;
  --nav-h: 46px;
  --maxw: 1400px;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0d1519;
  --surface: #131e24;
  --surface-2: #17242b;
  --surface-3: #1d2c34;
  --line: #26363f;
  --line-strong: #354852;

  --ink: #e8eef0;
  --ink-2: #b3c2c8;
  --ink-3: #8298a1;

  --navy: #031530;
  --brand: #0072ce;           /* HBS theme blue, white text */
  --brand-ink: #7bbdf5;
  --brand-wash: #0f2742;
  --accent: #ff9a4d;

  --ok: #63c295;
  --ok-wash: #122c22;
  --warn: #d9a441;
  --warn-wash: #2e2515;
  --danger: #e08c84;
  --danger-wash: #33201e;
  --info-wash: #16242d;

  --focus: #ff9a4d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.012em; line-height: 1.2; }

a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.9em; letter-spacing: -0.02em; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.muted { color: var(--ink-3); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: top 0.12s ease;
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------------ header */

.masthead {
  position: sticky; top: 0; z-index: 40;
  background: var(--navy);
  color: #f2f5f6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.masthead-inner {
  max-width: var(--maxw); margin: 0 auto;
  height: var(--header-h);
  padding: 0 20px;
  display: flex; align-items: center; gap: 14px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand svg { display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.10em;
  text-transform: uppercase; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.brand-name-short {
  display: none;
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.10em;
  text-transform: uppercase; white-space: nowrap;
}
.brand-sub {
  font-size: var(--text-xs); color: rgba(242, 245, 246, 0.62);
  letter-spacing: 0.04em; white-space: nowrap;
}

.masthead-spacer { flex: 1 1 auto; }

.account-chip {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 5px 12px 5px 6px;
  min-width: 0;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: #ffffff;
  font-size: 11px; font-weight: 750; letter-spacing: 0.02em;
}
.account-chip-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.account-chip-name { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-chip-sub { font-size: 11px; color: rgba(242, 245, 246, 0.58); white-space: nowrap; }

.icon-btn {
  appearance: none; background: rgba(255, 255, 255, 0.07); color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.14);
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer; flex: none;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); }

/* --------------------------------------------------------------------- nav */

.tabs-bar {
  position: sticky; top: var(--header-h); z-index: 35;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tabs {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; gap: 2px; height: var(--nav-h);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: var(--text-sm); font-weight: 560;
  color: var(--ink-3); padding: 0 14px;
  display: inline-flex; align-items: center; gap: 7px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .count {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  background: var(--surface-3); border-radius: 999px; padding: 1px 6px;
}

/* -------------------------------------------------------------------- main */

main { max-width: var(--maxw); margin: 0 auto; padding: 22px 20px 80px; }

.view { display: none; }
.view.is-active { display: block; animation: rise 0.22s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view.is-active { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.view-title { font-size: var(--text-xl); }
.view-sub { font-size: var(--text-sm); color: var(--ink-3); margin-top: 3px; }

/* ------------------------------------------------------------------ stats */

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.075em;
  color: var(--ink-3); font-weight: 600;
}
.stat-value { font-size: var(--text-xl); font-weight: 640; margin-top: 4px; letter-spacing: -0.02em; }
.stat-note { font-size: var(--text-xs); color: var(--ink-3); margin-top: 2px; }

/* ------------------------------------------------------------------ panels */

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.panel-title { font-size: var(--text-sm); font-weight: 650; letter-spacing: 0.01em; }
.panel-body { padding: 14px; }

/* ------------------------------------------------------------- form inputs */

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-size: 11px; font-weight: 650; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--ink-3);
}
input[type='text'], input[type='search'], input[type='number'], textarea, select {
  font: inherit; font-size: var(--text-sm); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 7px 10px; width: 100%;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
textarea { resize: vertical; min-height: 62px; line-height: 1.45; }
input:hover, textarea:hover, select:hover { border-color: var(--ink-3); }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }

.search-wrap { position: relative; flex: 1 1 240px; max-width: 340px; }
.search-wrap svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-wrap input { padding-left: 30px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none; font: inherit; font-size: var(--text-xs); font-weight: 600;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 5px 11px; cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed='true'] {
  background: var(--brand); border-color: var(--brand); color: #ffffff;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  appearance: none; font: inherit; font-size: var(--text-sm); font-weight: 620;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.08s ease;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #ffffff;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
html[data-theme='dark'] .btn-primary:hover { color: #1a0d00; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-sm { padding: 5px 10px; font-size: var(--text-xs); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ tables */

.table-scroll { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: var(--text-sm);
}
table.data th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 9px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data td {
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tbody tr { cursor: pointer; transition: background 0.1s ease; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:focus-visible { background: var(--brand-wash); outline-offset: -2px; }
table.data tbody tr[aria-current='true'] { background: var(--brand-wash); }
table.data tr:last-child td { border-bottom: 0; }
table.data.static tbody tr { cursor: default; }

.cell-strong { font-weight: 620; }
.cell-sub { font-size: var(--text-xs); color: var(--ink-3); }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.01em;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-wash); color: var(--ok); }
.badge-active { background: var(--brand-wash); color: var(--brand-ink); }
.badge-warn { background: var(--warn-wash); color: var(--warn); }
.badge-danger { background: var(--danger-wash); color: var(--danger); }
.badge-neutral { background: var(--surface-3); color: var(--ink-2); }
.badge-plain::before { display: none; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: var(--text-sm); color: var(--ink-2);
  background: var(--surface-2);
}
.notice svg { flex: none; margin-top: 1px; }
.notice-info { background: var(--info-wash); border-left-color: var(--brand); }
.notice-ok { background: var(--ok-wash); border-left-color: var(--ok); color: var(--ink-2); }
.notice-warn { background: var(--warn-wash); border-left-color: var(--warn); }
.notice strong { color: var(--ink); }

/* -------------------------------------------------------- states: loading */

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-row { height: 15px; margin: 12px; }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 46px 24px; color: var(--ink-3);
}
.empty-icon {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-3); margin-bottom: 2px;
}
.empty-title { font-size: var(--text-base); font-weight: 620; color: var(--ink); }
.empty-text { font-size: var(--text-sm); max-width: 42ch; }

/* -------------------------------------------------------------- order rail */

.order-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

.rows-mobile { display: none; }
.row-card {
  width: 100%; text-align: left; appearance: none; font: inherit;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; margin-bottom: 8px;
  display: grid; gap: 6px; cursor: pointer; color: inherit;
}
.row-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ----------------------------------------------------------------- drawer */

.scrim {
  position: fixed; inset: 0; background: rgba(11, 18, 24, 0.5);
  backdrop-filter: blur(2px); z-index: 50; opacity: 0;
  animation: fade 0.16s ease forwards;
}
@keyframes fade { to { opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51;
  width: min(560px, 100%);
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slide-in 0.22s cubic-bezier(0.2, 0.75, 0.3, 1);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }
.drawer-foot {
  padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2);
}

.kv { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 6px 14px; font-size: var(--text-sm); }
.kv dt { color: var(--ink-3); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650; padding-top: 2px; }
.kv dd { margin: 0; }

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); margin: 20px 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-label:first-child { margin-top: 0; }

.addr { font-family: var(--mono); font-size: var(--text-xs); line-height: 1.55; white-space: pre-line; color: var(--ink-2); }

/* --------------------------------------------------------------- reorder */

.reorder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; align-items: start; }

.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.card:hover { border-color: var(--line-strong); }
.thumb {
  aspect-ratio: 4 / 3; background: var(--surface-3);
  display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #ffffff; }
.thumb-fallback {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.card-body { padding: 11px 12px; display: grid; gap: 6px; flex: 1; }
.card-sku { font-family: var(--mono); font-size: var(--text-xs); font-weight: 600; color: var(--brand-ink); letter-spacing: -0.01em; }
.card-desc { font-size: var(--text-sm); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.card-price .amt { font-size: var(--text-lg); font-weight: 650; }
.card-price .per { font-size: var(--text-xs); color: var(--ink-3); }
.card-foot { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px; }

.stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--surface);
}
.stepper button {
  appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-2);
  width: 28px; height: 30px; display: grid; place-items: center;
}
.stepper button:hover { background: var(--surface-3); color: var(--ink); }
.stepper input {
  width: 46px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  border-radius: 0; text-align: center; padding: 5px 2px;
  font-family: var(--mono); font-size: var(--text-sm);
}
.stepper input:focus-visible { box-shadow: none; outline: 2px solid var(--focus); outline-offset: -2px; }

.cart { position: sticky; top: calc(var(--header-h) + var(--nav-h) + 16px); }
.cart-lines { display: grid; }
.cart-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center;
}
.cart-line:last-of-type { border-bottom: 0; }
.cart-line-meta { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; justify-content: space-between; }
.totals { display: grid; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-strong); font-size: var(--text-sm); }
.totals-row { display: flex; justify-content: space-between; }
.totals-row.grand { font-size: var(--text-lg); font-weight: 680; }

/* ---------------------------------------------------------- preview sheet */

.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.sheet {
  position: relative; z-index: 61; width: min(720px, 100%); max-height: min(88vh, 900px);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop 0.2s cubic-bezier(0.2, 0.75, 0.3, 1);
}
@keyframes pop { from { transform: translateY(10px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.sheet-body { padding: 16px 18px; overflow-y: auto; }
.sheet-foot { padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 12px; }

.confirm-box { display: grid; gap: 10px; }
.check-row { display: flex; gap: 9px; align-items: flex-start; font-size: var(--text-sm); }
.check-row input[type='checkbox'] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.type-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; }

.result-block { display: grid; gap: 10px; }
.result-ref {
  font-family: var(--mono); font-size: var(--text-sm); background: var(--surface-3);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 8px 10px; word-break: break-all;
}

/* --------------------------------------------------------------- artwork */

.artwork-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 12px; }
.art-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--text-xs); color: var(--ink-3); }
.filename { font-family: var(--mono); font-size: 11px; line-height: 1.4; word-break: break-all; color: var(--ink-2); }

/* --------------------------------------------------------------- footer */

.foot {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px 40px;
  font-size: var(--text-xs); color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
}
.foot .dot { opacity: 0.5; }

.mode-banner {
  background: var(--warn-wash); color: var(--warn);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  font-size: var(--text-xs); font-weight: 600;
  padding: 7px 20px; text-align: center;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .reorder-layout { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
}

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root { --header-h: 56px; }
  main { padding: 16px 14px 96px; }
  .masthead-inner { padding: 0 14px; gap: 10px; }
  .brand-sub { display: none; }
  .brand-name { display: none; }
  .brand-name-short { display: block; }
  .account-chip-sub { display: none; }
  .account-chip { max-width: 46vw; }
  .tabs { padding: 0 14px; }
  .foot { padding: 0 14px 32px; }

  /* Tables become cards: a 6-column wholesale table cannot be read at 390px,
     and horizontal scrolling hides the columns customers came for. */
  /* Only list tables that ship a card fallback are hidden. The drawer and the
     preview sheet keep their real tables — a reorder preview without line
     items would be a confirmation screen with nothing to confirm. */
  .table-scroll.has-cards { display: none; }
  .rows-mobile { display: block; }
  /* Four money columns must fit 390px without sideways scrolling: on a
     confirmation screen an off-screen Extended column is the one number the
     customer most needs. Fixed layout lets the description wrap instead. */
  .drawer .data, .sheet .data { font-size: var(--text-xs); width: 100%; table-layout: fixed; }
  .drawer .data th, .drawer .data td,
  .sheet .data th, .sheet .data td { padding: 7px 5px; }
  .drawer .data th:nth-child(2), .drawer .data td:nth-child(2),
  .sheet .data th:nth-child(2), .sheet .data td:nth-child(2) { width: 34px; }
  .drawer .data th:nth-child(3), .drawer .data td:nth-child(3),
  .sheet .data th:nth-child(3), .sheet .data td:nth-child(3) { width: 64px; }
  .drawer .data th:nth-child(4), .drawer .data td:nth-child(4),
  .sheet .data th:nth-child(4), .sheet .data td:nth-child(4) { width: 74px; }
  .drawer .data .card-sku, .sheet .data .card-sku { overflow-wrap: anywhere; }

  .drawer { width: 100%; border-left: 0; animation: slide-up 0.22s cubic-bezier(0.2, 0.75, 0.3, 1); }
  @keyframes slide-up { from { transform: translateY(14px); opacity: 0.7; } to { transform: none; opacity: 1; } }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }

  .sheet-wrap { padding: 0; align-items: flex-end; }
  .sheet { max-height: 94vh; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .type-row { grid-template-columns: minmax(0, 1fr); }
  .sheet-actions .btn { flex: 1; }
  .catalog { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .artwork-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .search-wrap { max-width: none; }
}

@media print {
  .masthead, .tabs-bar, .btn, .chips { display: none; }
}

/* Multi-line customer notes keep their line breaks. */
.prewrap { white-space: pre-line; }

/* Real HBS logo (reversed for the navy header). The mark already carries the company name. */
.brand-logo { display: block; flex: none; height: 38px; width: auto; }
.brand-logo + .brand-text { border-left: 1px solid rgba(255, 255, 255, 0.22); padding-left: 12px; }
@media (max-width: 720px) { .brand-logo { height: 34px; } }
