/* ==========================================================================
   Tradex — Prototype design system (v0.1)
   Shared by the Storefront, ERP workspace and Vendor portal mockups.

   Layout shells are injected by assets/tradex.js based on <body data-app>.
   Page authors write only the page content inside <main>.
   ========================================================================== */

/* Inter (SIL Open Font License) bundled locally so the prototype works offline */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Ink / neutrals */
  --ink-950: #070c18;
  --ink-900: #0b1220;
  --ink-800: #121b2f;
  --ink-700: #1c2742;
  --ink-600: #2a3656;
  --tx-1: #101828;
  --tx-2: #475467;
  --tx-3: #667085;
  --tx-4: #98a2b3;
  --line: #e4e7ec;
  --line-2: #eef1f5;
  --bg: #f4f6fa;
  --bg-2: #eef2f7;
  --surface: #ffffff;

  /* Brand */
  --brand: #2e5bff;
  --brand-600: #2349e0;
  --brand-700: #1b3bbe;
  --brand-800: #172f8f;
  --brand-50: #eef2ff;
  --brand-100: #dde5ff;
  --brand-200: #bccbff;
  --accent: #ff7a1a;
  --accent-600: #ea6a0c;
  --accent-50: #fff3ea;
  --vendor: #0e9f8a;
  --vendor-50: #e6f7f4;

  /* Semantic */
  --ok: #12a150;      --ok-tx: #067647;   --ok-50: #e8f7ee;
  --warn: #f5a524;    --warn-tx: #a15c07; --warn-50: #fff6e5;
  --bad: #e5484d;     --bad-tx: #b42318;  --bad-50: #fdeceb;
  --info: #0ea5e9;    --info-tx: #026aa2; --info-50: #e6f5fd;

  /* Product condition */
  --c-new: #12a150;
  --c-openbox: #0b8ec9;
  --c-refurb: #6d4aff;
  --c-used: #c26a00;

  /* Chart roles (validated reference slots — see dataviz palette) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --st-good: #0ca30c;
  --st-warning: #fab219;
  --st-serious: #ec835a;
  --st-critical: #d03b3b;
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  /* Shape */
  --r-xs: 4px;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --sh-2: 0 4px 14px rgba(16, 24, 40, .08);
  --sh-3: 0 16px 40px rgba(16, 24, 40, .16);
  --ring: 0 0 0 3px rgba(46, 91, 255, .22);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1320px;
}

/* -------------------------------------------------------------------------- */
/* Base                                                                       */
/* -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--tx-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
h4 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num, .tnum, table { font-variant-numeric: tabular-nums; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--tx-3); }
.subtle { color: var(--tx-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 650; }
.upper { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 650; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.text-ok { color: var(--ok-tx); } .text-warn { color: var(--warn-tx); } .text-bad { color: var(--bad-tx); } .text-brand { color: var(--brand); }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 12px; }
.row-top { display: flex; align-items: flex-start; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }

/* -------------------------------------------------------------------------- */
/* Icons & product art                                                         */
/* -------------------------------------------------------------------------- */
.ic { display: inline-block; vertical-align: -0.2em; width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 28px; height: 28px; }
i[data-icon] { display: inline-flex; font-style: normal; }

