/* ===== DESIGN TOKENS ===== */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem;

  --radius-sm: 0.375rem; --radius-md: 0.5rem;
  --radius-lg: 0.75rem;  --radius-xl: 1rem; --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ===== LIGHT MODE ===== */
:root, [data-theme='light'] {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-surface-2: #f8f9fb;
  --color-surface-offset: #edf0f4;
  --color-border: #d0d5dd;
  --color-divider: #e4e7ec;
  --color-text: #1a1d23;
  --color-text-muted: #6b7280;
  --color-text-faint: #9ca3af;
  --color-text-inverse: #ffffff;
  --color-primary: #003f87;
  --color-primary-hover: #002d61;
  --color-primary-active: #001f44;
  --color-primary-highlight: #dbe6f5;
  --color-accent: #c8a415;
  --color-accent-hover: #a68812;
  --color-accent-highlight: #faf3d4;
  --color-success: #16a34a;
  --color-success-hover: #15803d;
  --color-success-highlight: #dcfce7;
  --color-canada: #d42b2b;
  --color-canada-highlight: #fde8e8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

/* ===== DARK MODE ===== */
[data-theme='dark'] {
  --color-bg: #111318; --color-surface: #1a1d24; --color-surface-2: #22262e;
  --color-surface-offset: #1e2128; --color-border: #333840; --color-divider: #282d35;
  --color-text: #e2e4e8; --color-text-muted: #8b8f98; --color-text-faint: #585c65;
  --color-text-inverse: #111318;
  --color-primary: #5b9cf5; --color-primary-hover: #3d84f0;
  --color-primary-active: #2670e0; --color-primary-highlight: #1e2a40;
  --color-accent: #e8c849; --color-accent-hover: #d4b43c; --color-accent-highlight: #2e2a1a;
  --color-success: #4ade80; --color-success-hover: #22c55e; --color-success-highlight: #1a2e22;
  --color-canada: #f87171; --color-canada-highlight: #2e1a1a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111318; --color-surface: #1a1d24; --color-surface-2: #22262e;
    --color-surface-offset: #1e2128; --color-border: #333840; --color-divider: #282d35;
    --color-text: #e2e4e8; --color-text-muted: #8b8f98; --color-text-faint: #585c65;
    --color-text-inverse: #111318;
    --color-primary: #5b9cf5; --color-primary-hover: #3d84f0;
    --color-primary-active: #2670e0; --color-primary-highlight: #1e2a40;
    --color-accent: #e8c849; --color-accent-hover: #d4b43c; --color-accent-highlight: #2e2a1a;
    --color-success: #4ade80; --color-success-hover: #22c55e; --color-success-highlight: #1a2e22;
    --color-canada: #f87171; --color-canada-highlight: #2e1a1a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2); --shadow-md: 0 4px 12px rgba(0,0,0,0.3); --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
  }
}

/* ===== LAYOUT ===== */
.app-container { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* ===== HEADER ===== */
.app-header {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-4) var(--space-4) var(--space-3);
  position: sticky; top: 0; z-index: 100;
}
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.header-top h1 {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700;
  display: flex; align-items: center; gap: var(--space-2);
}
.header-actions { display: flex; gap: var(--space-2); align-items: center; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.1);
}
.icon-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* Trip selector in header */
.trip-selector {
  display: flex; align-items: center; gap: var(--space-2);
  background: rgba(255,255,255,0.12); border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3); cursor: pointer;
  font-size: var(--text-xs); color: rgba(255,255,255,0.9); font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2); max-width: 180px;
}
.trip-selector:hover { background: rgba(255,255,255,0.2); }
.trip-selector span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Stats bar */
.stats-bar { display: flex; gap: var(--space-4); }
.stat-item { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); opacity: 0.9; }
.stat-number { font-weight: 700; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }

/* ===== TABS ===== */
.tabs {
  display: flex; background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}
.tab-btn {
  flex: 1; padding: var(--space-3) var(--space-4); font-size: var(--text-sm);
  font-weight: 600; color: var(--color-text-muted);
  border-bottom: 2px solid transparent; text-align: center; background: none;
}
.tab-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* ===== TAB CONTENT ===== */
.tab-content { display: none; flex: 1; overflow-y: auto; }
.tab-content.active { display: block; }

/* ===== SEARCH ===== */
.search-bar {
  padding: var(--space-3) var(--space-4); background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}
