@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset & Base ──────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Login Gate ───────────────────────────────────── */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #121314;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.login-gate.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  text-align: center;
}

.login-logo {
  margin-bottom: 4px;
}

.login-logo-img {
  height: 72px;
  width: auto;
}

.login-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.login-input {
  width: 260px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(216, 163, 95, 0.2);
  border-radius: 8px;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.login-input:focus {
  border-color: #D8A35F;
}

.login-input-wrap {
  position: relative;
  width: 260px;
}

.login-input-wrap .login-input {
  width: 100%;
  padding-right: 56px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #666;
  border: 1px solid #777;
  border-radius: 4px;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.toggle-password:hover {
  background: #555;
  color: #fff;
  border-color: #888;
}

.login-btn {
  width: 260px;
  padding: 12px;
  background: #D8A35F;
  color: #121314;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.login-btn:hover {
  background: #c4923e;
}

.login-error {
  font-size: 12px;
  color: #63151C;
  min-height: 18px;
}

body {
  background: #121314;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(216, 163, 95, 0.15);
  background: linear-gradient(180deg, rgba(18, 19, 20, 1) 0%, rgba(18, 19, 20, 0.95) 100%);
  backdrop-filter: blur(12px);
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-logo {
  height: 36px;
  width: auto;
}

.logo-tag {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  margin-left: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Status Indicator ──────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D8A35F;
  box-shadow: 0 0 8px rgba(216, 163, 95, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(216, 163, 95, 0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 16px rgba(216, 163, 95, 0.3); }
}

.status-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  transition: color 0.3s ease;
}

.status-updated {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  margin-left: 8px;
}

/* Loading spinner on status dot */
.status-dot.loading {
  background: transparent;
  border: 2px solid rgba(216, 163, 95, 0.3);
  border-top-color: #D8A35F;
  animation: spin 0.8s linear infinite;
  box-shadow: none;
}

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

/* ── Error Banner ─────────────────────────────────── */
.error-banner {
  background: rgba(99, 21, 28, 0.9);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}

.error-banner.visible {
  padding: 8px 24px;
  max-height: 40px;
  border-bottom-color: rgba(216, 163, 95, 0.2);
}

/* ── Day Picker ────────────────────────────────────── */
.day-picker {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 3px;
}

.day-picker button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-picker button:hover {
  color: rgba(255, 255, 255, 0.7);
}

.day-picker button.active {
  background: #D8A35F;
  color: #121314;
  box-shadow: 0 2px 8px rgba(216, 163, 95, 0.3);
}

/* ── Time Slider ───────────────────────────────────── */
.time-slider {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-slider-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  white-space: nowrap;
  min-width: 90px;
  text-align: center;
}

.time-slider-track {
  position: relative;
  width: 140px;
  height: 28px;
  display: flex;
  align-items: center;
}

.time-slider-track .track-bg {
  position: absolute;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.time-slider-track .track-fill {
  position: absolute;
  height: 4px;
  background: #D8A35F;
  border-radius: 2px;
  pointer-events: none;
}

.time-slider-track input[type="range"] {
  position: absolute;
  width: 100%;
  height: 28px;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  pointer-events: none;
  margin: 0;
}

.time-slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #D8A35F;
  border: 2px solid #121314;
  box-shadow: 0 0 6px rgba(216, 163, 95, 0.4);
  cursor: pointer;
  pointer-events: all;
}

.time-slider-track input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #D8A35F;
  border: 2px solid #121314;
  box-shadow: 0 0 6px rgba(216, 163, 95, 0.4);
  cursor: pointer;
  pointer-events: all;
}

/* ── View Tabs ─────────────────────────────────────── */
.view-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 3px;
}

.view-tabs button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-tabs button:hover {
  color: rgba(255, 255, 255, 0.7);
}

.view-tabs button.active {
  background: rgba(216, 163, 95, 0.15);
  color: #D8A35F;
}

/* ── Content Panels ────────────────────────────────── */
.content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view-panel {
  position: absolute;
  inset: 0;
  display: none;
}

.view-panel.active {
  display: flex;
}

/* ── Map ───────────────────────────────────────────── */
#map {
  flex: 1;
  width: 100%;
  background: #121314; /* Leaflet's default #ddd flashes light gray while tiles load */
}

