/* App-specific overlay on top of invus-theme.css
   - Auth pages (login, forgot, reset, callback)
   - Hub-page styles (Tool Selection)
   - Alert variants used by Flask flash/error messaging
*/

/* ----- Auth pages ----- */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--invus-space-5);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--color-accent-fill) 12%, transparent), transparent 28%),
    radial-gradient(circle at top left, color-mix(in srgb, var(--color-highlight) 24%, transparent), transparent 36%),
    var(--invus-color-bg);
}

.auth-card {
  width: min(100%, 420px);
  display: grid;
  gap: var(--invus-space-4);
  padding: var(--invus-space-6);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-lg);
  background: var(--invus-color-pure-white);
  box-shadow: var(--invus-shadow-md);
}

.auth-card--status {
  text-align: center;
  justify-items: center;
}

.auth-card__header {
  display: flex;
  gap: var(--invus-space-3);
  align-items: center;
}

.auth-card h1 {
  margin: 0;
  font-size: var(--invus-font-size-700);
}

.auth-card p {
  margin: 0;
  color: var(--invus-color-text-muted);
}

.auth-card label {
  display: grid;
  gap: 6px;
  font-weight: 500;
  color: var(--invus-color-text);
  font-size: var(--invus-font-size-200);
}

.auth-card input {
  width: 100%;
}

.auth-card__link {
  justify-self: center;
  color: var(--invus-color-link);
  text-decoration: none;
  font-size: var(--invus-font-size-200);
}

.auth-card__link:hover {
  text-decoration: underline;
}

/* Brand mark / wordmark used on auth + hub pages */
.brand__mark {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--color-highlight);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--invus-font-heading);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wordmark {
  display: inline-grid;
  place-items: center;
  height: 96px;
  width: 96px;
  border-radius: var(--invus-radius-lg);
  background: var(--color-header);
  color: var(--color-header-fg);
  font-family: var(--invus-font-heading);
  font-size: 36px;
  letter-spacing: -0.02em;
  box-shadow: var(--invus-shadow-md);
}

/* Alert variants layered onto Invus base alert */
.alert--error {
  background: var(--status-critical-bg);
  border-color: var(--status-critical-bg);
  border-left-color: var(--status-critical);
  color: var(--status-critical-fg);
}

.alert--success {
  background: var(--status-success-bg);
  border-color: var(--status-success-bg);
  border-left-color: var(--status-success);
  color: var(--status-success-fg);
}

.alert--info {
  background: var(--status-info-bg);
  border-color: var(--status-info-bg);
  border-left-color: var(--status-info);
  color: var(--status-info-fg);
}

/* Light spinner used by auth status card */
.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--invus-color-border);
  border-top-color: var(--color-accent-fill);
  border-radius: var(--radius-pill);
  animation: spin 1s linear infinite;
}

@keyframes skeletonPulse {
  0%, 100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* ----- Hub page (Tool Selection) ----- */
.hub-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--color-accent-fill) 12%, transparent), transparent 28%),
    radial-gradient(circle at top left, color-mix(in srgb, var(--color-highlight) 24%, transparent), transparent 36%),
    var(--invus-color-bg);
}

.hub-shell__container {
  min-height: 100vh;
  padding: var(--invus-space-6) 0 var(--invus-space-7);
}

.hub-welcome {
  margin-bottom: var(--invus-space-5);
}

.hub-copy {
  max-width: 70ch;
}

.hub-header {
  margin-bottom: var(--invus-space-6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--invus-space-4);
  align-items: center;
  padding: var(--invus-space-4) var(--invus-space-5);
  border: 0;
  border-top: 3px solid var(--color-header-rule);
  border-radius: var(--invus-radius-lg);
  background: var(--color-header);
  color: var(--color-header-fg);
  box-shadow: var(--invus-shadow-sm);
}

.hub-header h2 {
  color: var(--color-header-fg);
  margin: 2px 0 0;
}

.hub-header p {
  color: var(--color-header-muted);
  margin: 4px 0 0;
}

.hub-header small {
  opacity: 0.82;
}

.hub-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--invus-space-4);
  align-items: center;
}

.hub-header__brand {
  display: flex;
  align-items: center;
  gap: var(--invus-space-3);
}

.hub-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--invus-space-2);
  align-items: center;
}

.hub-header .btn--secondary,
.page-topbar .btn--secondary,
.store-dd-header .btn--secondary,
.np-header .btn--secondary,
.monitoring-header .btn--secondary {
  color: var(--color-header-fg);
  border-color: var(--color-header-border);
  background: transparent;
}

.hub-header .btn--secondary:hover,
.hub-header .btn--secondary:focus-visible,
.page-topbar .btn--secondary:hover,
.page-topbar .btn--secondary:focus-visible,
.store-dd-header .btn--secondary:hover,
.store-dd-header .btn--secondary:focus-visible,
.np-header .btn--secondary:hover,
.np-header .btn--secondary:focus-visible,
.monitoring-header .btn--secondary:hover,
.monitoring-header .btn--secondary:focus-visible {
  background: var(--color-header-overlay);
  border-color: var(--color-header-fg);
  color: var(--color-header-fg);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--invus-space-5);
  margin-top: var(--invus-space-5);
}

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

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

.tool-card {
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  border: 1px solid var(--invus-color-border);
  background: var(--invus-color-pure-white);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--invus-space-3);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--invus-shadow-lg);
  border-color: color-mix(in srgb, var(--invus-color-invus-cyan) 55%, var(--invus-color-border));
}

.tool-card--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: var(--invus-space-5);
}

.tool-card--wide .tool-card__icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
}

.tool-card--wide .tool-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--invus-space-2);
}

.tool-card--wide .tool-card-footer {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--invus-space-2);
}

.tool-card--disabled {
  cursor: default;
  opacity: 0.55;
  pointer-events: none;
}

.tool-card--disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--invus-color-border);
}

.tool-card__badge {
  align-self: flex-start;
  border-radius: 999px;
  border: 1px solid var(--invus-color-border);
  background: var(--invus-color-surface);
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-100);
  font-weight: 800;
  line-height: 1.2;
  padding: 4px 10px;
}

.tool-card h3 {
  margin: 0;
  color: var(--invus-color-invus-navy);
}

.tool-card .tool-card__desc {
  color: var(--invus-color-text-muted);
  margin: 0;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--invus-space-2);
  margin-top: var(--invus-space-2);
}

.feature-tag,
.tool-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--invus-color-border);
  background: var(--invus-color-surface);
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-100);
  font-weight: 500;
  line-height: 1.4;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--invus-space-3);
  margin-top: auto;
  padding-top: var(--invus-space-3);
}

.tool-card__cue {
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-200);
  font-weight: 700;
}

.tool-card--utility {
  border-style: dashed;
}

.tool-card__note {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-200);
  font-weight: 600;
  margin: calc(var(--invus-space-2) * -1) 0 0;
}

/* Section divider used between hub header and tool grid */
.section-divider {
  border-bottom: 1px solid var(--invus-color-border);
  margin: var(--invus-space-2) 0 var(--invus-space-3) 0;
}

/* ----- Sidebar tool page tweaks ----- */
.sidebar-title {
  margin: 0 0 var(--invus-space-4) 0;
  font-size: var(--invus-font-size-600);
}

.sidebar-block {
  display: grid;
  gap: var(--invus-space-2);
  margin-bottom: var(--invus-space-4);
}

.sidebar-block label {
  color: var(--invus-color-text-muted);
  font-size: 13px;
}

.page-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--invus-space-4);
  align-items: center;
  margin-bottom: var(--invus-space-5);
  padding: var(--invus-space-4) var(--invus-space-5);
  border: 0;
  border-top: 3px solid var(--color-header-rule);
  border-radius: var(--invus-radius-lg);
  background: var(--color-header);
  color: var(--color-header-fg);
  box-shadow: var(--invus-shadow-sm);
}

