@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #B2DFDB;
  --primary-light: #80CBC4;
  --primary-dark: #4DB6AC;
  --primary-glow: rgba(245, 158, 11, 0.15);
  --emerald: #00796B;
  --emerald-light: #E0F2F1;
  --emerald-bg: rgba(16, 185, 129, 0.1);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.1);
  --violet: #8b5cf6;
  --violet-bg: rgba(139, 92, 246, 0.1);
  --amber-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --bg: #0f172a;
  --bg-raised: #1e293b;
  --bg-card: #1e293b;
  --bg-input: #0f172a;
  --border: #334155;
  --border-light: #475569;
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
}

::selection {
  background: var(--primary);
  color: var(--bg);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4)); }
  50% { filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.7)); }
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

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

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 0.25rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 0;
  width: 100%;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

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

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(245, 158, 11, 0.05);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-active .status-dot {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: status-pulse 1.5s ease-in-out infinite;
}

.status-active {
  color: var(--emerald);
}

.status-idle .status-dot {
  background: var(--text-muted);
}

.status-idle {
  color: var(--text-muted);
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.7); }
}

.last-update {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

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

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-amber { border-top: 3px solid var(--primary); }
.stat-emerald { border-top: 3px solid var(--emerald); }
.stat-blue { border-top: 3px solid var(--blue); }
.stat-violet { border-top: 3px solid var(--violet); }

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-amber .stat-icon-wrap { background: var(--amber-bg); }
.stat-emerald .stat-icon-wrap { background: var(--emerald-bg); }
.stat-blue .stat-icon-wrap { background: var(--blue-bg); }
.stat-violet .stat-icon-wrap { background: var(--violet-bg); }

.stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-unit {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Chart Section */
.chart-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.4s ease both;
  animation-delay: 0.2s;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

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

.chart-wrapper-tall {
  height: 340px;
}

.empty-chart, .empty-log, .empty-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.empty-chart p, .empty-log p, .empty-table p {
  font-size: 0.9rem;
  max-width: 360px;
}

/* Week Bars */
.week-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  animation: fadeInUp 0.4s ease both;
  animation-delay: 0.25s;
}

.week-bars {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  height: 180px;
  padding-top: 1rem;
}

.week-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
}

.week-bar-value {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

.week-bar-track {
  flex: 1;
  width: 100%;
  max-width: 48px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.week-bar-fill {
  width: 100%;
  background: linear-gradient(to top, var(--primary-dark), var(--primary-light));
  border-radius: var(--radius-xs);
  transition: height 0.6s ease;
  min-height: 2px;
}

.week-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* History Page */
.history {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.range-selector {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  border: 1px solid var(--border);
}

.range-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
}

.range-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.range-btn.active {
  background: var(--primary);
  color: var(--bg);
}

.export-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.export-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-muted);
}

.export-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.summary-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  animation: fadeInUp 0.4s ease both;
}

.summary-card:nth-child(1) { animation-delay: 0s; }
.summary-card:nth-child(2) { animation-delay: 0.05s; }
.summary-card:nth-child(3) { animation-delay: 0.1s; }

.summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.summary-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

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

