/* Shared dashboard base styles — used by app and by docs/wireframes. Border/colour tokens aligned with design-system.css. */
:root {
  --font-tabular: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", "Liberation Mono", monospace;
  --color-brand-pink: #E60085;
  --color-brand-grey: #454554;
  --color-bg: #FFFFFF;
  --color-bg-subtle: #F5F5F7;
  --color-bg-subtle-lighter: #FAFAFA;
  --color-landlord-moto: #006068;
  --color-landlord-welcome-break: #2f3339;
  --color-landlord-roadchef: #B82E33;
  --color-landlord-extra: #fec31e;
  --color-extra-text: #2C405A;
  /* Borders (align with Map Visualiser / design-system) */
  --color-border-light: rgba(69, 69, 84, 0.2);
  --color-border-medium: rgba(69, 69, 84, 0.25);
  --color-border-subtle: rgba(69, 69, 84, 0.12);
  --color-border-inner: rgba(69, 69, 84, 0.1);
  --color-border-divider: rgba(69, 69, 84, 0.08);
  --color-border-muted: rgba(69, 69, 84, 0.15);
  --color-border-dashed: rgba(69, 69, 84, 0.3);
  /* Fills and overlays (grey family for hovers, placeholders, charts) */
  --color-fill-hover: rgba(69, 69, 84, 0.06);
  --color-fill-subtle: rgba(69, 69, 84, 0.08);
  --color-fill-muted: rgba(69, 69, 84, 0.12);
  --color-fill-medium: rgba(69, 69, 84, 0.2);
  --color-fill-strong: rgba(69, 69, 84, 0.25);
  --color-chart-last-year: rgba(69, 69, 84, 0.3);
  --color-legend-neutral: rgba(69, 69, 84, 0.35);
  --color-shadow-muted: rgba(69, 69, 84, 0.15);
  /* Page background (slightly darker than panel; use --color-bg-subtle for a lighter page) */
  --color-page-bg: #ECECEE;
  /* Live Vehicles bar colours (derived from brand pink for consistency) */
  --color-vehicle-bar: var(--color-brand-pink);
  --color-vehicle-bar-dim: rgba(230, 0, 133, 0.45);
  --color-vehicle-bar-other: rgba(230, 0, 133, 0.28);
  /* Site header (i-media website style: dark bar, white logo & nav) */
  --color-header-bg: #151519;
  --color-header-text: #FFFFFF;
  --color-header-text-muted: rgba(255, 255, 255, 0.85);
  --color-header-border: rgba(255, 255, 255, 0.08);
  /* Error state (e.g. API error banner) */
  --color-error-bg: #f8d7da;
  --color-error-text: #721c24;
  /* Shadows */
  --shadow-tooltip: 0 2px 8px rgba(0, 0, 0, 0.2);
  /* Z-index scale */
  --z-base: 0;
  --z-tooltip: 10;
  /* 8pt grid spacing (4, 8, 12, 16, 24, 32, 40, 48) — design-system.css adds full set */
  --space-40: 40px;
  --space-48: 48px;
}
* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--color-brand-grey);
  background: var(--color-page-bg);
  margin: 0;
  padding: 0;
}

/* Page header (i-media website style: #151519 bar, white logo & nav, Talk to us CTA) */
.dashboard-header {
  position: relative;
  background: var(--color-header-bg);
  margin: 0;
  padding: 0 var(--space-lg, 24px);
  border-bottom: none;
}
.dashboard-header-inner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: var(--space-md, 16px);
}
.dashboard-header-brand {
  display: flex;
  align-items: center;
  gap: 24px;
  align-self: stretch;
}
.dashboard-header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.dashboard-header-logo {
  display: flex;
  align-items: center;
  color: #FFF;
  text-decoration: none;
}
.dashboard-header-logo:hover {
  color: var(--color-header-text-muted);
}
.dashboard-header-logo-img {
  height: 16px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}