.page-container-padded {
  padding: var(--invus-space-6);
}

.page-topbar h2 {
  color: var(--color-header-fg);
}

.page-title-tight {
  margin: 4px 0 0;
}

.page-title-compact {
  margin-bottom: 4px;
}

.u-flush {
  margin: 0;
}

.page-topbar .text-muted {
  color: var(--color-header-muted);
}

.page-section + .page-section {
  margin-top: var(--invus-space-5);
}

/* ----- Store Deep-dive ----- */
.store-dd-page {
  padding: var(--invus-space-4) var(--invus-space-5) var(--invus-space-7);
  display: grid;
  gap: var(--invus-space-4);
  background: var(--invus-color-bg);
}

.store-dd-header {
  position: sticky;
  top: var(--invus-space-3);
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--invus-space-3);
  align-items: flex-end;
  padding: var(--invus-space-3) var(--invus-space-4);
  border-top: 3px solid var(--color-header-rule);
  border-radius: var(--invus-radius-lg);
  background: var(--color-header);
  color: var(--color-header-fg);
  box-shadow: var(--invus-shadow-sm);
}

.store-dd-header h2 {
  margin: 2px 0;
  color: var(--color-header-fg);
  font-size: var(--invus-font-size-600);
}

.store-dd-header .text-muted,
.store-dd-crumb {
  color: var(--color-header-muted);
}

.store-dd-home-link {
  margin-bottom: var(--invus-space-1);
}

.store-dd-header__meta {
  display: grid;
  gap: var(--invus-space-2);
  justify-items: end;
}

.store-dd-header-filters {
  flex: 1 1 100%;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--invus-space-3);
  padding-top: var(--invus-space-2);
  border-top: 1px solid var(--color-header-overlay-strong);
}

.store-dd-filter-group {
  display: grid;
  gap: var(--invus-space-2);
  align-items: end;
  min-width: 0;
}

.store-dd-filter-group--picker {
  flex: 1 1 auto;
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(240px, 1.4fr);
}

.store-dd-filter-group--benchmark {
  flex: 0 0 min(220px, 25vw);
  justify-self: end;
}

.store-dd-control {
  display: grid;
  gap: 4px;
  color: var(--color-header-muted);
  font-size: var(--invus-font-size-100);
  font-weight: 700;
}

.store-dd-control select,
.store-dd-control input {
  width: 100%;
  min-height: 32px;
  border-color: var(--color-header-border);
  background: var(--invus-color-pure-white);
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-200);
}

.store-dd-search-control {
  position: relative;
}

.store-dd-badges,
.store-dd-health,
.store-dd-jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--invus-space-2);
}

.store-dd-badges span,
.store-dd-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--invus-font-size-100);
  font-weight: 700;
}

.store-dd-badges span {
  background: var(--color-header-overlay);
  color: var(--color-header-fg);
}

.store-dd-pill {
  background: var(--status-info-bg);
  color: var(--status-info-fg);
}

.store-dd-pill--green {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
}

.store-dd-pill--red {
  background: var(--status-critical-bg);
  color: var(--status-critical-fg);
}

.store-dd-pill--gray {
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
}

.store-dd-jump {
  flex: 1 1 100%;
}

.store-dd-jump a {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-header-overlay);
  color: var(--color-header-fg);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--invus-font-size-100);
}

.store-dd-picker {
  display: grid;
  gap: var(--invus-space-3);
}

.store-dd-picker-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  display: none;
  gap: var(--invus-space-2);
  max-height: 360px;
  overflow: auto;
  padding: var(--invus-space-2);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--color-surface);
  box-shadow: var(--invus-shadow-lg);
  color: var(--color-text-secondary);
}

.store-dd-picker-list--open {
  display: grid;
}

.store-dd-picker-row {
  display: flex;
  justify-content: space-between;
  gap: var(--invus-space-3);
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
}

.store-dd-picker-row:hover {
  border-color: var(--color-accent-fill);
  background: var(--status-info-bg);
}

.store-dd-identity,
.store-dd-quality {
  display: flex;
  flex-wrap: wrap;
  gap: var(--invus-space-3);
}

.store-dd-identity > div,
.store-dd-quality span {
  padding: var(--invus-space-2) var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--color-surface-2);
}

.store-dd-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--invus-space-3);
  margin-top: var(--invus-space-3);
}

.store-dd-kpi {
  display: grid;
  gap: var(--invus-space-1);
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.store-dd-kpi small {
  color: var(--color-text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.store-dd-kpi strong {
  font-size: var(--invus-font-size-500);
}

.store-dd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--invus-space-4);
}

.store-dd-sales-primary {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 0.65fr);
  gap: var(--invus-space-4);
  align-items: stretch;
  margin-bottom: var(--invus-space-5);
}

.store-dd-sales-primary--wide {
  grid-template-columns: minmax(0, 1fr);
}

.store-dd-sales-secondary {
  padding-top: var(--invus-space-4);
  border-top: 1px solid var(--invus-color-border);
}

.store-dd-trend-card,
.store-dd-sssg-card {
  display: grid;
  gap: var(--invus-space-2);
}

.store-dd-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--invus-space-3);
  flex-wrap: wrap;
}

.store-dd-legend {
  display: inline-flex;
  align-items: center;
  gap: var(--invus-space-3);
  flex-wrap: wrap;
  font-size: var(--invus-font-size-100);
  color: var(--color-text-secondary);
}

.store-dd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.store-dd-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--chart-1);
}

.store-dd-legend-item--delivery i {
  background: var(--chart-2);
}

.store-dd-legend-item--catering-others i {
  background: var(--color-border-strong);
}

.store-dd-chart {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 160px;
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--color-surface-2);
}

.store-dd-chart span {
  position: relative;
  flex: 1 1 4px;
  min-width: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--chart-1);
}

.store-dd-chart--monthly {
  height: 260px;
  gap: var(--invus-space-2);
  padding: 42px var(--invus-space-3) 34px;
}

.store-dd-month {
  position: relative;
  flex: 1 1 34px;
  min-width: 34px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.store-dd-month > span {
  width: 100%;
  min-height: 8px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  background: transparent;
}

.store-dd-stack {
  display: block;
  width: 100%;
  min-height: 0;
  background: var(--chart-1);
}

.store-dd-stack--delivery {
  background: var(--chart-2);
}

.store-dd-stack--catering-others {
  background: var(--color-border-strong);
}

.store-dd-month > i {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  transform-origin: top center;
  white-space: nowrap;
  color: var(--color-text-secondary);
  font-style: normal;
  font-size: var(--invus-font-size-100);
}

.store-dd-sssg-bubble {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 42px;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  text-align: center;
  font-size: var(--invus-font-size-100);
  font-weight: 800;
  box-shadow: var(--invus-shadow-sm);
}

.store-dd-sssg-bubble--positive {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
}

.store-dd-sssg-bubble--negative {
  background: var(--status-critical-bg);
  color: var(--status-critical-fg);
}

.store-dd-sssg-body {
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--invus-space-2);
  padding: var(--invus-space-4);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--status-info-bg);
}

.store-dd-sssg-body strong {
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-800);
  line-height: 1;
}

.store-dd-sssg-body span,
.store-dd-sssg-body small {
  color: var(--status-info-fg);
  font-weight: 600;
}

.store-dd-econ-table th,
.store-dd-econ-table td {
  text-align: right;
}

.store-dd-econ-table th:first-child,
.store-dd-econ-table td:first-child {
  text-align: left;
}

.store-dd-bar {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 2fr auto;
  gap: var(--invus-space-2);
  align-items: center;
  margin: var(--invus-space-2) 0;
  font-size: var(--invus-font-size-200);
}

.store-dd-bar div {
  height: 12px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
}

.store-dd-bar i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--chart-1);
}

