/* Solar dashboard theme. Layout and controls share the same visual language
   in the results and plant editor; calculation-related styles stay in main.css. */
:root {
  --background: #f2f6f8;
  --surface-muted: #edf4f6;
  --text: #152b3c;
  --muted: #607386;
  --border: #dce6eb;
  --accent: #087c89;
  --accent-strong: #056270;
  --solar: #f5ad29;
  --shadow: 0 5px 20px rgba(23, 59, 74, .045);
}
/* Forecast overview and drill-down share a stable scale and responsive layout. */
.production-forecast { padding: 20px; min-width: 0; }
.forecast-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.forecast-heading h2 { font-size: 1.2rem; margin: 0; }
.forecast-heading .context-summary { margin: 4px 0 0; }
.forecast-heading button { font-size: .8rem; padding: 8px 12px; }
#forecast-status { font-size: .78rem; color: var(--muted); line-height: 1.5; margin: 12px 0; }
.forecast-days { margin-top: 20px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.forecast-day { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 10px; background: #f7fafb; border: 1px solid var(--border); color: var(--text); min-width: 0; }
.forecast-day:hover { background: #edf6f6; border-color: #8bbdc3; }
.forecast-day[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; background: #eef8f7; }
.forecast-today { background: #edf7f5; }
.forecast-day-label { font-size: .85rem; font-weight: 700; }
.forecast-day-plant { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.forecast-day-plant + .forecast-day-plant { padding-top: 10px; border-top: 1px solid var(--border); }
.forecast-day-energy { font-size: clamp(1rem, 1.5vw, 1.25rem); font-weight: 750; color: var(--accent-strong); }
.forecast-plant-1 .forecast-day-energy { color: #7c3aed; }
.forecast-plant-name { font-size: .72rem; overflow-wrap: anywhere; line-height: 1.5; }
.forecast-conditions { display: flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 400; line-height: 1.3; }
.forecast-conditions:has(.forecast-summary-icons > svg:nth-of-type(2)) { flex-direction: column; align-items: flex-start; }
.forecast-summary-icons { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.forecast-summary-icons:has(> svg:nth-of-type(2)) .forecast-weather-icon { width: 26px; height: 26px; flex-shrink: 1; min-width: 0; }
.forecast-weather-arrow { color: var(--muted); font-size: .85rem; }
.forecast-weather-icon { width: 32px; height: 32px; flex-shrink: 0; }
.forecast-day-note { font-size: .7rem; color: var(--muted); font-weight: 400; line-height: 1.4; }
.forecast-footnote { margin: 12px 0 0; font-size: .73rem; color: var(--muted); line-height: 1.6; }
.forecast-period-totals { display: grid; gap: 12px; margin-top: 16px; }
.forecast-total-plant h4 { margin: 0 0 8px; font-size: .85rem; overflow-wrap: anywhere; }
.forecast-total-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 0; }
.forecast-total-grid > div { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #edf7f5; min-width: 0; }
.forecast-total-grid dt { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.forecast-total-grid dd { margin: 5px 0 0; font-size: 1.2rem; font-weight: 750; color: var(--accent-strong); overflow-wrap: anywhere; }
.forecast-plant-1 .forecast-total-grid > div { background: #f5f0fc; }
.forecast-plant-1 .forecast-total-grid dd { color: #7c3aed; }
.forecast-total-note { margin: 8px 0 14px; font-size: .73rem; line-height: 1.5; color: var(--muted); }
.forecast-hourly-plant { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.forecast-hourly-plant h3 { font-size: 1rem; margin: 0; }
.forecast-hourly-scroll { padding: 12px 0 8px; }
.forecast-hourly-bars { display: grid; grid-template-columns: repeat(var(--forecast-hours), minmax(0, 1fr)); gap: 0; }
.forecast-hour { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; padding: 0 3px; min-width: 0; }
.forecast-bar-area { height: 160px; width: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; border-bottom: 1px solid #bacdd6; background: repeating-linear-gradient(to top, transparent 0, transparent 39px, #dce6eb 39px, #dce6eb 40px); position: relative; padding-top: 20px; box-sizing: content-box; }
.forecast-bar { width: 65%; background: #188c97; border-radius: 4px 4px 0 0; min-height: 1px; flex-shrink: 0; max-height: 140px; }
.forecast-plant-1 .forecast-bar { background: #9870db; }
.forecast-bar-value { font-size: .7rem; font-weight: 650; padding-bottom: 3px; }
.forecast-hour-past .forecast-bar { opacity: .4; }
.forecast-hour-current { background: #fdf3d9; border-radius: 5px; }
.forecast-hour-current .forecast-hour-time::after { content: " · Now"; font-weight: 750; color: #895c00; }
.forecast-hour-time { font-size: .65rem; overflow-wrap: anywhere; }
.forecast-hour-weather { font-size: .63rem; color: var(--muted); line-height: 1.3; min-height: 2.6em; max-width: 100%; overflow-wrap: anywhere; }
.forecast-hour .forecast-weather-icon { max-width: 100%; }
.forecast-hour-temperature { font-size: .7rem; color: var(--muted); }
.forecast-controls, .forecast-chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.forecast-controls { margin: 12px 0 18px; }
.forecast-controls label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .85rem; }
.forecast-controls select { width: auto; margin: 0; padding: 7px 28px 7px 10px; }
.forecast-controls .context-summary { margin: 0; }
.forecast-chart-heading h3 { font-size: 1rem; margin: 0; }
.forecast-chart-heading button { font-size: .8rem; padding: 8px 12px; }
#forecast-chart > [hidden], #forecast-overview-back[hidden] { display: none; }
.forecast-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0; }
.forecast-legend-plant { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; overflow-wrap: anywhere; }
.forecast-legend-swatch { width: 10px; height: 10px; border-radius: 2px; background: #188c97; flex-shrink: 0; }
.forecast-plant-1 .forecast-legend-swatch { background: #9870db; }
.forecast-daily-bars { display: grid; grid-template-columns: repeat(var(--forecast-day-count), minmax(0, 1fr)); gap: 4px; }
.forecast-daily-day { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; padding: 0 2px 8px; background: transparent; border: 1px solid transparent; color: var(--text); border-radius: 6px; }
.forecast-daily-day:hover { background: #edf6f6; border-color: #8bbdc3; }
.forecast-daily-day .forecast-day-label { font-size: .7rem; line-height: 1.5; overflow-wrap: anywhere; }
.forecast-daily-day .forecast-day-note { font-size: .62rem; }
.forecast-daily-group { flex-direction: row; align-items: end; justify-content: center; gap: 4px; }
.forecast-daily-series { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: end; min-width: 0; }
.forecast-daily-series .forecast-bar { width: 80%; }
.forecast-daily-series .forecast-bar-value { font-size: clamp(.55rem, 1vw, .75rem); }
.forecast-long-range .forecast-bar { opacity: .7; }
.forecast-day:focus-visible, .forecast-daily-day:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .forecast-hourly-bars { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 18px; }
  .production-forecast { padding: 14px; }
  .forecast-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forecast-day { padding: 10px; }
  .forecast-daily-bars { grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 16px; }
  .forecast-controls, .forecast-chart-heading { flex-wrap: wrap; }
  .forecast-day-energy { font-size: 1.2rem; }
  .forecast-conditions { flex-wrap: wrap; }
  .forecast-heading { align-items: center; }
}
@media (max-width: 460px) {
  .forecast-hourly-bars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
body { background: radial-gradient(ellipse at top left, #e9f3f6, transparent 650px), var(--background); }
main { width: min(1180px, calc(100% - 48px)); padding-top: 28px; }
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.brand-sun { width: 52px; height: 52px; flex-shrink: 0; color: var(--solar); }
.page-header h1 { margin: 0 0 2px; font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: -.035em; }
.page-header p { font-size: .95rem; }
.panel { border-radius: 14px; box-shadow: var(--shadow); }
button, input, select { border-radius: 8px; }
button { transition: background-color .15s, border-color .15s, box-shadow .15s; }
button.primary { background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 8px #087c8918; }
button.primary:hover { background: var(--accent-strong); }
button.secondary { background: #f7fafb; }
button.secondary:hover { background: #e8f2f4; border-color: #9ac2cb; }
input, select { min-height: 44px; background-color: white; }
/* Example text should be visibly distinct from a value the user has entered. */
input::placeholder, textarea::placeholder { color: #94a3b0; opacity: 1; font-weight: 400; }
input:focus, select:focus { border-color: var(--accent); }
.plant-controls h2 { margin-bottom: 10px; }
.plant-controls h2, .scenario-controls h2 { display: flex; align-items: center; gap: 10px; }
/* Match the sun mark with local SVGs: warm accents and rounded strokes. */
.setup-icon { width: 36px; height: 36px; flex-shrink: 0; color: var(--solar); }
.plant-toolbar { gap: 12px; }
#plant-select { color: var(--text); font-size: 1.05rem; font-weight: 700; }
.context-summary { margin: 8px 0; font-size: .82rem; line-height: 1.6; }
#plant-list { margin-bottom: 0; }
.scenario-controls { gap: 36px; padding-top: 16px; margin-top: 16px; }
.scenario-controls h2 { margin-bottom: 10px; }
.scenario-controls details > summary { font-size: .84rem; padding: 4px 0; }
.scenario-controls .field-help { font-size: .75rem; font-weight: 400; }
.date-controls .actions { margin-top: 10px; gap: 8px; }
.date-controls .actions button { min-height: 38px; padding: 7px 12px; font-size: .85rem; }
.status:empty { display: none; }
.comparison-toggle, .comparison-link { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.comparison-toggle { margin: 16px 0 0; font-weight: 650; }
.comparison-toggle input, .comparison-link input { min-height: 16px; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.comparison-setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.comparison-setup { padding: 16px; border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: 10px; background: #f6fbfc; }
.comparison-setup.comparison-b { border-top-color: #7c3aed; background: #faf7ff; }
.comparison-setup h3 { margin: 0 0 12px; font-size: 1rem; }
.comparison-tile-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.comparison-tile-header h3 { margin: 0; }
.comparison-tile-header button { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.comparison-setup label { margin-bottom: 12px; font-size: .85rem; }
.comparison-setup .comparison-link { font-weight: 500; }
.comparison-setup .form-hint { margin-bottom: 0; }
.comparison-date-actions { gap: 6px; margin: 0 0 12px; }
.comparison-date-actions button, .comparison-special-dates button { min-height: 36px; padding: 6px 10px; font-size: .8rem; }
.comparison-special-dates { margin: 8px 0 12px; }
.comparison-special-dates summary { font-size: .85rem; }
.comparison-weather { grid-template-columns: 1fr; }
#comparison-controls > .form-hint { margin-top: 12px; font-size: .8rem; line-height: 1.55; }
.summary-grid.comparison-summary { grid-template-columns: 1fr; }
.comparison-metric { padding: 20px; }
.comparison-metric h3 { font-size: .9rem; margin: 0 0 12px; }
.comparison-summary .comparison-metric.energy-highlight { background: linear-gradient(125deg, #e0f4f6, #f7f3ff); border-color: #bed6e1; }
.comparison-metric-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.comparison-metric-values strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.comparison-metric-values p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }
.comparison-case-label { font-size: .9rem !important; margin: 0 0 4px !important; overflow-wrap: anywhere; }
.comparison-case-label.comparison-a { color: var(--accent-strong); }
.comparison-case-label.comparison-b { color: #6d28d9; }
.comparison-date-label { font-size: .75rem !important; color: var(--muted); margin: 0 0 10px !important; }
.comparison-difference { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.comparison-detail { padding: 20px; }
.comparison-detail h2 { font-size: 1.1rem; }
.comparison-detail > summary { font-weight: 700; color: var(--accent-strong); cursor: pointer; }
.comparison-detail-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 16px; }
.comparison-detail-columns > div { min-width: 0; }
.comparison-metric-values > :only-child,
.comparison-detail-columns > :only-child { grid-column: 1 / -1; }
.comparison-detail p { font-size: .82rem; line-height: 1.5; color: var(--muted); }
.comparison-panel-item { padding: 12px 0; border-top: 1px solid var(--border); }
.comparison-panel-item h4 { margin: 0 0 10px; }
.comparison-detail .daily-panel-timing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.comparison-detail .yearly-best-details { display: grid; grid-template-columns: 1fr; gap: 12px; }
.comparison-detail .timing-item { flex-wrap: wrap; }
.comparison-table-wrap { overflow-x: auto; margin-top: 14px; }
.comparison-table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.comparison-table th, .comparison-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }
.comparison-table thead th:nth-child(2) { color: var(--accent-strong); }
.comparison-table thead th:nth-child(3) { color: #6d28d9; }
@media (max-width: 650px) {
  .comparison-setup-grid, .comparison-detail-columns { grid-template-columns: 1fr; }
  .comparison-metric-values { gap: 12px; }
  .comparison-metric-values strong { font-size: 1.3rem; }
  .comparison-setup, .comparison-metric, .comparison-detail { padding: 14px; }
}
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 4px; }
.results-heading h2 { font-size: 1.1rem; }
.results-heading .context-summary { text-align: right; }
/* Controls and period tabs stay together while reading results; dialogs
   and map controls retain their higher stacking levels. */
.results-navigation { position: sticky; top: 0; z-index: 20; margin: 12px 0 18px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.97); box-shadow: 0 5px 16px #15374709; }
.navigation-label { margin: 0 0 8px; color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.result-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid #b9ccd5; border-radius: 8px; }
.result-tabs button { min-height: 48px; border: 0; border-radius: 0; color: var(--text); background: #fff; font-size: 1rem; padding: 10px 8px; }
.result-tabs button + button { border-left: 1px solid #b9ccd5; }
.result-tabs button:first-child { border-radius: 7px 0 0 7px; }
.result-tabs button:last-child { border-radius: 0 7px 7px 0; }
.result-tabs button:hover { background: #edf7f8; }
.result-tabs button[aria-selected="true"] { background: var(--accent); color: white; }
.tab-period { font-weight: 400; opacity: .85; }
.tab-period:not(:empty)::before { content: " · "; }
.tab-basis { display: block; margin-top: 3px; font-size: .72rem; font-weight: 500; line-height: 1.3; opacity: .9; }
.estimate-basis { margin: -4px 0 18px; padding: 14px 18px; border: 1px solid #c6e1e7; border-left: 4px solid var(--accent); border-radius: 10px; background: #eaf5f7; }
.estimate-basis .estimate-basis-title { margin: 0 0 4px; font-weight: 700; color: var(--accent-strong); }
.estimate-basis p:last-child { margin: 0; color: #435d70; font-size: .85rem; line-height: 1.55; }
.result-view { scroll-margin-top: 140px; gap: 16px; }
#comparison-results { overflow-anchor: none; }
.results-panel { overflow-anchor: none; align-content: start; }
#calculation-status { position: sticky; top: 128px; padding: 16px 20px; margin: 0; }
.comparison-loading { display: block; }
.comparison-loading > .panel { position: sticky; top: 128px; padding: 16px 20px; margin: 0; }
.summary-grid { gap: 16px; }
.summary-grid .panel { padding: 22px; }
.summary-grid .result-kicker { font-size: .85rem; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 650; margin-bottom: 0; }
.summary-grid .angle-value { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -.045em; margin: 8px 0; font-variant-numeric: tabular-nums; }
.summary-grid .energy-highlight { border-color: #a7d8df; background: linear-gradient(125deg, #e0f4f6, #f1fbfb); }
.summary-grid .energy-highlight .result-kicker, .energy-highlight .angle-value { color: var(--accent-strong); }
.summary-grid p:not(.result-kicker) { margin-bottom: 0; line-height: 1.5; }
.meter { background: #e9f0f3; }
.meter-fill { background: linear-gradient(90deg, var(--solar), var(--accent)); }
.day-chart-card { padding: 20px 22px; }
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.chart-toolbar h2 { font-size: 1.1rem; margin: 0; letter-spacing: -.02em; }
.chart-switch { display: inline-flex; flex-wrap: nowrap; flex-shrink: 0; gap: 0; border: 1px solid #bfd0d8; border-radius: 8px; }
.chart-switch button { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 0; font-size: .8rem; background: white; }
.chart-switch button:first-child { border-radius: 7px 0 0 7px; }
.chart-switch button:last-child { border-radius: 0 7px 7px 0; }
.chart-switch button[aria-pressed="true"] { background: var(--accent); color: white; }
.chart-body > p { color: var(--muted); font-size: .8rem; margin-bottom: 12px; }
.chart-angle-toggle { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .82rem; font-weight: 500; cursor: pointer; }
.chart-angle-toggle input { width: 16px; height: 16px; min-height: 16px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.chart-wrap { height: 340px; }
.disclosure { padding: 10px 20px; }
.disclosure > summary { color: var(--text); font-size: .92rem; }
.disclosure[open] > summary { color: var(--accent-strong); }
.timing-card { padding: 22px; }
.timing-card h2 { font-size: 1.1rem; }
.daily-sunlight-detail { padding: 10px 12px; border-radius: 8px; background: #f7fafb; border-left: 3px solid #d9e9ec; }
.daily-sunlight-detail:nth-child(n+3) { border-left-color: var(--solar); background: #fffaf0; }
.daily-sunlight-detail strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.detail-card { box-shadow: none; background: #f7fafb; }
/* Editor: the scrollable form retains a persistent header and action bar. */
.plant-dialog { width: min(840px, calc(100% - 32px)); max-width: none; border-radius: 18px; box-shadow: 0 24px 80px #0e2c4b40; background: #f5f8fa; }
.plant-dialog::backdrop { background: rgba(14, 35, 51, .55); backdrop-filter: blur(4px); }
.plant-dialog form { padding: 0 24px 24px; gap: 0; }
.dialog-header { position: sticky; top: 0; z-index: 1100; align-items: center; margin: 0 -24px 20px; padding: 18px 24px; background: #fff; border-bottom: 1px solid var(--border); }
.dialog-eyebrow { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; color: var(--accent) !important; margin-bottom: 4px !important; }
.dialog-header h2 { font-size: 1.45rem; letter-spacing: -.025em; }
.dialog-header p:not(.dialog-eyebrow) { font-size: .84rem; }
.dialog-header .icon-button { display: grid; place-items: center; padding: 0; flex-shrink: 0; line-height: 1; min-width: 38px; width: 38px; height: 38px; min-height: 38px; border-radius: 50%; font-size: 1.5rem; background: #f0f5f7; color: var(--muted); }
.plant-dialog .form-section { margin: 0 0 18px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: white; }
.plant-dialog .form-section h3 { font-size: 1rem; margin-bottom: 14px; }
.editor-step { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; margin-right: 5px; background: #e7f5f6; color: var(--accent); font-size: .8rem; }
.plant-dialog .location-map { border-radius: 10px; margin-top: 14px; }
.location-metadata { margin-top: 16px; align-items: start; }
.plant-dialog .form-hint, .plant-dialog .field-help { font-size: .78rem; font-weight: 400; line-height: 1.55; }
.plant-dialog .place-search .form-hint { margin-bottom: 0; }
.plant-dialog .location-coordinates { margin-top: 8px; border-top: 1px solid var(--border); }
.plant-dialog .panel-set { border-radius: 10px; background: #f7fafb; box-shadow: none; }
.plant-dialog .panel-set summary { font-size: .9rem; }
.plant-dialog .editor-section-title { color: var(--muted); font-size: .8rem !important; margin-top: 20px; }
.plant-dialog .form-section > summary { padding: 0; color: var(--text); }
.plant-dialog .form-section[open] > summary { margin-bottom: 14px; color: var(--accent-strong); }
.section-data-source { font-size: .75rem; margin-top: 6px; }
.dialog-actions { z-index: 1100; margin: 0 -24px -24px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -5px 18px #15374709; }
@media (max-width: 700px) {
  main { width: calc(100% - 24px); padding-top: 20px; }
  .page-header { gap: 10px; margin-bottom: 18px; }
  .brand-sun { width: 40px; height: 40px; }
  .setup-icon { width: 30px; height: 30px; }
  .page-header p { font-size: .78rem; }
  .form-panel { padding: 16px; }
  .scenario-controls { grid-template-columns: 1fr; gap: 16px; }
  .scenario-controls .date-controls { padding-top: 14px; }
  .date-controls .actions { flex-wrap: nowrap; }
  .date-controls .actions button { padding: 7px 8px; font-size: .75rem; }
  .plant-toolbar { gap: 8px; }
  .plant-toolbar button { flex: 1; min-height: 40px; font-size: .85rem; }
  .results-heading { display: block; }
  .results-heading .context-summary { text-align: left; }
  .results-navigation { padding: 10px; margin-top: 10px; }
  .result-tabs button { min-height: 46px; font-size: .95rem; }
  .tab-period { display: none; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summary-grid .energy-highlight { grid-column: 1 / -1; grid-row: 1; padding: 20px; }
  .summary-grid .energy-highlight .angle-value { font-size: 2.6rem; }
  .summary-grid .panel { padding: 14px; }
  .summary-grid .angle-value { font-size: clamp(1.45rem, 6vw, 2rem); }
  .summary-grid .output-value, .summary-grid p:not(.result-kicker) { font-size: .75rem; }
  .summary-grid .result-kicker { font-size: .78rem; }
  .day-chart-card, .timing-card { padding: 16px; }
  .chart-toolbar { flex-wrap: wrap; gap: 10px; }
  .chart-toolbar h2 { font-size: 1rem; }
  .chart-wrap { height: 280px; }
  .daily-sunlight-detail { padding: 8px; }
  .daily-sunlight-detail span { font-size: .75rem; }
  .plant-dialog { width: calc(100% - 16px); border-radius: 14px; }
  .plant-dialog form { padding: 0 12px 12px; }
  .dialog-header { margin: 0 -12px 12px; padding: 14px 16px; }
  .plant-dialog .form-section { padding: 14px; margin-bottom: 12px; }
  .location-metadata { grid-template-columns: 1fr; }
  .dialog-actions { margin: 0 -12px -12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

/* Explicit sharing leaves the address bar and the user's collection intact. */
.navigation-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.navigation-heading .navigation-label { margin: 0; }
#share-view-button { min-height: 32px; padding: 5px 10px; font-size: .8rem; white-space: nowrap; }
.shared-view-banner { padding: 1rem; margin-bottom: 1rem; border-left: 4px solid #087c89; }
.shared-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; }
.share-dialog { width: min(560px, calc(100vw - 2rem)); box-sizing: border-box; border: 0; border-radius: 18px; padding: 1.5rem; color: #243b53; }
.share-dialog::backdrop { background: rgb(15 35 50 / 45%); }
.share-dialog textarea { box-sizing: border-box; width: 100%; resize: vertical; margin: .5rem 0; overflow-wrap: anywhere; }
.shared-view-banner [hidden] { display: none; }

.share-dialog { max-height: 90vh; overflow-y: auto; }
#shared-import-choices fieldset { margin: 1rem 0; border: 1px solid #ccd9df; border-radius: 10px; padding: .8rem; min-width: 0; }
#shared-import-choices legend { font-weight: 600; overflow-wrap: anywhere; }
#shared-import-choices label, .shared-copy-choice { display: flex; align-items: flex-start; gap: .6rem; margin: .7rem 0; }
#shared-import-choices input[type="radio"], .shared-copy-choice input { width: 18px; height: 18px; min-height: 18px; flex-shrink: 0; margin: 2px 0 0; }

/* The editor keeps navigation and actions visible while only its active panel scrolls. */
.plant-dialog form { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto; overflow: hidden; padding: 0; height: min(820px, calc(100dvh - 32px)); }
.plant-dialog #editor-storage-conflict { margin: 0; }
.plant-dialog .dialog-header { position: relative; margin: 0; padding: 16px 24px; }
.plant-dialog .dialog-header > div { flex: 1; }
.editor-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 12px 24px; background: white; border-bottom: 1px solid var(--border); }
.editor-tabs button { background: #f1f5f7; color: var(--muted); padding: 10px 6px; font-size: .85rem; border: 1px solid transparent; }
.editor-tabs button[aria-selected="true"] { background: #e7f5f6; color: var(--accent-strong); border-color: var(--accent); }
.editor-tabs button.has-error::after { content: " !"; color: #b42318; font-weight: bold; }
.editor-content { grid-row: 5; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px; min-height: 0; }
.editor-content [role="tabpanel"][hidden] { display: none; }
.plant-dialog .dialog-actions { position: static; grid-row: 7; margin: 0; padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px)); }
.dialog-actions #cancel-plant-button { margin-right: auto; }
#editor-validation-message { grid-row: 6; margin: 0; padding: 8px 24px; color: #b42318; background: #fff4f2; font-size: .85rem; }
.editor-location-summary { display: flex; align-items: center; gap: 16px; }
.editor-location-summary p { flex: 1; margin: 0; }
.editor-location-summary[hidden], #editor-location-picker[hidden] { display: none; }
.editor-help, .editor-location-details { margin-top: 10px; }
.editor-menu { position: relative; }
.editor-menu > summary { list-style: none; padding: 8px; cursor: pointer; }
.editor-menu > summary::-webkit-details-marker { display: none; }
.editor-menu > button { position: absolute; right: 0; top: 100%; white-space: nowrap; box-shadow: var(--shadow); }
.editor-menu:has(#delete-plant-button[hidden]) { display: none; }
.panel-set-card > summary { font-weight: 650; }
@media (max-width: 700px) {
  .plant-dialog { width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .plant-dialog form { height: 100dvh; padding: 0; }
  .plant-dialog .dialog-header { margin: 0; padding: 12px 16px; }
  .plant-dialog .dialog-header h2 { font-size: 1.2rem; }
  .plant-dialog .dialog-header p:not(.dialog-eyebrow) { display: none; }
  .editor-tabs { padding: 10px 12px; gap: 3px; }
  .editor-tabs button { font-size: .75rem; padding: 10px 3px; }
  .editor-content { padding: 14px 12px; }
  .plant-dialog .dialog-actions { padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px)); flex-wrap: nowrap; gap: 5px; }
  .plant-dialog .dialog-actions button { width: auto; padding: 10px 8px; font-size: .8rem; min-width: 0; }
  .editor-location-summary { align-items: start; flex-direction: column; gap: 10px; }
}
.panel-orientation-help { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 16px; color: var(--muted); font-size: .78rem; }
/* Whole-watt validation stays independent of the 100 W arrow increment. */
.panel-power-control { position: relative; }
.panel-power-control input { appearance: textfield; -moz-appearance: textfield; padding-right: 72px; }
.panel-power-control input::-webkit-inner-spin-button,
.panel-power-control input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.panel-power-control .unit { top: 50%; bottom: auto; transform: translateY(-50%); }
.panel-power-arrows { position: absolute; right: 34px; top: 4px; bottom: 4px; display: grid; grid-template-rows: 1fr 1fr; }
.panel-power-arrows button { min-height: 0; padding: 0 6px; font-size: .85rem; line-height: 1; color: var(--muted); background: #f0f5f7; border-radius: 3px; }
.panel-power-field { display: grid; gap: 8px; }

/* Scrolling setup and a compact results toolbar share one modal editor. */
.results-heading { display: block; margin-top: 4px; }
.results-heading h2 { font-size: 1.2rem; margin: 0 0 8px; }
.results-heading #results-context { display: none; }
.page-header #share-view-button { margin-left: auto; min-height: 38px; font-size: .8rem; }
.dashboard-plants { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dashboard-plants:has(#dashboard-plant-b[hidden]) { grid-template-columns: 1fr; }
.dashboard-plant { min-width: 0; }
.plant-select-row { display: flex; gap: 8px; align-items: end; }
.plant-select-row label { flex: 1 1 0; min-width: 0; margin: 0; font-size: .75rem; gap: 4px; }
.plant-select-row select { width: 100%; min-width: 0; min-height: 38px; font-size: .9rem; padding: 7px 8px; }
.plant-select-row #plant-select { font-size: .9rem; }
.plant-select-row button { min-height: 38px; padding: 6px 10px; font-size: .75rem; }
.plant-a label { color: var(--accent-strong); }
.plant-b label { color: #6d28d9; }
.dashboard-plant .context-summary { margin: 4px 0 0; font-size: .7rem; line-height: 1.4; }
.dashboard-section { margin: 8px 0; border-top: 1px solid var(--border); }
.dashboard-section > summary { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; font-size: .85rem; }
.dashboard-section > summary::before { content: '▸'; font-size: .75rem; }
.dashboard-section[open] > summary::before { content: '▾'; }
.control-summary { margin-left: auto; color: var(--muted); font-size: .73rem; font-weight: 400; line-height: 1.4; text-align: right; }
.dashboard-section-content { padding: 0 0 10px; }
.dashboard-section .comparison-link { margin: 0 0 8px; font-size: .75rem; }
.dashboard-date-panels, .dashboard-weather-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dashboard-date-panels:has(#date-panel-b[hidden]), .dashboard-weather-panels:has(#dashboard-weather-b[hidden]) { grid-template-columns: 1fr; }
.dashboard-date-panel, .dashboard-weather-panel { min-width: 0; }
.dashboard-date-panel label, .dashboard-weather-panel label { margin: 0; gap: 4px; font-size: .75rem; min-width: 0; }
.dashboard-date-panel input, .dashboard-weather-panel input, .dashboard-weather-panel select { width: 100%; min-width: 0; min-height: 38px; padding: 7px 8px; font-size: .9rem; }
.date-controls { display: flex; gap: 5px; align-items: end; }
.date-controls > label, .date-controls > .dashboard-period-controls { flex: 1; order: 2; min-width: 0; }
.dashboard-period-controls { display: flex; gap: 8px; }
.dashboard-period-controls > label { flex: 1; min-width: 0; }
.date-controls .actions { display: contents; }
.date-controls .actions button { min-height: 38px; padding: 6px 8px; }
.date-controls .actions button:first-child { order: 1; }
.date-controls .actions button:last-child { order: 3; }
.date-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.date-actions button { min-height: 30px; padding: 4px 10px; font-size: .75rem; }
.live-label { color: var(--accent-strong); font-size: .72rem; font-weight: 700; }
.dashboard-date-panel .context-summary { margin: 4px 0; font-size: .7rem; line-height: 1.4; }
.date-specials > summary { padding: 4px 0; font-size: .75rem; }
.date-specials > summary span { font-weight: 400; color: var(--muted); }
.date-specials button { min-height: 32px; padding: 5px 8px; font-size: .75rem; }
.weather-select-row { display: flex; gap: 8px; align-items: end; }
.weather-select-row label { flex: 1; }
.weather-select-row button { min-height: 38px; padding: 6px 8px; font-size: .72rem; }
.weather-conditions { margin-top: 6px; }
.weather-conditions > summary { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 4px 0; font-size: .75rem; }
.weather-conditions .weather-details-grid { margin-top: 8px; gap: 12px; }
.weather-conditions .field-help { font-size: .7rem; font-weight: 400; }
.results-navigation { margin-top: 0; margin-bottom: 8px; max-height: none; overflow: visible; }
.results-navigation .result-tabs button { padding-top: 6px; padding-bottom: 6px; }
.result-view { scroll-margin-top: calc(var(--dashboard-controls-height, 200px) + 16px); }
.estimate-basis { margin: 0 0 12px; padding: 10px 14px; }
.estimate-basis .estimate-basis-title { font-size: .82rem; margin: 0; }
.estimate-basis summary { font-size: .75rem; padding: 4px 0 0; }
.estimate-basis details p { margin-top: 8px; }
.scenario-badge { display: inline-block; border-radius: 6px; padding: 4px 8px; background: #fff2d5; color: #735010; font-size: .75rem; font-weight: 650; }
#calculation-status, .comparison-loading > .panel { position: static; }
@media (max-width: 850px) {
  .dashboard-date-panels, .dashboard-weather-panels { grid-template-columns: 1fr; }
  .dashboard-section > summary { align-items: start; }
  .dashboard-section > summary > span:first-child { flex-shrink: 0; }
  .date-controls input { font-size: .8rem; padding: 7px 4px; }
  .results-navigation .result-tabs .tab-basis { font-size: .6rem; line-height: 1.2; }
}
@media (max-width: 650px) {
  .page-header { flex-wrap: wrap; }
  .page-header #share-view-button { margin-left: 0; }
  .plant-select-row { gap: 4px; }
  .plant-select-row select { font-size: .8rem; }
  .plant-select-row #plant-select { font-size: .8rem; }
  .plant-select-row button { padding: 6px; font-size: .7rem; }
  .dashboard-plant .context-summary { font-size: .65rem; }
}

.dashboard-setup { padding: 18px 20px; }
.dashboard-setup h2 { font-size: 1rem; margin: 0 0 12px; }
.results-context-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.results-context-actions button { display: flex; flex-direction: column; align-items: start; gap: 2px; min-width: 0; padding: 4px 8px; min-height: 38px; text-align: left; font-size: .65rem; color: var(--muted); }
.results-context-actions button > span:last-child { font-size: .75rem; color: var(--text); font-weight: 650; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.3; overflow-wrap: anywhere; }
.results-context-actions:has(#results-weather-button[hidden]) { grid-template-columns: 1fr; }
.dashboard-controls-dialog { position: fixed; inset: auto; top: var(--editor-center-y, 50svh); left: 50%; transform: translate(-50%, -50%); margin: 0; width: min(720px, calc(100vw - 48px)); max-height: calc(var(--editor-viewport-height, 100svh) - 32px); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 12px 60px #152b3c30; }
.dashboard-controls-dialog::backdrop { background: #152b3c55; }
.dashboard-editor-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dashboard-editor-header h2 { margin: 0; font-size: 1.1rem; }
.dashboard-editor-header button { min-height: 36px; padding: 6px 12px; }
.dashboard-editor-content { padding: 16px 18px; overflow-y: auto; overscroll-behavior: contain; max-height: calc(var(--editor-viewport-height, 100svh) - 102px); }
.dashboard-editor-content .dashboard-section { border: 0; margin: 0; }
.dashboard-editor-content .dashboard-section > summary { display: none; }
.dashboard-editor-content .dashboard-section-content { padding: 0; }
@media (max-width: 650px) {
  .dashboard-setup { padding: 14px; }
  .dashboard-controls-dialog { width: calc(100% - 24px); max-width: none; border-radius: 16px; }
  .dashboard-editor-content { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .results-context-actions button > span:last-child { font-size: .7rem; }
}

.time-selectable-chart { cursor: crosshair; }

.forecast-weather-control[hidden] { display: none; }
.forecast-weather-control:has(input:disabled) .chart-angle-toggle { color: var(--muted); cursor: default; }
/* Keep the availability explanation accessible without adding another chart row. */
.forecast-weather-availability { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.summary-grid > .panel:has(> .forecast-metric:not([hidden])) { display: flex; flex-direction: column; }
.summary-grid > .panel:has(> .forecast-metric:not([hidden])) > :nth-last-child(2) { margin-bottom: 16px; }
.forecast-metric { display: grid; gap: 5px; padding: 14px 16px; border: 1px solid rgba(49,143,213,.18); border-radius: 12px; background: rgba(49,143,213,.055); color: #236b9f; }
.summary-grid > .panel > .forecast-metric { margin-top: auto; }
.forecast-metric[hidden], #power-chart-options[hidden] { display: none; }
.forecast-metric-label { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 650; }
.forecast-metric-label::before { content: ""; width: 20px; border-top: 2px dashed #318fd5; }
.forecast-metric .forecast-metric-number { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 750; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.forecast-metric-detail { font-size: .78rem; line-height: 1.45; color: var(--muted); }
.comparison-forecast-value { margin-top: 14px; }
@media (max-width: 650px) {
  .forecast-metric { padding: 12px; }
  .forecast-metric-label, .forecast-metric-detail { font-size: .72rem; }
  .forecast-metric .forecast-metric-number { font-size: 1.45rem; }
}



.chart-integrated-footer[hidden] { display: none; }
.chart-integrated-footer { margin-top: 0; }
.chart-weather-row { position: relative; height: 84px; }
.chart-weather-row:has(.chart-weather-plant-label) { height: 104px; }
.chart-weather-hour { position: absolute; top: 0; transform: translateX(-50%); padding: 0; gap: 4px; }
.chart-weather-icons { display: flex; align-items: center; justify-content: center; width: 100%; height: 26px; }
.chart-weather-icons .forecast-weather-icon { width: 26px; height: 26px; min-width: 0; flex-shrink: 1; }
.chart-weather-plant-label { position: absolute; left: 0; top: 0; color: var(--muted); font-size: .65rem; }
.chart-integrated-legend { display: flex; flex-wrap: wrap; gap: 2px 8px; justify-content: center; padding-top: 4px; }
.chart-integrated-legend button { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 4px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 400; }
.chart-legend-swatch { display: inline-block; width: 28px; flex-shrink: 0; }
.chart-integrated-legend .chart-series-hidden { opacity: .5; text-decoration: line-through; }

.chart-weather-hour .forecast-hour-weather { font-size: clamp(.45rem, calc(var(--weather-cell-width) * .21), .63rem); }
.chart-weather-hour .forecast-hour-temperature { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(.45rem, calc(var(--weather-cell-width) * .25), .7rem); }
.chart-weather-hour .chart-weather-icons, .chart-weather-hour .forecast-weather-icon { height: min(26px, var(--weather-cell-width)); }

@media (max-width: 760px) {
  .chart-weather-row { height: 120px; }
  .chart-weather-row:has(.chart-weather-plant-label) { height: 140px; }
}

.results-context-actions[hidden], .estimate-basis[hidden] { display: none; }

.forecast-weather-feedback { display: block; margin: -2px 0 12px 28px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.forecast-weather-feedback[hidden] { display: none; }

.plant-setup-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.plant-setup-header h2 { margin: 0; }
.plant-setup-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.plant-setup-actions .comparison-toggle { margin: 0; font-size: .85rem; }
.plant-setup-actions button { min-height: 36px; padding: 7px 12px; font-size: .85rem; white-space: nowrap; }
.app-toast { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; align-items: start; gap: 12px; max-width: min(440px, calc(100vw - 40px)); padding: 14px 16px; border: 1px solid #a7d8df; border-radius: 12px; background: white; color: var(--text); box-shadow: 0 8px 28px rgba(23,59,74,.16); font-size: .85rem; line-height: 1.5; }
.app-toast .icon-button { flex: 0 0 auto; min-width: 24px; min-height: 24px; padding: 0; font-size: 1.25rem; }
.app-toast.error, .editor-feedback.error, .result-feedback.error { color: #a02525; border-color: #e6b8b8; background: #fff6f6; }
.editor-feedback { margin: 0; padding: 10px 18px; border-bottom: 1px solid var(--border); color: var(--accent-strong); font-size: .85rem; line-height: 1.5; }
.result-feedback { border-left: 4px solid #a02525; }
.app-toast[hidden], .editor-feedback[hidden], .result-feedback[hidden] { display: none; }
@media (max-width: 650px) {
  .plant-setup-header { align-items: start; flex-wrap: wrap; gap: 12px; }
  .plant-setup-actions { width: 100%; justify-content: space-between; gap: 12px; }
  .plant-setup-actions .comparison-toggle { font-size: .8rem; }
  .app-toast { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
}

#plant-editor-status { grid-row: 4; }

/* First visits have a useful starting point instead of an empty results dashboard. */
.welcome-pending .app-grid, .welcome-pending #share-view-button { display: none; }
.welcome-screen[hidden], .demo-banner[hidden], .app-grid[hidden] { display: none; }
.welcome-screen { display: grid; gap: 22px; }
.welcome-hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 36px; overflow: hidden; }
.welcome-copy { position: relative; z-index: 1; }
.welcome-copy h2 { margin: 0 0 18px; font-size: clamp(1.9rem, 3.4vw, 2.8rem); line-height: 1.15; letter-spacing: -.04em; }
.welcome-copy > p { font-size: 1.05rem; color: var(--muted); margin: 0 0 24px; max-width: 470px; }
#welcome-create { padding: 14px 20px; font-size: 1rem; }
#welcome-create span { margin-left: 12px; }
.welcome-copy .welcome-reassurance { font-size: .88rem; margin: 18px 0 0; color: var(--text); }
.welcome-reassurance small { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; }
.welcome-house { width: 115%; max-width: none; height: auto; margin-left: -5%; }
.welcome-how { grid-column: 1 / -1; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.welcome-how h3 { margin: 0 0 10px; font-size: 1.1rem; }
.welcome-how p { margin: 0 0 10px; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.welcome-how p:last-child { margin-bottom: 0; }
.welcome-demo { padding: 28px 36px; }
.welcome-badge { display: inline-block; padding: 3px 12px; border-radius: 30px; background: #fff0c9; color: #805600; font-size: .7rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; }
.welcome-demo h2 { margin: 12px 0 6px; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.025em; }
.welcome-demo > p { margin: 4px 0; }
.welcome-demo-detail { color: var(--muted); font-size: .9rem; }
.welcome-location-row { display: flex; align-items: center; gap: 16px; margin: 22px 0 8px; }
#welcome-location { border-color: var(--accent); color: var(--accent); background: white; min-height: 48px; }
.welcome-or { color: var(--muted); font-size: .85rem; }
.welcome-search { flex: 1; max-width: 440px; margin: 0; }
.welcome-search input { width: 100%; min-height: 48px; }
.welcome-search .place-suggestions { top: 50px; }
.welcome-demo .form-hint { font-size: .77rem; color: var(--muted); }
#welcome-status:empty, #demo-resource-status:empty { display: none; }
#welcome-status.error { color: var(--danger); }
.welcome-preview { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; align-items: center; border-top: 1px solid var(--border); margin-top: 24px; padding-top: 18px; }
.welcome-preview h3 { margin: 0 0 8px; font-size: 1.3rem; }
.welcome-preview p { margin: 6px 0; font-size: .9rem; }
.welcome-preview figure { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fbfdfe; text-align: center; }
.welcome-preview figcaption { color: var(--muted); font-size: .75rem; }
.welcome-preview svg { display: block; width: 100%; height: auto; }
.welcome-preview .welcome-chart-title { margin: 12px 0 2px; text-align: left; font-size: .78rem; font-weight: 650; }
.welcome-chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: .72rem; }
.welcome-chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.welcome-chart-legend i { display: inline-block; width: 24px; border-top: 2px solid #087c89; }
.welcome-chart-legend .welcome-cloudy-swatch { border-top: 2px dashed #318fd5; }
.demo-banner { display: grid; gap: 16px; padding: 20px; margin-bottom: 20px; border-color: #9acbd1; background: #f3fbfc; }
.demo-banner p { margin: 8px 0 0; }
.demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.demo-actions button { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .demo-banner { padding: 14px; }
  .welcome-hero { padding: 26px; grid-template-columns: 1fr; }
  .welcome-copy > p { max-width: none; }
  .welcome-house { width: 100%; margin: 12px 0 -16px; max-height: 260px; object-fit: contain; }
  .welcome-demo { padding: 24px; }
  .welcome-preview { grid-template-columns: 1fr; gap: 14px; }
  .welcome-preview figure { max-width: 560px; width: 100%; justify-self: center; }
}
@media (max-width: 460px) {
  .demo-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .demo-actions button { width: 100%; }
  .welcome-location-row { flex-wrap: wrap; gap: 10px; }
  .welcome-search { flex-basis: 100%; max-width: none; }
  .welcome-or { display: none; }
  #welcome-location, #welcome-create { width: 100%; }
  .welcome-hero, .welcome-demo { padding: 22px 18px; }
  .welcome-copy h2 { font-size: 2rem; }
}
.welcome-pending #welcome-screen { visibility: hidden; }

/* Copy controls are secondary actions; source selection lives in a native modal. */
#copy-plant-section { margin-top: 8px; }
#copy-plant-button, #copy-location-button { font-size: .8rem; padding: 7px 10px; }
#same-location-row { margin-bottom: 12px; }
.plant-copy-dialog form { display: grid; gap: 12px; }
.plant-copy-dialog h2 { margin: 0; font-size: 1.2rem; }
.plant-copy-dialog p { font-size: .85rem; line-height: 1.5; }
.plant-copy-dialog select { margin-top: 6px; }
#plant-copy-error { color: #b42318; }

/* Roof-side editor: compass, tilt picker, panel count and the live estimate. */
.roof-side-step { margin: 0 0 18px; }
.roof-side-step h4, .roof-side-more h4 { margin: 0 0 6px; font-size: .95rem; color: var(--text); }
.roof-side-more h4 { margin-top: 16px; }
.roof-size-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.roof-orientation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
.compass-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.orientation-exact { flex: 1; min-width: 150px; display: grid; gap: 8px; }
.orientation-exact .form-hint { margin: 0; }
.orientation-value { margin: 0; font-weight: 650; color: var(--accent-strong); }
.compass { position: relative; width: 168px; height: 168px; flex: none; }
.compass-dial { position: absolute; inset: 30px; width: 108px; height: 108px; cursor: grab; touch-action: none; }
.compass-dial:active { cursor: grabbing; }
.compass-ring { fill: #fff; stroke: var(--border); stroke-width: 2; }
.compass-needle line { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.compass-needle path { fill: #f59e0b; stroke: #b45309; stroke-width: 1; stroke-linejoin: round; }
.compass-hub { fill: var(--accent-strong); }
.compass-point { position: absolute; left: 50%; top: 50%; width: 34px; height: 30px; margin: -15px 0 0 -17px; padding: 0; min-height: 0;
  font-size: .72rem; font-weight: 650; border-radius: 8px; background: #f1f5f7; color: var(--muted); border: 1px solid transparent;
  transform: rotate(var(--angle)) translateY(-69px) rotate(calc(-1 * var(--angle))); }
.compass-point[aria-pressed="true"], .tilt-preset[aria-pressed="true"] { background: #e7f5f6; color: var(--accent-strong); border-color: var(--accent); }
.tilt-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
.tilt-preset { display: grid; gap: 2px; padding: 8px 2px; min-height: 0; font-size: .72rem; line-height: 1.15; background: #f1f5f7; color: var(--muted); border: 1px solid transparent; }
.tilt-preset span { font-weight: 650; color: var(--text); }
.tilt-drawing { width: 132px; height: 84px; flex: none; }
.tilt-ground { stroke: var(--border); stroke-width: 2; stroke-linecap: round; }
.tilt-panel { stroke: var(--accent-strong); stroke-width: 6; stroke-linecap: round; }
.tilt-arc { fill: none; stroke: #f59e0b; stroke-width: 2; }
.panel-set-tilt-slider { width: 100%; accent-color: var(--accent); padding: 0; }
.roof-pitch-help { margin-top: 0; }
.roof-side-estimate { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: #fff8e6; color: #7a4b00; font-size: .88rem; font-weight: 600; }
.roof-side-estimate:empty { display: none; }
.roof-side-more-summary { font-weight: 400; color: var(--muted); }
.roof-side-actions { margin-top: 14px; }
.roof-layout-prompt { margin: 12px 0 16px; padding: 12px 14px; border: 1px solid #f3d38a; border-radius: 10px; background: #fffaf0; }
.roof-layout-prompt[hidden] { display: none; }
.roof-layout-prompt p { margin: 0 0 8px; }
.roof-layout-prompt .form-hint { margin: 8px 0 0; }
.plant-installation-year { display: grid; gap: 6px; max-width: 420px; margin-bottom: 16px; }
.inverter-clipping-note { margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; background: #eef6fb; color: #1d4f72; font-size: .88rem; }
.inverter-clipping-note[hidden] { display: none; }
.inverter-settings > label { display: grid; gap: 6px; max-width: 520px; margin-bottom: 16px; }
.plant-dialog form { grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto auto; }
.editor-estimate { grid-row: 6; padding: 8px 24px; background: #f0f9f8; border-top: 1px solid var(--border); }
.editor-estimate p { margin: 0; }
#editor-estimate-value { font-weight: 650; color: var(--accent-strong); }
.editor-estimate .form-hint { font-size: .78rem; }
.plant-dialog #editor-validation-message { grid-row: 7; }
.plant-dialog .dialog-actions { grid-row: 8; }
@media (max-width: 700px) {
  .roof-orientation { grid-template-columns: 1fr; }
  .roof-size-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roof-size-grid .panel-power-field { grid-column: 1 / -1; }
  .editor-estimate { padding: 6px 16px; }
  #editor-estimate-value { font-size: .9rem; }
  .compass-row { gap: 12px; }
}

/* Main screen: compact plant setup and a plain-language yearly headline. */
.dashboard-setup .plant-setup-actions { justify-content: space-between; margin-top: 10px; gap: 12px; }
.dashboard-setup .plant-setup-actions button { min-height: 32px; padding: 5px 10px; font-size: .78rem; }
.dashboard-setup .plant-setup-actions .comparison-toggle { font-size: .78rem; font-weight: 500; color: var(--muted); }
.results-heading:has(#results-context[hidden]), .results-heading { margin: 0; }
.results-panel > .estimate-basis { margin: 18px 0 0; }
.year-headline-card .yearly-total { margin: 4px 0 6px; font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 750; line-height: 1.15; color: var(--accent-strong); }
.yearly-context { margin: 0 0 14px; color: var(--text); font-size: .95rem; line-height: 1.5; }
.year-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.year-facts div { padding: 10px 12px; border-radius: 10px; background: #f3f8f9; }
.year-facts dt { font-size: .72rem; color: var(--muted); }
.year-facts dd { margin: 2px 0 0; font-size: .9rem; font-weight: 650; color: var(--text); }
.yearly-basis { margin: 12px 0 0; font-size: .82rem; color: var(--muted); }
.yearly-details { margin-top: 6px; font-size: .82rem; }
.yearly-details summary { color: var(--accent-strong); cursor: pointer; }
.yearly-details p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.yearly-analysis > summary { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; cursor: pointer; list-style: none; }
.yearly-analysis > summary::-webkit-details-marker { display: none; }
.yearly-analysis > summary::before { content: "▸"; grid-row: 1 / span 2; align-self: center; font-size: 1.1rem; color: var(--accent-strong); transition: transform .15s; }
.yearly-analysis[open] > summary::before { transform: rotate(90deg); }
.yearly-analysis-hint { grid-column: 2; }
.estimate-basis-compact .estimate-basis-title { display: none; }
.yearly-analysis-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.yearly-analysis-hint { font-size: .82rem; color: var(--muted); }
.yearly-analysis-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.yearly-analysis-section h2 { margin-top: 0; }
@media (max-width: 700px) {
  .year-facts { grid-template-columns: 1fr; gap: 6px; }
  .year-facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 12px; }
  .year-facts dd { margin: 0; text-align: right; }
}

/* Plain tabs and the Today strip. Tab basis labels stay available to screen readers. */
.result-tabs .tab-basis { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.today-strip { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0 0 12px; padding: 10px 16px; border-radius: 12px; background: #fff8e6; border: 1px solid #f3d38a; }
.today-strip[hidden] { display: none; }
.today-strip-values { margin: 0; font-weight: 650; color: #5f3b00; }
.today-strip-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: .8rem; }
.today-strip-actions [hidden] { display: none; }
.today-strip-source { color: #8a6a2f; }

/* Quick date controls beside the results, forecast-first Day cards and clearer forecast day cards. */
.results-date-group { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px; min-width: 0; }
.results-context-actions .quick-date-button { flex-direction: row; align-items: center; justify-content: center; min-width: 38px; padding: 4px 10px; font-size: 1.1rem; line-height: 1; color: var(--accent-strong); }
.results-context-actions .quick-date-now { font-size: .78rem; font-weight: 650; }
.results-context-actions .quick-date-now[aria-pressed="true"] { background: #e7f5f6; border-color: var(--accent); }
.results-context-actions:has(#results-weather-button[hidden]) .results-date-group { max-width: 520px; }
.scenario-metric-label { margin: 0 0 2px; font-size: .78rem; font-weight: 650; color: var(--muted); }
.scenario-metric-label[hidden] { display: none; }
.summary-grid > .panel.forecast-first > .result-kicker { order: 0; }
.summary-grid > .panel.forecast-first > .forecast-metric { order: 1; margin: 4px 0 14px; }
.summary-grid > .panel.forecast-first > * { order: 2; }
.summary-grid > .panel.forecast-first > .angle-value { font-size: 1.35rem; color: var(--text); }
.summary-grid > .panel.forecast-first > :nth-last-child(2) { margin-bottom: 0; }
.forecast-tip { display: inline-flex; align-items: center; gap: 8px; margin: 24px 0 8px; padding: 8px 12px; border-radius: 999px; background: #fff8e6; border: 1px solid #f3d38a; color: #5f3b00; font-size: .85rem; font-weight: 650; }
.forecast-tip[hidden] { display: none; }
.forecast-tip:not([hidden]) + .forecast-days { margin-top: 0; }
.forecast-day, .forecast-daily-day { cursor: pointer; }
.forecast-day-action { margin-top: auto; padding-top: 6px; font-size: .75rem; font-weight: 650; color: var(--accent-strong); }
.forecast-daily-day:hover .forecast-bar { filter: brightness(1.12); }

/* Optional analytics choices stay separate from the solar plant settings. */
.analytics-footer { margin: 18px auto; text-align: center; }
.analytics-footer button { font-size: .8rem; }
.analytics-footer:has(button[hidden]) { display: none; }
.analytics-consent { position: fixed; z-index: 11000; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: 480px; max-height: 60dvh; overflow: auto; margin: auto; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: white; box-shadow: 0 8px 40px #142e4333; }
.analytics-consent[hidden], .analytics-consent [hidden], #analytics-settings[hidden] { display: none; }
.analytics-consent h2 { margin: 0 0 6px; font-size: .95rem; }
.analytics-consent p { margin: 0 0 10px; font-size: .8rem; line-height: 1.45; color: var(--muted); }
.analytics-consent .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 0; }
.analytics-consent .actions button { min-height: 40px; margin: 0; padding: 8px 18px; font-size: .85rem; }
