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

:root {
  --campfire-1: #0D0221;
  --campfire-2: #0A0E27;
  --campfire-3: #150E56;
  --campfire-4: #3D2C8D;
  --campfire-5: #C5C5C5;

  --bg-dark: #1a1118;
  --bg-card: #2a1f26;
  --bg-card-hover: #352a30;
  --bg-surface: #211820;
  --bg-input: #1e151c;

  --text-primary: #FFF3E0;
  --text-secondary: #c4a08a;
  --text-muted: #8a7068;

  --border: rgba(191, 54, 12, 0.2);
  --border-accent: rgba(255, 87, 34, 0.3);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(255, 87, 34, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

::selection {
  background: var(--campfire-3);
  color: white;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(191, 54, 12, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 87, 34, 0.05) 0%, transparent 50%);
}

/* ===== APP LAYOUT ===== */

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(42, 31, 38, 0.9) 0%, transparent 100%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.app-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--campfire-4);
  letter-spacing: -0.5px;
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.alert-count-badge {
  background: linear-gradient(135deg, var(--campfire-1), var(--campfire-2));
  color: var(--campfire-5);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 87, 34, 0.15); }
  50% { box-shadow: 0 0 20px rgba(255, 87, 34, 0.3); }
}

/* ===== TAB NAV ===== */

.tab-nav {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 87, 34, 0.08);
}

.tab-btn.active {
  color: var(--campfire-4);
  background: rgba(255, 87, 34, 0.12);
  box-shadow: inset 0 -2px 0 var(--campfire-4);
}

/* ===== MAIN ===== */

.app-main {
  flex: 1;
  padding: 0;
}

/* ===== MAP SECTION ===== */

.map-section {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}

.map-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.severity-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.refresh-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-accent);
  background: transparent;
  color: var(--campfire-4);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-btn:hover:not(:disabled) {
  background: rgba(255, 87, 34, 0.1);
}

.refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.map-wrapper {
  flex: 1;
  position: relative;
  min-height: 350px;
}

.weather-map {
  width: 100%;
  height: 100%;
}

.map-loading-overlay,
.map-error-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(26, 17, 24, 0.85);
  z-index: 10;
  gap: 12px;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--campfire-4);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Map markers & tooltips */

.custom-marker-icon {
  background: transparent !important;
  border: none !important;
}

.map-marker {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--campfire-3);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.severity-marker-extreme { border-color: var(--campfire-1); box-shadow: 0 0 12px rgba(191,54,12,0.5); }
.severity-marker-severe { border-color: var(--campfire-2); }
.severity-marker-moderate { border-color: var(--campfire-3); }
.severity-marker-minor { border-color: var(--campfire-4); }

.user-location-dot {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
}

.alert-tooltip {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-accent) !important;
  border-radius: var(--radius-sm) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.85rem !important;
  padding: 6px 12px !important;
  box-shadow: var(--shadow-md) !important;
}

.alert-tooltip::before {
  border-top-color: var(--border-accent) !important;
}

/* ===== ALERT CARDS STRIP ===== */

.alert-cards-strip {
  padding: 12px 24px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.strip-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.cards-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--campfire-3) var(--bg-dark);
}

.cards-scroll::-webkit-scrollbar {
  height: 6px;
}

.cards-scroll::-webkit-scrollbar-track {
  background: var(--bg-dark);
  border-radius: 3px;
}

.cards-scroll::-webkit-scrollbar-thumb {
  background: var(--campfire-3);
  border-radius: 3px;
}

.alert-card-mini {
  flex-shrink: 0;
  width: 200px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  animation: fadeSlideIn 0.3s ease both;
}