.store-dd-product-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--invus-space-3);
  margin-bottom: var(--invus-space-4);
}

.store-dd-product-summary article,
.store-dd-product-panel {
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.store-dd-product-summary article {
  display: grid;
  gap: 4px;
  padding: var(--invus-space-3);
}

.store-dd-product-summary small,
.store-dd-product-summary span,
.store-dd-product-panel .text-muted {
  color: var(--color-text-secondary);
  font-size: var(--invus-font-size-100);
}

.store-dd-product-summary small {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.store-dd-product-summary strong {
  font-size: var(--invus-font-size-500);
}

.store-dd-product-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: var(--invus-space-4);
  align-items: start;
}

.store-dd-product-panel {
  display: grid;
  gap: var(--invus-space-3);
  min-width: 0;
  padding: var(--invus-space-3);
}

.store-dd-product-panel--wide {
  overflow-x: auto;
}

.store-dd-product-toggle {
  display: inline-flex;
  width: fit-content;
  gap: 2px;
  margin-bottom: var(--invus-space-3);
  padding: 3px;
  border: 1px solid var(--invus-color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
}

.store-dd-product-toggle button {
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--invus-font-size-100);
  font-weight: 800;
  padding: 5px 12px;
}

.store-dd-product-toggle button[aria-pressed="true"] {
  background: var(--color-selected);
  color: var(--color-on-selected);
  box-shadow: var(--invus-shadow-sm);
}

.store-dd-product-table {
  margin-bottom: 0;
}

.store-dd-product-table th:nth-child(n+4),
.store-dd-product-table td:nth-child(n+4) {
  text-align: right;
}

.store-dd-product-share {
  display: grid;
  min-width: 86px;
  gap: 4px;
  justify-items: end;
}

.store-dd-product-share i {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
}

.store-dd-product-share b {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--chart-1);
}

.store-dd-sku-fallback {
  display: inline-flex;
  margin-left: var(--invus-space-1);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--status-warning-bg);
  color: var(--status-warning-fg);
  font-size: var(--invus-font-size-100);
  font-weight: 800;
}

.store-dd-product-category {
  grid-template-columns: minmax(90px, 1fr) 1.4fr auto;
}

.store-dd-product-category small {
  grid-column: 1 / -1;
  color: var(--color-text-secondary);
  font-size: var(--invus-font-size-100);
}

.store-dd-product-bar {
  display: grid;
  gap: var(--invus-space-1);
}

.store-dd-product-bar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--invus-space-2);
  font-size: var(--invus-font-size-200);
  font-weight: 800;
}

.store-dd-product-bar__track {
  height: 12px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
}

.store-dd-product-bar__track i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--chart-1);
}

.store-dd-product-bar small {
  color: var(--color-text-secondary);
  font-size: var(--invus-font-size-100);
}

.store-dd-note,
.store-dd-caveat {
  margin-top: var(--invus-space-3);
  padding: var(--invus-space-3);
  border-left: 3px solid var(--status-warning);
  border-radius: 0 var(--invus-radius-sm) var(--invus-radius-sm) 0;
  background: var(--status-warning-bg);
  color: var(--status-warning-fg);
  font-size: var(--invus-font-size-200);
  font-weight: 600;
}

.store-dd-note--neutral {
  border-left-color: var(--invus-color-border);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
}

.store-dd-op-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--invus-space-3);
}

.store-dd-op-card,
.store-dd-op-channel {
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.store-dd-op-card {
  display: grid;
  gap: 4px;
  padding: var(--invus-space-3);
}

.store-dd-op-card small,
.store-dd-op-channel small,
.store-dd-op-channel span {
  color: var(--color-text-secondary);
  font-size: var(--invus-font-size-100);
}

.store-dd-op-card strong {
  font-size: var(--invus-font-size-500);
}

.store-dd-op-section {
  margin-top: var(--invus-space-4);
}

.store-dd-op-channels {
  display: grid;
  gap: var(--invus-space-2);
}

.store-dd-speed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: var(--invus-space-3);
}

.store-dd-speed-panel {
  display: grid;
  gap: var(--invus-space-3);
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.store-dd-speed-panel__head {
  display: grid;
  gap: 2px;
}

.store-dd-speed-panel__head span,
.store-dd-speed-metrics small {
  color: var(--color-text-secondary);
  font-size: var(--invus-font-size-100);
}

.store-dd-speed-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--invus-space-2);
}

.store-dd-speed-metrics div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.store-dd-speed-metrics b {
  font-size: var(--invus-font-size-400);
}

.store-dd-op-channel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(3, minmax(90px, auto));
  gap: var(--invus-space-3);
  align-items: center;
  padding: var(--invus-space-3);
}

.store-dd-op-channel > div {
  display: grid;
  gap: 2px;
}

.store-dd-quality {
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-lg);
  background: var(--color-surface-2);
}

@media (max-width: 900px) {
  .store-dd-header-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .store-dd-filter-group--picker,
  .store-dd-sales-primary {
    grid-template-columns: 1fr;
  }

  .store-dd-filter-group--benchmark {
    flex-basis: auto;
  }

  .store-dd-op-channel {
    grid-template-columns: 1fr 1fr;
  }

  .store-dd-product-layout,
  .store-dd-speed-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- Network Pulse ----- */
.np-page {
  padding: var(--invus-space-5) var(--invus-space-6) var(--invus-space-7);
  display: grid;
  gap: var(--invus-space-5);
}

.np-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--invus-space-4);
  flex-wrap: wrap;
  background: var(--color-header);
  color: var(--color-header-fg);
  border: 0;
  border-top: 3px solid var(--color-header-rule);
  border-radius: var(--invus-radius-lg);
  box-shadow: var(--invus-shadow-sm);
  padding: var(--invus-space-4) var(--invus-space-5);
}

.np-header h2 {
  color: var(--color-header-fg);
}

.np-header small,
.np-header .text-muted {
  color: var(--color-header-muted);
}

.np-header__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--invus-space-2);
}

.header-export-btn {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-surface);
  padding: 8px 16px;
  border-radius: var(--invus-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-export-btn:hover {
  background-color: var(--color-surface-2);
  color: var(--color-text);
}

.header-export-btn:focus-visible {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px var(--focus-ring);
  outline: none;
}

.header-export-btn:disabled,
.header-export-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.np-export-status {
  margin: 0;
}

.np-header__stats {
  color: var(--color-header-muted);
  font-size: var(--invus-font-size-200);
  display: inline-flex;
  gap: var(--invus-space-2);
  align-items: center;
}

.np-header__sep {
  opacity: 0.6;
}

.np-header__banner {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-bg);
  border-left-color: var(--status-warning);
  color: var(--status-warning-fg);
}

.alert--warning {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-bg);
  border-left-color: var(--status-warning);
  color: var(--status-warning-fg);
}

.np-sidebar-filters {
  display: grid;
  gap: var(--invus-space-3);
}

.layout--sidebar .sidebar__body.np-sidebar-filters {
  padding-bottom: calc(12px + (var(--invus-btn-height) * 2) + 56px);
}

/* The apply/reset filter footer is taller (badge + 2 buttons) than the
   single-button footer .sidebar's base padding-bottom assumes, so without
   this the absolutely-positioned footer overlaps the scrollable filter list. */
.layout--sidebar .sidebar:has(.sidebar__footer.np-filter-actions) {
  padding-bottom: calc(12px + (var(--invus-btn-height) * 2) + 56px);
}

.np-filter-group {
  display: grid;
  gap: 6px;
}

.np-sidebar-filters .np-filter-group,
.np-sidebar-filters .multi-select-container,
.np-sidebar-filters select,
.np-sidebar-filters input {
  width: 100%;
  max-width: none;
}

.np-filter-group label {
  color: var(--invus-color-text-muted);
  font-size: 13px;
}

