/* ═══════════════════════════════════════════════════════════════
   MediaTea — Insights Dashboard Stylesheet
   Design congruent with main prototype (styles.css)
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (same as main app) ─── */
:root {
  /* Backgrounds */
  --bg-primary: #0d0d0f;
  --bg-surface: #1a1a1e;
  --bg-surface-raised: #242428;
  --bg-surface-hover: #2a2a30;
  --bg-glass: rgba(26, 26, 30, 0.85);

  /* Text */
  --text-primary: #f2f2f7;
  --text-secondary: #a0a0aa;
  --text-tertiary: #6b6b75;

  /* Brand */
  --purple: #b590cc;
  --purple-bright: #c8a2e0;
  --purple-dark: #8a60a8;
  --purple-glow: rgba(181, 144, 204, 0.15);
  --purple-surface: rgba(181, 144, 204, 0.08);

  /* Lean colors */
  --lean-left: #60a5fa;
  --lean-center: #9ca3af;
  --lean-right: #f87171;
  --lean-left-deep: #3b82f6;
  --lean-right-deep: #ef4444;

  /* Semantic */
  --tone-neutral: #22c55e;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 100px;
  --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.3);

  /* Animation */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 200ms var(--ease-out);
  --transition-med: 350ms var(--ease-out);

  /* Liquid Glass */
  --glass-bg: rgba(28, 28, 32, 0.55);
  --glass-blur: 40px;
  --glass-saturate: 180%;
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-inner: rgba(255, 255, 255, 0.06);
  --glass-specular: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 50%
  );
  --glass-shadow:
    0 2px 16px rgba(0, 0, 0, 0.2), 0 0 1px rgba(255, 255, 255, 0.1);
}

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

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #0a0a0c;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════
   LEGEND PANEL (side description)
   ═══════════════════════════════════════ */

.legend-panel {
  position: fixed;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 24px;
  z-index: 10;
}

.legend-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.legend-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.legend-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 16px 0;
}

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

.lf-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.lf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.lf-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lf-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.lf-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.legend-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   PHONE FRAME
   ═══════════════════════════════════════ */

.prototype-wrapper {
  display: flex;
  align-items: center;
  gap: 60px;
}

.phone-frame {
  width: 393px;
  height: 852px;
  background: var(--bg-primary);
  border-radius: 50px;
  border: 3px solid #2a2a2e;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(181, 144, 204, 0.05);
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 34px;
  background: #000;
  border-radius: 0 0 20px 20px;
  z-index: 100;
}

.phone-screen {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   INSIGHTS HEADER
   ═══════════════════════════════════════ */

.insights-header {
  padding: 52px 20px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur))
    saturate(var(--glass-saturate));
  border-bottom: 1px solid var(--glass-border-inner);
  z-index: 10;
}

.feed-brand {
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.brand-mark {
  font-family: "Inter", sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.brand-accent {
  font-family: "Inter", sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1.5px;
  color: var(--purple);
}

.brand-dot {
  font-size: 10px;
  color: var(--purple);
  margin-left: 4px;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════
   INSIGHTS TITLE + TIME TOGGLES
   ═══════════════════════════════════════ */

.insights-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 4px;
}

.insights-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--purple);
}

