/* ============================================================
   SALES ANALYSIS FOR MERCHANDISERS | sales-analysis.css
   Uses the shared design tokens from styles.css.
   ============================================================ */

.sa-page {
  --sa-panel:    #0f0f11;
  --sa-panel-2:  #17171a;
  --sa-line:     rgba(255,255,255,0.08);
  --sa-line-2:   rgba(255,255,255,0.14);
  --sa-label:    #f5f5f7;
  --sa-label-2:  #a1a1a8;
  --sa-label-3:  #6e6e76;
  --sa-accent:   #e0143c;

  /* Status colours: chip background / chip text */
  --st-red-bg:   rgba(224, 20, 60, 0.16);
  --st-red:      #ff6b84;
  --st-amber-bg: rgba(245, 166, 35, 0.16);
  --st-amber:    #f7b955;
  --st-green-bg: rgba(52, 199, 89, 0.15);
  --st-green:    #5fd884;
  --st-grey-bg:  rgba(255,255,255,0.06);
  --st-grey:     #8a8a92;
  --st-blue:     #4c8dff;

  min-height: 100vh;
  padding-top: var(--nav-h);
  padding-bottom: 96px;
  color: var(--sa-label);
  font-family: var(--font-body);
  background: #000;
}
.sa-body { background: #000; }

.sa-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* ── NAV (this page: Back link beside the links, as on the calendar) ── */
.sa-body .nav { justify-content: space-between; gap: 24px; }
.sa-body .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s;
}
.sa-body .back-btn svg { transition: transform 0.2s var(--ease-out); }
.sa-body .back-btn:hover { color: var(--text); }
.sa-body .back-btn:hover svg { transform: translateX(-3px); }
@media (max-width: 760px) {
  .sa-body .nav__links { display: none; }
}

/* ── HERO ── */
.sa-hero {
  padding: clamp(48px, 7vw, 96px) 0 clamp(28px, 4vw, 44px);
  text-align: center;
}
.sa-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sa-accent);
  margin-bottom: 14px;
}
.sa-title {
  font-family: var(--font-serif);
  font-size: clamp(44px, 8vw, 92px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: none;
}
.sa-title span { color: var(--red); }
.sa-sub {
  max-width: 620px;
  margin: 20px auto 0;
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.55;
  color: var(--sa-label-2);
}

/* Entrance: same float-up the rest of the site uses */
.sa-hero .sa-eyebrow,
.sa-hero .sa-title,
.sa-hero .sa-sub,
.sa-upload-wrap {
  opacity: 0;
  transform: translateY(24px);
  animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.sa-hero .sa-title   { animation-delay: 0.08s; }
.sa-hero .sa-sub     { animation-delay: 0.16s; }
.sa-upload-wrap      { animation-delay: 0.26s; }
@media (prefers-reduced-motion: reduce) {
  .sa-hero .sa-eyebrow, .sa-hero .sa-title, .sa-hero .sa-sub, .sa-upload-wrap {
    opacity: 1; transform: none; animation: none;
  }
}

/* ── BUTTONS ── */
.sa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--red);
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.sa-btn:hover { background: var(--sa-accent); border-color: var(--sa-accent); transform: translateY(-1px); }
.sa-btn--ghost {
  background: transparent;
  border-color: var(--sa-line-2);
  color: var(--sa-label);
}
.sa-btn--ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.3); }
.sa-btn:focus-visible { outline: 2px solid var(--sa-accent); outline-offset: 3px; }

/* ── UPLOAD ── */
.sa-upload-wrap { max-width: 820px; }
.sa-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: clamp(36px, 6vw, 60px) 24px;
  border: 1.5px dashed rgba(255,255,255,0.18);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(176,0,32,0.10), transparent 60%),
    var(--sa-panel);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.sa-drop:hover,
.sa-drop:focus-within,
.sa-drop.is-over {
  border-color: var(--sa-accent);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(224,20,60,0.18), transparent 60%),
    var(--sa-panel);
}
.sa-drop.is-over { transform: scale(1.01); }
.sa-drop__icon {
  display: grid;
  place-items: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(224,20,60,0.14);
  color: var(--st-red);
  margin-bottom: 6px;
}
.sa-drop__title { font-family: var(--font-serif); font-size: clamp(18px, 2.4vw, 22px); font-weight: 600; }
.sa-drop__hint  { font-size: 14px; color: var(--sa-label-2); }
.sa-drop__hint u { text-underline-offset: 3px; color: var(--sa-label); }
.sa-drop__formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.sa-drop__formats span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--sa-line-2);
  color: var(--sa-label-3);
}
.sa-upload-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 16px;
}
.sa-privacy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--sa-label-3);
}
.sa-help {
  margin-top: 16px;
  border-top: 1px solid var(--sa-line);
  padding-top: 14px;
  font-size: 14px;
  color: var(--sa-label-2);
}
.sa-help summary { cursor: pointer; color: var(--sa-label); font-weight: 500; }
.sa-help__body { padding-top: 10px; line-height: 1.6; }
.sa-help__body ul { margin: 8px 0 10px 18px; list-style: disc; }
.sa-help__body b { color: var(--sa-label); font-weight: 600; }

/* Collapsed upload once results are showing */
.sa-upload-wrap.is-collapsed { display: none; }

/* ── STATUS ── */
.sa-status {
  max-width: 820px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--sa-panel);
  border: 1px solid var(--sa-line);
  font-size: 14px;
  color: var(--sa-label-2);
}
.sa-status.is-error { border-color: rgba(224,20,60,0.45); color: var(--st-red); }
.sa-status .sa-spin {
  width: 16px; height: 16px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--sa-accent);
  animation: sa-spin 0.8s linear infinite;
}
@keyframes sa-spin { to { transform: rotate(360deg); } }

/* ── RESULTS ── */
.sa-results { animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }

.sa-filebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.sa-filebar__info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; }
.sa-filebar__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sa-label-3);
}
.sa-filebar__name { font-weight: 600; overflow-wrap: anywhere; }
.sa-filebar__meta { font-size: 13px; color: var(--sa-label-3); }
.sa-filebar__actions { display: flex; gap: 8px; }

/* KPI tiles */
.sa-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.sa-kpi {
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: var(--sa-panel);
  border: 1px solid var(--sa-line);
  min-width: 0;
}
.sa-kpi__label {
  font-size: 12px;
  color: var(--sa-label-2);
  margin-bottom: 8px;
}
.sa-kpi__value {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.sa-kpi__delta { margin-top: 6px; font-size: 12px; color: var(--sa-label-3); }
.sa-kpi--alert .sa-kpi__value { color: var(--st-red); }
.sa-kpi--warn  .sa-kpi__value { color: var(--st-amber); }
.sa-up   { color: var(--st-green) !important; }
.sa-down { color: var(--st-red) !important; }

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

/* Panels */
.sa-panel {
  border-radius: 18px;
  background: var(--sa-panel);
  border: 1px solid var(--sa-line);
  padding: clamp(18px, 2.4vw, 24px);
}
.sa-panel__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.sa-panel__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sa-label-3);
  margin: 18px 0 10px;
}
.sa-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 860px) { .sa-split { grid-template-columns: 1fr; } }

/* Insights */
.sa-insights__list { display: flex; flex-direction: column; gap: 10px; }
.sa-insight {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sa-panel-2);
  font-size: 14px;
  line-height: 1.5;
  color: var(--sa-label-2);
}
.sa-insight b { color: var(--sa-label); font-weight: 600; }
.sa-insight__icon {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}
.sa-insight--red   .sa-insight__icon { background: var(--st-red-bg);   color: var(--st-red); }
.sa-insight--amber .sa-insight__icon { background: var(--st-amber-bg); color: var(--st-amber); }
.sa-insight--green .sa-insight__icon { background: var(--st-green-bg); color: var(--st-green); }
.sa-insight--blue  .sa-insight__icon { background: rgba(76,141,255,0.15); color: var(--st-blue); }
.sa-insight--grey  .sa-insight__icon { background: var(--st-grey-bg); color: var(--st-grey); }

/* Stock health mix */
.sa-mix__bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--sa-panel-2);
  gap: 2px;
}
.sa-mix__bar span { height: 100%; transition: flex-grow 0.6s var(--ease-out); }
.sa-mix__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--sa-label-2);
}
.sa-mix__legend li { display: flex; align-items: center; gap: 8px; }
.sa-mix__legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sa-mix__legend b { color: var(--sa-label); font-weight: 600; margin-left: auto; font-variant-numeric: tabular-nums; }

.sa-top { display: flex; flex-direction: column; gap: 9px; counter-reset: top; }
.sa-top li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  font-size: 13px;
  counter-increment: top;
}
.sa-top li::before {
  content: counter(top);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sa-label-3);
}
.sa-top__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-top__val  { font-variant-numeric: tabular-nums; color: var(--sa-label-2); }
.sa-top__bar  { grid-column: 2 / 4; height: 4px; border-radius: 4px; background: var(--sa-panel-2); overflow: hidden; }
.sa-top__bar i { display: block; height: 100%; border-radius: 4px; background: var(--st-blue); }

/* Config */
.sa-config { margin-bottom: 18px; padding: 0; }
.sa-config summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.sa-config summary::-webkit-details-marker { display: none; }
.sa-config summary::after {
  content: '+';
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--sa-label-3);
}
.sa-config[open] summary::after { content: '−'; }
.sa-config__hint { font-size: 13px; font-weight: 400; color: var(--sa-label-3); }
.sa-config.has-warning .sa-config__hint { color: var(--st-amber); }
.sa-config__body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 8px 28px;
  padding: 0 20px 20px;
}
.sa-config__body .sa-panel__sub { margin-top: 4px; }
@media (max-width: 860px) { .sa-config__body { grid-template-columns: 1fr; } }
.sa-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
@media (max-width: 520px) { .sa-map { grid-template-columns: 1fr; } }
.sa-map label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sa-label-2); }
.sa-map select,
.sa-sort select,
.sa-thresholds input {
  font: inherit;
  font-size: 13px;
  color: var(--sa-label);
  background: var(--sa-panel-2);
  border: 1px solid var(--sa-line-2);
  border-radius: 8px;
  padding: 7px 9px;
  min-width: 0;
}
.sa-map select { width: 100%; }
.sa-thresholds { display: flex; flex-direction: column; gap: 9px; font-size: 13px; color: var(--sa-label-2); }
.sa-thresholds input { width: 64px; margin: 0 4px; text-align: center; }

/* Controls */
.sa-controls {
  position: sticky;
  top: var(--nav-h);
  z-index: 20;
  padding: 12px 0;
  margin-bottom: 4px;
  background: linear-gradient(#000 78%, rgba(0,0,0,0));
}
.sa-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.sa-pills::-webkit-scrollbar { display: none; }
.sa-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--sa-line-2);
  background: var(--sa-panel);
  color: var(--sa-label-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.sa-pill:hover:not(:disabled) { color: var(--sa-label); border-color: rgba(255,255,255,0.3); }
.sa-pill i { width: 8px; height: 8px; border-radius: 50%; }
.sa-pill__count {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--sa-label-2);
}
.sa-pill.is-active {
  background: var(--sa-label);
  border-color: var(--sa-label);
  color: #000;
}
.sa-pill.is-active .sa-pill__count { background: rgba(0,0,0,0.1); color: #000; }
.sa-pill:disabled { opacity: 0.35; cursor: not-allowed; }
.sa-pill:focus-visible { outline: 2px solid var(--sa-accent); outline-offset: 2px; }

.sa-controls__row { display: flex; gap: 10px; margin-top: 10px; }
.sa-search {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  color: var(--sa-label);
  background: var(--sa-panel);
  border: 1px solid var(--sa-line-2);
  border-radius: 999px;
  padding: 9px 16px;
}
.sa-search:focus, .sa-map select:focus, .sa-sort select:focus, .sa-thresholds input:focus {
  outline: none;
  border-color: var(--sa-accent);
}
.sa-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sa-label-3); }
.sa-sort select { border-radius: 999px; padding: 8px 12px; }