.np-filter-actions {
  display: flex;
  align-items: center;
  gap: var(--invus-space-2);
}

.np-sidebar-summary {
  gap: var(--invus-space-2);
}

.np-sidebar-note {
  padding-top: var(--invus-space-2);
  border-top: 1px solid var(--invus-color-border);
  font-size: var(--invus-font-size-200);
}

.layout--sidebar .sidebar__footer.np-filter-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--invus-space-2);
}

.layout--sidebar .sidebar__footer.np-filter-actions .btn {
  width: 100%;
  inline-size: 100%;
}

.layout--sidebar .sidebar__footer.np-filter-actions .btn--secondary {
  background: var(--invus-color-pure-white);
  color: var(--invus-color-invus-navy);
  border-color: var(--invus-color-border);
}

.layout--sidebar .sidebar__footer.np-filter-actions .btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.layout--sidebar .sidebar__footer.np-filter-actions .badge {
  justify-self: start;
}

/* ----- Network View map-first layout ----- */
.network-view {
  min-height: 100vh;
  display: grid;
  gap: var(--invus-space-4);
  padding: var(--invus-space-5);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--color-accent-fill) 10%, transparent), transparent 30%),
    var(--invus-color-bg);
}

.network-view__header {
  position: relative;
}

.network-view__back {
  justify-self: start;
  margin-bottom: 0;
}

.network-view__body {
  display: block;
  min-width: 0;
}

.network-view__sidebar {
  position: fixed;
  top: 132px;
  left: calc(var(--invus-space-5) + var(--invus-space-3));
  z-index: 650;
  width: min(260px, calc(100vw - 40px));
  display: grid;
  gap: var(--invus-space-3);
  max-height: calc(100vh - 156px);
  overflow: auto;
  padding: var(--invus-space-3);
  background: color-mix(in srgb, var(--invus-color-pure-white) 94%, transparent);
  backdrop-filter: blur(2px);
  box-shadow: var(--invus-shadow-lg);
}

.network-view__sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--invus-space-3);
}

.network-view__sidebar-head h3,
.network-view__sidebar-head p {
  margin: 0;
}

.network-view__sidebar-head h3 {
  margin-bottom: var(--invus-space-1);
}

.network-view__sidebar-body {
  display: grid;
  gap: var(--invus-space-3);
}

.network-view__sidebar-actions {
  display: grid;
  gap: var(--invus-space-3);
  padding-top: var(--invus-space-2);
  border-top: 1px solid var(--invus-color-border);
}

.network-view__control,
.network-view__control--model,
.network-view__sidebar .np-filter-group,
.network-view__sidebar .multi-select-container,
.network-view__sidebar select,
.network-view__sidebar input,
.network-view__sidebar-actions .btn {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.network-view__summary {
  padding: var(--invus-space-2) var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  background: var(--color-surface-2);
  font-size: var(--invus-font-size-200);
}

.network-view__main {
  min-width: 0;
  display: grid;
  gap: var(--invus-space-4);
}

.network-view__scrim {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: color-mix(in srgb, var(--invus-color-invus-navy) 38%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.network-view__scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.network-view__drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 2010;
  width: min(420px, calc(100vw - 32px));
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--invus-space-4);
  padding: var(--invus-space-5);
  border-left: 1px solid var(--invus-color-border);
  background: var(--invus-color-pure-white);
  box-shadow: var(--invus-shadow-lg);
  transform: translateX(100%);
  transition: transform 0.18s ease;
}

.network-view__drawer.is-open {
  transform: translateX(0);
}

.network-view__drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--invus-space-3);
}

.network-view__drawer-head h3,
.network-view__drawer-head p {
  margin: 0;
}

.network-view__drawer-head h3 {
  margin-bottom: var(--invus-space-1);
}

.network-view__drawer-body {
  display: grid;
  gap: var(--invus-space-3);
  overflow: auto;
  padding-bottom: var(--invus-space-5);
}

.network-view__drawer .np-filter-group,
.network-view__drawer .multi-select-container,
.network-view__drawer select,
.network-view__drawer input {
  width: 100%;
  max-width: none;
}

.network-view__drawer-note {
  padding-top: var(--invus-space-2);
  border-top: 1px solid var(--invus-color-border);
  font-size: var(--invus-font-size-200);
}

body.network-view-drawer-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .network-view__scrim,
  .network-view__drawer {
    transition: none;
  }
}

@media (max-width: 900px) {
  .network-view {
    padding: var(--invus-space-3);
  }

  .network-view__body {
    display: block;
  }

  .network-view__sidebar {
    position: static;
    width: auto;
    max-height: none;
    margin-bottom: var(--invus-space-4);
  }
}

.np-section {
  padding: var(--invus-space-5);
}

.np-section + .np-section {
  margin-top: 0;
}

.np-section__head,
.sssg-section-head,
.store-dd-section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--invus-space-4);
  margin-bottom: var(--invus-space-3);
  flex-wrap: wrap;
}

.np-section__head h3,
.np-section__head h4,
.sssg-section-head h3,
.sssg-section-head h4,
.store-dd-section-title-row h3,
.store-dd-section-title-row h4 {
  margin: 0;
}

.np-section__head p,
.sssg-section-head p,
.store-dd-section-title-row p {
  margin: 0;
}

.np-section__controls {
  display: inline-flex;
  align-items: center;
  gap: var(--invus-space-3);
  flex-wrap: wrap;
}

.np-reading-note {
  border-left: 3px solid var(--color-accent-fill);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  padding: var(--invus-space-3) var(--invus-space-4);
  margin-bottom: var(--invus-space-4);
}

.np-reading-note__label {
  color: var(--status-info-fg);
  font-size: var(--invus-font-size-200);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 var(--invus-space-1);
}

.np-reading-note p {
  color: var(--color-text-secondary);
  font-size: var(--invus-font-size-200);
  margin: 0;
}

.export-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  background: var(--invus-color-pure-white);
  color: var(--invus-color-invus-navy);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.export-icon-btn:hover {
  background: var(--color-surface-2);
  border-color: var(--color-accent);
}

.export-icon-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ----- Operations & Speed ----- */
.operations-table-wrap {
  overflow-x: auto;
  margin-top: var(--invus-space-3);
}

.operations-table-wrap .operations-num,
.operations-table-wrap th.operations-num {
  text-align: right;
}

.operations-gated {
  border: 1px dashed var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  padding: var(--invus-space-4);
  color: var(--invus-color-text-muted);
}

.operations-caveats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--invus-space-2);
  margin-top: var(--invus-space-3);
}

.operations-caveat {
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-pill);
  padding: var(--invus-space-1) var(--invus-space-3);
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-200);
}

.operations-heatmap-grid {
  overflow-x: auto;
  margin-top: var(--invus-space-3);
}

.operations-heatmap-grid table {
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 2px;
}

.operations-heatmap-grid th,
.operations-heatmap-grid td {
  text-align: center;
  white-space: nowrap;
}

.operations-heatmap-cell {
  min-width: 34px;
  border-radius: var(--invus-radius-sm);
  color: var(--invus-color-text);
  font-size: var(--invus-font-size-100);
}

.operations-heatmap-cell--empty { background: var(--color-surface-2); color: var(--invus-color-text-muted); }
.operations-heatmap-cell--q1 { background: var(--seq-1); }
.operations-heatmap-cell--q2 { background: var(--seq-2); }
.operations-heatmap-cell--q3 { background: var(--seq-3); }
.operations-heatmap-cell--q4 { background: var(--seq-4); }
.operations-heatmap-cell--q5 { background: var(--seq-5); }
.operations-heatmap-cell--q6 { background: var(--seq-6); color: var(--invus-color-pure-white); }
.operations-heatmap-cell--q7 { background: var(--seq-7); color: var(--invus-color-pure-white); }