.dashboard-header-logo:hover .dashboard-header-logo-img {
  opacity: 0.85;
}
.dashboard-header-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #FFF;
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm, 4px);
  transition: color var(--transition-fast, 0.15s ease), background var(--transition-fast, 0.15s ease);
}
.dashboard-header-menu-btn:hover {
  color: var(--color-header-text);
  background: rgba(255, 255, 255, 0.08);
}
.dashboard-header-menu-btn:focus-visible {
  outline: 2px solid var(--color-brand-pink);
  outline-offset: 2px;
}
.dashboard-header-nav {
  display: flex;
  align-items: center;
  height: 56px;
  gap: var(--space-xl, 32px);
}
.dashboard-header-link {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-md, 14px);
  font-weight: 400;
  color: #BBBCBF;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  height: 100%;
  transition: color var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease);
}
.dashboard-header-link:hover {
  color: var(--color-header-text);
}
.dashboard-header-link-icon {
  margin-right: var(--space-xs, 6px);
  font-size: 0.85em;
}
.dashboard-header-link.is-title {
  color: #FFF;
  font-weight: 600;
  align-items: center;
  display: inline-flex;
  min-height: 56px;
  box-sizing: border-box;
  border: none;
  padding: 0;
}
.dashboard-header-link.is-title:hover {
  color: #FFF;
}
.dashboard-header-link.is-current {
  color: var(--color-header-text);
  font-weight: 600;
  border-bottom-color: var(--color-header-text);
}
.dashboard-header-link.is-disabled {
  cursor: not-allowed;
  opacity: 0.8;
}
.dashboard-header-link.is-disabled:hover {
  color: #BBBCBF;
}
.dashboard-header-link:focus-visible {
  outline: 2px solid var(--color-brand-pink);
  outline-offset: 2px;
}
.dashboard-header-link.is-disabled:focus-visible {
  outline: none;
}
.dashboard-header-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: var(--space-sm, 8px) 16px;
  font-size: var(--font-size-md, 14px);
  font-weight: var(--font-weight-medium, 500);
  color: #FFF;
  background: var(--color-brand-pink);
  border: 2px solid var(--color-brand-pink);
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast, 0.15s ease), background var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease);
}
.dashboard-header-cta:hover {
  color: var(--color-brand-pink);
  background: #FFF;
  border-color: #FFF;
}
.dashboard-header-cta:focus-visible {
  outline: 2px solid #FFF;
  outline-offset: 2px;
}
.wireframe-label {
  font-size: var(--font-size-xs, 10px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-brand-grey);
  margin-bottom: var(--space-xs, 4px);
}
.audience-bar {
  margin-bottom: 0px;
}
/* Right side of detail zone: full-width controls row */
.detail-zone-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-md, 16px);
  width: 100%;
  min-width: 0;
}
.detail-zone-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
.detail-zone-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md, 16px);
  width: 100%;
  min-height: 40px;
  flex-wrap: wrap;
}
.detail-zone-controls-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md, 16px);
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
}
.detail-zone-controls-left .timeline-scrubber {
  flex-shrink: 0;
}
.detail-zone-controls-left .granularity-tag-group {
  flex-shrink: 0;
}
.detail-zone-controls-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md, 16px);
  flex-shrink: 0;
}
.detail-zone-controls-row .granularity-tag-group {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
}
.detail-zone-controls-row .granularity-tag-group .pill.active {
  background: unset;
  box-shadow: none;
  color: var(--color-brand-grey);
  font-weight: 600;
}
.detail-zone-controls-row .granularity-tag-group .pill.active:hover:not(.locked) {
  background: unset;
  box-shadow: none;
}
.audience-bar-row {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md, 16px);
}
.dashboard-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--color-brand-grey, #454554);
  text-decoration: none;
}
.dashboard-logo:hover {
  color: var(--color-brand-grey, #454554);
}
.dashboard-logo-img {
  height: 16px;
  width: auto;
  display: block;
}
.dashboard-logo--on-visual {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  padding: 20px;
  color: #fff;
}
.dashboard-logo--on-visual:hover {
  color: #fff;
}
.detail-zone-header {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs, 4px);
}
.detail-zone-header .detail-zone-description {
  margin-bottom: 0;
  max-width: 100%;
}
.detail-zone-headline {
  margin: 0 0 var(--space-xs, 4px);
  font-size: 1.5rem;
  font-weight: 600;
  color: #000000;
  line-height: 1.2;
}
.detail-zone-title {
  margin: 0;
  font-size: var(--font-size-lg, 16px);
  font-weight: 600;
  color: #000000;
}
.detail-zone-description {
  font-size: var(--font-size-md, 14px);
  color: var(--color-text-secondary, var(--color-brand-grey));
  margin: 0 0 var(--space-md, 16px);
  max-width: 60em;
}
.audience-bar .wireframe-label { margin-bottom: var(--space-sm, 8px); }
.audience-bar-row .detail-view-toggle {
  flex-shrink: 0;
}
.detail-download-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg, 6px);
  color: var(--color-brand-grey);
  cursor: pointer;
}
.detail-download-btn:hover:not(:disabled) {
  background: var(--color-fill-hover);
}
.detail-download-btn:disabled {
  background: var(--color-bg-subtle);
  opacity: 0.8;
  cursor: not-allowed;
}
/* .detail-view-toggle and .granularity-tag-group share design-system .marker-style-toggle styles (design-system.css) */
.pills { display: flex; flex-wrap: wrap; gap: var(--space-sm, 8px); align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-sm, 8px) var(--space-12, 12px);
  border-radius: 999px;
  font-size: var(--font-size-sm, 12px);
  border: 1px solid var(--color-border-medium);
  background: var(--color-bg);
  color: var(--color-brand-grey);
  cursor: pointer;
}
.pill.active {
  background: var(--color-brand-grey);
  color: white;
  border-color: var(--color-brand-grey);
}
.pill.locked { opacity: 0.6; cursor: not-allowed; }
.date-and-view-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md, 16px);
  margin-bottom: var(--space-sm, 8px);
}
.date-and-view-row-right {
  display: flex;
  align-items: center;
  gap: var(--space-md, 16px);
}
.chart-insight-row-title {
  margin: 0;
  flex: 0 0 auto;
}
.chart-legend-below {
  margin-top: var(--space-sm, 8px);
  margin-bottom: 0;
}
.chart-area { margin-bottom: var(--space-md, 16px); }

/* Global tab group: shared style for granularity (Day/Week/…) and detail view (Live Vehicles/EPOS/…). Use .tab-group on the container. No rounded corners; no stroke on active pill. */
.tab-group,
.granularity-tag-group,
.detail-view-toggle {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  height: 40px;
  min-height: 40px;
  margin-bottom: 0;
  padding: 0;
  border: 1px solid var(--color-border-light);
  border-radius: 0;
  overflow: hidden;
  width: fit-content;
  box-sizing: border-box;
  background: var(--color-bg-subtle);
}
.granularity-tag-group {
  border-radius: var(--radius-lg, 6px);
}
.detail-view-toggle {
  border-radius: var(--radius-lg, 6px);
}
.tab-group .pill,
.granularity-tag-group .pill,
.detail-view-toggle .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 var(--space-12, 12px);
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--color-border-light);
  font-size: var(--font-size-sm, 12px);
  line-height: 1;
  box-sizing: border-box;
}
.tab-group .pill:last-child,
.granularity-tag-group .pill:last-child,
.detail-view-toggle .pill:last-child {
  border-right: none;
}
.tab-group .pill:first-child,
.granularity-tag-group .pill:first-child,
.detail-view-toggle .pill:first-child {
  border-radius: 0;
}
.tab-group .pill:last-child,
.granularity-tag-group .pill:last-child,
.detail-view-toggle .pill:last-child {
  border-radius: 0;
}
.tab-group .pill.active,
.granularity-tag-group .pill.active,
.detail-view-toggle .pill.active {
  background: #fff;
  color: var(--color-brand-grey);
  font-weight: 600;
  border: none;
  border-right: none;
  box-shadow: none;
}
.tab-group .pill.locked,
.granularity-tag-group .pill.locked,
.detail-view-toggle .pill.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.date-and-view-row .view-toggle {
  border-radius: 0;
  border-left: none;
}
.date-and-view-row .view-toggle .pill:first-child,
.date-and-view-row .view-toggle .pill:last-child {
  border-radius: 0;
}
.chart-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-md, 16px);
  margin-bottom: 0;
}
.chart-kpi {
  flex: 0 0 auto;
  width: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  border: none;
}
.chart-kpi .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-brand-grey);
  line-height: 1.2;
}
.chart-kpi .label {
  font-size: 0.75rem;
  color: var(--color-brand-grey);
  margin-top: var(--space-xs, 4px);
}
.chart-area.chart-area-fill {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.summary-zone {
  padding-bottom: var(--space-lg, 24px);
  margin-bottom: var(--space-lg, 24px);
  border-bottom: 1px solid var(--color-border-subtle);
  background: none;
}
.summary-zone .wireframe-label {
  margin-bottom: var(--space-sm, 8px);
}
.hero {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.hero-kpi { text-align: center; }
.hero-kpi .value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-brand-grey);
  line-height: 1.2;
}
.hero-kpi .label {
  font-size: 0.875rem;
  color: var(--color-brand-grey);
  margin-top: 4px;
}
.hero-kpi.ev-headline .value { font-size: 1.25rem; }
.forecast-toggle { display: flex; gap: var(--space-sm, 8px); margin-bottom: var(--space-12, 12px); font-size: var(--font-size-sm, 12px); }
.forecast-toggle span {
  padding: var(--space-sm, 8px) var(--space-12, 12px);
  border-radius: var(--radius-lg, 6px);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
}
.forecast-toggle span.active {
  background: var(--color-brand-pink);
  color: white;
  border-color: var(--color-brand-pink);
}
.area-chart {
  height: 180px;
  background: linear-gradient(180deg, rgba(230,0,133,0.15) 0%, rgba(230,0,133,0.02) 100%);
  border: 1px solid rgba(230,0,133,0.6);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.area-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.area-chart.forecast-extension { border-style: dashed; }
.area-chart.forecast-extension svg path:last-of-type { stroke-dasharray: 6 4; }

/* Weekly bar chart (this year vs last year) + timeline slider */
.weekly-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
  margin-bottom: 4px;
}
.weekly-bars .week-col {
  flex: 1;
  min-width: 2px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 1px;
}
.weekly-bars .week-bar {
  flex: 0 0 auto;
  width: 100%;
  min-height: 3px;
  border-radius: 1px 1px 0 0;
}
.weekly-bars .week-bar.last-year { background: var(--color-chart-last-year); }
.weekly-bars .week-bar.this-year { background: rgba(230,0,133,0.4); }
.weekly-bars .week-bar.this-year.current-week { background: var(--color-brand-pink); }
.weekly-bars .week-bar.this-year.future { background: var(--color-fill-subtle); }
/* Fallback when .week-bar is direct child (no .week-col) */
.weekly-bars > .week-bar { flex: 1; min-width: 2px; }