.insights-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.time-toggles {
  display: flex;
  gap: 2px;
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.time-toggle {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.time-toggle.active {
  background: rgba(181, 144, 204, 0.35);
  color: #fff;
  box-shadow: 0 0 8px rgba(181, 144, 204, 0.15);
}

.time-toggle:hover:not(.active) {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   PRIVACY BADGE
   ═══════════════════════════════════════ */

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  margin-bottom: 4px;
}

.privacy-badge svg {
  color: var(--tone-neutral);
  flex-shrink: 0;
}

.privacy-badge span {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ═══════════════════════════════════════
   SCROLLABLE INSIGHTS AREA
   ═══════════════════════════════════════ */

.insights-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}

.insights-scroll::-webkit-scrollbar {
  display: none;
}

/* ═══════════════════════════════════════
   INSIGHT CARD (base)
   ═══════════════════════════════════════ */

.insight-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  animation: card-enter 600ms var(--ease-out) backwards;
}

.insight-card:nth-child(1) {
  animation-delay: 0ms;
}
.insight-card:nth-child(2) {
  animation-delay: 80ms;
}
.insight-card:nth-child(3) {
  animation-delay: 160ms;
}
.insight-card:nth-child(4) {
  animation-delay: 240ms;
}
.insight-card:nth-child(5) {
  animation-delay: 320ms;
}
.insight-card:nth-child(6) {
  animation-delay: 400ms;
}
.insight-card:nth-child(7) {
  animation-delay: 480ms;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* ═══════════════════════════════════════
   1. HERO CARD — MEDIA DIET SUMMARY
   ═══════════════════════════════════════ */

.hero-card {
  background: linear-gradient(
    135deg,
    rgba(181, 144, 204, 0.12) 0%,
    rgba(96, 165, 250, 0.06) 100%
  );
  border-color: rgba(181, 144, 204, 0.15);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.hero-stat-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-topics {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.hero-topic-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.hero-topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-raised);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 5px;
}

.chip-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--purple);
  background: rgba(181, 144, 204, 0.15);
  padding: 1px 5px;
  border-radius: 6px;
}

/* ═══════════════════════════════════════
   2. POLITICAL LEAN DISTRIBUTION
   ═══════════════════════════════════════ */

.lean-bar-container {
  margin-bottom: 14px;
}

.lean-stacked-bar {
  display: flex;
  height: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  gap: 2px;
}

.lean-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 600ms var(--ease-out);
  position: relative;
  cursor: default;
}

.lean-segment.left {
  background: var(--lean-left-deep);
}

.lean-segment.lean-left {
  background: rgba(96, 165, 250, 0.6);
}

.lean-segment.center {
  background: var(--lean-center);
}

.lean-segment.lean-right {
  background: rgba(248, 113, 113, 0.6);
}

.lean-segment.right {
  background: var(--lean-right-deep);
}

.seg-pct {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.lean-bar-labels {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px 0;
}

.lean-bar-labels span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lean-label-left {
  color: var(--lean-left);
}
.lean-label-center {
  color: var(--lean-center);
}
.lean-label-right {
  color: var(--lean-right);
}

.lean-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.lean-breakdown-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.lb-dot.left {
  background: var(--lean-left-deep);
}
.lb-dot.lean-left {
  background: rgba(96, 165, 250, 0.7);
}
.lb-dot.center {
  background: var(--lean-center);
}
.lb-dot.lean-right {
  background: rgba(248, 113, 113, 0.7);
}
.lb-dot.right {
  background: var(--lean-right-deep);
}

.lb-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.lb-count {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════
   3. SOURCE DIVERSITY
   ═══════════════════════════════════════ */

.diversity-index {
  display: flex;
  align-items: center;
  gap: 6px;
}

.di-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.di-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--tone-neutral);
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.source-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.source-info {
  display: flex;
  flex-direction: column;
  min-width: 70px;
}

.source-info .source-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.source-lean {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.source-lean.center {
  color: var(--lean-center);
}
.source-lean.slight-left {
  color: var(--lean-left);
}
.source-lean.right {
  color: var(--lean-right);
}

.source-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-surface-raised);
  border-radius: 3px;
  overflow: hidden;
}

.source-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--purple);
  transition: width 800ms var(--ease-out);
}

.source-bar.left {
  background: var(--lean-left);
}
.source-bar.right {
  background: var(--lean-right);
}

.source-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

/* Credibility Breakdown */
.cred-breakdown {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.cred-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.cred-bar {
  display: flex;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  gap: 1px;
}

.cred-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 800ms var(--ease-out);
}