.operations-legend {
  display: flex;
  align-items: center;
  gap: var(--invus-space-3);
  flex-wrap: wrap;
  margin-top: var(--invus-space-3);
  font-size: var(--invus-font-size-200);
}

.operations-legend__scale {
  display: inline-flex;
  gap: 2px;
}

.operations-legend__swatch {
  width: 22px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.operations-table-toggle {
  margin-left: auto;
}

.operations-kpi-strip-note {
  margin-top: var(--invus-space-2);
}

.np-section__notice {
  margin-top: var(--invus-space-3);
}

.np-control-label {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-200);
  font-weight: 600;
}

.np-select-inline {
  min-height: 32px;
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  padding: 0 var(--invus-space-3);
  background: var(--invus-color-pure-white);
}

.np-headline-takeaway {
  padding: var(--invus-space-3) var(--invus-space-4);
  border-radius: var(--invus-radius-md);
  background: var(--status-info-bg);
  color: var(--status-info-fg);
  font-weight: 500;
  line-height: 1.5;
}

.np-skeleton-block {
  color: var(--invus-color-text-muted);
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.np-headline-section {
  display: grid;
  gap: var(--invus-space-3);
}

.np-headline-header {
  margin-bottom: 0;
}

.np-headline-title {
  display: inline-flex;
  align-items: center;
  gap: var(--invus-space-2);
}

.ai-tag {
  display: inline-block;
  padding: 2px 8px;
  background-color: var(--status-info-bg);
  color: var(--status-info-fg);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: help;
}

.ai-tag[hidden] {
  display: none;
}

.np-headline-list {
  margin: 0;
  padding-left: 18px;
}

.np-headline-list li + li {
  margin-top: 4px;
}

/* Global loading spinner - lives in the sidebar-back row (base_sidebar.html)
 * so it's available on every page that extends it. `.sidebar__back` itself
 * is `position: absolute` (see invus-theme.css); this wrapper takes over
 * that exact positioning so the button's on-screen spot never moves, and
 * lays the button + spinner out side by side via flex. Hidden by default -
 * a page's JS opts in by calling ArgusDash.showLoadingIndicator()/
 * hideLoadingIndicator() (dashboard_common.js) around its fetch calls;
 * pages that never call it simply never show the spinner. */
.layout--sidebar .sidebar-back-row {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout--sidebar .sidebar-back-row .sidebar__back {
  position: static;
}

.global-loading-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--invus-color-border);
  border-top-color: var(--color-brand);
  animation: globalLoadingSpin 0.7s linear infinite;
}

/* `display: inline-block` above has the same specificity as the browser's
 * default `[hidden] { display: none }` rule, and wins the tie - so setting
 * el.hidden = true in JS was toggling the attribute correctly but never
 * actually hiding (or stopping the animation on) the element. This rule's
 * higher specificity restores the expected behavior. */
.global-loading-spinner[hidden] {
  display: none;
}

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

.np-pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  border-radius: var(--invus-radius-sm);
  overflow: hidden;
  border: 1px solid var(--invus-color-border);
  background: var(--color-surface);
  max-width: 100%;
}

.np-pill {
  height: 32px;
  padding: 0 var(--invus-space-3);
  border-radius: 0;
  border: none;
  background: var(--invus-color-pure-white);
  color: var(--invus-color-text);
  font-weight: 500;
  font-size: var(--invus-font-size-200);
}

.np-pill + .np-pill {
  border-left: 1px solid var(--invus-color-border);
}

.np-pill[aria-pressed="true"] {
  background: var(--color-selected);
  color: var(--color-on-selected);
}

.np-kpi-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: var(--invus-space-3);
}

@media (max-width: 1280px) {
  .np-kpi-strip { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
}

@media (max-width: 720px) {
  .np-kpi-strip { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

.np-kpi {
  position: relative;
  background: var(--invus-color-pure-white);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  padding: var(--invus-space-3) var(--invus-space-4);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--invus-shadow-sm);
}

.np-kpi--skeleton {
  pointer-events: none;
}

.np-skeleton-line {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface-2) 78%, var(--status-info-bg) 22%);
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.np-skeleton-line--short {
  width: 48%;
}

.np-skeleton-line--value {
  width: 70%;
  height: 22px;
  margin: var(--invus-space-1) 0;
}

.np-kpi__label {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-200);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.np-kpi__value {
  font-family: var(--invus-font-heading);
  font-size: var(--invus-font-size-600);
  color: var(--invus-color-invus-navy);
  line-height: 1.2;
}

.np-kpi__delta {
  font-size: var(--invus-font-size-200);
  font-weight: 600;
}

.np-kpi__delta--green { color: var(--delta-up); }
.np-kpi__delta--red { color: var(--delta-down); }
.np-kpi__delta--gray { color: var(--invus-color-text-muted); }

.np-kpi__note {
  font-size: var(--invus-font-size-100);
}

.np-kpi__sparkline {
  width: 100%;
  height: 22px;
  margin-top: auto;
}

.np-kpi__sparkline polyline {
  fill: none;
  stroke: var(--chart-6);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.np-kpi__tooltip {
  position: absolute;
  inset: auto auto calc(100% + 6px) 0;
  background: var(--invus-color-invus-navy);
  color: var(--invus-color-pure-white);
  padding: var(--invus-space-2) var(--invus-space-3);
  border-radius: var(--invus-radius-sm);
  font-size: var(--invus-font-size-100);
  max-width: 320px;
  white-space: normal;
  display: none;
  z-index: 60;
  box-shadow: var(--invus-shadow-md);
}

.np-kpi:hover .np-kpi__tooltip,
.np-kpi:focus-within .np-kpi__tooltip {
  display: block;
}

.np-chart-box {
  position: relative;
  height: 320px;
}

.np-chart-box--tall {
  height: 400px;
}

.np-grid-50 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--invus-space-5);
}

@media (max-width: 1100px) {
  .np-grid-50 { grid-template-columns: 1fr; }
}

.np-geo-section {
  position: relative;
}

.np-geo-layout {
  display: block;
}

.np-geo-map-wrap {
  position: relative;
  min-width: 0;
}

.np-geo-map {
  min-height: 680px;
  aspect-ratio: 5 / 4;
  width: 100%;
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  overflow: hidden;
  background: var(--color-surface-2);
}

.np-geo-map .leaflet-left {
  left: 280px;
}

.np-geo-fullscreen-btn {
  position: absolute;
  top: var(--invus-space-3);
  right: var(--invus-space-3);
  z-index: 500;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  border: 1px solid var(--invus-color-border);
  background: var(--invus-color-pure-white);
  color: var(--invus-color-invus-navy);
  border-radius: var(--invus-radius-sm);
  cursor: pointer;
  box-shadow: var(--invus-shadow-sm);
}

.np-geo-fullscreen-btn:hover {
  border-color: var(--invus-color-invus-cyan);
}

