* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1216;
  color: #e6e9ef;
  margin: 0;
  padding: 24px;
}
h1 { font-weight: 600; margin-bottom: 20px; }
h2.section { font-size: 16px; color: #9aa4b2; margin: 24px 0 12px; font-weight: 600; }
.cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card {
  background: #1a1f27;
  border-radius: 12px;
  padding: 20px 24px;
  min-width: 200px;
  flex: 1;
}
.card.highlight { background: #16321f; border: 1px solid #2f7d4d; }
.card h2 { margin: 0 0 8px; font-size: 15px; color: #9aa4b2; text-transform: uppercase; letter-spacing: 0.05em; }
.card .power { font-size: 32px; font-weight: 700; color: #4ade80; }
.card .energy { font-size: 14px; color: #c3c9d3; margin-top: 4px; }
.card .string1 { font-size: 12px; color: #9aa4b2; margin-top: 4px; }
.card .updated { font-size: 12px; color: #6b7280; margin-top: 8px; }
.card .forecast { font-size: 12px; color: #9aa4b2; margin-top: 4px; }
.card .forecast .live { color: #facc15; font-weight: 600; }
.card .forecast .sun-times { color: #6b7280; margin-bottom: 2px; }
.card .forecast .deviation { color: #f87171; margin-top: 4px; line-height: 1.5; }
h3.subsection { font-size: 13px; color: #6b7280; margin: 4px 0 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.breakdown {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: #1a1f27;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.breakdown .stat { display: flex; flex-direction: column; min-width: 110px; }
.breakdown .label { font-size: 11px; color: #9aa4b2; text-transform: uppercase; letter-spacing: 0.05em; }
.breakdown .value { font-size: 18px; font-weight: 600; color: #e6e9ef; margin-top: 2px; }
canvas { max-width: 100%; }

.chart-wrapper {
  background: #1a1f27;
  border-radius: 12px;
  padding: 16px;
  height: 320px;
  position: relative;
}
.chart-wrapper-wide { height: 380px; margin-bottom: 24px; }

.chart-nodata {
  display: none;
  position: absolute;
  inset: 16px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  color: #9aa4b2;
  font-size: 13px;
  padding: 0 20px;
}
.chart-nodata .nodata-total { font-size: 28px; font-weight: 700; color: #4ade80; }
.chart-nodata .nodata-label { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.chart-nodata .nodata-note { font-size: 12px; color: #6b7280; max-width: 320px; }
.chart-wrapper.no-data .chart-nodata { display: flex; }
.chart-wrapper.no-data canvas { visibility: hidden; }

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid #2a3140;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label { font-size: 13px; color: #9aa4b2; }
.summary-row .value { font-size: 15px; font-weight: 600; color: #e6e9ef; }

.date-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.date-picker-row label { font-size: 14px; color: #9aa4b2; }
.date-picker-row input, .date-picker-row button,
.add-subscriber-row input, .add-subscriber-row button,
#subscribers-locked input, #subscribers-locked button {
  background: #1a1f27;
  color: #e6e9ef;
  border: 1px solid #2a3140;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
}
.date-picker-row button, .add-subscriber-row button, #subscribers-locked button {
  cursor: pointer;
  background: #2a3140;
}
.date-picker-row button:hover, .add-subscriber-row button:hover, #subscribers-locked button:hover {
  background: #38455c;
}
.hm-granularity-btn.active {
  background: #4ade80;
  color: #0f1216;
  border-color: #4ade80;
  font-weight: 600;
}

.hm-stats-box {
  background: #171b22;
  border: 1px solid #2a3140;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.hm-pill-toggle {
  display: flex;
  border: 1px solid #2a3140;
  border-radius: 999px;
  overflow: hidden;
  width: fit-content;
  margin-bottom: 16px;
}
.hm-pill-toggle button {
  background: transparent;
  color: #9aa4b2;
  border: none;
  padding: 8px 22px;
  font-size: 14px;
  cursor: pointer;
}
.hm-pill-toggle button.active {
  background: #4ade80;
  color: #0f1216;
  font-weight: 600;
}
.hm-metric-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.hm-metric-btn {
  background: #1a1f27;
  color: #9aa4b2;
  border: 1px solid #2a3140;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.hm-metric-btn.active {
  background: #60a5fa;
  color: #0f1216;
  border-color: #60a5fa;
  font-weight: 600;
}
.hm-total-row {
  margin-bottom: 16px;
}
.hm-total-value {
  font-size: 36px;
  font-weight: 800;
  color: #e6e9ef;
}
.hm-total-label {
  margin-left: 10px;
  font-size: 14px;
  color: #9aa4b2;
}
.hm-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}
.hm-pager button {
  background: #1a1f27;
  color: #e6e9ef;
  border: 1px solid #2a3140;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.hm-pager button:hover {
  background: #2a3140;
}
.hm-pager span {
  font-size: 15px;
  font-weight: 600;
  color: #e6e9ef;
  min-width: 100px;
  text-align: center;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.subscribers-box {
  background: #1a1f27;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  max-width: 560px;
}
#subscriber-list { list-style: none; padding: 0; margin: 0 0 12px; }
#subscriber-list li.subscriber-row {
  padding: 10px 0;
  border-bottom: 1px solid #2a3140;
  font-size: 14px;
}
.subscriber-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.subscriber-top-row button {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 13px;
}
.subscriber-categories { display: flex; gap: 14px; flex-wrap: wrap; }
.category-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #9aa4b2;
  cursor: pointer;
}
.add-subscriber-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-subscriber-row input[type="email"] { flex: 1; min-width: 180px; }

.about-box {
  background: #1a1f27;
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid #2a3140;
  margin-bottom: 24px;
}
.about-box p { font-size: 14px; line-height: 1.6; color: #c3c9d3; margin: 0 0 12px; }
.about-box p:last-child { margin-bottom: 0; }
.about-box .lede { font-size: 15px; color: #e6e9ef; }

.changelog-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.7;
  color: #c3c9d3;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.source-card {
  background: #171b22;
  border: 1px solid #2a3140;
  border-radius: 10px;
  padding: 14px 16px;
}
.source-card .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
}
.source-card h4 { margin: 0 0 6px; font-size: 14px; color: #e6e9ef; display: flex; align-items: center; }
.source-card p { margin: 0; font-size: 12.5px; color: #9aa4b2; line-height: 1.5; }

.feature-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-list li {
  background: #171b22;
  border: 1px solid #2a3140;
  border-radius: 10px;
  padding: 12px 16px;
}
.feature-list .label { font-size: 13px; font-weight: 600; color: #e6e9ef; display: block; margin-bottom: 4px; }
.feature-list .desc { font-size: 12.5px; color: #9aa4b2; line-height: 1.5; }

.meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #2a3140;
}
.meta-row .stat { display: flex; flex-direction: column; }
.meta-row .stat .k { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.meta-row .stat .v { font-size: 13px; color: #c3c9d3; margin-top: 2px; }

.contact-box {
  margin-top: 20px;
  background: #16321f;
  border: 1px solid #2f7d4d;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.contact-box p { margin: 0; font-size: 13px; color: #c3c9d3; }
.contact-box a {
  color: #4ade80;
  font-weight: 600;
  text-decoration: none;
  background: rgba(74, 222, 128, 0.1);
  padding: 8px 16px;
  border-radius: 8px;
  white-space: nowrap;
}

.disclaimer { font-size: 11.5px; color: #6b7280; margin-top: 14px; line-height: 1.5; }

.legal-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid #2a3140; }
.legal-box h5 { margin: 0 0 6px; font-size: 12px; color: #9aa4b2; text-transform: uppercase; letter-spacing: 0.05em; }
.legal-box p { font-size: 12.5px; color: #6b7280; line-height: 1.6; margin: 0 0 14px; }
.legal-box p:last-of-type { margin-bottom: 0; }
.legal-box a { color: #9aa4b2; }

.footer-copyright { margin-top: 8px; margin-bottom: 12px; text-align: center; font-size: 11.5px; color: #6b7280; }
.footer-copyright a { color: #9aa4b2; }
.footer-copyright a:hover { color: #e6e9ef; }

.back-link {
  display: inline-block;
  font-size: 13px;
  color: #9aa4b2;
  text-decoration: none;
  margin-bottom: 16px;
}
.back-link:hover { color: #e6e9ef; }
.error { color: #f87171; font-size: 13px; margin-left: 8px; }