.search-input-wrap { position: relative; }
.search-input-wrap svg {
  position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%);
  color: var(--color-text-faint); width: 18px; height: 18px; pointer-events: none;
}
.search-input {
  width: 100%; padding: var(--space-2) var(--space-3) var(--space-2) var(--space-10);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface-2); font-size: var(--text-sm);
}
.search-input::placeholder { color: var(--color-text-faint); }
.search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-highlight); }

/* ===== FILTER CHIPS ===== */
.filter-chips {
  display: flex; gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-3);
  overflow-x: auto; background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 500;
  border: 1px solid var(--color-border); color: var(--color-text-muted);
  background: var(--color-surface); flex-shrink: 0;
}
.chip:hover { background: var(--color-surface-offset); }
.chip.active { background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary); }

/* ===== PLATE CARDS (KY) ===== */
.plate-list { padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.section-header {
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 700;
  color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em;
  padding: var(--space-3) 0 var(--space-1); border-bottom: 1px solid var(--color-divider);
  display: flex; justify-content: space-between; align-items: center;
}
.section-count { font-size: var(--text-xs); font-weight: 400; text-transform: none; letter-spacing: normal; color: var(--color-text-faint); }

.plate-card {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); cursor: pointer; min-height: 64px; text-align: left; width: 100%;
}
.plate-card:hover { background: var(--color-surface-offset); border-color: var(--color-primary); }
.plate-card.spotted { background: var(--color-success-highlight); border-color: var(--color-success); }

/* Plate image thumbnail */
.plate-thumb {
  width: 72px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); object-fit: cover;
  flex-shrink: 0; background: var(--color-surface-offset);
}
.plate-thumb-placeholder {
  width: 72px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); flex-shrink: 0;
  background: var(--color-surface-offset); display: flex;
  align-items: center; justify-content: center;
}

.plate-check {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  border: 2px solid var(--color-border); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; color: transparent;
}
.plate-card.spotted .plate-check { background: var(--color-success); border-color: var(--color-success); color: white; }

.plate-info { flex: 1; min-width: 0; }
.plate-name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); line-height: 1.3; }
.plate-meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.plate-date { font-size: var(--text-xs); color: var(--color-success); font-weight: 500; }

/* ===== STATE GRID ===== */
.state-section { padding: var(--space-4) var(--space-4) var(--space-2); }
.state-section-header {
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 700;
  color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em;
  padding-bottom: var(--space-2); border-bottom: 2px solid var(--color-divider);
  margin-bottom: var(--space-3); display: flex; align-items: center; gap: var(--space-2);
}
.state-section-header .flag { font-size: 1.2em; }

