/* Dashboard v0.8 usability + semantics pass. Additive on top of v0.7. */

/* Stronger weather identity without turning the panel into a novelty widget. */
.start-page .weather-card{
  background:
    radial-gradient(circle at 10% 12%,color-mix(in srgb,var(--weather-accent) 26%,transparent),transparent 34%),
    radial-gradient(circle at 88% 18%,color-mix(in srgb,var(--weather-accent) 10%,transparent),transparent 30%),
    linear-gradient(145deg,color-mix(in srgb,var(--panel) 84%,var(--weather-accent) 16%),var(--panel));
  border-color:color-mix(in srgb,var(--weather-accent) 44%,var(--line));
}
.start-page .weather-now .weather-icon,.start-page .v08-weather-emoji{
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font-variant-emoji:emoji;
  filter:none;
  text-shadow:0 4px 18px color-mix(in srgb,var(--weather-accent) 35%,transparent);
}
.start-page .weather-hour{
  background:
    linear-gradient(180deg,color-mix(in srgb,var(--panel-2) 82%,var(--forecast-accent) 18%),color-mix(in srgb,var(--panel-2) 94%,var(--forecast-accent) 6%));
  border-color:color-mix(in srgb,var(--forecast-accent) 42%,var(--line));
}
.start-page .weather-hour b{display:flex;align-items:center;justify-content:center;gap:3px}
.start-page .v08-weather-emoji{font-size:1.15em;line-height:1}

/* The past is supporting context; the future is the decision surface. */
.start-page .timeline-row-v07 .timeline-track{
  background:linear-gradient(90deg,var(--panel-2) 0 var(--now-pct,33.333%),color-mix(in srgb,var(--panel-2) 72%,var(--bg) 28%) var(--now-pct,33.333%) 100%);
}
.start-page .timeline-row-v07.history-row .timeline-track{
  height:23px;
  opacity:.82;
  background:linear-gradient(90deg,var(--panel-2) 0 var(--now-pct,33.333%),color-mix(in srgb,var(--panel-2) 60%,var(--bg) 40%) var(--now-pct,33.333%) 100%);
}
.start-page .timeline-row-v07.future-row .timeline-track{height:37px}
.start-page .timeline-row-v07.history-row .timeline-segment{top:3px;bottom:3px;font-size:8px}
.start-page .timeline-row-v07.history-row .timeline-segment small{display:none}
.start-page .timeline-row-v07.future-row .timeline-segment{top:4px;bottom:4px;font-size:9px}
.start-page .timeline-axis-v07{height:24px}
.start-page .v07-axis-tick{font-size:9px;line-height:1.1;color:color-mix(in srgb,var(--muted) 88%,var(--text) 12%)}
.start-page .v07-axis-tick.is-now{font-size:9.5px}
.start-page .timeline-row-label strong{font-size:10px}.start-page .timeline-row-label small{font-size:7.5px}
.start-page .timeline-unplanned{top:4px;bottom:4px}

/* One consistent vocabulary: there is no purple local-discharge mode in v0.8. */
.start-page .timeline-legend{align-items:center}
.start-page .timeline-legend span{white-space:nowrap}

