/* ============================================================
   Cannavate — Store HQ
   Design system v4.1 — dense retail ops
   Ink charcoal + deep olive (distinct from mint/teal SaaS greens).
   ============================================================ */

/* Confirm dialog (app-styled window.confirm replacement) */
.confirm-dialog-overlay { z-index: 320; }
.confirm-dialog-overlay .token-modal-card { width: min(420px, calc(100vw - 32px)); }
.confirm-dialog-text { white-space: pre-line; }

/* Loyalty panel (CRM → Discounts) */
.loyalty-admin-rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.loyalty-admin-rate-controls { display: inline-flex; align-items: center; gap: 8px; }

/* Reports: upcoming toggle */
.reports-upcoming-toggle { margin-top: 14px; text-align: center; }

:root {
  color-scheme: light;

  /* Canvas & surfaces — neutral, no green cast */
  --canvas: #f3f2ef;
  --surface: #ffffff;
  --surface-soft: #f7f6f3;
  --fill: #e9e8e4;
  --fill-strong: #d9d8d3;

  /* Text */
  --ink: #141414;
  --ink-soft: #2e2e2e;
  /* AA+ on canvas/surface at small sizes (muted ~6:1, faint ~4.8:1). */
  --muted: #5b5b5b;
  --faint: #6a6a6a;

  /* Accent — deep olive */
  --accent: #2f3f34;
  --accent-deep: #24322a;
  --accent-bright: #3d5244;
  --accent-tint: rgba(47, 63, 52, 0.1);
  --accent-tint-strong: rgba(47, 63, 52, 0.16);
  /* Text on accent-filled controls: white in light, near-black in dark —
     white on the dark theme's pale sage accent is a 2.9:1 AA failure. */
  --on-accent: #ffffff;

  /* Semantic */
  --danger: #dc2626;
  --danger-tint: rgba(220, 38, 38, 0.1);
  --warn: #b45309;
  --warn-tint: rgba(180, 83, 9, 0.12);
  --info: #4a5568;
  --info-tint: rgba(74, 85, 104, 0.1);
  --ok: #2f3f34;
  --ok-tint: rgba(47, 63, 52, 0.12);

  /* Hairlines */
  --line: rgba(20, 20, 20, 0.12);
  --line-soft: rgba(20, 20, 20, 0.07);
  --line-strong: rgba(20, 20, 20, 0.18);

  /* Quiet fills */
  --fill-quiet: rgba(20, 20, 20, 0.04);
  --fill-quiet-strong: rgba(20, 20, 20, 0.08);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.05), 0 4px 12px rgba(20, 20, 20, 0.04);
  --shadow-md: 0 2px 8px rgba(20, 20, 20, 0.06), 0 12px 28px rgba(20, 20, 20, 0.06);
  --shadow-lg: 0 8px 24px rgba(20, 20, 20, 0.1), 0 24px 48px rgba(20, 20, 20, 0.08);

  /* Shape — soft, not pill-soft. Controls stay architectural. */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-control: 6px;
  --radius-chrome: 5px;

  /* Type */
  --font-display: "Manrope", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;

  --focus-ring: 0 0 0 3px rgba(47, 63, 52, 0.28);

  /* Frosted glass */
  --glass: rgba(255, 255, 255, 0.86);
  --glass-strong: rgba(255, 255, 255, 0.96);
  --glass-blur: saturate(160%) blur(12px);

  /* App chrome — true charcoal */
  --topbar-bg: #141414;
  --topbar-ink: #f3f2ef;
  --topbar-muted: #a8a8a8;
  --topbar-line: rgba(243, 242, 239, 0.14);
  --topbar-fill: rgba(243, 242, 239, 0.08);
  --topbar-fill-strong: rgba(243, 242, 239, 0.14);
  --topbar-accent: #c4b59a;
}

/* ---------- Dark theme ----------
   Toggled by adding .theme-dark to <html>; every component reads these tokens. */

html.theme-dark {
  color-scheme: dark;

  --canvas: #121212;
  --surface: #1a1a1a;
  --surface-soft: #202020;
  --fill: #2a2a2a;
  --fill-strong: #383838;

  --ink: #f3f2ef;
  --ink-soft: #d6d5d1;
  --muted: #a3a3a3;
  --faint: #8f8f8f;

  /* Desaturated sage — not mint */
  --accent: #8a9a8e;
  --on-accent: #121212;
  --accent-deep: #a3b0a6;
  --accent-bright: #a3b0a6;
  --accent-tint: rgba(138, 154, 142, 0.16);
  --accent-tint-strong: rgba(138, 154, 142, 0.26);

  --danger: #ff453a;
  --danger-tint: rgba(255, 69, 58, 0.16);
  --warn: #ff9f0a;
  --warn-tint: rgba(255, 159, 10, 0.16);
  --info: #9aa3ad;
  --info-tint: rgba(154, 163, 173, 0.16);
  --ok: #8a9a8e;
  --ok-tint: rgba(138, 154, 142, 0.16);

  --line: rgba(243, 242, 239, 0.1);
  --line-soft: rgba(243, 242, 239, 0.06);
  --line-strong: rgba(243, 242, 239, 0.18);

  --fill-quiet: rgba(243, 242, 239, 0.07);
  --fill-quiet-strong: rgba(243, 242, 239, 0.14);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.5), 0 32px 80px rgba(0, 0, 0, 0.55);

  --focus-ring: 0 0 0 4px rgba(138, 154, 142, 0.4);

  --glass: rgba(26, 26, 26, 0.72);
  --glass-strong: rgba(32, 32, 32, 0.94);

  --topbar-bg: #0e0e0e;
  --topbar-ink: #f3f2ef;
  --topbar-muted: #9a9a9a;
  --topbar-line: rgba(243, 242, 239, 0.12);
  --topbar-fill: rgba(243, 242, 239, 0.07);
  --topbar-fill-strong: rgba(243, 242, 239, 0.14);
  --topbar-accent: #c4b59a;
}

html.theme-dark ::selection { background: rgba(138, 154, 142, 0.35); }
html.theme-dark .demo-mode-card { background: #2b2517; }
html.theme-dark ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border: 2px solid transparent; background-clip: content-box; }
html.theme-dark ::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.32); background-clip: content-box; }

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
  max-width: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(47, 63, 52, 0.18); }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.03em;
}
p { margin: 0; }

button {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: -0.01em;
  border: 0;
  cursor: pointer;
  color: inherit;
  background: none;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: none; box-shadow: var(--focus-ring); }

input, select, textarea { font-family: inherit; color: var(--ink); letter-spacing: -0.011em; }
input::placeholder,
textarea::placeholder {
  color: var(--faint);
  opacity: 1;
}
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.16); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, 0.28); background-clip: content-box; }

/* ---------- Ambient background — flat ops canvas ---------- */

.app-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--canvas);
}

.app-glow,
.app-grid { display: none; }

/* ---------- Sandbox deployment banner ---------- */

.sandbox-banner {
  position: sticky;
  top: 0;
  z-index: 10000;
  display: block;
  width: 100%;
  margin: 0;
  padding: 7px 14px;
  background: #92400e;
  color: #fffbeb;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}
.sandbox-banner[hidden] { display: none !important; }
html.is-sandbox body { padding-top: 0; }
/* Sandbox strip sits above the shell — keep both inside the viewport. */
body.is-sandbox .sandbox-banner {
  position: relative;
  flex: 0 0 auto;
}

/* ---------- App shell — sidebar layout ---------- */

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--topbar-bg);
  color: var(--topbar-ink);
  border-right: 1px solid var(--topbar-line);
  overflow: hidden auto;
  overscroll-behavior: contain;
  transition: transform 0.22s ease, box-shadow 0.22s ease, width 0.2s ease;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-close {
  display: none;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border-radius: 9px;
  color: var(--topbar-muted);
  background: transparent;
}
.sidebar-close svg { width: 18px; height: 18px; }
.sidebar-close:hover {
  background: var(--topbar-fill);
  color: var(--topbar-ink);
}

.app-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-body {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  /* No top padding — sticky page/section headers pin flush under the topbar. */
  padding: 0 20px 72px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Leading content that isn't a pinned header still needs air under the topbar. */
#content > :first-child:not(.page-head):not(.section-header):not(.inventory-search-panel) {
  margin-top: 16px;
}
#content > .inventory-search-panel:first-child {
  margin-top: 16px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}
.page-head .subtitle { margin-top: 4px; }

/* Pinned page headers — sit flush under the topbar when stuck */
.page-head,
#content > .section-header:first-of-type,
#content > .inventory-search-panel > .section-header:first-child {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 0 14px;
  padding: 12px 8px 12px;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--line);
}

/* When the pinned bar is the first thing on the page, keep a little inner top pad. */
#content > .page-head:first-child,
#content > .section-header:first-of-type:first-child,
#content > .inventory-search-panel:first-child > .section-header:first-child {
  padding-top: 16px;
}

/* Sidebar brand — matches topbar chrome */

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-height: 52px;
  background: transparent;
  color: var(--topbar-ink);
  border-bottom: 1px solid var(--topbar-line);
}

.brand-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-tint);
  border-radius: var(--radius-md);
}
.sidebar-brand .brand-mark {
  color: var(--topbar-accent);
  background: var(--topbar-fill-strong);
}
.brand-mark svg, .brand-mark img, .brand-mark .cn-logo-mark { width: 22px; height: 22px; display: block;
  transform: scale(1.22);
  transform-origin: center;
}

.sidebar-brand-copy { min-width: 0; }
.sidebar-brand h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--topbar-ink);
  line-height: 1.15;
}
.sidebar-brand .eyebrow { color: var(--topbar-muted); }

.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.subtitle { color: var(--muted); font-size: 13px; }

/* Sidebar nav */

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 12px 12px;
  overflow-y: auto;
}

.sidebar-item-row { display: flex; align-items: center; gap: 4px; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--topbar-muted);
  border: 1px solid transparent;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}
a.sidebar-item:visited { color: var(--topbar-muted); }
a.sidebar-item.active:visited { color: var(--topbar-ink); }
/* Soft border on primary destinations — not nested dropdown rows */
.sidebar-item:not(.sidebar-subitem) {
  border-color: color-mix(in srgb, var(--topbar-line) 92%, transparent);
  background: color-mix(in srgb, var(--topbar-fill) 28%, transparent);
}
.sidebar-item:hover { background: var(--topbar-fill); color: var(--topbar-ink); }
.sidebar-item:not(.sidebar-subitem):hover {
  border-color: color-mix(in srgb, var(--topbar-ink) 16%, var(--topbar-line));
}
.sidebar-item.active {
  background: var(--topbar-fill-strong);
  color: var(--topbar-ink);
  font-weight: 600;
}
.sidebar-item:not(.sidebar-subitem).active {
  border-color: color-mix(in srgb, var(--topbar-accent) 50%, var(--topbar-line));
}
.sidebar-item.active:hover { background: var(--topbar-fill-strong); color: var(--topbar-ink); }

.sidebar-icon { flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; }
.sidebar-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-count {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--topbar-fill);
  font-size: 11px;
  font-weight: 600;
  color: var(--topbar-muted);
  font-variant-numeric: tabular-nums;
}
.sidebar-item.active .sidebar-count {
  background: var(--topbar-accent);
  /* Dark text on the tan accent: 9:1. White on it was 2:1. */
  color: var(--topbar-bg, #141414);
}

/* Keep lab chips and non-task summary strips off. */
.lab-chip-count {
  display: none !important;
}
.summary:not(.task-summary):not(.aic-perf-stats):not(.catalog-summary):not(.metric-strip) {
  display: none !important;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.metric-strip .summary-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}
.metric-strip .summary-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.metric-strip .summary-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.metric-strip .summary-note {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.list-count-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0 8px;
  padding: 14px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--line, rgba(0,0,0,0.08));
}
.list-count-footer button {
  font-weight: 600;
}

.sidebar-item-action {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--topbar-muted);
}
.sidebar-item-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-item-action:hover { background: var(--topbar-fill); color: var(--topbar-ink); }

/* Sidebar group flyout (Inventory / Ordering) */

.sidebar-chevron {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--topbar-muted);
}
.sidebar-chevron svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-chevron-flyout { opacity: 0.75; }

.sidebar-group-header[aria-expanded="true"] {
  background: var(--topbar-fill-strong);
  color: var(--topbar-ink);
  border-color: color-mix(in srgb, var(--topbar-accent) 50%, var(--topbar-line));
}

.side-nav-flyout {
  position: fixed;
  z-index: 12060;
  width: min(280px, calc(100vw - 24px));
  padding: 10px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--topbar-line) 80%, #fff);
  background: color-mix(in srgb, var(--topbar-bg, #141414) 96%, #000);
  color: var(--topbar-ink, #f3f2ef);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  animation: side-nav-flyout-in 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
.side-nav-flyout[hidden] { display: none !important; }

.side-nav-flyout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 10px;
}
.side-nav-flyout-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--topbar-muted, rgba(243, 242, 239, 0.7));
}
.side-nav-flyout-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--topbar-muted, rgba(243, 242, 239, 0.7));
  font-size: 18px;
  line-height: 1;
}
.side-nav-flyout-close:hover {
  background: var(--topbar-fill, rgba(255, 255, 255, 0.08));
  color: var(--topbar-ink, #fff);
}

.side-nav-flyout-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--topbar-fill, rgba(255,255,255,0.08)) 70%, transparent);
}

.side-nav-flyout-tab-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.side-nav-flyout-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--topbar-muted, rgba(243, 242, 239, 0.78));
  text-align: left;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}
a.side-nav-flyout-tab:visited { color: var(--topbar-muted, rgba(243, 242, 239, 0.78)); }
a.side-nav-flyout-tab.is-active:visited { color: var(--topbar-ink, #fff); }
.side-nav-flyout-tab:hover {
  background: var(--topbar-fill, rgba(255, 255, 255, 0.1));
  color: var(--topbar-ink, #fff);
}
.side-nav-flyout-tab.is-active {
  background: var(--topbar-fill-strong, rgba(255, 255, 255, 0.14));
  border-color: color-mix(in srgb, var(--topbar-accent, #c4b59a) 55%, transparent);
  color: var(--topbar-ink, #fff);
  font-weight: 650;
}
.side-nav-flyout-tab .sidebar-icon {
  width: 18px;
  height: 18px;
}
.side-nav-flyout-tab .sidebar-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-nav-flyout-tab-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-nav-flyout-count {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--topbar-fill, rgba(255,255,255,0.12)) 90%, transparent);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.side-nav-flyout-tab.is-active .side-nav-flyout-count {
  background: var(--topbar-accent, #c4b59a);
  color: #1a1a1a;
}
.side-nav-flyout-refresh {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--topbar-muted, rgba(243, 242, 239, 0.7));
}
.side-nav-flyout-refresh svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-nav-flyout-refresh:hover {
  background: var(--topbar-fill, rgba(255, 255, 255, 0.1));
  color: var(--topbar-ink, #fff);
}

@keyframes side-nav-flyout-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .side-nav-flyout { animation: none; }
}

body.sidebar-collapsed .sidebar-chevron { display: none; }
body.sidebar-collapsed .sidebar-item:not(.sidebar-subitem) {
  border-color: color-mix(in srgb, var(--topbar-line) 95%, transparent);
  background: color-mix(in srgb, var(--topbar-fill) 40%, transparent);
  border-radius: 11px;
  padding: 9px;
}
body.sidebar-collapsed .sidebar-item:not(.sidebar-subitem).active {
  border-color: color-mix(in srgb, var(--topbar-accent) 55%, var(--topbar-line));
}

/* Reports: inline volume bars inside tables */

.report-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--fill);
  overflow: hidden;
}
.report-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  min-width: 2px;
}

/* Reports: date range control */
.reports-range {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 3px;
  background: var(--fill-quiet);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
}
.reports-range-chip {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.reports-range-chip:hover { color: var(--ink); }
.reports-range-chip.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  border-color: var(--line-soft);
}
.reports-range-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.reports-range-input {
  width: auto;
  min-width: 9.5rem;
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.reports-range-apply {
  margin-right: 2px;
  padding: 6px 12px;
  font-size: 12.5px;
}

/* Reports: default hero chart */

.reports-hero {
  margin: 0 0 8px;
  padding: 18px 18px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--fill)), var(--surface));
}
.reports-hero .summary { margin: 14px 0 8px; }
.reports-chart-panel { display: grid; gap: 10px; }
.reports-chart-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.reports-chart-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.reports-chart-total {
  margin-top: 2px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}
.reports-chart-sub { margin-top: 4px; color: var(--muted); font-size: 0.9rem; }
.reports-chart-wrap {
  overflow-x: visible;
  margin: 0;
  padding: 0;
  max-width: 100%;
  min-width: 0;
}
.reports-sales-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
}
.reports-chart-axis { stroke: color-mix(in srgb, var(--ink) 16%, transparent); stroke-width: 1; }
.reports-chart-grid { stroke: color-mix(in srgb, var(--ink) 8%, transparent); stroke-width: 1; stroke-dasharray: 4 6; }
.reports-chart-area {
  fill: color-mix(in srgb, var(--accent) 16%, transparent);
}
.reports-chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.reports-chart-points circle {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 1.6;
}
.reports-chart-bar {
  fill: var(--accent);
  opacity: 0.9;
  pointer-events: none;
}
.reports-chart-bar-hit {
  fill: transparent;
  cursor: pointer;
}
.reports-chart-bars:hover .reports-chart-bar { opacity: 0.55; }
.reports-chart-bar-hit:hover + .reports-chart-bar { opacity: 1; }
.reports-chart-canvas {
  position: relative;
}
.reports-chart-tip {
  position: absolute;
  z-index: 20;
  min-width: 200px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 28%, transparent);
  pointer-events: none;
  font-size: 0.82rem;
  line-height: 1.35;
}
.reports-chart-tip-day {
  font-weight: 750;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.reports-chart-tip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.reports-chart-tip-grid span,
.reports-chart-tip-row span,
.reports-chart-tip-label {
  color: color-mix(in srgb, var(--surface) 68%, transparent);
  text-transform: capitalize;
}
.reports-chart-tip-grid strong,
.reports-chart-tip-row strong {
  display: block;
  font-weight: 700;
  color: var(--surface);
}
.reports-chart-tip-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--surface) 18%, transparent);
}
.reports-chart-tip-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.reports-chart-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
}
.reports-chart-tip-row strong { display: inline; }
.reports-chart-label {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font-body);
  font-weight: 500;
}
.reports-chart-empty {
  padding: 28px 8px 20px;
  text-align: center;
}
.reports-chart-empty-title {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.reports-chart-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.velocity-chart-bar {
  fill: var(--accent);
  opacity: 0.88;
}
.velocity-chart-bar:hover { opacity: 1; }
.data-table tr.clickable-row:hover td {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

/* Sidebar foot */

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--topbar-line);
}

.sidebar-integration {
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--topbar-fill);
  border: 1px solid var(--topbar-line);
}
.sidebar-integration-title { font-size: 12px; font-weight: 600; color: var(--topbar-ink); }
.sidebar-integration-status { margin-top: 2px; font-size: 12px; font-weight: 600; color: #34d399; }
.sidebar-integration.disconnected .sidebar-integration-status { color: #f87171; }
.sidebar-integration button.primary {
  width: 100%;
  margin-top: 10px;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
}

.sidebar-operator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 0;
}

.sidebar-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--topbar-fill-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--topbar-ink);
}

.sidebar-operator-copy { min-width: 0; }
.sidebar-operator-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--topbar-muted);
  margin-bottom: 3px;
}

.sidebar-operator-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--topbar-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* Collapsed sidebar rail */

body.sidebar-collapsed .app-shell { grid-template-columns: 68px minmax(0, 1fr); }
body.sidebar-collapsed .app-sidebar { overflow: hidden; }
body.sidebar-collapsed .sidebar-brand { padding: 10px 13px; justify-content: center; }
body.sidebar-collapsed .sidebar-brand-copy,
body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .sidebar-count,
body.sidebar-collapsed .sidebar-item-action,
body.sidebar-collapsed .sidebar-integration,
body.sidebar-collapsed .sidebar-operator-copy { display: none; }
body.sidebar-collapsed .sidebar-nav { padding: 6px 13px 12px; }
body.sidebar-collapsed .sidebar-item { justify-content: center; padding: 10px; }
body.sidebar-collapsed .sidebar-foot { align-items: center; }
body.sidebar-collapsed .sidebar-operator { padding: 0; }

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 400;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px clamp(14px, 3vw, 30px);
  background: var(--topbar-bg);
  color: var(--topbar-ink);
  border-bottom: 1px solid var(--topbar-line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.22), 0 10px 28px rgba(15, 23, 42, 0.2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.topbar-left { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; min-width: 0; }
.topbar-left .status-copy { flex: 1; min-width: 0; }
.header-actions { flex: 0 0 auto; }

/* Mobile/drawer: brand lives in the topbar (sidebar is off-canvas). */
.topbar-brand {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: var(--topbar-ink);
  border-radius: 10px;
  padding: 2px 6px 2px 2px;
  margin-left: -2px;
}
.topbar-brand:hover { background: var(--topbar-fill); }
.topbar-brand .brand-mark {
  width: 30px;
  height: 30px;
  color: var(--topbar-accent);
  background: var(--topbar-fill-strong);
}
.topbar-brand .brand-mark svg, .topbar-brand .brand-mark img, .topbar-brand .brand-mark .cn-logo-mark { width: 20px; height: 20px;
  transform: scale(1.22);
  transform-origin: center;
}
.topbar-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.1;
}
.topbar-brand-copy strong {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--topbar-ink);
}
.topbar-brand-store {
  font-size: 11px;
  font-weight: 600;
  color: var(--topbar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

/* Topbar chrome: light controls on dark slate */
.topbar .store-context-name { color: var(--topbar-ink); }
.topbar .store-context-meta,
.topbar .store-context-status { color: var(--topbar-muted); }
.topbar .store-context-sep { color: color-mix(in srgb, var(--topbar-muted) 70%, transparent); }
.topbar .sidebar-toggle { color: var(--topbar-muted); }
.topbar .sidebar-toggle:hover {
  background: var(--topbar-fill-strong);
  color: var(--topbar-ink);
}
.topbar .global-search-field {
  border-color: transparent;
  background: #ffffff;
  color: #6b7280;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.topbar .global-search:focus-within .global-search-field,
.topbar .global-search.is-open .global-search-field {
  border-color: color-mix(in srgb, var(--topbar-accent) 55%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--topbar-accent) 28%, transparent);
  background: #ffffff;
  color: #111827;
}
.topbar .global-search-field input { color: #111827; }
.topbar .global-search-field input::placeholder { color: var(--topbar-muted); }
.topbar .global-search-kbd {
  border-color: rgba(17, 24, 39, 0.1);
  background: rgba(17, 24, 39, 0.04);
  color: #9ca3af;
}
.topbar .station-chip {
  border-color: var(--topbar-line);
  background: var(--topbar-fill);
  color: var(--topbar-ink);
}
.topbar .station-chip-dot { background: var(--topbar-accent); }
.topbar .secondary,
.topbar .subtle-action {
  background: var(--topbar-fill);
  border-color: var(--topbar-line);
  color: var(--topbar-ink);
  border-radius: var(--radius-chrome);
}
.topbar .secondary:hover:not(:disabled),
.topbar .subtle-action:hover:not(:disabled) {
  background: var(--topbar-fill-strong);
  border-color: color-mix(in srgb, var(--topbar-line) 70%, #fff);
  color: var(--topbar-ink);
}
.topbar .profile-menu-trigger {
  border-color: var(--topbar-line);
  background: var(--topbar-fill);
  color: var(--topbar-ink);
}
.topbar .profile-menu-trigger:hover {
  background: var(--topbar-fill-strong);
  border-color: color-mix(in srgb, var(--topbar-line) 70%, #fff);
}
.topbar .profile-menu-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--topbar-accent) 70%, var(--topbar-line));
  box-shadow: none;
  background: var(--topbar-fill-strong);
}
.topbar .profile-menu-avatar {
  /* 45% accent over black keeps white initials at 7.8:1 (82% was 3:1). */
  background: color-mix(in srgb, var(--topbar-accent) 45%, #000);
  color: #fff;
}
.topbar .profile-menu-chevron { color: var(--topbar-muted); }

/* ---------- Global search (always in topbar) ---------- */

.global-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 560px;
  min-width: 160px;
  z-index: 420;
}
.global-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.global-search:focus-within .global-search-field,
.global-search.is-open .global-search-field {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  background: var(--surface);
  color: var(--ink);
}
.global-search-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  opacity: 0.75;
}
.global-search-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 0;
  box-shadow: none !important;
}
.global-search-field input::placeholder { color: var(--faint); font-weight: 500; }
.global-search-field input::-webkit-search-decoration,
.global-search-field input::-webkit-search-cancel-button { display: none; }
.global-search-kbd {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  background: var(--fill-quiet);
  color: var(--faint);
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}
.global-search:focus-within .global-search-kbd { display: none; }

