:root {
  --canvas: #f6f7f5;
  --surface: #fff;
  --surface-muted: #f9faf8;
  --ink: #17211b;
  --muted: #66706a;
  --subtle: #929a95;
  --border: #e3e7e3;
  --border-strong: #d6dcd7;
  --green: #176b45;
  --green-soft: #e6f2eb;
  --lime-soft: #f1f4d2;
  --blue: #3a7195;
  --orange: #ad6c2b;
  --red: #ad4c48;
  --red-soft: #f9e9e8;
  --radius: 8px;
  --sidebar-width: 224px;
  --shadow: 0 1px 2px rgba(24, 39, 29, .04), 0 8px 24px rgba(24, 39, 29, .035);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  min-width: 320px;
  overflow-x: hidden;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; }
button { color: inherit; }
button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.offline-banner {
  position: fixed;
  top: 12px;
  right: 24px;
  left: calc(var(--sidebar-width) + 24px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1440px;
  margin: auto;
  padding: 10px 12px 10px 16px;
  color: #653926;
  background: #fbf0df;
  border: 1px solid #efdabc;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.offline-banner[hidden] { display: none; }
.offline-banner button {
  padding: 5px 9px;
  color: #653926;
  background: transparent;
  border: 1px solid #dfc7a5;
  border-radius: 5px;
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 27px 15px 22px;
  background: #fbfcf9;
  border-right: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 31px;
  margin: 0 13px 39px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .12em;
  text-decoration: none;
}
.brand-mark {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: var(--ink);
  clip-path: polygon(0 0, 33% 0, 33% 24%, 67% 24%, 67% 48%, 100% 48%, 100% 76%, 67% 76%, 67% 100%, 33% 100%, 33% 76%, 0 76%);
}
.navigation { display: flex; flex-direction: column; gap: 3px; }
.sidebar-navigation { margin-bottom: auto; }
.sidebar-nav-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px 9px;
  width: 100%;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.sidebar-nav-button:hover { color: var(--ink); background: #f0f4ef; }
.sidebar-nav-button.active { color: var(--green); background: var(--green-soft); }
.sidebar-nav-button svg { width: 16px; height: 16px; margin-top: 1px; }
.sidebar-nav-button span { font-size: 12px; font-weight: 650; }
.sidebar-nav-button small { grid-column: 2; overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-source-switcher { display: none; }
.unit-price-column { width: 122px; }
.online-table-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.online-table-panel { min-width: 0; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.online-table-panel.online-best-sellers { display: none; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.panel-heading h2 { margin: 0; font-size: 16px; }
.table-export-button, .section-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 29px;
  padding: 0 9px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #d4e6da;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}
.table-export-button:hover, .section-export-button:hover { background: #dcece2; }
.table-export-button svg, .section-export-button svg { width: 14px; height: 14px; }
.secondary-table-wrap { overflow-x: auto; }
.secondary-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.secondary-table th { padding: 6px 5px; color: var(--subtle); border-bottom: 1px solid var(--border); font-size: 9px; font-weight: 580; text-align: left; }
.secondary-table td { height: 46px; padding: 6px 5px; overflow: hidden; border-bottom: 1px solid #edf0ed; font-size: 10px; text-overflow: ellipsis; vertical-align: middle; }
.secondary-table th:nth-child(1) { width: 36px; }
.secondary-table th:nth-child(3), .secondary-table th:nth-child(4) { width: 74px; }
.secondary-table td:not(:nth-child(2)) { color: var(--muted); font-variant-numeric: tabular-nums; }
.online-country-panel { grid-column: 1 / -1; }
.country-selector { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.country-selector button { min-height: 26px; padding: 0 8px; color: var(--muted); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 9px; }
.country-selector button.active { color: var(--green); background: var(--green-soft); border-color: #c3ddcf; font-weight: 650; }
.country-product-caption { margin-bottom: 7px; color: var(--subtle); font-size: 9px; }
.country-product-table-wrap { border-top: 1px solid var(--border); }
.country-product-table { table-layout: fixed; }
.country-product-table .product-column { width: 33%; }
.country-product-table .model-column { width: 18%; }
.country-product-table .spec-column { width: 27%; }
.country-product-table .units-column { width: 10%; }
.country-product-table .price-column { width: 12%; }
.section-export-row { display: flex; justify-content: flex-end; margin-top: 11px; }
.clickable-product { position: relative; cursor: pointer; }
.clickable-product:hover .product-name { color: var(--green); }
.sku-open-icon { display: none; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 4px; color: var(--green); vertical-align: middle; }
.clickable-product:hover .sku-open-icon, .clickable-product:focus-visible .sku-open-icon { display: inline-flex; }
.sku-open-icon svg { width: 13px; height: 13px; }
.sku-open-icon[hidden] { display: none; }
.nav-caption {
  margin: 0 14px 12px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  transition: background-color .16s, color .16s;
}
.nav-link:hover { color: var(--ink); background: #f0f3ef; }
.nav-link.active { color: var(--ink); background: #ebf0ea; font-weight: 650; }
.nav-count { min-width: 22px; margin-left: auto; color: var(--subtle); font-size: 11px; text-align: right; }
.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: auto;
  padding: 18px 11px 0;
  border-top: 1px solid var(--border);
}
.sidebar-foot a {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.sidebar-foot a:hover { color: var(--ink); }
.sidebar-foot svg { width: 16px; height: 16px; }
.sidebar-source { display: flex; align-items: center; gap: 7px; color: var(--subtle); font-size: 10px; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; background: var(--subtle); border-radius: 50%; }
.status-dot.live { background: #389765; box-shadow: 0 0 0 3px rgba(56, 151, 101, .1); }
.status-dot.snapshot { background: #b77b36; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); }
.main-content, .content { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 73px;
  padding: 0 38px;
  background: rgba(251, 252, 249, .84);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.connection-state { display: flex; align-items: center; gap: 7px; margin-right: 5px; color: var(--muted); font-size: 11px; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  padding: 0;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.icon-button:hover { color: var(--ink); border-color: var(--border-strong); }
.icon-button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.export-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.export-button:hover { background: #115639; }
.export-button:disabled { cursor: wait; opacity: .75; }
.export-button svg { width: 16px; height: 16px; }
.content { width: min(100%, 1520px); padding: 36px 38px 20px; }
.numeric-audit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 13px; margin: -14px 0 20px; padding: 7px 10px; color: var(--muted); background: #fbfcf9; border: 1px solid var(--border); border-radius: 5px; font-size: 9px; line-height: 1.4; }
.numeric-audit:empty { display: none; }
.numeric-audit strong { color: var(--ink); font-size: 9px; font-weight: 650; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 29px;
}
.eyebrow { margin: 0 0 9px; color: var(--subtle); font-size: 9px; font-weight: 750; letter-spacing: .17em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 29px; font-weight: 710; letter-spacing: -.025em; line-height: 1.25; }
.heading-copy { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.source-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 13px;
  border-bottom: 1px solid var(--border-strong);
}
.source-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  min-height: 57px;
  padding: 9px 14px 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  text-align: left;
}
.source-button:hover { background: #f0f4ef; }
.source-button.active { color: var(--ink); background: var(--surface); }
.source-button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--green);
  content: "";
}
.source-button-label { font-size: 13px; font-weight: 680; }
.source-button-range {
  width: 100%;
  overflow: hidden;
  color: var(--subtle);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-workspace[hidden] { display: none; }
.period-panel {
  margin-bottom: 22px;
  padding: 12px 13px 8px;
  background: #fbfcf9;
  border: 1px solid var(--border);
  border-radius: 0 6px 6px 6px;
}
.period-heading { display: flex; align-items: baseline; gap: 10px; margin: 0 1px 7px; }
.period-heading > span { color: var(--ink); font-size: 11px; font-weight: 650; }
.period-heading small { overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.tob-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.tob-toolbar .period-heading { margin-bottom: 0; padding-top: 8px; }
.source-range-notice { margin-top: 7px; color: var(--subtle); font-size: 9px; line-height: 1.45; }
.online-series-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; padding-top: 7px; border-top: 1px solid #edf0ed; }
.online-series-filter > span { color: var(--subtle); font-size: 9px; }
.online-series-filter { flex-wrap: wrap; overflow-x: visible; scrollbar-width: thin; }
.online-series-filter .period-options { min-width: 0; flex-wrap: wrap; }
.metric-fx { max-width: 1160px; margin: 6px auto 0; color: var(--subtle); font-size: 9px; line-height: 1.6; }
.online-cost-block { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.cost-source-link { color: var(--green-deep, #155f40); font-size: 10px; font-weight: 650; text-decoration: none; }
.cost-source-link:hover { text-decoration: underline; }
.cost-inline-import { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 9px; white-space: nowrap; }
.cost-inline-import input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.spec-select { max-width: 150px; min-height: 27px; padding: 0 18px 0 6px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; font-size: 9px; }
.combined-workspace { margin-bottom: 22px; }
.combined-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 16px 18px;
  background: #fbfcf9;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.combined-summary h2 { margin: 0 0 5px; font-size: 16px; font-weight: 680; }
.combined-summary p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.combined-range-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-left: 13px; border-left: 1px solid var(--border); }
.combined-range-item span { color: var(--muted); font-size: 10px; }
.combined-range-item strong { color: var(--ink); font-size: 11px; font-weight: 650; }
.combined-range-item small { color: var(--subtle); font-size: 9px; line-height: 1.35; }
.combined-jump-button { padding: 5px 8px; color: var(--green); background: var(--green-soft); border: 1px solid #d4e6da; border-radius: 4px; cursor: pointer; font-size: 9px; white-space: nowrap; }
.compact-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 108px;
  padding: 6px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.compact-field span { color: var(--subtle); font-size: 9px; }
.compact-field select { max-width: 160px; padding: 0 16px 0 0; color: var(--ink); background: transparent; border: 0; cursor: pointer; font-size: 11px; font-weight: 600; }
.period-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 35px;
  margin-bottom: 0;
  padding: 3px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.period-label { color: var(--subtle); font-size: 9px; }
.period-options { display: flex; flex-wrap: wrap; gap: 3px; }
.period-button {
  min-height: 27px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  white-space: nowrap;
}
.period-button:hover { color: var(--ink); background: #f2f5f1; }
.period-button.active { color: var(--green); background: var(--green-soft); border-color: #cfe2d5; font-weight: 650; }
.custom-date { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--subtle); font-size: 9px; white-space: nowrap; }
.custom-date input { width: 112px; min-height: 26px; padding: 1px 4px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; font-size: 10px; }
.custom-date button { min-height: 26px; padding: 0 7px; color: var(--green); background: var(--green-soft); border: 1px solid #d4e6da; border-radius: 4px; cursor: pointer; font-size: 9px; }
.coverage-note { display: flex; align-items: flex-start; gap: 6px; margin: -11px 0 15px; color: var(--orange); font-size: 10px; line-height: 1.5; }
.coverage-note[hidden] { display: none; }
.coverage-note svg { width: 13px; height: 13px; margin-top: 1px; flex: 0 0 13px; }
.price-basis {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 31px;
  margin: -7px 0 14px;
  padding: 6px 10px;
  color: var(--muted);
  background: #fbfcf9;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.45;
}
.price-basis strong { flex: 0 0 auto; color: var(--ink); font-size: 10px; font-weight: 650; }
.amount-only-banner { margin: -5px 0 14px; padding: 7px 10px; color: var(--muted); background: #fff9ee; border: 1px solid #ead8b8; border-radius: 5px; font-size: 10px; line-height: 1.5; }
.amount-only-banner[hidden] { display: none; }
.date-field {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  row-gap: 2px;
  width: 250px;
  min-width: 0;
  padding: 9px 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.date-field > span:first-child { color: var(--subtle); font-size: 9px; grid-column: 1; grid-row: 1; line-height: 1.4; }
.date-field select {
  appearance: none;
  padding: 0 17px 0 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  grid-column: 1;
  grid-row: 2;
}
.date-field > svg {
  width: 15px;
  height: 15px;
  margin: -45px 0 0 -2px;
  color: var(--muted);
  grid-column: 1;
  grid-row: 2;
  pointer-events: none;
}
.date-value {
  padding-left: 4px;
  color: var(--muted);
  border-left: 1px solid var(--border);
  font-size: 11px;
  grid-column: 2;
  grid-row: 1 / 3;
  line-height: 1.5;
  white-space: nowrap;
}

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric {
  min-height: 145px;
  padding: 18px 20px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric:nth-child(2) { background: #fafcf8; }
.metric:nth-child(3) { background: #f8fbf5; }
.metric:nth-child(4) { background: #fafcf8; }
.metric-label { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 15px; }
.metric-label h2 { margin: 0; color: var(--muted); font-size: 11px; font-weight: 550; }
.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: -4px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
}
.metric-icon.accent { color: #667b22; background: var(--lime-soft); }
.metric-icon svg { width: 14px; height: 14px; }
.metric-value { min-height: 34px; margin-bottom: 9px; font-size: 31px; font-weight: 710; letter-spacing: -.035em; line-height: 1; }
.metric-value small { margin-left: 4px; color: var(--subtle); font-size: 10px; font-weight: 500; letter-spacing: 0; }
.metric-value .channel-breakdown { display: block; margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.metric-feature {
  display: -webkit-box;
  height: 35px;
  margin-bottom: 8px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
}
.metric-detail { display: flex; align-items: center; gap: 6px; color: var(--subtle); font-size: 10px; white-space: nowrap; }
.metric-detail span + span::before { content: "·"; margin-right: 6px; }
.delta { padding: 2px 5px; color: var(--green); background: var(--green-soft); border-radius: 3px; font-weight: 650; }
.delta.negative { color: var(--red); background: var(--red-soft); }
.delta.neutral { color: var(--muted); background: #eef1ee; }

.category-summary { display: flex; gap: 27px; margin: 22px 0 32px; padding: 0 2px; }
.category-summary-label { display: flex; flex: 0 0 auto; flex-direction: column; justify-content: center; gap: 2px; min-width: 94px; }
.category-summary-label > span { color: var(--ink); font-size: 11px; font-weight: 650; }
.category-summary-label > small { color: var(--subtle); font-size: 9px; white-space: nowrap; }
.international-insights {
  margin: 23px 0 30px;
  padding: 17px 19px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.international-insights[hidden] { display: none; }
.combined-insights { border-left: 3px solid #d7e4d9; }
.insight-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.insight-heading .eyebrow { margin-bottom: 5px; }
.insight-heading h2 { margin: 0; font-size: 16px; font-weight: 690; }
.insight-filter { padding: 4px 7px; color: var(--green); background: var(--green-soft); border: 1px solid #d4e6da; border-radius: 4px; cursor: pointer; font-size: 9px; }
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 17px; }
.insight-card h3 { margin: 0 0 10px; color: var(--muted); font-size: 10px; font-weight: 550; }
.insight-card .insight-subheading { margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf0ed; }
.breakdown-list { display: flex; flex-direction: column; gap: 8px; }
.breakdown-item { display: grid; grid-template-columns: minmax(0, 1fr) 46px; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.breakdown-item strong { font-size: 10px; font-weight: 600; }
.breakdown-bar { grid-column: 1 / -1; height: 4px; overflow: hidden; background: #edf1ed; border-radius: 4px; }
.breakdown-bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.breakdown-item:nth-child(2) .breakdown-bar span { background: #539276; }
.breakdown-item:nth-child(3) .breakdown-bar span { background: #8eb3a0; }
.insight-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 10px; color: var(--subtle); border-top: 1px solid #edf0ed; font-size: 9px; }
.data-audit-link { padding: 0; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 9px; text-decoration: underline; }
.data-audit-link:hover { color: var(--ink); }
.country-table-section { margin: 0 0 30px; }
.country-table-section .section-title-row { margin-bottom: 14px; }
.compact-country-wrap { border-top: 1px solid var(--border); border-radius: var(--radius); }
.country-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.country-table th { height: 34px; padding: 0 10px; color: var(--muted); background: #fbfcfa; border-bottom: 1px solid var(--border); font-size: 9px; text-align: left; font-weight: 550; }
.country-table td { height: 33px; padding: 4px 10px; color: var(--muted); border-bottom: 1px solid #edf0ed; }
.country-table tbody tr:last-child td { border-bottom: 0; }
.country-table td:first-child { color: var(--ink); font-weight: 600; }
.country-table td.units { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.country-table th.country-units { text-align: right; }
.country-table td.share { text-align: right; font-variant-numeric: tabular-nums; }
.country-detail-actions { display: flex; align-items: center; gap: 10px; }
.country-expand-button { padding: 3px 7px; color: var(--green); background: var(--green-soft); border: 1px solid #d4e6da; border-radius: 4px; cursor: pointer; font-size: 9px; }
.market-flow-section { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; margin-bottom: 28px; }
.flow-column { padding: 15px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.flow-column .section-title-row { margin-bottom: 12px; }
.flow-column .section-title-row h2 { font-size: 15px; }
.market-flow, .order-flow { display: flex; flex-direction: column; gap: 8px; }
.market-row { display: grid; grid-template-columns: 54px minmax(30px, 1fr) 53px 39px 51px; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.market-name { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.market-bar { height: 5px; overflow: hidden; background: #edf1ed; border-radius: 4px; }
.market-bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.market-value { color: var(--ink); font-size: 10px; text-align: right; }
.market-share { text-align: right; }
.market-clients { color: var(--subtle); text-align: right; }
.order-row { display: grid; grid-template-columns: minmax(76px, 1fr) minmax(62px, 1.2fr) 43px 56px; align-items: center; gap: 5px; min-height: 27px; color: var(--muted); font-size: 9px; }
.order-code { overflow: hidden; color: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.order-client, .order-country { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row strong { color: var(--ink); font-size: 9px; text-align: right; white-space: nowrap; }
.breakdown-empty { padding: 20px 0; color: var(--subtle); font-size: 10px; }
.customer-country-group { padding-bottom: 8px; border-bottom: 1px solid #f0f2ef; }
.customer-country-group:last-child { padding-bottom: 0; border-bottom: 0; }
.customer-group-header { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 10px; font-weight: 620; }
.customer-group-header strong { font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.customer-group-bar { height: 4px; margin-top: 6px; overflow: hidden; background: #edf1ed; border-radius: 4px; }
.customer-group-bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.customer-group-names { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 5px; color: var(--muted); font-size: 9px; }
.customer-group-names b { color: var(--ink); font-weight: 600; }
@media (max-width: 600px) {
  .country-table th:nth-child(2), .country-table td:nth-child(2) { display: none; }
  .country-table th:nth-child(3), .country-table td:nth-child(3) { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .country-table th, .country-table td { padding-right: 7px; padding-left: 7px; }
}
.category-row { display: flex; flex: 1 1 0; align-items: center; gap: 10px; min-width: 0; }
.category-label { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.category-dot { display: block; width: 6px; height: 6px; border-radius: 50%; }
.category-dot.keyboard, .category-fill.keyboard { background: var(--green); }
.category-dot.mouse, .category-fill.mouse { background: var(--blue); }
.category-dot.accessory, .category-fill.accessory { background: var(--orange); }
.category-bar { flex: 1; min-width: 15px; height: 4px; overflow: hidden; background: #e5eae6; border-radius: 4px; }
.category-fill { width: 0; height: 100%; border-radius: 4px; transition: width .3s; }
.category-row strong { min-width: 35px; color: var(--ink); font-size: 11px; font-weight: 650; text-align: right; }

.leaderboard-section { padding-top: 1px; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-title-row .eyebrow { margin-bottom: 7px; }
.section-title-row h2 { margin: 0; font-size: 20px; font-weight: 690; letter-spacing: -.015em; }
.section-context { padding-bottom: 1px; color: var(--subtle); font-size: 10px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 39px; padding: 0 12px; background: #fbfcfa; border: 1px solid var(--border); border-top: 0; }
.view-switch { display: inline-flex; gap: 2px; padding: 2px; background: #f0f3ef; border-radius: 5px; }
.view-button { min-height: 26px; padding: 0 9px; color: var(--muted); background: transparent; border: 0; border-radius: 3px; cursor: pointer; font-size: 10px; }
.view-button:hover { color: var(--ink); }
.view-button.active { color: var(--green); background: #fff; box-shadow: 0 1px 2px rgba(20, 40, 25, .08); font-weight: 620; }
#skuMatchState { color: var(--subtle); font-size: 9px; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }
.cost-import-button { padding: 5px 7px; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 9px; }
.cost-import-button:hover { color: var(--green); border-color: #bfd2c5; }
.catalog-link { color: var(--muted); font-size: 9px; white-space: nowrap; }
.category-tabs { display: flex; gap: 22px; margin-top: 22px; border-bottom: 1px solid var(--border); }
.category-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.category-heading-row .category-tabs { flex: 1; min-width: 0; }
.category-heading-row .section-export-button { flex: 0 0 auto; margin-top: 15px; }
.fixed-site-label { color: var(--ink); font-size: 10px; font-weight: 650; }
.secondary-leaderboard { max-height: 660px; overflow: auto; border-top: 1px solid var(--border); }
.secondary-leaderboard .leaderboard-table { min-width: 650px; }
.secondary-leaderboard .leaderboard-table th { position: sticky; top: 0; z-index: 1; background: #fbfcfa; }
.growth-column { width: 66px; }
.launch-column { width: 84px; }
.online-table-panel:has(.secondary-leaderboard) { padding: 14px 0 0; }
.online-table-panel:has(.secondary-leaderboard) .panel-heading { padding: 0 14px; }
.tab {
  position: relative;
  min-height: 39px;
  padding: 0 1px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
}
.tab span { margin-left: 4px; color: var(--subtle); font-size: 10px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 650; }
.tab.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--green); content: ""; }
.table-wrap {
  position: relative;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}
.leaderboard-table { width: 100%; min-width: 830px; border-collapse: collapse; table-layout: fixed; text-align: left; }
.leaderboard-table th {
  height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: #fbfcfa;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}
.leaderboard-table td { height: 75px; padding: 9px 12px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
.leaderboard-table tr:last-child td { border-bottom: 0; }
.leaderboard-table tbody tr:hover td { background: #fcfdfb; }
.rank-column { width: 50px; }
.product-column { width: 30%; }
.model-column { width: 15%; }
.spec-column { width: 25%; }
.sku-column { width: 55px; }
.units-column { width: 62px; }
.price-column { width: 72px; }
.cost-column { width: 83px; }
.revenue-column { width: 94px; }
.customer-column { width: 130px; }
.customer-value { display: block; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; }
.leaderboard-table th:nth-child(n+5) { text-align: right; }
.leaderboard-table td:nth-child(n+5) { text-align: right; }
.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
}
.sort-control:hover, .sort-control.active { color: var(--green); }
.sort-control > span { color: var(--subtle); font-size: 10px; }
.rank-number { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rank-number.top { color: var(--ink); font-weight: 700; }
.rank-marker { display: block; width: 16px; height: 2px; margin-top: 4px; background: var(--border); }
.rank-number.top .rank-marker { background: var(--green); }
.product-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.product-image {
  position: relative;
  width: 61px;
  height: 50px;
  flex: 0 0 61px;
  overflow: hidden;
  background: #f2f4f1;
  border: 1px solid #edf0ed;
  border-radius: 5px;
}
.product-image img {
  width: 100%;
  height: 100%;
  padding: 2px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  display: block;
  transition: transform .22s;
}
.leaderboard-table tr:hover .product-image img { transform: scale(1.035); }
.image-fallback { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; color: var(--subtle); }
.image-fallback svg { width: 20px; height: 20px; }
.product-image.failed img { display: none; }
.product-image.failed .image-fallback { display: flex; }
.product-info { min-width: 0; }
.product-name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-category { margin-top: 4px; color: var(--subtle); font-size: 9px; }
.model-code { display: block; color: var(--ink); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.model-item { color: var(--muted); font-size: 10px; line-height: 1.35; }
.mobile-meta { display: none; }
.sku-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.spec-text { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.spec-text > span { display: block; }
.spec-text.missing { color: var(--subtle); }
.spec-line { margin-bottom: 2px; }
.units-value { color: var(--ink); font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; }
.units-value small { display: block; margin-top: 2px; color: var(--subtle); font-size: 8px; font-weight: 500; }
.units-cell { position: relative; padding-right: 16px !important; }
.units-cell::after {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 4px solid #d6ddd7;
  content: "";
  transform: translateY(-50%);
}
.price-value { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.revenue-value { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-source { display: block; margin-top: 2px; color: var(--subtle); font-size: 8px; line-height: 1.25; white-space: nowrap; }
.cost-value { color: var(--green); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-detail { display: block; margin-top: 2px; color: var(--subtle); font-size: 8px; }
.missing-value { color: var(--subtle); font-size: 11px; }
.empty-state { padding: 42px 20px; color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none; }
.table-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 11px; color: var(--subtle); font-size: 9px; line-height: 1.5; }
.table-note svg { width: 12px; height: 12px; flex: 0 0 12px; margin-top: 1px; }
.page-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 34px;
  padding: 15px 0 8px;
  color: var(--subtle);
  border-top: 1px solid var(--border);
  font-size: 10px;
}
.page-footer strong { color: var(--muted); font-weight: 500; }
.page-footer a { color: var(--muted); text-decoration: none; }
.page-footer a:hover { color: var(--ink); }
.footer-spacer { flex: 1; }
.toast {
  position: fixed;
  left: auto;
  width: max-content;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(390px, calc(100vw - 32px));
  padding: 11px 14px;
  color: #fff;
  background: #263a2e;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(23, 33, 27, .2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s, transform .18s;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  padding: 0;
  color: #c5d1c8;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  vertical-align: middle;
}
.cost-dialog {
  width: min(440px, calc(100vw - 28px));
  padding: 22px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 16px 50px rgba(23, 33, 27, .18);
}
.cost-dialog::backdrop { background: rgba(23, 33, 27, .28); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font-size: 20px; font-weight: 700; }
.dialog-close { width: 24px; height: 24px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 20px; }
.dialog-copy { margin: 8px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.file-pick { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 88px; padding: 14px; color: var(--green); background: #f6faf6; border: 1px dashed #b9d4c3; border-radius: 6px; cursor: pointer; font-size: 12px; }
.file-pick:hover { background: var(--green-soft); }
.file-pick input { display: none; }
.file-pick svg { width: 20px; height: 20px; }
.dialog-status { min-height: 23px; margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.dialog-cancel { padding: 5px 8px; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.dialog-source { color: var(--green); font-size: 10px; text-decoration: none; }

@media (max-width: 600px) {
  .table-wrap { overflow-x: clip; }
  .leaderboard-table { min-width: 0; table-layout: fixed; }
  .rank-column { width: 36px; }
  .product-column { width: auto; }
  .leaderboard-table .model-column, .leaderboard-table .spec-column, .leaderboard-table .sku-column, .leaderboard-table .price-column, .leaderboard-table .cost-column, .leaderboard-table .unit-price-column, .leaderboard-table .customer-column { display: none; }
  .units-column { width: 52px; }
  .leaderboard-table th { padding: 0 8px; }
  .leaderboard-table td { height: 76px; padding: 8px; }
  .leaderboard-table td:first-child { padding-right: 4px; padding-left: 10px; }
  .product-cell { gap: 8px; }
  .product-image { width: 53px; height: 47px; flex-basis: 53px; }
  .product-name { font-size: 11px; }
  .mobile-meta { display: block; max-width: 230px; margin-top: 3px; overflow: hidden; color: var(--subtle); font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
  .cost-column, .leaderboard-table .cost-column { display: none; }
  .units-cell { padding-right: 14px !important; padding-left: 5px !important; }
  .cost-column { width: 61px; }
  .leaderboard-table th.cost-column, .leaderboard-table td.cost-column { padding-right: 5px; padding-left: 3px; }
  .units-cell::after { right: 5px; }
  .toast { right: 12px; bottom: 12px; left: auto; max-width: calc(100vw - 24px); }
}

@media (max-width: 1100px) {
  .leaderboard-table .cost-column, .leaderboard-table .price-column { display: none; }
  .product-image { width: 75px; height: 66px; flex-basis: 75px; }
  .product-image img { object-fit: contain; padding: 3px; background: #fff; }
}

@media (max-width: 1100px) {
  :root { --sidebar-width: 195px; }
  .content, .topbar { padding-right: 24px; padding-left: 24px; }
  .offline-banner { left: calc(var(--sidebar-width) + 15px); right: 15px; }
  .category-summary { gap: 16px; }
  .metric { padding-right: 16px; padding-left: 16px; }
}

@media (max-width: 820px) {
  .sidebar { display: flex; position: relative; inset: auto; width: 100%; padding: 13px 12px 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand { margin: 0 7px 10px; }
  .sidebar-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sidebar-foot { display: none; }
  .main-content { margin-left: 0; }
  .topbar { justify-content: space-between; height: 64px; padding: 0 18px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 750; letter-spacing: .12em; }
  .mobile-brand .brand-mark { width: 18px; height: 18px; flex-basis: 18px; }
  .topbar-actions { gap: 7px; }
  .connection-state { display: none; }
  .content { padding: 25px 18px 16px; }
  .offline-banner { left: 12px; right: 12px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 22px; }
  .filter-row { width: 100%; justify-content: flex-start; }
  .compact-field { flex: 1 1 130px; }
  .period-strip { margin-bottom: 18px; padding: 8px; }
  .custom-date { width: 100%; margin-left: 0; padding-top: 3px; }
  .online-cost-block { width: 100%; }
  .online-table-grid { grid-template-columns: 1fr; }
  .online-country-panel { grid-column: auto; }
  .international-insights { margin-top: 18px; padding: 15px 13px 11px; }
  .insight-grid { grid-template-columns: 1fr; gap: 18px; }
  .market-flow-section { grid-template-columns: 1fr; margin-bottom: 22px; }
  h1 { font-size: 26px; }
  .date-field { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .category-summary { flex-wrap: wrap; gap: 12px 22px; margin: 19px 0 27px; }
  .category-row { flex-basis: calc(50% - 11px); }
  .section-title-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .section-context { font-size: 10px; }
  .table-wrap { border-radius: 0 0 6px 6px; }
  .page-footer { flex-wrap: wrap; }
  .footer-spacer { flex-basis: 100%; height: 0; }
}

@media (max-width: 490px) {
  .content { padding-right: 12px; padding-left: 12px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .icon-button { display: none; }
  .topbar-actions { flex: 0 0 auto; }
  .export-button { width: 35px; padding: 0; justify-content: center; }
  .export-button span { display: none; }
  .page-heading { min-width: 0; }
  .date-field { min-width: 0; max-width: 100%; }
  .metric-grid { gap: 8px; }
  .metric { min-height: 137px; padding: 14px 12px; }
  .metric-value { font-size: 28px; }
  .metric-feature { font-size: 14px; }
  .metric-detail { gap: 4px; white-space: normal; }
  .metric-detail span + span::before { margin-right: 4px; }
  .category-summary { flex-direction: column; gap: 11px; }
  .category-row { flex-basis: auto; }
  .category-tabs { gap: 19px; }
  .tab { min-height: 38px; }
  .section-title-row h2 { font-size: 19px; }
  .table-note { font-size: 9px; }
  .leaderboard-section { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