/* A real energy-series legend instead of colourless prose. */
.start-page .energy-legend{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.start-page .energy-legend span{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.start-page .energy-legend i{display:inline-block;width:13px;height:3px;border-radius:99px;background:var(--muted)}
.start-page .energy-legend [data-series="pv"] i{background:var(--yellow)}
.start-page .energy-legend [data-series="grid"] i{background:var(--cyan)}
.start-page .energy-legend [data-series="battery"] i{background:var(--purple)}

/* Compact contextual help works with mouse hover and keyboard/tap focus. */
.start-page [data-tip]{position:relative;cursor:help;outline:none}
.start-page [data-tip]::after{
  content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translate(-50%,5px);
  width:min(240px,70vw);padding:7px 9px;border-radius:8px;border:1px solid color-mix(in srgb,var(--line) 72%,var(--text) 28%);
  background:color-mix(in srgb,var(--panel) 94%,#000 6%);color:var(--text);font-size:10px;line-height:1.35;font-weight:500;letter-spacing:0;text-transform:none;
  box-shadow:0 10px 28px rgba(0,0,0,.28);opacity:0;visibility:hidden;pointer-events:none;z-index:40;white-space:normal;text-align:left;
  transition:opacity .14s ease,transform .14s ease,visibility .14s ease;
}
.start-page [data-tip]:hover::after,.start-page [data-tip]:focus::after{opacity:1;visibility:visible;transform:translate(-50%,0)}
.start-page .phase-balance[data-tip]::after{left:auto;right:0;transform:translate(0,5px)}
.start-page .phase-balance[data-tip]:hover::after,.start-page .phase-balance[data-tip]:focus::after{transform:translate(0,0)}

@media(min-width:1280px){
  .start-page .planning-panel{padding-bottom:7px}
  .start-page .timeline-shell.timeline-24h{gap:3px}
  .start-page .timeline-row-v07.history-row .timeline-track{height:21px}
  .start-page .timeline-row-v07.future-row .timeline-track{height:35px}
}

@media(max-width:680px){
  /* Weather is one horizontal instrument band: current conditions + four days. */
  .start-page .weather-card.weather-rich{
    grid-template-columns:96px minmax(0,1fr);
    grid-template-rows:auto auto auto;
    gap:7px 7px;
    padding:11px 10px;
  }
  .start-page .weather-top{padding-right:7px;display:flex;flex-direction:column;justify-content:center}
  .start-page .weather-now{gap:4px}.start-page .weather-now .weather-icon{font-size:31px}.start-page .weather-now strong{font-size:31px}
  .start-page .weather-condition{font-size:10px;line-height:1.2}.start-page .weather-range{font-size:8.5px;line-height:1.2;margin-top:4px}
  .start-page .weather-hours.weather-days{gap:3px;align-items:stretch}
  .start-page .weather-day{min-height:62px;padding:5px 2px;border-radius:8px}
  .start-page .weather-day time{font-size:8px;font-weight:750}.start-page .weather-day b{font-size:13px;margin-top:2px}.start-page .weather-day small{font-size:7.5px;line-height:1.15}.start-page .weather-day em{font-size:7.5px;margin-top:2px}
  .start-page .pv-forecast-line span{font-size:8px}.start-page .pv-forecast-line strong{font-size:12px}

  /* Title + exactly three phases share one line; onbalans remains desktop detail. */
  .start-page .phase-panel{grid-template-columns:88px minmax(0,1fr);gap:5px;padding:7px 8px}
  .start-page .phase-panel .panel-head h2{font-size:12px;line-height:1.1}.start-page .phase-panel .panel-head small{font-size:7.5px;line-height:1.15}.start-page #phaseUpdated{display:none}
  .start-page .phase-strip.phase-strip-rich{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
  .start-page .phase-strip-rich .phase-cell{min-height:43px;padding:4px 4px;gap:3px}
  .start-page .phase-strip-rich .phase-cell strong{font-size:15px;line-height:1}.start-page .phase-strip-rich .phase-cell span{font-size:9px}.start-page .phase-strip-rich .phase-cell small{font-size:7.5px;line-height:1.1}
  .start-page .phase-strip-rich .phase-balance{display:none}

  /* Six hours of history are deliberately thinner; eighteen future hours dominate. */
  .start-page .planning-panel{padding:10px 8px}
  .start-page .timeline-axis-v07,.start-page .timeline-row-v07{grid-template-columns:56px minmax(0,1fr);gap:4px}
  .start-page .timeline-axis-v07{height:25px}.start-page .v07-axis-tick{font-size:8.5px}.start-page .v07-axis-tick.is-now{font-size:9px}
  .start-page .timeline-row-label strong{font-size:9.5px}.start-page .timeline-row-label small{font-size:7px}
  .start-page .timeline-row-v07.history-row .timeline-track{height:20px}.start-page .timeline-row-v07.future-row .timeline-track{height:36px}
  .start-page .timeline-row-v07.history-row .timeline-segment{top:3px;bottom:3px;font-size:7px}.start-page .timeline-row-v07.future-row .timeline-segment{top:4px;bottom:4px;font-size:8px}
  .start-page .planning-pill{font-size:9px}

  .start-page .chart-foot{font-size:9px;line-height:1.25}.start-page .energy-legend{gap:8px}.start-page .energy-legend i{width:12px}
  .start-page [data-tip]::after{font-size:11px;width:min(250px,78vw)}
}