.weekly-bars-wrap {
  position: relative;
  margin-bottom: 0;
  padding-bottom: 2px;
}
.timeline-scrubber {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  width: fit-content;
  min-width: min-content;
  height: var(--space-40, 40px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg, 6px);
  overflow: hidden;
  background: var(--color-bg);
}
.scrubber-arrow {
  flex: 0 0 auto;
  width: 32px;
  height: var(--space-40, 40px);
  min-height: var(--space-40, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-brand-grey);
  background: var(--color-bg);
  border: none;
  cursor: pointer;
}
.scrubber-arrow.scrubber-prev { border-radius: 6px 0 0 6px; }
.scrubber-arrow.scrubber-next { border-radius: 0 6px 6px 0; border-left: 1px solid var(--color-border-inner); }
.scrubber-arrow:hover:not(.disabled):not(:disabled) { background: var(--color-fill-hover); }
.scrubber-arrow.disabled,
.scrubber-arrow:disabled {
  background: var(--color-bg-subtle);
  opacity: 0.8;
  cursor: not-allowed;
}
.scrubber-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm, 8px);
  flex: 0 0 auto;
  min-width: 0;
  width: max-content;
  padding: 0 var(--space-md, 16px);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-brand-grey);
  white-space: nowrap;
  background: var(--color-bg);
  border: none;
  border-left: 1px solid var(--color-border-inner);
  user-select: none;
}
#scrubber-date {
  font-size: 12px;
  white-space: nowrap;
}
.timeline-date {
  margin: var(--space-sm, 8px) 0 0 0;
  font-size: var(--font-size-sm, 12px);
  font-weight: 600;
  color: var(--color-brand-grey);
}

.view-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  margin-left: 16px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg, 6px);
  overflow: hidden;
  width: fit-content;
}
.view-toggle .pill {
  border-radius: 0;
  border: none;
  margin: 0;
}
.view-toggle .pill:first-child,
.view-toggle .pill:last-child { border-radius: 0; }
.view-toggle .pill:not(:first-child) { border-left: 1px solid var(--color-border-light); }

/* Reusable key/legend: swatch + label per item. Use .key, .key-item, .key-swatch + modifier. */
.key,
.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-12, 12px);
  margin-top: 0;
  margin-bottom: 0;
  font-size: var(--font-size-sm, 12px);
  color: var(--color-brand-grey);
}
.key-item,
.chart-legend .legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
}
.key-swatch,
.chart-legend .legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-xs, 2px);
  flex-shrink: 0;
}
/* Key swatch modifiers (use on .key-swatch) */
.key-swatch--selected,
.key-swatch--pink,
.chart-legend .legend-selected,
.chart-legend .legend-pink { background: var(--color-brand-pink); }
.key-swatch--this-year,
.chart-legend .legend-this-year { background: rgba(230, 0, 133, 0.4); }
.key-swatch--last-year,
.key-swatch--grey,
.chart-legend .legend-last-year,
.chart-legend .legend-grey { background: var(--color-legend-neutral); }
.key-swatch--average,
.chart-legend .legend-average {
  width: 20px;
  height: 0;
  border: none;
  border-bottom: 2px dashed var(--color-brand-grey);
  border-radius: 0;
  vertical-align: middle;
}
.key-swatch--updating { background: var(--color-vehicle-bar); }
.key-swatch--other { background: var(--color-vehicle-bar-other); }

/* App: API error banner */
.api-error-banner {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  padding: var(--space-12, 12px) var(--space-md, 16px);
  margin: 0;
  font-size: var(--font-size-md, 14px);
}
.api-error-banner .api-error-hint {
  margin: var(--space-sm, 8px) 0 0;
  font-size: var(--font-size-sm, 12px);
}
.api-error-banner code {
  background: rgba(0, 0, 0, 0.08);
  padding: var(--space-xs, 4px) var(--space-sm, 8px);
  border-radius: var(--radius-md, 4px);
}

/* App: chart tooltip */
.chart-tooltip {
  position: absolute;
  z-index: var(--z-tooltip);
  background: var(--color-brand-grey);
  color: #fff;
  padding: var(--space-sm, 8px) var(--space-md, 16px);
  border-radius: var(--radius-lg, 6px);
  font-size: var(--font-size-sm, 12px);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-tooltip);
}