.state-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: var(--space-2);
}
.state-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-2) var(--space-2) var(--space-3); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  cursor: pointer; text-align: center; gap: 2px; min-height: 74px; width: 100%;
  position: relative;
}
.state-card:hover { background: var(--color-surface-offset); border-color: var(--color-primary); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.state-card.both-spotted { background: var(--color-success-highlight); border-color: var(--color-success); }
.state-card.canada-spotted { background: var(--color-canada-highlight); border-color: var(--color-canada); }

/* Yellow = truck only, no car */
.state-card.truck-spotted { background: #fefce8; border-color: #ca8a04; }
[data-theme='dark'] .state-card.truck-spotted { background: #1c1a00; border-color: #d97706; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .state-card.truck-spotted { background: #1c1a00; border-color: #d97706; }
}
.state-card.truck-spotted .state-abbr { color: #ca8a04; }
[data-theme='dark'] .state-card.truck-spotted .state-abbr { color: #fbbf24; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .state-card.truck-spotted .state-abbr { color: #fbbf24; }
}
.state-card.truck-spotted .state-date { color: #ca8a04; }
[data-theme='dark'] .state-card.truck-spotted .state-date { color: #fbbf24; }

/* Car-only = orange */
.state-card.car-spotted { background: #fff7ed; border-color: #ea580c; }
[data-theme='dark'] .state-card.car-spotted { background: #1f1000; border-color: #f97316; }
  :root:not([data-theme]) .state-card.car-spotted { background: #1f1000; border-color: #f97316; }
.state-card.car-spotted .state-abbr { color: #ea580c; }
[data-theme='dark'] .state-card.car-spotted .state-abbr { color: #fb923c; }
  :root:not([data-theme]) .state-card.car-spotted .state-abbr { color: #fb923c; }
.state-card.car-spotted .state-date { color: #ea580c; }
[data-theme='dark'] .state-card.car-spotted .state-date { color: #fb923c; }

/* Vehicle icons row at top of each state card */
.state-icons {
  display: flex; flex-direction: row;
  justify-content: space-between; align-items: center;
  width: 100%; height: 14px; margin-bottom: 2px;
}
.vehicle-icon { width: 12px; height: 12px; flex-shrink: 0; }
.car-icon { color: var(--color-success); }
.truck-icon { color: #ca8a04; }
[data-theme='dark'] .truck-icon { color: #fbbf24; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .truck-icon { color: #fbbf24; }
}
.state-card.canada-spotted .car-icon { color: var(--color-canada); }
.icon-placeholder { width: 12px; height: 12px; flex-shrink: 0; display: block; }

.state-abbr { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; color: var(--color-text); line-height: 1; }
.state-card.both-spotted .state-abbr { color: var(--color-success); }
.state-card.canada-spotted .state-abbr { color: var(--color-canada); }

.state-name { font-size: 0.6rem; color: var(--color-text-muted); line-height: 1.2; }
.state-date { font-size: 0.55rem; color: var(--color-success); font-weight: 600; line-height: 1; }
.state-card.canada-spotted .state-date { color: var(--color-canada); }

/* ===== PROGRESS BAR ===== */
.progress-section {
  padding: var(--space-4); background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}
.progress-label { display: flex; justify-content: space-between; font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); }
.progress-bar { width: 100%; height: 10px; background: var(--color-surface-offset); border-radius: var(--radius-full); overflow: hidden; margin-bottom: var(--space-1); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--color-primary), var(--color-accent)); border-radius: var(--radius-full); transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.progress-sub { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: var(--space-8); left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-text); color: var(--color-bg);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: 600; box-shadow: var(--shadow-lg);
  z-index: 200; opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300;
  display: none; align-items: flex-end; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--color-surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-6); width: 100%; max-width: 480px; max-height: 75vh; overflow-y: auto;
}
.modal h2 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-4); }
.modal p { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.modal-btn {
  width: 100%; padding: var(--space-3); border-radius: var(--radius-lg);
  font-weight: 600; font-size: var(--text-sm); margin-top: var(--space-2);
}
.modal-btn.primary { background: var(--color-primary); color: var(--color-text-inverse); }
.modal-btn.primary:hover { background: var(--color-primary-hover); }
.modal-btn.danger { background: transparent; color: #dc2626; border: 1px solid #dc2626; }
.modal-btn.danger:hover { background: #fef2f2; }
.modal-btn.secondary { background: var(--color-surface-offset); color: var(--color-text); }

/* ===== TRIP LIST ===== */
.trip-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border-radius: var(--radius-lg);
  border: 1px solid var(--color-border); background: var(--color-surface);
  margin-bottom: var(--space-2); cursor: pointer;
}
.trip-item:hover { border-color: var(--color-primary); background: var(--color-surface-offset); }
.trip-item.active-trip { border-color: var(--color-primary); background: var(--color-primary-highlight); }
.trip-item-info { flex: 1; min-width: 0; }
.trip-item-name { font-weight: 600; font-size: var(--text-sm); }
.trip-item-stats { font-size: var(--text-xs); color: var(--color-text-muted); }
.trip-actions { display: flex; gap: var(--space-1); }
.trip-icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); background: var(--color-surface-offset);
}
.trip-icon-btn:hover { color: var(--color-text); }

/* ===== SAVE CODE ===== */
.save-code-box {
  background: var(--color-primary-highlight); border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg); padding: var(--space-4); text-align: center;
  margin-bottom: var(--space-4);
}
.save-code-label { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-1); }
.save-code { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; color: var(--color-primary); letter-spacing: 0.05em; }
.save-code-hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }

/* ===== FORM ===== */
.form-group { margin-bottom: var(--space-3); }
.form-label { display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-1); }
.form-input {
  width: 100%; padding: var(--space-3); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface-2);
  font-size: var(--text-sm); font-family: var(--font-body);
}
.form-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-highlight); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: var(--space-12) var(--space-8); color: var(--color-text-muted); }
.empty-state svg { margin: 0 auto var(--space-4); color: var(--color-text-faint); }
.empty-state p { font-size: var(--text-sm); max-width: 100%; }

@media (min-width: 481px) {
  .state-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== PLATE ZOOM MODAL ===== */
.zoom-modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  width: calc(100% - var(--space-8));
  max-width: 360px;
  position: relative;
}
.zoom-close {
  position: absolute; top: var(--space-3); right: var(--space-3);
  background: var(--color-surface-offset); border: none;
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--color-text);
}