/* ── TABLE ── */
.sa-table-wrap {
  border-radius: 18px;
  background: var(--sa-panel);
  border: 1px solid var(--sa-line);
  overflow: hidden;
}
.sa-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sa-table th {
  padding: 13px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--sa-label-3);
  border-bottom: 1px solid var(--sa-line);
  white-space: nowrap;
}
.sa-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--sa-line);
  vertical-align: middle;
}
.sa-table tbody tr:last-child td { border-bottom: 0; }
.sa-table tbody tr.sa-row { transition: background 0.15s; }
.sa-table tbody tr.sa-row:hover { background: rgba(255,255,255,0.025); }
.sa-table .sa-col-loc, .sa-table .sa-loc { text-align: center; }
.sa-table.no-branch    [data-loc="branch"],
.sa-table.no-warehouse [data-loc="warehouse"],
.sa-table.no-online    [data-loc="online"],
.sa-table.no-total     [data-loc="total"],
.sa-table.no-trend     .sa-col-trend,
.sa-table.no-trend     .sa-trend-cell { display: none; }

/* Group header rows */
.sa-group td {
  padding: 16px 14px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sa-label-2);
  background: rgba(255,255,255,0.015);
}
.sa-group__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.sa-group__count { margin-left: 6px; font-weight: 400; color: var(--sa-label-3); }

/* Priority badge */
.sa-pri {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sa-pri--act   { background: var(--red); color: #fff; }
.sa-pri--watch { background: var(--st-amber-bg); color: var(--st-amber); }
.sa-pri--ok    { background: var(--st-green-bg); color: var(--st-green); }
.sa-pri--over  { background: rgba(76,141,255,0.15); color: var(--st-blue); }
.sa-pri--idle  { background: var(--st-grey-bg); color: var(--st-grey); }

/* Product */
.sa-prod__name { font-weight: 600; color: var(--sa-label); line-height: 1.3; }
.sa-prod__code {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--sa-label-3);
}
.sa-prod__cat {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--font-body);
  letter-spacing: 0;
  color: var(--sa-label-3);
}

/* Sold */
.sa-sold { min-width: 120px; }
.sa-sold__val { font-weight: 600; font-variant-numeric: tabular-nums; }
.sa-sold__units { font-size: 12px; color: var(--sa-label-3); font-variant-numeric: tabular-nums; }
.sa-sold__bar {
  margin-top: 6px;
  height: 4px;
  width: 100%;
  max-width: 120px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
.sa-sold__bar i { display: block; height: 100%; border-radius: 4px; background: var(--st-blue); }

/* Trend */
.sa-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.sa-trend--up   { background: var(--st-green-bg); color: var(--st-green); }
.sa-trend--down { background: var(--st-red-bg);   color: var(--st-red); }
.sa-trend--flat { background: var(--st-grey-bg);  color: var(--st-grey); }
.sa-trend--new  { background: rgba(76,141,255,0.15); color: var(--st-blue); }

/* Stock chips */
.sa-chip {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sa-chip--red   { background: var(--st-red-bg);   color: var(--st-red); }
.sa-chip--amber { background: var(--st-amber-bg); color: var(--st-amber); }
.sa-chip--green { background: var(--st-green-bg); color: var(--st-green); }
.sa-chip--blank { color: var(--sa-label-3); font-weight: 500; font-size: 13px; }

/* Cover */
.sa-cover { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sa-cover__num { font-weight: 600; }
.sa-cover__unit { font-size: 12px; color: var(--sa-label-3); margin-left: 2px; }
.sa-cover--red   .sa-cover__num { color: var(--st-red); }
.sa-cover--amber .sa-cover__num { color: var(--st-amber); }
.sa-cover--green .sa-cover__num { color: var(--st-green); }
.sa-cover--blue  .sa-cover__num { color: var(--st-blue); }

/* Action */
.sa-action { font-size: 13px; color: var(--sa-label); line-height: 1.4; }
.sa-action__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.sa-tag {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--st-grey-bg);
  color: var(--sa-label-2);
  white-space: nowrap;
}

.sa-empty { padding: 36px 20px; text-align: center; color: var(--sa-label-3); }

.sa-method {
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--sa-label-3);
  max-width: 860px;
}
.sa-method b { color: var(--sa-label-2); font-weight: 600; }

/* ── MOBILE: table rows become cards ── */
@media (max-width: 760px) {
  .sa-controls__row { flex-direction: column; }
  .sa-sort { justify-content: space-between; }
  .sa-table thead { display: none; }
  .sa-table, .sa-table tbody { display: block; }
  .sa-table tr.sa-group { display: block; }
  .sa-table tr.sa-group td { display: block; }
  .sa-table tr.sa-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "pri  prod  sold"
      "m    m     m"
      "act  act   act";
    gap: 10px 12px;
    padding: 14px;
    border-bottom: 1px solid var(--sa-line);
  }
  .sa-table tr.sa-row td { display: block; padding: 0; border: 0; }
  .sa-table tr.sa-row td.sa-pri-cell  { grid-area: pri; }
  .sa-table tr.sa-row td.sa-prod-cell { grid-area: prod; }
  .sa-table tr.sa-row td.sa-sold      { grid-area: sold; min-width: 0; text-align: right; }
  .sa-sold__bar { margin-left: auto; width: 80px; }
  .sa-table tr.sa-row td.sa-action-cell { grid-area: act; }
  /* Trend, stock and cover collapse into one strip of labelled chips */
  .sa-table tr.sa-row td.sa-mobile-strip { grid-area: m; display: flex; flex-wrap: wrap; gap: 6px; }
  .sa-table tr.sa-row td.sa-trend-cell,
  .sa-table tr.sa-row td.sa-loc,
  .sa-table tr.sa-row td.sa-cover-cell { display: none; }
}
.sa-mobile-strip { display: none; }
.sa-mstat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 9px;
  background: var(--sa-panel-2);
  font-size: 11px;
  color: var(--sa-label-3);
}
.sa-mstat .sa-chip { min-width: 30px; height: 22px; font-size: 12px; border-radius: 6px; }
.sa-mstat .sa-trend { padding: 2px 6px; }