.best-day-date {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Data Table */
.data-table-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-date {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.table-kwh {
  color: var(--emerald-light);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.table-peak {
  color: var(--primary-light);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.data-table.compact td {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

/* Webhook Panel */
.webhook-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.webhook-info-card,
.manual-entry-card,
.webhook-log-card,
.recent-readings-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  animation: fadeInUp 0.4s ease both;
}

.webhook-info-card { animation-delay: 0s; }
.manual-entry-card { animation-delay: 0.05s; }
.webhook-log-card { animation-delay: 0.1s; }
.recent-readings-card { animation-delay: 0.15s; }

.webhook-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.webhook-format h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--primary-light);
  overflow-x: auto;
  line-height: 1.6;
}

.webhook-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.webhook-note code {
  background: rgba(245, 158, 11, 0.1);
  color: var(--primary-light);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

/* Manual Form */
.manual-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  min-height: 44px;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.primary-btn {
  padding: 0.65rem 1.5rem;
  background: var(--primary);
  border: none;
  color: var(--bg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  min-height: 44px;
  align-self: flex-start;
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

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

/* Log */
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

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

.log-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
}

.log-time {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  white-space: nowrap;
}

.log-status {
  font-size: 0.75rem;
}

.log-data {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Readings */
.readings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.readings-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.source-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  font-weight: 500;
}

.source-badge.webhook {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
}

.source-badge.manual {
  background: rgba(139, 92, 246, 0.1);
  color: var(--violet);
}

.icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.text-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Loading Skeletons */
.loading-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.skeleton-card {
  height: 110px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-chart {
  height: 300px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-table {
  height: 200px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

/* Responsive */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .history-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 1rem;
  }

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

  .tab-nav {
    padding: 0.5rem 1rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .main-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .stat-icon-wrap {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .history-summary-grid {
    grid-template-columns: 1fr;
  }

  .history-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .range-selector {
    align-self: stretch;
  }

  .range-btn {
    flex: 1;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .status-bar {
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
  }

  .week-bars {
    height: 140px;
  }

  .chart-wrapper {
    height: 220px;
  }

  .chart-wrapper-tall {
    height: 260px;
  }

  .skeleton-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to SolarPulse — your personal solar production monitoring dashboard. The main view shows real-time stats from your solar panels.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "The status bar at the top shows whether your system is actively producing power and when the last reading was received.", "view": "user", "highlight_selector": ".status-bar", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Four stat cards give you an instant snapshot — current output in watts, today's total production in kWh, peak power, and average output.", "view": "user", "highlight_selector": ".stats-grid", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Below the stats, a production curve chart shows how your output has varied throughout the day, and a 7-day bar chart shows recent daily totals.", "view": "user", "highlight_selector": ".chart-section", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Switch to the History tab to see longer-term production data with daily breakdowns, exportable to CSV.", "view": "user", "highlight_selector": ".tab-nav", "wait_for": "user_interaction"},
  {"step": 6, "narration": "Use the range selector to view 7 days, 30 days, or 90 days of historical data. The chart shows both daily production and peak power.", "view": "user", "highlight_selector": ".range-selector", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "The Data Feed tab shows webhook integration details. Your solar monitoring device sends POST requests with production data in JSON format.", "view": "user", "highlight_selector": ".webhook-info-card", "wait_for": "tap_to_continue"},
  {"step": 8, "narration": "You can also add readings manually for testing. Enter power in watts and energy in kWh, then click Add Reading.", "view": "user", "highlight_selector": ".manual-entry-card", "wait_for": "user_interaction"},
  {"step": 9, "narration": "Webhook events appear in real-time in the event log, and all recent readings are listed below with their source (webhook or manual).", "view": "user", "highlight_selector": ".recent-readings-card", "wait_for": "tap_to_continue"}
]
-->

.anomaly-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  animation: fadeInUp 0.4s ease both;
}

.anomaly-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.anomaly-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.anomaly-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.anomaly-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-light);
}

.status-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary-light);
}

.status-notice {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.status-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
}

.anomaly-success {
  border-color: rgba(16, 185, 129, 0.25);
}

.anomaly-warning {
  border-color: rgba(245, 158, 11, 0.25);
}

.anomaly-notice {
  border-color: rgba(59, 130, 246, 0.25);
}

.anomaly-neutral {
  border-color: rgba(148, 163, 184, 0.18);
}

.anomaly-card {\n  background: var(--bg-card);\n  border-radius: var(--radius);\n  padding: 1.25rem;\n  border: 1px solid var(--border);\n  animation: fadeInUp 0.4s ease both;\n}\n\n.anomaly-card-header {\n  display: flex;\n  align-items: flex-start;\n  justify-content: space-between;\n  gap: 1rem;\n  margin-bottom: 0.6rem;\n}\n\n.anomaly-title {\n  font-size: 0.95rem;\n  font-weight: 600;\n  color: var(--text);\n}\n\n.anomaly-message {\n  font-size: 0.9rem;\n  color: var(--text-secondary);\n  line-height: 1.6;\n}\n\n.anomaly-meta {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 0.75rem 1rem;\n  margin-top: 0.85rem;\n  font-size: 0.78rem;\n  color: var(--text-muted);\n}\n\n.status-pill {\n  padding: 0.35rem 0.7rem;\n  border-radius: 999px;\n  font-size: 0.75rem;\n  font-weight: 600;\n  white-space: nowrap;\n}\n\n.status-success {\n  background: rgba(16, 185, 129, 0.12);\n  color: var(--emerald-light);\n}\n\n.status-warning {\n  background: rgba(245, 158, 11, 0.12);\n  color: var(--primary-light);\n}\n\n.status-notice {\n  background: rgba(59, 130, 246, 0.12);\n  color: #60a5fa;\n}\n\n.status-neutral {\n  background: rgba(148, 163, 184, 0.12);\n  color: var(--text-secondary);\n}\n\n.anomaly-success {\n  border-color: rgba(16, 185, 129, 0.25);\n}\n\n.anomaly-warning {\n  border-color: rgba(245, 158, 11, 0.25);\n}\n\n.anomaly-notice {\n  border-color: rgba(59, 130, 246, 0.25);\n}\n\n.anomaly-neutral {\n  border-color: rgba(148, 163, 184, 0.18);\n}\n\n.export-filter-card {\n  background: var(--bg-card);\n  border-radius: var(--radius);\n  padding: 1.25rem;\n  border: 1px solid var(--border);\n  display: flex;\n  flex-direction: column;\n  gap: 1rem;\n}\n\n.export-filter-desc {\n  font-size: 0.9rem;\n  color: var(--text-secondary);\n  max-width: 760px;\n}\n\n.export-filter-grid {\n  display: grid;\n  grid-template-columns: 1fr 1fr auto;\n  gap: 0.75rem 1rem;\n  align-items: end;\n}\n\n.export-filter-grid .form-group span {\n  font-size: 0.75rem;\n  color: var(--text-muted);\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.04em;\n}\n\n.export-range-btn {\n  justify-self: start;\n}\n\n.export-filter-meta {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 0.5rem 1rem;\n  font-size: 0.8rem;\n  color: var(--text-muted);\n}\n

.analysis-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  animation: fadeInUp 0.4s ease both;
}

.analysis-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.analysis-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 760px;
}

.analysis-btn {
  white-space: nowrap;
}

.analysis-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
}

.analysis-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.analysis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.analysis-error {
  font-size: 0.85rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .analysis-header,
  .export-filter-grid {
    grid-template-columns: 1fr;
  }

  .analysis-header {
    flex-direction: column;
  }

  .analysis-btn {
    width: 100%;
  }
}
