:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #111827;
  --muted: #64748b;
  --line: #d7dee8;
  --accent: #0f6f7f;
  --accent-2: #e8740f;
  --brand-pink: #ec1e8c;
  --amazon: #e8740f;
  --website: #0f9d97;
  --wholesale: #5b6ed0;
  --navy: #101b28;
  --navy-2: #1d2c3b;
  --gold: #f4c542;
  --silver: #d7dee8;
  --bronze: #c78642;
  --green: #1f7a4d;
  --red: #a13a32;
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hidden {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #1a2838 0%, #0c1622 100%);
  color: #eef4f8;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 0 4px;
}

.brand-logo {
  display: block;
  width: 120px;
  height: auto;
  max-width: 100%;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #17212c;
}

.login-shell {
  width: min(100%, 430px);
}

.login-panel {
  background: #ffffff;
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.compact-brand {
  color: var(--ink);
  margin-bottom: 24px;
}

.compact-brand span {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-status {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.user-strip {
  display: grid;
  gap: 6px;
  color: #d7e1ea;
  font-size: 13px;
}

.sidebar-user-strip {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: #d7e1ea;
  font-size: 12px;
}

.sidebar-user-strip:has(.view-as-user.hidden):not(:has(#user-email:not(:empty))) {
  display: none;
}

.sidebar-user-strip .view-as-user {
  color: #d7e1ea;
}

.sidebar-user-strip #user-email {
  color: #aebbc7;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.view-as-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #d7e1ea;
  cursor: pointer;
}

.view-as-user span {
  font-size: 12px;
  font-weight: 600;
  color: #d7e1ea;
  margin-bottom: 0;
  letter-spacing: 0;
  text-transform: none;
}

/* Hide native checkbox; render a switch in its place. */
.view-as-user input {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 18px;
  min-height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex: 0 0 auto;
  padding: 0;
}

.view-as-user input::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.view-as-user input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.view-as-user input:checked::before {
  transform: translateX(14px);
}

.logout-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: transparent;
  color: #cdd6df;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.logout-icon {
  width: 14px;
  height: 14px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 0;
  color: #d7e1ea;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: var(--navy-2);
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #aebbc7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.main {
  padding: 26px;
  min-width: 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding-bottom: 8px;
  transition: padding-bottom 0.18s ease;
}

.filter-chips {
  display: none !important;
}

.main.settings-page-active .topbar {
  position: static;
}

.topbar > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
}

.global-sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.global-sync-status.running {
  border-color: rgba(13, 108, 124, 0.28);
  background: #e9f7f9;
  color: var(--accent);
}

.global-sync-status.success {
  border-color: rgba(21, 128, 61, 0.28);
  background: #ecfdf3;
  color: #15803d;
}

.global-sync-status.failed {
  border-color: rgba(185, 28, 28, 0.28);
  background: #fef2f2;
  color: #b91c1c;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  width: 100%;
}

/* Inline-label variant for the simple filter controls: label sits left of
   the input on the same row, saving vertical space. */
.filter-date,
.filter-search,
#ranking-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.filter-date {
  flex: 0 0 auto;
}

.filter-date > input {
  width: 130px;
  flex: 0 0 auto;
}

.filter-search {
  flex: 0 0 auto;
  min-width: 0;
}

.filter-search > input {
  width: 200px;
}

#ranking-filter-label {
  flex: 0 0 auto;
}

#ranking-filter-label > select {
  width: 140px;
  flex: 0 0 auto;
}

.filter-date > span,
.filter-search > span,
#ranking-filter-label > span,
.item-type-control > span,
.league-control > span,
.team-color-control > span {
  margin-bottom: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.filter-search > input {
  flex: 1 1 auto;
  min-width: 0;
}

/* Type+League stacked combo â€” keep its compact vertical layout but
   shrink overall footprint. */
.type-league-stack {
  display: grid;
  gap: 4px;
  flex: 0 0 auto;
}

.item-type-control,
.league-control,
.team-color-control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.item-type-control > select,
.league-control > select,
.team-color-control > select {
  width: 130px;
  flex: 0 0 auto;
}

.compare-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 0;
  border-left: 0;
  flex: 0 0 auto;
}

.compare-toggle-label > span {
  margin-bottom: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.compare-toggle {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 26px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 12px;
  cursor: pointer;
}

.compare-toggle.active,
.compare-toggle[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

#go-button {
  grid-column: span 1;
}

.date-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

/* Zero-height full-width spacer that forces the next flex item onto a new
   line, so date controls stay on the top row and Ranking/Search/Item Type/
   League/Team flow on the bottom row. */
.filter-break {
  flex-basis: 100%;
  height: 0;
}

.date-shortcuts button {
  border: 1px solid #ccd7dc;
  border-radius: 6px;
  background: #ffffff;
  color: #173f47;
  min-height: 26px;
  min-width: 0;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  white-space: nowrap;
}

.saved-view-control {
  grid-column: span 2;
}

.saved-view-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  grid-column: span 3;
}

.type-league-stack {
  grid-column: span 2;
  display: grid;
  gap: 8px;
  align-self: end;
}

.type-league-stack .item-type-control,
.type-league-stack .league-control {
  grid-column: auto;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 2px;
}

label {
  min-width: 0;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--ink);
  font-size: 12px;
}

.filter-button,
.sync-button,
.assign-button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 4px 12px;
  font-weight: 800;
  cursor: pointer;
  font-size: 12px;
}

.filter-button {
  min-width: 54px;
  white-space: nowrap;
}

#go-button {
  align-self: center;
  justify-self: start;
  min-width: 56px;
  flex: 0 0 auto;
}

.compare-toggle-label,
.compare-field {
  padding: 0 0 0 8px;
  border-left: 1px solid #e1e7ee;
}

.filter-button.secondary {
  background: #eef5f6;
  color: #173f47;
  border: 1px solid #ccd7dc;
}

.compare-toggle.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.filter-button.danger {
  background: #f8e9e7;
  color: var(--red);
  border: 1px solid #e8c5c1;
}

button:disabled,
.filter-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sync-button {
  display: none;
}

.sync-button.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.assign-control {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  max-width: 360px;
}

.compare-cell {
  background: #fbfcfd;
}

.delta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.delta-up {
  color: var(--green);
}

.delta-down {
  color: var(--red);
}

.delta-flat {
  color: var(--muted);
}

.assign-control select {
  min-height: 36px;
}

.assign-button {
  min-height: 36px;
  padding: 7px 12px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

#metric-source-mix-card {
  grid-column: auto;
}

.metric-strip.sync-status {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-strip.sync-status #metric-unknown-card { order: 0; }
.metric-strip.sync-status #metric-sales-card { order: 1; }
.metric-strip.sync-status #metric-units-card { order: 2; }
.metric-strip.sync-status #metric-parents-card { order: 3; }

.metric-strip article,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-strip article {
  min-height: 96px;
  padding: 14px 16px 13px;
  display: grid;
  align-content: space-between;
}

.metric-strip article:hover,
.panel:hover {
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.09);
}

.metric-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.metric-strip strong {
  font-size: clamp(16px, 1vw, 20px);
  line-height: 1.08;
  overflow-wrap: anywhere;
  letter-spacing: 0;
  font-weight: 800;
}

.metric-strip article:nth-child(-n+3) strong {
  font-size: clamp(22px, 1.4vw, 28px);
  font-weight: 800;
}

.metric-strip article:nth-child(-n+3) span {
  font-size: 12px;
}