/* ── Leaflet Overrides ─────────────────────────────── */
.leaflet-control-zoom a {
  background: #1a1b1d !important;
  color: #D8A35F !important;
  border: 1px solid rgba(216, 163, 95, 0.2) !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
  background: #222325 !important;
  border-color: rgba(216, 163, 95, 0.4) !important;
}

.leaflet-control-zoom {
  border: none !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-control-attribution {
  background: rgba(18, 19, 20, 0.85) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  font-size: 10px !important;
  backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
  color: rgba(216, 163, 95, 0.5) !important;
}

.leaflet-tile-pane .base-tiles {
  filter: saturate(0.3) brightness(0.9);
}

/* ── Map Markers ───────────────────────────────────── */
.theater-marker {
  width: 8px;
  height: 8px;
  background: #D8A35F;
  border: 1.5px solid #121314;
  border-radius: 50%;
  box-shadow: none;
}

.gap-marker {
  width: 12px;
  height: 12px;
  background: #1B4D7A;
  border: 2px solid rgba(27, 77, 122, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(56, 140, 224, 0.5);
  animation: gap-pulse 2s ease-in-out infinite;
}

@keyframes gap-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(56, 140, 224, 0.5); transform: scale(1); }
  50% { box-shadow: 0 0 16px rgba(56, 140, 224, 0.7); transform: scale(1.2); }
}

/* ── Leaflet Popups ────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: #1a1b1d !important;
  border: 1px solid rgba(216, 163, 95, 0.2) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-content {
  color: #fff !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 12px !important;
  margin: 10px 14px !important;
}

.leaflet-popup-content .theater-name {
  font-weight: 600;
  color: #D8A35F;
  font-size: 13px;
  margin-bottom: 2px;
}

.leaflet-popup-content .theater-city {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.leaflet-popup-content .gap-label {
  font-weight: 600;
  color: #388CE0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.leaflet-popup-content .gap-location {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.leaflet-popup-content .gap-count {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  margin-top: 2px;
}

.leaflet-popup-tip {
  background: #1a1b1d !important;
  border: 1px solid rgba(216, 163, 95, 0.2) !important;
}

/* ── Layer Toggles ────────────────────────────────── */
.layer-toggles {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  gap: 6px;
}

.layer-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 19, 20, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.layer-toggle:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.6);
}

.layer-toggle.active {
  border-color: rgba(216, 163, 95, 0.3);
  color: #fff;
}

.layer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: opacity 0.2s ease;
}

.layer-toggle:not(.active) .layer-dot {
  opacity: 0.3;
}

.stats-bar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  gap: 16px;
  background: rgba(18, 19, 20, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.stat-value {
  color: #D8A35F;
  font-weight: 600;
}

.map-subtitle {
  position: absolute;
  top: 52px;
  right: 16px;
  z-index: 1000;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  max-width: 500px;
  text-align: right;
}

.stat-fresh {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 12px;
}

.demand-dot {
  background: #D8A35F;
  box-shadow: 0 0 4px rgba(216, 163, 95, 0.5);
}

.gaps-dot {
  background: #3366CC;
  box-shadow: 0 0 4px rgba(51, 102, 204, 0.5);
}

.theaters-dot {
  background: #D8A35F;
  border: 1.5px solid #121314;
  box-shadow: 0 0 4px rgba(216, 163, 95, 0.5);
}

.requests-dot {
  background: #9B59B6;
  box-shadow: 0 0 4px rgba(155, 89, 182, 0.5);
}

.leaflet-popup-content .request-label {
  font-weight: 600;
  color: #B07CC6;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaflet-popup-content .request-movie {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  margin-top: 2px;
}

.leaflet-popup-content .request-city {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  margin-top: 2px;
}

.leaflet-popup-content .request-date {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  margin-top: 4px;
}

.festivals-dot {
  background: #E67E22;
}

.festival-legend {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.3px;
}

.festival-legend.visible { display: flex; }

.festival-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.festival-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid;
  display: inline-block;
}