/* ── Overrides for site-wide defaults (body is centred, headings are display caps) ── */
.sa-results, .sa-config, .sa-table-wrap, .sa-status, .sa-help__body { text-align: left; }
.sa-help summary, .sa-hero { text-align: center; }
.sa-panel__title, .sa-panel__sub, .sa-title, .sa-config summary {
  text-transform: none;
}
.sa-panel__sub { text-transform: uppercase; }
.sa-status[hidden], .sa-results[hidden], .sa-empty[hidden] { display: none !important; }
.sa-sold__units, .sa-sold__val { text-align: inherit; }
.sa-results { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* Blank cells from the file are shown as "blank", never as 0 or a dash */
.sa-blank {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
  color: var(--sa-label-3);
}
.sa-chip--text { background: var(--st-grey-bg); color: var(--sa-label-2); font-weight: 500; }
.sa-cover__note {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--sa-label-3);
  white-space: nowrap;
}

/* Original file view */
.sa-original { margin-top: 14px; padding: 0; }
.sa-original summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  padding: 16px 20px; cursor: pointer; font-weight: 600; list-style: none;
}
.sa-original summary::-webkit-details-marker { display: none; }
.sa-original summary::after { content: '+'; margin-left: auto; font-family: var(--font-mono); color: var(--sa-label-3); }
.sa-original[open] summary::after { content: '−'; }
.sa-original__scroll { overflow: auto; max-height: 520px; margin: 0 20px 20px; border: 1px solid var(--sa-line); border-radius: 10px; }
.sa-original__table { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: pre; }
.sa-original__table th, .sa-original__table td { padding: 7px 10px; border-bottom: 1px solid var(--sa-line); border-right: 1px solid var(--sa-line); text-align: left; }
.sa-original__table th { position: sticky; top: 0; background: var(--sa-panel-2); color: var(--sa-label); font-weight: 600; }
.sa-original__table td.sa-rownum, .sa-original__table th.sa-rownum { color: var(--sa-label-3); font-family: var(--font-mono); font-size: 11px; }
.sa-original__table tr.is-skipped td { color: var(--sa-label-3); }
.sa-original__table tr.is-skipped td.sa-rownum::after { content: ' not a product'; font-family: var(--font-body); font-style: italic; }

/* ── v2: real-report layout ── */
.sa-src { font-size: 11px; color: var(--sa-label-3); font-style: italic; }
.sa-kpi__value small { font-size: 13px; font-weight: 500; color: var(--sa-label-3); }
.sa-table th small { font-size: 10px; color: var(--sa-label-3); font-weight: 400; }
.sa-table tr.sa-row { cursor: pointer; }
.sa-table tr.sa-row:focus-visible { outline: 2px solid var(--sa-accent); outline-offset: -2px; }
.sa-table tr.sa-row.is-open { background: rgba(255,255,255,0.03); }
.sa-tablehint { margin-top: 10px; font-size: 12.5px; color: var(--sa-label-3); }

.sa-prod__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px;
  margin-top: 4px; font-size: 11.5px; color: var(--sa-label-2);
}
.sa-prod__meta i { font-style: normal; color: var(--sa-label-3); }
.sa-prod__ranks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sa-rank {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.02em;
  padding: 2px 6px; border-radius: 5px; background: rgba(76,141,255,0.12); color: #8fb6ff;
}