.np-geo-rank {
  position: fixed;
  top: 132px;
  right: calc(var(--invus-space-5) + var(--invus-space-3) + 44px);
  z-index: 650;
  width: 280px;
  max-height: calc(100vh - 156px);
  overflow: auto;
  padding: var(--invus-space-4);
  background: color-mix(in srgb, var(--invus-color-pure-white) 92%, transparent);
  backdrop-filter: blur(2px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.np-geo-rank h4 {
  margin: 0 0 var(--invus-space-3);
}

.np-geo-legend {
  position: fixed;
  left: calc(var(--invus-space-5) + var(--invus-space-3));
  bottom: var(--invus-space-5);
  z-index: 650;
  width: min(260px, calc(100vw - 40px));
  padding: var(--invus-space-3);
  background: color-mix(in srgb, var(--invus-color-pure-white) 94%, transparent);
  backdrop-filter: blur(2px);
  box-shadow: var(--invus-shadow-lg);
}

.np-geo-legend h4 {
  margin: 0 0 var(--invus-space-2);
}

.np-geo-legend__scale {
  display: grid;
  gap: var(--invus-space-1);
}

.np-geo-legend__scale span {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: var(--invus-space-2);
  color: var(--color-text-secondary);
  font-size: var(--invus-font-size-100);
}

.np-geo-legend__scale i {
  width: 28px;
  height: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.np-geo-rank__toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  border: 1px solid var(--invus-color-border);
  background: var(--invus-color-pure-white);
  color: var(--invus-color-invus-navy);
  border-radius: var(--invus-radius-sm);
  cursor: pointer;
}

.np-geo-rank__toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}

.np-geo-rank.is-collapsed {
  transform: translateX(calc(100% + var(--invus-space-3)));
  opacity: 0.95;
}

.np-geo-rank.is-collapsed .np-geo-rank__toggle {
  transform: translateX(-100%);
}

.np-geo-rank.is-collapsed .np-geo-rank__toggle-icon {
  transform: rotate(180deg);
}

.np-geo-top-list {
  display: flex;
  flex-direction: column;
  gap: var(--invus-space-2);
}

.np-geo-top-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  background: var(--invus-color-pure-white);
  color: var(--invus-color-text);
  text-align: left;
  cursor: pointer;
}

.np-geo-top-item:hover {
  border-color: var(--invus-color-invus-cyan);
  box-shadow: var(--invus-shadow-sm);
}

.np-geo-top-item span {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-200);
}

.np-geo-city-drill {
  position: fixed;
  right: calc(var(--invus-space-5) + var(--invus-space-3) + 44px);
  bottom: var(--invus-space-5);
  z-index: 650;
  width: 300px;
  max-height: min(360px, calc(100vh - 220px));
  overflow: auto;
  padding: var(--invus-space-4);
  background: color-mix(in srgb, var(--invus-color-pure-white) 94%, transparent);
  backdrop-filter: blur(2px);
}

.np-geo-city-drill h4 {
  margin: 0 0 var(--invus-space-3);
}

.np-geo-city-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  background: var(--invus-color-pure-white);
  color: var(--invus-color-text);
  text-align: left;
  cursor: pointer;
}

.np-geo-city-item + .np-geo-city-item {
  margin-top: var(--invus-space-2);
}

.np-geo-city-item:hover {
  border-color: var(--invus-color-invus-cyan);
  box-shadow: var(--invus-shadow-sm);
}

.np-geo-city-item span {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-200);
}

.np-geo-attribution {
  margin: var(--invus-space-3) 0 0;
  font-size: var(--invus-font-size-100);
}


.np-geo-quality {
  margin-top: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  padding: var(--invus-space-3);
  background: var(--invus-color-pure-white);
}

.np-geo-quality summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--invus-color-invus-navy);
}

.np-geo-quality p {
  margin: var(--invus-space-2) 0 0;
}

.np-geo-quality ul {
  margin: var(--invus-space-2) 0 0;
  padding-left: var(--invus-space-5);
}

.np-geo-dot {
  border: 1px solid var(--color-surface);
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--overlay-marker-outline);
}

.np-geo-dot--t1 { background: var(--seq-7); }
.np-geo-dot--t2 { background: var(--seq-5); }
.np-geo-dot--t3 { background: var(--seq-3); }
.np-geo-dot--unknown { background: var(--chart-8); }
.np-geo-dot--growth-up { background: var(--delta-up); }
.np-geo-dot--growth-down { background: var(--delta-down); }
.np-geo-dot--growth-neutral { background: var(--div-mid); }

.np-geo-dot--new {
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--delta-up);
}

.np-geo-dot--closed {
  opacity: 0.75;
  background: var(--chart-8);
  border-radius: 2px;
  transform: rotate(45deg);
}

.np-geo-dot--verified {
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-header);
}

.np-geo-dot--review {
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--status-warning-fg);
}

.np-geo-verified-badge {
  display: inline-block;
  margin-top: var(--invus-space-1);
  padding: 2px 6px;
  background: var(--status-info-bg);
  color: var(--status-info-fg);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.np-geo-review-badge {
  display: inline-block;
  margin-top: var(--invus-space-1);
  padding: 2px 6px;
  background: var(--status-warning-bg);
  color: var(--status-warning-fg);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.np-geo-popup-cta {
  margin-top: var(--invus-space-2);
  height: 28px;
  font-size: var(--invus-font-size-100);
}

/* Remove Leaflet's default focus outline that draws a bounding rectangle
   around clicked SVG state polygons. */
.leaflet-interactive:focus,
.leaflet-container .leaflet-interactive:focus {
  outline: none;
}

/* Fullscreen styles. Browser Fullscreen API uses :fullscreen; the in-page
   fallback class produces the same visual result on the section element. */
.np-geo-section:fullscreen,
.np-geo-section.is-fullscreen-fallback {
  position: fixed;
  inset: 0;
  margin: 0;
  border-radius: 0;
  z-index: 1000;
  background: var(--invus-color-pure-white);
  padding: var(--invus-space-3) var(--invus-space-4);
  display: flex;
  flex-direction: column;
}

.np-geo-section:fullscreen .np-geo-layout,
.np-geo-section.is-fullscreen-fallback .np-geo-layout,
.np-geo-section:fullscreen .np-geo-map-wrap,
.np-geo-section.is-fullscreen-fallback .np-geo-map-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.np-geo-section:fullscreen .np-geo-map,
.np-geo-section.is-fullscreen-fallback .np-geo-map {
  height: 100%;
  min-height: 0;
}

.np-geo-section:fullscreen .np-geo-rank,
.np-geo-section.is-fullscreen-fallback .np-geo-rank {
  position: absolute;
  top: var(--invus-space-3);
  right: calc(var(--invus-space-3) + 44px);
  max-height: calc(100% - var(--invus-space-3) * 2);
}

.np-geo-section:fullscreen .np-geo-legend,
.np-geo-section.is-fullscreen-fallback .np-geo-legend {
  position: absolute;
  left: var(--invus-space-3);
  bottom: var(--invus-space-3);
}

@media (max-width: 1100px) {
  .np-geo-rank {
    right: calc(var(--invus-space-3) + 44px);
    width: 240px;
  }
  .np-geo-map { min-height: 560px; }
}

@media (max-width: 900px) {
  .np-geo-rank {
    position: absolute;
    top: var(--invus-space-3);
    right: calc(var(--invus-space-3) + 44px);
    max-height: calc(100% - var(--invus-space-3) * 2);
  }

  .np-geo-legend {
    position: absolute;
    left: var(--invus-space-3);
    bottom: var(--invus-space-3);
  }

  .np-geo-map .leaflet-left {
    left: 0;
  }
}

.np-channel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--invus-space-3);
  align-items: stretch;
}

@media (max-width: 720px) {
  .np-channel-row { grid-template-columns: 1fr; }
}

.np-channel-legend {
  display: flex;
  flex-direction: column;
  gap: var(--invus-space-2);
  font-size: var(--invus-font-size-200);
  max-height: 320px;
  overflow: auto;
}

.np-channel-legend__item {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px dashed var(--invus-color-border);
}

.np-channel-legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.np-channel-legend__amount {
  color: var(--invus-color-text-muted);
  font-variant-numeric: tabular-nums;
}