.leaflet-popup-content .festival-label {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaflet-popup-content .festival-label.in-app {
  color: #2ECC71;
}

.leaflet-popup-content .festival-label.not-in-app {
  color: #E67E22;
}

.leaflet-popup-content .festival-name {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  margin-top: 2px;
}

.leaflet-popup-content .festival-location {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  margin-top: 2px;
}

.leaflet-popup-content .festival-dates {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  margin-top: 4px;
}

/* ── Map Vignette ──────────────────────────────────── */
#map::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  box-shadow: inset 0 0 120px rgba(18, 19, 20, 0.6);
}

/* ── Growth-only day picker buttons ───────────────── */
.day-picker .growth-only {
  display: none;
}

body.view-growth .day-picker .growth-only {
  display: inline-block;
}

/* ── Growth Panel ─────────────────────────────────── */
#growthView {
  flex-direction: column;
  padding: 32px;
  overflow-y: auto;
  gap: 24px;
  transition: opacity 0.3s ease;
}

#growthView.loading {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Growth Freshness ─────────────────────────────── */
.growth-freshness {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* ── Executive Summary ────────────────────────────── */
.executive-summary {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
}

/* ── About This Data ─────────────────────────────── */
.about-data-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 24px;
}

.about-data-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

.about-data-block h3 {
  font-size: 16px;
  font-weight: 600;
  color: #D8A35F;
  margin-bottom: 6px;
}

.about-data-block p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
}

.about-data-block ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-data-block li {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.about-data-block li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: #D8A35F;
  border-radius: 50%;
}

.about-data-block li strong {
  color: rgba(255, 255, 255, 0.85);
}

.growth-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.growth-row .growth-section {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.growth-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 2px;
}

.growth-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #D8A35F;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-desc {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.4;
}

.section-narrative {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin-top: 4px;
}

/* ── Stat Cards ───────────────────────────────────── */
.stat-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(216, 163, 95, 0.1);
  border-radius: 10px;
  padding: 16px 20px;
  min-width: 140px;
  flex: 1;
}

.stat-card.highlight {
  border-color: rgba(216, 163, 95, 0.3);
  background: rgba(216, 163, 95, 0.05);
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: #D8A35F;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-desc {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
  line-height: 1.3;
}

.geo-loading {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  padding: 12px 0;
}

/* ── Growth Tables ────────────────────────────────── */
#growthView .data-table-wrapper {
  border: 1px solid rgba(216, 163, 95, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  max-height: 400px;
  overflow-y: auto;
}

#growthView .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#growthView .data-table th {
  position: sticky;
  top: 0;
  background: rgba(18, 19, 20, 0.95);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(216, 163, 95, 0.15);
}

#growthView .data-table td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
}

#growthView .data-table tbody tr:hover {
  background: rgba(216, 163, 95, 0.04);
}

#growthView .data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

#growthView .data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

#growthView .data-table td.highlight-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #D8A35F;
}

#growthView .data-table th:not(:first-child),
#growthView .data-table td:not(:first-child) {
  text-align: right;
}

.table-cta {
  font-size: 13px;
  font-weight: 400;
  color: rgba(216, 163, 95, 0.7);
  margin-top: 12px;
  line-height: 1.5;
}

.stat-card-value .trend-up {
  color: #48C9B0;
}

.stat-card-value .trend-down {
  color: #FF4757;
}

/* ── Traffic Panel ─────────────────────────────────── */
#trafficView {
  flex-direction: column;
  padding: 32px;
  overflow-y: auto;
  gap: 32px;
}

