:root {
  --bg: #f5f5f5;
  --card-bg: white;
  --text: #333;
  --text-muted: #666;
  --text-faint: #999;
  --border: #ddd;
  --border-light: #eee;
  --primary: #2d5a27;
  --primary-dark: #1e3d1a;
  --summary-bg: #f8f9fa;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --card-bg: #2d2d2d;
    --text: #e5e5e5;
    --text-muted: #aaa;
    --text-faint: #777;
    --border: #444;
    --border-light: #3a3a3a;
    --primary: #4a8c42;
    --primary-dark: #3d7336;
    --summary-bg: #363636;
  }
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
  background: var(--bg);
  color: var(--text);
}
h1 { color: var(--primary); margin-bottom: 8px; }
.subtitle { color: var(--text-muted); margin-bottom: 24px; }
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
input {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
}
input:focus { outline: none; border-color: var(--primary); }
button {
  padding: 12px 24px;
  font-size: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
button:hover { background: var(--primary-dark); }
button:disabled { background: #999; cursor: not-allowed; }
.btn-secondary {
  background: #6c757d;
  padding: 8px 16px;
  font-size: 14px;
}
.btn-secondary:hover { background: #545b62; }
.btn-small {
  padding: 4px 8px;
  font-size: 12px;
  background: #dc3545;
}
.btn-small:hover { background: #c82333; }

/* Saved locations */
.saved-locations {
  margin-bottom: 24px;
}
.saved-locations h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.saved-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.saved-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}
.saved-chip:hover { border-color: var(--primary); }
.saved-chip .remove {
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
}
.saved-chip .remove:hover { color: #dc3545; }

/* Results */
.results { display: none; }
.pollen-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}
.card-header h3 { margin: 0; }
.header-buttons {
  display: flex;
  gap: 8px;
}
.pollen-type {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.pollen-type:last-child { border-bottom: none; }
.type-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.type-icon {
  font-size: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--summary-bg);
  border-radius: 8px;
}
.type-name { font-weight: 600; }
.type-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.type-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Visual scale bar */
.scale-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 120px;
}
.scale-segment {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border-light);
  transition: background 0.3s ease;
}
.scale-segment.filled-0 { background: #6bc96b; }
.scale-segment.filled-1 { background: #9cd84b; }
.scale-segment.filled-2 { background: #ffeb3b; }
.scale-segment.filled-3 { background: #ff9800; }
.scale-segment.filled-4 { background: #f44336; }
.scale-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 24px;
  text-align: right;
}
.index-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
}
.index-badge.low { background: #d4edda; color: #155724; }
.index-badge.moderate { background: #fff3cd; color: #856404; }
.index-badge.high { background: #f8d7da; color: #721c24; }
.index-badge.very-high { background: #721c24; color: white; }
.comparison {
  font-size: 13px;
  color: var(--text-muted);
}
.comparison .above { color: #dc3545; }
.comparison .below { color: #28a745; }
.summary {
  margin: 0 0 16px 0;
  padding: 12px;
  background: var(--summary-bg);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
}
.peak-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--summary-bg);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.peak-info .peak-icon { font-size: 18px; }
.stats-note {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 8px;
}
.error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 8px;
  display: none;
}

/* Loading skeleton */
.loading-skeleton {
  display: none;
}
.skeleton-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.skeleton-buttons {
  display: flex;
  gap: 8px;
}
.skeleton-line {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--summary-bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
.skeleton-title {
  width: 180px;
  height: 24px;
}
.skeleton-btn {
  width: 70px;
  height: 32px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--summary-bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-summary {
  width: 100%;
  height: 60px;
  margin-bottom: 16px;
}
.skeleton-pollen-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.skeleton-pollen-item:last-child {
  border-bottom: none;
}
.skeleton-label {
  width: 80px;
  height: 20px;
}
.skeleton-badge {
  width: 100px;
  height: 28px;
  border-radius: 20px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Results with transitions */
.results {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.results.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Share toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* Compare view */
.compare-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.compare-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.compare-card h4 {
  margin: 0 0 12px 0;
  color: var(--primary);
}
.compare-card.error-card {
  background: #f8d7da;
  color: #721c24;
}
.nab-number-sm {
  font-size: 28px;
  font-weight: 700;
}
.nab-scale-sm {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}
.compare-triggers {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}


/* Ambee / NAB section */
.ambee-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.ambee-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* NAB hero display */
.nab-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--summary-bg);
  border-radius: 10px;
  margin-bottom: 8px;
}
.nab-index-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}
.nab-number {
  font-size: 52px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.nab-scale {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 400;
}
.nab-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nab-badge {
  font-size: 15px;
  padding: 5px 14px;
}
.nab-source {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Google secondary section */
.google-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.section-label {
  margin: 0 0 12px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ambee-counts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ambee-count-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--summary-bg);
  border-radius: 8px;
}
.ambee-count-item .count-type {
  font-weight: 600;
  min-width: 50px;
}
.ambee-count-item .count-value {
  flex: 1;
  font-size: 15px;
}
.ambee-count-item .count-unit {
  font-size: 12px;
  color: var(--text-muted);
}
.ambee-species {
  margin-top: 12px;
}
.ambee-species h5 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.species-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.species-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text);
}


/* Plant species section */
.plants-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.plants-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text-muted);
}
.plants-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plant-group {
  background: var(--summary-bg);
  border-radius: 8px;
  padding: 12px;
}
.plant-group-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.plant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.plant-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.plant-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.in-season-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  font-weight: 500;
}

.pollen-trend {
  font-size: 13px;
  padding: 4px 12px;
  color: var(--text-muted);
}
.species-type {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 2px;
}
.species-genus {
  font-size: 10px;
  font-style: italic;
  opacity: 0.6;
  margin-left: 2px;
}