/* Lite version: hover tooltip for locked/disabled controls */
.lite-version-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  background: var(--color-brand-grey);
  color: #fff;
  padding: var(--space-sm, 8px) var(--space-md, 16px);
  border-radius: var(--radius-lg, 6px);
  font-size: var(--font-size-sm, 12px);
  font-weight: var(--font-weight-regular);
  pointer-events: none;
  white-space: normal;
  max-width: 240px;
  text-align: center;
  box-shadow: var(--shadow-tooltip);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.lite-version-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

/* App: chart insight title margin */
.chart-insight {
  margin: 0 0 var(--space-sm, 8px);
}
.chart-insight-row-title {
  font-weight: 600;
}

/* App: weekly bars interaction and average line */
.weekly-bars-wrap {
  position: relative;
}
.weekly-bars .week-bar {
  border: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  border-radius: 2px;
  transition: background var(--transition-fast, 0.15s ease);
}
.weekly-bars .week-bar:hover {
  background: var(--color-brand-pink);
}
.weekly-bars .week-bar:focus {
  outline: none;
}
.weekly-bars .week-bar.current-week {
  background: var(--color-brand-pink);
}
.vehicles-live-label {
  margin: 0 0 var(--space-12, 12px);
  font-size: var(--font-size-sm, 12px);
  color: var(--color-text-secondary, var(--color-brand-grey));
}
/* Live data chip: matches timeline-scrubber (same border, height, background) */
.vehicles-live-chip {
  display: inline-flex;
  align-items: center;
  height: var(--space-40, 40px);
  padding: 0 var(--space-md, 16px);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg, 6px);
  background: var(--color-bg);
  font-size: var(--font-size-sm, 12px);
  font-weight: 600;
  color: var(--color-brand-grey);
}
.vehicles-live-chip .vehicles-live-status-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm, 8px);
}
.vehicles-live-chip .vehicles-live-timestamp {
  font-variant-numeric: tabular-nums;
}
.vehicles-live-timestamp {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.chart-average-line-wrap {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.chart-average-line {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-view-cumulative .wireframe-label { margin-bottom: var(--space-sm, 8px); }

.slider-row { display: flex; align-items: center; gap: var(--space-md, 16px); margin-top: var(--space-12, 12px); }
.slider-row label { font-size: var(--font-size-sm, 12px); min-width: 160px; }
input[type="range"] { flex: 1; accent-color: var(--color-brand-pink); height: 8px; }

.detail-zone {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 0px;
  padding: 24px;
  border-radius: var(--radius-xl, 8px);
  background: var(--color-bg-subtle);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.detail-zone .wireframe-label { margin-bottom: var(--space-sm, 8px); }
.detail-zone.forecast-mode .landlord-bar .seg,
.detail-zone.forecast-mode .site-bar,
.detail-zone.forecast-mode .product-bar,
.detail-zone.forecast-mode .subcat-bar { opacity: 0.6; }
.detail-zone.forecast-mode .landlord-bar,
.detail-zone.forecast-mode .epos-box { border: 2px dashed var(--color-border-dashed); }
.forecast-badge {
  font-size: 11px;
  color: var(--color-brand-grey);
  margin-bottom: 8px;
}
.landlord-bar {
  display: flex;
  width: 100%;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 0 0 2px white;
  gap: 2px;
  background: white;
}
.landlord-bar .seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.landlord-bar .seg.extra { color: var(--color-extra-text); }
.landlord-bar .seg.moto { background: var(--color-landlord-moto); }
.landlord-bar .seg.wb { background: var(--color-landlord-welcome-break); }
.landlord-bar .seg.roadchef { background: var(--color-landlord-roadchef); }
.landlord-bar .seg.extra { background: var(--color-landlord-extra); }

.epos-panel {
  display: flex;
  gap: 0;
  min-height: 360px;
  margin-bottom: 24px;
}
/* Generic detail-panel layout (audience index, etc.) — same structure as epos-panel */
.detail-panel-layout {
  display: flex;
  gap: 0;
  min-height: 360px;
  margin-bottom: 24px;
}
.epos-box {
  padding: var(--space-lg, 24px);
}
.epos-sites-box {
  flex: 1;
  min-width: 240px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-xl, 8px) 0 0 var(--radius-xl, 8px);
}
.epos-subcat-products-box {
  flex: 2;
  min-width: 0;
  display: flex;
  background: var(--color-bg-subtle-lighter);
  border-radius: 0 var(--radius-xl, 8px) var(--radius-xl, 8px) 0;
}
.epos-subcat-products-box .epos-col {
  flex: 1;
  min-width: 0;
}
.epos-subcat-products-box .epos-col:first-child {
  padding-right: 24px;
  margin-right: 0;
  border-right: 1px solid var(--color-border-light);
}
.epos-subcat-products-box .epos-col:last-child {
  flex: 1.2;
  padding-left: 24px;
}

/* Audience index layout: no padding, background or borders */
.audience-index-layout.detail-panel-layout {
  flex-direction: column;
  gap: var(--space-md, 16px);
  padding: 0;
  background: none;
  border: none;
}
.audience-index-panel-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12, 12px);
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.audience-index-panel-header .audience-segment-select {
  width: auto;
  min-width: 200px;
  margin-bottom: 0;
}
/* Use marker-style-toggle (design-system) for look; smaller so 8 segments fit in one row */
.audience-segment-toggle.marker-style-toggle {
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
  padding: var(--space-xs, 4px);
}
.audience-segment-toggle.marker-style-toggle .pill {
  height: 24px;
  padding: 0 var(--space-sm, 8px);
  font-size: var(--font-size-xs, 10px);
  line-height: 12px;
}
.audience-index-panel-header .audience-index-chart-toggle.marker-style-toggle {
  flex-shrink: 0;
  padding: var(--space-xs, 4px);
}
.audience-index-chart-toggle.marker-style-toggle .pill {
  height: 24px;
  padding: 0 var(--space-sm, 8px);
  font-size: var(--font-size-xs, 10px);
  line-height: 12px;
}
.audience-index-panel-body {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  gap: var(--space-md, 16px);
}
/* Persistent card: always visible (Tornado and Beeswarm) */
.audience-index-card-persistent {
  flex: 0 0 200px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  min-height: 0;
}
.audience-index-tornado-view {
  display: flex;
  flex: 1;
  min-width: 0;
}
.audience-index-layout[data-chart="beeswarm"] .audience-index-tornado-view {
  display: none;
}
.audience-index-beeswarm-view {
  display: none;
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.audience-index-layout[data-chart="beeswarm"] .audience-index-beeswarm-view {
  display: flex;
}
.beeswarm-chart-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.beeswarm-chart-img {
  max-width: 100%;
  height: auto;
  display: block;
}
.beeswarm-placeholder {
  width: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-fill-subtle);
  border-radius: var(--radius-xl, 8px);
  font-size: var(--font-size-md, 14px);
  color: var(--color-text-secondary, #666);
}
/* Fake hover balloon (tooltip) on beeswarm */
.beeswarm-tooltip {
  position: absolute;
  top: 10%;
  right: 10%;
  padding: var(--space-sm, 8px) var(--space-md, 16px);
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl, 8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  font-size: var(--font-size-sm, 12px);
  color: var(--color-brand-grey);
  min-width: 100px;
  line-height: 1.4;
}
.beeswarm-tooltip::before {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 24px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
  filter: drop-shadow(0 1px 1px var(--color-shadow-muted));
}
.beeswarm-tooltip::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 23px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid var(--color-border-light);
}
.beeswarm-tooltip-index {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #2d8a4e;
}
.beeswarm-tooltip-value {
  display: block;
  font-variant-numeric: tabular-nums;
}
.beeswarm-tooltip-site {
  display: block;
  font-weight: 600;
  margin-top: 2px;
}

/* Unified tornado chart: one row = site (left) | tornado bar (middle) | value (right) */
.audience-index-tornado-chart {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.audience-index-tornado-chart-body {
  display: flex;
  flex-direction: column;
}
.audience-index-tornado-row {
  display: flex;
  align-items: center;
  gap: var(--space-12, 12px);
  min-height: var(--space-40, 40px);
  padding: var(--space-sm, 8px) 0;
  border-bottom: 1px solid var(--color-border-divider);
  box-sizing: border-box;
  cursor: default;
  transition: background 0.15s ease;
}
.audience-index-tornado-row:hover {
  background: var(--color-fill-hover);
}
.audience-index-tornado-row .audience-index-tornado-site {
  min-width: 120px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, var(--color-brand-grey));
}
.audience-index-tornado-row .audience-index-tornado-bar-wrap {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  height: 20px;
}
.audience-index-tornado-bar-track {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 16px;
}
.audience-index-tornado-bar-left,
.audience-index-tornado-bar-right {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}
.audience-index-tornado-bar-left { justify-content: flex-end; }
.audience-index-tornado-bar-right { justify-content: flex-start; }
.audience-index-tornado-bar-center {
  width: 2px;
  height: 100%;
  background: var(--color-brand-grey);
  opacity: 0.4;
  flex-shrink: 0;
}
.audience-index-tornado-bar-negative {
  height: 14px;
  max-width: 100%;
  border-radius: 0;
  background: #B82E33;
  opacity: 0.85;
}
.audience-index-tornado-bar-positive {
  height: 14px;
  max-width: 100%;
  border-radius: 0;
  background: #2d8a4e;
}
.audience-index-tornado-row .audience-index-tornado-value {
  flex-shrink: 0;
  min-width: 64px;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-brand-grey);
}
.audience-index-tornado-other {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-secondary, #666);
}
.audience-index-tornado-loading {
  margin: 0;
  padding: 16px 0;
  font-size: 13px;
  color: var(--color-text-secondary, #666);
}

/* Tornado view layout */
.audience-index-layout .audience-index-tornado-view {
  flex: 1;
  min-width: 0;
}
.audience-segment-select {
  width: 100%;
  margin-bottom: var(--space-12, 12px);
  padding: var(--space-sm, 8px) var(--space-sm, 8px);
  font-size: var(--font-size-sm, 12px);
  border-radius: var(--radius-lg, 6px);
  border: 1px solid var(--color-border-medium);
}

.epos-col h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px 0;
  color: var(--color-brand-grey);
}
.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-heading-row h3 {
  margin: 0;
}
.epos-col .heading-link {
  font-size: 12px;
  color: var(--color-brand-pink);
  text-decoration: none;
  white-space: nowrap;
}
.epos-col .heading-link:hover {
  text-decoration: underline;
}
.epos-col .order-by {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.epos-col .order-by-label {
  font-size: 13px;
  color: var(--color-brand-grey);
  flex-shrink: 0;
}
.epos-col .order-by select {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.epos-col select {
  width: 100%;
  padding: var(--space-sm, 8px) var(--space-md, 16px);
  margin-bottom: var(--space-12, 12px);
  font-size: var(--font-size-sm, 12px);
  border-radius: var(--radius-lg, 6px);
  border: 1px solid var(--color-border-medium);
}
/* Detail panel column (audience index, etc.) — same typography as epos-col */
.detail-panel-col h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px 0;
  color: var(--color-brand-grey);
}
.detail-panel-col .heading-link {
  font-size: 12px;
  color: var(--color-brand-pink);
  text-decoration: none;
  white-space: nowrap;
}
.detail-panel-col .heading-link:hover {
  text-decoration: underline;
}
.detail-panel-col .footer-note {
  font-size: 11px;
  color: var(--color-brand-grey);
  margin-top: 12px;
}
/* Shared bar row layout: label + bar + value (sites, subcategories, products). Use .bar-row for new instances. */
.bar-row,
.site-row,
.subcat-row,
.product-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: var(--space-sm, 8px) 0;
  font-size: var(--font-size-sm, 12px);
  border-bottom: 1px solid var(--color-border-divider);
}
.site-row input,
.subcat-row input {
  margin: 0;
}
/* Bar row: fixed-width label (ellipsis) */
.site-row .site-name,
.subcat-row .subcat-name,
.product-row .product-name {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Bar row: bar area (flex) */
.site-row .site-bar-wrap,
.subcat-row .subcat-bar-wrap,
.product-row .product-bar-wrap {
  flex: 1;
  min-width: 60px;
  display: flex;
  align-items: center;
}
/* Bar row: fixed-width value (tabular, right-align) */
.site-row .site-value,
.subcat-row .subcat-value,
.product-row .product-value {
  width: 5em;
  min-width: 5em;
  flex-shrink: 0;
  font-family: var(--font-tabular);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.product-row .product-rank {
  width: 24px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--color-brand-grey);
  opacity: 0.8;
}
.epos-panel .subcat-bar--pink { background: var(--color-brand-pink); }
.epos-loading, .epos-error, .epos-empty { font-size: 13px; color: var(--color-brand-grey); margin: 8px 0; }
.epos-error { color: #721c24; }

/* Vehicle leaderboard (on-site vehicles panel): brand (name + icon) + bar + value */
.vehicle-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: 8px;
  font-size: 13px;
  border-width: 0;
  transition: opacity 0.25s ease-out, background 0.2s ease;
  position: relative;
  z-index: 1;
  border-radius: var(--radius-md, 4px);
  margin: 0;
}
.vehicle-row--animate-in {
  opacity: 0;
}
.vehicle-row-brand {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 130px;
  width: 130px;
  flex-shrink: 0;
  gap: var(--space-sm, 8px);
}
.vehicle-row-brand .vehicle-name {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-md, 14px);
  font-weight: 500;
  text-align: right;
}
.vehicle-row-brand .vehicle-icon,
.vehicle-row-brand .vehicle-icon-placeholder {
  flex-shrink: 0;
}
.vehicle-row .vehicle-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  /* Match icon colour to label (--color-brand-grey #454554) */
  filter: brightness(0) saturate(100%) invert(27%) sepia(12%) saturate(1200%) hue-rotate(220deg) brightness(92%) contrast(88%);
}
.vehicle-row .vehicle-bar-wrap {
  flex: 1;
  min-width: 80px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
}
.vehicle-row .vehicle-value {
  flex-shrink: 0;
  margin-left: var(--space-sm, 8px);
  padding: 0 16px 0 12px;
  border-radius: var(--radius-md, 4px);
  font-size: var(--font-size-md, 14px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  transition: background 0.2s ease;
  position: relative;
  z-index: 2;
  vertical-align: middle;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Count hugs content; percentage column below keeps alignment */
.vehicle-row .vehicle-value-count {
  font-weight: 600;
}
/* Fixed-width percentage column, smaller type, so percentages align and compare independently */
.vehicle-row .vehicle-value-pct {
  font-size: 0.7em;
  font-weight: 400;
  opacity: 0.6;
  min-width: 4.25em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}
.vehicle-bar { height: 32px; border-radius: 0 4px 4px 0; min-width: 40px; background: var(--color-vehicle-bar); transition: width 0.4s ease-out, background 0.25s ease, filter 0.2s ease; position: relative; z-index: 10; }
/* Value cell that is rolling up: subtle “live” highlight so the eye is drawn to what’s changing */
.vehicle-row .vehicle-value.vehicle-value--updating {
  background: var(--color-bg-subtle);
}
/* Skeleton/loading state: ghosted small bars and values until live data loads */
.vehicle-row--skeleton .vehicle-bar,
.vehicle-bar.vehicle-bar--skeleton {
  background: var(--color-fill-medium);
  opacity: 0.7;
}
.vehicle-row--skeleton .vehicle-value {
  opacity: 0.5;
}

/* "All other" / summary row: no icon, no bar, last in list; total on the right, label unchanged */
.vehicle-row-other {
  border-top: none;
  margin-top: 0;
  padding-top: var(--space-sm, 8px);
}
.vehicle-row-other .vehicle-icon-placeholder {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: block;
}
.vehicle-row-other .vehicle-bar-wrap--no-bar {
  min-height: 0;
  height: 0;
  overflow: hidden;
}
.vehicle-row-other .vehicle-value {
  font-weight: 600;
}

.vehicles-chart-descriptor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md, 16px);
  margin-bottom: var(--space-md, 12px);
  padding: 0 16px;
}
.vehicles-leaderboard-inner .vehicles-chart-descriptor {
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--color-text-secondary, #555);
  line-height: 1.4;
}
.vehicles-chart-descriptor-row .vehicles-live-chip {
  flex-shrink: 0;
}