.chart-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(216, 163, 95, 0.1);
  border-radius: 12px;
  padding: 24px;
}
.growth-section .chart-card {
  background: none;
  border: none;
  padding: 0;
  margin-top: 8px;
}

.chart-card h2 {
  font-size: 14px;
  font-weight: 600;
  color: #D8A35F;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
}

.tz-label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

/* Platform provenance tag: Mobile / Web / Mobile + Web / All sources */
.platform-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
}
.stat-card-label .platform-tag,
.stat .platform-tag { margin-left: 6px; }

@media print {
  .platform-tag {
    color: #555;
    background: transparent;
    border: 1px solid #aaa;
  }
}

.chart-desc {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.5;
  margin: -12px 0 16px;
}

/* ── Chart Keys ──────────────────────────────────── */
.chart-key {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* Bar chart key */
.bar-key-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
}

.bar-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.bar-low { background: rgba(216, 163, 95, 0.25); }
.bar-mid { background: rgba(216, 163, 95, 0.6); }
.bar-high { background: #D8A35F; }

/* Heatgrid key */
.heatgrid-key {
  gap: 8px;
}

.heatgrid-key-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
}

.heatgrid-key-bar {
  width: 160px;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(99, 21, 28, 0.2) 0%, #63151C 25%, #C4483A 50%, #D8A35F 75%, #FFFFFF 100%);
}

.chart-card canvas {
  width: 100% !important;
  max-height: 300px;
}

/* ── Weekday/Hour Heatgrid ─────────────────────────── */
.heatgrid {
  display: grid;
  grid-template-columns: 48px repeat(24, 1fr);
  grid-template-rows: 28px repeat(7, 1fr);
  gap: 2px;
  min-height: 240px;
}

.heatgrid-hour-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
}

.heatgrid-day-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

.heatgrid-cell {
  border-radius: 3px;
  min-height: 28px;
  transition: all 0.15s ease;
  cursor: default;
  position: relative;
}

.heatgrid-cell:hover {
  transform: scale(1.15);
  z-index: 1;
  box-shadow: 0 0 8px rgba(216, 163, 95, 0.4);
}

.heatgrid-corner {
  /* empty top-left corner */
}

/* ── Device Breakdown Chart ──────────────────────── */
.device-chart-wrapper {
  display: flex;
  align-items: center;
  gap: 32px;
}

.device-chart-wrapper canvas {
  max-width: 200px !important;
  max-height: 200px !important;
}

.device-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.device-legend-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  min-width: 70px;
}

.device-legend-value {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.device-legend-empty {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  padding: 8px 0;
}

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  background: rgba(18, 19, 20, 0.95);
  border-top: 1px solid rgba(216, 163, 95, 0.15);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #D8A35F;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-company {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.footer-address {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
}

.footer-phone {
  font-size: 12px;
  font-weight: 500;
  color: #D8A35F;
  text-decoration: none;
}

.footer-phone:hover {
  text-decoration: underline;
}

/* ── Download Report Button ──────────────────────── */
.download-report-btn {
  background: rgba(216, 163, 95, 0.12);
  border: 1px solid rgba(216, 163, 95, 0.3);
  color: #D8A35F;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.download-report-btn:hover {
  background: rgba(216, 163, 95, 0.2);
  border-color: rgba(216, 163, 95, 0.5);
}

/* ── Data Tiers CTA ─────────────────────────────── */
.data-tiers-contact {
  margin-top: 1rem;
  font-size: 1rem;
  color: #D8A35F;
}
.data-tiers-contact a {
  color: #D8A35F;
  text-decoration: underline;
}

/* ── Print Styles ────────────────────────────────── */
/* Print header — hidden on screen, visible in print */
.print-header {
  display: none;
}