/* ===== VEHICLE PICKER MODAL ===== */
#vehiclePickerModal {
  align-items: center; /* center vertically, not bottom-sheet */
}

.picker-modal {
  border-radius: var(--radius-xl);
  max-width: 320px;
  width: calc(100% - var(--space-8));
}

.picker-buttons {
  display: flex; flex-direction: row;
  gap: var(--space-3);
}

.picker-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--space-2); padding: var(--space-4) var(--space-3);
  border: 2px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface-2); color: var(--color-text);
  font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; transition: all var(--transition-interactive);
  min-height: 80px;
}
.picker-btn:hover { border-color: var(--color-primary); background: var(--color-primary-highlight); }
.picker-btn.active {
  background: var(--color-success); border-color: var(--color-success);
  color: #fff;
}
.picker-btn svg { display: block; }

/* ===== DEEP DIVE DROPDOWN TAB ===== */
.tab-dropdown {
  position: relative;
  display: inline-flex;
}

.tab-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.tab-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 200;
  min-width: 140px;
  overflow: hidden;
}

.tab-dropdown-menu.open {
  display: block;
}

.tab-dropdown-item {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  transition: background 0.15s;
}

.tab-dropdown-item:hover {
  background: var(--color-surface-offset);
}

.tab-dropdown-item.active {
  color: var(--color-primary);
  background: var(--color-surface-offset);
}

/* ===== TOP BAR TRIP SELECTOR ===== */
.trip-selector-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.1;
}

.trip-code-small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  opacity: 0.85;
  text-transform: uppercase;
  white-space: nowrap;
}

.trip-code-small:empty {
  display: none;
}

/* ── Version label ───────────────────────────────────────────────────────── */
.app-version {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* ── No Image Available placeholder ─────────────────────────────────────── */
.plate-thumb-placeholder { display:flex; align-items:center; justify-content:center; width:100%; }
.plate-no-img-svg { width:100%; height:auto; max-width:90px; }

/* ── Car Colors Tab ──────────────────────────────────────────────────────── */
.colors-hint {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  text-align: center;
  padding: var(--space-2) var(--space-4) var(--space-3);
}
.colors-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-6);
}
.color-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition-interactive), transform var(--transition-interactive);
  text-align: left;
  width: 100%;
  position: relative;
}
.color-card:active { transform: scale(0.98); }
.color-card.color-spotted {
  border-color: var(--color-primary);
  background: var(--color-primary-highlight);
}
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.color-info { flex: 1; min-width: 0; }
.color-name  { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); }
.color-count { font-size: var(--text-xs); color: var(--color-text-3); margin-top: 1px; }
.color-badge {
  min-width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-1);
}

/* ── Stats Modal ─────────────────────────────────────────────────────────── */
.stats-modal {
  max-height: 88vh;
  overflow-y: auto;
  width: min(500px, 95vw);
}
.stats-summary {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.stats-summary-item {
  flex: 1;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
  text-align: center;
}
.stats-big-num   { font-size: var(--text-lg); font-weight: 700; color: var(--color-primary); }
.stats-big-label { font-size: var(--text-xs); color: var(--color-text-3); margin-top: 2px; }
.stats-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-3);
  margin-bottom: var(--space-2);
}
.stats-state-grid { display: flex; flex-direction: column; gap: 3px; }
.stats-state-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}
.stats-state-row.spotted-state { background: var(--color-success-highlight); }
.stats-state-code { width: 2.5rem; font-size: var(--text-xs); font-weight: 700; flex-shrink: 0; }
.stats-state-name { flex: 1; font-size: var(--text-xs); color: var(--color-text-2); }
.stats-state-cnt  { font-size: var(--text-xs); font-weight: 700; color: var(--color-primary); min-width: 2rem; text-align: right; }
.stats-game-row {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}
.stats-game-name   { font-size: var(--text-sm); font-weight: 600; }
.stats-game-detail { font-size: var(--text-xs); color: var(--color-text-3); margin-top: 2px; }
.stats-colors-grid { display: flex; flex-direction: column; gap: 3px; }
.stats-color-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}
.stats-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid;
  flex-shrink: 0;
}