/* Retail vs online split */
.sa-chan { margin-top: 8px; max-width: 150px; }
.sa-chan__bar { display: flex; height: 5px; border-radius: 5px; overflow: hidden; background: rgba(255,255,255,0.05); }
.sa-chan__bar i { display: block; height: 100%; }
.sa-chan__r { background: #f7b955; }
.sa-chan__o { background: #b28bff; }
.sa-chan__txt { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; font-size: 11px; color: var(--sa-label-2); white-space: nowrap; }
.sa-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.sa-dot--r { background: #f7b955; }
.sa-dot--o { background: #b28bff; }
.sa-sold__val small { font-size: 11px; color: var(--sa-label-3); font-weight: 400; }

.sa-stock { font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1.6; white-space: nowrap; }
.sa-mini { display: inline-block; min-width: 44px; font-size: 10.5px; color: var(--sa-label-3); }
.sa-ret { font-variant-numeric: tabular-nums; }
.sa-ret.is-high { color: #c58bff; font-weight: 600; }

/* Expanded product: every column from the file */
.sa-detail td { padding: 0 14px 16px !important; background: rgba(255,255,255,0.03); }
.sa-detail__head { padding: 4px 2px 10px; font-size: 12px; color: var(--sa-label-2); }
.sa-detail__head span { color: var(--sa-label-3); }
.sa-detail__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.sa-detail__item {
  display: flex; flex-direction: column; gap: 3px; padding: 8px 10px;
  border-radius: 8px; background: var(--sa-panel-2); min-width: 0;
}
.sa-detail__item span { font-size: 10.5px; color: var(--sa-label-3); }
.sa-detail__item b { font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Breakdowns */
.sa-breakdowns { margin-top: 28px; }
.sa-section-title {
  font-family: var(--font-serif); font-size: 22px; font-weight: 600;
  text-transform: none; letter-spacing: -0.01em; margin-bottom: 12px;
}
.sa-bd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 14px; }
.sa-bd__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sa-bd__top .sa-panel__title { margin-bottom: 6px; }
.sa-bd__src { font-size: 11px; color: var(--sa-label-3); }
.sa-bd__head { font-size: 13px; color: var(--sa-label-2); margin-bottom: 12px; line-height: 1.5; }
.sa-bd__head b { color: var(--sa-label); }
.sa-bd__scroll { overflow-x: auto; max-height: 460px; overflow-y: auto; }
.sa-bd__table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sa-bd__table th {
  position: sticky; top: 0; background: var(--sa-panel);
  padding: 8px 8px; text-align: right; font-weight: 500; font-size: 11px; color: var(--sa-label-3);
  border-bottom: 1px solid var(--sa-line); white-space: nowrap;
}
.sa-bd__table th:first-child, .sa-bd__table td:first-child { text-align: left; }
.sa-bd__table td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--sa-line); white-space: nowrap; }
.sa-bd__label { font-weight: 600; color: var(--sa-label); }
.sa-bd__measure { position: relative; min-width: 110px; }
.sa-bd__bar { position: absolute; left: 8px; right: 8px; top: 50%; height: 18px; transform: translateY(-50%); pointer-events: none; }
.sa-bd__bar i { display: block; height: 100%; border-radius: 4px; background: rgba(76,141,255,0.18); }
.sa-bd__num { position: relative; }
.sa-bd__table tr.is-total td { font-weight: 700; border-top: 1px solid var(--sa-line-2); color: var(--sa-label); }

/* Original sheet group row */
.sa-original__table th.sa-grouphead { color: var(--sa-label-2); font-weight: 500; font-size: 11px; top: 0; }

.sa-map__note { grid-column: 1 / -1; margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--sa-label-3); }
.sa-map__note b { color: var(--sa-label-2); }

.sa-results.is-breakdown-only .sa-kpis,
.sa-results.is-breakdown-only .sa-split,
.sa-results.is-breakdown-only .sa-config,
.sa-results.is-breakdown-only .sa-controls,
.sa-results.is-breakdown-only .sa-table-wrap,
.sa-results.is-breakdown-only .sa-tablehint,
.sa-results.is-breakdown-only .sa-original { display: none; }

/* Mobile: product rows become cards (v2 column classes) */
@media (max-width: 760px) {
  .sa-table tr.sa-row td.sa-a-pri  { grid-area: pri; }
  .sa-table tr.sa-row td.sa-a-prod { grid-area: prod; }
  .sa-table tr.sa-row td.sa-a-sold { grid-area: sold; min-width: 0; text-align: right; }
  .sa-table tr.sa-row td.sa-a-act  { grid-area: act; }
  .sa-table tr.sa-row td.sa-m-hide { display: none; }
  .sa-table tr.sa-row td.sa-a-sold .sa-chan { margin-left: auto; }
  .sa-table tr.sa-row td.sa-a-sold .sa-chan__txt { justify-content: flex-end; }
  .sa-detail td { display: block; padding: 0 14px 14px !important; }
}
.sa-cur { margin-right: 1px; color: var(--sa-label-2); font-weight: 500; }
.sa-pri--check { background: rgba(197,139,255,0.16); color: #c58bff; }

.sa-table td.sa-col-prod { min-width: 230px; }
.sa-table td.sa-col-sold { min-width: 150px; }
@media (max-width: 760px) { .sa-table td.sa-col-prod, .sa-table td.sa-col-sold { min-width: 0; } }
@media (max-width: 760px) {
  .sa-table tr.sa-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "pri  prod"
      ".    sold"
      "m    m"
      "act  act";
  }
  .sa-table tr.sa-row td.sa-a-sold { text-align: left; }
  .sa-table tr.sa-row td.sa-a-sold .sa-sold__bar,
  .sa-table tr.sa-row td.sa-a-sold .sa-chan { margin-left: 0; }
  .sa-table tr.sa-row td.sa-a-sold .sa-chan__txt { justify-content: flex-start; }
  .sa-prod__ranks { gap: 4px; }
  .sa-rank { font-size: 9.5px; }
}

/* Which sheets were read and what each was used for */
.sa-sheets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 16px; }
.sa-sheets:empty { display: none; }
.sa-sheets__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sa-label-3); margin-right: 4px; }
.sa-sheet {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--sa-panel); border: 1px solid var(--sa-line-2); color: var(--sa-label);
}
.sa-sheet small { font-weight: 400; font-size: 11.5px; color: var(--sa-label-3); }
.sa-sheet--products { border-color: rgba(95,216,132,0.35); }
.sa-sheet--products small { color: var(--st-green); }
.sa-sheet--empty { opacity: 0.6; }
.sa-sheettag {
  margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-family: var(--font-body);
  font-size: 10px; letter-spacing: 0; background: rgba(255,255,255,0.07); color: var(--sa-label-2);
}
.sa-original__sheet { margin: 4px 20px 8px; font-size: 13px; font-weight: 600; text-transform: none; font-family: var(--font-body); letter-spacing: 0; }
.sa-original__sheet span { font-weight: 400; color: var(--sa-label-3); margin-left: 6px; }
.sa-map__sheet { grid-column: 1 / -1; }
.sa-th-note { display: block; margin-top: 2px; font-size: 11px; color: var(--sa-label-3); }
/* Wide reports: let the table scroll sideways instead of clipping columns */
.sa-table-wrap { overflow-x: auto; }
@media (min-width: 761px) {
  .sa-table th, .sa-table td { padding-left: 10px; padding-right: 10px; }
  .sa-table td.sa-col-prod { min-width: 210px; }
  .sa-table td.sa-col-sold { min-width: 130px; }
  .sa-table td.sa-col-action { min-width: 140px; }
}
.sa-results .sa-container { max-width: 1380px; }

