/* The forecast palette is the reference; lighter surfaces use darker shades. */
:root{--meteo-temp:#ffbe7b;--meteo-temp-min:#6ad3f2;--meteo-temp-mean:#f3d990;--meteo-rain:#65c7ff;--meteo-rain-rate:#2e85d6;--meteo-wind:#b997f0;--meteo-gust:#edd0ff;--meteo-direction:#ffffff;--meteo-hum:#6fe0c2;--meteo-press:#c4c4c4}
html:not(.dark-mode) .metric-card{--meteo-temp:#b66b16;--meteo-temp-min:#087a9c;--meteo-rain:#147ca8;--meteo-rain-rate:#104c92;--meteo-wind:#66409d;--meteo-gust:#8a56bf;--meteo-direction:#30485a;--meteo-hum:#157d65;--meteo-press:#626262}
#current-temp-value,#current-temp-high,#current-temp-low{color:#fff}
html.dark-mode :is(#current-humidity-value,#current-wind-speed-value,#current-rain-value,#current-pressure-value){color:#fff}
.current-grid :is(#current-humidity-high,#current-humidity-low,#current-wind-gust-high,#current-rain-rate-value){color:inherit}
html.dark-mode .current-grid :is(#current-humidity-high,#current-humidity-low,#current-wind-gust-high,#current-rain-rate-value){color:#fff}
#current-wind-direction,#wind-direction-arrow{color:var(--meteo-direction)}
[data-weather-metric=temp] b,[data-weather-metric=tempMax] b{color:var(--meteo-temp)}
[data-weather-metric=tempMin] b{color:var(--meteo-temp-min)}
[data-weather-metric=wind] b{color:var(--meteo-wind)}[data-weather-metric=gust] b{color:var(--meteo-gust)}
[data-weather-metric=rain] b{color:var(--meteo-rain)}[data-weather-metric=hum] b{color:var(--meteo-hum)}[data-weather-metric=press] b{color:var(--meteo-press)}
:root[data-parent-theme=light]{--meteo-temp:#b66b16;--meteo-temp-min:#087a9c;--meteo-temp-mean:#947322;--meteo-rain:#147ca8;--meteo-rain-rate:#104c92;--meteo-wind:#66409d;--meteo-gust:#8a56bf;--meteo-direction:#30485a;--meteo-hum:#157d65;--meteo-press:#626262}

[data-weather-metric=rainRate] b{color:var(--meteo-rain-rate)}

tr:has(>[data-record-metric=tempMax]),[data-timeline-metric=tempMax]{--record-color:var(--meteo-temp)}
tr:has(>[data-record-metric=tempMin]),[data-timeline-metric=tempMin]{--record-color:var(--meteo-temp-min)}
tr:has(>[data-record-metric=hum]),[data-timeline-metric=hum]{--record-color:var(--meteo-hum)}
tr:has(>[data-record-metric=press]),[data-timeline-metric=press]{--record-color:var(--meteo-press)}
tr:has(>[data-record-metric=rainRate]),[data-timeline-metric=rainRate]{--record-color:var(--meteo-rain-rate)}
tr:has(>[data-record-metric=rain]),[data-timeline-metric=rain]{--record-color:var(--meteo-rain)}
tr:has(>[data-record-metric=gust]),[data-timeline-metric=gust]{--record-color:var(--meteo-gust)}
table:has(tr>td[data-record-metric]){
  border-collapse:separate!important;
  border-spacing:0 3px;
}
tr.td_data:has(>td[data-record-metric])>td{
  align-self:stretch;
  background-color:color-mix(in srgb,var(--record-color) 11%,transparent)!important;
  border-bottom-color:transparent!important;
}
tr.td_data:has(>td[data-record-metric])>td:first-child{border-radius:8px 0 0 8px}
tr.td_data:has(>td[data-record-metric])>td:last-child{border-radius:0 8px 8px 0}
[data-record-metric] .record-value{
  color:var(--record-color)!important;
  font-weight:700;
}
[data-record-metric] .record-value>span{color:inherit!important}

@media(max-width:700px){
  .history-card tr.td_data:has(>td[data-record-metric]){
    margin-block:2px;
    border-radius:8px;
    overflow:hidden;
    background-color:color-mix(in srgb,var(--record-color) 11%,transparent)!important;
    border-bottom-color:transparent!important;
  }
  .history-card tr.td_data:has(>td[data-record-metric])>td{
    background-color:transparent!important;
    border-radius:0;
  }
}

html:not(.dark-mode) .records-timeline{
  --meteo-temp:#b66b16;
  --meteo-temp-min:#087a9c;
  --meteo-rain:#147ca8;
  --meteo-rain-rate:#104c92;
  --meteo-gust:#8a56bf;
  --meteo-hum:#157d65;
  --meteo-press:#626262;
}
.panel.records-timeline{margin-bottom:12px;padding:14px 17px}
.records-timeline h3{margin:0 0 8px;font-size:1rem}
.records-timeline-axis{
  --lane-height:44px;
  --year-height:23px;
  position:relative;
  margin:0 4px;
  height:calc(var(--lanes) * var(--lane-height) + var(--year-height));
}
.records-timeline-track,.records-timeline-years{
  margin:0;
  padding:0;
  list-style:none;
}
.records-timeline-track{
  position:absolute;
  inset:0 0 var(--year-height);
  border-bottom:1px solid var(--line);
}
.records-timeline-marker{
  position:absolute;
  left:var(--point);
  bottom:0;
  height:calc(var(--lane) * var(--lane-height) + 11px);
  border-left:1px solid color-mix(in srgb,var(--record-color) 45%,transparent);
}
.records-timeline-marker::after{
  content:"";
  position:absolute;
  bottom:-3px;
  left:-3px;
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--record-color);
}
.records-timeline-event{
  position:absolute;
  z-index:1;
  left:var(--label-position);
  bottom:calc(var(--lane) * var(--lane-height) + 10px);
  translate:-50% 0;
  box-sizing:border-box;
  width:12%;
  max-width:135px;
  text-align:center;
  line-height:1.15;
}
.records-timeline-event span,.records-timeline-event strong,.records-timeline-event time{display:block}
.records-timeline-event span{font-size:clamp(8px,.8vw,10px)}
.records-timeline-event strong{margin:1px 0;color:var(--record-color);font-size:clamp(10px,.95vw,12px)}
.records-timeline-event time{color:var(--muted);font-size:9px}
.records-timeline-years{color:var(--muted);font-size:clamp(.59rem,1vw,.73rem)}
.records-timeline-years li{
  position:absolute;
  bottom:0;
  left:var(--year-position);
  translate:-50% 0;
  display:flex;
  align-items:flex-end;
  height:var(--year-height);
  font-variant-numeric:tabular-nums;
}
.records-timeline-years li:first-child{translate:0 0}
.records-timeline-years li::before{
  content:"";
  position:absolute;
  top:0;
  left:50%;
  height:4px;
  border-left:1px solid var(--line);
}
.records-timeline-years li:first-child::before{left:0}
@media(max-width:700px),(pointer:coarse){
  .panel.records-timeline{padding:12px}
  .records-timeline h3{font-size:.9rem}
  .records-timeline-axis{height:calc(var(--years) * 43px);margin:0}
  .records-timeline-track{
    inset:0;
    border-bottom:0;
  }
  .records-timeline-track::before{
    content:"";
    position:absolute;
    inset:0 auto 0 50%;
    border-left:1px solid var(--line);
  }
  .records-timeline-years li{
    top:var(--year-position);
    bottom:auto;
    left:50%;
    translate:-50% -50%;
    display:block;
    height:auto;
    padding:0 3px;
    background:#fff;
    color:var(--muted);
    font-size:9px;
  }
  .records-timeline-years li:first-child{translate:-50% 0}
  .records-timeline-years li::before{display:none}
  html.dark-mode .records-timeline-years li{background:#192a36}
  .records-timeline-marker{
    top:var(--point);
    bottom:auto;
    left:50%;
    width:38px;
    height:0;
    border:0;
    border-top:1px solid var(--record-color);
  }
  .records-timeline-marker::after{left:auto;right:-2px;bottom:-2px}
  .records-timeline-track li:nth-child(odd) .records-timeline-marker{left:auto;right:50%}
  .records-timeline-track li:nth-child(odd) .records-timeline-marker::after{left:-2px;right:auto}
  .records-timeline-event{
    top:var(--point);
    bottom:auto;
    left:calc(50% + 44px);
    translate:0 -50%;
    width:calc(50% - 44px);
    max-width:none;
    text-align:left;
  }
  .records-timeline-track li:nth-child(odd) .records-timeline-event{
    left:auto;
    right:calc(50% + 44px);
    text-align:right;
  }
  .records-timeline-event span,.records-timeline-event time{font-size:10px}
  .records-timeline-event strong{font-size:12px}
}