.vehicles-leaderboard.epos-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 360px;
  margin-bottom: 0;
  border-radius: var(--radius-xl, 8px);
  background: var(--color-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.vehicles-leaderboard-inner {
  position: relative;
  flex: 2;
  min-width: 0;
  padding: var(--space-lg, 24px) var(--space-sm, 8px);
  border-radius: var(--radius-xl, 8px) 0 0 var(--radius-xl, 8px);
  overflow: hidden;
}
.vehicles-leaderboard-rows {
  position: relative;
  z-index: 1;
  isolation: isolate;
  padding-left: var(--space-sm, 8px);
  padding-right: var(--space-sm, 8px);
}
.vehicles-leaderboard-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.vehicle-turn-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-vehicle-bar);
  transition: left 1.5s ease-out, top 1.5s ease-out;
  will-change: left, top;
}

.vehicles-live-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12, 12px);
  padding-left: var(--space-md, 16px);
  padding-right: var(--space-md, 16px);
}
.vehicles-leaderboard-key {
  margin-top: var(--space-md, 16px);
  margin-bottom: 0;
  justify-content: flex-end;
  padding-left: var(--space-md, 16px);
  padding-right: var(--space-md, 16px);
}
/* Vehicles live label: uses .key component for the key row */
.vehicles-live-key {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12, 12px);
  font-size: var(--font-size-sm, 12px);
  color: var(--color-text-secondary, #666);
}
.vehicles-live-key .key-item { gap: var(--space-sm, 8px); }
.vehicles-live-key .key-swatch--updating { background: var(--color-vehicle-bar); }
.vehicles-live-key .key-swatch--other { background: var(--color-vehicle-bar-other); }