@media print {
  @page {
    margin: 0.6in 0.75in 0.8in 0.75in;
    size: letter;
  }

  /* Hide UI chrome */
  header,
  .login-gate,
  .download-report-btn,
  .error-banner,
  .site-footer,
  .geo-loading,
  #mapView,
  #trafficView,
  .view-tabs,
  .day-picker,
  .time-slider,
  .status-dot,
  .status-text {
    display: none !important;
  }

  /* Reset layout */
  body {
    background: #fff !important;
    color: #1a1a1a !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .content {
    overflow: visible !important;
    position: static !important;
  }

  #growthView {
    display: flex !important;
    flex-direction: column !important;
    position: static !important;
    padding: 0 !important;
    overflow: visible !important;
    gap: 32px !important;
  }

  /* ── Cover Header ── */
  .print-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 120px 0 40px 0;
    margin-bottom: 0;
    border-bottom: none;
    page-break-after: always;
    font-family: -apple-system, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
  }

  .print-header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .print-logo {
    height: 200px;
    width: auto;
  }

  .print-header-subtitle {
    font-family: -apple-system, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    font-size: 28px;
    font-weight: 300;
    color: #333;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding-left: 0;
    border-left: none;
    text-align: center;
  }

  .print-header-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #555;
    font-family: -apple-system, 'SF Pro Text', system-ui, sans-serif;
    font-weight: 400;
    letter-spacing: 0.3px;
    margin-top: 16px;
  }

  /* ── Executive Summary ── */
  .executive-summary {
    background: none !important;
    border-left: 3px solid #63151C !important;
    border-radius: 0 !important;
    padding: 16px 24px !important;
    font-size: 13px !important;
    line-height: 1.9 !important;
    color: #333 !important;
    margin-top: 0 !important;
  }

  /* ── Section Styling ── */
  .growth-row {
    flex-direction: column !important;
  }

  .growth-section {
    background: none !important;
    border: none !important;
    border-left: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    break-inside: avoid;
  }

  .section-header {
    margin-bottom: 16px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #e0e0e0 !important;
  }

  .growth-section-title {
    color: #63151C !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    margin-bottom: 6px !important;
  }

  .section-narrative {
    color: #555 !important;
    font-size: 11.5px !important;
    line-height: 1.8 !important;
    max-width: none;
  }

  .table-cta {
    color: #63151C !important;
    font-size: 11px !important;
    font-style: italic;
    margin-top: 8px !important;
  }

  /* ── Stat Cards ── */
  .stat-cards {
    gap: 0 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .stat-card {
    background: #fff !important;
    border: none !important;
    border-right: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    padding: 16px 18px !important;
    min-width: 0 !important;
    flex: 1 !important;
    box-sizing: border-box !important;
  }

  .stat-card:last-child {
    border-right: none !important;
  }

  .stat-card.highlight {
    background: #fff !important;
    border-color: #e0e0e0 !important;
    border-width: 0 !important;
    border-right: 1px solid #e0e0e0 !important;
  }

  .stat-card-value {
    color: #1a1a1a !important;
    font-size: 24px !important;
    font-weight: 700 !important;
  }

  .stat-card.highlight .stat-card-value {
    color: #63151C !important;
  }

  .stat-card-value .trend-up {
    color: #1a7a5a !important;
  }

  .stat-card-value .trend-down {
    color: #b33a2b !important;
  }

  .stat-card-label {
    color: #1a1a1a !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-top: 4px !important;
  }

  .stat-card-desc {
    color: #555 !important;
    font-size: 8px !important;
    margin-top: 2px !important;
  }

  /* ── Charts ── */
  .chart-card {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    break-inside: avoid;
  }

  .chart-card h2 {
    color: #63151C !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    margin-bottom: 12px !important;
  }

  .chart-desc {
    color: #444 !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
  }

  .chart-card canvas {
    max-height: 220px !important;
    width: 100% !important;
    height: 200px !important;
  }

  .print-chart-img {
    max-height: 220px !important;
    width: 100% !important;
    object-fit: contain;
    display: block !important;
  }

  /* Freshness line */
  .growth-freshness {
    display: none !important;
  }

  /* ── Tables ── */
  #growthView .data-table-wrapper {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #growthView .data-table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  #growthView .data-table th {
    background: #63151C !important;
    color: #fff !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 10px 14px !important;
    border: none !important;
  }

  #growthView .data-table th:first-child {
    border-radius: 0 !important;
  }

  #growthView .data-table th:last-child {
    border-radius: 0 !important;
  }

  #growthView .data-table td {
    color: #333 !important;
    font-size: 11px !important;
    padding: 9px 14px !important;
    border-bottom: 1px solid #eee !important;
  }

  #growthView .data-table tr:nth-child(even) td {
    background: #fafafa !important;
  }

  #growthView .data-table td.highlight-num {
    color: #63151C !important;
    font-weight: 600 !important;
  }

  /* ── About This Data ── */
  .about-data-section {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    break-inside: avoid;
    page-break-before: always;
  }

  .about-data-body {
    gap: 20px !important;
  }

  .about-data-block h3 {
    color: #63151C !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    margin-bottom: 8px !important;
  }

  .about-data-block p {
    color: #555 !important;
    font-size: 10.5px !important;
    line-height: 1.8 !important;
  }

  .about-data-block li {
    color: #555 !important;
    font-size: 10.5px !important;
    line-height: 1.7 !important;
  }

  .about-data-block li::before {
    background: #63151C !important;
  }

  .about-data-block li strong {
    color: #1a1a1a !important;
  }

  /* ── Data Tiers CTA (print) ── */
  .data-tiers-contact {
    color: #63151C !important;
  }

  .data-tiers-contact a {
    color: #63151C !important;
  }

  /* ── Page Footer ── */
  #growthView::after {
    content: 'opencaptionfinder.com   ·   caz@opencaptionfinder.com   ·   matt@opencaptionfinder.com';
    display: block;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 9px;
    color: #999;
    text-align: center;
    padding-top: 24px;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
    letter-spacing: 0.5px;
  }
}