/* Pinned column headings (copy of the table header, see stickyHead in JS) */
.sa-stickyhead {
  position: fixed;
  z-index: 19;
  overflow: hidden;
  display: none;
  background: var(--sa-panel);
  border: 1px solid var(--sa-line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.55);
  pointer-events: none;
}
.sa-stickyhead.is-on { display: block; }
.sa-stickyhead .sa-table th { border-bottom: 0; background: var(--sa-panel); }
.sa-controls { background: #000; }

/* ── Product images ── */
.sa-table td.sa-col-img { width: 72px; padding-right: 4px; }
.sa-thumb {
  position: relative;
  display: grid; place-items: center;
  width: 60px; aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: #fff;
  overflow: visible;
  text-decoration: none;
}
.sa-thumb__img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: #fff; }
.sa-thumb::after {            /* shimmer while loading */
  content: ''; position: absolute; inset: 0; border-radius: 8px;
  background: linear-gradient(100deg, #1a1a1d 30%, #26262b 50%, #1a1a1d 70%);
  background-size: 200% 100%; animation: sa-shimmer 1.2s linear infinite;
}
.sa-thumb.is-loaded::after,
.sa-thumb--none::after,
.sa-thumb:has(.sa-thumb__ph)::after { display: none; }
@keyframes sa-shimmer { to { background-position: -200% 0; } }
.sa-thumb--none, .sa-thumb:has(.sa-thumb__ph) { background: var(--sa-panel-2); color: var(--sa-label-3); }
.sa-thumb__ph { font-size: 10px; line-height: 1.25; text-align: center; color: var(--sa-label-3); padding: 4px; }
.sa-thumb__ph small { color: #8fb6ff; font-size: 9.5px; }
/* Hover: larger preview */
.sa-thumb__big {
  position: absolute; left: calc(100% + 10px); top: 50%; z-index: 30;
  width: 220px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0 18px 40px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(-50%) scale(0.96); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.sa-thumb__big img { width: 100%; height: 100%; object-fit: contain; }
.sa-thumb.is-loaded:hover .sa-thumb__big { opacity: 1; transform: translateY(-50%) scale(1); }
.sa-thumb:focus-visible { outline: 2px solid var(--sa-accent); outline-offset: 2px; }

/* Images on/off switch */
.sa-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sa-label-2); cursor: pointer; white-space: nowrap; }
.sa-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sa-switch__track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: rgba(255,255,255,0.14); transition: background .2s; }
.sa-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sa-switch input:checked + .sa-switch__track { background: var(--sa-accent); }
.sa-switch input:checked + .sa-switch__track::after { transform: translateX(14px); }
.sa-switch input:focus-visible + .sa-switch__track { outline: 2px solid var(--sa-accent); outline-offset: 2px; }

@media (max-width: 760px) {
  .sa-table tr.sa-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "pri  img  prod"
      ".    img  sold"
      "m    m    m"
      "act  act  act";
  }
  .sa-table tr.sa-row:not(:has(.sa-a-img)) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "pri prod" ". sold" "m m" "act act";
  }
  .sa-table tr.sa-row td.sa-a-img { grid-area: img; }
  .sa-thumb { width: 56px; }
  .sa-thumb__big { display: none; }
  .sa-controls__row .sa-switch { order: 2; }
}
/* Square, larger product images */
.sa-table td.sa-col-img { width: 96px; }
.sa-thumb { width: 84px; aspect-ratio: 1 / 1; }
.sa-thumb__img { object-fit: cover; }
.sa-thumb__big { aspect-ratio: 1 / 1; width: 240px; }
.sa-thumb__big img { object-fit: cover; }
@media (max-width: 760px) { .sa-thumb { width: 72px; } }
/* ── Breakdowns: full width, same look as the product table ── */
.sa-bd-grid { grid-template-columns: 1fr; gap: 18px; }
.sa-bd { padding: 0; overflow: hidden; }
.sa-bd__top { padding: 20px 22px 0; }
.sa-bd__head { padding: 0 22px; }
.sa-bd__scroll { max-height: none; overflow-x: auto; border-top: 1px solid var(--sa-line); }
.sa-bd__table { font-size: 14px; }
.sa-bd__table th { position: static; padding: 13px 14px; font-size: 12px; font-weight: 500; text-align: right; background: transparent; }
.sa-bd__table td { padding: 13px 14px; }
.sa-bd__table tbody tr:hover { background: rgba(255,255,255,0.025); }
.sa-bd__label { font-size: 14px; }
.sa-bd__measure { min-width: 160px; }
.sa-bd__bar { position: static; display: block; height: 4px; width: 100%; max-width: 140px; margin: 6px 0 0 auto; transform: none; border-radius: 4px; background: rgba(255,255,255,0.05); }
.sa-bd__bar i { background: var(--st-blue); }
.sa-bd__measure { display: table-cell; }
.sa-bd__measure .sa-bd__num { display: block; font-weight: 600; }
.sa-bd__measure .sa-bd__bar { order: 2; }
.sa-bd__pct span:last-child { display: block; }
.sa-bd__share { display: block; height: 4px; width: 60px; margin: 0 0 5px auto; border-radius: 4px; background: rgba(255,255,255,0.05); overflow: hidden; }
.sa-bd__share i { display: block; height: 100%; background: #b28bff; }
.sa-bd__table tr.is-total td { background: rgba(255,255,255,0.03); }

/* Breakdown label icons */
.sa-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; vertical-align: middle;
  border-radius: 8px; background: rgba(255,255,255,0.06); font-size: 14px; line-height: 1; }
.sa-ico--swatch { border-radius: 50%; width: 18px; height: 18px; margin: 0 14px 0 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); }
.sa-ico--letter { font-size: 11px; font-weight: 700; color: var(--sa-label-2); font-family: var(--font-mono); }
.sa-ico__size { display: block; border-radius: 3px; background: var(--st-blue); }