/* Digital indicator (live-data pulse dot) — from i-Media Map Visualiser */
.vehicles-live-label .digital-indicator,
.vehicles-live-chip .digital-indicator {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--color-accent-green, #4CAF50);
  border-radius: 50%;
  border: 1.5px solid var(--color-bg, #fff);
  box-shadow: 0 0 0 0 var(--color-accent-green, #4CAF50);
}
.vehicles-live-label .digital-indicator::before,
.vehicles-live-label .digital-indicator::after,
.vehicles-live-chip .digital-indicator::before,
.vehicles-live-chip .digital-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--color-accent-green, #4CAF50);
  opacity: 0;
}
.vehicles-live-label .digital-indicator::before,
.vehicles-live-chip .digital-indicator::before {
  animation: vehicles-pulse-ring 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.vehicles-live-label .digital-indicator::after,
.vehicles-live-chip .digital-indicator::after {
  animation: vehicles-pulse-ring 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite 1.25s;
}
@keyframes vehicles-pulse-ring {
  0% { width: 8px; height: 8px; opacity: 0; }
  10% { opacity: 0.6; }
  100% { width: 20px; height: 20px; opacity: 0; }
}

/* Fetch indicator: flashes while request in progress, fades out when done */
/* Fetch icon: always slightly visible when inactive (so you can see it’s there), full + flash when fetching */
.vehicles-fetch-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-sm, 8px);
  min-width: 14px;
  min-height: 14px;
  opacity: 0.35;
  transition: opacity var(--transition-normal, 0.2s ease);
  color: var(--color-brand-grey);
  pointer-events: none;
  flex-shrink: 0;
}
.vehicles-fetch-indicator .vehicles-fetch-icon {
  display: block;
  width: 14px;
  height: 14px;
}
.vehicles-fetch-indicator--active {
  opacity: 1;
  color: var(--color-accent-green, #4CAF50);
  animation: vehicles-fetch-flash 0.7s ease-in-out infinite;
}
@keyframes vehicles-fetch-flash {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.vehicles-leaderboard-visual {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
}
.vehicles-leaderboard-visual-crop {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 0 8px 8px 0;
  background: var(--color-bg-subtle);
}
.vehicles-leaderboard-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.vehicles-billboard-current { transform: translateX(0); }
.vehicles-billboard-next { transform: translateX(-100%); }
.vehicles-leaderboard-visual-crop.vehicles-billboard-advancing .vehicles-billboard-current { transform: translateX(100%); }
.vehicles-leaderboard-visual-crop.vehicles-billboard-advancing .vehicles-billboard-next { transform: translateX(0); }
.vehicles-leaderboard-visual-crop.vehicles-billboard-reset .vehicles-leaderboard-visual-img { transition: none; }

/* Overlay card on billboard image (bottom) */
.billboard-overlay-card {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  padding: 16px 24px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 220px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2);
}
.billboard-overlay-card-label {
  color: var(--Pink-Playful-pink, #E60085);
  font-family: Poppins, sans-serif;
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  line-height: 150%;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.billboard-overlay-card-value {
  color: var(--Grey-Media-grey, #454554);
  font-family: Poppins, sans-serif;
  font-size: 40px;
  font-style: normal;
  font-weight: 500;
  line-height: 100%;
  height: 40px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}
.billboard-overlay-card-desc {
  color: var(--grey-80-on-white, #6A6A76);
  font-family: Poppins, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 150%;
  white-space: nowrap;
}
.vehicles-leaderboard-title { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--color-brand-grey); }
.vehicles-leaderboard-summary {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--color-brand-grey);
  line-height: 1.4;
}
.vehicles-leaderboard-loading,
.vehicles-leaderboard-empty,
.vehicles-leaderboard-error {
  margin: 0;
  padding: 12px 0;
  font-size: 14px;
  color: var(--color-brand-grey);
}
.vehicles-leaderboard-error { color: #721c24; }
.vehicles-leaderboard-footer { margin-top: 12px; }

.site-row.disabled { opacity: 0.4; pointer-events: none; }
.site-bar, .product-bar, .subcat-bar { height: 20px; border-radius: 4px; min-width: 40px; }
.site-bar.moto { background: var(--color-landlord-moto); }
.site-bar.wb { background: var(--color-landlord-welcome-break); }
.site-bar.roadchef { background: var(--color-landlord-roadchef); }
.site-bar.extra { background: var(--color-landlord-extra); }
.epos-panel .site-bar--pink,
.epos-panel .site-bar.site-bar--pink { background: var(--color-brand-pink); }
.epos-panel .product-bar { background: var(--color-brand-pink); }
.product-bar, .subcat-bar { background: rgba(230,0,133,0.7); }
.site-row .ev-index { font-size: 11px; opacity: 0.8; margin-left: 4px; }
.other-sites {
  margin-top: var(--space-sm, 8px);
  padding: var(--space-md, 16px);
  background: white;
  border-radius: var(--radius-lg, 6px);
  border: 1px dashed var(--color-border-dashed);
  font-size: var(--font-size-sm, 12px);
}
.epos-col .footer-note { font-size: 11px; color: var(--color-brand-grey); margin-top: 12px; }

.audience-index-panel { margin-bottom: 24px; }
.audience-index-panel .epos-box { background: var(--color-bg-subtle-lighter); }
.audience-index-panel h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px 0;
  color: var(--color-brand-grey);
}
.audience-index-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border-divider);
}
.audience-index-name { width: 200px; min-width: 200px; flex-shrink: 0; }
.audience-index-bar-wrap {
  flex: 1;
  min-width: 60px;
  display: flex;
  align-items: center;
}
.audience-index-bar {
  height: 20px;
  border-radius: 4px;
  min-width: 40px;
  background: var(--color-fill-strong);
}
.audience-index-value { flex-shrink: 0; margin-left: 8px; font-variant-numeric: tabular-nums; }

/* Audience index view: diverging bar chart (positive = green right, negative = red left) */
.audience-index-chart { margin-top: 12px; }
.audience-index-chart-row {
  display: flex;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border-divider);
}
.audience-index-bar-track {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  height: 20px;
}
.audience-index-bar-left,
.audience-index-bar-right {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}
.audience-index-bar-left { justify-content: flex-end; }
.audience-index-bar-right { justify-content: flex-start; }
.audience-index-bar-center {
  width: 2px;
  height: 100%;
  background: var(--color-brand-grey);
  opacity: 0.4;
  flex-shrink: 0;
}
.audience-index-bar-negative {
  height: 16px;
  max-width: 100%;
  border-radius: 0;
  background: #B82E33;
  opacity: 0.85;
}
.audience-index-bar-positive {
  height: 16px;
  max-width: 100%;
  border-radius: 0;
  background: #2d8a4e;
}
.audience-index-box .epos-col,
.audience-index-box .epos-col:first-child,
.audience-index-box .detail-panel-col,
.audience-index-box .detail-panel-col:first-child {
  padding-right: 0;
  padding-left: 0;
  border-right: none;
}
.audience-index-box .audience-card-col {
  flex: 0 0 200px;
  padding-right: var(--space-lg, 24px);
}
.audience-card-image {
  aspect-ratio: 4 / 3;
  background: var(--color-fill-muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.audience-card-image .wireframe-label {
  font-size: 11px;
  opacity: 0.7;
}
.audience-card-desc {
  font-size: 13px;
  color: var(--color-brand-grey);
  line-height: 1.4;
  margin: 0;
  opacity: 0.9;
}
.audience-index-card-persistent .heading-link {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--color-brand-pink);
  text-decoration: none;
}
.audience-index-card-persistent .heading-link:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--color-brand-grey);
  opacity: 0.8;
  font-size: 14px;
  background: white;
  border-radius: 8px;
  border: 1px dashed var(--color-border-medium);
}

