/* Solar potential (/solar-potential, ADR 0091), light theme, on top of
   learn.css. solar-potential-dark.css overrides it for the dark theme. The
   chart is SVG with classes for every color: the Content-Security-Policy
   forbids style attributes. */

.sp-page { --sp-bar: #e8891c; --sp-bar-soft: #fdf1e1; --sp-dot: #4a5a8c; }

/* ---- Key facts: the answer first, on phones too ---- */
.sp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; margin: 0 0 18px; }
.sp-fact {
  display: grid;
  gap: 2px;
  align-content: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.sp-fact-main { background: var(--sp-bar-soft); border-color: var(--sp-bar); }
.sp-fact-label { color: var(--muted); font-size: 0.86rem; }
.sp-fact-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.sp-fact-value small { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.sp-fact-note { color: var(--muted); font-size: 0.86rem; }

/* ---- The form ---- */
.sp-form { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin: 4px 0 12px; }
.sp-form label { display: grid; gap: 4px; font-size: 0.88rem; color: var(--muted); }
.sp-form input, .sp-form select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  min-height: 38px;
  width: 9em;
}
.sp-form select { width: auto; min-width: 9em; }
.sp-button {
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--sp-bar);
  background: var(--sp-bar);
  color: #1d1f24;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.sp-button:hover { filter: brightness(1.06); }
.sp-button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 2px; }
.sp-summary { font-weight: 600; margin-top: 4px; }

/* ---- Month chart and table ---- */
.sp-chart { margin: 6px 0 14px; }
.sp-chart svg { display: block; width: 100%; height: auto; max-height: 300px; }
.sp-grid { stroke: var(--line); stroke-width: 1; }
.sp-axis { fill: var(--muted); font-size: 12px; }
.sp-value { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.sp-bar { fill: var(--sp-bar); }
.sp-dot { fill: var(--sp-dot); stroke: var(--surface); stroke-width: 2; }
.sp-chart figcaption { color: var(--muted); font-size: 0.88rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-key { display: inline-block; width: 12px; height: 12px; }
.sp-key-bar { background: var(--sp-bar); border-radius: 3px; }
.sp-key-dot { background: var(--sp-dot); border-radius: 50%; margin-left: 10px; }
.sp-table-wrap { overflow-x: auto; }
.sp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.93rem; }
.sp-table th, .sp-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sp-table thead th { color: var(--muted); font-weight: 600; font-size: 0.84rem; white-space: normal; vertical-align: bottom; }
.sp-table th[scope="row"] { text-align: left; font-weight: 600; }
.sp-table tfoot th, .sp-table tfoot td { font-weight: 700; border-bottom: 0; }
.sp-note { color: var(--muted); font-size: 0.88rem; margin-top: 10px; }
.sp-disclaimer { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--sp-bar); background: var(--sp-bar-soft); border-radius: 0 10px 10px 0; }

/* Phones: the month, the hours and the kWh; the rest is on wider screens. */
@media (max-width: 560px) {
  .sp-more { display: none; }
  .sp-fact-value { font-size: 1.45rem; }
  .sp-value { font-size: 14px; }
  .sp-axis { font-size: 14px; }
  .sp-form label { flex: 1 1 40%; }
  .sp-form input, .sp-form select { width: 100%; }
}