/* Breakdown sort pills */
.sa-bd__pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 22px 16px; }
.sa-pill--sm { padding: 6px 12px; font-size: 12px; }
/* Fit every column without sideways scrolling on desktop */
@media (min-width: 900px) {
  .sa-bd__scroll { overflow-x: visible; }
  .sa-bd__table { table-layout: auto; width: 100%; font-size: 12.5px; }
  .sa-bd__table th { white-space: normal; padding: 10px 7px; font-size: 11px; line-height: 1.25; vertical-align: bottom; }
  .sa-bd__table td { padding: 10px 7px; white-space: nowrap; }
  .sa-bd__table th:first-child, .sa-bd__table td:first-child { padding-left: 18px; }
  .sa-bd__label { font-size: 13px; white-space: normal !important; min-width: 120px; }
  .sa-bd__measure { min-width: 0; }
  .sa-bd__bar { max-width: 80px; }
  .sa-bd__share { width: 40px; }
  .sa-bd__table .sa-trend { padding: 2px 6px; font-size: 11px; }
  .sa-ico { width: 22px; height: 22px; margin-right: 8px; font-size: 12px; }
}
@media (min-width: 900px) and (max-width: 1279px) {
  .sa-bd__table { font-size: 11.5px; }
  .sa-bd__table th { font-size: 10px; padding: 8px 4px; }
  .sa-bd__table td { padding: 8px 4px; }
  .sa-bd__bar, .sa-bd__share, .sa-ico { display: none; }
  .sa-bd__table .sa-trend { padding: 1px 4px; font-size: 10.5px; }
  .sa-bd__label { min-width: 90px; }
}
@media (max-width: 999px) { .sa-bd__scroll { overflow-x: auto; } }

/* Breakdown pie summaries */
.sa-bd__pies { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 34px; padding: 6px 22px 18px; }
.sa-pie { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sa-pie svg { width: 150px; height: 150px; }
.sa-pie circle { transition: opacity .15s; }
.sa-pie circle:hover { opacity: .75; }
.sa-pie__pct { fill: #fff; font: 700 20px var(--font-body); }
.sa-pie__lab { fill: var(--sa-label-3); font: 500 10px var(--font-body); }
.sa-pie figcaption { font-size: 12px; color: var(--sa-label-2); }
.sa-pie__legend { flex: 1; min-width: 260px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 22px; }
.sa-pie__legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sa-pie__legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.sa-pie__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sa-label); }
.sa-pie__legend b { font-variant-numeric: tabular-nums; }
.sa-pie__legend .sa-trend { padding: 1px 6px; font-size: 10.5px; }
.sa-pie__wow { font-size: 11px; color: var(--sa-label-3); white-space: nowrap; }
.sa-top--worst .sa-top__bar i { background: var(--st-red); }

.sa-sort--then span { font-style: italic; }
@media (min-width: 761px) { .sa-controls__row { flex-wrap: wrap; } .sa-search { min-width: 240px; } }