.np-channel-legend__delta {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.np-channel-legend__delta--green { color: var(--delta-up); }
.np-channel-legend__delta--red { color: var(--delta-down); }
.np-channel-legend__delta--gray { color: var(--invus-color-text-muted); }

.np-channel-total {
  margin-top: var(--invus-space-2);
  font-weight: 600;
  color: var(--invus-color-invus-navy);
}

.np-table-wrapper {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  background: var(--invus-color-neutral-0);
}

.np-leaderboard {
  min-width: 1180px;
}

.np-leaderboard__row {
  cursor: pointer;
}

.np-leaderboard__row:hover td {
  background: var(--invus-color-light-cyan);
}

.np-leaderboard-loading td {
  padding: var(--invus-space-4);
}

.np-leaderboard-loading .np-skeleton-line {
  width: min(260px, 60%);
  margin-bottom: var(--invus-space-2);
}

.np-cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.np-cell-compact {
  width: 1%;
  white-space: nowrap;
}

.np-metric-cell {
  font-weight: 600;
}

.np-metric-cell--strong { background: var(--metric-heat-pos-bg); color: var(--metric-heat-pos-fg); }
.np-metric-cell--mid { background: var(--metric-heat-mid-bg); color: var(--metric-heat-mid-fg); }
.np-metric-cell--weak { background: var(--metric-heat-neg-bg); color: var(--metric-heat-neg-fg); }
.np-metric-cell--neutral { background: transparent; color: var(--invus-color-text-muted); }

.np-rank-watch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.np-delta {
  font-weight: 600;
  text-align: right;
}

.np-delta--green { color: var(--delta-up); }
.np-delta--red { color: var(--delta-down); }
.np-delta--gray { color: var(--invus-color-text-muted); }

.np-kpi--link {
  cursor: pointer;
}

.np-kpi--link:hover,
.np-kpi--link:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
  outline: none;
}

.np-watch-button {
  border: 1px solid transparent;
  border-radius: var(--invus-radius-sm);
  background: transparent;
  color: var(--invus-color-invus-navy);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.np-watch-button:hover,
.np-watch-button:focus-visible {
  border-color: var(--color-accent);
  background: var(--status-info-bg);
  outline: none;
}

.np-segmentation-summary {
  margin-bottom: var(--invus-space-3);
  font-size: var(--invus-font-size-200);
}

/* SSSG Discovery */
.sssg-dashboard {
  padding: var(--invus-space-6);
  max-width: 1480px;
}

.sssg-data-pill {
  align-self: center;
  background: var(--invus-color-light-champagne);
  color: var(--invus-color-invus-navy);
  border-color: var(--invus-color-champagne);
}

.period-preset-select {
  min-height: 36px;
  padding: 0 var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  background: var(--invus-color-pure-white);
  color: var(--invus-color-invus-navy);
  font: inherit;
}

.sssg-header-window-control,
.sssg-mode-control {
  display: inline-grid;
  grid-template-columns: auto minmax(190px, 240px) auto;
  align-items: center;
  gap: var(--invus-space-2);
  margin-top: var(--invus-space-3);
}

.sssg-mode-control {
  margin-left: var(--invus-space-3);
}

.sssg-header-window-control label,
.sssg-mode-control label {
  color: var(--color-header-fg);
  font-size: var(--invus-font-size-200);
  font-weight: 700;
}

.sssg-welcome {
  border-left: 4px solid var(--invus-color-invus-cyan);
}

.sssg-sidebar-nav {
  display: grid;
  gap: var(--invus-space-2);
  margin-bottom: var(--invus-space-4);
}

.sssg-sidebar-nav .btn {
  justify-content: flex-start;
  width: 100%;
}

.sssg-method-card p,
.sssg-sidebar-note {
  font-size: var(--invus-font-size-200);
}

.sssg-funnel {
  display: grid;
  gap: var(--invus-space-2);
}

.sssg-funnel-stage {
  display: grid;
  gap: 4px;
}

.sssg-funnel-stage__label {
  display: flex;
  justify-content: space-between;
  gap: var(--invus-space-2);
  font-size: var(--invus-font-size-200);
}

.sssg-funnel-stage__label strong {
  color: var(--invus-color-invus-navy);
}

.sssg-funnel-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--invus-color-light-grey);
}

.sssg-funnel-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-header), var(--color-accent-fill));
}

.sssg-funnel-stage small {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-100);
  line-height: 1.25;
}

.sssg-legend-card {
  display: grid;
  gap: var(--invus-space-2);
}

.sssg-legend-row {
  display: flex;
  align-items: center;
  gap: var(--invus-space-2);
  font-size: var(--invus-font-size-200);
}

.sssg-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  flex: 0 0 auto;
}

.sssg-swatch--positive { background: var(--div-pos-1); }
.sssg-swatch--negative { background: var(--div-neg-1); }
.sssg-swatch--neutral { background: var(--div-mid); }
.sssg-swatch--na { background: var(--color-surface); }

.sssg-summary-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.4fr);
  gap: var(--invus-space-4);
  align-items: stretch;
}

.sssg-kpi-stack {
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--invus-space-4);
}

.sssg-secondary-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--invus-space-4);
}

.sssg-kpi-card,
.sssg-matrix-card,
.sssg-section {
  background: var(--invus-color-pure-white);
  padding: var(--invus-space-4);
  box-shadow: var(--invus-shadow-sm);
}

.sssg-kpi-card {
  display: grid;
  align-content: start;
  gap: var(--invus-space-2);
  min-height: 0;
}

.sssg-kpi-card--primary {
  border-left: 4px solid var(--invus-color-invus-cyan);
}

.sssg-card-label {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-100);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sssg-kpi-value {
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-800);
  font-weight: 800;
  line-height: 1;
}

.sssg-kpi-card:not(.sssg-kpi-card--primary) .sssg-kpi-value {
  font-size: var(--invus-font-size-700);
}

.sssg-skeleton {
  color: transparent;
  border-radius: var(--invus-radius-sm);
  background: color-mix(in srgb, var(--color-surface-2) 78%, var(--status-info-bg) 22%);
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.sssg-kpi-meta,
.sssg-kpi-submeta {
  font-size: var(--invus-font-size-200);
}

.sssg-finding {
  margin: 0;
  padding: var(--invus-space-2) var(--invus-space-3);
  border-left: 3px solid var(--invus-color-invus-cyan);
  border-radius: var(--invus-radius-sm);
  background: var(--invus-color-light-cyan);
  color: var(--invus-color-invus-navy);
}

.sssg-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--invus-space-3);
  margin-bottom: var(--invus-space-4);
}

.sssg-section-head h3 {
  margin: 0;
}

.sssg-anomaly-callout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--invus-space-4);
  background: var(--invus-color-pure-white);
  padding: var(--invus-space-4);
  box-shadow: var(--invus-shadow-sm);
}

.sssg-anomaly-callout h3 {
  margin: 0 0 var(--invus-space-3);
}

.sssg-anomaly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--invus-space-3);
  width: 100%;
  margin-bottom: var(--invus-space-2);
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sssg-anomaly-row small {
  display: block;
  color: currentColor;
  opacity: 0.72;
}

.sssg-anomaly-row b {
  font-size: var(--invus-font-size-400);
}

.sssg-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: var(--invus-space-2);
  margin-top: var(--invus-space-3);
}

.sssg-matrix-cell,
.sssg-heatmap-cell {
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.sssg-matrix-cell:hover,
.sssg-matrix-cell:focus,
.sssg-heatmap-cell:hover,
.sssg-heatmap-cell:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
  outline: none;
}

.sssg-matrix-cell:hover,
.sssg-matrix-cell:focus {
  transform: translateY(-1px);
}

.sssg-matrix-cell {
  display: grid;
  gap: 4px;
  min-height: 96px;
  padding: var(--invus-space-3);
  box-shadow: inset 0 0 0 1px var(--overlay-cell-inset);
}

.sssg-matrix-label {
  color: currentColor;
  font-weight: 700;
}

.sssg-matrix-cell strong {
  font-size: var(--invus-font-size-600);
  color: currentColor;
}

.sssg-marginals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--invus-space-3);
  margin-top: var(--invus-space-3);
  padding-top: var(--invus-space-3);
  border-top: 1px solid var(--invus-color-border);
}

.sssg-marginal-group {
  display: grid;
  gap: var(--invus-space-2);
}