.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(70vh, 480px);
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md, 0 16px 40px rgba(0, 0, 0, 0.14));
  -webkit-overflow-scrolling: touch;
}
.global-search-group {
  padding: 8px 8px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.global-search-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: baseline;
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.global-search-item:hover,
.global-search-item.is-active {
  background: var(--accent-tint, var(--fill-quiet));
}
.global-search-item-title {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-search-item-sub {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-search-item-kind {
  font-size: 11px;
  font-weight: 650;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.global-search-empty,
.global-search-loading {
  padding: 18px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.global-search-hint {
  padding: 8px 10px 4px;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.4;
}

.sidebar-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
}
.sidebar-toggle svg { width: 18px; height: 18px; }
.sidebar-toggle:hover { background: var(--fill); color: var(--ink); }
.topbar .sidebar-toggle:hover {
  background: var(--topbar-fill);
  color: var(--topbar-ink);
}

.theme-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--fill-quiet);
  color: var(--muted);
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle:hover { background: var(--fill-quiet-strong); color: var(--ink); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }
html.theme-dark .theme-toggle .theme-icon-sun { display: block; }
html.theme-dark .theme-toggle .theme-icon-moon { display: none; }

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Top-right chrome controls — shared language for system rollout */
.header-actions > .secondary,
.header-actions > .subtle-action,
.header-actions .page-refresh-btn,
.header-actions .ask-topbar-btn,
.header-actions .station-chip,
.header-actions .demo-mode-indicator,
.header-actions .profile-menu-trigger {
  min-height: 34px;
  height: 34px;
  border-radius: var(--radius-chrome);
  box-shadow: none;
}

.demo-mode-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--warn-tint);
  padding: 0 9px;
  border-radius: var(--radius-chrome);
  border: 1px solid rgba(180, 83, 9, 0.22);
}
.demo-mode-indicator::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--warn);
}

/* ---------- Buttons ---------- */

.primary,
.resolve-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: none;
}
.primary:hover:not(:disabled),
.resolve-btn:hover:not(:disabled) { background: var(--accent-deep); }
.primary:active:not(:disabled),
.resolve-btn:active:not(:disabled) { transform: none; opacity: 0.92; }

.secondary,
.all-dates-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.secondary:hover:not(:disabled),
.all-dates-button:hover:not(:disabled) { background: var(--surface-soft); border-color: var(--line-strong); }
.secondary:active:not(:disabled),
.all-dates-button:active:not(:disabled) { transform: none; }

.danger-action {
  background: var(--danger-tint);
  color: var(--danger);
}
.danger-action:hover:not(:disabled) { background: rgba(255, 59, 48, 0.16); color: #c22a21; }

.subtle-action { background: transparent; color: var(--muted); }
.subtle-action:hover:not(:disabled) { background: var(--fill); color: var(--ink); }

.refresh-action { position: relative; }
.refresh-action.is-refreshing { pointer-events: none; opacity: 0.8; }
.refresh-action.is-refreshing::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}

.page-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  flex: 0 0 auto;
  border-radius: var(--radius-chrome);
}
.page-refresh-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.page-refresh-btn.is-refreshing svg { visibility: hidden; }
.page-refresh-btn.is-refreshing::after {
  position: absolute;
  inset: 0;
  margin: auto;
  border-color: color-mix(in srgb, var(--topbar-ink, currentColor) 28%, transparent);
  border-top-color: var(--topbar-ink, currentColor);
}
.topbar .page-refresh-btn {
  background: var(--topbar-fill);
  border-color: var(--topbar-line);
  color: var(--topbar-ink);
}
.topbar .page-refresh-btn:hover:not(:disabled) {
  background: var(--topbar-fill-strong);
  border-color: color-mix(in srgb, var(--topbar-line) 70%, #fff);
  color: var(--topbar-ink);
}

/* ---------- Status copy & pills ---------- */

.status-copy { display: flex; align-items: center; gap: 9px; min-width: 0; }
.status-copy .subtitle { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: none;
  animation: none;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
button.online-pill { cursor: pointer; }
button.online-pill:hover { background: var(--surface-soft); border-color: var(--line-strong); color: var(--ink); }

/* ---------- Page tabs — segmented control (settings sub-tabs) ---------- */

.page-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 3px;
  margin: 0 0 16px;
  background: var(--fill-quiet);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
}

.tab-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--line-soft);
}
.tab-btn.active:hover { background: var(--surface); color: var(--ink); }

.tab-with-action { display: inline-flex; align-items: center; gap: 2px; }

.tab-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--muted);
}
.tab-refresh-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-refresh-btn:hover { background: var(--surface); color: var(--ink); }

.settings-nested-tabs { margin-top: 2px; }
.settings-nested-tabs .tab-btn { font-size: 12.5px; padding: 7px 12px; }

/* ---------- Settings shell (in-page left rail) ---------- */

.settings-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
}

.settings-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-label {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
}

.settings-nav-item:hover {
  color: var(--ink);
  background: var(--fill-quiet);
}

.settings-nav-item.active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-soft);
  box-shadow: var(--shadow-xs);
}

.settings-nav-empty {
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.settings-panel {
  min-width: 0;
}

.settings-denied strong {
  font-weight: 650;
}

@media (max-width: 820px) {
  .settings-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 8px;
    margin-bottom: 4px;
    background: var(--fill-quiet);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
  }

  .settings-nav-group {
    min-width: 140px;
    flex: 1 1 140px;
  }
}

/* ---------- Summary metrics ---------- */

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 14px;
  margin: 0 0 22px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.summary-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.summary-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--muted);
}

.summary-value {
  margin-top: 6px;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.summary-note { margin-top: 5px; font-size: 12px; color: var(--faint); }

/* ---------- Section headers ---------- */

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 28px 6px 14px;
}

.section-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }

.scroll-note { font-size: 12px; color: var(--faint); }

.task-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.task-filter-toggle:hover { background: var(--surface-soft); border-color: var(--line-strong); }

/* ---------- Task / list cards (dense ops rows) ---------- */

.task-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.problem {
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  animation: none;
}
.problem:hover { transform: none; box-shadow: none; border-color: var(--line-strong); background: var(--surface); }

.problem-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rank {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}

.product { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.product-subtitle { margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }

.status-pill {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--fill-quiet);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  white-space: nowrap;
}
.status-pill.high { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.status-pill.medium { background: var(--warn-tint); color: var(--warn); border-color: transparent; }

/* --- Platform admin dashboard --- */
.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 2px 22px;
}
.admin-h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
}
.admin-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.admin-scanner-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.admin-scanner-video-wrap {
  position: relative;
  background: #0f1410;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 280px;
  aspect-ratio: 16 / 10;
}
.admin-scanner-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0f1410;
}
.admin-scanner-frame {
  position: absolute;
  inset: 14% 18%;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.admin-scanner-result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.admin-scanner-value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  word-break: break-all;
  line-height: 1.35;
}
.admin-scanner-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.admin-scanner-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.admin-scanner-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-scanner-history li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg, #f7f6f3);
}
@media (max-width: 900px) {
  .admin-scanner-stage { grid-template-columns: 1fr; }
}
.admin-loading, .admin-empty, .admin-error {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.admin-page {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.admin-page .admin-head,
.admin-page .problem-header,
.admin-page .section-header {
  min-width: 0;
}
.admin-page .problem-header {
  flex-wrap: wrap;
}
.admin-page .admin-actions-cell {
  max-width: 100%;
}
.admin-page .lab-tabs {
  min-width: 0;
}
.admin-page .summary {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
}
.admin-responsive-list {
  min-width: 0;
  max-width: 100%;
}
.admin-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}
.admin-entity-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 14px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-entity-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.admin-entity-card-title-block {
  min-width: 0;
  flex: 1 1 auto;
}
.admin-entity-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
  flex: 0 0 auto;
}
.admin-entity-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  min-width: 0;
}
@media (min-width: 900px) {
  .admin-entity-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1200px) {
  .admin-entity-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.admin-entity-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-entity-field-wide {
  grid-column: 1 / -1;
}
.admin-entity-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.admin-entity-value {
  font-size: 13px;
  color: var(--ink);
  min-width: 0;
}
.admin-entity-value-wrap {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.admin-entity-value .admin-plan-select {
  max-width: 100%;
  width: 100%;
}
.admin-entity-value .admin-price-cell {
  flex-wrap: nowrap;
  width: 100%;
}
.admin-entity-value .admin-price-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 140px;
}
.admin-error { color: var(--danger); }
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: 8px;
  max-width: 100%;
  min-width: 0;
  container-type: inline-size;
  container-name: hq-table;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: top;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-plan-select {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Customer management */
.admin-price-cell { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.admin-price-input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.admin-mini-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.admin-mini-btn:hover { filter: brightness(0.97); }
.admin-mini-btn.active {
  background: var(--accent-tint);
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.admin-mini-revoke { color: #b42318; border-color: #f3c6c0; background: #fdf1ef; }
.admin-mini-activate { color: #067647; border-color: #bbe7ce; background: #edfaf2; }
.admin-mini-view { color: var(--on-accent); border-color: var(--accent); background: var(--accent); }
.admin-mini-view:hover { background: var(--accent-deep); border-color: var(--accent-deep); filter: none; }
.admin-actions-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-row-suspended { opacity: 0.62; }
.admin-total-row td { font-weight: 700; border-top: 1px solid var(--line); }

/* Sandbox Admin → Team board */
.team-board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 960px) {
  .team-board-grid { grid-template-columns: 1fr; }
}
.team-board-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.team-board-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.team-board-form input,
.team-board-form textarea,
.team-board-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
.team-board-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.team-board-form-row select { flex: 1 1 140px; }
.team-board-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.team-board-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}
.team-board-card.muted { opacity: 0.78; }
.team-board-card-top {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.team-board-card-title {
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 4px;
}
.team-board-card-notes {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: pre-wrap;
  margin-bottom: 6px;
}
.team-board-card-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.team-board-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.team-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  background: var(--fill);
  color: var(--ink-soft);
  text-transform: capitalize;
}
.team-pill.priority-p0 { background: #fde8e8; color: #b42318; }
.team-pill.priority-p1 { background: #fff4e5; color: #b54708; }
.team-pill.priority-p2 { background: var(--fill); color: var(--ink-soft); }
.team-pill.status-in_progress,
.team-pill.status-waiting { background: var(--info-tint); color: var(--info); }
.team-pill.status-done,
.team-pill.shipped { background: #edfaf2; color: #067647; }
.team-pill.rejected { background: #fdf1ef; color: #b42318; }
.team-board-recent {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
}
.team-board-recent summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-soft);
}
.team-board-recent .team-board-card { margin-top: 8px; }

/* Ordering action menus + section CTAs */
.ordering-page .ord-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ordering-page .ord-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ordering-page .ord-btn:hover:not(:disabled) {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}
.ordering-page .ord-btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.ordering-page .ord-btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.ordering-page .ord-btn:disabled { opacity: 0.55; cursor: default; }

.ord-card-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ord-menu {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}
.ord-menu-trigger {
  appearance: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.ord-menu-trigger:hover,
.ord-menu-trigger[aria-expanded="true"] {
  color: var(--ink);
  background: var(--fill-quiet);
  border-color: var(--line);
}
.ord-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 168px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md, 0 12px 28px rgba(0, 0, 0, 0.12));
}
.ord-menu-panel[hidden] { display: none !important; }
.ord-menu-item {
  appearance: none;
  width: 100%;
  display: block;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.ord-menu-item:hover:not(:disabled) { background: var(--fill-quiet); }
.ord-menu-item.is-danger { color: var(--danger, #b42318); }
.ord-menu-item.is-danger:hover:not(:disabled) {
  background: var(--danger-tint, #fdf1ef);
}
.ord-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.ord-orders-table .ord-order-row td {
  vertical-align: middle;
}
.ord-orders-table .ord-order-row.is-expanded,
.ord-orders-table .ord-order-row.is-menu-open {
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 55%, var(--surface));
}
.ord-order-ref-cell {
  position: relative;
}
.ord-menu-panel.is-fixed {
  position: fixed;
  right: auto;
  z-index: 12050;
}
.ord-orders-table .ord-order-detail-row > td {
  padding: 0 12px 14px;
  background: var(--surface-soft, var(--fill-quiet));
  border-bottom: 1px solid var(--line);
}
.ord-order-detail {
  padding: 10px 4px 4px;
}
.ord-order-detail .admin-table-wrap {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.sidebar-item.sidebar-exit-view { color: var(--topbar-accent); font-weight: 600; }
.sidebar-item.sidebar-exit-view:hover { background: var(--topbar-fill); color: var(--topbar-accent); }

/* Revenue */
.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.admin-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.admin-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; }
.admin-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.admin-bar-fill { width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.admin-bar-label { font-size: 10px; color: var(--muted); }
.admin-pay-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  align-items: end;
}
.admin-pay-form .lab-field { margin-bottom: 0; }
.admin-pay-form .lab-field-wide { grid-column: span 2; }
.admin-pay-submit { align-self: end; height: 40px; }

@media (max-width: 860px) {
  .admin-two-col { grid-template-columns: 1fr; }
  .admin-pay-form { grid-template-columns: 1fr 1fr; }
  .admin-pay-form .lab-field-wide { grid-column: span 2; }
}
.admin-table tbody tr:hover { background: var(--surface-soft); }
.admin-cell-title { font-weight: 600; color: var(--ink); }
.admin-muted { color: var(--faint); font-size: 12px; }
.admin-message { max-width: 360px; white-space: pre-wrap; color: var(--muted); }
.admin-yes { color: var(--accent); font-weight: 600; }
.admin-no { color: var(--faint); }
@media (max-width: 720px) {
  .admin-head { flex-direction: column; }
  .admin-message { max-width: 220px; }
}

/* --- Lab / Potency dashboard --- */
.lab-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.lab-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.lab-card-wide { grid-column: span 2; }
.lab-card-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.lab-card-wide .lab-card-value { font-size: 16px; line-height: 1.3; }
.lab-card-label { margin-top: 4px; color: var(--muted); font-size: 12px; }
.lab-corr-pos { color: var(--accent); }
.lab-corr-neg { color: var(--danger); }
.lab-corr-neutral { color: var(--faint); }
.lab-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.lab-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lab-tab.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.lab-table + input, input#labSearchInput { margin-bottom: 12px; }
#labSearchInput { margin-bottom: 14px; }
.lab-bar {
  display: inline-block;
  vertical-align: middle;
  width: 70px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-soft);
  overflow: hidden;
  margin-left: 6px;
}
.lab-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.lab-spread-flag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--warn-tint);
  color: var(--warn);
  font-size: 11px;
  font-weight: 600;
}
.lab-batch-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.lab-head-actions { display: flex; gap: 8px; align-items: center; }

/* Category filter chips */
.lab-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.lab-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.lab-chip:hover { background: var(--surface-soft); color: var(--ink); }
.lab-chip.active { background: var(--accent-tint-strong); border-color: var(--accent); color: var(--accent-deep); }
.lab-chip-count { font-size: 10.5px; color: var(--faint); font-weight: 600; }
.lab-chip.active .lab-chip-count { color: var(--accent-deep); opacity: 0.75; }

/* Tab alert badge */
.lab-tab-badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 17px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--warn-tint);
  color: var(--warn);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}
.lab-tab.active .lab-tab-badge { background: rgba(255, 255, 255, 0.25); color: #fff; }

.lab-chem-upload { margin-bottom: 16px; }
.lab-chem-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.lab-chem-upload-row .capacity-input { flex: 1 1 220px; min-width: 180px; }
.lab-file-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.lab-chem-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--surface);
}
.lab-chem-matches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.lab-chem-manual {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Devices: per-station printers + behavior */
.devices-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.devices-station-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 8px;
}
.devices-station-group-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 6px 2px;
}
.devices-station-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.devices-station-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.devices-station-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 55%, var(--surface));
}
.devices-station-btn-label {
  font-size: 13.5px;
  font-weight: 700;
}
.devices-station-btn-meta {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.devices-field-label {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
@media (max-width: 820px) {
  .devices-layout {
    grid-template-columns: 1fr;
  }
  .devices-station-list {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .devices-station-group {
    flex: 1 1 100%;
  }
  .devices-station-btn {
    width: auto;
    min-width: 120px;
  }
}

/* Hardware printer modes */
.hardware-mode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.hardware-mode-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  cursor: pointer;
}
.hardware-mode-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 55%, var(--surface));
}
.hardware-mode-option input {
  margin-top: 3px;
}
.hardware-mode-option strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}
.hardware-mode-note {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}
.hardware-advanced {
  margin-top: 4px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--fill-quiet);
  border: 1px solid var(--line-soft);
}

/* Home — feature spotlight (commercial banner) */
.home-feature-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(168px, 22vw, 220px);
  margin: 0 0 14px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: var(--shadow-md);
  color: #f6f3ec;
}
.home-feature-banner-media {
  position: absolute;
  inset: 0;
  background: #1a221c center/cover no-repeat;
  transform: scale(1.02);
}
.home-feature-banner-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      105deg,
      rgba(14, 18, 15, 0.92) 0%,
      rgba(14, 18, 15, 0.78) 38%,
      rgba(14, 18, 15, 0.28) 68%,
      rgba(14, 18, 15, 0.08) 100%
    ),
    linear-gradient(to top, rgba(14, 18, 15, 0.45) 0%, transparent 42%);
  pointer-events: none;
}
.home-feature-banner-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 22px);
  padding: clamp(16px, 2.4vw, 26px) clamp(16px, 2.6vw, 28px);
  padding-right: 48px;
  max-width: 720px;
}
.home-feature-stamp {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(246, 243, 236, 0.72);
  background: rgba(20, 28, 22, 0.42);
  box-shadow:
    0 0 0 4px rgba(14, 18, 15, 0.28),
    inset 0 0 0 1px rgba(246, 243, 236, 0.18);
  transform: rotate(-7deg);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.home-feature-stamp img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.home-feature-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.home-feature-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 243, 236, 0.72);
}
.home-feature-title {
  margin: 0;
  font-size: clamp(22px, 3.1vw, 30px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #fbf8f1;
  text-wrap: balance;
}
.home-feature-blurb {
  margin: 0;
  max-width: 38rem;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(246, 243, 236, 0.82);
  text-wrap: pretty;
}
.home-feature-cta {
  justify-self: start;
  margin-top: 8px;
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #f6f3ec;
  color: #1a221c;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, background 0.16s ease;
}
.home-feature-cta:hover {
  background: #ffffff;
  transform: translateY(-1px);
}
.home-feature-cta:focus-visible {
  outline: 2px solid #f6f3ec;
  outline-offset: 3px;
}
.home-feature-banner-dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(246, 243, 236, 0.28);
  border-radius: 999px;
  background: rgba(14, 18, 15, 0.42);
  color: rgba(246, 243, 236, 0.88);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.home-feature-banner-dismiss:hover {
  background: rgba(14, 18, 15, 0.62);
  color: #fff;
}
.home-feature-banner-dismiss:focus-visible {
  outline: 2px solid #f6f3ec;
  outline-offset: 2px;
}
@media (max-width: 720px) {
  .home-feature-banner { min-height: 0; }
  .home-feature-banner-body {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 44px;
  }
  .home-feature-stamp {
    width: 56px;
    height: 56px;
    transform: rotate(-5deg);
  }
  .home-feature-stamp img { width: 34px; height: 34px; }
  .home-feature-blurb { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-feature-cta { transition: none; }
  .home-feature-cta:hover { transform: none; }
}

/* Home — Store Command Center */
.page-head.home-hero,
#content > .page-head.home-hero:first-child {
  position: static;
  z-index: auto;
  margin: 0 0 12px;
  padding: 8px 0 4px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}
.page-head.home-hero h1 {
  font-size: clamp(28px, 3.6vw, 36px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.page-head.home-hero .subtitle {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}
.page-head.home-hero .page-head-actions .primary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
#content.hq-page-enter {
  animation: hqPageEnter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes hqPageEnter {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  #content.hq-page-enter { animation: none; }
}

.home-enter {
  animation: homeEnter 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes homeEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .home-enter { animation: none; }
}

.home-command {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 14px;
  align-items: stretch;
}

.home-panel {
  min-width: 0;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 92%, var(--fill-quiet));
}

.home-panel-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
  margin-bottom: 10px;
}

.home-panel-today {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.home-today-sales {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.home-today-sales:hover .home-today-total {
  color: var(--accent);
}
.home-today-total {
  font-size: clamp(40px, 5.5vw, 56px);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  transition: color 0.15s ease;
}
.home-today-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.home-today-queue {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 2px 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease;
}
.home-today-queue:hover .home-today-queue-label {
  color: var(--accent);
}
.home-today-queue-label {
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
}

.home-floor-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-floor-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.home-floor-row:hover {
  background: var(--fill-quiet);
}
.home-floor-row-static {
  cursor: default;
}
.home-floor-row-static:hover { background: transparent; }
.home-floor-label {
  grid-column: 1;
  grid-row: 1;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
}
.home-floor-value {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-align: right;
}
.home-floor-value-soft {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  max-width: 11rem;
  line-height: 1.25;
}
.home-floor-note {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
  color: var(--muted);
}

.home-skel {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--fill-quiet) 0%, color-mix(in srgb, var(--fill-quiet) 40%, var(--surface)) 50%, var(--fill-quiet) 100%);
  background-size: 200% 100%;
  animation: homeSkel 1.1s ease-in-out infinite;
}
.home-skel-value { width: 58%; height: 28px; margin-bottom: 10px; }
.home-skel-today { width: 70%; height: 52px; margin-bottom: 12px; }
.home-skel-note { width: 70%; height: 10px; }
@keyframes homeSkel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .home-skel { animation: none; }
}