.cred-seg-label {
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.cred-seg.very-high {
  background: #16a34a;
}
.cred-seg.high {
  background: #22c55e;
}
.cred-seg.mixed {
  background: #eab308;
}
.cred-seg.low {
  background: #ef4444;
}

/* ═══════════════════════════════════════
   4. ARTICLE TYPE MIX
   ═══════════════════════════════════════ */

.type-mix-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.type-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.type-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 72px;
  flex-shrink: 0;
}

.type-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--bg-surface-raised);
  border-radius: 5px;
  overflow: hidden;
}

.type-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 800ms var(--ease-out);
}

.type-bar.news {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.type-bar.opinion {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.type-bar.analysis {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}
.type-bar.feature {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}
.type-bar.explainer {
  background: linear-gradient(90deg, #06b6d4, #22d3ee);
}

.type-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   5. READING HABITS
   ═══════════════════════════════════════ */

.habits-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.habit-stat {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--bg-surface-raised);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.habit-stat svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.habit-stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.habit-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.habit-stat-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Heatmap */
.heatmap-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.heatmap-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 10px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 3px;
  margin-bottom: 4px;
}

.hm-cell {
  aspect-ratio: 1;
  background: var(--purple);
  border-radius: 3px;
  min-height: 14px;
}

.heatmap-day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 10px;
}

.heatmap-day-labels span {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: center;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.heatmap-legend-label {
  font-size: 9px;
  color: var(--text-tertiary);
}

.heatmap-legend-cells {
  display: flex;
  gap: 2px;
}

.heatmap-legend-cells .hm-cell {
  width: 12px;
  height: 12px;
  min-height: unset;
}

/* ═══════════════════════════════════════
   6. BLIND SPOTS
   ═══════════════════════════════════════ */

.blind-spots-card {
  border-left: 3px solid rgba(181, 144, 204, 0.4);
}

.blind-spots-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.blind-spot-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blind-spot-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.blind-spot-item:hover {
  background: var(--bg-surface-raised);
}

.blind-spot-item:active {
  transform: scale(0.98);
}

.bs-topic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.bs-content {
  flex: 1;
  min-width: 0;
}

.bs-topic {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bs-headline {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-top: 2px;
}

.bs-sources {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 3px;
  display: block;
}

.bs-arrow {
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-top: 8px;
}

/* ═══════════════════════════════════════
   7. RECENT ACTIVITY
   ═══════════════════════════════════════ */

.see-all-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.see-all-btn:hover {
  opacity: 0.7;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.recent-item:hover {
  background: var(--bg-surface-raised);
}

.recent-item:active {
  transform: scale(0.98);
}

.ri-source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.ri-content {
  flex: 1;
  min-width: 0;
}

.ri-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.ri-source {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ri-lean {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 1px 5px;
  border-radius: 3px;
}

.ri-lean.center {
  color: var(--lean-center);
  background: rgba(156, 163, 175, 0.12);
}

.ri-lean.slight-left {
  color: var(--lean-left);
  background: rgba(96, 165, 250, 0.12);
}

.ri-lean.right {
  color: var(--lean-right);
  background: rgba(248, 113, 113, 0.12);
}

.ri-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
}

.ri-headline {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   TAB BAR — Floating Glass
   ═══════════════════════════════════════ */

.tab-bar {
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 56px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur))
    saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border-inner);
  border-radius: 28px;
  z-index: 50;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  margin-bottom: 8px;
}

.tab-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-specular);
  border-radius: inherit;
  pointer-events: none;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  min-width: 52px;
}

.tab-item span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.tab-item svg {
  width: 22px;
  height: 22px;
}

.tab-item.active {
  color: var(--purple);
}

.tab-item:hover:not(.active) {
  color: var(--text-secondary);
}

.tab-item:active {
  transform: scale(0.96);
}

/* ═══════════════════════════════════════
   TOAST
   ═══════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: all 400ms var(--ease-out);
  z-index: 200;
  pointer-events: none;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ═══════════════════════════════════════
   RESPONSIVE: hide legend on small screens
   ═══════════════════════════════════════ */

@media (max-width: 900px) {
  .legend-panel {
    display: none;
  }
}