.sa-match{display:block;margin-top:4px;font-size:10px;letter-spacing:.02em;color:var(--sa-muted,#8a8a92);white-space:nowrap}
.sa-insight .sa-muted{opacity:.65;font-weight:400}

/* ── Theme toggle ── */
.sa-theme {
  position: fixed; right: clamp(14px, 3vw, 28px); bottom: clamp(14px, 3vw, 28px);
  z-index: 110; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: #17171a; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  color: #f5f5f7; font: 600 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.sa-theme:hover { border-color: #e0143c; }
.sa-theme:focus-visible { outline: 2px solid var(--sa-accent, #e0143c); outline-offset: 3px; }
.sa-theme svg { width: 15px; height: 15px; }
.sa-theme .sa-theme__sun { display: none; }
html.sa-light .sa-theme .sa-theme__sun { display: block; }
html.sa-light .sa-theme { background: #fff; color: #111114; border-color: rgba(0,0,0,.16); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
html.sa-light .sa-theme .sa-theme__moon { display: none; }
@media (max-width: 760px) { .sa-theme__text { display: none; } .sa-theme { padding: 0 9px; } }

/* ── Light mode: every text colour is dark enough to read on white ── */
html.sa-light {
  color-scheme: light;
  --bg: #f4f4f6; --bg-2: #ececef; --bg-3: #e4e4e8; --bg-4: #dcdce1;
  --text: #111114; --text-2: #55555c; --text-3: #8a8a92;
  --red: #c4001f;
  --border: rgba(0,0,0,0.08); --border-2: rgba(0,0,0,0.16);
}
html.sa-light, html.sa-light body, html.sa-light .sa-body { background: #f4f4f6; }
html.sa-light .sa-page {
  --sa-panel:    #ffffff;
  --sa-panel-2:  #f1f1f4;
  --sa-line:     rgba(0,0,0,0.09);
  --sa-line-2:   rgba(0,0,0,0.16);
  --sa-label:    #111114;
  --sa-label-2:  #4a4a52;
  --sa-label-3:  #6a6a72;
  --sa-accent:   #c4001f;
  --sa-muted:    #6a6a72;
  --st-red-bg:   rgba(196, 0, 31, 0.10);
  --st-red:      #b0001c;
  --st-amber-bg: rgba(200, 120, 0, 0.13);
  --st-amber:    #8a5200;
  --st-green-bg: rgba(20, 140, 60, 0.12);
  --st-green:    #11702f;
  --st-grey-bg:  rgba(0,0,0,0.05);
  --st-grey:     #55555c;
  --st-blue:     #1f5fd1;
  background: #f4f4f6;
  color: var(--sa-label);
}
html.sa-light .nav.is-scrolled { background: rgba(244,244,246,0.92); border-bottom-color: rgba(0,0,0,0.08); }
html.sa-light .nav .back-btn, html.sa-light .nav__links a { color: #4a4a52; }
html.sa-light .nav .back-btn:hover, html.sa-light .nav__links a:hover { color: #111114; }
html.sa-light .sa-controls { background: #f4f4f6; }
html.sa-light .sa-stickyhead { background: #f4f4f6; }
html.sa-light .sa-btn:not(.sa-btn--ghost) { color: #fff; background: var(--sa-accent); border-color: var(--sa-accent); }
html.sa-light .sa-btn--ghost:hover { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.3); }
html.sa-light .sa-drop { border-color: rgba(0,0,0,0.2); }
html.sa-light .sa-pill:hover:not(:disabled) { border-color: rgba(0,0,0,0.3); }
html.sa-light .sa-pill__count { background: rgba(0,0,0,0.07); }
html.sa-light .sa-pill.is-active { background: #111114; color: #fff; border-color: #111114; }
html.sa-light .sa-pill.is-active .sa-pill__count { background: rgba(255,255,255,0.18); color: #fff; }
html.sa-light .sa-table tbody tr.sa-row:hover,
html.sa-light .sa-bd__table tbody tr:hover { background: rgba(0,0,0,0.03); }
html.sa-light .sa-table tr.sa-row.is-open,
html.sa-light .sa-detail td,
html.sa-light .sa-bd__table tr.is-total td { background: rgba(0,0,0,0.035); }
html.sa-light .sa-chan__bar, html.sa-light .sa-bd__bar, html.sa-light .sa-bd__share { background: rgba(0,0,0,0.07); }
html.sa-light .sa-switch__track { background: rgba(0,0,0,0.18); }
html.sa-light .sa-ico { background: rgba(0,0,0,0.05); }
html.sa-light .sa-ico--swatch, html.sa-light .sa-pie__legend i { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
html.sa-light .sa-pie__pct { fill: #111114; }
html.sa-light .sa-ret.is-high, html.sa-light .sa-pri--check { color: #7a2fc0; }
html.sa-light .sa-pri--check { background: rgba(122,47,192,0.12); }
html.sa-light .sa-thumb__ph small { color: #1f5fd1; }
html.sa-light .sa-rank, html.sa-light .sa-chan__tag { color: #1f5fd1; }
html.sa-light .sa-thumb, html.sa-light .sa-thumb__img { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }

/* Stock-vs-sales warning triangle */
.sa-swarn { display: inline-block; margin-left: 6px; font-size: 13px; line-height: 1; cursor: help; vertical-align: 1px; }
.sa-swarn--red   { color: var(--st-red); animation: saWarnPulse 1.8s ease-in-out infinite; }
.sa-swarn--amber { color: var(--st-amber); }
@keyframes saWarnPulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .sa-swarn--red { animation: none; } }

/* ── Breakdown trend overview ── */
.sa-bd__trends { margin: 4px 22px 18px; padding: 16px 18px; border-radius: 14px; background: var(--sa-panel-2); border: 1px solid var(--sa-line); }
.sa-bd__kicker { font: 700 10px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--sa-label-3); margin: 0 0 10px; }
.sa-bd__trends ul { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.sa-bd__trends .sa-insight { font-size: 13px; }

/* ── Mix panel (replaces the twin pies) ── */
.sa-mx { display: grid; grid-template-columns: 210px 1fr; gap: 26px; align-items: center; padding: 6px 22px 22px; }
.sa-mx__chart { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sa-mx__chart svg { width: 200px; height: 200px; overflow: visible; }
.sa-mx__base { stroke: var(--sa-line); }
.sa-mx__arc { transition: opacity .2s, stroke-width .2s; cursor: pointer; }
.sa-mx.is-focus .sa-mx__arc { opacity: .25; }
.sa-mx.is-focus .sa-mx__arc.is-on { opacity: 1; stroke-width: 26px; }
.sa-mx__pct { fill: var(--sa-label); font: 700 30px var(--font-body); letter-spacing: -.02em; }
.sa-mx__lab { fill: var(--sa-label-2); font: 500 11px var(--font-body); }
.sa-mx__cap { margin: 0; font: 700 10px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sa-label-3); }
.sa-mx__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sa-mx__row { display: grid; grid-template-columns: 12px minmax(90px, 1.2fr) 52px minmax(80px, 2fr) 92px 78px; align-items: center; gap: 12px;
  padding: 7px 10px; border-radius: 10px; font-size: 13px; transition: background .15s, opacity .2s; cursor: default; }
.sa-mx.is-focus .sa-mx__row { opacity: .45; }
.sa-mx.is-focus .sa-mx__row.is-on { opacity: 1; background: var(--sa-panel-2); }
.sa-mx__sw { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.sa-mx__name { color: var(--sa-label); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-mx__val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--sa-label); }
.sa-mx__track { position: relative; height: 8px; border-radius: 8px; background: var(--sa-line); }
.sa-mx__track i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; }
.sa-mx__ly { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 2px; background: var(--sa-label); opacity: .75; }
.sa-mx__row .sa-trend { justify-self: start; padding: 2px 7px; font-size: 10.5px; white-space: nowrap; }
.sa-mx__wow { font-size: 11px; color: var(--sa-label-3); white-space: nowrap; text-align: right; }
.sa-mx__stacks { margin-top: 16px; display: grid; gap: 8px; padding: 0 10px; }
.sa-mx__stack { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 12px; font-size: 11px; color: var(--sa-label-2); }
.sa-mx__stack div { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; }
.sa-mx__stack i { display: block; min-width: 2px; }
.sa-mx__note { margin: 2px 0 0; font-size: 11px; color: var(--sa-label-3); }
html.sa-light .sa-mx__sw { box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
@media (max-width: 900px) {
  .sa-mx { grid-template-columns: 1fr; }
  .sa-mx__row { grid-template-columns: 12px 1fr 52px 84px; }
  .sa-mx__track, .sa-mx__wow { display: none; }
}
.sa-bd .sa-mx { width: 100%; box-sizing: border-box; }
.sa-bd .sa-mx .sa-mx__legend { display: grid; grid-template-columns: 1fr; }
.sa-bd .sa-mx .sa-mx__row { display: grid; }
.sa-bd .sa-bd__trends ul { gap: 4px; }
.sa-bd .sa-bd__trends .sa-insight { padding: 8px 10px; background: transparent; gap: 10px; grid-template-columns: 24px 1fr; line-height: 1.5; }
.sa-bd .sa-bd__trends .sa-insight__icon { width: 24px; height: 24px; font-size: 12px; }