.home-panel-insight {
  margin: 8px 0 8px;
  position: relative;
  padding: 14px 16px;
  border-color: transparent;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.home-insight-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.home-insight-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.home-insight-title strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.home-insight-title span {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
}
.home-insight-title:hover strong { color: var(--accent); }
.home-insight-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.home-insight-customize {
  position: relative;
}
.home-insight-gear {
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 650;
}
.home-insight-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: min(280px, 78vw);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md, 0 12px 28px rgba(0, 0, 0, 0.12));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home-insight-menu-head {
  padding: 6px 8px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.home-insight-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.home-insight-option:hover {
  background: var(--fill-quiet);
}
.home-insight-option.is-active {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 55%, var(--surface));
}
.home-insight-option strong {
  font-size: 13.5px;
  font-weight: 700;
}
.home-insight-option span {
  font-size: 12px;
  color: var(--muted);
}
.home-insight-chart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px 28px;
  align-items: center;
}
.home-insight-donut {
  position: relative;
  width: 176px;
  height: 176px;
  flex: 0 0 auto;
}
.home-insight-donut svg {
  display: block;
  transform: rotate(-0.001deg); /* crisp joins */
  overflow: visible;
}
.home-insight-arc-track {
  pointer-events: none;
}
.home-insight-arc {
  pointer-events: stroke;
  cursor: pointer;
  transition:
    stroke-width 0.18s ease,
    opacity 0.18s ease,
    filter 0.18s ease;
}
.home-insight-chart.is-hovering .home-insight-arc.is-dimmed {
  opacity: 0.22;
}
.home-insight-chart.is-hovering .home-insight-arc.is-active {
  stroke-width: 28;
  opacity: 1;
  filter: brightness(1.08);
}
.home-insight-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 28px;
}
.home-insight-donut-center strong {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  max-width: 7.5rem;
  transition: color 0.15s ease;
}
.home-insight-donut-center span {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-insight-chart.is-hovering .home-insight-donut-center span {
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-soft);
}
.home-insight-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.home-insight-legend-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--fill-quiet) 65%, transparent);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
.home-insight-legend-row:hover,
.home-insight-legend-row.is-active {
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 70%, var(--surface));
  transform: translateX(2px);
}
.home-insight-chart.is-hovering .home-insight-legend-row.is-dimmed {
  opacity: 0.38;
}
.home-insight-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--insight-tone, var(--accent)) 18%, var(--surface));
  color: var(--insight-tone, var(--accent));
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.home-insight-legend-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-insight-legend-copy strong {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-insight-legend-copy span {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}
.home-insight-value {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
.home-insight-empty {
  padding: 18px 4px 6px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
}
.home-insight-skel {
  padding-top: 4px;
}
@media (max-width: 720px) {
  .home-insight-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .home-insight-legend { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .home-insight-arc,
  .home-insight-legend-row,
  .home-insight-donut-center strong { transition: none; }
  .home-insight-legend-row:hover,
  .home-insight-legend-row.is-active { transform: none; }
}

@media (max-width: 960px) {
  .home-command { grid-template-columns: 1fr; }
  .home-panel-today { min-height: 0; }
  .home-today-queue { margin-top: 16px; }
}

/* Catalog column settings (POS-style) */
.catalog-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 8px;
  min-height: 32px;
}
.catalog-table-toolbar-label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.catalog-columns { position: relative; }
.catalog-settings-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.catalog-settings-btn:hover,
.catalog-settings-btn[aria-expanded="true"] {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 45%, var(--surface));
}
.catalog-settings-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.catalog-columns-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: min(280px, calc(100vw - 32px));
  max-height: 380px;
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md, 0 12px 28px rgba(0,0,0,0.12));
}
.catalog-columns-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 6px;
}
.catalog-columns-menu-head strong {
  font-size: 13px;
  font-weight: 700;
}
.catalog-columns-reset {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 2px 4px;
}
.catalog-columns-menu-hint {
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 4px 8px;
}
.catalog-col-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.catalog-col-option:hover { background: var(--fill-quiet); }
.catalog-col-option.is-required { opacity: 0.85; }
.catalog-col-option.is-hidden { opacity: 0.72; }
.catalog-col-option.is-draggable { cursor: grab; }
.catalog-col-option.is-draggable:active { cursor: grabbing; }
.catalog-col-option.is-dragging {
  opacity: 0.45;
  background: var(--fill-quiet);
}
.catalog-col-option.drag-over {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 55%, var(--surface));
}
.catalog-col-drag {
  flex: 0 0 auto;
  width: 16px;
  text-align: center;
  font-size: 11px;
  letter-spacing: -1px;
  color: var(--muted);
  user-select: none;
  line-height: 1;
  opacity: 0.35;
}
.catalog-col-option.is-draggable .catalog-col-drag { opacity: 0.7; }
.catalog-col-option.is-hidden .catalog-col-drag,
.catalog-col-option.is-required .catalog-col-drag { opacity: 0.2; }
.catalog-col-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
  flex: 1;
}
.catalog-col-option.is-required .catalog-col-check { cursor: default; }
.catalog-col-check input { margin: 0; }

/* Catalog product list: name-only rows on mobile, menu to edit / expand */
.catalog-row-name {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.catalog-row-chevron {
  display: none;
  flex: 0 0 auto;
  width: 0.55em;
  height: 0.55em;
  margin-top: 0.45em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.catalog-row-name-text { min-width: 0; flex: 1; }
.catalog-fifo-hint {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.35;
  color: var(--accent-deep);
  opacity: 0.92;
}
.catalog-fifo-note {
  margin: 0 0 10px;
  font-size: 13px;
}
.catalog-product-row.card-menu {
  position: relative;
}
.catalog-row-menu-host {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 0;
  height: 0;
  overflow: visible;
  z-index: 40;
  flex: none;
  align-self: auto;
}
.catalog-row-menu-host .card-menu-list {
  right: 0;
  left: auto;
  top: 0;
  min-width: 168px;
  z-index: 50;
}
.catalog-product-row.card-menu.open {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow-sm);
}

@media (max-width: 900px) {
  .catalog-products-table .catalog-row-chevron { display: inline-block; }
  .catalog-products-table tbody tr.catalog-product-row.is-expanded .catalog-row-chevron {
    transform: rotate(45deg);
    margin-top: 0.35em;
  }
  .catalog-products-table tbody tr.catalog-product-row:not(.is-expanded) td:not(:first-child) {
    display: none !important;
  }
  .catalog-products-table tbody tr.catalog-product-row:not(.is-expanded) td:first-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .catalog-products-table tbody tr.catalog-product-row:not(.is-expanded) .catalog-row-sub {
    display: none;
  }
  .catalog-products-table tbody td:first-child {
    position: relative;
    padding-right: 12px;
  }
  .catalog-row-menu-host {
    top: auto;
    right: 0;
    left: 0;
    position: relative;
    width: auto;
    height: auto;
    margin-top: 8px;
  }
  .catalog-product-row.card-menu.open .catalog-row-menu-host .card-menu-list,
  .catalog-row-menu-host.open .card-menu-list {
    position: relative;
    top: 0;
    right: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    box-shadow: var(--shadow-md, 0 8px 20px rgba(0,0,0,0.1));
  }
}

.product-custom-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-custom-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1.4fr) auto;
  gap: 8px;
  align-items: center;
}

/* Sortable table headers — 3-state: asc → desc → neutral */
.th-sort,
.lab-th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sort:hover,
.lab-th-sort:hover { color: var(--ink); }
.th-sort-active,
.lab-th-active { color: var(--accent-deep); }
.th-sort-label { vertical-align: baseline; }
.th-sort-arrow,
.lab-sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  line-height: 1;
  min-width: 0.9em;
  opacity: 0.35;
  font-weight: 700;
}
.th-sort-active .th-sort-arrow,
.lab-th-active .lab-sort-arrow {
  opacity: 1;
  color: var(--accent-deep, var(--accent));
}
.th-sort:hover .th-sort-arrow { opacity: 0.75; }

/* HQ table column drag-reorder (Sheets-style) */
.admin-table thead th.th-col-drag,
.data-table thead th.th-col-drag,
.admin-table-wrap table thead th.th-col-drag,
.data-table-wrap table thead th.th-col-drag {
  cursor: grab;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
body.hq-col-reorder-armed,
body.hq-col-reorder-armed * {
  user-select: none !important;
  -webkit-user-select: none !important;
}
body.hq-col-reorder-dragging,
body.hq-col-reorder-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.admin-table.is-col-dragging tbody td:nth-child(var(--hq-drag-col)),
.data-table.is-col-dragging tbody td:nth-child(var(--hq-drag-col)),
.admin-table-wrap table.is-col-dragging tbody td:nth-child(var(--hq-drag-col)),
.data-table-wrap table.is-col-dragging tbody td:nth-child(var(--hq-drag-col)),
.admin-table.is-col-dragging thead th:nth-child(var(--hq-drag-col)),
.data-table.is-col-dragging thead th:nth-child(var(--hq-drag-col)),
.admin-table-wrap table.is-col-dragging thead th:nth-child(var(--hq-drag-col)),
.data-table-wrap table.is-col-dragging thead th:nth-child(var(--hq-drag-col)) {
  opacity: 0.35;
  background: color-mix(in srgb, var(--accent, #2f6f4e) 8%, var(--surface, #fff));
}
.admin-table.is-col-dragging thead th.th-col-dragging,
.data-table.is-col-dragging thead th.th-col-dragging,
.admin-table-wrap table.is-col-dragging thead th.th-col-dragging {
  opacity: 0.35;
}
.admin-table thead th.th-col-drop-before::before,
.data-table thead th.th-col-drop-before::before,
.admin-table-wrap table thead th.th-col-drop-before::before,
.data-table-wrap table thead th.th-col-drop-before::before,
.admin-table thead th.th-col-drop-after::after,
.data-table thead th.th-col-drop-after::after,
.admin-table-wrap table thead th.th-col-drop-after::after,
.data-table-wrap table thead th.th-col-drop-after::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent-deep, var(--accent, #2f6f4e));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #2f6f4e) 35%, transparent);
  pointer-events: none;
  z-index: 2;
}
.admin-table thead th.th-col-drop-before::before,
.data-table thead th.th-col-drop-before::before,
.admin-table-wrap table thead th.th-col-drop-before::before,
.data-table-wrap table thead th.th-col-drop-before::before {
  left: -1px;
}
.admin-table thead th.th-col-drop-after::after,
.data-table thead th.th-col-drop-after::after,
.admin-table-wrap table thead th.th-col-drop-after::after,
.data-table-wrap table thead th.th-col-drop-after::after {
  right: -1px;
}

/* Floating column preview while dragging */
.hq-col-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 12050;
  pointer-events: none;
  will-change: transform;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface, #fff);
  border: 1px solid color-mix(in srgb, var(--accent, #2f6f4e) 45%, var(--line, #ddd));
  box-shadow:
    0 12px 28px rgba(20, 20, 20, 0.18),
    0 2px 6px rgba(20, 20, 20, 0.08);
  transform: translate3d(-9999px, -9999px, 0);
  opacity: 0.97;
}
.hq-col-drag-ghost-head {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink, #141414);
  background: color-mix(in srgb, var(--accent, #2f6f4e) 12%, var(--surface, #fff));
  border-bottom: 1px solid var(--line-soft, rgba(20, 20, 20, 0.08));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hq-col-drag-ghost-body {
  display: grid;
  background: var(--surface, #fff);
}
.hq-col-drag-ghost-cell {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--ink-soft, #2e2e2e);
  border-bottom: 1px solid var(--line-soft, rgba(20, 20, 20, 0.06));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 30px;
}
.hq-col-drag-ghost-cell:last-child { border-bottom: 0; }
.hq-col-drag-ghost-cell.is-empty { color: var(--faint, #999); }

@container hq-table (max-width: 780px) {
  .admin-table thead th.th-col-drag,
  .data-table thead th.th-col-drag {
    cursor: default;
  }
}

.lab-cat-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--fill-quiet, var(--surface-soft));
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Potency-shift alerts */
.lab-alerts {
  border: 1px solid var(--warn);
  background: var(--warn-tint);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.lab-alerts-title { font-size: 13px; font-weight: 700; color: var(--warn); margin-bottom: 10px; }
.lab-alert-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.lab-alert-row:first-of-type { border-top: 0; }
.lab-alert-delta { min-width: 74px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.lab-alert-up { color: var(--accent-deep); }
.lab-alert-down { color: var(--danger); }
.lab-alert-main { min-width: 0; }
.lab-alert-more { margin-top: 8px; font-size: 12px; }

/* Show more */
.lab-show-more-wrap { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.lab-show-more { font-size: 12.5px; }

/* Batch variation cards */
.lab-batch-list { display: grid; gap: 14px; }
.lab-batch-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: visible;
  min-width: 0;
}
.lab-batch-head { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); background: var(--surface-soft); }
.lab-batch-head .admin-muted { margin-top: 2px; }
.lab-batch-card .admin-table-wrap, .lab-batch-card .admin-table { border: 0; border-radius: 0; }
.lab-batch-corr { margin-left: 6px; font-weight: 600; font-size: 11px; }

/* Predictor */
.lab-predict {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}
.lab-predict-note { grid-column: 1 / -1; }
.lab-predict-form, .lab-predict-result, .lab-predict-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.lab-predict-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.lab-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.lab-field span { font-size: 12px; font-weight: 600; color: var(--muted); }
.lab-field input, .lab-field select {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
}
.lab-predict-result { display: flex; flex-direction: column; justify-content: center; }
.lab-predict-big { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; color: var(--accent); line-height: 1; }
.lab-predict-big span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.lab-predict-sub { margin-top: 10px; font-size: 13px; font-weight: 600; }
.lab-predict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.lab-predict-metric { font-size: 22px; font-weight: 700; color: var(--ink); }
.lab-predict-metriclabel { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lab-predict-note-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.lab-predict-note { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Order planner */
.lab-field-hint { font-size: 11.5px; color: var(--faint); font-style: normal; }
.lab-verdict {
  align-self: flex-start;
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 14px;
}
.lab-verdict-good { background: rgba(52, 199, 89, 0.14); color: #1d9d4b; }
.lab-verdict-ok { background: var(--accent-tint-strong); color: var(--accent-deep); }
.lab-verdict-warn { background: var(--warn-tint); color: var(--warn); }
.lab-order-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.lab-profit { color: var(--accent); }
.lab-checks { margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.lab-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.lab-check strong { color: var(--ink); font-weight: 600; }
.lab-check-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
}
.lab-check-dot.good { background: #34c759; }
.lab-check-dot.ok { background: var(--accent); }
.lab-check-dot.warn { background: #ff9500; }

@media (max-width: 720px) {
  .lab-order-tiles { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .lab-card-wide { grid-column: span 1; }
  .lab-predict { grid-template-columns: 1fr; }
}

/* --- Ordering dashboard --- */
.ordering-vendor-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ordering-vendor-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.ordering-vendor-card:hover,
.ordering-vendor-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 40%, var(--surface));
  outline: none;
}
.ordering-vendor-card.is-menu-open {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-tint, var(--fill-quiet)) 55%, var(--surface));
}
.ordering-vendor-card.is-inactive {
  opacity: 0.78;
}
.ordering-vendor-card-main { min-width: 0; }
.ordering-vendor-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.ordering-vendor-card-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.ordering-vendor-card-meta,
.ordering-vendor-card-stats {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ordering-vendor-card-stats { color: var(--faint); }
.ordering-vendor-card-hint {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--faint);
  user-select: none;
}
.ordering-vendor-card:hover .ordering-vendor-card-hint,
.ordering-vendor-card.is-menu-open .ordering-vendor-card-hint {
  color: var(--accent);
}
@media (max-width: 720px) {
  .ordering-vendor-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ordering-vendor-card-hint { justify-self: start; }
  .ordering-vendor-card-meta,
  .ordering-vendor-card-stats { white-space: normal; }
}

.ordering-vendor-group { margin-bottom: 18px; }
.ordering-vendor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink);
}
.ordering-vendor-meta { font-size: 12px; font-weight: 500; color: var(--faint); }
.problem.ordering-row-selected { box-shadow: inset 3px 0 0 var(--accent); }
.ordering-builder-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.ordering-add-toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.ordering-add-toggle input { width: 16px; height: 16px; }
.ordering-qty-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ordering-qty-input { width: 84px; }
.ordering-vendor-input {
  flex: 1 1 160px;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}
.ordering-cart {
  position: sticky;
  bottom: 12px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.12));
}
.ordering-cart-empty { color: var(--faint); font-size: 13px; }
.ordering-cart-info { font-size: 14px; color: var(--ink); }
.ordering-cart-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .ordering-cart { flex-direction: column; align-items: stretch; }
  .ordering-cart-actions { justify-content: space-between; }
}

.problem-body { display: flex; flex-direction: column; gap: 11px; }

/* Card overflow menu (three-dot) */

.card-menu { position: relative; flex: 0 0 auto; align-self: flex-start; }

.card-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
}
.card-menu-trigger svg { width: 17px; height: 17px; fill: currentColor; }
.card-menu-trigger:hover { background: var(--fill); color: var(--ink); }
.card-menu.open .card-menu-trigger { background: var(--fill-strong); color: var(--ink); }

.card-menu-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 300;
  min-width: 210px;
  padding: 5px;
  background: var(--glass-strong);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.card-menu.open .card-menu-list { display: block; animation: menuEnter 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }

.card-menu-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.card-menu-item:hover { background: var(--fill); }
.card-menu-item:active { background: var(--fill-strong); }

@keyframes menuEnter {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Reason banner */

.task-reason-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.task-reason-banner span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.task-reason-banner strong { font-size: 13px; font-weight: 500; color: var(--ink-soft); line-height: 1.45; }

.task-reason-banner.urgent { background: var(--danger-tint); border-color: transparent; }
.task-reason-banner.urgent span { color: var(--danger); }
.task-reason-banner.urgent strong { color: #9c231c; }

.task-reason-banner.watch { background: var(--warn-tint); border-color: transparent; }
.task-reason-banner.watch span { color: var(--warn); }
.task-reason-banner.watch strong { color: #8f5400; }

.task-reason-banner.sku { background: var(--info-tint); border-color: transparent; }
.task-reason-banner.sku span { color: var(--info); }
.task-reason-banner.sku strong { color: var(--accent-deep); }

.task-reason-banner.capacity { background: var(--accent-tint); border-color: transparent; }
.task-reason-banner.capacity span { color: var(--accent); }
.task-reason-banner.capacity strong { color: var(--accent-deep); }

/* Metric tiles */

.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 88px), 1fr));
  gap: 8px;
}

.number-box {
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  text-align: center;
}
.number-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.number-value {
  margin-top: 3px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Card copy blocks */

.sku {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.sku strong { color: var(--ink); font-weight: 600; }
.sku b { color: var(--accent-deep); font-weight: 700; }

.instruction {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.instruction.new-sku-warning { background: var(--warn-tint); border-color: transparent; color: #8f5400; font-weight: 500; }
.instruction.multi-sku-note { background: var(--info-tint); border-color: transparent; color: var(--accent-deep); }
.instruction.fit-rest-note { background: var(--accent-tint); border-color: transparent; color: var(--accent-deep); }

.new-sku-required-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--warn-tint);
  border: 0;
}
.new-sku-required-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--warn);
}
.new-sku-required-text { font-size: 12.5px; line-height: 1.55; color: #8f5400; }

/* Success banners */

.task-complete-banner,
.automation-complete-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  border: 0;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
}
.task-complete-check,
.automation-complete-check {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
}

/* Actions inside cards */

.resolve-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.capacity-input,
.test-input,
.field-input,
.admin-input {
  width: 96px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input,
.admin-input { width: auto; min-width: 160px; }
.capacity-input:focus,
.test-input:focus,
.field-input:focus,
.admin-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

.secondary-action-stack { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.secondary-action-stack .secondary { justify-content: center; }

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

/* ---------- Card state variants ---------- */

.demo-mode-card { background: #fffdf8; }

.task-completing-card { box-shadow: 0 0 0 3px var(--accent-tint-strong), var(--shadow-sm); }

.automation-running-card {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, var(--line)), var(--shadow-xs);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}
.automation-running-card .task-reason-banner {
  background: var(--accent-tint);
  border-color: transparent;
}
.automation-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  font-size: 13px;
}
.automation-progress-copy strong { color: var(--ink-soft); font-weight: 500; line-height: 1.45; }
.automation-progress-copy span {
  font-weight: 700;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.automation-progress-track {
  height: 3px;
  margin: 2px 0 10px;
  border-radius: 999px;
  background: var(--fill);
  overflow: hidden;
}
.automation-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--automation-progress-scale, 0));
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 72%, #2f3a28), var(--accent));
  border-radius: inherit;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.automation-complete-card { background: var(--accent-tint); }

.automation-login-required-card { box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.2), var(--shadow-xs); }

/* Compact restock fill — stays in-row, olive progress, soft exit */
.restock-compact-row.is-filling {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--accent-tint) 70%, var(--surface)) 0%,
      color-mix(in srgb, var(--accent-tint) calc(var(--automation-progress-scale, 0) * 85%), var(--surface)) 100%
    );
  animation: restockFillIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.restock-compact-row.is-filling::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--fill-strong);
  pointer-events: none;
}
.restock-compact-row.is-filling::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--automation-progress-scale, 0));
  background: var(--accent);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 1;
}
.restock-compact-row.is-fill-done {
  background: var(--accent-tint);
  border-color: transparent;
}
.restock-compact-row.is-fill-failed {
  background: var(--danger-tint);
  border-color: transparent;
}
.restock-compact-fill-msg {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.restock-compact-fill-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.restock-compact-fill-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  animation: restockFillPulse 1.6s ease-out infinite;
}
.restock-compact-row.is-completing {
  animation: restockFillOut 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes restockFillIn {
  from { opacity: 0.72; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes restockFillOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  55% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-6px) scale(0.985); max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
}
@keyframes restockFillPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .restock-compact-row.is-filling,
  .restock-compact-row.is-completing,
  .restock-compact-fill-pulse,
  .automation-progress-bar,
  .restock-compact-row.is-filling::before {
    animation: none;
    transition: none;
  }
}

/* ---------- Empty & celebration states ---------- */

.empty,
.empty-state {
  padding: 48px 28px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  color: var(--muted);
}
.empty::before,
.empty-state::before {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin: 0 auto 18px;
  border-radius: 2px;
  background: var(--accent);
}
.empty h2,
.empty-state h2 { font-size: 18px; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 6px; }
.empty p,
.empty-state p { font-size: 13.5px; max-width: 52ch; margin: 0 auto; line-height: 1.5; }

.celebration-empty { padding: 72px 30px; }
.celebration-content { display: flex; flex-direction: column; align-items: center; gap: 9px; }

.celebration-badge {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(47, 63, 52, 0.28);
}

.celebration-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.celebration-empty h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.03em; }
.celebration-empty p { color: var(--muted); }