.alert-card-mini:nth-child(1) { animation-delay: 0s; }
.alert-card-mini:nth-child(2) { animation-delay: 0.05s; }
.alert-card-mini:nth-child(3) { animation-delay: 0.1s; }
.alert-card-mini:nth-child(4) { animation-delay: 0.15s; }
.alert-card-mini:nth-child(5) { animation-delay: 0.2s; }
.alert-card-mini:nth-child(6) { animation-delay: 0.25s; }
.alert-card-mini:nth-child(7) { animation-delay: 0.3s; }
.alert-card-mini:nth-child(8) { animation-delay: 0.35s; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-card-mini:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.severity-bg-extreme { border-left: 3px solid var(--campfire-1); }
.severity-bg-severe { border-left: 3px solid var(--campfire-2); }
.severity-bg-moderate { border-left: 3px solid var(--campfire-3); }
.severity-bg-minor { border-left: 3px solid var(--campfire-4); }

.card-icon {
  font-size: 1.2rem;
}

.card-event {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-area {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== SEVERITY BADGES ===== */

.severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-extreme {
  background: rgba(191, 54, 12, 0.25);
  color: #ff8a65;
  border: 1px solid rgba(191, 54, 12, 0.4);
}

.badge-severe {
  background: rgba(216, 67, 21, 0.25);
  color: #ffab91;
  border: 1px solid rgba(216, 67, 21, 0.4);
}

.badge-moderate {
  background: rgba(230, 74, 25, 0.2);
  color: #ffcc80;
  border: 1px solid rgba(230, 74, 25, 0.3);
}

.badge-minor {
  background: rgba(255, 87, 34, 0.15);
  color: #ffe0b2;
  border: 1px solid rgba(255, 87, 34, 0.25);
}

.badge-unknown {
  background: rgba(255, 243, 224, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-lg {
  padding: 4px 12px;
  font-size: 0.75rem;
}

/* ===== TIMELINE SECTION ===== */

.timeline-section {
  padding: 20px 24px;
}

.timeline-header {
  margin-bottom: 20px;
}

.severity-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.summary-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.chip-extreme { border-color: rgba(191, 54, 12, 0.4); }
.chip-severe { border-color: rgba(216, 67, 21, 0.4); }
.chip-moderate { border-color: rgba(230, 74, 25, 0.3); }
.chip-minor { border-color: rgba(255, 87, 34, 0.25); }

.chip-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--campfire-4);
}

.chip-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.timeline-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--campfire-4);
}

/* ===== TIMELINE LIST ===== */

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 16px 12px;
  border: none;
  background: transparent;
  text-align: left;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-md);
  width: 100%;
  animation: fadeSlideIn 0.3s ease both;
}

.timeline-item:nth-child(1) { animation-delay: 0s; }
.timeline-item:nth-child(2) { animation-delay: 0.04s; }
.timeline-item:nth-child(3) { animation-delay: 0.08s; }
.timeline-item:nth-child(4) { animation-delay: 0.12s; }
.timeline-item:nth-child(5) { animation-delay: 0.16s; }
.timeline-item:nth-child(6) { animation-delay: 0.2s; }
.timeline-item:nth-child(7) { animation-delay: 0.24s; }
.timeline-item:nth-child(8) { animation-delay: 0.28s; }
.timeline-item:nth-child(9) { animation-delay: 0.32s; }
.timeline-item:nth-child(10) { animation-delay: 0.36s; }

.timeline-item:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.timeline-marker-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 40px;
}

.timeline-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.dot-extreme { border-color: var(--campfire-1); box-shadow: 0 0 10px rgba(191,54,12,0.3); }
.dot-severe { border-color: var(--campfire-2); }
.dot-moderate { border-color: var(--campfire-3); }
.dot-minor { border-color: var(--campfire-4); }

.timeline-line {
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: linear-gradient(180deg, var(--border-accent), transparent);
  margin-top: 4px;
}

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