.art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  overflow: hidden;
  background: radial-gradient(120% 90% at 30% 15%, var(--art-bg1, #f3f6ff) 0%, var(--art-bg2, #e3eaff) 100%);
}
.art svg.art-svg { width: 72%; height: 82%; filter: drop-shadow(0 10px 12px rgba(15, 23, 42, .12)); }
.art.square { aspect-ratio: 1 / 1; }
.art.wide { aspect-ratio: 16 / 9; }
.art.plain { background: var(--bg-2); }

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--tx-1); --b-bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
  text-decoration: none !important;
}
.btn:hover { background: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn-primary { --b-bg: var(--brand); --b-fg: #fff; --b-bd: var(--brand); }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { --b-bg: var(--accent); --b-fg: #fff; --b-bd: var(--accent); }
.btn-accent:hover { background: var(--accent-600); }
.btn-dark { --b-bg: var(--ink-900); --b-fg: #fff; --b-bd: var(--ink-900); }
.btn-dark:hover { background: var(--ink-700); }
.btn-soft { --b-bg: var(--brand-50); --b-fg: var(--brand-700); --b-bd: var(--brand-50); }
.btn-soft:hover { background: var(--brand-100); }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--tx-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--tx-1); }
.btn-danger { --b-bg: var(--surface); --b-fg: var(--bad-tx); --b-bd: #f4c7c3; }
.btn-danger:hover { background: var(--bad-50); }
.btn-ok { --b-bg: var(--ok); --b-fg: #fff; --b-bd: var(--ok); }
.btn-ok:hover { filter: brightness(.95); }
.btn-wa { --b-bg: #1faa59; --b-fg: #fff; --b-bd: #1faa59; }
.btn-wa:hover { background: #178f4a; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; gap: 4px; border-radius: var(--r-xs); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: var(--r-sm); gap: 2px; }
.seg button, .seg a { border: 0; background: transparent; padding: 5px 12px; border-radius: 5px; font-size: 12.5px; font-weight: 600; color: var(--tx-2); text-decoration: none; white-space: nowrap; }
.seg .active { background: var(--surface); color: var(--tx-1); box-shadow: var(--sh-1); }

/* -------------------------------------------------------------------------- */
/* Badges, pills, chips                                                        */
/* -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--bg-2); color: var(--tx-2);
}
.badge .ic { width: 12px; height: 12px; }
.badge.b-ok { background: var(--ok-50); color: var(--ok-tx); }
.badge.b-warn { background: var(--warn-50); color: var(--warn-tx); }
.badge.b-bad { background: var(--bad-50); color: var(--bad-tx); }
.badge.b-info { background: var(--info-50); color: var(--info-tx); }
.badge.b-brand { background: var(--brand-50); color: var(--brand-700); }
.badge.b-accent { background: var(--accent-50); color: #b24a00; }
.badge.b-dark { background: var(--ink-800); color: #fff; }
.badge.b-vendor { background: var(--vendor-50); color: #07695b; }
.badge.b-outline { background: transparent; border: 1px solid var(--line); }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.sq { border-radius: var(--r-xs); }

/* Product condition badges — always text + colour */
.cond { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-xs); font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #fff; white-space: nowrap; }
.cond.new { background: var(--c-new); }
.cond.openbox { background: var(--c-openbox); }
.cond.refurb { background: var(--c-refurb); }
.cond.used { background: var(--c-used); }
.cond.outline { background: transparent; border: 1.5px solid currentColor; }
.cond.outline.new { color: var(--c-new); } .cond.outline.openbox { color: var(--c-openbox); } .cond.outline.refurb { color: var(--c-refurb); } .cond.outline.used { color: var(--c-used); }

/* Status pills used for ERP states */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--tx-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tx-4); flex: none; }
.status.s-ok::before { background: var(--ok); } .status.s-ok { color: var(--ok-tx); }
.status.s-warn::before { background: var(--warn); } .status.s-warn { color: var(--warn-tx); }
.status.s-bad::before { background: var(--bad); } .status.s-bad { color: var(--bad-tx); }
.status.s-info::before { background: var(--info); } .status.s-info { color: var(--info-tx); }
.status.s-brand::before { background: var(--brand); } .status.s-brand { color: var(--brand-700); }
.status.s-muted { color: var(--tx-3); }

/* Severity (exceptions) — icon + label + colour, never colour alone */
.sev { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px 2px 6px; border-radius: 999px; white-space: nowrap; }
.sev .ic { width: 13px; height: 13px; }
.sev.critical { background: #fbe9e9; color: #a32121; }
.sev.serious { background: #fdefe8; color: #a8441b; }
.sev.warning { background: #fff5dc; color: #8a5a00; }
.sev.good { background: #e6f6e6; color: #0a6b0a; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--tx-2);
  font-size: 12.5px; font-weight: 550; white-space: nowrap; cursor: pointer;
}
.chip:hover { border-color: var(--tx-4); color: var(--tx-1); }
.chip.active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.chip .ic { width: 14px; height: 14px; }
.chip .x { opacity: .6; }

.kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font-size: 11px; font-family: ui-monospace, monospace; color: var(--tx-2); background: var(--surface); }

/* -------------------------------------------------------------------------- */
/* Cards & surfaces                                                            */
/* -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 15px; }
.card-head .sub { color: var(--tx-3); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card.flat { border: 0; box-shadow: none; }
.card.raised { box-shadow: var(--sh-2); border-color: transparent; }
.panel { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 16px; }
.divider-v { width: 1px; align-self: stretch; background: var(--line); }

/* Callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.callout .ic { margin-top: 1px; }
.callout.c-info { background: var(--info-50); border-color: #b9e3f8; color: #0b4a6f; }
.callout.c-ok { background: var(--ok-50); border-color: #bde8cc; color: #05603a; }
.callout.c-warn { background: var(--warn-50); border-color: #f8dca6; color: #7a4a04; }
.callout.c-bad { background: var(--bad-50); border-color: #f6c9c6; color: #912018; }
.callout.c-brand { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }
.callout strong { font-weight: 650; }

/* -------------------------------------------------------------------------- */
/* Forms                                                                       */
/* -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--tx-2); }
.field .hint { font-size: 12px; color: var(--tx-3); }
.field .err { font-size: 12px; color: var(--bad-tx); }
.req::after { content: " *"; color: var(--bad); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--tx-1); font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input.is-error { border-color: var(--bad); }
.input.is-ok { border-color: var(--ok); }
.input-sm, .select.input-sm { height: 30px; font-size: 12.5px; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.input-group .input, .input-group .select { border: 0; border-radius: 0; box-shadow: none !important; }
.input-group .addon { display: grid; place-items: center; padding: 0 10px; color: var(--tx-3); background: var(--bg); font-size: 13px; white-space: nowrap; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--tx-3); }
.input-icon .input { padding-left: 36px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--tx-4); position: relative; transition: background .15s; margin: 0; cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(14px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--r); padding: 28px; text-align: center; color: var(--tx-3); background: var(--bg); }
.dropzone .ic { margin: 0 auto 8px; color: var(--brand); width: 28px; height: 28px; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); height: 34px; }
.qty button { width: 32px; height: 100%; border: 0; background: transparent; color: var(--tx-2); display: grid; place-items: center; }
.qty button:hover { background: var(--bg); }
.qty input { width: 40px; border: 0; text-align: center; font-weight: 600; height: 100%; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* -------------------------------------------------------------------------- */
/* Tabs                                                                        */
/* -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { position: relative; border: 0; background: none; padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--tx-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--tx-1); }
.tab.active { color: var(--brand-700); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px 2px 0 0; }
.tab .count { background: var(--bg-2); color: var(--tx-2); font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.tab.active .count { background: var(--brand-50); color: var(--brand-700); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tabs.pills { border: 0; gap: 6px; }
.tabs.pills .tab { border-radius: 999px; padding: 6px 14px; }
.tabs.pills .tab.active { background: var(--ink-900); color: #fff; }
.tabs.pills .tab.active::after { display: none; }

/* -------------------------------------------------------------------------- */
/* Tables                                                                      */
/* -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--tx-3); background: #fafbfc; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: #fafbff; }
.table tr.selected td { background: var(--brand-50); }
.table .r, .table th.r { text-align: right; }
.table .c, .table th.c { text-align: center; }
.table td.check-col, .table th.check-col { width: 36px; padding-right: 0; }
.table.compact td { padding: 7px 12px; }
.table.compact th { padding: 8px 12px; }
.table tfoot td { font-weight: 650; background: #fafbfc; border-top: 1px solid var(--line); }
.table .cell-main { font-weight: 600; color: var(--tx-1); }
.table .cell-sub { font-size: 12px; color: var(--tx-3); }
.table .thumb { width: 40px; height: 40px; border-radius: var(--r-sm); flex: none; aspect-ratio: auto; }
.table .thumb svg.art-svg { width: 80%; height: 80%; filter: none; }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.bulkbar { display: none; align-items: center; gap: 10px; padding: 8px 16px; background: var(--ink-900); color: #fff; font-size: 13px; }
.bulkbar.show { display: flex; }
.bulkbar .btn { height: 28px; font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 12.5px; color: var(--tx-3); }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button { min-width: 30px; height: 30px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); font-size: 12.5px; }
.pager .pages button.active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }

/* Key-value lists */
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--tx-3); }
.kv dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.spec-table th { width: 34%; text-align: left; font-weight: 550; color: var(--tx-3); padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.spec-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); }

/* -------------------------------------------------------------------------- */
/* Progress, meters, steppers, timelines                                       */
/* -------------------------------------------------------------------------- */
.meter { height: 8px; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.meter.m-ok { background: #d2f0dd; } .meter.m-ok > span { background: var(--ok); }
.meter.m-warn { background: #fdebc4; } .meter.m-warn > span { background: var(--warn); }
.meter.m-bad { background: #f9d3d1; } .meter.m-bad > span { background: var(--bad); }
.meter.thin { height: 5px; }

.stepper { display: flex; align-items: center; gap: 0; counter-reset: step; }
.stepper .step { display: flex; align-items: center; gap: 10px; flex: 1; font-weight: 600; font-size: 13px; color: var(--tx-3); }
.stepper .step .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--surface); font-size: 12px; flex: none; }
.stepper .step::after { content: ""; flex: 1; height: 2px; background: var(--line); margin: 0 12px; border-radius: 2px; }
.stepper .step:last-child { flex: none; }
.stepper .step:last-child::after { display: none; }
.stepper .step.done { color: var(--tx-1); }
.stepper .step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .step.done::after { background: var(--ok); }
.stepper .step.current { color: var(--brand-700); }
.stepper .step.current .dot { border-color: var(--brand); color: var(--brand); box-shadow: var(--ring); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 20px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .t-dot { position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--tx-3); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.timeline .t-dot .ic { width: 11px; height: 11px; stroke-width: 3; }
.timeline li.done .t-dot { background: var(--ok); color: #fff; box-shadow: none; }
.timeline li.done::before { background: var(--ok); }
.timeline li.current .t-dot { background: var(--brand); color: #fff; box-shadow: var(--ring); }
.timeline li.warn .t-dot { background: var(--warn); color: #fff; box-shadow: none; }
.timeline .t-title { font-weight: 600; font-size: 13.5px; }
.timeline .t-meta { font-size: 12px; color: var(--tx-3); }

/* Avatar */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand); flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.sq { border-radius: var(--r-sm); }
.av-stack { display: flex; }
.av-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.av-stack .avatar:first-child { margin-left: 0; }

/* Stars */
.stars { display: inline-flex; align-items: center; gap: 1px; color: #f5a524; }
.stars .ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.stars .ic.off { fill: #d9dde5; }
.rating-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--ok); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 4px; }
.rating-pill .ic { width: 11px; height: 11px; fill: #fff; stroke: none; }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--tx-3); }
.empty .ic { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--tx-4); }
.empty h4 { color: var(--tx-1); margin-bottom: 4px; }

/* Skeleton */
.skel { background: linear-gradient(90deg, #eef1f5 0%, #f7f9fb 50%, #eef1f5 100%); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius: var(--r-sm); }
@keyframes skel { to { background-position: -200% 0; } }

/* -------------------------------------------------------------------------- */
/* Overlays: modal, drawer, toast, dropdown, tooltip                           */
/* -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 60px 20px; background: rgba(7, 12, 24, .55); overflow-y: auto; }
.modal.open { display: flex; animation: fade .15s; }
.modal-card { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); animation: rise .18s; }
.modal-card.lg { max-width: 820px; }
.modal-card.xl { max-width: 1080px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #fafbfc; border-radius: 0 0 var(--r-lg) var(--r-lg); }

.drawer { position: fixed; inset: 0; z-index: 190; display: none; background: rgba(7, 12, 24, .45); }
.drawer.open { display: block; animation: fade .15s; }
.drawer-card { position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--surface); box-shadow: var(--sh-3); display: flex; flex-direction: column; animation: slidein .2s; }
.drawer-card.wide { width: min(880px, 100%); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fafbfc; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } }

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink-900); color: #fff; padding: 11px 16px; border-radius: var(--r); box-shadow: var(--sh-3); font-size: 13.5px; font-weight: 500; animation: rise .2s; pointer-events: auto; }
.toast .ic { color: #5ee29a; }

.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-3); padding: 6px; z-index: 150; display: none; color: var(--tx-1); }
.dd-menu.left { left: 0; right: auto; }
.dd.open .dd-menu { display: block; animation: rise .12s; }
.dd-menu a, .dd-menu button.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); border: 0; background: none; color: var(--tx-1); font-size: 13px; text-align: left; text-decoration: none; }
.dd-menu a:hover, .dd-menu button.dd-item:hover { background: var(--bg); }
.dd-menu .dd-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-4); }
.dd-menu hr { margin: 6px 0; }

[data-tip] { position: relative; }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink-900); color: #fff; font-size: 11.5px; font-weight: 500; padding: 5px 8px; border-radius: 5px; white-space: nowrap; z-index: 60; pointer-events: none; }

/* -------------------------------------------------------------------------- */
/* Prototype toolbar & annotations                                             */
/* -------------------------------------------------------------------------- */
.protobar { position: relative; z-index: 120; background: var(--ink-950); color: #c9d2e3; font-size: 12.5px; border-bottom: 1px solid #1a2338; }
.protobar .pb-inner { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 16px; }
.protobar .pb-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #fff; }
.protobar .pb-tag .badge { background: #26324f; color: #9fb4ff; height: 18px; font-size: 10.5px; }
.protobar .seg { background: #141d31; }
.protobar .seg button, .protobar .seg a { color: #9aa6bf; font-size: 12px; padding: 4px 10px; }
.protobar .seg .active { background: #2a3656; color: #fff; box-shadow: none; }
.protobar .pb-sep { width: 1px; height: 20px; background: #26324f; }
.protobar .pb-btn { display: inline-flex; align-items: center; gap: 6px; background: #141d31; border: 1px solid #26324f; color: #c9d2e3; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.protobar .pb-btn:hover { background: #1c2742; color: #fff; }
.protobar .pb-btn.on { background: #3a2a0d; border-color: #7a5410; color: #ffcf70; }
.protobar .dd-menu { max-height: 70vh; overflow-y: auto; min-width: 280px; }
.protobar-mini { position: fixed; left: 12px; bottom: 12px; z-index: 250; display: none; }
.proto-hidden .protobar { display: none; }
.proto-hidden .protobar-mini { display: inline-flex; }

/* Annotation pins — shown when "Phase notes" is on */
[data-anno] { position: relative; }
body.annot-on [data-anno] { outline: 1.5px dashed rgba(245, 165, 36, .9); outline-offset: 3px; }
body.annot-on [data-anno]::before {
  content: attr(data-anno);
  position: absolute; top: -12px; left: 8px; z-index: 40;
  background: #ffcf70; color: #3d2800;
  font: 700 10.5px/1 var(--font); letter-spacing: .01em;
  padding: 4px 7px; border-radius: 4px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Brand                                                                       */
/* -------------------------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none !important; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #4d7bff 0%, #2349e0 55%, #1b2fa8 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(35, 73, 224, .35); }
.logo-mark svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.logo-word { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; line-height: 1; }
.logo-word b { color: var(--accent); font-weight: 800; }
.logo-sub { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .6; margin-top: 2px; }

/* Storefront base rules that the responsive section below adapts (Studio identity · D-281) */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.pgrid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pgrid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pgrid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pgrid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pgrid.rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.pgrid.rail .pcard { flex: 0 0 240px; scroll-snap-align: start; }

/* Help widget, compare tray ---------------------------------------------- */
.helpfab { position: fixed; right: 22px; bottom: 22px; z-index: 140; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.helpfab .fab { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--st-ink); color: #fff; box-shadow: var(--sh-3); font-weight: 650; }
.helpfab .fab .ic { width: 20px; height: 20px; color: var(--st-volt); }
.helpfab .fab-wa { width: 50px; height: 50px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #1faa59; color: #fff; box-shadow: var(--sh-3); }
.chatbox { display: none; width: 370px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-3); }
.helpfab.open .chatbox { display: block; animation: rise .15s; }
.chatbox .cb-head { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--st-ink); color: #fff; }
.chatbox .cb-body { display: flex; flex-direction: column; gap: 10px; height: 300px; overflow-y: auto; padding: 14px; background: var(--st-paper); }
.msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; }
.msg.bot { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--st-ink); color: #fff; border-top-right-radius: 4px; }
.msg.sys { align-self: center; padding: 0; background: transparent; color: var(--tx-3); font-size: 11.5px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--st-ink); font-size: 12.5px; font-weight: 600; }
.quick button:hover { border-color: var(--st-ink); }
.chatbox .cb-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.compare-tray { position: fixed; left: 50%; bottom: 18px; z-index: 130; transform: translateX(-50%); display: none; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 18px; background: var(--st-ink); color: #fff; box-shadow: var(--sh-3); }
.compare-tray.show { display: flex; animation: rise .15s; }
.compare-tray .slots { display: flex; gap: 8px; }
.compare-tray .slot { width: 46px; height: 46px; overflow: hidden; border-radius: 10px; background: #2a2e36; }

/* Menu drawer (tablet & phone) -------------------------------------------- */
.s-drawer { position: fixed; inset: 0; z-index: 260; }
.s-drawer[hidden] { display: none; }
.sd-backdrop { position: absolute; inset: 0; background: rgba(17, 19, 23, .5); opacity: 0; transition: opacity .2s; }
.sd-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(360px, 88vw); display: flex; flex-direction: column; background: #fff; box-shadow: var(--sh-3); transform: translateX(-100%); transition: transform .22s ease; }
.s-drawer.open .sd-backdrop { opacity: 1; }
.s-drawer.open .sd-panel { transform: none; }
.sd-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 14px 16px; background: var(--st-paper-2); color: var(--st-ink); }
.sd-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--st-ink); text-decoration: none !important; }
.sd-user b { display: block; font-size: 15px; }
.sd-user small { display: block; color: var(--tx-3); font-size: 12px; }
.sd-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--st-ink); color: var(--st-volt); font-size: 13px; font-weight: 700; }
.sd-close { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--st-ink); }
.sd-close:hover { background: #fff; }
.sd-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; }
.sd-pin { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; color: var(--tx-2); font-size: 13px; text-align: left; }
.sd-pin > span { flex: 1; }
.sd-pin b { color: var(--tx-1); }
.sd-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.sd-quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; border-radius: 14px; background: var(--st-paper); color: var(--tx-1); font-size: 11.5px; font-weight: 600; text-align: center; text-decoration: none !important; }
.sd-quick a .ic { color: var(--st-ink); }
.sd-quick b { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--st-volt); color: var(--st-ink); font-size: 10.5px; }
.sd-sec { padding: 18px 16px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.sd-link, .sd-acc summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; color: var(--tx-1); font-size: 14.5px; font-weight: 550; text-decoration: none !important; cursor: pointer; list-style: none; }
.sd-link > span, .sd-acc summary > span { flex: 1; min-width: 0; }
.sd-link > .ic:first-child, .sd-acc summary > .ic:first-child { color: var(--tx-3); }
.sd-link > .ic:last-child, .sd-chev { color: var(--tx-4); transition: transform .15s; }
.sd-link:hover, .sd-acc summary:hover { background: var(--st-paper); }
.sd-acc summary::-webkit-details-marker { display: none; }
.sd-acc[open] > summary { background: var(--st-paper); color: var(--st-ink); }
.sd-acc[open] > summary > .ic:first-child { color: var(--st-ink); }
.sd-acc[open] .sd-chev { transform: rotate(180deg); }
.sd-sub { display: flex; flex-direction: column; padding: 4px 0 8px 46px; border-bottom: 1px solid var(--line-2); }
.sd-sub a { padding: 11px 16px 11px 0; color: var(--tx-2); font-size: 14px; text-decoration: none !important; }
.sd-sub a:hover { color: var(--st-ink); }
.sd-out { margin-top: 12px; border-top: 1px solid var(--line-2); color: var(--tx-2); }
.s-tabbar { display: none; }


/* Price block */
.price { display: flex; flex-direction: column; gap: 2px; }
.price .p-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .p-now { font-size: 19px; font-weight: 750; color: var(--tx-1); letter-spacing: -0.01em; }
.price .p-mrp { font-size: 12.5px; color: var(--tx-4); text-decoration: line-through; }
.price .p-off { font-size: 12.5px; font-weight: 700; color: var(--ok-tx); white-space: nowrap; }
.price .p-tax { font-size: 11.5px; color: var(--tx-3); }
.price .p-dealer-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: #07695b; background: var(--vendor-50); padding: 1px 6px; border-radius: 4px; }
.price .p-tier { font-size: 11.5px; color: #07695b; font-weight: 600; }
.price .p-lock { font-size: 11.5px; color: var(--brand-700); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.price.lg .p-now { font-size: 30px; }
.price.lg .p-mrp, .price.lg .p-off { font-size: 14px; }
.price.md .p-now { font-size: 22px; }

/* View-as visibility helpers (storefront buyer context) */
/* Hide-only rules, so shown elements keep their authored display (flex, inline-flex…) */
body:not(.view-dealer) .only-dealer { display: none !important; }
body.view-dealer .hide-dealer { display: none !important; }
body:not(.view-guest) .only-guest { display: none !important; }
body.view-guest .hide-guest { display: none !important; }
body.view-guest .only-signed { display: none !important; }

/* ========================================================================== */
/* ERP / VENDOR WORKSPACE                                                      */
/* ========================================================================== */
body[data-app="erp"], body[data-app="vendor"] { background: var(--bg); }
.ws { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 40px); }
.proto-hidden .ws { min-height: 100vh; }
.ws-side { background: var(--ink-900); color: #aab4c8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.ws-side .ws-brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px; color: #fff; }
.ws-side .ws-brand .logo-word { font-size: 19px; }
.ws-side .ws-org { margin: 0 12px 12px; padding: 9px 10px; border-radius: var(--r); background: #121b2f; border: 1px solid #1f2a44; display: flex; align-items: center; gap: 10px; color: #dfe5f1; font-size: 12.5px; cursor: pointer; }
.ws-side .ws-org small { display: block; color: #7d89a3; font-size: 11px; }
.ws-nav { padding: 4px 10px 16px; display: flex; flex-direction: column; gap: 1px; }
.ws-nav .grp { padding: 14px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #5f6b85; }
.ws-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: #aab4c8; font-size: 13.5px; font-weight: 550; text-decoration: none; }
.ws-nav a .ic { width: 17px; height: 17px; color: #7d89a3; }
.ws-nav a:hover { background: #151f36; color: #fff; }
.ws-nav a.active { background: linear-gradient(90deg, rgba(46,91,255,.28), rgba(46,91,255,.08)); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.ws-nav a.active .ic { color: #8fa8ff; }
.ws-nav a .n { margin-left: auto; font-size: 11px; font-weight: 700; background: #26324f; color: #dfe5f1; padding: 1px 7px; border-radius: 999px; }
.ws-nav a .n.hot { background: var(--bad); color: #fff; }
.ws-nav a .ph { margin-left: auto; font-size: 10px; font-weight: 700; color: #7d89a3; border: 1px solid #2a3656; padding: 0 5px; border-radius: 4px; }
.ws-side .ws-foot { margin-top: auto; padding: 12px; border-top: 1px solid #1a2338; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #dfe5f1; }
.ws-side .ws-foot small { display: block; color: #7d89a3; font-size: 11px; }
body[data-app="vendor"] .ws-side { background: #07231f; }
body[data-app="vendor"] .ws-side .ws-org { background: #0b2f29; border-color: #124039; }
body[data-app="vendor"] .ws-nav a:hover { background: #0c332c; }
body[data-app="vendor"] .ws-nav a.active { background: linear-gradient(90deg, rgba(14,159,138,.35), rgba(14,159,138,.08)); box-shadow: inset 2px 0 0 #2fd3b8; }
body[data-app="vendor"] .ws-nav a.active .ic { color: #6ee7d3; }
body[data-app="vendor"] .ws-nav .grp { color: #4d7a72; }
body[data-app="vendor"] .ws-side .ws-foot { border-color: #0f3a33; }

.ws-body { display: flex; flex-direction: column; min-width: 0; }
.ws-top { position: sticky; top: 0; z-index: 90; height: 60px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; }
.ws-top .ws-search { flex: 1; max-width: 520px; position: relative; }
.ws-top .ws-search .input { height: 38px; padding-left: 38px; padding-right: 64px; background: var(--bg); border-color: transparent; }
.ws-top .ws-search .input:focus { background: #fff; }
.ws-top .ws-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tx-3); }
.ws-top .ws-search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.ws-top .top-btn { position: relative; width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--tx-2); border: 0; background: transparent; }
.ws-top .top-btn:hover { background: var(--bg); color: var(--tx-1); }
.ws-top .top-btn .pip { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid #fff; }
.ws-top .ws-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: var(--r); cursor: pointer; font-size: 12.5px; line-height: 1.2; }
.ws-top .ws-user:hover { background: var(--bg); }
.ws-top .ws-user small { display: block; color: var(--tx-3); font-size: 11.5px; }
.ws-main { padding: 24px 28px 48px; min-width: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head .sub { color: var(--tx-3); margin-top: 4px; font-size: 13.5px; }
.page-head .crumbs { margin-bottom: 8px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filterbar .select, .filterbar .input { width: auto; height: 34px; font-size: 13px; background-color: #fff; }
.filterbar .input-icon .input { width: 100%; }

/* KPI / stat tiles */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .k-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tx-3); font-weight: 550; }
.kpi .k-label .ic { width: 15px; height: 15px; }
.kpi .k-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--tx-1); line-height: 1.15; font-variant-numeric: proportional-nums; }
.kpi .k-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--tx-3); }
.kpi .k-foot .spark { flex: none; }
.kpi .k-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-sub { font-size: 12px; color: var(--tx-3); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 12px; white-space: nowrap; }
.delta .ic { width: 13px; height: 13px; }
.delta.up-good, .delta.down-good { color: #006300; }
.delta.up-bad, .delta.down-bad { color: #b42318; }
.spark { width: 96px; height: 28px; }

/* Exceptions list */
.exc { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.exc:last-child { border-bottom: 0; }
.exc:hover { background: #fafbff; }
.exc .e-title { font-weight: 600; font-size: 13.5px; }
.exc .e-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--tx-3); margin-top: 3px; }
.exc .e-meta span { display: inline-flex; align-items: center; gap: 4px; }
.exc .e-meta .ic { width: 12px; height: 12px; }
.exc .e-act { display: flex; gap: 6px; }

/* List rows */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.list-row .li-icon { width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center; background: var(--bg-2); color: var(--tx-2); flex: none; }
.list-row .li-icon.brand { background: var(--brand-50); color: var(--brand); }
.list-row .li-icon.ok { background: var(--ok-50); color: var(--ok-tx); }
.list-row .li-icon.warn { background: var(--warn-50); color: var(--warn-tx); }
.list-row .li-icon.bad { background: var(--bad-50); color: var(--bad-tx); }
.list-row .li-icon.vendor { background: var(--vendor-50); color: #07695b; }

/* Pipeline strip */
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; }
.pipeline .stage { padding: 14px 16px; border-right: 1px solid var(--line-2); position: relative; }
.pipeline .stage:last-child { border-right: 0; }
.pipeline .stage .s-n { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.pipeline .stage .s-l { font-size: 12px; color: var(--tx-3); font-weight: 550; }
.pipeline .stage .s-w { font-size: 11.5px; margin-top: 4px; }

/* Scan box (warehouse) */
.scanbox { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid var(--brand); border-radius: var(--r); background: var(--brand-50); }
.scanbox .input { background: #fff; font-family: ui-monospace, monospace; font-size: 15px; height: 44px; }

/* Diff view (vendor submission review) */
.diff { display: grid; grid-template-columns: 180px 1fr 1fr; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.diff > div { padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.diff .dh { background: #fafbfc; font-weight: 650; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--tx-3); }
.diff .old { background: #fff5f5; color: #912018; text-decoration: line-through; text-decoration-color: rgba(145,32,24,.4); }
.diff .new { background: #f0fbf4; color: #05603a; }
.diff .same { color: var(--tx-2); }

/* Permission matrix */
.perm { text-align: center; }
.perm .ic { margin: 0 auto; width: 16px; height: 16px; }
.perm .yes { color: var(--ok); }
.perm .no { color: var(--tx-4); }
.perm .lim { color: var(--warn-tx); font-size: 11.5px; font-weight: 650; }

/* Chat inbox (support) */
.inbox { display: grid; grid-template-columns: 320px 1fr 300px; height: calc(100vh - 200px); min-height: 560px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.inbox > * { min-height: 0; }
.inbox .ib-list { border-right: 1px solid var(--line); overflow-y: auto; }
.inbox .ib-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.inbox .ib-item:hover { background: var(--bg); }
.inbox .ib-item.active { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
.inbox .ib-thread { display: flex; flex-direction: column; min-width: 0; }
.inbox .ib-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: #f7f8fb; }
.inbox .ib-side { border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; }

/* ========================================================================== */
/* Charts                                                                      */
/* ========================================================================== */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .ax-label { fill: #898781; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .end-label { fill: var(--tx-1); font-size: 11.5px; font-weight: 600; }
.chart .end-label-sub { fill: var(--tx-3); font-size: 11px; }
.chart .crosshair { stroke: #898781; stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar:hover, .chart .bar.hover { opacity: .8; }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-2); border-radius: var(--r-sm); padding: 8px 10px; font-size: 12px; min-width: 150px; z-index: 5; display: none; }
.chart-tip .tt-h { color: var(--tx-3); font-size: 11.5px; margin-bottom: 4px; }
.chart-tip .tt-r { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.chart-tip .tt-r .key { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.chart-tip .tt-r b { font-weight: 700; color: var(--tx-1); font-variant-numeric: tabular-nums; }
.chart-tip .tt-r span { color: var(--tx-2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--tx-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .lk { width: 14px; height: 2px; border-radius: 2px; }
.legend .lk.rect { width: 10px; height: 10px; border-radius: 2px; }
.chart-table { display: none; }
.chart-wrap.show-table .chart { display: none; }
.chart-wrap.show-table .chart-table { display: block; }

/* ========================================================================== */
/* Prototype hub (index)                                                       */
/* ========================================================================== */
body[data-app="hub"] { background: #f4f6fa; }
.hub-hero { background: radial-gradient(80% 120% at 90% 0%, #2e5bff 0%, #15247a 40%, #070c18 100%); color: #fff; padding: 56px 0 120px; }
.hub-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; margin-top: 18px; }
.hub-hero p { color: #c3cdf0; font-size: 16px; max-width: 700px; margin-top: 14px; }
.hub-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: -84px; }
.app-card { background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: 24px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); }
.app-card .ac-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.app-card h3 { font-size: 19px; }
.app-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.app-card li a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; margin: 0 -10px; border-radius: var(--r-sm); color: var(--tx-1); font-weight: 550; font-size: 13.5px; }
.app-card li a:hover { background: var(--bg); text-decoration: none; }
.app-card li a .ic { color: var(--tx-4); width: 15px; height: 15px; }
.phase-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.phase { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; position: relative; }
.phase .ph-n { font-size: 12px; font-weight: 800; color: var(--brand); letter-spacing: .04em; }
.phase h4 { margin-top: 4px; font-size: 14.5px; }
.phase p { font-size: 12.5px; color: var(--tx-3); margin-top: 6px; }
.phase.now { border-color: var(--brand); box-shadow: var(--ring); }

/* -------------------------------------------------------------------------- */
/* Mobile / tablet storefront shell (hidden on desktop)                        */
/* -------------------------------------------------------------------------- */
.protobar .pb-more { display: none; }
.pb-rest { display: contents; }
.pb-view { display: flex; align-items: center; gap: 14px; }
html.s-lock, html.s-lock body { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 265; display: none; background: rgba(7, 12, 24, .55); }
.sheet-backdrop.show { display: block; animation: fade .15s; }
.sheet-only { display: none; }
@media (max-width: 980px) { .sheet-only { display: revert; } .hide-sheet { display: none; } }

/* Storefront tables inside scroll wrappers keep readable column widths on tablets and phones */
@media (max-width: 980px) {
  body[data-app="store"] .table-wrap > .table:has(tr > :nth-child(3)) { min-width: 480px; }
  body[data-app="store"] .table-wrap > .table:has(tr > :nth-child(4)) { min-width: 640px; }
  body[data-app="store"] .table-wrap > .table:has(tr > :nth-child(5)) { min-width: 800px; }
  body[data-app="store"] .table-wrap > .table:has(tr > :nth-child(6)) { min-width: 960px; }
  body[data-app="store"] .table-wrap > .table :is(td, th):not(.check-col):not(:empty) { min-width: 150px; }
  body[data-app="store"] .table-wrap > .table td:not(.check-col):not(:empty):has(.cell-sub) { min-width: 190px; }
  body[data-app="store"] .table-wrap > .table td.r:not(.check-col):not(:empty):has(.cell-sub) { min-width: 170px; }
  body[data-app="store"] .table-wrap > .table td:not(.check-col):not(:empty):has(> .row) { min-width: 230px; }
}

/* Page grids with inline column templates opt in to stacking: .stack-md (tablet and below), .stack-sm (phone) */
@media (max-width: 980px) { .stack-md { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 760px) { .stack-sm { grid-template-columns: minmax(0, 1fr) !important; } }

/* Touch devices: no sticky hover tooltips */
@media (hover: none) { [data-tip]:hover::after { display: none; } }

/* -------------------------------------------------------------------------- */
/* Responsive                                                                  */
/* Storefront: desktop ≥ 981 px · tablet 761–980 px · phone ≤ 760 px.          */
/* ERP / vendor keep the desktop-first rules (staff mobile is Phase 2).        */
/* -------------------------------------------------------------------------- */
@media (max-width: 1360px) {
  /* The prototype toolbar needs ~1350 px on the storefront: collapse it into a menu panel */
  body[data-app="store"] .protobar .pb-more { display: inline-flex; margin-left: auto; }
  body[data-app="store"] .pb-rest { display: none; }
  body[data-app="store"] .protobar.pb-open .pb-rest { display: flex; }
}
@media (max-width: 1100px) {
  .protobar .pb-more { display: inline-flex; margin-left: auto; }
  .pb-rest { display: none; }
  .protobar.pb-open .pb-rest { display: flex; }
}
/* Prototype toolbar panel (collapsed state) */
.protobar.pb-open .pb-rest { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 16px 16px; background: var(--ink-950); border-bottom: 1px solid #1a2338; box-shadow: var(--sh-3); }
.protobar.pb-open .pb-rest .pb-sep { display: none; }
.protobar.pb-open .pb-rest .ml-auto { margin-left: 0; }
.protobar.pb-open .pb-rest .seg { flex-wrap: wrap; }
.protobar.pb-open .pb-view { gap: 10px; flex-wrap: wrap; }
.protobar.pb-open .pb-more { background: #1c2742; color: #fff; }

@media (max-width: 1200px) {
  .pgrid.cols-5, .pgrid.cols-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inbox { grid-template-columns: 280px 1fr; }
  .inbox .ib-side { display: none; }
}

/* Tablet and below ------------------------------------------------------- */
@media (max-width: 980px) {
  .ws { grid-template-columns: 1fr; }
  .ws-side { position: static; height: auto; }
  .g-3, .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-3 { grid-column: 1 / -1; }
  .hub-apps, .phase-grid { grid-template-columns: 1fr; }
  .pgrid.cols-3, .pgrid.cols-4, .pgrid.cols-5, .pgrid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .container { padding: 0 20px; }

}

/* Phone ------------------------------------------------------------------- */
@media (max-width: 760px) {
  body[data-app="store"] { --s-bottom: 60px; }
  body[data-app="store"] .s-footer { padding-bottom: var(--s-bottom); }
  .protobar-mini { bottom: calc(var(--s-bottom, 0px) + 12px); }
  body[data-app="store"][data-page="checkout"], body[data-app="store"][data-page="product"] { --s-bottom: 0px; }
  .container { padding: 0 16px; }
  h1 { font-size: 22px; }
  .section { margin-top: 26px; }
  .section-head { flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
  .section-head h2 { font-size: 18px; }

  /* Prototype toolbar: brand + menu button only */
  .protobar .pb-tag .badge { display: none; }

  /* Bottom bar */
  .s-tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
  .s-tabbar a, .s-tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--tx-3); font-size: 11px; font-weight: 600; text-decoration: none !important; }
  .s-tabbar .ic { width: 22px; height: 22px; }
  .s-tabbar .on { color: var(--brand-700); }
  .s-tabbar .on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .s-tabbar .count { position: absolute; top: 5px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
  body[data-page="checkout"] .s-tabbar, body[data-page="product"] .s-tabbar { display: none; }

  /* Floating help, compare tray and toasts sit above the bottom bar */
  .helpfab { right: 12px; bottom: calc(var(--s-bottom) + 12px); }
  body:has(.compare-tray.show) .helpfab { bottom: calc(var(--s-bottom) + 76px); }
  .helpfab .fab { width: 48px; padding: 0; justify-content: center; }
  .helpfab .fab > span { display: none; }
  .chatbox { position: fixed; left: 8px; right: 8px; bottom: calc(var(--s-bottom) + 72px); width: auto; }
  .chatbox .cb-body { height: min(320px, calc(100vh - var(--s-bottom) - 280px)); }
  .compare-tray { left: 8px; right: 8px; bottom: calc(var(--s-bottom) + 8px); transform: none; gap: 10px; padding: 8px 10px 8px 12px; }
  .compare-tray .slots { gap: 6px; margin-left: auto; }
  .compare-tray .slot { width: 34px; height: 34px; }
  .toasts { bottom: calc(var(--s-bottom) + 16px); width: calc(100% - 24px); }
  .toast { max-width: 100%; }

  /* Modals become bottom sheets */
  .modal { padding: 0; align-items: flex-end; }
  .modal-card, .modal-card.lg, .modal-card.xl { max-width: none; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; }
  .modal-head { position: sticky; top: 0; z-index: 3; background: var(--surface); padding: 14px 16px; border-radius: 16px 16px 0 0; }
  .modal-body { padding: 16px; }
  .modal-foot { position: sticky; bottom: 0; flex-wrap: wrap; padding: 12px 16px; border-radius: 0; }
  .drawer-head, .drawer-body { padding: 16px; }
  .drawer-foot { padding: 12px 16px; flex-wrap: wrap; }
  .dd-menu { max-width: calc(100vw - 24px); }

  /* Components */
  .g-2, .g-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .g-4, .g-5, .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3, .form-grid .full { grid-column: 1 / -1; }
  .card-pad, .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; flex-wrap: wrap; }
  .card-foot { padding: 12px 16px; flex-wrap: wrap; }
  .kv { grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); }
  .tabs { scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .pager { flex-wrap: wrap; gap: 10px; }
  .row-between { flex-wrap: wrap; }
  /* Field rows (input + badge + button): the input gets its own line */
  .field > .row { flex-wrap: wrap; }
  .field > .row > .grow { flex: 1 1 100%; }
  /* Rows holding large buttons or callout actions wrap instead of squeezing their text */
  .row:has(> .btn-lg), .callout .row, .modal-body .row:has(> .btn), .row:has(> .btn):has(> .small, > .tiny) { flex-wrap: wrap; }
  /* Wide tables keep readable columns and scroll sideways inside their wrapper */
  .filterbar .seg, .table-toolbar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filterbar .seg > *, .table-toolbar .seg > * { flex: none; }
  /* Phones: finished/upcoming steps shrink to dot + short connector; the current step gets the room for its label */
  .stepper .step:not(.current) { flex: 0 0 auto; }
  .stepper .step:not(.current)::after { flex: 0 0 14px; }
  .stepper .step.current { flex: 1 1 auto; }
  .callout { flex-wrap: wrap; }
  .callout > div { flex: 1 1 200px; min-width: 0; }
  .stepper .step { font-size: 0; gap: 6px; }
  .stepper .step .dot { font-size: 12px; }
  .stepper .step.current { font-size: 12px; line-height: 1.2; min-width: 0; }
  /* List rows with a trailing action: the action drops under the text instead of squeezing it */
  .list-row { flex-wrap: wrap; }
  .list-row > .grow { flex: 1 1 calc(100% - 60px); }
  .list-row > .grow ~ .btn, .list-row > .grow ~ .row-actions { margin-left: 48px; }
  .stepper .step::after { margin: 0 6px; min-width: 6px; }
  .table td, .table th { padding-left: 12px; padding-right: 12px; }
  body.annot-on [data-anno]::before { white-space: normal; max-width: calc(100vw - 48px); }
  .stepper .step.current:last-child { flex: 0 1 auto; }
  /* Segmented filters and button rows never force the page wider */
  .filterbar .seg, .card-head .seg, .section-head .seg, .panel-head .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filterbar .seg::-webkit-scrollbar, .card-head .seg::-webkit-scrollbar, .section-head .seg::-webkit-scrollbar, .panel-head .seg::-webkit-scrollbar { display: none; }
  .seg > button, .seg > a { flex: none; }
  .filterbar { gap: 8px; }
  .filterbar > * { max-width: 100%; }
  .empty .row, .callout .row, .card-foot .row, .state-panel .row, .drawer-foot, .modal-foot { flex-wrap: wrap; }
  .empty .row { justify-content: center; }
  /* Record tables (.m-stack) become one card per row, each value labelled with its column name */
  .table.m-stack { min-width: 0 !important; table-layout: auto !important; }
  .table.m-stack thead { display: none; }
  .table.m-stack, .table.m-stack tbody, .table.m-stack tfoot, .table.m-stack tr { display: block; width: 100%; }
  .table.m-stack tr { padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
  .table.m-stack tbody tr:hover td { background: none; }
  .table.m-stack td { display: grid; grid-template-columns: minmax(92px, 36%) minmax(0, 1fr); gap: 2px 12px; align-items: baseline; padding: 4px 0 !important; border: 0; text-align: left !important; white-space: normal !important; background: none !important; }
  .table.m-stack td::before { content: attr(data-label); color: var(--tx-3); font-size: 11px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; }
  .table.m-stack td[data-label=""] { grid-template-columns: minmax(0, 1fr); }
  .table.m-stack td[data-label=""]::before { display: none; }
  .table.m-stack td:first-child { grid-template-columns: minmax(0, 1fr); padding-bottom: 6px !important; font-weight: 600; }
  .table.m-stack td:first-child::before { display: none; }
  .table.m-stack td > * { min-width: 0; }
  .table.m-stack td .row-actions, .table.m-stack td > .btn { justify-self: start; }
  .table.m-stack td.check-col { display: none; }
  .table.m-stack tfoot td { background: none; border-top: 0; }

}

/* Small phones -------------------------------------------------------------- */
@media (max-width: 420px) {
  .protobar .pb-tag a { font-size: 0; gap: 0 !important; }
  .protobar .pb-tag a::after { content: "Prototype"; font-size: 12.5px; margin-left: 8px; }
  .compare-tray .slots { display: none; }
  .compare-tray > div:first-child { margin-right: auto; }
  .sd-quick { gap: 6px; padding: 12px; }
  /* Steppers: shorter connectors so the current step's label keeps two lines at most */
  .stepper .step::after { margin: 0 3px; }
  .stepper .step:not(.current)::after { flex: 0 0 8px; }
}

/* -------------------------------------------------------------------------- */
/* Photos (real product imagery — see credits.html)                            */
/* -------------------------------------------------------------------------- */
.ph { position: relative; overflow: hidden; background: #eef1f5; aspect-ratio: 5 / 4; border-radius: var(--r); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.ph.square { aspect-ratio: 1 / 1; }
.ph.wide { aspect-ratio: 16 / 9; }
.ph.contain img { object-fit: contain; background: #fff; }
.ph.round-0 { border-radius: 0; }
.thumb.ph { width: 44px; height: 44px; aspect-ratio: auto; border-radius: var(--r-sm); flex: none; }
.thumb-lg.ph { width: 64px; height: 64px; aspect-ratio: auto; border-radius: var(--r-sm); flex: none; }
.compare-tray .slot .ph { aspect-ratio: 1; border-radius: 0; width: 100%; height: 100%; }
.select.is-error, .textarea.is-error { border-color: var(--bad); }

/* Vendor portal accent (teal) for interactive states */
body[data-app="vendor"] { --ring: 0 0 0 3px rgba(14, 159, 138, .22); }
body[data-app="vendor"] .btn-primary { --b-bg: var(--vendor); --b-bd: var(--vendor); }
body[data-app="vendor"] .btn-primary:hover { background: #0b8a78; }
body[data-app="vendor"] .btn-soft { --b-bg: var(--vendor-50); --b-fg: #07695b; --b-bd: var(--vendor-50); }
body[data-app="vendor"] .tab.active { color: #07695b; }
body[data-app="vendor"] .tab.active::after { background: var(--vendor); }
body[data-app="vendor"] .tab.active .count { background: var(--vendor-50); color: #07695b; }
body[data-app="vendor"] .stepper .step.current { color: #07695b; }
body[data-app="vendor"] .stepper .step.current .dot { border-color: var(--vendor); color: var(--vendor); }
body[data-app="vendor"] .timeline li.current .t-dot { background: var(--vendor); }
body[data-app="vendor"] .switch input:checked { background: var(--vendor); }
body[data-app="vendor"] input[type="checkbox"], body[data-app="vendor"] input[type="radio"] { accent-color: var(--vendor); }
body[data-app="vendor"] .input:focus, body[data-app="vendor"] .select:focus, body[data-app="vendor"] .textarea:focus { border-color: var(--vendor); }
body[data-app="vendor"] .input-group:focus-within { border-color: var(--vendor); }
body[data-app="vendor"] .meter:not(.m-ok):not(.m-warn):not(.m-bad) { background: #cdeee8; }
body[data-app="vendor"] .meter:not(.m-ok):not(.m-warn):not(.m-bad) > span { background: var(--vendor); }

/* Anchored sections clear the sticky store header */
body[data-app="store"] [id] { scroll-margin-top: 130px; }
body[data-app="erp"] [id], body[data-app="vendor"] [id] { scroll-margin-top: 76px; }
.pgrid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* -------------------------------------------------------------------------- */
/* Contextual help — ⓘ buttons, glossary terms, help panel (ERP & vendor)      */
/* -------------------------------------------------------------------------- */
button.hi { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin: 0 0 0 5px; border: 0; border-radius: 50%; background: none; color: var(--tx-4); cursor: pointer; vertical-align: -3px; flex: none; line-height: 1; font: inherit; text-transform: none; letter-spacing: 0; }
button.hi .ic { width: 15px; height: 15px; }
button.hi:hover, button.hi:focus-visible { color: var(--brand); background: var(--brand-50); }
button.hi:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
th button.hi, .upper button.hi, .k-label button.hi { width: 16px; height: 16px; margin-left: 3px; }
th button.hi .ic, .upper button.hi .ic, .k-label button.hi .ic { width: 13px; height: 13px; }
.kpi { position: relative; }
.k-label:has(> button.hi) { padding-right: 16px; }
.k-label:has(> button.hi) > span { white-space: normal; overflow: visible; }
.k-label > button.hi { position: absolute; top: 12px; right: 10px; margin: 0; }
.dd-label button.hi { width: 15px; height: 15px; vertical-align: -3px; } .dd-label button.hi .ic { width: 12px; height: 12px; }
.hi-lab { display: inline-flex; align-items: center; gap: 0; align-self: flex-start; }
.field > .hi-lab > label { font-size: 12.5px; font-weight: 600; color: var(--tx-2); }
.ws-side button.hi { color: #5f6b85; } .ws-side button.hi:hover, .ws-side button.hi:focus-visible { color: #fff; background: #1f2a44; }
button.hi.hi-tab { display: inline-flex; align-items: center; gap: 5px; width: auto; height: 28px; margin: auto 2px auto auto; padding: 0 10px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--tx-3); white-space: nowrap; position: sticky; right: 0; background: var(--surface); box-shadow: -14px 0 12px -6px var(--surface); vertical-align: middle; }
button.hi.hi-tab:hover, button.hi.hi-tab:focus-visible { color: var(--brand-700); background: var(--brand-50); }
button.hi.hi-tab-out { display: flex; margin: 6px 12px 0 auto; }
.drawer .tabs .hi-tab, .modal .tabs .hi-tab { background: #fff; }
.gl { text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); cursor: help; border-radius: 2px; }
.gl:hover, .gl:focus-visible { text-decoration-style: solid; text-decoration-color: currentColor; background: var(--brand-50); color: var(--brand-800); outline: none; }
.gl:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
html.hi-off button.hi { display: none !important; }
html.hi-off .gl { text-decoration: none; cursor: inherit; pointer-events: none; }
.gl-tip { position: fixed; z-index: 310; display: none; max-width: 300px; padding: 8px 11px; border-radius: 8px; background: var(--ink-900); color: #dfe5f1; font-size: 12.5px; line-height: 1.45; box-shadow: var(--sh-3); pointer-events: none; }
.gl-tip b { color: #fff; } .gl-tip .f { color: #aab4c8; } .gl-tip .m { color: #8fa8ff; font-size: 11.5px; margin-top: 4px; }
.hp-hl { outline: 2px solid var(--brand) !important; outline-offset: 3px; border-radius: 4px; }
.hp { position: fixed; inset: 0; z-index: 280; pointer-events: none; }
.hp[hidden] { display: none; }
.hp-bd { display: none; }
.hp-panel { pointer-events: auto; position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--sh-3), -1px 0 0 var(--line); animation: slidein .2s; }
.hp-head { display: flex; align-items: flex-start; gap: 8px; padding: 16px 14px 12px 18px; border-bottom: 1px solid var(--line-2); }
.hp-ttl { flex: 1; min-width: 0; }
.hp-kind { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-700); }
.hp-ttl h2 { font-size: 19px; line-height: 1.25; margin-top: 3px; outline: none; overflow-wrap: anywhere; }
.hp-full { color: var(--tx-3); font-size: 13px; margin-top: 3px; }
.hp-full[hidden] { display: none; }
.hp-ib { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: none; color: var(--tx-3); cursor: pointer; }
.hp-ib:hover, .hp-ib:focus-visible { background: var(--bg); color: var(--tx-1); }
.hp-ib[hidden] { display: none; }
.hp-tools { display: flex; flex-direction: column; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.hp-q { position: relative; }
.hp-q .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--tx-3); }
.hp-q input { width: 100%; height: 36px; padding: 0 10px 0 32px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); font: inherit; font-size: 13.5px; color: var(--tx-1); }
.hp-q input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: var(--ring); }
.hp-seg { align-self: flex-start; }
.hp-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 18px 28px; font-size: 13.5px; line-height: 1.55; color: var(--tx-2); }
.hp-body b, .hp-body strong { color: var(--tx-1); font-weight: 650; }
.hp-lead { margin: 14px 0 0; font-size: 14px; color: var(--tx-1); }
.hp-sec { margin-top: 18px; }
.hp-sec h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-3); }
.hp-sec h3 .ic { width: 14px; height: 14px; color: var(--brand); }
.hp-sec p { margin: 0 0 6px; }
.hp-ul, .hp-ol { margin: 0; padding-left: 20px; }
.hp-ul li, .hp-ol li { margin: 4px 0; }
.hp-ol li::marker { font-weight: 700; color: var(--brand-700); }
.hp-dl { display: grid; grid-template-columns: minmax(0, 36%) minmax(0, 1fr); gap: 9px 14px; margin: 0; }
.hp-dl dt { min-width: 0; font-weight: 650; color: var(--tx-1); overflow-wrap: anywhere; }
.hp-dl dd { min-width: 0; margin: 0; }
.hp-dl dt .status, .hp-dl dt .badge { white-space: normal; height: auto; min-height: 20px; }
.hp-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 650; color: var(--brand-700); text-align: left; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(46, 91, 255, .35); cursor: pointer; }
.hp-link:hover, .hp-link:focus-visible { text-decoration-color: currentColor; }
.hp-map { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hp-map li { display: flex; flex-direction: column; gap: 1px; padding-left: 12px; border-left: 2px solid var(--brand-100); }
.hp-map li span { font-size: 12.5px; color: var(--tx-3); }
.hp-rel { display: flex; flex-wrap: wrap; gap: 6px; }
.hp-chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--tx-2); cursor: pointer; }
.hp-chip:hover, .hp-chip:focus-visible { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.hp-letter { margin: 18px 0 6px; font-size: 12px; font-weight: 750; color: var(--brand-700); }
.hp-gl { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.hp-letter + .hp-gl { margin-top: 0; }
.hp-gi { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.hp-gi:hover, .hp-gi:focus-visible { border-color: var(--brand); background: var(--brand-50); }
.hp-gi b { font-size: 13.5px; color: var(--tx-1); }
.hp-gi i { font-style: normal; font-size: 12px; color: var(--tx-3); }
.hp-gi span { grid-column: 1 / -1; font-size: 12.5px; color: var(--tx-2); line-height: 1.45; }
.hp-foot { padding: 10px 18px; border-top: 1px solid var(--line-2); background: #fafbfc; font-size: 12.5px; }
.hp-foot .switch { font-size: 12.5px; }
@media (max-width: 760px) {
  .hp { pointer-events: auto; }
  .hp-bd { display: block; position: absolute; inset: 0; background: rgba(7, 12, 24, .55); }
  .hp-panel { top: auto; left: 0; width: 100%; height: 88vh; height: 88dvh; border-radius: 16px 16px 0 0; animation: rise .2s; padding-bottom: env(safe-area-inset-bottom); }
  .hp-dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .hp-dl dd { margin-bottom: 8px; }
  button.hi.hi-tab span { display: none; }
  button.hi.hi-tab { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { .hp-panel { animation: none; } }
/* Touch screens: a larger invisible tap area around each small ⓘ */
@media (pointer: coarse) { button.hi:not(.hi-tab)::before { content: ""; position: absolute; inset: -8px; } }

/* -------------------------------------------------------------------------- */
/* Guided workflow — "How it works" strip, tab intros (ERP pages)              */
/* -------------------------------------------------------------------------- */
section.flow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 16px; }
.flow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 0; }
.flow-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.flow-title .ic { width: 17px; height: 17px; color: var(--brand); }
.flow-sub { margin: 3px 0 0; font-size: 13px; color: var(--tx-3); }
.flow-toggle { flex: none; }
.flow-toggle .when-closed, section.flow.collapsed .flow-toggle .when-open { display: none; }
section.flow.collapsed .flow-toggle .when-closed { display: inline; }
section.flow.collapsed .flow-head { padding-bottom: 14px; align-items: center; }
section.flow.collapsed .flow-sub, section.flow.collapsed .flow-steps, section.flow.collapsed .flow-foot { display: none; }
.flow-steps { list-style: none; margin: 0; padding: 12px 18px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 22px; counter-reset: none; }
.flow-step { position: relative; min-width: 0; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -17px; width: 12px; height: 12px; margin-top: -6px; background: no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E"); }
.flow-btn { width: 100%; height: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; gap: 2px 8px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fbfcfe; font: inherit; text-align: left; color: var(--tx-2); cursor: pointer; transition: border-color .12s, background .12s; }
div.flow-btn { cursor: default; }
button.flow-btn:hover, button.flow-btn:focus-visible { border-color: var(--brand); background: var(--brand-50); }
button.flow-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.flow-btn .fs-n { grid-row: 1 / span 3; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--tx-2); font-size: 12px; font-weight: 750; }
.flow-btn .fs-t { font-size: 13px; font-weight: 700; color: var(--tx-1); line-height: 1.3; }
.flow-btn .fs-d { font-size: 12px; line-height: 1.4; color: var(--tx-3); }
.flow-btn .fs-f { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12px; }
.flow-btn .fs-c { font-weight: 650; color: var(--tx-2); }
.flow-btn .fs-c.warn { color: var(--warn-tx); } .flow-btn .fs-c.bad { color: var(--bad-tx); } .flow-btn .fs-c.ok { color: var(--ok-tx); }
.flow-btn .fs-who { color: var(--tx-3); }
.flow-btn .fs-who::before { content: "· "; }
.flow-step.is-attn .flow-btn { border-color: #f3c677; background: var(--warn-50); }
.flow-step.is-attn .fs-n { background: var(--warn); color: #fff; }
.flow-step.is-done .fs-n { background: var(--ok-50); color: var(--ok-tx); }
.flow-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 0 18px 14px; font-size: 12.5px; color: var(--tx-3); }
.flow-foot .ic { width: 14px; height: 14px; vertical-align: -2px; color: var(--brand); }
.tab-intro { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); background: #fafbff; font-size: 13px; line-height: 1.5; color: var(--tx-2); }
.tab-intro > .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--brand); }
.tab-intro b { color: var(--tx-1); }
.tab-intro .ti-next { display: block; color: var(--tx-3); }
.drawer .tab-intro, .modal .tab-intro { margin: 0 0 4px; border: 1px solid var(--line-2); border-radius: var(--r); }
.next-step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px dashed var(--brand-100); border-radius: var(--r); background: var(--brand-50); color: var(--brand-800); font-size: 13px; }
.next-step > .ic { width: 16px; height: 16px; flex: none; }
.next-step .grow { flex: 1 1 240px; min-width: 0; }
@media (max-width: 760px) {
  .flow-head { padding: 12px 14px 0; }
  .flow-steps { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 14px 14px; }
  .flow-step:not(:last-child)::after { display: none; }
  .flow-btn { grid-template-rows: auto auto auto; }
  .flow-foot { padding: 0 14px 12px; }
  .tab-intro { padding: 10px 12px; }
}
/* Workspace detail headers and action rows wrap on laptop widths instead of pushing the page sideways */
:is(body[data-app="erp"], body[data-app="vendor"]) .ws-main :is(.row-between:not(td *), .card-foot) { flex-wrap: wrap; }
:is(body[data-app="erp"], body[data-app="vendor"]) .ws-main .row-between:not(td *) > .row:has(> .btn) { flex-wrap: wrap; }
:is(body[data-app="erp"], body[data-app="vendor"]) .ws-main .row-between:not(td *) > .badge { white-space: normal; height: auto; min-height: 22px; padding-top: 2px; padding-bottom: 2px; }
:is(body[data-app="erp"], body[data-app="vendor"]) .ws-main .row:has(> .btn):not(td *) { flex-wrap: wrap; }

/* -------------------------------------------------------------------------- */
/* Workspace responsive — ERP workspace & vendor portal                        */
/* Desktop and laptop (≥ 981 px) are unchanged; tablet 761–980 · phone ≤ 760.  */
/* Menu becomes a slide-in panel ≤ 980; tables scroll inside their card;       */
/* list + detail and side-panel layouts stack; nothing is hidden or removed.   */
/* -------------------------------------------------------------------------- */
.ws-top .ws-burger, .ws-top .ws-search-btn, .ws-side .ws-side-x { display: none; }
.ws-side-x { margin-left: auto; width: 36px; height: 36px; place-items: center; border: 0; border-radius: var(--r-sm); background: #121b2f; color: #dfe5f1; flex: none; }
.ws-side-x:hover, .ws-side-x:focus-visible { background: #1f2a44; color: #fff; }
body[data-app="vendor"] .ws-side-x { background: #0b2f29; }
/* Tables the workspace wrapped automatically behave exactly as before on desktop */
.table-wrap.tw-auto { overflow: visible; }

@media (max-width: 980px) {
:is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap.tw-auto { overflow-x: auto; }
:is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap {
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(255, 255, 255, 0)) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(16, 24, 40, .16), transparent) left center / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(16, 24, 40, .16), transparent) right center / 10px 100% no-repeat scroll;
}
}


@media (max-width: 980px) {
  /* Menu: slide-in panel opened from the top bar (TX.openSheet: dialog, focus trap, Esc, focus return) */
  :is(body[data-app="erp"], body[data-app="vendor"]) .ws { grid-template-columns: minmax(0, 1fr); }
  .ws-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 270; width: min(300px, 86vw); height: 100%; transform: translateX(-104%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; box-shadow: var(--sh-3); overscroll-behavior: contain; }
  .ws-side.sheet-open { transform: none; visibility: visible; transition: transform .22s ease; }
  .ws-top .ws-burger, .ws-side .ws-side-x { display: grid; }
  .ws-top { padding: 0 12px; gap: 8px; }
  .ws-top .ws-search { max-width: none; min-width: 0; }
  .ws-top .ws-search .kbd { display: none; }
  .ws-top .ws-search .input { padding-right: 12px; }
  .ws-top .ws-user { padding: 2px; }
  .ws-top .ws-user > div:not(.avatar), .ws-top .ws-user > .ic { display: none; }
  .ws-top > .ml-auto { gap: 4px !important; flex: none; }
  .ws-main { padding: 18px 16px 40px; }
  .page-head { align-items: flex-start; margin-bottom: 16px; }
  .page-head .actions { gap: 6px; }
  /* Summary tiles */
  .kpi { padding: 14px 14px; }
  .kpi .k-value { font-size: 23px; }
  /* Status pipelines and stepped bars keep one line and scroll sideways */
  .ws-main .pipeline { display: flex; overflow-x: auto; scrollbar-width: none; }
  .ws-main .pipeline::-webkit-scrollbar { display: none; }
  .ws-main .pipeline .stage { flex: 1 0 116px; }
  /* Tables: readable columns; the table scrolls inside its card */
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap > .table { min-width: 100%; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap > .table:has(tr > :nth-child(4)) { min-width: 600px; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap > .table:has(tr > :nth-child(6)) { min-width: 760px; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap > .table:has(tr > :nth-child(8)) { min-width: 920px; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap > .table:has(tr > :nth-child(10)) { min-width: 1060px; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap > .table :is(td, th):not(.check-col):not(:empty) { min-width: 96px; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap > .table td:not(.check-col):not(.r):not(:empty) { min-width: 136px; }
  /* Toolbars and filters wrap; search boxes take the full row */
  .ws-main .table-toolbar > .input-icon, .ws-main .filterbar > .input-icon { flex: 1 1 220px; width: auto !important; max-width: 100%; }
  .ws-main .table-toolbar > .ml-auto, .ws-main .filterbar > .ml-auto { margin-left: 0; }
  .ws-main :is(.table-toolbar, .filterbar, .card-head) > .row:has(> .btn, > .chip, > .seg, > .select, > .input-icon, > .switch) { flex-wrap: wrap; row-gap: 6px; }
  .ws-main .card-head > .row > div { min-width: 0; }
  /* Screen-reader-only text inside scrolling tables stays inside the scroll box */
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap { position: relative; }
  /* Support inbox always stacks, whatever the page's own desktop layout */
  .ws-main .inbox { grid-template-columns: minmax(0, 1fr) !important; height: auto !important; }
  /* A drop-down that is the first page action opens to the right (the actions row starts at the left edge) */
  .page-head .actions > .dd:first-child .dd-menu { left: 0; right: auto; }
  .kpi .k-foot { flex-wrap: wrap; }
  .bulkbar { flex-wrap: wrap; row-gap: 6px; }
  .bulkbar .ml-auto { margin-left: 0; flex: 1 1 100%; }
  /* List + detail and side-panel layouts stack (list first, then the selected record) */
  .ws-main .split, .ws-main .ed-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .ws-main .split > .side { border-right: 0; border-bottom: 1px solid var(--line-2); max-height: 420px; overflow-y: auto; }
  /* Support inbox: conversation list, thread and customer panel stack; nothing is hidden */
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .inbox .ib-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 360px; }
  .inbox .ib-thread { min-height: 520px; }
  .inbox .ib-side { display: block; border-left: 0; border-top: 1px solid var(--line); }
  /* Drawers use the full width on tablets and phones */
  .drawer-card, .drawer-card.wide { width: 100%; max-width: 760px; }
  .drawer-head { flex-wrap: wrap; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .drawer-head > :first-child { flex: 1 1 0; min-width: 0; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .drawer-head .row { flex-wrap: wrap; row-gap: 6px; }
  /* Exception rows: actions drop under the text */
  .exc { grid-template-columns: auto minmax(0, 1fr); }
  .exc .e-act { grid-column: 2; flex-wrap: wrap; }
  /* Diff views: field name above the old → new values */
  :is(.ws-main, .drawer, .modal) .diff { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  :is(.ws-main, .drawer, .modal) .diff > div:nth-child(3n + 1) { grid-column: 1 / -1; background: #fafbfc; font-weight: 650; }
  /* How it works: three steps per row */
  section.flow .flow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  section.flow .flow-step:nth-child(3n)::after { display: none; }
}

@media (max-width: 760px) {
  .ws-top { height: 56px; }
  .ws-top .ws-search-btn { display: grid; }
  .ws-top .ws-search { display: none; position: absolute; left: 0; right: 0; top: 100%; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--sh-2); }
  .ws-top .ws-search > .ic { left: 24px; }
  .ws-top.search-open .ws-search { display: block; }
  .ws-top .btn .lbl { display: none; }
  .ws-top .btn.btn-sm { padding: 0 9px; }
  .ws-top .dd { position: static; }
  .ws-top .dd-menu { left: 8px; right: 8px; top: calc(100% + 4px); width: auto !important; min-width: 0; max-height: calc(100vh - 120px); overflow-y: auto; }
  .ws-main { padding: 14px 12px 32px; }
  .page-head h1 { font-size: 21px; }
  .page-head .sub { font-size: 13px; }
  .page-head .actions { width: 100%; }
  .kpi { padding: 12px; gap: 4px; }
  .kpi .k-value { font-size: 21px; }
  .kpi .k-foot { flex-wrap: wrap; }
  .kpi .k-foot .spark { display: none; }
  .ws-main .card-head { align-items: flex-start; }
  .ws-main .tabs .tab { padding-left: 11px; padding-right: 11px; }
  :is(body[data-app="erp"], body[data-app="vendor"]) .table-wrap > .table :is(td, th) { padding-left: 10px; padding-right: 10px; }
  .pager { justify-content: center; text-align: center; }
  /* How it works: a swipeable row of step cards */
  section.flow .flow-steps { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 14px; }
  section.flow .flow-steps::-webkit-scrollbar { display: none; }
  section.flow .flow-step { flex: 0 0 78%; scroll-snap-align: start; }
  section.flow .flow-step::after { display: none; }
  .tab-intro { font-size: 12.5px; }
  .exc { padding: 12px 14px; gap: 10px; }
  .scanbox { flex-wrap: wrap; }
  .scanbox .input { flex: 1 1 200px; min-width: 0; }
  .diff { font-size: 12.5px; }
  .timeline li { padding-left: 28px; }
  /* Drop-downs in card headers never make the header wider than the screen */
  .ws-main .card-head > .row { min-width: 0; max-width: 100%; }
  .ws-main .card-head .select { max-width: 100%; min-width: 0; }
  /* Exception rows: one column — severity, text, then actions */
  .exc { grid-template-columns: minmax(0, 1fr); }
  .exc .e-act { grid-column: 1; }
  .exc > :first-child { justify-self: start; }
  /* Segmented filters in header rows scroll instead of widening the page */
  .ws-main .row-between > .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  /* Form text 16 px on phones so iOS does not zoom when a field is focused */
  :is(body[data-app="erp"], body[data-app="vendor"]) :is(.input, .select, .textarea) { font-size: 16px !important; }
}

/* ========================================================================== */
/* STOREFRONT — "Studio" visual identity (template TPL-forge v2 · D-281)       */
/* Original identity adopted after client review on 30 Sep 2026: light paper   */
/* surfaces, graphite ink for actions, one signature "volt" accent, Space      */
/* Grotesk display type, inset product photography. Everything below is scoped */
/* to the storefront; the ERP workspace and vendor portal keep their own look. */
/* ========================================================================== */
/* Space Grotesk (SIL Open Font License) bundled locally so the prototype works offline */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/spacegrotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/spacegrotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens ------------------------------------------------------------------ */
body[data-app="store"] {
  /* Storefront palette */
  --st-paper: #f4f4f0;      /* page */
  --st-paper-2: #eaeae3;    /* tiles, utility bar, soft buttons */
  --st-paper-3: #dfdfd6;
  --st-ink: #111317;        /* text and primary actions */
  --st-ink-2: #2a2e36;      /* hover on ink */
  --st-volt: #d4f25a;       /* signature accent — always with ink text */
  --st-volt-2: #c3e449;
  --st-volt-50: #f3fad6;
  --st-volt-ink: #3a4606;
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Shared design-system tokens re-pointed for the storefront */
  --bg: var(--st-paper); --bg-2: var(--st-paper-2); --surface: #fff;
  --line: #e0e0d9; --line-2: #ebebe5;
  --tx-1: #111317; --tx-2: #3c4048; --tx-3: #5c6068; --tx-4: #8a8e95;
  --brand: #111317; --brand-600: #2a2e36; --brand-700: #111317; --brand-800: #111317;
  --brand-50: #f0f0ea; --brand-100: #e4e4dc; --brand-200: #cbcbc1;
  --accent: #d4f25a; --accent-600: #c3e449; --accent-50: #f3fad6;
  --ring: 0 0 0 3px rgba(17, 19, 23, .14);
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 24px;
  --sh-1: 0 1px 2px rgba(17, 19, 23, .05);
  --sh-2: 0 10px 28px rgba(17, 19, 23, .08);
  --sh-3: 0 22px 52px rgba(17, 19, 23, .18);
  background: var(--st-paper);
}

/* Type -------------------------------------------------------------------- */
:where(body[data-app="store"]) :is(h1, h2, h3) { font-family: var(--font-display); letter-spacing: -0.02em; }
:where(body[data-app="store"]) h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
:where(body[data-app="store"]) h2 { font-size: 22px; font-weight: 700; }
:where(body[data-app="store"]) h3 { font-weight: 600; }
body[data-app="store"] a { text-underline-offset: 3px; }
body[data-app="store"] :is(p, li, dd, .hint, .callout > div) > a:not(.btn):not(.chip):not(.badge),
body[data-app="store"] .small > a:not(.btn):not(.chip):not(.badge) { text-decoration: underline; text-decoration-color: rgba(17, 19, 23, .3); }
body[data-app="store"] :is(p, li, dd, .hint, .callout > div, .small) > a:not(.btn):not(.chip):hover { text-decoration-color: currentColor; }
body[data-app="store"] :focus-visible { outline: 2px solid var(--st-ink); outline-offset: 2px; }
body[data-app="store"] .link-btn { text-decoration: underline; text-decoration-color: rgba(17, 19, 23, .3); text-underline-offset: 3px; }

/* Components re-skinned for the storefront -------------------------------- */
body[data-app="store"] .btn { font-weight: 600; }
body[data-app="store"] .btn-primary:hover { background: var(--st-ink-2); }
body[data-app="store"] .btn-accent { --b-fg: var(--st-ink); }
body[data-app="store"] .btn-soft:hover { background: var(--st-paper-3); }
body[data-app="store"] .btn-dark { --b-bg: var(--st-ink); --b-bd: var(--st-ink); }
body[data-app="store"] .badge.b-accent { background: var(--st-volt); color: var(--st-ink); }
body[data-app="store"] .badge.b-brand { background: var(--st-paper-2); color: var(--st-ink); }
body[data-app="store"] .badge.b-dark { background: var(--st-ink); }
body[data-app="store"] .chip:hover { border-color: var(--st-ink); color: var(--st-ink); }
body[data-app="store"] .chip.active { background: var(--st-ink); border-color: var(--st-ink); }
body[data-app="store"] .tab.active { color: var(--st-ink); }
body[data-app="store"] .tab.active::after { background: var(--st-ink); height: 3px; }
body[data-app="store"] .tab.active .count { background: var(--st-volt); color: var(--st-ink); }
body[data-app="store"] input[type="checkbox"], body[data-app="store"] input[type="radio"] { accent-color: var(--st-ink); }
body[data-app="store"] .table th, body[data-app="store"] .spec-table th, body[data-app="store"] .table tfoot td { background: #f8f8f5; }
body[data-app="store"] .table tbody tr:hover td { background: #fafaf7; }
body[data-app="store"] :is(.modal-foot, .drawer-foot) { background: #f8f8f5; }
body[data-app="store"] .toast { background: var(--st-ink); border-radius: 12px; }
body[data-app="store"] .toast .ic { color: var(--st-volt); }
body[data-app="store"] .pager .pages button.active { background: var(--st-ink); border-color: var(--st-ink); }
body[data-app="store"] .stars { color: var(--st-ink); }
body[data-app="store"] .stars .ic.off { fill: #d4d4cc; }
body[data-app="store"] .rating-pill { background: transparent; color: var(--st-ink); padding: 0; font-size: 12.5px; }
body[data-app="store"] .rating-pill .ic { fill: var(--st-ink); }
/* Condition: white pill + coloured dot + text (never colour alone) */
body[data-app="store"] .cond { gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: #fff; color: var(--st-ink); border: 1px solid var(--line); font-size: 11.5px; font-weight: 650; letter-spacing: 0; }
body[data-app="store"] .cond::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-dot, var(--tx-4)); flex: none; }
body[data-app="store"] .cond.new { --c-dot: var(--c-new); }
body[data-app="store"] .cond.openbox { --c-dot: var(--c-openbox); }
body[data-app="store"] .cond.refurb { --c-dot: var(--c-refurb); }
body[data-app="store"] .cond.used { --c-dot: var(--c-used); }
/* Price */
body[data-app="store"] .price .p-now { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
body[data-app="store"] .price .p-mrp { color: var(--tx-4); }
body[data-app="store"] .price .p-off { background: var(--st-volt); color: var(--st-ink); padding: 1px 8px; border-radius: 999px; font-size: 11.5px; line-height: 18px; }
body[data-app="store"] .price .p-tax { color: var(--tx-3); }
body[data-app="store"] .price.lg .p-off { font-size: 13px; line-height: 22px; padding: 1px 10px; }

/* Logo -------------------------------------------------------------------- */
body[data-app="store"] .logo { gap: 10px; }
body[data-app="store"] .logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--st-ink); box-shadow: none; }
body[data-app="store"] .logo-mark svg { stroke: var(--st-volt); stroke-width: 3; }
body[data-app="store"] .logo-word { font-family: var(--font-display); font-weight: 700; font-size: 25px; letter-spacing: -0.045em; }
body[data-app="store"] .logo-word b { color: inherit; font-weight: 700; }

/* Utility bar ------------------------------------------------------------- */
.s-util { background: var(--st-paper-2); color: var(--tx-2); font-size: 12px; border-bottom: 1px solid var(--line); }
.s-util .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 34px; }
.s-util .u-msg { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.s-util .u-msg > span { overflow: hidden; text-overflow: ellipsis; }
.s-util .u-msg b { color: var(--st-ink); font-weight: 650; }
.s-util .ic { width: 14px; height: 14px; flex: none; }
.s-util .u-links { display: flex; align-items: center; gap: 20px; }
.s-util .u-links a { color: var(--tx-2); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.s-util .u-links a:hover { color: var(--st-ink); text-decoration: none; }

/* Main header ------------------------------------------------------------- */
.s-header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) { .s-header { background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.6) blur(14px); } }
.s-header .container { display: flex; align-items: center; gap: 20px; height: 76px; }
.s-header .logo { flex: none; }
.s-burger { display: none; place-items: center; width: 42px; height: 42px; flex: none; margin-left: -6px; border: 0; border-radius: 12px; background: transparent; color: var(--st-ink); }
.s-burger:hover { background: var(--st-paper); }
.s-search { flex: 1 1 auto; max-width: 780px; margin: 0 auto 0 8px; position: relative; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 5px 0 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--st-paper); transition: border-color .15s, background .15s, box-shadow .15s; }
.s-search:hover { border-color: var(--st-paper-3); }
.s-search:focus-within { background: #fff; border-color: var(--st-ink); box-shadow: 0 0 0 4px rgba(17, 19, 23, .07); }
.s-search > .ic { color: var(--tx-3); }
.s-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0; font-size: 14.5px; color: var(--tx-1); outline: none; }
.s-search input::placeholder { color: var(--tx-3); }
.s-search .s-scope { flex: none; max-width: 170px; height: 30px; padding: 0 26px 0 12px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c6068' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center; appearance: none; font-size: 12.5px; font-weight: 550; color: var(--tx-2); cursor: pointer; outline: none; }
.s-search .s-go { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; display: grid; place-items: center; background: var(--st-ink); color: #fff; transition: background .15s; }
.s-search .s-go:hover { background: var(--st-ink-2); }
.s-search .s-go .ic { width: 18px; height: 18px; }
.s-suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: none; z-index: 120; padding: 8px; background: #fff; color: var(--tx-1); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-3); }
.s-search:focus-within .s-suggest { display: block; animation: rise .12s; }
.s-suggest a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--tx-1); font-size: 13.5px; }
.s-suggest a:hover { background: var(--st-paper); text-decoration: none; }
.s-suggest .ic { color: var(--tx-4); }
.s-suggest .hl { font-weight: 700; }
.s-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.s-pin { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px 0 11px; margin-right: 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--tx-3); font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.s-pin .ic { width: 17px; height: 17px; color: var(--st-ink); }
.s-pin b { color: var(--st-ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.s-pin:hover { border-color: var(--st-ink); }
.s-act { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 6px; border-radius: 999px; color: var(--st-ink); font-size: 13.5px; font-weight: 600; line-height: 1.15; white-space: nowrap; text-decoration: none !important; }
.s-act:hover { background: var(--st-paper); }
.s-act .ic { width: 21px; height: 21px; }
.s-act-t small { display: block; font-size: 11px; font-weight: 500; color: var(--tx-3); }
.s-act-icon { width: 44px; padding: 0; justify-content: center; }
.s-act-account { padding-left: 6px; }
.s-act-account > .ic { margin-left: 6px; }
.s-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--st-ink); color: var(--st-volt); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.s-act-cart { margin-left: 6px; padding: 0 8px 0 16px; background: var(--st-ink); color: #fff; }
.s-act-cart:hover { background: var(--st-ink-2); }
.s-act-cart .ic { width: 19px; height: 19px; }
.s-act .count { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--st-volt); color: var(--st-ink); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.s-dealer-flag { display: none; }
body.view-dealer .s-dealer-flag { display: inline-flex; }

/* Department rail + mega menu -------------------------------------------- */
.s-catbar { position: relative; background: #fff; border-bottom: 1px solid var(--line); }
.s-catbar > .container { display: flex; align-items: center; gap: 2px; height: 54px; }
.s-catbar > .container > a, .s-catbar .all, .s-rail-pin { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 36px; padding: 0 13px; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--tx-2); font-size: 13.5px; font-weight: 550; white-space: nowrap; text-decoration: none !important; }
.s-catbar > .container > a:hover { color: var(--st-ink); background: var(--st-paper); }
.s-catbar > .container > a.active { color: #fff; background: var(--st-ink); }
.s-catbar .all { margin-right: 10px; padding: 0 16px 0 13px; background: var(--st-ink); color: #fff; font-weight: 650; }
.s-catbar .all .ic { width: 16px; height: 16px; }
.s-catbar .all:hover { background: var(--st-ink-2); }
.s-catbar.mega-open .all { background: var(--st-volt); color: var(--st-ink); }
.s-rail-pin { display: none; }
.s-rail-gap { flex: 1 1 12px; min-width: 12px; }
.s-catbar > .container > a.rchip { border-color: var(--line); color: var(--st-ink); font-weight: 600; margin-left: 6px; }
.s-catbar > .container > a.rchip:hover { border-color: var(--st-ink); background: #fff; }
.s-catbar > .container > a.rchip.active { background: var(--st-ink); border-color: var(--st-ink); color: #fff; }
.s-catbar .rchip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-refurb); }
.s-catbar > .container > a.deal { background: var(--st-volt); border-color: var(--st-volt); }
.s-catbar > .container > a.deal:hover { background: var(--st-volt-2); border-color: var(--st-volt-2); }
.s-mega { position: absolute; left: 0; right: 0; top: 100%; display: none; z-index: 110; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 30px 60px rgba(17, 19, 23, .14); }
.s-catbar.mega-open .s-mega { display: block; animation: rise .12s; }
.s-mega .container { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 36px; padding-top: 28px; padding-bottom: 32px; align-items: start; }
.s-mega h5 { margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.s-mega .m-cats { display: flex; flex-direction: column; gap: 1px; }
.s-mega .m-cats a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--tx-1); font-size: 13.5px; font-weight: 550; }
.s-mega .m-cats a span { flex: 1; }
.s-mega .m-cats a small { color: var(--tx-4); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.s-mega .m-cats a .ic { color: var(--tx-3); }
.s-mega .m-cats a:hover { background: var(--st-paper); text-decoration: none; }
.s-mega .m-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 28px; }
.s-mega .m-cols a { display: block; padding: 6px 0; color: var(--tx-1); font-size: 13.5px; font-weight: 500; }
.s-mega .m-cols a:hover { text-decoration: underline; }
.s-mega .m-note { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--st-volt-50); font-size: 13px; color: var(--tx-2); }
.s-mega .m-note b { color: var(--st-ink); }

/* Main area & sections ---------------------------------------------------- */
.store-main { min-height: 60vh; padding-bottom: 56px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tx-3); flex-wrap: wrap; }
.crumbs a { color: var(--tx-2); }
.crumbs .ic { width: 12px; height: 12px; color: var(--tx-4); }
.section { margin-top: 48px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
:where(body[data-app="store"]) .section-head h2 { font-size: 26px; letter-spacing: -0.03em; }
.section-head p { color: var(--tx-3); margin-top: 4px; }
body[data-app="store"] .section-head > a.strong { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--st-ink); font-size: 13px; text-decoration: none; }
body[data-app="store"] .section-head > a.strong:hover { border-color: var(--st-ink); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--st-ink); }

/* Product card: inset photo tile, brand + rating line, spec line, clear price */
.pcard { container: pcard / inline-size; position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s; }
.pcard:hover { border-color: #cfcfc6; box-shadow: var(--sh-2); transform: translateY(-3px); }
.pcard .p-media { position: relative; margin: 8px 8px 0; border-radius: 14px; overflow: hidden; background: var(--st-paper); }
.pcard .p-media .ph { border-radius: 0; aspect-ratio: 5 / 4; background: var(--st-paper); }
.pcard:hover .p-media .ph img { transform: scale(1.04); }
.pcard .p-flags { position: absolute; top: 10px; left: 10px; right: 52px; z-index: 2; display: flex; flex-wrap: wrap; gap: 5px; align-items: flex-start; }
.pcard .p-flags .badge { height: 24px; border-radius: 999px; font-weight: 650; }
.pcard .p-fav { position: absolute; top: 9px; right: 9px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .94); color: var(--tx-2); box-shadow: var(--sh-1); }
.pcard .p-fav:hover, .pcard .p-fav.on { color: #d92d4a; }
.pcard .p-fav.on .ic { fill: #d92d4a; }
.pcard .p-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.pcard .p-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard .p-brand { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.pcard .p-rating { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--st-ink); white-space: nowrap; }
.pcard .p-rating .ic { width: 12px; height: 12px; fill: var(--st-ink); stroke: none; }
.pcard .p-rating span { font-weight: 500; color: var(--tx-3); }
.pcard .p-title { font-size: 14px; font-weight: 600; line-height: 1.35; min-height: 38px; color: var(--st-ink); }
.pcard a.p-link { color: inherit; text-decoration: none; }
.pcard a.p-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pcard .p-specs { font-size: 12px; color: var(--tx-3); }
.pcard .price .p-now { font-size: 19px; }
.pcard .price .p-line { gap: 6px; }
.pcard .p-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--tx-2); }
.pcard .p-meta .ic { width: 13px; height: 13px; }
.pcard .p-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.pcard .p-foot { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); }
.pcard .p-foot .btn { flex: 1; height: 36px; border-radius: 10px; }
.pcard .p-compare { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tx-3); cursor: pointer; }
.pcard .p-compare input { accent-color: var(--st-ink); }
@container pcard (max-width: 250px) {
  .pcard .p-add-x { display: none; }
  .pcard .price .p-now { font-size: 17px; }
}

/* Hero: text on graphite, photograph in its own frame (no dark wash over photos) */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); grid-template-areas: "copy media"; min-height: 380px; border-radius: 28px; background: var(--st-ink); color: #fff; }
.hero .h-copy { grid-area: copy; align-self: center; position: relative; z-index: 2; padding: 48px 52px; }
.hero.photo .h-bg { grid-area: media; position: relative; min-height: 300px; margin: 12px; border-radius: 20px; overflow: hidden; background: #22252b; }
.hero.photo .h-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .h-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; background: rgba(255, 255, 255, .05); color: #e8e9e4; font-size: 12px; font-weight: 600; }
.hero .h-kicker .ic { color: var(--st-volt); }
.hero h1 { margin-top: 18px; font-size: 44px; line-height: 1.02; letter-spacing: -0.04em; color: #fff; }
.hero p { max-width: 480px; margin-top: 14px; color: #b9bcc3; font-size: 15.5px; }
.hero .h-dots { display: none; }
body[data-app="store"] .hero-stats { color: #9ea2aa; }
body[data-app="store"] .hero-stats b { color: #fff; font-family: var(--font-display); letter-spacing: -0.02em; }
.hero-side { display: grid; gap: 16px; }

/* Promo tiles, trust row, bands */
.promo { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 170px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--tx-1); }
.promo h3 { font-size: 19px; font-weight: 700; }
.promo p { max-width: 72%; margin-top: 4px; color: var(--tx-2); font-size: 13px; }
.promo.photo { border: 0; color: #fff; background: var(--st-ink); }
.promo.photo .p-bg { position: absolute; inset: 0; }
.promo.photo .p-bg .ph { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.promo.photo .p-bg img { width: 100%; height: 100%; object-fit: cover; }
.promo.photo .p-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17, 19, 23, .9) 0%, rgba(17, 19, 23, .62) 55%, rgba(17, 19, 23, .12) 100%); }
.promo.photo > *:not(.p-bg) { position: relative; z-index: 1; }
.promo.photo p { color: #d6d8dc; }
.trust-strip { display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.trust-strip > div { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-right: 1px solid var(--line-2); }
.trust-strip > div:last-child { border-right: 0; }
.trust-strip .ti { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--st-paper); color: var(--st-ink); }
.trust-strip b { display: block; font-size: 13.5px; }
.trust-strip span { font-size: 12px; color: var(--tx-3); }
.band { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px 36px; border-radius: 24px; }
.band.dealer { background: var(--st-ink) radial-gradient(520px 240px at 100% 0%, rgba(212, 242, 90, .16), transparent 70%); color: #fff; }
.band.dealer h2, .band.dealer h3 { color: #fff; }
.band.dealer p { color: #b9bcc3; }
.band.whatsapp { background: #e6f4e9; }

/* Footer ------------------------------------------------------------------ */
.s-footer { margin-top: 80px; background: var(--st-ink); color: #a9adb5; font-size: 13px; }
.s-footer .f-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: end; padding: 60px 0 44px; border-bottom: 1px solid #25282f; }
.s-footer .f-kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8b8f97; }
.s-footer .f-hero h2 { margin-top: 12px; color: #fff; font-size: 52px; line-height: .98; letter-spacing: -0.045em; }
.s-footer .f-hero h2 em { font-style: normal; color: var(--st-volt); }
.s-footer .f-news p { color: #c3c6cc; font-size: 14px; margin-bottom: 12px; }
.s-footer .news { display: flex; gap: 8px; }
.s-footer .news .input { height: 48px; border-radius: 12px; background: #1b1e24; border-color: #2c3038; color: #fff; }
.s-footer .news .input::placeholder { color: #8b8f97; }
.s-footer .news .btn { height: 48px; padding: 0 22px; border-radius: 12px; }
.s-footer .f-top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 32px; padding: 44px 0 36px; }
.s-footer .f-brand p { max-width: 320px; margin-top: 14px; }
.s-footer .f-contact { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; color: #d6d8dc; }
.s-footer .f-contact span { display: inline-flex; align-items: center; gap: 8px; }
.s-footer h5 { margin: 4px 0 14px; color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.s-footer a { display: block; padding: 4px 0; color: #a9adb5; }
.s-footer a:hover { color: #fff; }
.s-footer .logo { display: inline-flex; padding: 0; color: #fff; }
body[data-app="store"] .s-footer .logo-mark { background: var(--st-volt); }
body[data-app="store"] .s-footer .logo-mark svg { stroke: var(--st-ink); }
.s-footer .f-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0 22px; border-top: 1px solid #25282f; font-size: 12px; }
.s-footer .pay-row { display: flex; gap: 6px; }
.s-footer .pay-row span { padding: 4px 8px; border-radius: 6px; background: #1d2026; color: #c9ccd2; font-size: 10.5px; font-weight: 700; }

/* Responsive — storefront (desktop ≥ 981 · tablet 761–980 · phone ≤ 760) --- */
@media (max-width: 1500px) { .s-catbar > .container > a[data-p="9"], .s-catbar > .container > a[data-p="8"] { display: none; } }
@media (max-width: 1360px) {
  .s-catbar > .container > a[data-p="7"], .s-catbar > .container > a[data-p="6"] { display: none; }
  .s-act-account .s-act-t { display: none; }
  .s-act-account { padding: 0 5px; }
}
@media (max-width: 1200px) {
  .s-catbar > .container > a[data-p="4"], .s-catbar > .container > a[data-p="1"] { display: none; }
  .s-pin .pin-city { display: none; }
  .s-search .s-scope { display: none; }
  .s-util .u-links a:nth-child(5), .s-util .u-links a:nth-child(6) { display: none; }
  .trust-strip { grid-template-columns: repeat(3, 1fr); }
  .trust-strip > div { border-bottom: 1px solid var(--line-2); }
  .s-footer .f-top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .s-footer .f-brand { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .s-util .container { justify-content: center; }
  .s-util .u-links { display: none; }
  .s-burger { display: grid; }
  .s-header .container { gap: 12px; height: 64px; }
  .s-search { height: 46px; margin: 0; }
  .s-pin, .s-act-orders, .s-act-wish { display: none !important; }
  .s-act-cart { margin-left: 2px; padding: 0 6px 0 12px; }
  .s-act-cart .s-act-t { display: none; }
  /* Department rail: swipeable chips; "All departments" opens the menu drawer */
  .s-catbar > .container { height: 56px; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .s-catbar > .container::-webkit-scrollbar { display: none; }
  .s-catbar > .container > a, .s-rail-pin { border-color: var(--line); height: 38px; }
  .s-catbar > .container > a[data-p] { display: inline-flex !important; }
  .s-catbar .all { margin-right: 0; }
  .s-rail-pin { display: inline-flex; color: var(--st-ink); cursor: pointer; }
  .s-rail-pin b { font-weight: 650; }
  .s-rail-gap { display: none; }
  .s-catbar > .container > a.rchip { margin-left: 0; }
  .s-mega { display: none !important; }
  .hero, .hero.photo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "copy"; }
  .hero.photo .h-bg { min-height: 240px; margin: 10px 10px 0; }
  .hero .h-copy { padding: 30px 32px 34px; }
  .hero h1 { font-size: 36px; }
  .band { flex-direction: column; align-items: flex-start; padding: 26px; }
  .s-footer { margin-top: 56px; }
  .s-footer .f-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 44px 0 32px; }
  .s-footer .f-hero h2 { font-size: 42px; }
  .s-footer .f-top { gap: 24px; padding: 32px 0 24px; }
  .s-footer .f-bottom { flex-direction: column; align-items: flex-start; }
  .s-footer .f-bottom .row { flex-wrap: wrap; }
  .s-footer .pay-row { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .s-util { font-size: 11.5px; }
  .s-util .container { height: 30px; }
  .s-util .u-msg { display: block; overflow: hidden; text-overflow: ellipsis; }
  .s-util .u-msg .ic { display: inline-block; vertical-align: -2px; margin-right: 4px; }
  .s-header .container { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "burger logo actions" "search search search"; gap: 8px 6px; height: auto; padding-top: 8px; padding-bottom: 10px; }
  .s-burger { grid-area: burger; }
  .s-header .logo { grid-area: logo; justify-self: start; }
  body[data-app="store"] .s-header .logo-mark { width: 30px; height: 30px; border-radius: 9px; }
  body[data-app="store"] .s-header .logo-word { font-size: 22px; }
  .s-actions { grid-area: actions; gap: 2px; }
  .s-act { min-width: 44px; height: 44px; justify-content: center; }
  .s-act-account .s-av { width: 32px; height: 32px; }
  .s-search { grid-area: search; max-width: none; height: 46px; padding-left: 14px; }
  .s-search .s-go { width: 36px; height: 36px; border-radius: 10px; }
  .s-search input, .input, .select, .textarea { font-size: 16px; } /* ≥16 px stops iOS zooming into fields */
  .s-catbar > .container { height: 54px; }
  /* Bottom bar: ink active state with a volt marker */
  .s-tabbar .on { color: var(--st-ink); }
  .s-tabbar .on::before { background: var(--st-ink); height: 3px; }
  .s-tabbar .count { background: var(--st-volt); color: var(--st-ink); }
  .helpfab .fab { width: 50px; padding: 0; justify-content: center; }
  /* Product cards: two per row */
  .pgrid, .pgrid.cols-3, .pgrid.cols-4, .pgrid.cols-5, .pgrid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pgrid.rail { gap: 10px; }
  .pgrid.rail .pcard { flex: 0 0 min(46vw, 210px); }
  .pcard { border-radius: 16px; }
  .pcard .p-media { margin: 6px 6px 0; border-radius: 12px; }
  .pcard .p-body { padding: 10px 10px 12px; gap: 5px; }
  .pcard .p-flags { top: 7px; left: 7px; right: 44px; }
  .pcard .p-flags .cond, .pcard .p-flags .badge { white-space: normal; height: auto; min-height: 22px; padding-top: 3px; padding-bottom: 3px; line-height: 1.2; font-size: 10.5px; }
  .pcard .p-fav { width: 32px; height: 32px; top: 6px; right: 6px; }
  .pcard .p-top { flex-wrap: wrap; gap: 2px 8px; }
  .pcard .p-rating span { display: none; }
  .pcard .p-title { font-size: 13px; min-height: 35px; }
  .pcard .price .p-now { font-size: 16px; }
  .pcard .p-meta > span:last-child { display: none; }
  .price .p-org, .m-hide { display: none; }
  .pcard .p-foot { flex-wrap: wrap; gap: 8px; }
  .pcard .p-foot .btn { flex: 1 1 100%; order: 1; height: 38px; }
  .pcard .p-compare { order: 2; }
  .pcard:hover { transform: none; }
  /* Merchandising */
  .section { margin-top: 34px; }
  .section-head { flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
  :where(body[data-app="store"]) h1 { font-size: 24px; }
  :where(body[data-app="store"]) .section-head h2 { font-size: 21px; }
  body[data-app="store"] .section-head > a.strong { height: 34px; padding: 0 12px; }
  .hero { border-radius: 20px; min-height: 0; }
  .hero.photo .h-bg { min-height: 190px; border-radius: 14px; margin: 8px 8px 0; }
  .hero .h-copy { padding: 22px 20px 24px; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 14px; }
  .promo { min-height: 150px; border-radius: 16px; }
  .promo.photo .p-bg::after { background: linear-gradient(90deg, rgba(17, 19, 23, .9) 0%, rgba(17, 19, 23, .74) 60%, rgba(17, 19, 23, .4) 100%); }
  .trust-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 16px; }
  .trust-strip > div { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-right: 0; }
  .trust-strip > div:nth-child(odd) { border-right: 1px solid var(--line-2); }
  .trust-strip > div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
  .trust-strip .ti { width: 34px; height: 34px; }
  .band { padding: 22px 20px; border-radius: 18px; }
  .band .row { flex-wrap: wrap; }
  .s-footer .f-hero h2 { font-size: 36px; }
  .s-footer .news { flex-wrap: wrap; }
  .s-footer .news .input { flex: 1 1 200px; min-width: 0; }
  .s-footer .f-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  body[data-app="store"] .s-header .logo-word { font-size: 20px; }
  body[data-app="store"] .s-header .logo { gap: 7px; }
}