.celebration-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.celebration-brand {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.registers-launch-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.registers-launch-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
.registers-table-wrap .hq-actions-cell {
  width: 52px;
  text-align: right;
  vertical-align: middle;
}
.registers-table-wrap .hq-actions-cell .card-menu,
.registers-table-wrap .hq-actions-cell .registers-row-menu-host {
  display: inline-flex;
  justify-content: flex-end;
  position: relative;
}
.registers-table-wrap tbody tr.registers-row {
  cursor: pointer;
}
.registers-table-wrap tbody tr.registers-row:hover {
  background: color-mix(in srgb, var(--fill-quiet, #f7f6f3) 80%, transparent);
}
.registers-table-wrap tbody tr.registers-row.card-menu.open {
  background: color-mix(in srgb, var(--accent, #2f3f34) 6%, transparent);
}
.registers-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--fill);
  color: var(--ink-soft);
}
.registers-status-pill.is-open {
  background: color-mix(in srgb, var(--ok, #2f7d4f) 16%, transparent);
  color: var(--ok, #2f7d4f);
}
.token-modal-card.registers-close-card {
  width: min(480px, 100%);
}
.token-modal-card.registers-history-card {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  text-align: left;
}
.registers-history-section { margin-top: 16px; }
.registers-history-heading {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.registers-history-table { font-size: 13px; }
.token-modal-card.registers-device-card {
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
}
.registers-device-card .devices-field-label {
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.registers-device-card .devices-field-label:first-of-type { margin-top: 0; }
.registers-device-card .capacity-input {
  width: auto;
  min-width: 0;
  box-sizing: border-box;
}
.registers-device-card #deviceReceiptHost,
.registers-device-card #devicePickHost,
.registers-device-card #deviceNotes {
  width: 100%;
  min-width: min(100%, 280px);
  min-height: 38px;
}
.registers-cash-kind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}
.registers-cash-kind-row .home-chip {
  min-height: 34px;
}
.registers-close-totals {
  display: grid;
  gap: 8px;
  margin: 4px 0 4px;
}
.registers-close-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.registers-close-row.is-grand {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-weight: 750;
  color: var(--ink);
}
.registers-close-variance {
  margin: 10px 0 0;
}
.registers-close-variance.is-warn,
#hqCloseDeposit.is-warn {
  color: var(--warn, #b45309);
  font-weight: 650;
}
.celebration-pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- AIC performance (empty restock dashboard) ---------- */

.aic-perf { display: flex; flex-direction: column; gap: 14px; }

.aic-perf-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
}

.aic-perf-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(47, 63, 52, 0.28);
}

.aic-perf-head-copy { min-width: 0; }
.aic-perf-head-copy h2 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; letter-spacing: -0.025em; color: var(--ink); margin: 2px 0; }
.aic-perf-head-copy p { color: var(--muted); font-size: 13.5px; }

.aic-perf-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 2px 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.aic-perf-last-move { font-size: 12px; font-weight: 500; color: var(--muted); }

.aic-perf-stats { margin: 0; }

.aic-perf-note {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  color: var(--muted);
  font-size: 13.5px;
}

.aic-perf-heavy-mover {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(120deg, var(--accent-tint), var(--surface) 55%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.aic-perf-heavy-mover-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 20px rgba(31, 92, 69, 0.25);
}

.aic-perf-heavy-mover-copy { flex: 1; min-width: 0; }
.aic-perf-heavy-mover-line { font-size: 14px; color: var(--ink-soft); }
.aic-perf-heavy-mover-line strong { color: var(--ink); font-weight: 600; }
.aic-perf-heavy-mover-meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); }

.aic-perf-heavy-mover-trophy {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--warn-tint);
  color: var(--warn);
}
.aic-perf-heavy-mover-trophy svg { width: 22px; height: 22px; }

.aic-perf-chart {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.aic-perf-chart-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}
.aic-perf-chart-name {
  flex: 0 0 34%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.aic-perf-chart-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--fill);
  overflow: hidden;
}
.aic-perf-chart-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent));
  animation: aicPerfBarGrow 0.6s ease both;
}
.aic-perf-chart-value {
  flex: 0 0 44px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@keyframes aicPerfBarGrow {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.aic-perf-achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.aic-perf-achievement {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
.aic-perf-achievement-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 700;
}
.aic-perf-achievement-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.aic-perf-achievement-message { margin-top: 2px; font-size: 12.5px; color: var(--muted); }

.aic-perf-recent {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.aic-perf-recent-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  font-size: 13px;
}
.aic-perf-recent-row + .aic-perf-recent-row { border-top: 1px solid var(--line-soft); }
.aic-perf-recent-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
.aic-perf-recent-qty { flex: 0 0 auto; font-weight: 600; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.aic-perf-recent-time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }

.aic-perf-skeleton { display: grid; gap: 12px; }
.aic-perf-skeleton-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.aic-perf-skeleton-rows { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.aic-perf-skeleton-block {
  height: 72px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-soft) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: aicPerfShimmer 1.4s ease infinite;
}

@keyframes aicPerfShimmer {
  from { background-position: 120% 0; }
  to { background-position: -80% 0; }
}

/* ---------- Initial load copy ---------- */

.initial-load-copy {
  max-width: 620px;
  margin: 40px auto;
  padding: 36px 38px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.initial-load-copy h2 { font-size: 24px; letter-spacing: -0.025em; margin-bottom: 10px; }
.initial-load-copy p { color: var(--muted); font-size: 14px; line-height: 1.6; }

.initial-load-steps { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.initial-load-step {
  position: relative;
  padding: 10px 14px 10px 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--ink-soft);
}
.initial-load-step::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--accent);
}

/* ---------- Station / register picker (post sign-in) ---------- */

.station-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.52);
  backdrop-filter: blur(6px);
}
.station-picker-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 24px;
}
.station-picker-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.station-picker-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--accent);
}
.station-picker-mark svg { width: 22px; height: 22px; display: block; }
.station-picker-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.station-picker-brand-copy strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: none;
}
.station-picker-brand-copy span {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.station-picker-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.station-picker-hint {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.station-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.station-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60vh, 420px);
  overflow: auto;
  padding-right: 2px;
}
.station-picker-btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.station-picker-list .station-picker-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
}
.station-picker-btn:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.station-picker-btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--accent);
}
.station-picker-btn:active { transform: scale(0.98); }
.station-picker-btn-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.station-picker-btn-kind {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.station-picker-list .station-picker-btn-kind {
  margin-top: 0;
  flex: 0 0 auto;
}
@media (max-width: 420px) {
  .station-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.station-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-chrome);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.station-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
}

/* ---------- Inventory / product search (embedded on Restock) ---------- */