/* Placeholder panel (e.g. site breakdown not yet built) */
.detail-panel-placeholder {
  padding: var(--space-lg, 24px);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-xl, 8px);
}
.detail-panel-placeholder-text {
  margin: 0;
  color: var(--color-brand-grey);
}

.ctas {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg, 24px);
  margin-top: 24px;
  margin-bottom: var(--space-lg, 24px);
}
.cta-link {
  font-size: 14px;
  color: var(--color-brand-pink);
  text-decoration: none;
}
.cta-link:hover { text-decoration: underline; }
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  background: rgba(230, 0, 133, 1);
  color: white;
  font-size: var(--font-size-lg, 16px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid rgba(230, 0, 133, 1);
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
}
.cta-button-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
  margin-left: 0;
  vertical-align: middle;
}
.footer-data { font-size: 12px; color: var(--color-brand-grey); }

.popover {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 360px;
  padding: var(--space-lg, 24px);
  background: white;
  border-radius: var(--radius-xl, 8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border: 1px solid var(--color-border-muted);
  z-index: var(--z-tooltip);
}
.popover p { margin: 0 0 var(--space-12, 12px) 0; font-size: var(--font-size-md, 14px); }
.popover .cta-button { margin-top: var(--space-sm, 8px); }

/* ========== Responsive: tablet and mobile ========== */
/* Tab-group selects: visible on mobile (default for small viewports), hidden on desktop */
.tab-group-select {
  width: 100%;
  max-width: 280px;
  min-height: 40px;
}

/* Desktop: hide dropdowns, show pill groups */
@media (min-width: 769px) {
  .tab-group-select {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .dashboard-header-menu-btn {
    display: inline-flex;
  }
  .dashboard-header-right {
    position: relative;
  }
  .dashboard-header-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: min(320px, 100vw);
    height: auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm, 8px) 0;
    margin-top: 0;
    background: var(--color-header-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 var(--radius-md, 6px) var(--radius-md, 6px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-fast, 0.15s ease), visibility var(--transition-fast, 0.15s ease), transform var(--transition-fast, 0.15s ease);
    z-index: 100;
  }
  .dashboard-header.is-menu-open .dashboard-header-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .dashboard-header-nav .dashboard-header-link {
    display: flex;
    align-items: center;
    height: auto;
    min-height: 44px;
    padding: var(--space-sm, 8px) var(--space-lg, 24px);
    border-bottom: none;
  }
  .dashboard-header-nav .dashboard-header-link:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .dashboard-header-nav .dashboard-header-link.is-current {
    border-bottom: none;
    background: rgba(255, 255, 255, 0.06);
  }
  .vehicles-leaderboard.epos-panel {
    flex-direction: column;
  }
  .vehicles-leaderboard-inner {
    border-radius: var(--radius-xl, 8px) var(--radius-xl, 8px) 0 0;
  }
  .vehicles-leaderboard-visual {
    min-height: 200px;
  }
  .vehicles-leaderboard-visual-crop {
    border-radius: 0 0 var(--radius-xl, 8px) var(--radius-xl, 8px);
  }
  .epos-panel {
    flex-direction: column;
  }
  .epos-sites-box {
    border-radius: var(--radius-xl, 8px) var(--radius-xl, 8px) 0 0;
  }
  .epos-subcat-products-box {
    flex-direction: column;
    border-radius: 0 0 var(--radius-xl, 8px) var(--radius-xl, 8px);
  }
  .epos-subcat-products-box .epos-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
    padding-right: 0;
    margin-right: 0;
    padding-bottom: var(--space-lg, 24px);
    margin-bottom: var(--space-md, 16px);
  }
  .epos-subcat-products-box .epos-col:last-child {
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  .detail-zone {
    border-radius: 0;
    box-shadow: none;
  }
  .audience-bar-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md, 16px);
  }
  .detail-zone-right {
    align-items: stretch;
  }
  .detail-zone-controls-row {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .detail-zone-controls-left {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  /* On mobile: hide camera/download buttons; granularity becomes dropdown */
  .detail-zone-controls-actions {
    display: none !important;
  }
  .detail-zone-actions.detail-zone-actions--desktop {
    display: none;
  }
  .tab-group-select {
    display: block;
  }
  .vehicle-row-brand {
    padding: 0;
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    justify-content: center;
    gap: 0;
  }
  .vehicle-row-brand .vehicle-name,
  .vehicle-row .vehicle-name {
    display: none;
  }
  .vehicle-row .vehicle-value-pct {
    display: none;
  }
  .vehicles-chart-descriptor-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm, 8px);
  }
  .vehicles-leaderboard.epos-panel {
    border-radius: 0;
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
    max-width: none;
    box-sizing: border-box;
  }
  .detail-zone-controls-row .tab-group-select--granularity {
    flex: 0 0 auto;
    min-width: 120px;
  }
  .timeline-scrubber {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: var(--space-40, 40px);
    min-height: var(--space-40, 40px);
  }
  .timeline-scrubber .scrubber-date {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }
  .audience-index-panel-header .audience-segment-toggle,
  .audience-index-panel-header .audience-index-chart-toggle {
    display: none !important;
  }
  .audience-index-panel-header .tab-group-select--segment,
  .audience-index-panel-header .tab-group-select--chart {
    display: block;
  }
  .audience-index-panel-header {
    flex-wrap: wrap;
    gap: var(--space-sm, 8px);
  }
  .audience-index-panel-body {
    flex-direction: column;
  }
  .audience-index-card-persistent {
    flex: 0 0 auto;
    max-width: 100%;
  }
  .audience-index-tornado-view,
  .audience-index-beeswarm-view {
    min-width: 0;
    overflow-x: auto;
  }
  .chart-row {
    flex-direction: column;
    gap: var(--space-md, 16px);
  }
  .chart-kpi {
    width: 100%;
  }
  .weekly-bars-wrap {
    overflow-x: auto;
    min-width: 0;
  }
  .scrubber-arrow {
    min-width: 44px;
    height: var(--space-40, 40px);
    min-height: var(--space-40, 40px);
  }
}

@media (max-width: 480px) {
  .tab-group-select {
    max-width: 100%;
  }
}