/* ── Tablets + phones ──────────────────────────────── */
@media (max-width: 1000px) {
  /* Header items join one wrapping flow, in three rows:
     logo + live status / view tabs + day picker / time slider + report button */
  header {
    flex-wrap: wrap;
    gap: 8px 10px;
  }

  .header-right {
    display: contents;
  }

  .status-dot,
  .status-text,
  .status-updated {
    order: 1;
  }

  /* Forces the row break after the status line */
  header::after {
    content: '';
    order: 2;
    flex-basis: 100%;
    margin-top: -8px;
  }

  .view-tabs,
  .day-picker {
    order: 3;
  }

  .time-slider,
  .download-report-btn {
    order: 4;
  }

  .status-dot,
  .day-picker,
  .download-report-btn {
    margin-left: auto;
  }

  .status-updated {
    margin-left: 0;
    white-space: nowrap;
  }

  /* Layer toggles scroll sideways instead of running off the screen */
  .layer-toggles {
    right: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .layer-toggles::-webkit-scrollbar {
    display: none;
  }

  .layer-toggle {
    flex-shrink: 0;
  }

  /* Stats sit under the toggles instead of on top of them */
  .stats-bar {
    top: 66px;
    left: 16px;
    right: auto;
  }

  .growth-row {
    flex-direction: column;
  }
}

/* ── Phones ────────────────────────────────────────── */
@media (max-width: 640px) {
  header {
    padding: 10px 12px;
  }

  .view-tabs button,
  .day-picker button {
    padding: 6px 8px;
  }

  .time-slider-track {
    width: 120px;
  }

  .time-slider-label {
    min-width: 64px;
  }

  #trafficView,
  #growthView {
    padding: 16px;
    gap: 16px;
  }

  .chart-card,
  .growth-section {
    padding: 16px;
  }

  .device-chart-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .site-footer {
    padding: 10px 16px;
  }

  .footer-contact {
    gap: 2px 12px;
  }
}