.restock-product-search-bar {
  margin: 0 0 18px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  box-shadow: var(--shadow-xs);
}
.restock-product-search-bar-slim {
  margin: 0 0 14px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.restock-product-search-bar-slim.is-active {
  border: none;
  background: transparent;
}
.restock-product-search-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 4px;
}
.restock-product-search-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-soft);
}
.restock-product-search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.restock-product-search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: var(--ink-soft);
  stroke-width: 2.25;
  fill: none;
  pointer-events: none;
}
.restock-product-search-input.inventory-search-box {
  padding: 13px 16px 13px 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.restock-product-search-input.inventory-search-box::placeholder {
  color: var(--faint);
  font-weight: 400;
}
.restock-product-search-input.inventory-search-box:focus {
  background: var(--surface);
  border-color: var(--accent);
}
.restock-product-search-status {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.restock-product-search-status.is-empty {
  font-weight: 500;
  color: var(--ink-soft);
}
.restock-inventory-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.restock-inventory-filters select,
.restock-inventory-filters .cn-select {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
}
.restock-inventory-filters select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.restock-inventory-filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.operator-prompt-field-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

/* ---------- Receiving (scan → catalog link) ---------- */

.receiving-page { display: flex; flex-direction: column; gap: 4px; }

.receiving-manifest-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.receiving-manifest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.receiving-manifest-main {
  min-width: 0;
  flex: 1 1 auto;
}
.receiving-manifest-number {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.receiving-manifest-vendor {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.receiving-manifest-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.receiving-manifest-meta {
  font-size: 12px;
  font-weight: 650;
  color: var(--faint);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .receiving-manifest-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .receiving-manifest-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.receiving-scan-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.receiving-scan-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--fill-quiet);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.receiving-scan-input:focus {
  outline: none;
  background: var(--surface);
  box-shadow: var(--focus-ring);
}

.receiving-idle {
  padding: 28px 20px;
  border-radius: var(--radius-md);
  background: var(--fill-quiet);
  text-align: left;
}
.receiving-idle h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.receiving-idle p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.receiving-result-card {
  padding: 18px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.receiving-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.receiving-label {
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.02em;
}
.receiving-item-name {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--ink);
}
.receiving-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.receiving-source {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  color: var(--faint);
}
.receiving-linked {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-size: 12.5px;
  line-height: 1.4;
  max-width: 260px;
}

.receiving-normalized {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--fill-quiet);
  font-size: 14px;
  font-weight: 600;
}

.receiving-match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.receiving-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-align: left;
  background: var(--fill-quiet);
  color: var(--ink);
}
.receiving-match-row:hover { background: var(--fill); }
.receiving-match-row.active {
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.receiving-match-name { font-size: 13.5px; font-weight: 600; }
.receiving-match-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.receiving-confidence {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--fill);
  color: var(--muted);
}
.receiving-confidence.high { background: var(--accent-tint); color: var(--accent-deep); }
.receiving-confidence.medium { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.receiving-confidence.low,
.receiving-confidence.manual { background: var(--fill-strong); color: var(--ink-soft); }

.receiving-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.receiving-catalog-search { margin-top: 18px; }
.receiving-catalog-search .inventory-search-box { margin-top: 6px; }

.receiving-fixtures { margin-top: 8px; }
.receiving-fixture-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.receiving-fixture-chip {
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receiving-recent-table { margin-top: 4px; }

.receiving-order-search-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.receiving-order-search,
.receiving-order-fields .capacity-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.receiving-progress-tracker {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line, rgba(0,0,0,0.1));
  border-radius: var(--radius-md, 8px);
  background: color-mix(in srgb, var(--accent, #0f766e) 6%, var(--surface, #fff));
}
.receiving-progress-tracker-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.receiving-progress-tracker-head strong {
  font-size: 13px;
  font-weight: 750;
}
.receiving-progress-tracker-note {
  font-size: 12px;
  color: var(--muted, #667);
  line-height: 1.35;
}
.receiving-confirmed-table-wrap {
  margin-top: 8px;
}
.receiving-confirmed-table tbody tr.receiving-confirmed-row td {
  background: color-mix(in srgb, var(--accent, #0f766e) 6%, var(--surface, #fff));
}
.receiving-confirmed-table tbody tr.receiving-pending-row td {
  background: var(--surface-soft, #f7f7f5);
}
.receiving-confirmed-table tbody tr.is-missing-info td {
  background: color-mix(in srgb, var(--danger, #b42318) 7%, var(--surface, #fff));
}
.receiving-line-confirm-row .receiving-cost-hint {
  flex: 1 1 220px;
  align-self: center;
}
.receiving-tracker-fields {
  margin-top: 0;
}
.receiving-tracker-confirm {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.receiving-order-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 12px;
  margin-top: 8px;
  align-items: start;
}
.receiving-order-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.receiving-order-fields label.receiving-order-field-wide {
  grid-column: 1 / -1;
}
.receiving-order-fields label.receiving-order-field-money {
  max-width: 160px;
}
.receiving-order-suggestions,
.receiving-order-search-hits {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 4px;
  max-width: 100%;
}
.receiving-order-line .receiving-match-row {
  align-items: flex-start;
  text-align: left;
}
.receiving-order-line .receiving-match-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.35;
}
.receiving-order-line .receiving-match-meta {
  flex: 0 0 auto;
  white-space: normal;
}
.receiving-order-line .product-subtitle {
  overflow-wrap: anywhere;
  white-space: normal;
}
.receiving-order-line .product.mono {
  overflow-wrap: anywhere;
  white-space: normal;
}
.receiving-match-note {
  margin-top: 8px;
  color: var(--muted);
}
.receiving-order-room-label {
  display: block;
  margin: 10px 0 4px;
  font-size: 13px;
  font-weight: 600;
  max-width: 320px;
}
.receiving-order-room-select {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
  appearance: auto;
  padding-right: 28px;
}
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* Inventory Hub — match home clarity: non-sticky head, quiet sections */
.page-head.inventory-hub-hero,
#content > .page-head.inventory-hub-hero:first-child,
.ordering-page > .page-head.ordering-hero,
.page-head.ordering-hero,
.page-head.customers-hero,
#content > .page-head.customers-hero:first-child {
  position: static;
  z-index: auto;
  margin: 0 0 12px;
  padding: 8px 0 4px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}
.page-head.inventory-hub-hero h1,
.page-head.ordering-hero h1,
.page-head.customers-hero h1 {
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.page-head.inventory-hub-hero .subtitle,
.page-head.ordering-hero .subtitle,
.page-head.customers-hero .subtitle {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}
.page-head.customers-hero .page-head-actions .primary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.customers-tabs {
  margin-bottom: 14px;
}
.customers-search-bar {
  margin-bottom: 12px;
}
.customers-section-header,
#content .customers-section-header {
  position: static;
  z-index: auto;
  align-items: center;
  margin: 8px 0 10px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}
.customers-section-header .section-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.customers-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.customers-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
}
.customers-metric-value {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.customers-metric-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}
.customers-form-block {
  max-width: 720px;
}

.customer-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.customer-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.customer-profile-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.customer-profile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 12px;
}

.customer-profile-nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.customer-profile-nav-item:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
}

.customer-profile-nav-item.is-active {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  color: var(--ink);
}

.customer-profile-summary {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.customer-photo-slot {
  aspect-ratio: 1;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.customer-photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-allotment-card {
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 12px;
  padding: 14px 16px;
}

.customer-allotment-title {
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.customer-allotment-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 14px;
}

.customer-profile-panel {
  margin-bottom: 18px;
}

.customer-panel-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.customer-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.customer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.customer-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.customer-notes-input {
  width: 100%;
  min-height: 160px;
}

.customer-sale-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.customer-sale-items {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.customer-sale-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

@media (max-width: 820px) {
  .customer-profile-layout {
    grid-template-columns: 1fr;
  }
  .customer-profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
  }
  .customer-profile-summary,
  .customer-profile-grid {
    grid-template-columns: 1fr;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.ordering-page > .page-tabs {
  margin-bottom: 14px;
}
.ordering-page .ordering-section-header,
.ordering-page .restock-task-header,
#content .ordering-section-header {
  position: static;
  z-index: auto;
  align-items: center;
  margin: 4px 0 10px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}
.ordering-page .ordering-section-header .section-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.ordering-vendors-block {
  margin-top: 16px;
  padding-top: 14px;
}
.ordering-page .page-head-actions .primary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.restock-task-header,
.restock-products-header,
#content .restock-task-header,
#content .restock-products-header {
  position: static;
  z-index: auto;
  align-items: center;
  margin: 4px 0 10px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}
.restock-task-header .section-title,
.restock-products-header .section-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.restock-task-toggle { white-space: nowrap; }

/* Vault stats / restock panel: collapsible so on-hand search sits near the top */
.vault-stats-shell {
  margin: 6px 0 4px;
}
.vault-stats-rail {
  position: sticky;
  top: 0;
  z-index: 4;
}
.vault-stats-toggle {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control, 10px);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.vault-stats-toggle:hover {
  background: var(--fill-quiet, #f7f6f3);
  border-color: var(--line);
}
.vault-stats-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.vault-stats-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.vault-stats-toggle-title {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.vault-stats-toggle-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.vault-stats-toggle-action {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent-deep, var(--accent));
}
.vault-stats-chevron {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.vault-stats-shell.is-collapsed .vault-stats-chevron {
  transform: rotate(-90deg);
}
.vault-stats-slide {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.24s ease, margin 0.32s ease;
  opacity: 1;
  margin-top: 10px;
}
.vault-stats-shell.is-collapsed .vault-stats-slide {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}
.vault-stats-slide-inner {
  overflow: hidden;
  min-height: 0;
}
.vault-stats-shell.is-collapsed .vault-stats-slide-inner {
  visibility: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .vault-stats-slide,
  .vault-stats-chevron {
    transition: none;
  }
}

/* Wide screens: collapsed panel tucks to a compact side tab feel via rail only */
@media (min-width: 1100px) {
  .vault-stats-shell.is-collapsed .vault-stats-toggle {
    max-width: 280px;
  }
}

.task-list-compact {
  gap: 6px;
}
.restock-compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto auto;
  gap: 12px 16px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.restock-compact-row.tone-urgent {
  border-color: transparent;
  background: var(--danger-tint);
}
.restock-compact-row.tone-watch {
  border-color: transparent;
  background: var(--warn-tint);
}
.restock-compact-row.tone-sku {
  border-color: transparent;
  background: var(--info-tint);
}
.restock-compact-row.tone-capacity {
  border-color: transparent;
  background: var(--accent-tint);
}
.restock-compact-tone-pill {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
}
.restock-compact-row.tone-urgent .restock-compact-tone-pill { color: var(--danger); }
.restock-compact-row.tone-watch .restock-compact-tone-pill { color: var(--warn); }
.restock-compact-row.tone-sku .restock-compact-tone-pill { color: var(--info); }
.restock-compact-row.tone-capacity .restock-compact-tone-pill { color: var(--accent-deep); }
.restock-compact-more {
  margin: 8px 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.restock-compact-more .linkish {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  padding: 0;
}
.restock-compact-more .linkish:hover { text-decoration: underline; }
.restock-compact-main { min-width: 0; }
.restock-compact-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.restock-compact-index {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.restock-compact-name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(520px, 100%);
}
.restock-compact-cat {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.restock-compact-reason {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.restock-compact-reason strong { color: var(--ink-soft); font-weight: 650; }
.restock-compact-grab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--info, #0071e3) 14%, transparent);
  color: var(--accent-deep, #0040dd);
  font-size: 11.5px;
  line-height: 1.3;
  white-space: nowrap;
}
.restock-compact-row.tone-sku .restock-compact-grab {
  background: color-mix(in srgb, var(--info, #0071e3) 18%, #fff);
}
.restock-compact-grab-label {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 10px;
  color: inherit;
  opacity: 0.8;
}
.restock-compact-grab-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.restock-compact-grab-sku strong { font-weight: 800; }
.restock-compact-grab-hint {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: lowercase;
}
.restock-compact-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.restock-compact-metrics b {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.restock-compact-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.restock-compact-qty {
  width: 72px;
  min-height: 34px;
  padding: 6px 8px;
  text-align: center;
}
.restock-compact-actions .resolve-btn,
.restock-compact-actions .secondary {
  min-height: 34px;
  padding: 6px 12px;
}

@media (max-width: 900px) {
  .restock-compact-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .restock-compact-actions { justify-content: flex-start; }
  .restock-compact-reason { white-space: normal; }
}

.restock-product-results {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

#orderingPriorityBody { margin-bottom: 4px; }
#orderingVendorList { margin-top: 4px; }

.inventory-search-panel { display: flex; flex-direction: column; }

.inventory-search-box {
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--fill-quiet);
  font-size: 15px;
  color: var(--ink);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}
.inventory-search-box::placeholder { color: var(--faint); }
.inventory-search-box:focus { outline: none; background: var(--surface); box-shadow: var(--focus-ring); }

.inventory-results { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }

.inventory-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.inventory-row:hover { box-shadow: var(--shadow-sm); }
.inventory-row.selected {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.inventory-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}

.inventory-move-btn {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 8px 14px;
  order: 0;
}

.inventory-row-main {
  flex: 1 1 220px;
  min-width: 180px;
}

.inventory-product { font-size: 14.5px; font-weight: 600; letter-spacing: -0.014em; color: var(--ink); overflow-wrap: anywhere; }
.inventory-meta { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.inventory-meta b { color: var(--accent-deep); }
.inventory-category { flex: 0 1 120px; min-width: 90px; }

.inventory-qty {
  flex: 0 0 auto;
  min-width: 36px;
  text-align: right;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Inventory rows reuse .card-menu for click-to-open actions, but must NOT
   inherit the compact three-dot host sizing (flex: 0 0 auto; align-self: flex-start). */
.inventory-row.card-menu {
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
}
.inventory-row.inventory-row-menu:hover {
  border-color: var(--line-strong);
}
.inventory-row.card-menu.open {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.inventory-row-menu-host {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
}
.inventory-row-menu-host .card-menu-trigger {
  width: 34px;
  height: 34px;
}
.inventory-row-menu-host .card-menu-list {
  right: 0;
  top: calc(100% + 4px);
  left: auto;
  min-width: 200px;
  z-index: 40;
}
.inventory-row .inventory-select,
.inventory-row .inventory-move-btn {
  cursor: pointer;
}

.inventory-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--fill);
  border: 0;
  color: var(--ink-soft);
  white-space: nowrap;
}
.inventory-pill.shelf { background: var(--accent-tint); color: var(--accent-deep); }
.inventory-pill.vault { background: var(--info-tint); color: var(--info); }

.inventory-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--accent-tint);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}
.inventory-bulk-bar[hidden] { display: none !important; }
.inventory-bulk-copy { font-size: 13px; color: var(--ink-soft); }
.inventory-bulk-copy strong { color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.inventory-bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inventory-select-all-toggle { margin-right: 4px; }

.card-menu-item-danger { color: var(--danger); }
.card-menu-item-danger:hover { background: var(--danger-tint); color: var(--danger); }

/* ---------- Move log ---------- */

.move-log-grid,
.velocity-metric-grid,
.admin-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
}

.move-log-metric {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.move-log-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.move-log-value {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
label.move-log-metric { display: block; cursor: pointer; }
label.move-log-metric .capacity-input { width: 100%; margin-top: 6px; }

.move-date-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.move-date-label {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}
.move-date-label:hover { background: #000000; }
.move-date-nav .secondary { min-width: 38px; padding: 8px 12px; }

.move-date-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Velocity controls ---------- */

.velocity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.velocity-search-box { flex: 1 1 280px; }

.velocity-focus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.velocity-focus-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted, var(--muted, #6e6e73));
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.velocity-focus-chip:hover { background: var(--fill); color: var(--ink); }
.velocity-focus-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.velocity-hub-summary { margin-bottom: 14px; }

.velocity-hub-charts {
  margin-bottom: 18px;
  display: grid;
  gap: 14px;
}
.velocity-charts-primary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
}
.velocity-charts-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .velocity-charts-primary,
  .velocity-charts-secondary { grid-template-columns: 1fr; }
}

.velocity-chart-panel {
  padding: 14px 14px 10px;
  border-radius: var(--radius-md, 12px);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
.velocity-hub-charts.reports-hero {
  padding: 14px;
}
.velocity-hub-charts .reports-chart-total {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
}

.velocity-hbar-chart { max-height: 280px; }
.velocity-hbar-track {
  fill: var(--fill);
}
.velocity-hbar-bar--accent { fill: var(--accent); opacity: 0.92; }
.velocity-hbar-bar--promo { fill: color-mix(in srgb, var(--accent) 55%, #6b8f71); opacity: 0.95; }
.velocity-hbar-bar--warn { fill: color-mix(in srgb, var(--warn) 78%, var(--accent)); opacity: 0.9; }
.velocity-hbar-bar--muted { fill: color-mix(in srgb, var(--ink) 28%, var(--fill-strong)); opacity: 0.9; }
.velocity-hbar-row:hover .velocity-hbar-bar { opacity: 1; filter: brightness(1.05); }
.velocity-hbar-row:hover .velocity-hbar-label { fill: var(--ink); }
.velocity-hbar-label { fill: var(--ink-soft); font-size: 11px; font-weight: 600; }
.velocity-hbar-value { fill: var(--muted); font-size: 10.5px; font-weight: 600; }

.velocity-pkg-tag,
.metrc-pkg-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--fill);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  user-select: all;
}

.velocity-mix-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 4px 2px 8px;
}
.velocity-mix-ring {
  width: 168px;
  height: 168px;
  flex: 0 0 auto;
}
.velocity-mix-track { stroke: var(--fill); }
.velocity-mix-regular { stroke: color-mix(in srgb, var(--ink) 22%, var(--fill-strong)); stroke-linecap: butt; }
.velocity-mix-promo { stroke: var(--accent); stroke-linecap: butt; }
.velocity-mix-center-value {
  fill: var(--ink);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.velocity-mix-center-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.velocity-mix-legend {
  display: grid;
  gap: 8px;
  min-width: 160px;
  flex: 1 1 160px;
}
.velocity-mix-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.velocity-mix-legend-row strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.velocity-mix-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.velocity-mix-swatch--regular { background: color-mix(in srgb, var(--ink) 22%, var(--fill-strong)); }
.velocity-mix-swatch--promo { background: var(--accent); }
.velocity-mix-swatch--risk { background: color-mix(in srgb, var(--warn) 78%, var(--accent)); }
.velocity-mix-legend-note {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.velocity-chart-bar-regular {
  fill: color-mix(in srgb, var(--ink) 18%, var(--fill-strong));
  opacity: 0.95;
}
.velocity-chart-bar-promo {
  fill: var(--accent);
  opacity: 0.92;
}
.velocity-chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.velocity-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.velocity-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.velocity-legend-swatch--regular { background: color-mix(in srgb, var(--ink) 18%, var(--fill-strong)); }
.velocity-legend-swatch--promo { background: var(--accent); }

.velocity-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) {
  .velocity-insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .velocity-insight-grid { grid-template-columns: 1fr; }
}

.velocity-insight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, var(--radius-sm));
  padding: 12px 12px 8px;
  min-height: 160px;
}
.velocity-insight-head { margin-bottom: 8px; }
.velocity-insight-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.velocity-insight-note {
  font-size: 11.5px;
  color: var(--ink-muted, var(--muted, #6e6e73));
  margin-top: 2px;
}
.velocity-insight-empty {
  font-size: 12.5px;
  color: var(--ink-muted, var(--muted, #6e6e73));
  padding: 10px 2px;
}
.velocity-insight-list { display: flex; flex-direction: column; gap: 2px; }
.velocity-insight-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 7px 6px;
  cursor: pointer;
  color: inherit;
}
.velocity-insight-row:hover { background: var(--fill); }
.velocity-insight-name {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.velocity-insight-meta {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--ink-muted, var(--muted, #6e6e73));
  font-variant-numeric: tabular-nums;
}

.velocity-intel-callout {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--fill);
  border: 1px solid var(--line);
}
.velocity-intel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted, var(--muted, #6e6e73));
  margin-bottom: 4px;
}
.velocity-intel-body {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
}

.sales-perf-factstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 6px 2px 2px;
  font-size: 12px;
  color: var(--ink-muted, var(--muted, #6e6e73));
  font-variant-numeric: tabular-nums;
}
.sales-perf-factstrip span:not(:last-child)::after {
  content: '·';
  margin: 0 8px;
  color: var(--line, #d2d2d7);
}

.sales-perf-note {
  margin: 12px 0 6px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-left-color: var(--line);
  background: var(--surface, #fff);
}
.sales-perf-note-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sales-perf-note-action {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.3;
}
.sales-perf-note-detail {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft, var(--ink));
  max-width: 62ch;
}
.sales-perf-note-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--ink-muted, var(--muted, #6e6e73));
  font-variant-numeric: tabular-nums;
}
.sales-perf-note-facts em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink-soft, var(--muted, #6e6e73));
  margin-right: 3px;
}
.sales-perf-note--ok {
  border-left-color: color-mix(in srgb, #3d7a4a 70%, var(--line));
}
.sales-perf-note--warn {
  border-left-color: color-mix(in srgb, #b07a2a 75%, var(--line));
}
.sales-perf-note--urgent {
  border-left-color: color-mix(in srgb, #b04a3a 80%, var(--line));
}
.sales-perf-note--muted {
  opacity: 0.9;
}

/* Legacy class names kept so older cached CSS still paints something sane. */
.sales-perf-action {
  margin: 12px 0 6px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--surface, #fff);
}
.sales-perf-action-kicker { display: none; }
.sales-perf-action-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}
.sales-perf-action-body {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft, var(--ink));
  max-width: 62ch;
}
.sales-perf-action-meta {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--ink-muted, var(--muted, #6e6e73));
}
.sales-perf-action--ok { border-left-color: color-mix(in srgb, #3d7a4a 70%, var(--line)); }
.sales-perf-action--warn { border-left-color: color-mix(in srgb, #b07a2a 75%, var(--line)); }
.sales-perf-action--urgent { border-left-color: color-mix(in srgb, #b04a3a 80%, var(--line)); }
.sales-perf-action--muted { opacity: 0.9; }

.velocity-sort-select,
.admin-time-wheel {
  padding: 8px 32px 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background-color: var(--fill);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.velocity-sort-select:hover,
.admin-time-wheel:hover { background-color: var(--fill-strong); }
.velocity-sort-select:focus,
.admin-time-wheel:focus { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Admin: daily snapshots & charts ---------- */

.admin-chart-controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-chart-controls label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-chart-controls input[type="date"] {
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--fill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.admin-time-picker { display: flex; flex-direction: column; gap: 5px; }
.admin-time-picker-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-time-wheel-row { display: flex; align-items: center; gap: 8px; }
.admin-time-divider { font-size: 12px; font-weight: 600; color: var(--faint); }

.admin-chart-wrap {
  overflow-x: visible;
  padding: 8px 2px 4px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.admin-productivity-chart { display: block; width: 100%; max-width: 100%; min-width: 0; height: auto; }

.admin-chart-axis { stroke: rgba(0, 0, 0, 0.16); stroke-width: 1; }
.admin-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.admin-chart-line.tasks { stroke: var(--accent); }
.admin-chart-line.usage { stroke: var(--info); }
.admin-chart-points circle { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }
.admin-chart-label { fill: var(--muted); font-size: 10px; font-family: var(--font-body); }
text.admin-chart-label { font-weight: 500; }

.admin-chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.admin-chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.admin-chart-legend i { width: 18px; height: 4px; border-radius: 999px; display: inline-block; }
.admin-chart-legend i.tasks { background: var(--accent); }
.admin-chart-legend i.usage { background: var(--info); }

.admin-snapshot-list {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.admin-snapshot-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.admin-snapshot-list-title {
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-ranked-list {
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
  counter-reset: ranked;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.admin-ranked-list li {
  counter-increment: ranked;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding-left: 26px;
  position: relative;
}
.admin-ranked-list li::before {
  content: counter(ranked);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}
.admin-ranked-name { font-weight: 600; color: var(--ink-soft); overflow-wrap: anywhere; }
.admin-ranked-value { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.admin-note-list { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--muted); }
.admin-note-list strong { color: var(--ink); font-weight: 600; }

.admin-empty-note { font-size: 12.5px; color: var(--faint); }

/* ---------- AIC achievements ---------- */

.aic-achievements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.aic-achievement-group {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.aic-achievement-title {
  margin-bottom: 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.aic-achievement-card {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.aic-achievement-card + .aic-achievement-card { margin-top: 8px; }
.aic-achievement-line { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.aic-achievement-line strong { color: var(--ink); font-weight: 700; }
.aic-achievement-meta { margin-top: 4px; font-size: 11.5px; color: var(--faint); }
.aic-achievement-time { font-size: 11px; color: var(--faint); }
.aic-achievement-empty { font-size: 12.5px; color: var(--faint); }

/* Achievement popup — frosted notification banner */

.aic-achievement-popup {
  position: fixed;
  top: 20px;
  left: 50%;
  right: auto;
  z-index: 11000;
  display: flex;
  align-items: center;
  gap: 13px;
  width: min(400px, calc(100vw - 40px));
  padding: 14px 18px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  opacity: 0;
  transform: translate(-50%, -12px) scale(0.98);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.aic-achievement-popup.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.aic-achievement-popup.hide { opacity: 0; transform: translate(-50%, -12px) scale(0.98); }

.aic-achievement-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 700;
}
.aic-achievement-popup-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.aic-achievement-popup-title { margin-top: 2px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.014em; color: var(--ink); }
.aic-achievement-popup-message { margin-top: 1px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ---------- Modals — frosted sheet ---------- */

.product-link {
  cursor: pointer;
  color: var(--accent);
  text-decoration: none;
}
.product-link:hover { text-decoration: underline; color: var(--accent-deep); }
.product.product-link { color: var(--ink); }
.product.product-link:hover { color: var(--accent); }

.token-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10500;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.token-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  max-height: min(86vh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 30px 28px 24px;
  background: var(--glass-strong);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: modalEnter 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}

/* Must beat .token-modal-card — same element uses both classes. */
.token-modal-card.product-profile-card {
  display: flex;
  flex-direction: column;
  width: min(1280px, calc(100vw - 24px));
  height: min(96vh, calc(100vh - 24px));
  max-height: min(96vh, calc(100vh - 24px));
  padding: 0;
  overflow: hidden;
  text-align: left;
}
.token-modal-card.product-profile-card .operator-prompt-title {
  text-align: left;
  font-size: 24px;
}
.token-modal-card.product-profile-card .section-header { margin: 22px 0 12px; }
.token-modal-card.product-profile-card .section-header:first-child { margin-top: 0; }

.product-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}
.product-media-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-soft, var(--fill-quiet));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-media-tile.is-primary {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.product-media-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--fill-quiet);
}
.product-media-tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
}
.product-media-primary-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep, var(--accent));
}
.product-profile-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--glass-strong);
}

.product-profile-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 28px 20px;
  -webkit-overflow-scrolling: touch;
}

.product-profile-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 28px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--glass-strong);
}

.token-modal-card.product-profile-card .move-log-grid,
.token-modal-card.product-profile-card .velocity-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.token-modal-card.product-profile-card .move-log-metric { min-width: 0; }

.token-modal-card.product-profile-card .capacity-input,
.token-modal-card.product-profile-card select.capacity-input {
  width: 100%;
  min-height: 40px;
  margin-top: 0;
}

@media (max-width: 720px) {
  .token-modal-card.product-profile-card {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
    border-radius: var(--radius-lg);
    padding: 0;
  }
  .product-profile-head,
  .product-profile-scroll,
  .product-profile-actions {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.operator-prompt-title { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; color: var(--ink); }
.operator-prompt-text { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.operator-prompt-note {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--fill-quiet);
  border: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.token-modal-card input:not([type="checkbox"]),
.token-modal-card textarea {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--fill-quiet);
  font-size: 15px;
  color: var(--ink);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}
.token-modal-card input:focus,
.token-modal-card textarea:focus { outline: none; background: var(--surface); box-shadow: var(--focus-ring); }

.token-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.legacy-creds-error {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 500;
}

.legacy-creds-fallback {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 6px 0 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-decoration: underline;
  cursor: pointer;
}
.legacy-creds-fallback:hover { color: var(--ink); }

.import-hint { margin-top: 8px; font-size: 12px; color: var(--faint); }
.import-textarea {
  min-height: 220px;
  resize: vertical;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

.modal-close-x {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--fill-quiet);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.modal-close-x:hover { background: var(--fill-quiet-strong); color: var(--ink); }

/* Keep the exit control pinned while tall modals scroll. */
.token-modal-card > .modal-close-x {
  position: sticky;
  top: 8px;
  align-self: flex-end;
  z-index: 50;
  flex: 0 0 auto;
  margin: 0 0 -38px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.token-modal-card > .modal-close-x:hover {
  background: var(--fill-quiet-strong);
  color: var(--ink);
}

/* Product profile already pins chrome in a non-scrolling header. */
.product-profile-head .modal-close-x {
  position: static;
  margin: 0;
  flex: 0 0 auto;
  background: var(--fill-quiet);
  border: 0;
  box-shadow: none;
}

/* Modal specializations */

.operator-initials-card,
.shift-end-card,
.label-preview-card {
  max-width: min(520px, calc(100vw - 32px));
  text-align: center;
}
.label-preview-stage-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}
.label-preview-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}
.label-preview-sticker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: #fff;
  color: #111;
  border: 1px solid rgba(20, 20, 20, 0.18);
  box-shadow: 0 10px 28px rgba(20, 20, 20, 0.08);
  font-family: "Manrope", "Segoe UI", sans-serif;
}
.label-preview-stage.is-shelf .label-preview-sticker {
  width: min(320px, 86vw);
  aspect-ratio: 2 / 1;
  padding: 12px 14px 10px;
  border-radius: 4px;
}
.label-preview-stage.is-vault .label-preview-sticker {
  width: min(480px, 94vw);
  aspect-ratio: 4 / 2.25;
  padding: 18px 20px 14px;
  border-radius: 6px;
  gap: 6px;
}
.label-preview-name {
  font-weight: 750;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.label-preview-stage.is-vault .label-preview-name {
  font-size: 22px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.2;
}
.label-preview-qty,
.label-preview-meta {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}
.label-preview-stage.is-vault .label-preview-qty,
.label-preview-stage.is-vault .label-preview-meta {
  font-size: 15px;
  font-weight: 700;
  margin-top: 0;
  color: #111;
}
.label-preview-barcode {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  margin-top: auto;
  padding-top: 8px;
}
.label-preview-stage.is-vault .label-preview-barcode { height: 72px; }
.label-preview-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: auto;
}
.label-preview-row .label-preview-barcode {
  margin-top: 0;
}
.label-preview-lab-qr {
  flex: 0 0 auto;
  text-align: center;
  padding-top: 8px;
  text-decoration: none;
  color: inherit;
}
.label-preview-lab-qr-box {
  width: 52px;
  height: 52px;
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.label-preview-lab-qr-box svg {
  display: block;
  width: 100%;
  height: 100%;
}
.label-preview-stage.is-shelf .label-preview-lab-qr-box {
  width: 44px;
  height: 44px;
}
.label-preview-lab-qr-caption {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #666;
}
.label-preview-barcode-svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #111;
}
.label-preview-barcode-missing {
  display: flex;
  align-items: center;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  border: 1px dashed #bbb;
  border-radius: 3px;
  padding: 0 8px;
}
.label-preview-tag {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-preview-slip {
  width: min(280px, 86vw);
  padding: 16px 14px 18px;
  text-align: left;
  background: #fff;
  color: #111;
  border: 1px solid rgba(20, 20, 20, 0.18);
  box-shadow: 0 10px 28px rgba(20, 20, 20, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
  border-radius: 4px;
}
.receipt-preview-slip h3 {
  text-align: center;
  font-size: 14px;
  margin: 0 0 4px;
  font-weight: 700;
  font-family: "Manrope", "Segoe UI", sans-serif;
}
.receipt-preview-slip .r-item { margin: 0 0 10px; }
.receipt-preview-slip .r-item-name {
  font-weight: 650;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}
.receipt-preview-slip .r-item-sku {
  margin: 2px 0 4px;
  font-size: 11px;
  color: #444;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.receipt-preview-slip .r-sub { text-align: center; margin-bottom: 10px; color: #333; }
.receipt-preview-slip .r-line { display: flex; justify-content: space-between; gap: 8px; }
.receipt-preview-slip .r-rule { border-top: 1px dashed #000; margin: 8px 0; }
.receipt-preview-slip .r-total { font-weight: 700; font-size: 13px; }
.receipt-preview-slip .r-foot { text-align: center; margin-top: 12px; color: #333; }

.vault-sticker-card { text-align: center; }
.operator-initials-card .token-modal-actions,
.shift-end-card .token-modal-actions,
.vault-sticker-card .token-modal-actions { justify-content: center; }

.operator-prompt-badge {
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(31, 92, 69, 0.3);
}
.operator-prompt-badge span {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffffff;
}

.operator-initials-card .inventory-move-room-select,
.operator-initials-card .cn-select:has(#inventoryMoveToRoomSelect),
.operator-initials-card label[for="inventoryMoveToRoomSelect"] + .cn-select {
  display: flex;
  width: 100%;
  margin-bottom: 10px;
}
.operator-initials-card label[for="inventoryMoveToRoomSelect"] + .cn-select .cn-select-trigger {
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  letter-spacing: normal;
  text-transform: none;
}

/* ---------- Create inventory audit form ---------- */

.audit-create-card .problem-body.audit-create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}

.audit-create-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  border: 0;
  padding: 0;
  min-width: 0;
}

.audit-create-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.audit-create-label .req {
  color: var(--danger, #c0392b);
  font-weight: 700;
}

.audit-create-chips {
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.audit-multi-select {
  position: relative;
  width: 100%;
}

.audit-multi-trigger {
  width: 100%;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-multi-trigger[aria-expanded="true"] {
  border-color: var(--accent, #3d5a40);
}

.audit-multi-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 10px;
  background: var(--surface, var(--bg, #fff));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 14%, transparent);
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-sizing: border-box;
}

.audit-multi-panel[data-ported="1"] {
  right: auto;
}

.audit-multi-panel[hidden] {
  display: none !important;
}

.audit-multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}

.audit-multi-option:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.audit-multi-option input {
  margin: 0;
}

.audit-create-hint {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.audit-create-radios {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.audit-create-radios .audit-create-label,
.audit-create-radios legend.audit-create-label {
  flex: 0 0 100%;
  padding: 0;
}

.audit-create-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.audit-create-radio input {
  margin: 0;
}

/* ---------- Inventory audit → Metrc adjust prompt ---------- */

.token-modal-card.audit-metrc-card {
  width: min(440px, 100%);
  padding: 26px 26px 20px;
  text-align: left;
}

.audit-metrc-head { padding-right: 28px; }

.audit-metrc-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.audit-metrc-title {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}

.audit-metrc-lede {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.audit-metrc-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 10%, transparent), transparent 60%),
    var(--fill-quiet);
  border: 1px solid color-mix(in srgb, var(--danger) 18%, var(--line-soft));
}

.audit-metrc-stat-value {
  flex: 0 0 auto;
  min-width: 44px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
}

.audit-metrc-stat-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.audit-metrc-stat-copy strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.audit-metrc-stat-copy span {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.audit-metrc-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.audit-metrc-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.audit-metrc-choice:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line-soft));
  background: color-mix(in srgb, var(--accent-tint) 55%, var(--surface));
}

.audit-metrc-choice.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line-soft));
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.audit-metrc-choice-radio {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent);
  background: var(--surface);
  position: relative;
}

.audit-metrc-choice.is-selected .audit-metrc-choice-radio {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.audit-metrc-choice-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.audit-metrc-choice-copy strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.audit-metrc-choice-copy span {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.audit-metrc-fields {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--fill-quiet);
  border: 1px solid var(--line-soft);
}

.audit-metrc-fields[hidden] { display: none !important; }

.audit-metrc-field { display: flex; flex-direction: column; gap: 6px; }

.audit-metrc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.token-modal-card.audit-metrc-card input.audit-metrc-control,
.token-modal-card.audit-metrc-card select.audit-metrc-control,
.token-modal-card.receiving-catalog-card input.audit-metrc-control,
.token-modal-card.receiving-catalog-card select.audit-metrc-control {
  width: 100%;
  min-height: 42px;
  margin-top: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.011em;
  text-transform: none;
  text-align: left;
  color: var(--ink);
  appearance: auto;
}

.token-modal-card.audit-metrc-card input.audit-metrc-control:focus,
.token-modal-card.audit-metrc-card select.audit-metrc-control:focus,
.token-modal-card.receiving-catalog-card input.audit-metrc-control:focus,
.token-modal-card.receiving-catalog-card select.audit-metrc-control:focus {
  outline: none;
  background: var(--surface);
  box-shadow: var(--focus-ring);
}

.token-modal-card.audit-metrc-card select.audit-metrc-control,
.token-modal-card.receiving-catalog-card select.audit-metrc-control {
  padding-right: 32px;
}

.audit-metrc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.audit-metrc-actions .primary,
.audit-metrc-actions .secondary {
  min-width: 0;
}

/* ---------- Receiving → new catalog product (Village name review) ---------- */

.token-modal-card.receiving-catalog-card {
  width: min(520px, 100%);
  padding: 26px 26px 20px;
  text-align: left;
}

.receiving-catalog-metrc {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--fill-quiet);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-word;
}

.receiving-catalog-metrc strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.receiving-catalog-fields { margin-top: 14px; }

.receiving-catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.receiving-required {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--danger);
  font-size: 10px;
  margin-left: 4px;
}

.receiving-gaps {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(220, 38, 38, 0.28);
  border-radius: var(--radius-md, 8px);
  background: rgba(220, 38, 38, 0.08);
  color: var(--ink);
}
.receiving-gaps-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 4px;
}
.receiving-gaps-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 8px;
}
.receiving-gaps-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 4px;
  font-size: 13px;
  line-height: 1.35;
}
.receiving-order-line.has-gaps {
  border-color: rgba(220, 38, 38, 0.35);
}
.receiving-line-gap {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 650;
}
.receiving-order-fields label.is-missing .capacity-input,
.receiving-order-search-label.is-missing .capacity-input,
.audit-metrc-field.is-missing .audit-metrc-control {
  border-color: rgba(220, 38, 38, 0.55);
}
.receiving-catalog-fields .receiving-gaps {
  grid-column: 1 / -1;
}

.receiving-cost-hint {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

@media (max-width: 560px) {
  .receiving-catalog-grid { grid-template-columns: 1fr; }
}

/* ---------- Loading screen ---------- */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: var(--canvas);
}

.liquid-bg { position: absolute; inset: 0; pointer-events: none; }
.liquid-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; }
.liquid-blob.one { width: 420px; height: 420px; left: -120px; top: -120px; background: radial-gradient(circle, rgba(0, 113, 227, 0.12), transparent 70%); animation: blobDrift 12s ease-in-out infinite alternate; }
.liquid-blob.two { width: 380px; height: 380px; right: -100px; top: 30%; background: radial-gradient(circle, rgba(142, 68, 173, 0.07), transparent 70%); animation: blobDrift 14s ease-in-out infinite alternate-reverse; }
.liquid-blob.three { width: 460px; height: 460px; left: 30%; bottom: -180px; background: radial-gradient(circle, rgba(10, 138, 78, 0.1), transparent 70%); animation: blobDrift 16s ease-in-out infinite alternate; }

.liquid-ripple { display: none; }

.loading-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 36px 36px 36px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.loading-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 22px;
  text-align: left;
}
.loading-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-tint);
  color: var(--accent);
}
.loading-brand-mark svg, .loading-brand-mark img, .loading-brand-mark .cn-logo-mark { width: 24px; height: 24px; display: block;
  transform: scale(1.22);
  transform-origin: center;
}
.loading-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.loading-brand-copy strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.loading-brand-copy span {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.loading-ring {
  width: 44px;
  height: 44px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: conic-gradient(transparent 10%, var(--ink) 90%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: spin 0.9s linear infinite;
}

.loading-text {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: loadingDots 1.4s steps(4, end) infinite;
}

.loading-subtext { margin-top: 7px; font-size: 13px; color: var(--muted); }

.loading-progress-panel {
  display: none;
  margin-top: 20px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--fill-quiet);
  border: 0;
  text-align: left;
}
.loading-screen.has-progress .loading-progress-panel { display: block; }

.loading-step-count {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.loading-current-step { margin-top: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.loading-recent-steps { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.loading-recent-step {
  position: relative;
  padding-left: 18px;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.5;
}
.loading-recent-step::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

/* ---------- Toast — frosted dark capsule ---------- */

.toast {
  display: none;
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 13000;
  max-width: min(440px, calc(100vw - 48px));
  padding: 12px 20px;
  background: rgba(29, 29, 31, 0.86);
  color: #f5f5f7;
  border-radius: 999px;
  border: 0;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}

/* ---------- Utility states ---------- */

.hide { opacity: 0; }
.show { opacity: 1; }

#content.loading { animation: contentFade 0.4s ease both; }
/* Page swaps must win over the boot-time loading fade when both classes exist. */
#content.hq-page-enter {
  animation: hqPageEnter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------- Animations ---------- */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes contentFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blobDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(46px, 34px, 0) scale(1.1); }
}

@keyframes loadingDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
  100% { content: ""; }
}

/* ---------- HQ vertical stack: tables → cards when narrow ---------- */

@container hq-table (max-width: 780px) {
  .admin-table thead,
  .data-table thead,
  table thead { display: none; }
  .admin-table,
  .data-table,
  table,
  .admin-table tbody,
  .data-table tbody,
  table tbody,
  .admin-table tfoot,
  .data-table tfoot,
  table tfoot {
    display: block;
    width: 100%;
  }
  .admin-table tbody tr,
  .data-table tbody tr,
  table tbody tr,
  .admin-table tfoot tr,
  .data-table tfoot tr,
  table tfoot tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 12px;
    padding: 12px 14px;
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
  }
  .admin-table tbody tr:hover,
  .data-table tbody tr:hover,
  table tbody tr:hover,
  .admin-table tbody tr:hover td,
  .data-table tbody tr:hover td,
  table tbody tr:hover td {
    background: var(--surface);
  }
  .admin-table tbody td,
  .data-table tbody td,
  table tbody td,
  .admin-table tfoot td,
  .data-table tfoot td,
  table tfoot td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 0;
    border: 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .admin-table tbody td::before,
  .data-table tbody td::before,
  table tbody td::before,
  .admin-table tfoot td::before,
  .data-table tfoot td::before,
  table tfoot td::before {
    content: attr(data-label);
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
  }
  .admin-table tbody td:first-child,
  .data-table tbody td:first-child,
  table tbody td:first-child {
    grid-column: 1 / -1;
    font-weight: 650;
    padding-bottom: 2px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--line-soft);
  }
  .admin-table tbody td:first-child::before,
  .data-table tbody td:first-child::before,
  table tbody td:first-child::before { display: none; }
  .admin-table tbody td.hq-span-cell,
  .data-table tbody td.hq-span-cell,
  table tbody td.hq-span-cell,
  .admin-table tbody td.hq-actions-cell,
  .data-table tbody td.hq-actions-cell,
  table tbody td.hq-actions-cell,
  .admin-table tfoot td,
  .data-table tfoot td,
  table tfoot td {
    grid-column: 1 / -1;
  }
  .admin-table tbody td.hq-actions-cell,
  .data-table tbody td.hq-actions-cell,
  table tbody td.hq-actions-cell {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-top: 4px;
  }
  .admin-table tbody td.hq-actions-cell::before,
  .data-table tbody td.hq-actions-cell::before,
  table tbody td.hq-actions-cell::before,
  .admin-table tbody td.hq-span-cell::before,
  .data-table tbody td.hq-span-cell::before,
  table tbody td.hq-span-cell::before,
  .admin-table tbody td:not([data-label])::before,
  .data-table tbody td:not([data-label])::before,
  table tbody td:not([data-label])::before,
  .admin-table tbody td[data-label=""]::before,
  .data-table tbody td[data-label=""]::before,
  table tbody td[data-label=""]::before {
    display: none;
  }
  .admin-message { max-width: none; }

  /* Catalog: collapsed = product name only; tap opens Edit / Expand menu */
  .catalog-products-table .catalog-row-chevron { display: inline-block; }
  .catalog-products-table tbody tr.catalog-product-row.is-expanded .catalog-row-chevron {
    transform: rotate(45deg);
    margin-top: 0.35em;
  }
  .catalog-products-table tbody tr.catalog-product-row:not(.is-expanded) td:not(:first-child) {
    display: none !important;
  }
  .catalog-products-table tbody tr.catalog-product-row:not(.is-expanded) td:first-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .catalog-products-table tbody tr.catalog-product-row:not(.is-expanded) .catalog-row-sub {
    display: none;
  }
  .catalog-products-table tbody td:first-child {
    position: relative;
    padding-right: 12px;
  }
  .catalog-row-menu-host {
    top: auto;
    right: 0;
    left: 0;
    position: relative;
    width: auto;
    height: auto;
    margin-top: 8px;
  }
  .catalog-product-row.card-menu.open .catalog-row-menu-host .card-menu-list,
  .catalog-row-menu-host.open .card-menu-list {
    position: relative;
    top: 0;
    right: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    box-shadow: var(--shadow-md, 0 8px 20px rgba(0,0,0,0.1));
  }
}

/* Fallback when container queries aren't available / content is viewport-narrow */
@media (max-width: 900px) {
  .admin-table-wrap,
  .data-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
    border-radius: 0;
  }
  .admin-table thead,
  .data-table thead { display: none; }
  .admin-table,
  .data-table,
  .admin-table tbody,
  .data-table tbody,
  .admin-table tfoot,
  .data-table tfoot {
    display: block;
    width: 100%;
  }
  .admin-table tbody tr,
  .data-table tbody tr,
  .admin-table tfoot tr,
  .data-table tfoot tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 12px;
    padding: 12px 14px;
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
  }
  .admin-table tbody tr:hover,
  .data-table tbody tr:hover,
  .admin-table tbody tr:hover td,
  .data-table tbody tr:hover td {
    background: var(--surface);
  }
  .admin-table tbody td,
  .data-table tbody td,
  .admin-table tfoot td,
  .data-table tfoot td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 0;
    border: 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .admin-table tbody td::before,
  .data-table tbody td::before,
  .admin-table tfoot td::before,
  .data-table tfoot td::before {
    content: attr(data-label);
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
  }
  .admin-table tbody td:first-child,
  .data-table tbody td:first-child {
    grid-column: 1 / -1;
    font-weight: 650;
    padding-bottom: 2px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--line-soft);
  }
  .admin-table tbody td:first-child::before,
  .data-table tbody td:first-child::before { display: none; }
  .admin-table tbody td.hq-span-cell,
  .data-table tbody td.hq-span-cell,
  .admin-table tbody td.hq-actions-cell,
  .data-table tbody td.hq-actions-cell,
  .admin-table tfoot td,
  .data-table tfoot td {
    grid-column: 1 / -1;
  }
  .admin-table tbody td.hq-actions-cell,
  .data-table tbody td.hq-actions-cell {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-top: 4px;
  }
  .admin-table tbody td.hq-actions-cell::before,
  .data-table tbody td.hq-actions-cell::before,
  .admin-table tbody td.hq-span-cell::before,
  .data-table tbody td.hq-span-cell::before,
  .admin-table tbody td:not([data-label])::before,
  .data-table tbody td:not([data-label])::before,
  .admin-table tbody td[data-label=""]::before,
  .data-table tbody td[data-label=""]::before {
    display: none;
  }

  .page-head,
  .page-head-actions,
  .header-actions,
  .section-header {
    min-width: 0;
  }
  .page-head-actions,
  .header-actions {
    flex-wrap: wrap;
    width: 100%;
  }
  .summary {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  }
  .lab-predict { grid-template-columns: 1fr; }
  .lab-alert-row { flex-wrap: wrap; }
  .lab-alert-delta { min-width: 0; }
}

@media (max-width: 560px) {
  .admin-table tbody tr,
  .data-table tbody tr,
  .admin-table tfoot tr,
  .data-table tfoot tr {
    grid-template-columns: 1fr;
  }
  .summary {
    grid-template-columns: 1fr 1fr;
  }
  .numbers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-body { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 380px) {
  .summary,
  .numbers {
    grid-template-columns: 1fr;
  }
}


/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .task-list { grid-template-columns: 1fr; }
}

/* Narrow viewports: keep a real left menu as an off-canvas drawer.
   Do NOT move nav items into a horizontally scrolling header. */
@media (max-width: 980px) {
  .app-shell,
  body.sidebar-collapsed .app-shell {
    display: block;
  }

  .app-main {
    width: 100%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }

  .app-sidebar,
  body.sidebar-collapsed .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 520;
    width: min(300px, 86vw);
    height: 100vh;
    height: 100dvh;
    border-right: 1px solid var(--topbar-line);
    border-bottom: 0;
    overflow: hidden auto;
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
  }

  /* Reset desktop icon-rail collapse rules while the drawer is open/closed. */
  body.sidebar-collapsed .app-sidebar {
    transform: translateX(-105%);
    box-shadow: none;
    pointer-events: none;
    overflow: hidden auto;
  }
  body.sidebar-collapsed .sidebar-brand {
    padding: 10px 14px;
    justify-content: flex-start;
  }
  body.sidebar-collapsed .sidebar-brand-copy,
  body.sidebar-collapsed .sidebar-label,
  body.sidebar-collapsed .sidebar-count,
  body.sidebar-collapsed .sidebar-item-action,
  body.sidebar-collapsed .sidebar-operator-copy {
    display: revert;
  }
  body.sidebar-collapsed .sidebar-integration { display: none; }
  body.sidebar-collapsed .sidebar-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 6px 12px 12px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body.sidebar-collapsed .sidebar-item {
    justify-content: flex-start;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    white-space: normal;
  }
  body.sidebar-collapsed .sidebar-subitems {
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding-left: 12px;
  }
  body.sidebar-collapsed .sidebar-foot {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .sidebar-nav {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .sidebar-item-row { flex: 0 0 auto; width: 100%; }
  .sidebar-subitems {
    flex-direction: column;
  }

  .sidebar-close {
    display: grid;
  }

  .sidebar-toggle {
    display: grid !important;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 510;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(8, 12, 18, 0.46);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
  }
  body:not(.sidebar-collapsed) .sidebar-backdrop,
  body.sidebar-drawer-open .sidebar-backdrop {
    display: block;
  }
  body.sidebar-collapsed .sidebar-backdrop {
    display: none;
  }

  /* Keep the topbar toggle above the dimmed page, left of the open drawer. */
  .topbar {
    position: relative;
    z-index: 500;
  }
  .topbar-brand { display: inline-flex; }
  .topbar-left .store-context { display: none; }
}

@media (max-width: 860px) {
  /* Clean 2-row shell: brand + actions on top, search full-width below. */
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "search search";
    align-items: center;
    column-gap: 12px;
    row-gap: 10px;
    padding: 10px 12px 12px;
    min-height: 0;
  }
  .topbar-left {
    grid-area: brand;
    gap: 8px;
    max-width: none;
    min-width: 0;
  }
  .topbar-brand {
    gap: 9px;
    padding: 2px 4px 2px 0;
  }
  .topbar-brand-copy strong { font-size: 15px; }
  .topbar-brand-store { max-width: min(200px, 48vw); }
  .header-actions {
    grid-area: actions;
    justify-self: end;
    align-self: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: auto;
  }
  .global-search {
    grid-area: search;
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    order: unset;
  }
  .global-search-field {
    height: 40px;
    border-radius: 10px;
    padding: 0 12px 0 12px;
  }
  .global-search-kbd { display: none; }
  .global-search-results { left: 0; right: 0; }
  .topbar .station-chip { display: none; }
  .topbar .page-refresh-btn {
    display: grid;
    place-items: center;
    width: 38px;
    min-height: 38px;
    padding: 0;
    order: 50; /* always far right */
  }
  .topbar .ask-topbar-btn {
    width: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 0;
    line-height: 0;
  }
  .topbar .ask-topbar-btn svg {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    vertical-align: middle !important;
  }
  .topbar .profile-menu-trigger {
    min-height: 38px;
  }
  .page-head,
  #content > .section-header:first-of-type,
  #content > .inventory-search-panel > .section-header:first-child {
    padding: 10px 2px 10px;
    margin-bottom: 12px;
  }
  #content > .page-head:first-child,
  #content > .section-header:first-of-type:first-child,
  #content > .inventory-search-panel:first-child > .section-header:first-child {
    padding-top: 12px;
  }
  .page-head h1 { font-size: 20px; }
  .page-head .subtitle { font-size: 12.5px; }
  .task-list { grid-template-columns: 1fr; }
  .page-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .page-tabs::-webkit-scrollbar { display: none; }
  .summary { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .summary-card { padding: 14px 15px 13px; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .page-body { padding-bottom: 70px; padding-left: 12px; padding-right: 12px; }
  .topbar {
    padding: 10px 12px 12px;
    column-gap: 10px;
    row-gap: 10px;
  }
  .topbar-brand-store { display: none; }
  .global-search-field input { font-size: 14px; }
  .header-actions { gap: 8px; }
  .primary, .secondary, .resolve-btn { min-height: 40px; }
  .problem { padding: 16px; }
  .numbers { grid-template-columns: repeat(3, 1fr); }
  .toast { max-width: calc(100vw - 32px); }
  .token-modal-card { padding: 24px 18px 18px; }
  .demo-mode-indicator { display: none !important; }
}

/* Purchasing: vendors, menu import wizard, offering browser */
.vendor-name-link {
  cursor: pointer;
  color: var(--accent);
  text-decoration: none;
}
.vendor-name-link:hover {
  text-decoration: underline;
}

.wizard-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.wizard-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--muted);
  font-weight: 700;
  font-size: 11.5px;
  flex: 0 0 auto;
}
.wizard-step.active { background: var(--accent); color: var(--on-accent); }
.wizard-step.done { background: var(--accent-tint-strong); color: var(--accent-deep); }
.wizard-url-field { grid-column: span 2; }
.wizard-samples { max-width: 260px; }
.wizard-sample {
  display: inline-block;
  background: var(--line-soft);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11.5px;
  margin: 2px 4px 2px 0;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.menu-errors-panel {
  background: var(--warn-tint);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--muted);
  max-height: 260px;
  overflow-y: auto;
}
.menu-error-row { padding: 3px 0; line-height: 1.4; }
.menu-error-line {
  display: inline-block;
  min-width: 64px;
  font-weight: 600;
  color: var(--warn);
}
.offerings-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.offerings-filters .capacity-input { width: auto; min-width: 130px; flex: 0 1 auto; }
.offerings-filters #offeringsSearchInput { flex: 1 1 200px; min-width: 180px; }
.offerings-filters .offerings-num { min-width: 78px; width: 78px; }

@media (max-width: 720px) {
  .wizard-url-field { grid-column: span 1; }
  .offerings-filters .capacity-input { flex: 1 1 45%; min-width: 0; }
}

/* --- Ask Cannavate slide-over --- */
.ask-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 18, 0.28);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.ask-panel-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.ask-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  z-index: 81;
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  border-left: 1px solid var(--line, rgba(0,0,0,.08));
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  color: var(--ink, #1d1d1f);
  transform: translateX(104%);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.ask-panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}
.ask-panel[hidden],
.ask-panel-backdrop[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .ask-panel,
  .ask-panel-backdrop { transition: none; }
}
.ask-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line, rgba(0,0,0,.08));
}
.ask-panel-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #6e6e73);
  margin-bottom: 2px;
}
.ask-panel-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.ask-panel-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted, #6e6e73);
  padding: 0 4px;
}
.ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ask-bubble {
  max-width: 95%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ask-bubble.user {
  align-self: flex-end;
  background: var(--accent-tint, rgba(0, 113, 227, 0.12));
  color: var(--ink, #1d1d1f);
}
.ask-bubble.assistant {
  align-self: flex-start;
  background: var(--fill-quiet, rgba(0, 0, 0, 0.045));
  border: 1px solid var(--line-soft, rgba(0,0,0,.05));
}
.ask-bubble.assistant.error {
  border-color: rgba(224, 52, 43, 0.35);
  background: rgba(224, 52, 43, 0.08);
}
.ask-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ask-link-chip {
  border: 1px solid var(--line, rgba(0,0,0,.1));
  background: var(--surface, #fff);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ask-link-chip:hover { background: var(--accent-tint, rgba(0, 113, 227, 0.09)); }
.ask-link-chip.is-help {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface, #fff));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line, rgba(0,0,0,.1)));
}
.ask-link-chip.is-help::after { content: " ↗"; font-weight: 700; }
.ask-status-note a { color: var(--accent); font-weight: 650; text-decoration: none; }
.ask-status-note a:hover { text-decoration: underline; }
.ask-bubble a { color: var(--accent); font-weight: 650; }
.ask-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}
.ask-suggest button {
  border: 1px solid var(--line, rgba(0,0,0,.1));
  background: transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #6e6e73);
  cursor: pointer;
}
.ask-suggest button:hover {
  color: var(--ink, #1d1d1f);
  background: var(--fill, #e8e8ed);
}
.ask-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 16px 10px;
  border-top: 1px solid var(--line, rgba(0,0,0,.08));
  align-items: end;
}
.ask-compose textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line, rgba(0,0,0,.12));
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  background: var(--surface-soft, #fafafc);
  color: var(--ink, #1d1d1f);
}
.ask-compose textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}
.ask-status-note {
  padding: 0 16px 14px;
  font-size: 11.5px;
  color: var(--muted, #6e6e73);
}
.ask-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-chrome);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.ask-topbar-btn svg {
  width: 15px;
  height: 15px;
  margin: 0 !important;
  vertical-align: 0 !important;
}

/* ---------- Store context + profile menu ---------- */

.store-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.store-context-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(360px, 42vw);
}
.store-context-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}
.store-context-sep { color: var(--faint); }
.store-context-status {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu { position: relative; }
.profile-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  min-height: 32px;
  padding: 0 8px 0 4px;
  border-radius: var(--radius-chrome);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}
.profile-menu-trigger:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}
.profile-menu-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--surface-soft);
  box-shadow: none;
}
.profile-menu-avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.profile-menu-chevron {
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  color: var(--muted);
}
.profile-menu-chevron svg { width: 12px; height: 12px; }

.profile-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  width: min(260px, calc(100vw - 24px));
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.profile-menu-dropdown[hidden] { display: none !important; }
.profile-menu-header {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 2px;
}
.profile-menu-user {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.profile-menu-store {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.profile-menu-item {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.profile-menu-item:hover { background: var(--fill-quiet); }
.profile-menu-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
}
.profile-menu-divider {
  height: 1px;
  margin: 3px 6px;
  background: var(--line-soft);
}
.profile-menu-danger { color: var(--danger); }
.profile-menu-danger:hover { background: var(--danger-tint); }

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.page-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.page-filters .capacity-input,
.page-filters .admin-input,
.page-filters .inventory-search-box,
.page-filters .velocity-search-box {
  min-height: 34px;
  border-radius: var(--radius-control);
}

.data-table tbody tr.is-clickable { cursor: pointer; }
.data-table tbody tr.is-clickable:hover td { background: var(--accent-tint); }

/* ---------- v3 production polish ---------- */

.page-head h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.panel,
.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 10px;
}

/* Discount creator — clear sections, plain-English preview */
.disc-editor {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.disc-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.disc-editor-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.disc-editor-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 46ch;
  line-height: 1.35;
}
.disc-editor-active { margin-top: 4px; flex-shrink: 0; }
.disc-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.disc-preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.disc-preview-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.disc-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.disc-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.disc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.disc-field .capacity-input { font-weight: 500; color: var(--ink); }
.disc-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.disc-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 12px;
  align-items: start;
}
.disc-editor-grid-tight { grid-template-columns: minmax(140px, 200px); }
.disc-target-picker-wrap { grid-column: 1 / -1; }
.disc-target-picker {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, var(--canvas, #f3f2ef) 55%, var(--surface));
}
.disc-target-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}
.disc-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #2f6b4f) 8%, var(--surface));
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}
.disc-target-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  padding: 2px 4px;
}
.disc-target-chip button:hover { color: var(--danger, #b42318); }
.disc-target-picker .disc-field { margin: 0; }
.disc-target-picker .cn-select { width: 100%; max-width: 360px; }
.disc-type-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.disc-type-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  background: var(--bg, transparent);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.disc-type-btn strong { font-size: 14px; font-weight: 700; }
.disc-type-btn span { font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.3; }
.disc-type-btn input { position: absolute; opacity: 0; pointer-events: none; }
.disc-type-btn.active {
  border-color: var(--accent, #2f6b4f);
  box-shadow: inset 0 0 0 1px var(--accent, #2f6b4f);
  background: color-mix(in srgb, var(--accent, #2f6b4f) 8%, var(--surface));
}
.disc-code-input {
  text-transform: uppercase;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  max-width: 240px;
}
.disc-hint {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
  font-weight: 500;
  line-height: 1.35;
}
.disc-hint-inline { align-self: end; padding-bottom: 2px; }
.disc-hint code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--line);
  color: var(--ink);
}
.disc-editor-warn {
  font-size: 13px;
  color: var(--warn, #9a6b2f);
  background: color-mix(in srgb, var(--warn, #9a6b2f) 12%, var(--surface));
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.35;
}
.disc-editor-warn .linkish,
button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.disc-details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0 16px;
}
.disc-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.disc-details > summary::-webkit-details-marker { display: none; }
.disc-details-muted {
  font-weight: 500;
  color: var(--faint);
  margin-left: 6px;
}
.disc-details-body {
  padding: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.disc-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
}
.kv-grid .kv-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 3px;
}
.kv-grid .kv-value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  max-width: 100%;
  min-width: 0;
  container-type: inline-size;
  container-name: hq-table;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  padding: 11px 12px;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-soft); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--fill-quiet);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-tint); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-tint); color: var(--danger); border-color: transparent; }

.topbar {
  padding: 8px 16px;
}

.sidebar-foot {
  border-top: 1px solid var(--line-soft);
}

.sidebar-integration {
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.token-modal-card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.liquid-bg,
.liquid-blob,
.liquid-ripple { display: none !important; }

.loading-screen {
  background: var(--canvas);
}
.loading-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.initial-load-copy h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.initial-load-copy p {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 48ch;
}
.initial-load-step {
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: var(--surface);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.hq-test-receipt { display: none; }
/* ---------- Appearance / theme studio ---------- */

.theme-preview-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.theme-preview-chip {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
}
.theme-preview-placeholder {
  min-height: 34px;
  padding: 4px 10px 4px 12px;
  border-radius: var(--radius-chrome, 5px);
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.theme-preview-placeholder input {
  width: 118px;
  min-height: 26px;
  margin: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-chrome, 5px);
  background: var(--fill-quiet);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  pointer-events: none;
}
.theme-preview-placeholder input::placeholder {
  color: var(--faint);
  opacity: 1;
}
.theme-section {
  margin-bottom: 28px;
  min-width: 0;
}
.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.theme-preset-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.theme-preset-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.theme-preset-card.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-xs);
  background: color-mix(in srgb, var(--accent-tint) 70%, var(--surface));
}
.theme-preset-swatches {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.theme-preset-swatches span { flex: 1; }
.theme-preset-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.theme-preset-copy strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.theme-preset-copy span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.theme-density-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
  min-width: 0;
}
.theme-density-slider-wrap {
  position: relative;
  padding: 10px 2px 6px;
}
.theme-density-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fill-strong), var(--accent-tint), var(--accent));
  outline: none;
  cursor: pointer;
}
.theme-density-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.theme-density-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.theme-density-slider:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.theme-density-ticks {
  position: absolute;
  left: 11px;
  right: 11px;
  top: 50%;
  height: 0;
  pointer-events: none;
}
.theme-density-ticks span {
  position: absolute;
  top: -11px;
  width: 2px;
  height: 22px;
  margin-left: -1px;
  background: var(--line-strong);
  border-radius: 2px;
  opacity: 0.85;
}
.theme-density-labels {
  position: relative;
  height: 28px;
  margin: 0 11px;
}
.theme-density-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.01em;
  padding: 4px 6px;
  cursor: pointer;
  white-space: nowrap;
}
.theme-density-mark.is-active {
  color: var(--accent-deep);
}
.theme-density-mark:hover {
  color: var(--ink);
}
.theme-custom-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.theme-custom-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.theme-custom-card .theme-preset-swatches {
  width: 96px;
  flex: 0 0 auto;
}
.theme-custom-card-copy {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme-custom-card-copy span { font-size: 12px; color: var(--muted); }
.theme-custom-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.theme-save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.theme-save-row input {
  flex: 1 1 220px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
.theme-help {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.theme-color-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}
.theme-color-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 14px;
  min-width: 0;
}
.theme-color-group h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.theme-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}
.theme-color-row:last-child { margin-bottom: 0; }
.theme-color-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
}
.theme-color-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
}
.theme-color-picker {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.theme-color-hex {
  width: 92px;
  max-width: 28vw;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 7px 8px;
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.theme-color-reset {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 2px;
}
.theme-color-reset.is-hidden { visibility: hidden; pointer-events: none; }
.theme-color-reset:hover { color: var(--ink); }

html.theme-hc {
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --radius-control: 6px;
}
html.theme-hc .admin-mini-btn,
html.theme-hc .primary,
html.theme-hc .secondary,
html.theme-hc .sidebar-item,
html.theme-hc .lab-tab {
  border-width: 2px;
}
html.theme-hc .theme-preset-card.is-active,
html.theme-hc .theme-density-mark.is-active {
  outline: 3px solid var(--topbar-accent);
  outline-offset: 2px;
}

/* Continuous density scale — driven by --density-* vars from theme.js */
html {
  --density: 50;
  --density-font: 14px;
  --density-lh: 1.45;
  --density-space: 1;
  --density-pad-y: 14px;
  --density-pad-x: 16px;
  --density-gap: 12px;
  --density-row: 40px;
  --density-radius-scale: 1;
}

body {
  font-size: var(--density-font);
  line-height: var(--density-lh);
}

.page-body {
  padding-left: max(14px, calc(var(--density-pad-x) * 1.1));
  padding-right: max(14px, calc(var(--density-pad-x) * 1.1));
  padding-bottom: calc(48px + (var(--density) * 0.55px));
}

.summary,
.admin-card-list,
.theme-preset-grid,
.theme-custom-list {
  gap: var(--density-gap);
}

.theme-section {
  margin-bottom: calc(16px + (var(--density) * 0.28px));
}

.summary-card,
.admin-entity-card,
.theme-preset-card,
.theme-custom-card {
  padding: var(--density-pad-y) var(--density-pad-x);
  gap: calc(var(--density-gap) * 0.85);
  border-radius: calc(var(--radius-lg) * var(--density-radius-scale));
}

.problem {
  padding: calc(var(--density-pad-y) * 0.85) calc(var(--density-pad-x) * 0.9);
  border-radius: calc(var(--radius-lg) * var(--density-radius-scale));
}

.admin-table th,
.admin-table td,
.data-table th,
.data-table td {
  padding-top: calc(var(--density-pad-y) * 0.55);
  padding-bottom: calc(var(--density-pad-y) * 0.55);
  padding-left: calc(var(--density-pad-x) * 0.7);
  padding-right: calc(var(--density-pad-x) * 0.7);
  line-height: var(--density-lh);
}

.sidebar-item,
.lab-tab,
.page-tab {
  min-height: calc(var(--density-row) * 0.7);
}

.sidebar-item {
  padding: calc(var(--density-pad-y) * 0.55) calc(var(--density-pad-x) * 0.75);
  gap: calc(var(--density-gap) * 0.65);
  font-size: calc(var(--density-font) * 0.95);
}

.section-header,
.admin-head,
.problem-header {
  gap: calc(var(--density-gap) * 0.75);
  margin-bottom: calc(var(--density-gap) * 0.35);
}

.section-title {
  font-size: calc(var(--density-font) * 1.25);
  line-height: var(--density-lh);
}

.primary,
.secondary,
.resolve-btn,
.admin-mini-btn {
  padding-top: calc(var(--density-pad-y) * 0.45);
  padding-bottom: calc(var(--density-pad-y) * 0.45);
  padding-left: calc(var(--density-pad-x) * 0.7);
  padding-right: calc(var(--density-pad-x) * 0.7);
  min-height: calc(var(--density-row) * 0.72);
  font-size: calc(var(--density-font) * 0.95);
}

.scroll-note,
.theme-help,
.instruction,
.admin-muted {
  line-height: var(--density-lh);
}

/* Named zones still get a little extra punch at the marks */
html.density-compact .sidebar-item { letter-spacing: -0.015em; }
html.density-spacious .section-title { letter-spacing: -0.035em; }

@media (max-width: 560px) {
  .theme-density-mark { font-size: 11px; }
}

@media (max-width: 720px) {
  .theme-color-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .theme-color-controls { width: 100%; }
  .theme-color-hex { flex: 1 1 auto; width: auto; max-width: none; }
}

/* ---------- Inventory discrepancy layer ---------- */

.discrepancy-layer {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.discrepancy-layer.is-compact { padding: 10px 12px; }
.discrepancy-layer-head {
  margin-bottom: 8px;
  align-items: flex-start;
  gap: 10px;
}
.discrepancy-layer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.discrepancy-progress-inline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
}
.discrepancy-offer-card {
  width: min(440px, 100%);
  padding: 22px 20px 18px;
}
.discrepancy-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.discrepancy-offer-actions .resolve-btn { min-width: 88px; }
.discrepancy-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.discrepancy-progress-item {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-chrome);
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.discrepancy-progress-item strong { font-size: 13px; color: var(--ink); }
.discrepancy-progress-item span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.discrepancy-progress-item.is-done {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
  background: var(--ok-tint);
}
.discrepancy-analysis-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.discrepancy-analysis-strip > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
}
.discrepancy-analysis-strip strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.discrepancy-playbook {
  margin: 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.discrepancy-playbook li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.discrepancy-playbook strong { color: var(--ink); font-size: 13px; }

.discrepancy-modal-card {
  width: min(560px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 20px 20px 18px;
}

/* Guided discrepancy investigation — one dialogue at a time */
.discrepancy-wizard { display: flex; flex-direction: column; gap: 12px; }
.discrepancy-wizard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.discrepancy-wizard-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.discrepancy-wizard-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.discrepancy-wizard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.discrepancy-wizard-dot.is-done { background: var(--ok); }
.discrepancy-wizard-dot.is-current {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.discrepancy-wizard-product { font-size: 12.5px; }
.discrepancy-wizard-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.discrepancy-wizard-prompt {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.discrepancy-wizard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.discrepancy-wizard-stats > div {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-chrome);
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.discrepancy-wizard-stats span { font-size: 11px; color: var(--muted); font-weight: 650; }
.discrepancy-wizard-stats strong { font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.discrepancy-wizard-evidence {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(36vh, 280px);
  overflow: auto;
}
.discrepancy-wizard-evidence li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-chrome);
  background: var(--surface-soft);
  font-size: 13px;
}
.discrepancy-wizard-evidence li strong {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}
.discrepancy-wizard-evidence li span { color: var(--ink); line-height: 1.35; }
.discrepancy-wizard-evidence li em {
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.discrepancy-wizard-empty,
.discrepancy-wizard-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-chrome);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.discrepancy-wizard-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.discrepancy-wizard-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  height: auto;
  min-height: 0;
  padding: 12px 14px;
  text-align: left;
  border-radius: var(--radius-chrome);
}
.discrepancy-wizard-choice strong { font-size: 14px; }
.discrepancy-wizard-choice span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
}
.discrepancy-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.discrepancy-wizard-actions .resolve-btn { min-width: 148px; }
.discrepancy-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.discrepancy-summary { margin-bottom: 12px; }
.discrepancy-summary-copy {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-chrome);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.discrepancy-summary-copy p { margin: 4px 0 6px; color: var(--ink-soft); font-size: 13.5px; }
.discrepancy-steps {
  margin: 0 0 16px;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.discrepancy-step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.discrepancy-step strong { color: var(--ink); }
.discrepancy-step.is-done strong { color: var(--ok); }
.discrepancy-opencarts { margin: 0 0 14px; }
.discrepancy-opencarts h4,
.discrepancy-timeline h4,
.discrepancy-resolve h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.discrepancy-opencarts ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 13px;
}
.discrepancy-timeline { margin: 0 0 16px; min-width: 0; }
.discrepancy-timeline-table td { font-size: 12.5px; }
.discrepancy-event-kind {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--fill-quiet);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.discrepancy-resolve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.discrepancy-resolve-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  height: auto;
  min-height: 0;
  padding: 10px 12px;
  text-align: left;
  border-radius: var(--radius-chrome);
}
.discrepancy-resolve-btn strong { font-size: 13px; }
.discrepancy-resolve-btn span { font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.35; white-space: normal; }
.discrepancy-resolve-btn.is-suggested {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-tint);
}
.discrepancy-note-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.discrepancy-note-label textarea { font-weight: 500; color: var(--ink); resize: vertical; }


/* ---------- Website (storefront listings) ---------- */
.website-shop-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.website-shop-bar-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.website-shop-bar-url {
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  word-break: break-all;
  text-decoration: none;
}
.website-shop-bar-url:hover { text-decoration: underline; }
.website-shop-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.website-attention {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--warn-tint, #fff6e8) 80%, var(--surface));
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.website-attention strong { font-size: 14px; }
.website-attention span { color: var(--ink-soft); font-size: 13px; }
.website-attention-cta {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.website-attention.is-clear {
  cursor: default;
  border-color: var(--line-soft);
  background: var(--fill-quiet);
}
.website-attention.is-clear .website-attention-cta { display: none; }

.website-filter-tabs { margin-bottom: 12px; }
.website-search-row {
  margin: 0 0 16px;
}
.website-search-row .capacity-input {
  width: min(420px, 100%);
  min-height: 38px;
}
.website-photo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.website-photo-toolbar .capacity-input { flex: 1 1 240px; }
.website-bulk-photo-card {
  width: min(720px, 96vw);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 20px 22px;
}
.website-bulk-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.website-bulk-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 110px;
  margin: 0 0 14px;
  padding: 18px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--fill-quiet);
  text-align: center;
  cursor: pointer;
}
.website-bulk-drop strong { font-size: 14px; }
.website-bulk-drop span { font-size: 12.5px; color: var(--muted); }
.website-bulk-drop.is-drag {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.website-bulk-drop.is-busy { opacity: 0.6; pointer-events: none; }
.website-bulk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.website-bulk-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.website-bulk-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--fill-quiet);
}
.website-bulk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.website-bulk-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.website-bulk-meta strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.website-bulk-meta .capacity-input { min-height: 34px; font-size: 13px; }
.website-bulk-status {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.website-bulk-status.matched { color: var(--accent-deep, var(--accent)); }
.website-bulk-status.ok { color: var(--ok, #2f3f34); }
.website-bulk-status.busy { color: var(--ink-soft); }
.website-bulk-status.err { color: var(--danger); }
.website-bulk-actions { margin-top: 4px; }

.website-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.website-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.website-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.website-card.is-hidden { opacity: 0.72; }
.website-card.needs-work {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
}
.website-card-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--fill-quiet);
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
}
.website-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.website-card-empty-photo {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, var(--fill-quiet), color-mix(in srgb, var(--accent-tint, #eef1ea) 70%, #fff));
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.website-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 12px;
  flex: 1;
}
.website-card-title-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.website-card-title-btn strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.website-card-title-btn span {
  font-size: 12px;
  color: var(--muted);
}
.website-card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.website-card-tips {
  font-size: 12px;
  font-weight: 600;
  color: var(--warn);
}
.website-card-tips.is-ready { color: var(--accent, #3d5a3a); }
.website-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.website-card-edit {
  padding: 6px 10px;
  font-size: 12px;
}

.website-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.website-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.website-switch-ui {
  position: relative;
  width: 36px;
  height: 22px;
  border-radius: 999px;
  background: var(--fill-quiet);
  border: 1px solid var(--line);
  transition: background 0.15s ease, border-color 0.15s ease;
  flex: 0 0 auto;
}
.website-switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease;
}
.website-switch input:checked + .website-switch-ui {
  background: var(--ink);
  border-color: var(--ink);
}
.website-switch input:checked + .website-switch-ui::after {
  transform: translateX(14px);
}
.website-switch input:disabled + .website-switch-ui { opacity: 0.5; }
.website-switch-label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
  min-width: 72px;
}

.website-settings {
  display: grid;
  gap: 14px;
  max-width: 640px;
}
.website-settings-card {
  padding: 18px 18px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.website-settings-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.website-settings-card p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
}
.website-settings-hint {
  margin: 10px 0 0 !important;
  font-size: 12.5px !important;
  color: var(--muted) !important;
}
.website-settings-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0 0 8px;
}
.website-settings-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.website-settings-link-row code {
  flex: 1 1 220px;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--fill-quiet);
  font-size: 12.5px;
  word-break: break-all;
}
.website-domain-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.website-domain-row .capacity-input {
  flex: 1 1 220px;
  min-height: 38px;
}
.website-visibility-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 16px;
}

.website-home-layout {
  max-width: 860px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: start;
}
.website-home-field {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

/* ---------- Homepage builder (Website → Customize Homepage) ---------- */

.website-home-builder { max-width: 1100px; }
.home-builder-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  margin: 0 0 16px;
}
.home-builder-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.home-builder-intro > div > p {
  margin: 0;
  max-width: 46rem;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
}
.home-simple-presets {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.home-simple-preset {
  display: grid;
  gap: 2px;
  text-align: left;
  min-width: 150px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.home-simple-preset:hover { border-color: var(--line-strong); }
.home-simple-preset.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.home-simple-preset strong { font-size: 13.5px; }
.home-simple-preset small { font-size: 11.5px; color: var(--muted); }

.home-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}
.home-builder-form { display: grid; gap: 12px; min-width: 0; }
.home-builder-preview-col {
  position: sticky;
  top: 10px;
  align-self: start;
}

/* Live shop preview (device frame) */
.home-preview-stage {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent, #2f3f34) 10%, transparent), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--canvas, #eceae4) 70%, #d9d5cb), color-mix(in srgb, var(--canvas, #eceae4) 40%, #cfc9bc));
  border: 1px solid var(--line-soft);
}
.home-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.home-preview-toolbar a {
  font-size: 12px;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.home-preview-toolbar a:hover { text-decoration: underline; }
.home-preview-device-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line-soft);
}
.home-preview-device-toggle button {
  all: unset;
  box-sizing: border-box;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-soft, var(--muted));
  border-radius: 999px;
  cursor: pointer;
}
.home-preview-device-toggle button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

.hp-device { width: 100%; }
.hp-device-phone {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}
.hp-phone-bezel {
  width: min(100%, 292px);
  border-radius: 28px;
  padding: 10px 8px 12px;
  background: linear-gradient(160deg, #2a2a2a, #111);
  box-shadow:
    0 18px 40px rgba(20, 20, 20, 0.28),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  position: relative;
}
.hp-phone-notch {
  width: 92px;
  height: 8px;
  margin: 2px auto 8px;
  border-radius: 999px;
  background: #050505;
}
.hp-phone-home {
  width: 88px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
}
.hp-device-desktop {
  border-radius: 12px;
  overflow: hidden;
  background: #1b1b1b;
  box-shadow: 0 16px 36px rgba(20, 20, 20, 0.22);
  border: 1px solid rgba(0,0,0,0.25);
}
.hp-browser-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #262626;
}
.hp-browser-dots {
  display: flex;
  gap: 5px;
}
.hp-browser-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
  display: block;
}
.hp-browser-dots i:nth-child(1) { background: #ff5f57; }
.hp-browser-dots i:nth-child(2) { background: #febc2e; }
.hp-browser-dots i:nth-child(3) { background: #28c840; }
.hp-browser-url {
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: #141414;
  color: rgba(255,255,255,0.72);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-screen {
  --hp-accent: #2f3f34;
  --hp-btn: var(--hp-accent);
  --hp-discount: var(--hp-accent);
  --hp-nav: inherit;
  --hp-bg: #f3f2ef;
  --hp-ink: #141414;
  --hp-muted: rgba(20,20,20,0.58);
  --hp-surface: #faf9f6;
  --hp-line: rgba(20,20,20,0.1);
  --hp-radius-sm: 6px;
  --hp-radius-md: 8px;
  --hp-radius-lg: 10px;
  --hp-font-heading: "Manrope", "Segoe UI", sans-serif;
  --hp-font-body: "Manrope", "Segoe UI", sans-serif;
  background: var(--hp-bg);
  color: var(--hp-ink);
  font-family: var(--hp-font-body);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 520px;
}
.hp-device-phone .hp-screen {
  border-radius: 18px;
  min-height: 420px;
  max-height: 520px;
}
.hp-device-desktop .hp-screen {
  max-height: 460px;
}
.hp-announce {
  padding: 6px 10px;
  background: var(--hp-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  text-align: center;
  letter-spacing: 0.01em;
}
.hp-tone-dark .hp-announce { color: #101210; }
.hp-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hp-line);
  background: color-mix(in srgb, var(--hp-surface) 80%, transparent);
  color: var(--hp-nav, var(--hp-ink));
}
.hp-brand {
  min-width: 0;
  margin-right: auto;
  display: flex;
  align-items: center;
}
.hp-brand strong {
  font-family: var(--hp-font-heading);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.hp-logo {
  display: block;
  height: 20px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
}
.hp-nav-links {
  display: flex;
  gap: 4px;
}
.hp-nav-links em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 650;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--hp-muted);
}
.hp-nav-links em.is-active {
  background: color-mix(in srgb, var(--hp-accent) 16%, transparent);
  color: var(--hp-ink);
}
.hp-tone-dark .hp-nav-links em.is-active { color: var(--hp-ink); }
.hp-cart {
  font-size: 10.5px;
  font-weight: 650;
  opacity: 0.72;
}
.hp-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
}
.hp-hero {
  padding: 16px 12px 10px;
}
.hp-hero h4 {
  margin: 0 0 6px;
  font-family: var(--hp-font-heading);
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 750;
}
.hp-hero p {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--hp-muted);
}
.hp-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hp-accent);
  margin-bottom: 4px;
}
.hp-cta {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--hp-radius-md);
  background: var(--hp-btn);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.hp-tone-dark .hp-cta { color: #101210; }
.hp-hero-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 8px;
  align-items: stretch;
}
.hp-hero-art {
  min-height: 72px;
  border-radius: var(--hp-radius-lg);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--hp-accent) 55%, #fff), var(--hp-accent));
}
.hp-hero-banner {
  margin: 8px 10px 4px;
  padding: 16px 12px;
  border-radius: var(--hp-radius-lg);
  background: linear-gradient(135deg, var(--hp-accent), color-mix(in srgb, var(--hp-accent) 70%, #000));
  color: #fff;
}
.hp-hero-banner .hp-eyebrow { color: rgba(255,255,255,0.82); }
.hp-hero-banner h4 { color: #fff; }
.hp-hero-banner p { color: rgba(255,255,255,0.78); }
.hp-hero-banner .hp-cta {
  background: #fff;
  color: color-mix(in srgb, var(--hp-accent) 80%, #000);
}
.hp-hero-minimal { padding: 12px 12px 6px; }
.hp-hero-minimal h4 { font-size: 14px; }
.hp-sections { display: grid; gap: 12px; padding: 4px 10px 14px; }
.hp-section { display: grid; gap: 8px; }
.hp-section-head h5 {
  margin: 0;
  font-family: var(--hp-font-heading);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.hp-section-muted { opacity: 0.78; }
.hp-empty {
  margin: 0;
  font-size: 11px;
  color: var(--hp-muted);
  padding: 10px;
  border: 1px dashed var(--hp-line);
  border-radius: var(--hp-radius-md);
  background: color-mix(in srgb, var(--hp-surface) 70%, transparent);
}
.hp-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.hp-device-desktop .hp-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.hp-card {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.hp-card-media {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--hp-radius-md);
  background: color-mix(in srgb, var(--hp-accent) 10%, var(--hp-surface));
  border: 1px solid var(--hp-line);
  overflow: hidden;
}
.hp-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hp-deal {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--hp-discount);
  color: #fff;
  font-size: 8.5px;
  font-weight: 750;
}
.hp-tone-dark .hp-deal { color: #101210; }
.hp-card-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.hp-card-body strong {
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-card-body span {
  font-size: 9px;
  color: var(--hp-muted);
}
.hp-banner-strip {
  display: grid;
  gap: 6px;
}
.hp-banner-slide {
  border-radius: var(--hp-radius-lg);
  overflow: hidden;
  border: 1px solid var(--hp-line);
  background: var(--hp-surface);
  aspect-ratio: 16 / 7;
}
.hp-banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hp-cat-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.hp-cat-tile {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.hp-cat-art {
  aspect-ratio: 4 / 3;
  border-radius: var(--hp-radius-md);
  background: color-mix(in srgb, var(--hp-accent) 12%, var(--hp-surface));
  border: 1px solid var(--hp-line);
  overflow: hidden;
}
.hp-cat-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hp-cat-tile span {
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-text-banner {
  padding: 12px;
  border-radius: var(--hp-radius-lg);
  background: color-mix(in srgb, var(--hp-accent) 12%, var(--hp-surface));
  border: 1px solid var(--hp-line);
}
.hp-text-banner strong {
  display: block;
  font-family: var(--hp-font-heading);
  font-size: 12px;
  margin-bottom: 2px;
}
.hp-text-banner span {
  font-size: 10.5px;
  color: var(--hp-muted);
}
.hp-story {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--hp-muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hp-visit {
  display: grid;
  gap: 6px;
}
.hp-visit > div {
  display: grid;
  gap: 1px;
  padding: 8px;
  border-radius: var(--hp-radius-md);
  background: var(--hp-surface);
  border: 1px solid var(--hp-line);
}
.hp-visit span {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hp-muted);
}
.hp-visit em {
  font-style: normal;
  font-size: 11px;
  white-space: pre-line;
}

/* legacy wireframe preview (unused) */
.home-preview-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.home-preview-card-head h3 { margin: 0; }
.home-preview-card-head a {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
}
.home-preview-card-head a:hover { text-decoration: underline; }

.home-preview-frame {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f3f2ef;
  color: #141414;
  --home-preview-accent: #2f3f34;
}
.home-preview-tone-light { background: #fbfbfa; }
.home-preview-tone-dark {
  background: #161715;
  color: #f2f1ed;
  border-color: rgba(242, 241, 237, 0.14);
}
.home-preview-announce {
  padding: 7px 12px;
  background: var(--home-preview-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}
.home-preview-tone-dark .home-preview-announce { color: #101210; }
.home-preview-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.1);
  font-size: 12px;
  font-weight: 650;
}
.home-preview-tone-dark .home-preview-nav { border-bottom-color: rgba(242, 241, 237, 0.12); }
.home-preview-nav span { margin-right: auto; }
.home-preview-nav em {
  font-style: normal;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted, #5b5b5b);
}
.home-preview-nav em:first-of-type {
  background: color-mix(in srgb, var(--home-preview-accent) 14%, transparent);
  color: inherit;
}
.home-preview-hero { padding: 18px 14px 8px; }
.home-preview-hero h4 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.home-preview-hero p {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.45;
  opacity: 0.72;
}
.home-preview-cta {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--home-preview-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.home-preview-tone-dark .home-preview-cta { color: #101210; }
.home-preview-blocks { display: grid; gap: 8px; padding: 8px 14px 14px; }
.home-preview-block {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 20, 20, 0.08);
}
.home-preview-tone-dark .home-preview-block {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(242, 241, 237, 0.1);
}
.home-preview-block strong { font-size: 13px; }
.home-preview-block span { font-size: 11.5px; opacity: 0.7; }
.home-preview-block.is-muted { opacity: 0.75; }

.home-simple-blocks { display: grid; gap: 8px; }
.home-simple-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: color-mix(in srgb, var(--canvas, #f3f2ef) 55%, var(--surface));
}
.home-simple-block input { margin-top: 3px; }
.home-simple-block span { display: grid; gap: 2px; }
.home-simple-block strong { font-size: 13.5px; }
.home-simple-block small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.home-simple-block-fields {
  margin: -2px 0 4px;
  padding: 12px 12px 4px;
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--surface);
}
.home-inline-fields {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}
.home-advanced-toggle {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  cursor: pointer;
}
.home-advanced-toggle:hover { text-decoration: underline; }
.home-advanced-card > p { margin-top: 10px; }

@media (max-width: 960px) {
  .home-builder-layout { grid-template-columns: 1fr; }
  .home-builder-preview-col { position: static; }
  .home-inline-fields { grid-template-columns: 1fr; }
}

.home-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.home-template {
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.home-template:hover { border-color: var(--line-strong); }
.home-template.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.home-template strong { font-size: 13.5px; }
.home-template small { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.home-template-swatch {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.home-template-swatch i {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.home-chip-field { display: grid; gap: 6px; margin: 0 0 14px; }
.home-chip-field > span { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); }
.home-chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.home-chip {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  color: var(--muted);
}
.home-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.home-chip.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.home-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  display: grid;
  place-items: center;
  background: var(--surface);
}
.home-swatch.is-active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.home-swatch-custom {
  width: 34px;
  height: 30px;
  padding: 0 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.home-section-list { display: grid; gap: 10px; }
.home-section-row {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px 14px;
}
.home-section-row.is-on { border-color: var(--line); }
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.home-section-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.home-section-toggle input { margin-top: 3px; }
.home-section-toggle span { display: grid; gap: 1px; }
.home-section-toggle strong { font-size: 13.5px; }
.home-section-toggle small { font-size: 11.5px; color: var(--muted); }
.home-announce-toggle { margin-bottom: 10px; }
.home-section-order { display: inline-flex; gap: 4px; }
.home-section-order button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.home-section-order button:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
.home-section-order button:disabled { opacity: 0.35; cursor: default; }
.home-section-fields { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }

.home-featured-picker { display: grid; gap: 8px; }
.home-featured-picker > span { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); }
.home-featured-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.home-featured-chips em { font-size: 12px; color: var(--faint); }
.home-featured-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  font-size: 12px;
  font-weight: 650;
}
.home-featured-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  padding: 2px 4px;
}
.home-featured-chip button:hover { color: var(--danger); }
.home-featured-results { display: grid; gap: 4px; }
.home-featured-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}
.home-featured-result:hover { border-color: var(--accent); }
.home-featured-result small { color: var(--muted); white-space: nowrap; }
.home-featured-empty { font-size: 12.5px; color: var(--faint); padding: 4px 2px; }
.home-save-card { position: sticky; bottom: 12px; box-shadow: 0 8px 28px rgba(20, 20, 20, 0.12); }
.website-home-field > span {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
}
/* The builder's fields must span the card: the global .capacity-input is 96px. */
.website-home-field .capacity-input,
.home-featured-picker .capacity-input,
.home-simple-block-fields .capacity-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 38px;
}
.website-home-field textarea.capacity-input {
  min-height: 84px;
  resize: vertical;
  line-height: 1.4;
}
.website-home-preview {
  padding: 22px 20px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(120% 80% at 10% 0%, color-mix(in srgb, var(--accent, #3d5a3a) 12%, transparent), transparent 55%),
    var(--surface);
}
.website-home-preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.website-home-preview-eyebrow {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
}
.website-home-preview-headline {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.website-home-preview-lede {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 36ch;
}

.website-orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
}
.website-order-list {
  display: grid;
  gap: 10px;
  max-width: 720px;
}
.website-order-card {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.website-order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.website-order-card-top strong {
  font-size: 15px;
}
.website-order-lane {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.website-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.website-order-items {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.4;
}

@media (max-width: 720px) {
  .website-shop-bar { align-items: stretch; }
  .website-shop-bar-actions { width: 100%; }
  .website-shop-bar-actions .primary,
  .website-shop-bar-actions .secondary { flex: 1; justify-content: center; text-align: center; }
  .website-card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .website-home-layout { grid-template-columns: 1fr; }
}

@media print {
  @page { margin: 8mm; size: 80mm auto; }
  body * { visibility: hidden !important; }
  #hqTestReceipt,
  #hqTestReceipt * { visibility: visible !important; }
  #hqTestReceipt {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 280px;
    font-family: ui-monospace, SFMono-Regular, Menlo, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.35;
    color: #000;
    background: #fff;
  }
  #hqTestReceipt h3 { text-align: center; font-size: 14px; margin: 0 0 4px; }
  #hqTestReceipt .r-sub { text-align: center; margin-bottom: 10px; }
  #hqTestReceipt .r-line { display: flex; justify-content: space-between; gap: 8px; }
  #hqTestReceipt .r-rule { border-top: 1px dashed #000; margin: 8px 0; }
  #hqTestReceipt .r-total { font-weight: 700; font-size: 13px; }
  #hqTestReceipt .r-foot { text-align: center; margin-top: 12px; }
}

/* ---------- Homepage builder: logo / banners / collections / ordering ---------- */

.home-logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.home-logo-preview img {
  height: 48px;
  max-width: 160px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}
.home-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 13px;
  background: var(--surface);
}
.home-upload-btn:hover { border-color: var(--accent); }
.home-upload-sm { padding: 4px 8px; font-size: 12px; }

.home-banner-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.home-banner-row.is-incomplete {
  background: color-mix(in srgb, var(--warn, #c9892a) 8%, transparent);
  margin: 0 -8px;
  padding: 12px 8px;
  border-radius: 8px;
}
.home-banner-thumbs {
  display: grid;
  gap: 8px;
}
.home-banner-thumb-wrap {
  display: grid;
  gap: 4px;
}
.home-banner-thumb-wrap > span {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.home-banner-thumb {
  width: 100%;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
  background: var(--canvas-deep, #eee);
}
.home-banner-thumb-mobile { height: 56px; }
.home-banner-thumb-empty {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  color: var(--danger, #b42318);
}
.home-banner-fields {
  display: grid;
  gap: 6px;
}
.home-banner-fields .capacity-input { min-height: 28px; font-size: 12.5px; }
.home-banner-warn {
  margin: 0;
  font-size: 12.5px;
  color: var(--danger, #b42318);
  font-weight: 600;
}
.home-banner-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}
.home-banner-specs > div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--canvas, #f7f6f3);
}
.home-banner-specs strong { font-size: 13px; }
.home-banner-specs span { font-size: 12px; color: var(--muted); }
.home-banner-add {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.home-banner-one-shot {
  justify-self: start;
  cursor: pointer;
}
.home-banner-advanced {
  margin-top: 4px;
}
.home-banner-advanced summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.home-banner-add-files {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 720px) {
  .home-banner-row { grid-template-columns: 1fr; }
  .home-banner-specs,
  .home-banner-add-files { grid-template-columns: 1fr; }
}
.home-banner-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.home-banner-actions button {
  background: none;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 14px;
  cursor: pointer;
}
.home-banner-actions button:hover { border-color: var(--accent); }
.home-banner-actions .home-banner-delete {
  margin-left: 4px;
  border-color: rgba(194, 42, 33, 0.35);
  color: #c22a21;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 10px;
}
.home-banner-actions .home-banner-delete:hover {
  border-color: #c22a21;
  background: rgba(255, 59, 48, 0.1);
}

.token-modal-card.banner-crop-card {
  width: min(720px, calc(100vw - 24px));
  max-height: min(92vh, 860px);
}
.banner-crop-lede {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}
.banner-crop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.banner-crop-grid.is-single { grid-template-columns: 1fr; }
@media (max-width: 640px) {
  .banner-crop-grid { grid-template-columns: 1fr; }
}
.banner-crop-pane {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.banner-crop-pane h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.banner-crop-pane small {
  color: var(--muted);
  font-size: 12px;
}
.banner-crop-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #1a1a1a;
}
.banner-crop-frame.is-desktop { aspect-ratio: 8 / 3; }
.banner-crop-frame.is-mobile { aspect-ratio: 3 / 2; }
.banner-crop-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.banner-crop-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.banner-crop-presets button {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--surface, #fff);
  cursor: pointer;
}
.banner-crop-presets button.is-active,
.banner-crop-presets button:hover {
  border-color: var(--accent);
  color: var(--accent-deep, var(--accent));
}
.banner-crop-zoom {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.banner-crop-zoom input[type="range"] { width: 100%; }
.banner-crop-note {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--warn, #8f5400);
  line-height: 1.4;
}
.banner-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.hp-carousel {
  position: relative;
  margin: 0 0 8px;
  aspect-ratio: 8 / 3;
  overflow: hidden;
  background: color-mix(in srgb, var(--hp-accent) 10%, var(--hp-surface));
}
.hp-device-phone .hp-carousel { aspect-ratio: 3 / 2; }
.hp-carousel-slide {
  display: none;
  width: 100%;
  height: 100%;
}
.hp-carousel-slide.is-active { display: block; }
.hp-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hp-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  display: flex;
  justify-content: center;
  gap: 4px;
}
.hp-carousel-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
}
.hp-carousel-dots i.is-active { background: #fff; width: 10px; }

.home-collection-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.home-collection-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.home-collection-head .capacity-input { flex: 1; }

.home-catimg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
.home-catimg-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
}
.home-catimg-thumb {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
}

.home-hours-grid {
  display: grid;
  gap: 6px;
}
.home-hours-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.home-hours-row > span:first-child { width: 36px; font-weight: 600; }
.home-hours-row input[type="time"] {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 12.5px;
}

.home-windows-list { display: grid; gap: 8px; margin-bottom: 10px; }
.home-window-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.home-window-row .capacity-input { flex: 1 1 100px; min-height: 28px; font-size: 12.5px; }
.home-window-row input[type="time"] {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 12.5px;
}

/* Website Customize shared shell (Dutchie-like tabs + sticky preview) */
.website-customize-shell {
  display: grid;
  gap: 14px;
  max-width: 1100px;
}
.website-customize-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-raised, var(--surface));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.website-customize-tab {
  all: unset;
  box-sizing: border-box;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.website-customize-tab:hover {
  background: var(--hover);
  color: var(--ink);
}
.website-customize-tab.is-active {
  background: var(--accent, #2f3f34);
  color: #fff;
}
.website-customize-savebar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
@media (max-width: 960px) {
  .website-customize-tabs { flex-wrap: wrap; }
  .website-customize-savebar { border-radius: 0; margin: 0 -16px; padding: 12px 16px; }
}

/* Recolorable Cannavate mark — paints with currentColor */
.cn-logo-mark {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: url("/app/cannavate-logo-mask.png") center / contain no-repeat;
  mask: url("/app/cannavate-logo-mask.png") center / contain no-repeat;
  transform: scale(1.22);
  transform-origin: center;
}

/* Sandbox UI audit: readable text controls and task-first layouts. */
input.capacity-input:is([type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], :not([type])),
textarea.capacity-input {
  width: 100%;
  min-width: min(220px, 100%);
  max-width: 100%;
  box-sizing: border-box;
}
.page-filters input[type="search"], .page-filters input[type="text"] { flex: 1 1 240px; }
.website-order-settings { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.website-order-settings > summary { padding: 14px 16px; cursor: pointer; font-weight: 650; }
.website-customize-savebar { position: sticky; bottom: 0; background: var(--surface); z-index: 5; padding: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.website-customize-savebar .website-settings-hint { flex: 1 1 240px; margin: 0; }
.home-feature-banner { min-height: 0; }
.home-feature-banner-body { min-height: 0; padding: 18px 46px 18px 20px; gap: 16px; }
.home-feature-stamp, .home-feature-banner-media, .home-feature-banner-scrim { display: none; }
.home-feature-banner { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.home-feature-title { font-size: 20px; color: var(--ink); }
.home-feature-eyebrow, .home-feature-blurb { color: var(--muted); }
.home-feature-blurb { margin: 6px 0 10px; }
.home-feature-banner-dismiss { color: var(--ink); }
.website-card-empty-photo { min-height: 100px; }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.product-profile-actions { position: sticky; bottom: 0; padding: 14px; background: var(--surface); border-top: 1px solid var(--line); z-index: 5; }
.customer-optional { margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.customer-optional summary { font-weight: 600; cursor: pointer; padding: 4px; }
.customer-optional[open] > div { margin-top: 12px; }
.ask-panel-backdrop { z-index: 10400; }
.ask-panel { z-index: 10401; }
.audit-completion-review { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 16px; padding: 12px; }
.audit-completion-review summary { cursor: pointer; font-weight: 650; padding: 4px; }
.audit-completion-review[open] > div { margin-top: 12px; }
.website-card-media:has(.website-card-empty-photo) { aspect-ratio: 4 / 3; }
.website-card-empty-photo { align-content: center; gap: 10px; padding: 12px; box-sizing: border-box; }
.website-card-empty-photo strong { font-size: 19px; color: var(--ink); }


/* Landing-page brand continuity: shared shape and calm olive chrome. */
:root {
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-control: 8px;
  --radius-chrome: 8px;
}

.sidebar-brand { padding-block: 14px; }
.sidebar-brand h1 { font-size: 18px; letter-spacing: -0.04em; }
.sidebar-brand .brand-mark { background: transparent; color: var(--topbar-ink); }
.sidebar-nav { gap: 4px; padding-top: 12px; }
.sidebar-item:not(.sidebar-subitem) { border-color: transparent; background: transparent; }
.sidebar-item:not(.sidebar-subitem).active {
  background: var(--topbar-fill-strong);
  border-color: var(--topbar-line);
  box-shadow: inset 3px 0 0 var(--topbar-accent);
}
.topbar { box-shadow: none; }
.topbar .global-search-field { background: var(--surface); border-color: var(--line); }
.topbar .global-search-field input { color: var(--ink); }
.topbar .global-search-field input::placeholder { color: var(--muted); }
.topbar .global-search-kbd { color: var(--muted); border-color: var(--line); }
.page-head h1 { letter-spacing: -0.04em; }
.page-head.home-hero { padding-block: 18px 12px; }
.home-panel { background: var(--surface); border-color: var(--line); border-radius: var(--radius-lg); }
.home-panel-today { background: color-mix(in srgb, var(--accent-tint) 45%, var(--surface)); }
.home-panel-kicker { letter-spacing: 0.09em; text-transform: uppercase; font-size: 11px; }
.home-today-total { color: var(--accent); }
.home-feature-banner { background: var(--surface-soft); box-shadow: none; }
.home-feature-cta { border-radius: var(--radius-control); background: var(--accent); color: var(--on-accent); box-shadow: none; }
.home-feature-cta:hover { background: var(--accent-deep); }
.home-feature-cta:focus-visible { outline-color: var(--accent); }
.home-feature-banner-dismiss { background: var(--fill-quiet); border-color: var(--line); }


/* Daily overview: feature spotlight, compact operational summary, then insight. */
.home-workspace { max-width: 1440px; margin-inline: auto; }
.home-workspace .home-hero { margin-bottom: 24px; padding: 22px 0 4px; }
.home-workspace .home-hero h1 { font-size: clamp(28px, 3vw, 38px); font-weight: 650; }
.home-workspace .home-command { grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr); gap: 0; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.home-workspace .home-panel-today { min-height: 0; padding: 22px 24px; border: 0; border-radius: 0; }
.home-workspace .home-today-total { font-size: clamp(32px, 3vw, 44px); font-weight: 650; }
.home-workspace .home-today-count { font-size: 12px; font-weight: 500; }
.home-workspace .home-today-queue { margin-top: 18px; padding-top: 10px; }
.home-workspace .home-panel-floor { border: 0; border-radius: 0; border-left: 1px solid var(--line); padding: 22px 0; background: transparent; }
.home-workspace .home-panel-floor > .home-panel-kicker { margin-inline: 24px; }
.home-workspace .home-floor-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.home-workspace .home-floor-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 24px 12px; border-radius: 0; }
.home-workspace .home-floor-row + .home-floor-row { border-left: 1px solid var(--line); }
.home-workspace .home-floor-label { order: 1; font-size: 13px; }
.home-workspace .home-floor-value { order: 0; align-self: flex-start; font-size: clamp(32px, 3vw, 44px); font-weight: 650; line-height: 1.1; }
.home-workspace .home-floor-note { order: 2; line-height: 1.5; }
.home-workspace .home-panel-insight { padding: 22px 24px; margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); }
/* Restore the photographic feature spotlight above the daily overview. */
.home-workspace .home-feature-banner { border: 1px solid rgba(246,243,236,.2); border-radius: 12px; background: #1a221c; margin: 8px 0 12px; color: #f6f3ec; }
.home-workspace .home-feature-banner-media, .home-workspace .home-feature-banner-scrim { display: block; }
.home-workspace .home-feature-banner-body { max-width: 760px; padding: 28px 48px 28px 28px; min-height: 190px; box-sizing: border-box; }
.home-workspace .home-feature-copy { width: 100%; display: grid; grid-template-columns: 1fr; gap: 8px; }
.home-workspace .home-feature-eyebrow { font-size: 10px; color: #dedfd7; }
.home-workspace .home-feature-title { font-size: clamp(24px, 3vw, 32px); font-weight: 650; color: #fbf8f1; }
.home-workspace .home-feature-blurb { font-size: 13px; margin: 0; max-width: 38rem; color: #e4e4db; }
.home-workspace .home-feature-cta { margin-top: 8px; padding: 10px 14px; background: #f6f3ec; color: #1a221c; border: 0; font-size: 13px; }
.home-workspace .home-feature-cta:hover { background: #fff; transform: none; }
.home-workspace .home-feature-cta:focus-visible { outline-color: #f6f3ec; }
.home-workspace .home-feature-banner-dismiss { top: 12px; right: 12px; width: 30px; height: 30px; font-size: 18px; background: rgba(14,18,15,.65); color: #f6f3ec; border-color: rgba(246,243,236,.4); }
@media (max-width: 1000px) {
  .home-workspace .home-command { grid-template-columns: 1fr; }
  .home-workspace .home-panel-today { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; }
  .home-workspace .home-panel-today > .home-panel-kicker { grid-column: 1 / -1; margin-bottom: 0; }
  .home-workspace .home-today-queue { align-self: end; margin: 0; border: 0; width: auto; }
  .home-workspace .home-panel-floor { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .home-workspace .home-hero { margin-bottom: 18px; padding-top: 10px; }
  .home-workspace .home-panel-today, .home-workspace .home-panel-insight { padding: 18px 16px; }
  .home-workspace .home-panel-floor > .home-panel-kicker { margin-inline: 16px; }
  .home-workspace .home-floor-row { padding-inline: 12px; }
  .home-workspace .home-floor-value { font-size: 28px; }
  .home-workspace .home-floor-label { font-size: 12px; }
  .home-workspace .home-floor-note { font-size: 11px; }
  .home-workspace .home-feature-copy { grid-template-columns: 1fr; }
  .home-workspace .home-feature-cta { grid-column: 1; grid-row: auto; margin-top: 8px; }
}

/* Three personal priority tiles, with an inline editor that works on narrow screens. */
.home-workspace .home-command { overflow: visible; }
.home-workspace .home-panel-today { border-radius: 12px 0 0 12px; }
.home-priority-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 24px 10px; }
.home-priority-head .home-panel-kicker { margin: 0; }
.home-priority-picker { margin-left: auto; font-size: 12px; }
.home-priority-picker summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.home-priority-picker[open] { flex: 1 0 100%; margin: 0; }
.home-priority-picker form { padding: 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); display: flex; flex-wrap: wrap; gap: 12px; }
.home-priority-picker form p { flex: 1 0 100%; margin: 0; color: var(--muted); }
.home-priority-picker form label { display: grid; gap: 6px; flex: 1 1 140px; font-weight: 600; }
.home-priority-picker select { width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.home-priority-picker [role="status"]:empty { display: none; }
@media (max-width: 1000px) { .home-workspace .home-panel-today { border-radius: 12px 12px 0 0; } }
@media (max-width: 560px) { .home-priority-head { padding-inline: 16px; } }

/* HQ workflow hierarchy. Home keeps its established presentation. */
.hq-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 12px; margin: 16px 0; }
.hq-report-card { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; cursor: pointer; }
.hq-report-card .problem-header { display: flex; flex-direction: column; align-items: stretch; gap: 16px; height: 100%; }
.hq-report-card .rank { color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 6px; }
.hq-report-card .product { font-size: 16px; font-weight: 650; letter-spacing: -.02em; line-height: 1.35; }
.hq-report-card .product-subtitle { font-size: 13px; line-height: 1.55; margin-top: 7px; color: var(--muted); }
.hq-report-action { margin-top: auto; font-size: 12px; font-weight: 650; color: var(--accent); }
.hq-report-card:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-soft); }
.hq-report-card:disabled { cursor: default; opacity: .65; }
.hq-report-card:focus-visible, .hq-secondary-section summary:focus-visible, .settings-nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hq-secondary-section { margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.hq-secondary-section > summary { padding: 15px 18px; cursor: pointer; font-size: 13px; font-weight: 650; color: var(--ink-soft); }
.hq-secondary-section > div { padding: 0 18px 18px; }
.hq-secondary-section .section-header { margin-top: 8px; }
.receiving-page .receiving-scan-bar { padding: 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; gap: 10px; }
.receiving-page .receiving-scan-input { min-height: 42px; min-width: 0; }
.settings-shell { gap: 28px; align-items: start; }
.settings-nav { padding: 12px; border-radius: 10px; }
.settings-nav-group + .settings-nav-group { margin-top: 18px; }
.settings-nav-label { font-size: 10px; letter-spacing: .06em; padding-inline: 10px; }
.settings-nav-item { min-height: 40px; padding: 10px; border-radius: 7px; font-size: 13px; text-align: left; }
.settings-nav-item.active { background: var(--accent-tint); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.settings-panel { min-width: 0; }
.settings-panel .section-header { gap: 12px; flex-wrap: wrap; }
.hq-draft-label { font-size: 11px; font-weight: 700; color: var(--ink-soft); padding: 5px 9px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; }
.home-preview-toolbar { flex-wrap: wrap; gap: 8px; }
.website-customize-savebar { gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.website-customize-savebar .website-settings-hint { flex: 1 1 280px; font-size: 12px; line-height: 1.5; }
.website-customize-savebar .primary { min-height: 42px; }
.hq-inline-status { padding: 12px 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); font-size: 13px; }
@media(max-width: 760px) {
 .settings-shell { gap: 16px; }
 .settings-nav { max-width: 100%; }
 .receiving-page .receiving-scan-bar { flex-wrap: wrap; }
 .receiving-page .receiving-scan-input { flex: 1 1 100%; }
 .website-customize-savebar { flex-wrap: wrap; }
 .hq-report-card { padding: 16px; }
}