.sssg-marginal-group > strong {
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-200);
}

.sssg-marginal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: var(--invus-space-2);
}

.sssg-marginal-card {
  display: grid;
  gap: 3px;
  min-height: 76px;
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--overlay-cell-inset);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.sssg-marginal-card:hover,
.sssg-marginal-card:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--focus-ring), inset 0 0 0 1px var(--overlay-cell-inset);
  outline: none;
  transform: translateY(-1px);
}

.sssg-marginal-card span {
  color: currentColor;
  font-weight: 700;
}

.sssg-marginal-card strong {
  color: currentColor;
  font-size: var(--invus-font-size-500);
}

.sssg-marginal-card small {
  color: currentColor;
  opacity: 0.78;
  font-size: var(--invus-font-size-100);
}

.sssg-heatmap {
  overflow-x: auto;
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--invus-color-pure-white);
}

.sssg-loading-state {
  padding: var(--invus-space-4);
  color: var(--invus-color-text-muted);
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.sssg-heatmap-grid {
  display: grid;
  gap: 1px;
  min-width: 1040px;
  background: var(--invus-color-border);
}

.sssg-heatmap-header,
.sssg-heatmap-row-header,
.sssg-heatmap-cell {
  padding: 11px 12px;
  background: var(--invus-color-pure-white);
}

.sssg-heatmap-header {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-100);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sssg-heatmap-row-header {
  position: sticky;
  left: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 78px;
  align-items: center;
  gap: var(--invus-space-2);
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-200);
  font-weight: 700;
}

.sssg-heatmap-grid > .sssg-heatmap-header:first-child {
  left: 0;
  z-index: 3;
}

.sssg-heatmap-cell {
  min-height: 64px;
}

.sssg-heatmap-cell strong,
.sssg-heatmap-cell small {
  display: block;
}

.sssg-heatmap-cell strong {
  font-size: var(--invus-font-size-400);
}

.sssg-heatmap-cell small,
.sssg-matrix-cell small {
  color: currentColor;
  opacity: 0.82;
  font-size: var(--invus-font-size-100);
}

.sssg-sparkline {
  width: 72px;
  height: 24px;
}

.sssg-sparkline polyline {
  fill: none;
  stroke: var(--invus-color-invus-cyan);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.sssg-cell--positive {
  background: var(--div-pos-1);
  color: var(--div-pos-fg);
}

.sssg-cell--negative {
  background: var(--div-neg-1);
  color: var(--div-neg-fg);
}

.sssg-cell--neutral {
  background: var(--div-mid);
  color: var(--div-mid-fg);
}

.sssg-cell--na {
  background: var(--color-surface);
  color: var(--invus-color-text-muted);
}

.sssg-hover-card {
  position: fixed;
  z-index: 3000;
  width: min(360px, calc(100vw - 24px));
  pointer-events: auto;
  padding: var(--invus-space-4);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--invus-color-pure-white);
  box-shadow: var(--invus-shadow-lg);
}

.sssg-hover-card__title {
  display: flex;
  justify-content: space-between;
  gap: var(--invus-space-3);
  margin-bottom: var(--invus-space-2);
  color: var(--invus-color-invus-navy);
}

.sssg-hover-card__metric {
  font-size: var(--invus-font-size-600);
  font-weight: 800;
  color: var(--invus-color-invus-navy);
}

.sssg-hover-card__metric small,
.sssg-hover-card__revenue {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-200);
  font-weight: 400;
}

.sssg-hover-mini-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--invus-space-2);
  margin-top: var(--invus-space-3);
}

.sssg-hover-mini-cell {
  display: grid;
  gap: 2px;
  padding: var(--invus-space-2);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  font-size: var(--invus-font-size-100);
}

.sssg-hover-mini-cell strong {
  font-size: var(--invus-font-size-300);
}

.sssg-drilldown-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3100;
  pointer-events: none;
  background: transparent;
}

.sssg-drilldown-backdrop[hidden],
.sssg-drilldown-panel[hidden] {
  display: none !important;
}

.sssg-drilldown-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3101;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(760px, calc(100vw - 80px));
  min-width: 520px;
  height: 100vh;
  background: var(--invus-color-pure-white);
  box-shadow: var(--invus-shadow-lg);
}

.sssg-drilldown-head {
  display: flex;
  justify-content: space-between;
  gap: var(--invus-space-3);
  padding: var(--invus-space-5);
  border-bottom: 1px solid var(--invus-color-border);
}

.sssg-drilldown-head h3 {
  margin: 0 0 var(--invus-space-1);
  color: var(--invus-color-invus-navy);
}

.sssg-drilldown-body {
  display: grid;
  align-content: start;
  gap: var(--invus-space-4);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--invus-space-5);
}

.sssg-drilldown-card {
  display: grid;
  gap: var(--invus-space-3);
  padding: var(--invus-space-4);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-md);
  background: var(--invus-color-light-grey);
}

.sssg-drilldown-card h4 {
  margin: 0;
  color: var(--invus-color-invus-navy);
}

.sssg-drilldown-note {
  margin: 0;
  font-size: var(--invus-font-size-100);
}

.sssg-decomp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--invus-space-3);
}

.sssg-decomp-grid div {
  display: grid;
  gap: 4px;
  padding: var(--invus-space-3);
  border: 1px solid var(--invus-color-border);
  border-radius: var(--invus-radius-sm);
  background: var(--invus-color-pure-white);
}

.sssg-decomp-grid span {
  color: var(--invus-color-text-muted);
  font-size: var(--invus-font-size-100);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sssg-decomp-grid strong {
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-500);
}

.sssg-drilldown-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--invus-color-pure-white);
  font-size: var(--invus-font-size-200);
}

.sssg-drilldown-table th:nth-child(2),
.sssg-drilldown-table td:nth-child(2) {
  width: 80px;
}

.sssg-drilldown-table th:nth-child(3),
.sssg-drilldown-table td:nth-child(3) {
  width: 120px;
}

.sssg-drilldown-table th:nth-child(4),
.sssg-drilldown-table td:nth-child(4) {
  width: 120px;
}

.sssg-drilldown-table th,
.sssg-drilldown-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--invus-color-border);
  text-align: left;
  vertical-align: top;
}

.sssg-drilldown-table th {
  color: var(--invus-color-invus-navy);
  font-size: var(--invus-font-size-100);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sssg-drilldown-store--included {
  background: var(--status-success-bg);
}

.sssg-drilldown-store--included td:first-child {
  border-left: 4px solid var(--status-success);
}

.sssg-drilldown-store--excluded {
  background: var(--color-surface-2);
  color: var(--invus-color-text-muted);
}

.sssg-drilldown-store--excluded td:first-child {
  border-left: 4px solid var(--invus-color-border);
}

.sssg-drilldown-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--status-info-bg);
  font-size: var(--invus-font-size-100);
  font-weight: 700;
}

.sssg-drilldown-store--included .sssg-drilldown-status {
  color: var(--status-success-fg);
  background: var(--status-success-bg);
}

.sssg-drilldown-table small {
  display: block;
  color: var(--invus-color-text-muted);
}

.sssg-footer {
  max-width: 90ch;
  padding-bottom: var(--invus-space-6);
}

@media (max-width: 1180px) {
  .sssg-summary-grid {
    grid-template-columns: 1fr;
  }

  .sssg-matrix-card {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .sssg-dashboard {
    padding: var(--invus-space-5);
  }

  .sssg-summary-grid,
  .sssg-secondary-kpis,
  .sssg-marginals,
  .sssg-anomaly-callout {
    grid-template-columns: 1fr;
  }

  .sssg-matrix-card {
    grid-column: span 1;
  }

  .sssg-header-window-control {
    grid-template-columns: 1fr;
  }

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

  .sssg-drilldown-panel {
    width: 100vw;
    min-width: 0;
  }
}