.timeline-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-event {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-area {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.timeline-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.meta-item {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-times {
  display: flex;
  gap: 16px;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ===== EMPTY STATE ===== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== DETAIL OVERLAY ===== */

.detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-close:hover {
  background: var(--campfire-1);
  color: white;
  border-color: var(--campfire-1);
}

.detail-header {
  padding: 24px 24px 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.severity-header-extreme { border-top: 3px solid var(--campfire-1); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.severity-header-severe { border-top: 3px solid var(--campfire-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.severity-header-moderate { border-top: 3px solid var(--campfire-3); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.severity-header-minor { border-top: 3px solid var(--campfire-4); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.severity-header-unknown { border-top: 3px solid var(--campfire-5); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

.detail-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.detail-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-event {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-right: 40px;
}

.detail-body {
  padding: 20px 24px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.meta-block {
  background: var(--bg-surface);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.meta-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.meta-value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Timeline bar */

.detail-timeline-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.time-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
  min-width: 80px;
}

.time-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.time-value {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.time-connector {
  flex: 1;
  height: 2px;
  min-width: 20px;
  background: linear-gradient(90deg, var(--campfire-3), var(--campfire-4));
  margin: 0 8px;
}

/* Detail sections */

.detail-section {
  margin-bottom: 16px;
}

.detail-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--campfire-4);
  margin-bottom: 8px;
}

.detail-headline-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.5;
}

.detail-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.instruction-section {
  background: rgba(191, 54, 12, 0.1);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(191, 54, 12, 0.2);
}

.detail-instruction {
  font-size: 0.85rem;
  color: var(--campfire-5);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Detail actions */

.detail-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.action-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}

.share-btn {
  background: linear-gradient(135deg, var(--campfire-2), var(--campfire-3));
  border: none;
  color: white;
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.close-action-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.close-action-btn:hover {
  background: var(--bg-surface);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 640px) {
  .app-header {
    padding: 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left {
    flex-direction: column;
    gap: 2px;
  }

  .app-title {
    font-size: 1.2rem;
  }

  .tab-nav {
    padding: 8px 16px;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .map-controls {
    padding: 8px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .severity-legend {
    gap: 10px;
  }

  .alert-cards-strip {
    padding: 10px 16px 14px;
  }

  .alert-card-mini {
    width: 170px;
    padding: 10px;
  }

  .timeline-section {
    padding: 16px;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .detail-timeline-bar {
    flex-direction: column;
    gap: 8px;
  }

  .time-connector {
    width: 2px;
    height: 16px;
    min-width: 2px;
  }

  .detail-panel {
    max-height: 90vh;
    border-radius: var(--radius-md);
  }

  .detail-actions {
    flex-direction: column;
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to StormWatch — your severe weather alert map. The app automatically loads active weather warnings from the National Weather Service.", "view": "user", "highlight_selector": ".app-header", "wait_for": "auto"},
  {"step": 2, "narration": "The interactive map shows color-coded alert zones. Red zones indicate extreme severity, orange for severe, and lighter colors for moderate and minor warnings.", "view": "user", "highlight_selector": ".map-wrapper", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "The severity legend at the top of the map helps you quickly identify alert levels. Click the refresh button to load the latest data.", "view": "user", "highlight_selector": ".map-controls", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Scroll through the active alerts strip below the map. Each card shows the alert type, affected area, and severity level. Click any card for full details.", "view": "user", "highlight_selector": ".alert-cards-strip", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Switch to the Timeline tab to see all alerts in a chronological view. Filter by severity or sort by newest, expiring soon, or severity level.", "view": "user", "highlight_selector": ".tab-nav", "wait_for": "user_interaction"},
  {"step": 6, "narration": "The timeline shows severity counts at the top and detailed alert entries below. Each entry shows timing, affected area, and source information.", "view": "user", "highlight_selector": ".timeline-header", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "Click any alert — on the map, in the card strip, or in the timeline — to see the full detail panel with description, safety instructions, and a share button.", "view": "user", "highlight_selector": ".detail-panel", "wait_for": "tap_to_continue"}
]
-->

.timeline-presence-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
}

.presence-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
  animation: presence-pulse 1.8s ease-in-out infinite;
}

.presence-label {
  color: var(--text-muted);
  font-weight: 500;
}

.presence-count {
  color: var(--text-primary);
  font-weight: 700;
}

@keyframes presence-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.2); opacity: 1; }
}

.map-share-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.share-filter-select,
.share-text-input {
  min-height: 36px;
}

.share-text-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  width: 150px;
}

.share-text-input::placeholder {
  color: var(--text-muted);
}

.share-text-input:focus {
  outline: none;
  border-color: var(--campfire-4);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-native-btn {
  color: var(--campfire-5);
  border-color: rgba(255, 243, 224, 0.25);
}

.share-notice {
  margin: 10px 24px 0;
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 87, 34, 0.12);
  border: 1px solid var(--border-accent);
  color: var(--campfire-5);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .map-share-controls {
    width: 100%;
  }

  .share-text-input {
    width: 100%;
    flex: 1 1 140px;
  }

  .share-notice {
    margin: 8px 16px 0;
  }
}

.history-analytics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.analytics-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analytics-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.4;
}

.analytics-list {
  font-weight: 500;
}

@media (max-width: 640px) {
  .history-analytics {
    grid-template-columns: 1fr;
  }
}

.timeline-chart-panel {
  margin: 16px 0 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.timeline-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.timeline-chart-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-chart-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-chart-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.timeline-chart-wrap {
  height: 280px;
  position: relative;
}

.alert-frequency-chart {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.chart-empty-state {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--bg-surface);
  text-align: center;
  padding: 16px;
}

@media (max-width: 640px) {
  .timeline-chart-panel {
    padding: 12px;
  }

  .timeline-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .timeline-chart-total {
    align-items: flex-start;
    text-align: left;
  }

  .timeline-chart-wrap {
    height: 240px;
  }
}