@media (max-width: 980px) {
  .metric-strip {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.metric-source-mix {
  display: grid;
  gap: 9px;
}

/* Net Sales tile: click-to-expand. Collapsed shows just the headline
   $ and the % margin (both bigger than other tiles). Expanded reveals
   the subtraction breakdown. Sits in a single grid column (narrower
   than before to make room for other tiles). */
.metric-net-sales {
  grid-column: span 1;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.15s ease;
}
.metric-net-sales:hover {
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
}
.metric-net-sales:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
}
/* Headline $ - bigger than the regular metric strong (which is ~16-20px). */
.metric-net-sales #metric-net-sales {
  font-size: clamp(22px, 1.6vw, 30px);
  line-height: 1.05;
  font-weight: 800;
}
/* Margin % - bumped from 12px to a more prominent size. */
.metric-net-sales #metric-net-sales-margin {
  display: block;
  font-size: clamp(14px, 1vw, 18px);
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}
/* Toggle chevron in the label. Rotates when expanded. */
.metric-net-sales .metric-net-sales-toggle {
  font-style: normal;
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  transition: transform 0.15s ease;
}
.metric-net-sales:not(.collapsed) .metric-net-sales-toggle {
  transform: rotate(180deg);
}
/* Breakdown list - hidden in collapsed state. */
.metric-net-sales-breakdown {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 6px 0 0 0;
  display: grid;
  gap: 4px;
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.metric-net-sales.collapsed .metric-net-sales-breakdown {
  display: none;
}
.metric-net-sales-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.metric-net-sales-breakdown .metric-net-sales-label {
  color: var(--muted);
}
.metric-net-sales-breakdown .metric-net-sales-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Admin overview visible cards (in DOM order): Sales(dual), SourceMix,
   SourceHealth, NetSales = 4 tiles. The combined Sales tile holds both
   $ and units. Hidden cards (standalone Units, Parents, Unknown) are
   display:none so they don't consume grid tracks. */
.metric-strip {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.85fr);
}
.metric-strip.sync-status {
  /* Settings page reuses sales/units/parents tiles for source last-sync;
     keep its existing 4-col layout */
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Dual-stat tile (combined Sales + Units): two halves side-by-side,
   separated by a thin vertical rule. Non-admin gets the primary half
   hidden, secondary takes the full width naturally. */
.metric-dual {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
}
.metric-dual > .metric-dual-half {
  display: grid;
  align-content: space-between;
  padding: 0 14px;
  min-width: 0;
}
.metric-dual > .metric-dual-half:first-of-type {
  padding-left: 0;
}
.metric-dual > .metric-dual-half:last-of-type {
  padding-right: 0;
}
/* Divider between the two halves */
.metric-dual::before {
  content: "";
  display: block;
  width: 1px;
  height: 60%;
  background: rgba(255, 255, 255, 0.08);
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}
/* When the primary half is hidden, the secondary spans full width and
   the divider hides itself. */
.metric-dual:has(> #metric-sales-primary[hidden]) {
  grid-template-columns: 1fr;
}
.metric-dual:has(> #metric-sales-primary[hidden])::before {
  display: none;
}

.sync-health-list {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.sync-health-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.sync-health-info {
  display: grid;
  gap: 0;
  min-width: 0;
}

.sync-health-info strong {
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0;
}

.sync-health-info small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: var(--muted);
}

.health-ok {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(31, 122, 77, 0.18);
}

.health-warn {
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(244, 197, 66, 0.25);
}

.health-err {
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(161, 58, 50, 0.18);
}

.health-loading {
  background: #cdd6df;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.metric-source-stack {
  display: flex;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5ebf1;
}

.metric-source-stack span {
  min-width: 4px;
}

.metric-source-stack .source-amazon {
  background: var(--amazon);
}

.metric-source-stack .source-website {
  background: var(--website);
}

.metric-source-stack .source-wholesale {
  background: var(--wholesale);
}

.metric-source-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.metric-source-row {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.metric-source-row strong {
  font-size: 12px;
  line-height: 1.15;
}

.metric-source-row span {
  margin: 0;
  white-space: normal;
  color: var(--muted);
  font-size: 12px;
}

.metric-strip article,
.health-card-button,
.product-row {
  cursor: pointer;
}

.trend-panel {
  margin-bottom: 20px;
  padding: 0 0 16px;
}

.trend-panel .panel-heading {
  align-items: center;
}

.trend-chart {
  padding: 4px 18px 0;
}

.trend-svg {
  width: 100%;
  height: 260px;
  display: block;
}

.trend-line {
  fill: none;
}

.trend-area-stacked {
  fill-opacity: 0.85;
  stroke: #ffffff;
  stroke-width: 0.5;
}

/* Compare modal */
.compare-modal-panel {
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}
.compare-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.compare-picker {
  display: grid;
  gap: 4px;
}
.compare-picker span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.compare-picker input {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
}
.compare-results {
  min-height: 100px;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.compare-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}
.compare-card.empty {
  opacity: 0.5;
}
.compare-card-head {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}
.compare-card-head img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.compare-card-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.compare-card-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.compare-card-head small {
  color: var(--muted);
  font-size: 12px;
}
.compare-card-head .compare-meta {
  font-style: italic;
}
.compare-stats {
  display: grid;
  gap: 6px;
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.compare-stats > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.compare-stats span {
  color: var(--muted);
}
.compare-stats strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
@media (max-width: 700px) {
  .compare-pickers,
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

/* Sync history table on Settings */
.sync-history-table {
  font-size: 12px;
  width: 100%;
}
.sync-history-grid {
  width: 100%;
  border-collapse: collapse;
}
.sync-history-grid th,
.sync-history-grid td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.sync-history-grid th {
  font-weight: 700;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sync-history-row {
  cursor: pointer;
}
.sync-history-row:hover {
  background: rgba(0, 0, 0, 0.03);
}
.sync-history-status.ok { color: #22c55e; font-weight: 600; }
.sync-history-status.err { color: #ef4444; font-weight: 600; }
.sync-history-status.warn { color: var(--muted); }
.sync-history-detail {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.sync-history-detail-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.sync-history-detail-head small {
  color: var(--muted);
}
.sync-history-error {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.sync-history-output {
  background: rgba(0, 0, 0, 0.04);
  padding: 8px;
  font-size: 11px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  border-radius: 4px;
}

.trend-margin-line {
  fill: none;
  stroke: #ff9800;
  stroke-width: 2;
  stroke-dasharray: 4 3;
  opacity: 0.9;
}
.trend-margin-tick {
  fill: #ff9800;
  font-weight: 600;
}
.trend-margin-swatch {
  background: #ff9800 !important;
  /* Render as a small dashed line block */
  border-radius: 0;
  width: 16px;
  height: 2px;
}
.trend-total-line {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.trend-tooltip-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.trend-grid {
  stroke: #e2e8ee;
  stroke-width: 1;
}

.trend-tick {
  font-size: 11px;
  fill: var(--muted);
  font-family: inherit;
}

.trend-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #344054;
}

.trend-dot-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.trend-chart {
  position: relative;
}

.trend-hit {
  cursor: crosshair;
}

.trend-guide {
  stroke: #94a3b8;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.trend-guide.hidden {
  display: none;
}

.trend-tooltip {
  position: absolute;
  pointer-events: none;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-size: 12px;
  color: #111827;
  z-index: 5;
  min-width: 200px;
  max-width: 280px;
}

.trend-tooltip.hidden {
  display: none;
}

.trend-tooltip-month {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
}

.trend-tooltip-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  white-space: nowrap;
}

.trend-tooltip-row strong {
  font-weight: 800;
  font-size: 12px;
}

.trend-tooltip-row small {
  color: var(--muted);
  font-size: 11px;
  margin-left: 4px;
}

.trend-tooltip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

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

.content-grid.settings-view {
  grid-template-columns: minmax(0, 1fr);
}

.content-grid.settings-view .side-panel {
  display: none;
}

.panel {
  min-width: 0;
}

.panel-heading {
  padding: 18px 20px 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading.compact {
  display: block;
}

.panel-heading h2 {
  margin-bottom: 5px;
  font-size: 18px;
  line-height: 1.15;
}

.panel-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}

.toggle-group {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  flex: 0 0 auto;
}

.toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
}

.toggle.active {
  background: var(--accent);
  color: #ffffff;
}

.export-button.hidden {
  display: none;
}

.item-sections {
  display: grid;
  gap: 28px;
  padding: 20px;
}

.item-type-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  overflow: hidden;
  background: #f8fafc;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--brand-pink);
}

.section-title::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background: repeating-linear-gradient(115deg, var(--brand-pink) 0 3px, transparent 3px 13px);
}

.section-title > * {
  position: relative;
  z-index: 1;
}

.section-title h3 {
  font-size: 17px;
  margin-bottom: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #526177;
  background: #fbfcfd;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0;
}

th:nth-child(1),
td:nth-child(1) {
  width: 5%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 18%;
}

td:nth-child(2) {
  position: relative;
  padding: 0 14px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 22%;
}

th:nth-child(4),
td:nth-child(4),
th:nth-child(5),
td:nth-child(5) {
  width: 10%;
}

th:nth-child(6),
td:nth-child(6) {
  width: 35%;
}

.item-sections.units-only th:nth-child(4),
.item-sections.units-only td:nth-child(4) {
  width: 12%;
}

.item-sections.units-only th:nth-child(5),
.item-sections.units-only td:nth-child(5) {
  width: 46%;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody td {
  height: 178px;
  background: #ffffff;
  transition: background 0.12s ease;
}

tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.row-sparkline {
  display: block;
  width: 164px;
  height: 34px;
  margin-top: 8px;
  overflow: visible;
}

.row-sparkline .spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-sparkline .spark-area {
  fill: var(--accent);
  fill-opacity: 0.18;
}

.row-sparkline .spark-baseline {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.trend-area {
  fill-opacity: 0.14;
  stroke: none;
}

.top-movers-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.top-movers-group { margin-bottom: 4px; }
.top-movers-group h3 {
  font-size: 12px;
  margin: 0 0 4px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mover-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
  align-items: center;
  font-size: 13px;
}

.mover-row:last-child {
  border-bottom: 0;
}

.mover-row strong {
  display: block;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mover-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.mover-delta {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.mover-delta.up {
  color: var(--green);
}

.mover-delta.down {
  color: var(--red);
}

/* Let the title/SKU column shrink so long titles truncate instead of
   overrunning into the delta. */
.mover-row > div { min-width: 0; }
.mover-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Product movers: smaller text so long product names fit. */
.movers-products .mover-row strong { font-size: 11.5px; }
.movers-products .mover-row small { font-size: 10px; }
.movers-products .mover-delta { font-size: 12px; }

/* Top Movers "building comparisonâ€¦" loading state */
.movers-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px;
  color: var(--muted);
  font-size: 13px;
}
.movers-loading small {
  display: block;
  font-size: 11px;
  margin-top: 3px;
  opacity: 0.85;
}
.movers-spinner {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: movers-spin 0.7s linear infinite;
}
@keyframes movers-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .movers-spinner { animation: none; } }

.mover-delta.flat {
  color: var(--muted);
  font-weight: 600;
}

/* Mini toast ("Link copied", etc.) */
#mini-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  z-index: 5000;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
#mini-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Team mode: tint UI accents with the filtered team's color ---- */
#team-accent-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--team-accent, transparent);
  z-index: 1000;
}
html:not([data-team-mode]) #team-accent-strip { display: none; }
html[data-team-mode] .nav-item.active {
  background: var(--team-accent);
  color: #fff;
}
html[data-team-mode] #page-title::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--team-accent);
  margin-right: 10px;
  vertical-align: baseline;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

/* ---- #4 number flash: brief accent pulse when a metric value changes ---- */
@keyframes count-flash {
  0% { color: var(--accent); }
  100% { color: inherit; }
}
.count-flash { animation: count-flash 0.85s ease; }

/* ---- #5 rank-movement badges in Top Teams ---- */
.rank-move {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: 3px;
}
.rank-move.up { color: var(--green); }
.rank-move.down { color: var(--red); }
.rank-move.flat { color: var(--muted); font-weight: 600; }
.rank-move.new { color: var(--accent); font-size: 10px; }

/* ---- #3 loading shimmer (body.data-busy) ---- */
body.data-busy .metric-strip { position: relative; }
body.data-busy .metric-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  background-size: 220% 100%;
  animation: shimmer-sweep 1.15s linear infinite;
  pointer-events: none;
  z-index: 6;
  border-radius: inherit;
}
@keyframes shimmer-sweep {
  0% { background-position: 180% 0; }
  100% { background-position: -80% 0; }
}
/* Dim the item table once while loading (a steady fade, NOT a repeating
   pulse â€” the pulse read as flashing during the longer cold builds). */
#item-sections { transition: opacity 0.25s ease; }
body.data-busy #item-sections { opacity: 0.55; }
@media (prefers-reduced-motion: reduce) {
  .count-flash { animation: none; }
  body.data-busy .metric-strip::after { animation: none; }
}

tbody tr:hover td {
  background: #eef5f7 !important;
}

tbody tr td:first-child {
  border-left: 3px solid transparent;
  color: #233044;
  font-weight: 800;
}

tbody tr:hover td:first-child {
  border-left-color: var(--accent);
}

tbody tr.jump-highlight td {
  background: #fff2cc;
  transition: background 0.25s ease;
}

.number {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* Margin health color-coding (set on the margin value span/strong). */
.margin-strong { color: var(--green); }
.margin-thin   { color: #b7791f; }   /* amber: thin (<15%) */
.margin-neg    { color: var(--red); }

/* Period-over-period delta badge on the hero metric tiles. */
.metric-delta { margin-top: 4px; }
.metric-delta .delta { font-size: 12px; }

/* Zebra striping + hover so rows are easy to track across columns. */
.product-row:nth-child(even) { background: rgba(15, 23, 42, 0.022); }
.product-row:hover { background: #e9f7f9; }

/* Click-to-sort column headers on the main table. */
.sortable-header { cursor: pointer; user-select: none; }
.sortable-header:hover { color: var(--accent); }
.sortable-header.active { color: var(--accent); }
.sort-arrow { font-size: 11px; }
/* Faint â‡… hint on inactive sortable columns so they read as clickable;
   the active column shows a solid â–²/â–¼. */
.sortable-header:not(.active) .sort-arrow { opacity: 0.32; }
.sortable-header:hover .sort-arrow { opacity: 0.7; }

/* Fulfillment Mix panel: inset the bar + legend to align with the heading
   (the shared .trend-panel has 0 horizontal padding), with bottom breathing
   room so the legend isn't flush to the box edge. */
.amazon-fulfillment-chart { padding: 4px 20px 8px; }

/* "Clear all" chip + the empty-state inline link button. */
.filter-chip-clear { font-weight: 700; }
.link-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
}
.link-button:hover { opacity: 0.8; }

/* #1 â€” Team color swatch in the team breakdowns. */
.team-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-right: 2px;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

/* #5 â€” Micro-interactions (motion-safe): card lift, smooth states, bar draw-in. */
@media (prefers-reduced-motion: no-preference) {
  .metric-hero, .metric-footer-item, .metric-secondary, .team-summary-row,
  .chip, .toggle, .nav-item, .filter-button {
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, color 0.14s ease;
  }
  .metric-hero:hover, .metric-footer-item:hover, .metric-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
  .team-summary-row:hover { transform: translateX(3px); }
  @keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .team-summary-row .bar span {
    transform-origin: left center;
    animation: bar-grow 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* âŒ˜K command palette */
#cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
#cmdk-overlay[hidden] { display: none; }
.cmdk-panel {
  width: 100%;
  max-width: 560px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #d7dee8);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
  overflow: hidden;
  animation: cmdk-pop 0.12s ease-out;
}
@keyframes cmdk-pop { from { transform: translateY(-8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.cmdk-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line, #d7dee8);
  padding: 16px 18px;
  font-size: 16px;
  color: var(--ink, #111827);
  background: transparent;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.cmdk-input::placeholder { color: var(--muted, #64748b); }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.cmdk-item.active { background: var(--surface-2, #eef5f6); }
.cmdk-label { color: var(--ink, #111827); font-weight: 600; font-size: 14px; }
.cmdk-sub {
  color: var(--muted, #64748b);
  font-size: 12px;
  margin-left: auto;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmdk-type {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--muted, #64748b);
}
.cmdk-type-page { background: var(--accent, #0f6f7f); }
.cmdk-type-team { background: var(--navy, #101b28); }
.cmdk-type-date { background: var(--green, #1f7a4d); }
.cmdk-type-sku { background: var(--accent-2, #e8740f); }
.cmdk-type-action { background: var(--muted, #64748b); }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted, #64748b); font-size: 14px; }
.cmdk-footer {
  display: flex;
  gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid var(--line, #d7dee8);
  color: var(--muted, #64748b);
  font-size: 11px;
}
.cmdk-footer kbd {
  font-family: inherit;
  background: var(--surface-2, #eef5f6);
  border: 1px solid var(--line, #d7dee8);
  border-radius: 5px;
  padding: 1px 5px;
  margin-right: 3px;
  font-size: 10px;
}

/* Tabular numerals on the hero metric figures so period-over-period digits
   line up and don't jitter (the data table already uses .number). */
.metric-strip strong,
.metric-hero strong,
#metric-net-sales {
  font-variant-numeric: tabular-nums;
}

.units-cell {
  white-space: normal;
  text-align: right;
  color: #334155;
}

.units-value {
  font-weight: 800;
  color: #101828;
  font-size: 16px;
  white-space: nowrap;
}

.rank-cell {
  text-align: center;
}

.rank-badge {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #12243d;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 2px 5px rgba(18, 36, 61, 0.18);
}

.metric-cell-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-cell-value {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.units-details {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.best-month-chip {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 9px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sku {
  font-weight: 800;
  color: #0f172a;
}

.item-cell {
  color: #344054;
}

.item-cell .sku {
  display: block;
  margin-bottom: 5px;
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.item-title {
  max-width: 42ch;
  color: #334155;
  font-size: 14px;
  line-height: 1.38;
}

.item-sizes {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.thumb-wrap {
  position: absolute;
  inset: 10px 12px;
  width: auto;
  max-width: none;
}

.image-cell .thumb-wrap {
  inset: 8px 10px;
  border-radius: 12px;
  background: #f4f7f9;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.product-thumb {
  width: 100%;
  height: 100%;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #cbd5df;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.05)),
    var(--thumb-color, #d8e8ea);
  display: grid;
  place-items: center;
  overflow: hidden;
  object-fit: contain;
}

img.product-thumb {
  display: block;
  /* Soft skeleton tint while the (lazy) image is still downloading, so a
     pending thumb reads as "loading" rather than a broken white box. The
     loaded image paints over it (white padding comes from the gradient top). */
  background: linear-gradient(135deg, #f2f6f8, #e8eef2);
  object-fit: contain;
  padding: 4px;
}

.image-cell img.product-thumb {
  padding: 6px;
  object-fit: contain;
}

img.product-thumb[data-loaded="1"],
img.product-thumb:not([loading]) {
  background: #ffffff;
}

.product-thumb span {
  color: #17212c;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.thumb-fallback {
  display: none;
}

.thumb-fallback.visible {
  display: grid;
}

.image-error {
  display: none !important;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 100%;
  align-content: flex-start;
  justify-content: flex-start;
}

.variants-cell .chips {
  gap: 8px;
}

.chip {
  border: 1px solid #ccd7dc;
  background: #eef5f6;
  color: #173f47;
  border-radius: 999px;
  padding: 5px 9px;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.variants-cell .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
}

.chip strong {
  font-weight: 900;
}

.chip.rank-1 {
  background: var(--gold);
  border-color: #d7a514;
  color: #231a00;
}

.chip.rank-2 {
  background: var(--silver);
  border-color: #aeb8c5;
  color: #1f2937;
}

.chip.rank-3 {
  background: var(--bronze);
  border-color: #9b632b;
  color: #211003;
}

.chip.chip-more {
  background: #ffffff;
  border-color: #d7dee8;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.chip.chip-more:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: #b9c4d2;
}

.top-teams-summary {
  padding: 16px 18px 18px;
  display: grid;
  gap: 15px;
}

.rule-box {
  display: none;
  margin: 0 16px 16px;
  padding: 14px;
  border-radius: 8px;
  background: #f7f2ec;
  border: 1px solid #e3d4c7;
}

.rule-box h3 {
  margin-bottom: 9px;
  font-size: 15px;
}

.rule-box p {
  color: #5f4b3b;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.rule-box p:last-child {
  margin-bottom: 0;
}

.team-summary-row {
  display: grid;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
  transition: background 0.12s ease;
}

.team-summary-row:hover {
  background: rgba(15, 111, 127, 0.06);
}

.team-summary-row.active {
  background: rgba(15, 111, 127, 0.12);
  outline: 1px solid rgba(15, 111, 127, 0.35);
}

.team-summary-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
}

.team-summary-top strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.team-summary-top span {
  color: var(--muted);
  text-align: right;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  flex: 0 0 auto;
}

.bar {
  height: 9px;
  border-radius: 999px;
  background: #e6ebf1;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent-2);
}

.team-summary-row.rank-1 .bar span {
  background: var(--gold);
}

.team-summary-row.rank-2 .bar span {
  background: #aeb8c5;
}

.team-summary-row.rank-3 .bar span {
  background: var(--bronze);
}

.top-teams-toggle {
  align-self: stretch;
  margin-top: 4px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.top-teams-toggle:hover {
  background: #eef5f6;
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  padding: 18px;
}

.settings-page {
  display: grid;
  gap: 16px;
}

.settings-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.settings-card.stacked {
  grid-template-columns: 1fr;
}

.collapsible-card {
  display: block;
  padding: 0;
  overflow: hidden;
}

.collapsible-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.collapsible-toggle:hover {
  background: rgba(0, 0, 0, 0.02);
}

.collapsible-toggle h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.collapsible-toggle p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.collapsible-toggle-stats {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-left: auto;
  margin-right: 14px;
  flex-wrap: nowrap;
}

.collapsible-stat {
  display: grid;
  text-align: right;
  line-height: 1.15;
  min-width: 0;
}

.collapsible-stat strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.collapsible-stat span {
  font-size: 11px;
  color: var(--muted);
  max-width: 180px;
}

.collapsible-chevron {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.collapsible-card:not(.collapsed) .collapsible-chevron {
  transform: rotate(90deg);
}

.collapsible-body {
  padding: 0 16px 16px;
  display: grid;
  gap: 12px;
}

.collapsible-card.collapsed .collapsible-body {
  display: none;
}

.settings-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.settings-card h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.settings-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.sync-status-text {
  margin-top: 9px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.access-card {
  grid-template-columns: 1fr;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.health-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.health-card-button {
  text-align: left;
}

.health-card span,
.health-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.health-card strong {
  display: block;
  margin: 6px 0;
  font-size: 17px;
  line-height: 1.2;
}

.missing-image-summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
}

.missing-image-summary strong {
  color: var(--text);
  font-size: 22px;
}

.mini-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-table {
  min-width: 900px;
}

.mini-table th,
.mini-table td {
  position: static;
  width: auto;
  height: auto;
  padding: 9px 10px;
  font-size: 12px;
  vertical-align: top;
}

.mini-table .sku-alt {
  font-size: 11px;
  color: var(--ink-mid, #475569);
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mini-table .sku-parent {
  font-size: 10px;
  color: var(--ink-low, #94a3b8);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-table th.sortable-header {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.mini-table th.sortable-header:hover {
  color: var(--accent, #1a2c47);
}

.mini-table th.sortable-header.active {
  color: var(--accent, #1a2c47);
}

.classification-table {
  min-width: 1080px;
}

.classification-table .assign-control {
  max-width: none;
  grid-template-columns: minmax(170px, 1fr) auto;
}

.mini-thumb {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 3px;
  color: #17212c;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.mini-thumb-fallback {
  background: #eaf5f6;
}

.imbalance-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.imbalance-pill.imbalance-amazon {
  background: rgba(232, 116, 15, 0.12);
  color: #c05e08;
  border: 1px solid rgba(232, 116, 15, 0.3);
}

.imbalance-pill.imbalance-website {
  background: rgba(0, 143, 140, 0.14);
  color: #007573;
  border: 1px solid rgba(0, 143, 140, 0.28);
}

.drawer,
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.drawer-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 40, 0.38);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100%;
  overflow: auto;
  background: #ffffff;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.22);
  padding: 22px;
}

.drawer-close {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  min-height: 34px;
  padding: 6px 10px;
  cursor: pointer;
}

.drawer-product {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.drawer-image {
  position: relative;
  height: 170px;
}

.drawer-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.drawer-kpis div,
.drawer-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.drawer-kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.drawer-kpis strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.drawer-section {
  margin-top: 12px;
}

.drawer-section h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.drawer-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #e5ebf1;
}

.drawer-line:first-of-type {
  border-top: 0;
}

.modal-panel {
  position: relative;
  width: min(420px, calc(100% - 32px));
  margin: 12vh auto 0;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal-heading,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.access-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto;
  gap: 10px;
  align-items: end;
}

.access-list {
  display: grid;
  gap: 8px;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.access-row strong,
.access-row span {
  display: block;
}

.access-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: block;
    padding: 14px;
  }

  .sidebar-note {
    display: none;
  }

  .brand {
    min-height: 0;
    padding: 4px 0;
  }

  .brand-logo {
    width: 54px;
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
  }

  .content-grid,
  .topbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .filters {
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-date,
  .compare-toggle-label,
  .filter-search,
  #ranking-filter-label,
  .item-type-control,
  .team-color-control,
  .saved-view-control,
  .saved-view-actions,
  .date-shortcuts,
  #go-button {
    grid-column: span 1;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-source-legend {
    grid-template-columns: 1fr;
  }

  .settings-card,
  .access-form,
  .access-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .main {
    padding: 16px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filters,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .filter-date,
  .compare-toggle-label,
  .filter-search,
  #ranking-filter-label,
  .item-type-control,
  .team-color-control,
  .saved-view-control,
  .saved-view-actions,
  .date-shortcuts,
  .more-filters,
  #go-button {
    grid-column: span 1;
  }

  .more-filters > summary {
    width: 100%;
    justify-content: space-between;
  }

  .more-filters-grid {
    position: static;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .panel-heading,
  .section-title {
    display: grid;
    gap: 8px;
  }

  h1 {
    font-size: 26px;
  }

  table {
    min-width: 0;
  }

  .item-type-section thead {
    display: none;
  }

  .item-type-section tbody,
  .item-type-section table,
  .item-type-section tr {
    display: block;
    width: 100%;
  }

  .item-type-section tbody tr {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "image item item"
      "image sales units"
      "chips chips chips";
    gap: 10px 14px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    position: relative;
    min-width: 0;
  }

  .item-type-section tbody td {
    display: block;
    height: auto;
    padding: 0;
    border-bottom: 0;
  }

  /* Rank: floating pill in the top-left corner of the image. */
  .item-type-section .rank-cell {
    display: inline-block;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    width: auto;
  }

  .item-type-section .rank-badge {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.24);
  }

  .item-type-section .image-cell {
    grid-area: image;
    width: 112px;
    height: 112px;
    padding: 0;
    position: relative;
  }

  .item-type-section .image-cell .thumb-wrap {
    position: static;
    inset: auto;
    width: 112px;
    height: 112px;
  }

  .item-type-section .item-cell {
    grid-area: item;
    width: auto;
    min-width: 0;
  }

  /* Sales cell: admin-only and not a compare cell. */
  .item-type-section .sales-cell {
    grid-area: sales;
    width: auto;
    text-align: left;
    padding-top: 4px;
    font-weight: 600;
    min-width: 0;
  }

  .item-type-section .units-cell {
    grid-area: units;
    width: auto;
    text-align: left;
    padding-top: 4px;
    font-weight: 600;
    min-width: 0;
  }

  /* Hide compare columns on mobile to keep the card layout sane. */
  .item-type-section tbody td.compare-cell,
  .item-type-section thead th.compare-cell {
    display: none !important;
  }

  .item-type-section .variants-cell {
    grid-area: chips;
    width: auto;
    min-width: 0;
  }

  .item-type-section .variants-cell .chips {
    width: 100%;
  }

  .item-cell .sku {
    font-size: 16px;
  }

  .product-thumb {
    border-radius: 6px;
  }

  .drawer-panel {
    width: 100%;
    padding: 18px 16px;
  }

  .drawer-product {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .drawer-kpis {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Mobile-friendly overrides (phones and small tablets)
   ------------------------------------------------------------
   Desktop layout is unchanged. These rules only fire below
   the breakpoints and override specific behaviors that don't
   translate well to narrow viewports.
   ============================================================ */

/* Desktop default: the mobile-only Filters toggle button is hidden. */
.mobile-filter-toggle {
  display: none;
}

@media (max-width: 820px) {
  /* Mobile-only Filters toggle button. Sits next to the page title. */
  .topbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
  }

  .mobile-filter-toggle[aria-expanded="false"] {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
  }

  /* Filters VISIBLE by default on mobile. Tapping the toggle adds
     .filters-collapsed to the topbar to hide them when not needed. */
  .topbar.filters-collapsed .filters {
    display: none;
  }

  /* Sidebar: convert from full-height left rail to a thin sticky top
     bar with horizontal nav. */
  .sidebar {
    display: flex;
    height: auto;
    overflow-y: visible;
    overflow-x: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 48px;
    position: sticky;
    top: 0;
    z-index: 30;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .logout-button {
    top: 8px;
    right: auto;
    left: 10px;
    width: 26px;
    height: 26px;
  }

  .brand {
    min-height: 0;
    padding: 0;
    flex: 0 0 auto;
  }

  .brand-logo {
    width: 36px;
  }

  .nav {
    flex: 1 1 auto;
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    align-items: center;
    min-width: 0;
  }

  .nav-item {
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* User strip is hidden in the mobile top bar â€” admins can manage
     view-as-user from the Settings page. */
  .sidebar-user-strip {
    display: none;
  }

  /* Topbar: stack title above filter bar; allow filters to use full width. */
  .topbar {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 10px;
    top: 56px; /* sit below sticky sidebar */
  }

  .filters {
    width: 100%;
    gap: 6px 8px;
  }

  .filter-date,
  .filter-search,
  #ranking-filter-label,
  .item-type-control,
  .league-control,
  .team-color-control {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .filter-date > input,
  .filter-search > input,
  #ranking-filter-label > select,
  .item-type-control > select,
  .league-control > select,
  .team-color-control > select {
    width: 100%;
  }

  .date-shortcuts {
    flex: 1 1 100%;
  }

  /* Metric strip: 2-up grid */
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-strip article {
    min-height: 80px;
    padding: 12px 14px 11px;
  }

  .metric-strip article:nth-child(-n+3) strong {
    font-size: clamp(20px, 5.5vw, 26px);
  }

  /* Compress trend chart */
  .trend-svg {
    height: 220px;
  }

  .trend-chart {
    padding: 4px 8px 0;
  }

  /* Drop the SKU rules panel on mobile - keep the side panel lean */
  .rule-box {
    display: none;
  }

  /* Tighten section headings */
  .panel-heading {
    padding: 12px 14px;
  }

  .panel-heading h2 {
    font-size: 16px;
  }
}

/* Tablet + narrow desktop (~700px and below): metric strip becomes 2-col
   so the Net Sales tile + Sales/Units tile stack 2-up rather than 1.
   The dual-stat Sales tile flips to vertical inside its card so the two
   halves are stacked instead of side-by-side (avoiding cramped numbers). */
@media (max-width: 700px) {
  .metric-strip {
    grid-template-columns: 1fr 1fr;
  }
  .metric-dual {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  .metric-dual::before {
    display: none !important;
  }
  .metric-dual > .metric-dual-half {
    padding: 4px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .metric-dual > .metric-dual-half:last-child {
    border-bottom: none;
  }
  .metric-net-sales {
    grid-column: span 2;
  }
  /* App shell: sidebar collapses to a top strip */
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    flex-direction: row;
    height: auto;
    width: 100%;
    padding: 8px 12px;
    overflow-x: auto;
  }
  .sidebar .nav {
    flex-direction: row;
    gap: 4px;
  }
  .sidebar-user-strip {
    display: none;
  }
  /* Main item-sections: allow horizontal scroll instead of clipping */
  .table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  /* Phones: single column metric strip; smaller hero numbers */
  .metric-strip {
    grid-template-columns: 1fr;
  }
  .metric-net-sales {
    grid-column: span 1;
  }

  /* Filter cells stack one per row */
  .filter-date,
  .filter-search,
  #ranking-filter-label,
  .item-type-control,
  .league-control,
  .team-color-control {
    flex: 1 1 100%;
  }

  .date-shortcuts button {
    padding: 4px 8px;
  }

  h1 {
    font-size: 20px;
  }

  .trend-svg {
    height: 180px;
  }

  /* Source Mix legend stacks */
  .metric-source-legend {
    grid-template-columns: 1fr;
  }

  /* Best Parent Items cards already stack from the 820px block - just
     tighten image size for phones */
  .item-type-section tbody tr {
    grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px 12px;
    padding: 14px;
  }

  .item-type-section .image-cell,
  .item-type-section .image-cell .thumb-wrap {
    width: 84px;
    height: 84px;
  }

  .item-type-section .metric-cell-value,
  .item-type-section .units-value {
    font-size: 15px;
  }

  .item-type-section .chip {
    max-width: 100%;
    white-space: normal;
  }
}

/* ===== Licensing page ===== */
.lic-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.lic-hero-tile {
  flex: 1 1 180px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lic-hero-tile small {
  color: #64748b;
  font-size: 0.72em;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.lic-hero-tile strong {
  font-size: 1.35em;
  font-variant-numeric: tabular-nums;
}
.lic-hero-tile span {
  color: #475569;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}
.lic-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}
.lic-table th {
  text-align: left;
  font-size: 0.78em;
  color: #64748b;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.lic-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  font-variant-numeric: tabular-nums;
}
.lic-amount {
  white-space: nowrap;
}
.lic-share {
  width: 45%;
}
.lic-share-track {
  display: inline-block;
  vertical-align: middle;
  width: calc(100% - 64px);
  height: 8px;
  background: #eef2f7;
  border-radius: 4px;
  overflow: hidden;
  margin-right: 8px;
}
.lic-share-fill {
  height: 100%;
  background: var(--accent, #0f766e);
  border-radius: 4px;
}
.lic-share span {
  font-size: 0.85em;
  color: #475569;
}
.lic-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 8px 4px 0;
  overflow-x: auto;
}
.lic-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}
.lic-bar {
  width: 34px;
  background: var(--accent, #0f766e);
  border-radius: 4px 4px 0 0;
  align-self: center;
}
.lic-bar-val {
  font-size: 0.75em;
  color: #475569;
  font-variant-numeric: tabular-nums;
}
.lic-bar-col small {
  color: #64748b;
  font-size: 0.72em;
  white-space: nowrap;
}

/* ===== Compact utility tables (Settings + Licensing) =====
   The global table rules are sized for the Best Parent Items rows
   (tbody td height 174px, min-width 940px, fixed nth-child widths) — they
   inflate small info tables (sync history, royalty email status, licensing)
   into huge empty rows. Undo all of that for the compact tables. */
.sync-history-grid,
.royalty-email-status-grid,
.lic-table {
  min-width: 0;
  table-layout: auto;
}
.sync-history-grid tbody td,
.royalty-email-status-grid tbody td,
.lic-table tbody td {
  height: auto;
}
.sync-history-grid th:nth-child(n),
.sync-history-grid td:nth-child(n),
.royalty-email-status-grid th:nth-child(n),
.royalty-email-status-grid td:nth-child(n),
.lic-table th:nth-child(n),
.lic-table td:nth-child(n) {
  width: auto;
}
.royalty-email-status-grid th,
.royalty-email-status-grid td,
.lic-table th,
.lic-table td {
  padding: 6px 10px;
  font-size: 13px;
}
/* Let wide utility tables scroll inside their card on phones instead of
   blowing out the page width. */
.licensing-page .settings-card,
#royalty-email-card {
  overflow-x: auto;
}
/* Licensing on phones: hero tiles stack, share column tightens. */
@media (max-width: 700px) {
  .lic-hero-tile {
    flex: 1 1 100%;
  }
  .lic-share {
    width: 35%;
  }
  .lic-share-track {
    width: calc(100% - 52px);
  }
}

/* ============================================================
   AESTHETIC OVERHAUL (2026-06-10)
   1 hero density · 3 brand-pink accents · 4 nav icons/sidebar
   5 filter clustering · 6 type scale · 7 chart polish · 8 header band
   ============================================================ */

/* ---- 8) Navy header band: title + filters live on a dark band; the white
   filter card pops against it. Sticky, full-bleed across .main padding. ---- */
.topbar {
  background: linear-gradient(135deg, #16223c 0%, #0e1830 100%);
  margin: -26px -26px 18px;
  padding: 14px 26px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar h1 {
  color: #ffffff;
  letter-spacing: -0.02em;
}
#page-title { color: #ffffff; }
/* mobile-filter-toggle keeps its own pill colors on the band */
.topbar .global-sync-status { color: #9fb0c2; }
.main.settings-page-active .topbar { position: sticky; top: 0; }

/* ---- 6) Type scale: Inter is now actually loaded; tighten hierarchy ---- */
h1 { font-weight: 800; }
.metric-strip article > span,
.metric-strip article span[id$="-label"] {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.metric-hero strong { letter-spacing: -0.01em; }

/* ---- 4) Sidebar: icons, pink active indicator, pinned user strip ---- */
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  font-size: 14px;
  position: relative;
}
.nav-item .nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.7;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }
.nav-item.active {
  box-shadow: inset 3px 0 0 var(--brand-pink);
}
.sidebar-user-strip {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- 3) Brand pink, used sparingly: primary CTA + focus + active chips ---- */
#go-button {
  background: var(--brand-pink);
  border-color: var(--brand-pink);
  color: #ffffff;
}
#go-button:hover { filter: brightness(1.08); }
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand-pink);
  outline-offset: 1px;
}

/* ---- 5) Filter bar: clustered groups + toggle chips ---- */
.filters {
  gap: 8px 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #ffffff;
}
.compare-toggle-label,
.date-shortcuts {
  border-left: 1px solid var(--line);
  padding-left: 14px;
  margin-left: 4px;
}
.date-shortcuts { gap: 6px; }
.date-shortcuts button {
  border-radius: 999px;
  padding: 3px 11px;
  min-height: 24px;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.date-shortcuts button:hover { border-color: var(--brand-pink); color: var(--brand-pink); }
.date-shortcuts button.active {
  background: var(--brand-pink);
  border-color: var(--brand-pink);
  color: #ffffff;
}

/* ---- 1) Hero tile density ---- */
/* Sales tile: sparkline fills the bottom half (full-width grid row) */
.metric-sales-spark {
  grid-column: 1 / -1;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.metric-sales-spark svg {
  width: 100%;
  height: 32px;
  display: block;
}
.metric-sales-spark small {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
/* Source Mix + Source Health: content fills/centers the card instead of
   clinging to one edge with dead space */
#metric-source-mix-card,
#metric-sync-card {
  display: flex;
  flex-direction: column;
}
#metric-source-mix {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
#metric-sync.sync-health-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

/* ---- 7) Chart polish: fainter grid, softer areas, legend pills ---- */
.trend-grid { stroke: #eef2f7; }
.trend-area-stacked { fill-opacity: 0.8; }
.trend-legend { gap: 6px; justify-content: flex-end; }
.trend-legend-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 600;
  font-size: 11.5px;
}

/* ---- Responsive compatibility for the band + sidebar changes ---- */
@media (max-width: 1120px) {
  .nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
  }
  .nav-item.active { box-shadow: inset 0 -3px 0 var(--brand-pink); }
  .sidebar-user-strip {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}
@media (max-width: 820px) {
  .topbar {
    margin: -16px -16px 14px;
    padding: 12px 16px;
  }
}

/* ===== Horizontal nav header (2026-06-10) =====
   The left rail is gone at ALL widths: the sidebar renders as a full-width
   navy strip on top (logo + icon+label nav + user strip + logout), visually
   merging with the title/filter band below it. This is the proven <=1120px
   layout promoted to desktop — labels stay readable and no column is wasted. */
.app-shell {
  grid-template-columns: 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  height: auto;
  padding: 8px 22px;
  border-right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow: visible;
}
.brand {
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
}
.brand-logo {
  width: 44px;
}
.nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.nav-item {
  width: auto;
  justify-content: flex-start;
  padding: 9px 14px;
  gap: 8px;
  white-space: nowrap;
}
.nav-item > span { display: inline; }
.nav-item .nav-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.nav-item.active {
  box-shadow: inset 0 -3px 0 var(--brand-pink);
}
.sidebar-user-strip {
  margin: 0 0 0 auto;
  padding: 0;
  border-top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.sidebar-user-strip .view-as-user > span { display: inline; }
.sidebar-user-strip #user-email { display: inline; }
.logout-button {
  position: static;
  margin: 0;
  order: 99;
  flex: 0 0 auto;
}
/* The title/filter band sits directly under the nav strip — slide it under
   on scroll (band is z-20, strip z-10), same as the existing mobile behavior. */

/* Use the FULL width of the white filter card: distribute the clusters
   instead of leaving dead space on the right. */
.filters {
  justify-content: space-between;
}

/* YoY one-click compare chip */
.compare-yoy {
  border: 1px solid #ccd7dc;
  border-radius: 999px;
  background: #ffffff;
  color: #173f47;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 11px;
  min-height: 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.compare-yoy:hover {
  border-color: var(--brand-pink);
  color: var(--brand-pink);
}

/* Licensing -> Overview drill-through rows */
.lic-row { cursor: pointer; }
.lic-row:hover td { background: var(--surface-2); }

/* Freeze the nav strip too: the title/filter band sticks just below it
   (its height is measured into --navstrip-h by syncNavStripHeight). */
.topbar {
  top: var(--navstrip-h, 62px);
}
.main.settings-page-active .topbar {
  top: var(--navstrip-h, 62px);
}

/* ===== Tighten the frozen band (2026-06-11) =====
   The active page name already shows in the nav strip directly above, so the
   big H1 ("Wholesale" etc.) is redundant — hide it and reclaim its column +
   slim the paddings. The band is sticky, so every saved pixel pays off on
   every scroll position. (The H1 element stays in the DOM for JS/a11y; the
   mobile Filters toggle keeps living in that first row.) */
#page-title {
  display: none;
}
.topbar {
  grid-template-columns: 1fr;
  padding: 8px 26px;
  gap: 6px;
  margin-bottom: 14px;
}
.topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
}
.filters {
  padding: 6px 12px;
  gap: 5px 12px;
}
@media (max-width: 820px) {
  .topbar {
    padding: 8px 16px;
  }
}

/* ===== Size Curve modal ===== */
.modal-panel--wide {
  width: min(960px, 94vw);
  max-width: 960px;
}

.modal-subtitle {
  color: #5c6b78;
  font-size: 13px;
  margin: 2px 0 0;
}

.size-curve-table {
  max-height: 62vh;
  overflow: auto;
  margin-top: 12px;
}

.size-curve-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.size-curve-table th,
.size-curve-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line, #e3e9ef);
  text-align: right;
  white-space: nowrap;
}

.size-curve-table th:first-child,
.size-curve-table td:first-child {
  text-align: left;
}

.size-curve-table thead th {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.size-curve-table .size-curve-total {
  font-weight: 700;
  background: #f4f8fa;
}

.size-curve-table .sc-units {
  display: block;
  color: #7a8894;
  font-size: 11px;
  font-weight: 400;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* ===== Season projection panel ===== */
.projection-toggle {
  align-self: flex-start;
  white-space: nowrap;
}

.projection-toggle.active {
  background: #17212c;
  color: #ffffff;
  border-color: #17212c;
}

.projection-panel {
  border-top: 1px solid var(--line, #e3e9ef);
  margin-top: 14px;
  padding-top: 12px;
}

.projection-loading {
  color: #5c6b78;
  font-size: 13px;
  padding: 10px 0;
}

.proj-summary {
  font-size: 14px;
  color: #2a3947;
  margin-bottom: 12px;
}

.proj-summary .proj-note {
  display: block;
  color: #7a8894;
  font-size: 12px;
  margin-top: 3px;
}

.proj-up { color: #147d54; font-weight: 600; }
.proj-down { color: #b3341f; font-weight: 600; }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  align-items: end;
}

.proj-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
}

.proj-bar {
  width: 70%;
  border-radius: 4px 4px 0 0;
}

.proj-bar.actual {
  background: #0f766e;
}

.proj-bar.projected {
  background: repeating-linear-gradient(135deg, #94c5c1 0 5px, #d9ecea 5px 10px);
  border: 1px dashed #4e968f;
}

.proj-month {
  font-size: 10px;
  color: #7a8894;
  text-transform: uppercase;
}

.proj-value {
  font-size: 10.5px;
  color: #2a3947;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .proj-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ===== Replenish page ===== */
.replenish-controls .rep-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
}

.replenish-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #5c6b78;
  font-weight: 600;
}

.replenish-controls input,
.replenish-controls select {
  padding: 7px 10px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  font-size: 13px;
  min-width: 110px;
}

.replenish-controls .rep-search input { min-width: 220px; }

.replenish-controls .rep-hide-nobuy {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  padding-bottom: 8px;
}

.rep-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.rep-inv-note {
  margin-right: auto;
  align-self: center;
  font-size: 12.5px;
  color: #5c6b78;
}

.rep-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff7e0;
  border: 1px solid #e8d48a;
  color: #6b5615;
  font-size: 13px;
}

.rep-summary {
  font-size: 13.5px;
  color: #2a3947;
  margin-bottom: 10px;
}

.rep-warn-text { color: #a15c0f; font-weight: 600; }

.replenish-table { max-height: 70vh; overflow: auto; }
.replenish-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.replenish-table th, .replenish-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line, #e3e9ef);
  white-space: nowrap;
}
.replenish-table thead th { position: sticky; top: 0; background: #ffffff; z-index: 1; text-align: right; }
.replenish-table thead th:nth-child(-n+3) { text-align: left; }
.replenish-table td.number { text-align: right; }

.rep-parent-row { cursor: pointer; }
.rep-parent-row:hover { background: #f6fafb; }
.rep-parent-row.expanded { background: #eef6f7; }
.rep-caret { width: 18px; color: #7a8894; }
.rep-parent-cell .sku { font-weight: 700; display: block; }
.rep-parent-cell .rep-title {
  display: block;
  color: #5c6b78;
  font-size: 12px;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rep-size-row { background: #fbfdfe; }
.rep-size-row td { border-bottom: 1px dashed #e7edf2; font-size: 12.5px; }
.rep-size-cell { padding-left: 26px !important; color: #38434e; }
.rep-size-label {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 10px;
  background: #eef2f5;
  font-size: 11px;
  font-weight: 700;
}
/* Royalty send-failure notice — Settings page only, dismissible (per Eli: a
   banner on every page just trains you to ignore it). Dismissal is per
   report+period, so it stays gone; the retry runs regardless. */
.royalty-alert {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid #fca5a5;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  background: #fef2f2;
  color: #7f1d1d;
}
.royalty-alert.hidden { display: none; }
.royalty-alert-head {
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.royalty-alert-actions { display: flex; gap: 6px; flex: 0 0 auto; }

.royalty-alert-x {
  flex: 0 0 auto;
  font: inherit;
  font-weight: 600;
  font-size: 0.82em;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #fca5a5;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.royalty-alert-x:hover { background: rgba(220, 38, 38, 0.12); }
.royalty-alert-list { margin: 0; padding-left: 18px; }
.royalty-alert-list li { margin: 4px 0; }
.royalty-alert-err {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em;
  opacity: 0.85;
  margin-top: 2px;
  word-break: break-word;
}
.royalty-alert-foot { margin-top: 8px; font-size: 0.85em; opacity: 0.9; }
@media (prefers-color-scheme: dark) {
  .royalty-alert { background: #2a1414; border-color: #7f1d1d; color: #fecaca; }
}

.rep-buy { color: #0b5c46; }
/* FBA reads as secondary to on-hand: it's stock, but it's at Amazon, not Gurnee. */
.rep-fba { color: #7a6a3a; }

.rep-badge {
  display: inline-block;
  min-width: 40px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.rep-badge.rep-low { background: #fde3dd; color: #a02c12; }
.rep-badge.rep-warn { background: #fdf0d4; color: #8a6100; }
.rep-badge.rep-ok { background: #def3ec; color: #0b5c46; }
.rep-badge.rep-unknown { background: #e8edf1; color: #5c6b78; }
.rep-truncated { text-align: center; color: #7a8894; font-size: 12.5px; padding: 10px; }

/* The global tbody td { height: 174px } is sized for product-image rows;
   compact data tables opt back out. */
.size-curve-table tbody td,
.replenish-table tbody td {
  height: auto;
}

/* Replenish cards stack their content (the base .settings-card is a 2-col
   grid meant for the Settings rows). */
.replenish-page .settings-card {
  display: block;
}

/* ===== Replenish v2 ===== */
.rep-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rep-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #17212c;
  margin: 0 0 2px;
}

.rep-card-sub {
  font-size: 12.5px;
  color: #5c6b78;
  margin: 0;
  max-width: 640px;
}

.rep-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rep-toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 2px;
}

.rep-toggles .check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #38434e;
  font-weight: 500;
}

.rep-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12.5px;
  color: #5c6b78;
}

.rep-list-chip {
  background: #e8f2ff;
  border: 1px solid #b9d5f3;
  color: #1c4d7c;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.rep-list-chip a { color: #1c4d7c; margin-left: 4px; text-decoration: none; }

.rep-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rep-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 6px;
  border: 1px solid #dbe4ec;
  object-fit: contain;
  background: #ffffff;
  display: block;
}

.rep-thumb-empty {
  background: linear-gradient(135deg, #f2f6f8, #e8eef2);
}

.rep-import-text {
  width: 100%;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-family: ui-monospace, Consolas, monospace;
  resize: vertical;
  margin-top: 10px;
}

.rep-import-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ===== ASP under sales ===== */
.asp-line {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #7a8894;
  margin-top: 2px;
}

/* ===== License P&L table ===== */
.pnl-table .pnl-baseline {
  background: #f4f8fa;
}

.pnl-pos { color: #147d54; font-weight: 600; }
.pnl-neg { color: #b3341f; font-weight: 600; }

/* ===== Wholesale Accounts panel ===== */
.accounts-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.accounts-actions .check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #38434e;
}

.accounts-table {
  max-height: 480px;
  overflow: auto;
  margin-top: 10px;
}

.accounts-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.accounts-table th,
.accounts-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line, #e3e9ef);
  white-space: nowrap;
}

.accounts-table tbody td {
  height: auto;
}

.accounts-table thead th {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
  text-align: left;
}

.accounts-table th.number,
.accounts-table td.number {
  text-align: right;
}

.accounts-table .accounts-name {
  font-weight: 600;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Insights page ===== */
.ins-scope-note {
  font-size: 13px;
  font-weight: 600;
  color: #4a5a68;
  background: #eef4f8;
  border: 1px solid #d7e3ec;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 12px;
}

.ins-subnav {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 14px;
}

.ins-view-btn.active {
  background: #16223c;
  color: #fff;
  border-color: #16223c;
}

/* ===== Insights: unified page (chart + comparison table) ===== */
.ins-chart-wrap {
  background: #fff;
  border: 1px solid #e3e9ee;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.ins-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.ins-legend { display: inline-flex; gap: 14px; }

.ins-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #46555f;
}

.ins-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.ins-ads-chart { width: 100%; height: auto; display: block; }

.ins-chart-wrap { position: relative; }

.ins-chart-cursor {
  stroke: #9fb0bb;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.ins-chart-cursor.hidden { display: none; }

.ins-chart-tip {
  position: absolute;
  z-index: 5;
  background: #fff;
  border: 1px solid #dbe3e9;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(22, 34, 60, 0.12);
  padding: 8px 11px;
  font-size: 12px;
  pointer-events: none;
  min-width: 140px;
}

.ins-chart-tip.hidden { display: none; }

.ins-chart-tip strong { display: block; margin-bottom: 4px; font-size: 12px; }

.ins-tip-row {
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.7;
  color: #46555f;
}

.ins-tip-row em {
  font-style: normal;
  font-weight: 600;
  margin-left: auto;
  color: #16223c;
}

.ins-tip-total { border-top: 1px solid #edf1f4; margin-top: 3px; padding-top: 3px; }

.ins-chart-ctl { display: inline-flex; gap: 6px; margin-left: 14px; }

.ins-mini-btn {
  font: inherit;
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #d5dde3;
  border-radius: 999px;
  background: #fff;
  color: #46555f;
  cursor: pointer;
}

.ins-mini-btn.active {
  background: #16223c;
  border-color: #16223c;
  color: #fff;
}

.ins-legend-dash {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px dashed #16223c;
  margin-right: 6px;
  vertical-align: middle;
}

.ins-cell-delta {
  font-size: 10px;
  color: #8a97a1;
  line-height: 1.3;
}

.ins-cell-delta.pos { color: #178a52; }

.ins-cell-delta.neg { color: #c0392b; }

.ins-kpi-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.ins-kpi-group {
  flex: 1 1 240px;
  background: #fff;
  border: 1px solid #e3e9ee;
  border-radius: 12px;
  padding: 12px 14px;
}

.ins-kpi-group-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #16223c;
  margin-bottom: 10px;
}

.ins-kpi-group-head span {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #8a97a1;
  margin-left: 8px;
}

.ins-kpi-group .ins-kpis {
  margin-bottom: 0;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.ins-kpi-win {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: #8a97a1;
  border: 1px solid #e3e9ee;
  border-radius: 999px;
  padding: 0 5px;
  vertical-align: middle;
}

.ins-kpi-chip {
  font-size: 11px;
  vertical-align: middle;
  white-space: nowrap;
}

.ins-jumpbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 18px;
  background: #fff;
  border-bottom: 1px solid #edf1f4;
  padding: 8px 2px;
  margin-bottom: 14px;
  font-size: 12.5px;
}

.ins-jumpbar a {
  color: #16223c;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.ins-jumpbar a:hover { color: #d63384; }

.ins-fold { margin-top: 16px; }

.ins-fold-toggle {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #16223c;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ins-fold-caret { color: #8a97a1; }

.ins-fold-body { margin-top: 6px; }

.ins-fold-body.hidden { display: none; }

.ins-card-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.ins-card-asof {
  font-size: 10.5px;
  color: #97a3ae;
  white-space: nowrap;
}

.ins-subhead {
  margin: 18px 0 8px;
  font-size: 13px;
  color: #16223c;
}

.ins-subhead .muted { font-weight: 400; font-size: 11px; margin-left: 8px; }

.ins-chart-grid line { stroke: #edf1f4; stroke-width: 1; }

.ins-chart-labels text {
  font-size: 11px;
  fill: #8a97a1;
}

.ins-ads-table td:first-child { white-space: nowrap; }

.ins-total-row td { border-top: 2px solid #dfe6ec; }

.ins-badge-soft {
  display: inline-block;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2f5;
  color: #5b6a75;
  vertical-align: middle;
}

.ins-badge-err { background: #fdecec; color: #b3372f; }

.ins-ads-notes p { margin: 4px 0 0; font-size: 11.5px; }

.ins-ads-section { margin-bottom: 22px; }

.ins-ads-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ins-ads-preset.active {
  background: #16223c;
  color: #fff;
  border-color: #16223c;
}

.ins-ads-date {
  width: auto;
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid #d5dde3;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  color: inherit;
  background: #fff;
}

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

.ins-win-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
}

.ins-win-btn.active {
  background: #16223c;
  color: #fff;
  border-color: #16223c;
}

.ins-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.ins-kpis .ins-tile {
  background: #fff;
  border: 1px solid #e3eaf0;
  border-radius: 10px;
  padding: 12px 14px;
}

.ins-section { margin-bottom: 26px; }

.ins-section-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #24333f;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e3eaf0;
}

/* Opt out of the global product-table sizing (min-width 940px, fixed
   layout, 174px rows, nth-child widths) — same escape hatch as .lic-table
   and .accounts-table. */
.ins-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ins-table tbody td { height: auto; }

.ins-table th:nth-child(n),
.ins-table td:nth-child(n) {
  width: auto;
  position: static;
}

.ins-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7b8794;
  padding: 4px 8px 6px;
  border-bottom: 1px solid #e8eef2;
}

.ins-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0f4f7;
  color: #33424e;
}

.ins-table td.num, .ins-table th:not(:first-child) { text-align: right; }

.ins-table tr:last-child td { border-bottom: none; }

.ins-url {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.ins-funnel { display: flex; flex-direction: column; gap: 8px; }

.ins-funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.ins-funnel-label { width: 110px; color: #5c6b78; flex-shrink: 0; }

.ins-funnel-track {
  flex: 1;
  height: 16px;
  background: #f0f4f7;
  border-radius: 6px;
  overflow: hidden;
}

.ins-funnel-fill {
  height: 100%;
  background: linear-gradient(90deg, #e91e8c, #a24bcf);
  border-radius: 6px;
}

.ins-funnel-step { font-size: 11.5px; color: #7b8794; width: 48px; text-align: right; }

.ins-bar {
  display: flex;
  height: 18px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}

.ins-bar-seg { min-width: 2%; }
.ins-g-female { background: #e91e8c; }
.ins-g-male { background: #2c7be5; }
.ins-bar-seg:not(.ins-g-female):not(.ins-g-male) { background: #9aa8b5; }

.ins-bar-legend { font-size: 12px; color: #5c6b78; display: flex; gap: 14px; margin-bottom: 8px; }

.ins-bar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7b8794;
  margin-bottom: 3px;
}

.ins-spark {
  display: block;
  width: 68px;
  height: 20px;
  margin-top: 6px;
  color: #a24bcf;
  opacity: 0.85;
}

.ins-lowstar span { color: #9c2d2d; }

.ins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.ins-card { display: block; }

.ins-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.ins-card-head h3 { margin: 0 0 2px; font-size: 15.5px; }
.ins-card-head p { margin: 0; font-size: 12px; color: #5c6b78; }

.ins-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.ins-tile {
  background: #f7fafb;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ins-tile-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7a8894;
  font-weight: 700;
}

.ins-tile-value { font-size: 19px; font-weight: 800; color: #17212c; }
.ins-delta { font-size: 11.5px; }

/* KPI-strip tile clarity: explicit period + "vs <dates>" lines */
.ins-kpi-period {
  font-size: 11px;
  color: #6b7a87;
  margin-top: 3px;
}
.ins-kpi-cmp {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 4px;
  font-size: 11.5px;
}
.ins-kpi-vs { color: #94a1ac; }
.ins-kpi .ins-spark { margin-top: 8px; }

/* Breakdown-window group: the 5 GA4 cards that re-scope together, wrapped
   as one unit with the toggle in its header so it reads as a set. */
.ins-breakdown {
  border: 1px solid #d9d2f2;
  background: #faf9ff;
  border-radius: 14px;
  padding: 16px 16px 4px;
  margin-bottom: 26px;
}
.ins-breakdown-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.ins-breakdown-titles .ins-section-title { border-bottom: 0; margin: 0 0 2px; padding: 0; }
.ins-breakdown-sub { margin: 0; font-size: 12.5px; color: #5c6b78; }
.ins-breakdown-sub strong { color: #4a3a8f; }
.ins-breakdown .ins-grid { margin-bottom: 0; }

/* Muted "fixed windows" note on section headers that DON'T move with toggle */
.ins-section-note {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9aa6b1;
  margin-left: 8px;
}

/* Clarity frustration rows: value + rate + plain-English definition */
.ins-fr-list { display: flex; flex-direction: column; gap: 2px; }
.ins-fr-row { padding: 8px 0; border-bottom: 1px solid #f0f4f7; }
.ins-fr-row:last-child { border-bottom: 0; }
.ins-fr-head { display: flex; justify-content: space-between; align-items: baseline; }
.ins-fr-label { font-size: 13px; font-weight: 700; color: #24333f; }
.ins-fr-val { font-size: 16px; font-weight: 800; color: #17212c; }
.ins-fr-meta { margin-top: 2px; }
.ins-fr-rate {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: #b1436b;
  background: #fdeef3;
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 8px;
}
.ins-fr-def { font-size: 12px; color: #6b7a87; }

/* Site-search demand gaps (terms that return 0 products) */
.ins-gap-head { color: #b1436b; }
.ins-gap-row span { color: #9c2d4d; font-weight: 600; }
.ins-gap-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 8px;
  background: #fdeef3;
  color: #b1436b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

@media (max-width: 700px) {
  .ins-breakdown-head { flex-wrap: wrap; }
  .ins-breakdown .ins-win-toggle { margin: 0; }
}

.ins-subhead {
  margin: 14px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7a8894;
}

.ins-list { display: flex; flex-direction: column; }

.ins-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed #e7edf2;
  font-size: 13px;
}

.ins-list-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-list-row em { color: #7a8894; font-style: normal; font-size: 12px; flex-shrink: 0; }

.ins-needs {
  font-size: 12.5px;
  color: #5c6b78;
  background: #f4f8fa;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}

.ins-needs code { font-size: 11.5px; background: #e8eef2; padding: 1px 5px; border-radius: 4px; }

@media (max-width: 980px) {
  .ins-grid { grid-template-columns: 1fr; }
  /* Grid items default to min-width:auto, so a wide table inside a card
     blows the WHOLE page out to desktop width on phones (Safari then zooms
     out to fit). Let the card shrink to the viewport; the .table-wrap
     inside scrolls the wide table instead. */
  .ins-grid .ins-card { min-width: 0; max-width: 100%; }
  .ins-card .table-wrap { max-width: 100%; }
}

/* ===== Phone-only ergonomics (2026-07-10, per Eli: NO desktop changes) =====
   Everything below only exists under the media-query widths. */

/* Today-glance card is a phone-only feature: hidden by default so desktop
   never sees it even if the JS gate ever mis-fires. */
.today-glance { display: none; }

@media (max-width: 700px) {
  /* 4. Today at a glance — first thing on Overview */
  .today-glance {
    display: block;
    background: linear-gradient(135deg, #1a2838 0%, #0c1622 100%);
    color: #eef4f8;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
  }
  .glance-head {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.72;
    margin-bottom: 6px;
  }
  .glance-head em { font-style: normal; }
  .glance-hero { font-size: 27px; font-weight: 800; margin-bottom: 8px; }
  .glance-hero small { font-size: 13px; font-weight: 600; opacity: 0.8; }
  .glance-split {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12.5px;
    opacity: 0.92;
    margin-bottom: 9px;
  }
  .glance-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12.5px;
    opacity: 0.8;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding-top: 8px;
  }
  .glance-split strong, .glance-foot strong { font-weight: 700; }

  /* Insights toolbar: wrap instead of forcing the page wider than the phone */
  .ins-ads-bar { gap: 6px; }
  .ins-ads-bar .filter-button { padding: 8px 12px; }
  .ins-ads-date { flex: 1 1 40%; min-width: 0; }
  .ins-chart-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .ins-chart-ctl { margin-left: 0; flex-wrap: wrap; }
  .ins-kpi-group { flex-basis: 100%; }
  .ins-jumpbar { gap: 12px; overflow-x: auto; }
  .ins-card-head-right { display: none; }
  .ins-breakdown-head { flex-wrap: wrap; }
  .ins-toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 8px;
  }
  .ins-win-toggle { margin-left: 0; margin-right: 0; }

  /* 2. Insights KPI strip: one thumb-swipeable row instead of a tall stack */
  .ins-kpis {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  .ins-kpis .ins-tile {
    flex: 0 0 46%;
    min-width: 150px;
    scroll-snap-align: start;
  }

  /* 1. Wide insights tables swipe sideways instead of squishing */
  .ins-tablewrap { -webkit-overflow-scrolling: touch; }
  .ins-tablewrap .ins-table { min-width: 480px; }

  /* 3. Bottom tab bar: the existing nav pins to the bottom where thumbs live */
  .nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: linear-gradient(180deg, #17273a 0%, #0c1622 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    gap: 0;
    overflow-x: auto;
  }
  .nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    font-size: 9.5px;
    min-width: 44px;
    text-align: center;
  }
  .nav-item .nav-icon { width: 20px; height: 20px; }
  .nav-item.active { box-shadow: inset 0 3px 0 var(--brand-pink); }
  .nav .sidebar-user-strip { display: none; }
  /* Content clears the bar (incl. iPhone home indicator) */
  .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* 5. Small-phone polish: bigger tap targets, lighter chart text */
@media (max-width: 480px) {
  .date-shortcuts button { min-height: 38px; padding: 8px 12px; }
  .filter-button { min-height: 40px; }
  .trend-svg text { font-size: 10px; }
  .ins-table td, .ins-table th { padding: 8px; }
}

.ins-asof {
  margin-top: 10px;
  font-size: 11px;
  color: #97a3ae;
}

/* ===== At-Once page (wholesale rep tool — its own layout) ===== */
.atonce-page { max-width: 1240px; }

.ao-wrap {
  background: #fff;
  border: 1px solid #e3e9ee;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(22, 34, 60, 0.05);
  padding: 18px 20px;
}

.ao-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf1f4;
}

.ao-head h2 { margin: 0; font-size: 18px; color: #16223c; }
.ao-head p { margin: 3px 0 0; font-size: 12.5px; color: #6b7a87; }
.ao-synced { font-size: 11px; color: #8a97a1; white-space: nowrap; padding-top: 5px; }

.ao-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  padding: 16px 0;
}

.ao-stepline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #16223c;
  margin: 14px 0 8px;
}

.ao-stepline:first-child { margin-top: 0; }

.ao-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #16223c;
  color: #fff;
  font-size: 11px;
}

.ao-muted {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #8a97a1;
  font-size: 11.5px;
}

.ao-leagues { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.ao-chip {
  font: inherit;
  font-size: 12px;
  padding: 5px 13px;
  border: 1px solid #d5dde3;
  border-radius: 999px;
  background: #fff;
  color: #46555f;
  cursor: pointer;
}

.ao-chip:hover { border-color: #16223c; }
.ao-chip.active { background: #16223c; border-color: #16223c; color: #fff; }
.ao-league { font-weight: 600; }
.ao-pct.active { background: #d63384; border-color: #d63384; }

.ao-gate {
  border: 1px dashed #d5dde3;
  border-radius: 10px;
  padding: 26px;
  text-align: center;
  color: #8a97a1;
  font-size: 13px;
}

.ao-teams-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.ao-search {
  flex: 1 1 auto;
  padding: 7px 11px;
  border: 1px solid #d5dde3;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}

.ao-link {
  font: inherit;
  font-size: 11.5px;
  background: none;
  border: none;
  color: #d63384;
  cursor: pointer;
  padding: 2px 4px;
}

.ao-list { display: grid; gap: 2px 12px; }
.ao-cols-1 { grid-template-columns: 1fr; }
.ao-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ao-tall { max-height: 300px; overflow-y: auto; padding-right: 4px; }
.ao-scroll { max-height: 132px; overflow-y: auto; padding-right: 4px; }

/* One block per league so NFL clubs and NCAA schools never interleave — and
   side by side, so picking two leagues doesn't mean scrolling to reach the
   second one (Eli 2026-07-30). */
.ao-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0 26px;
  align-items: start;
}
.ao-groups .ao-group { min-width: 0; }
.ao-cols-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ao-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid #edf1f4;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.ao-group-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #16223c;
}

/* Item types read as a wrapping row of chips, not a two-line scroll window. */
.ao-types { display: flex; flex-wrap: wrap; gap: 6px; }
.ao-type-chip { font-size: 12px; }
.ao-note { margin: 8px 0 0; font-size: 11px; color: #8b98a5; line-height: 1.5; }
.ao-note strong { color: #16223c; }

.ao-skus {
  width: 100%;
  border: 1px solid #dde4ea;
  border-radius: 7px;
  padding: 7px 9px;
  font: inherit;
  font-size: 12px;
  resize: vertical;
}
.ao-skus:focus { outline: none; border-color: #16223c; }
.ao-status.warn { color: #a5691a; }

.ao-rule {
  font-size: 11px;
  line-height: 1.55;
  color: #6b7a87;
  background: #f6f8fa;
  border-radius: 7px;
  padding: 9px 11px;
}
.ao-rule strong { color: #16223c; }

.ao-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #46555f;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.ao-check:hover { background: #f6f8fa; }
.ao-check.on { color: #16223c; font-weight: 600; }
.ao-check input { width: 15px; height: 15px; accent-color: #d63384; cursor: pointer; }
.ao-check.hidden { display: none; }

.ao-picked-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf1f4;
  min-height: 30px;
}

.ao-picked {
  font: inherit;
  font-size: 11.5px;
  padding: 3px 10px;
  border: none;
  border-radius: 999px;
  background: #16223c;
  color: #fff;
  cursor: pointer;
}

.ao-picked-none { font-size: 12px; color: #8a97a1; }

.ao-side {
  border-left: 1px solid #edf1f4;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ao-opt label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #16223c;
  margin-bottom: 6px;
}

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

.ao-num {
  width: 82px;
  padding: 6px 9px;
  border: 1px solid #d5dde3;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}

.ao-num-sm { width: 62px; }
.ao-help { font-size: 11px; color: #8a97a1; display: inline-block; margin-top: 4px; }
.ao-help em { font-style: normal; font-weight: 600; }

.ao-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid #edf1f4;
}

.ao-go {
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 26px;
  border: none;
  border-radius: 9px;
  background: #d63384;
  color: #fff;
  cursor: pointer;
}

.ao-go:hover { background: #bb2c73; }
.ao-go:disabled { background: #c9ced6; cursor: default; }

.ao-status { font-size: 12.5px; color: #6b7a87; }
.ao-status.ok { color: #178a52; font-weight: 600; }
.ao-status.bad { color: #c0392b; font-weight: 600; }
.ao-recap { margin-left: auto; font-size: 11.5px; color: #8a97a1; }

@media (max-width: 900px) {
  .ao-main { grid-template-columns: 1fr; }
  .ao-side { border-left: none; padding-left: 0; border-top: 1px solid #edf1f4; padding-top: 16px; }
  .ao-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ao-head { flex-direction: column; gap: 6px; }
  .ao-recap { margin-left: 0; width: 100%; }
}


.drawer-links { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.drawer-link-btn {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid #dde4ea;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #16223c;
  text-decoration: none;
  background: #fff;
}
.drawer-link-btn:hover { border-color: #16223c; }
