/* QSMET portale - versione telefono "stile app", fase 1.
   Caricato solo sotto i 768 px (attributo media del <link>): il desktop non cambia.
   Stessi colori, loghi e font del portale. Il carbonio resta solo nelle barre (in alto e in basso);
   il resto e' scuro e piatto. */

:root {
  --qs-tabs: 60px;
  --qs-safe: env(safe-area-inset-bottom, 0px);
  --qs-carbon: url(images/carbon_btn.png);
  --qs-line: rgba(255, 255, 255, 0.16);
}

/* ---------- sfondo delle sezioni: scuro piatto ---------- */
.app-cover {
  background-image: none !important;
  background-color: #0a0a0a !important;
}

/* ---------- barra in alto: carbonio ---------- */
#header,
.app-header-fixed .app-header {
  background: #000 var(--qs-carbon) !important;
  border-bottom: 1px solid var(--qs-line);
}

/* ---------- timeline: visibile anche sul telefono, con lo spazio per le schede in basso ---------- */
#timeline-container.d-none.d-sm-block { display: block !important; }
#timeline-container {
  height: calc(65px + var(--qs-tabs) + var(--qs-safe)) !important;
  padding-bottom: calc(var(--qs-tabs) + var(--qs-safe));
  background: #000 var(--qs-carbon) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.4) !important;
}
/* nel Radar c'e' gia' la sua barra (ultimi 15 minuti): resta solo lo spazio per le schede */

/* ---------- barra a schede in basso: carbonio, scheda attiva bianca ---------- */
#qsmet-tabs {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  height: calc(var(--qs-tabs) + var(--qs-safe));
  padding: 7px 2px calc(2px + var(--qs-safe));
  gap: 0;
  background: #000 var(--qs-carbon);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}
body.qsmet-has-tl #qsmet-tabs { display: flex; }
#qsmet-tabs .qs-tab {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  opacity: 0.6;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#qsmet-tabs .qs-tab i { font-size: 19px; }
#qsmet-tabs .qs-tab img { height: 20px; filter: invert(1); }
/* scheda attiva: niente bolla, icona e testo pieni e un segno arancione sul bordo alto */
#qsmet-tabs .qs-tab.active { background: transparent; color: #fff; opacity: 1; }
#qsmet-tabs .qs-tab.active:before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 30px;
  height: 4px;
  margin-left: -14px;
  border-radius: 0 0 3px 3px;
  background: #ff8c00;
}

/* ---------- stazioni meteo: una riga compatta; un tocco apre il pannello completo ---------- */
#groundstations { margin-top: 0 !important; background: #050505; }
#groundstations .mabBoxStation {
  flex-wrap: nowrap !important;
  align-items: center;
  min-height: 54px;
  padding: 0 4px 0 8px !important;
  border-bottom: 1px solid var(--qs-line) !important;
}
#groundstations .groundstation_clock { display: none !important; }

/* selettore: solo la stazione scelta, come pulsante con la freccia */
#groundstations .grtitle {
  width: auto !important;
  flex: none;
  padding: 0 !important;
  border-right: 0 !important;
  overflow: visible;
}
#groundstations .grtitle > .row { margin: 0; flex-wrap: nowrap; }
#groundstations .grtitle > .row > div { width: auto; flex: none; padding: 0 !important; margin: 0 !important; }
#groundstations .grtitle .badge { display: none !important; cursor: pointer; }
#groundstations .grtitle .badge.bg-success {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 38px;
  min-width: 72px;
  padding: 0 12px !important;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 19px;
  background: #1a1a1a !important;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
#groundstations .grtitle .badge.bg-success:after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 10px;
  margin-left: 6px;
}

/* valori: aria, pista (o umidita' se la stazione non ha la pista), vento, pioggia */
#groundstations .mabBoxStation .grcontent {
  width: auto !important;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: block;
  padding: 0 !important;
  cursor: pointer;
}
#groundstations .grcontent > .row {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: center;
  height: auto !important;
  margin: 0 !important;
  overflow: hidden;
}
#groundstations .grcontent > .row > div {
  width: auto !important;
  flex: none;
  height: auto !important;
  padding: 4px 5px !important;
  border-right: 0 !important;
  border-left: 1px solid var(--qs-line);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25 !important;
  white-space: nowrap;
}
#groundstations .grcontent > .row > div:first-child { border-left: 0; }
#groundstations .grcontent > .row > div .qm { margin-right: 3px; }
#groundstations .grcontent > .row > .nodata { width: 100% !important; white-space: normal; border: 0; }
#groundstations .grcontent > .row > .nodata h5 { font-size: 13px; margin: 0 !important; }

/* con la pista: 1 aria, 2 pista, 3 pioggia, 4 direzione, 5 vento, 6 raffiche, 7 umidita', 8 pressione */
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(4),
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(6),
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(7),
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(8) { display: none !important; }
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(1) { order: 1; }
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(2) { order: 2; }
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(5) { order: 3; }
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(3) { order: 4; }
/* senza la pista: 1 aria, 2 pioggia, 3 direzione, 4 vento, 5 raffiche, 6 umidita', 7 pressione */
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(3),
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(5),
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(7) { display: none !important; }
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(1) { order: 1; }
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(6) { order: 2; }
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(4) { order: 3; }
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(2) { order: 4; }

/* piu' larghezza, piu' valori nella riga compatta (prima restavano sempre 4): le righe sono nascoste solo sotto la soglia; ordine dopo i primi quattro */
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(6) { order: 5; }
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(7) { order: 6; }
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(8) { order: 7; }
#groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(4) { order: 8; }
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(5) { order: 5; }
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(7) { order: 6; }
#groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(3) { order: 7; }
@media (min-width: 500px) {
  #groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(6),
  #groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(5) { display: flex !important; }
}
@media (min-width: 600px) {
  #groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(7),
  #groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(7) { display: flex !important; }
}
@media (min-width: 680px) {
  #groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(8),
  #groundstations:not(.qs-open) .grcontent > .row > .el8:nth-child(4),
  #groundstations:not(.qs-open) .grcontent > .row > .el7:nth-child(3) { display: flex !important; }
}

/* pannello aperto: selettore a segmenti e tutti i valori */
#groundstations.qs-open .mabBoxStation {
  flex-wrap: wrap !important;
  align-items: flex-start;
  padding: 8px !important;
  background: #080808;
  width: 100%;
  max-width: 100%;
}
#groundstations.qs-open .grtitle { width: 100% !important; max-width: 100%; padding: 0 0 8px !important; }
#groundstations.qs-open .grtitle > .row {
  display: flex;
  width: 100%;
  max-width: 100%;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 21px;
}
#groundstations.qs-open .grtitle > .row > div { flex: 1 1 0 !important; width: 0 !important; min-width: 0; max-width: none; }
#groundstations.qs-open .grtitle .badge {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  padding: 0 !important;
  border: 0;
  border-right: 1px solid var(--qs-line);
  border-radius: 0;
  background: #141414 !important;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
#groundstations.qs-open .grtitle .badge.bg-success { background: #fff !important; color: #000 !important; }
#groundstations.qs-open .grtitle .badge.bg-success:after { content: ""; margin: 0; }
#groundstations.qs-open .mabBoxStation .grcontent { width: 100% !important; max-width: 100%; flex: none; cursor: default; }
#groundstations.qs-open .grcontent > .row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
}
#groundstations.qs-open .grcontent > .row > div {
  display: block !important;
  order: 0 !important;
  min-width: 0;
  padding: 8px 4px !important;
  border: 1px solid var(--qs-line);
  border-radius: 10px;
  background: #111;
  text-align: center;
  font-size: 12.5px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#groundstations.qs-open .grcontent > .row > .nodata { grid-column: 1 / -1; }

/* ---------- Radar: webcam piccole a destra ---------- */
#camswrapper { width: 78px !important; top: 4px; right: 4px; }
#camswrapper .camerathumb { margin: 0 0 6px !important; border: 2px solid rgba(255, 255, 255, 0.9) !important; border-radius: 10px !important; }
#camswrapper .camerathumb:hover { transform: none; }
#camswrapper .camerathumb img { border-top-left-radius: 7px; border-top-right-radius: 7px; }
#camswrapper span { font-size: 10px; line-height: 1.5; border-bottom-left-radius: 7px; border-bottom-right-radius: 7px; }
#camswrapper .camerathumb.qs-cam-off { display: none; }
#qs-cam-list .form-check { min-height: 40px; display: flex; align-items: center; gap: 8px; }

/* ---------- menu laterale: loghi in fondo (QS MET e WEC grandi, Furuno e Maxisoft piccoli) ---------- */
#sidebar-right .p-15px { padding-bottom: calc(var(--qs-tabs) + var(--qs-safe) + 24px) !important; }
#sidebar-right .row.mt-4 { align-items: center; row-gap: 14px; margin-top: 28px !important; border-top: 1px solid var(--qs-line); padding-top: 22px; }
#sidebar-right .row.mt-4 > div { margin-top: 0 !important; }
#sidebar-right .row.mt-4 > div:nth-child(1) img { height: 66px; width: auto; max-width: 100%; }
#sidebar-right .row.mt-4 > div:nth-child(2) img { height: 48px; width: auto; max-width: 100%; }
#sidebar-right .row.mt-4 > div:nth-child(3) img,
#sidebar-right .row.mt-4 > div:nth-child(4) img { height: 14px; width: auto; max-width: 100%; opacity: 0.9; }

/* ---------- Radar: la barra del tempo ha lo stesso aspetto della timeline delle altre sezioni ---------- */
#cloudsPlayer {
  height: 52px !important;
  padding: 0 8px !important;
  gap: 8px;
  background: #000 var(--qs-carbon) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.4) !important;
  font-weight: 700;
  font-size: 13px;
}
#cloudsPlayer > #starttime,
#cloudsPlayer > #endtime {
  border: 0 !important;
  padding: 0 4px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
#cloudsPlayer > .playbtn {
  height: 38px;
  min-width: 44px;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 19px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}
#cloudsPlayer select { height: 34px; border-radius: 17px; }

/* ---------- Climate Summary: meno margini, testi piu' piccoli, tabelle larghe scorrevoli ---------- */
.overviewcontainer, .comparecontainer { padding: 8px 8px 0 !important; }
.overviewcontainer .panel-body, .comparecontainer .panel-body { padding: 8px !important; }
#overview, #compare { font-size: 12px; }
#overview h6, #compare h6 { font-size: 12px; }
#compare .legendcomp, #overview #overviewlegend { font-size: 11px; line-height: 1.25; }
#overviewdata, #comparedata { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#overviewfilter .col-sm-6 { flex: 0 0 100%; max-width: 100%; text-align: left !important; }
#overview .btn-group .btn, #compare .btn-group .btn { padding: 8px 10px; min-height: 40px; }
#overview select.form-select, #compare select.form-select { min-height: 40px; font-size: 13px; }

/* il pulsante di refresh non deve stare sopra il menu aperto */
.app-sidebar-end-mobile-toggled .qsmet-refresh,
.app-sidebar-end-toggled .qsmet-refresh { display: none !important; }

/* ---------- impaginazione: refresh nella barra in alto, titolo che si accorcia ---------- */
.qsmet-refresh {
  position: fixed !important;
  top: 6px !important;
  right: 8px !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  z-index: 1031 !important;
}
#header .navbar-header { max-width: calc(100% - 64px); overflow: hidden; }
#header #eventtitlestatus { max-width: calc(100vw - 150px) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }

/* ---------- Radar: la barra del tempo lascia spazio al cursore; niente orologio sulla mappa ---------- */
#cloudsPlayer > #gostart, #cloudsPlayer > #goend { display: none !important; }
#cloudsPlayer > .playbtn { min-width: 40px; padding: 0 6px !important; }
#cloudsPlayer > #fps { width: auto !important; }
#mapclock:not(.clock-countdown) { display: none !important; }
#cloudsPlayer > #fps { display: none !important; }
/* durata e vista: sul telefono ci sono gia il pulsante della durata (#qs-dur) e le schede; main.css li nascondeva solo sotto i 450 px, per questo tra 451 e 767 la durata compariva due volte */
#cloudsPlayer > #length, #cloudsPlayer > #view { display: none !important; }
#cloudsPlayer { gap: 6px; }

/* ---------- Stations: grafici piu' bassi, senza spazi vuoti ---------- */
#toolcontainer .boxcontent .js-plotly-plot { height: 300px !important; }
#toolcontainer .boxcontent > div { min-height: 0; }

/* ---------- Forecast (vista oraria): i testi del giorno vanno a capo nella parte visibile ---------- */
#toolcontainer .Day .weatherconditions,
#toolcontainer .Day .previousnight { max-width: calc(100vw - 140px); }
#toolcontainer .Day .weatherconditions h5,
#toolcontainer .Day .previousnight h5 { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }

/* ---------- Forecast (vista giornaliera): schede piu' sobrie, bordo sottile ---------- */
.ForecastDaily { padding: 14px !important; }
.ForecastDaily .widget-chart-content {
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 14px !important;
  background: #111 !important;
  box-shadow: none !important;
}
.ForecastDaily .ForecastDay { padding: 0 6px; }

/* ---------- menu laterale: stile app (le sezioni sono gia' nella barra in basso) ---------- */
#sidebar-right .menu_eventmenu { display: none !important; }
#sidebar-right .menu_eventname { margin-bottom: 6px !important; }
#sidebar-right .btn-carbon,
#sidebar-right .btn.btn-black {
  background: #141414 !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 12px !important;
  min-height: 46px;
  box-shadow: none !important;
  font-weight: 700;
}
#sidebar-right .menu_activemenu .btn { border-color: #36d111 !important; }
#sidebar-right h3 { font-size: 15px; letter-spacing: 0.4px; text-transform: uppercase; color: #ff8c00; margin-top: 18px !important; }
#sidebar-right .menu_eventname { font-size: 18px; text-transform: none; color: #fff; }

/* ---------- Forecast orario: e' chiaro che si scorre di lato ---------- */
.forecastarrowcontainer {
  top: 8px !important;
  left: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 22px !important;
  background: #141414 !important;
  overflow: hidden;
}
.forecastarrowcontainer .btn, .forecastarrowcontainer a, .forecastarrowcontainer button {
  min-width: 40px;
  min-height: 38px;
  font-size: 18px;
}
/* suggerimento sotto le frecce */
.forecastarrowcontainer:after {
  content: "swipe";
  position: absolute;
  left: 0; right: 0; bottom: 1px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #ff8c00;
}
.forecastarrowcontainer { padding-bottom: 12px !important; }
/* sfumatura sul bordo destro: c'e' altro da vedere */
#toolcontainer .HourlyWrapper { position: relative; }
#toolcontainer .HourlyWrapper:after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 34px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(10, 10, 10, 0), rgba(10, 10, 10, 0.92));
  z-index: 5;
}

/* =====================================================================
   Impianto grafico unico (telefono): superfici scure, bordo sottile, un solo accento
   ===================================================================== */
:root {
  --qs-bg: #0a0a0a;
  --qs-surface: #121212;
  --qs-surface2: #1a1a1a;
  --qs-border: rgba(255, 255, 255, 0.12);
  --qs-muted: #9aa0a6;
  --qs-accent: #ff8c00;
  --qs-radius: 14px;
  --qs-gap: 12px;
}

/* pannelli (stazioni, climate, daily): schede uguali per tutte le sezioni */
#toolcontainer .panel,
#toolcontainer .panel.panel-inverse {
  background: var(--qs-surface) !important;
  border: 1px solid var(--qs-border) !important;
  border-radius: var(--qs-radius) !important;
  box-shadow: none !important;
  margin: 0 0 var(--qs-gap) 0 !important;
  overflow: hidden;
}
#toolcontainer .panel-heading { background: transparent !important; border-bottom: 1px solid var(--qs-border); padding: 12px 14px !important; }
#toolcontainer .panel-title { font-size: 16px !important; letter-spacing: 0.2px; }
#toolcontainer .row.gx-0.p-2 { padding: var(--qs-gap) !important; }

/* grafici: niente fondo grigio, griglia leggera, spazio tra un grafico e l'altro */
#toolcontainer .js-plotly-plot .main-svg .bg { fill: rgba(255, 255, 255, 0.025) !important; }
#toolcontainer .js-plotly-plot .gridlayer path { stroke: rgba(255, 255, 255, 0.07) !important; }
#toolcontainer .js-plotly-plot .zerolinelayer path { stroke: rgba(255, 255, 255, 0.18) !important; }
#toolcontainer .js-plotly-plot .gtitle { font-size: 13px !important; letter-spacing: 0.4px; text-transform: uppercase; fill: var(--qs-muted) !important; }
#toolcontainer .js-plotly-plot .legendtext { font-size: 11px !important; fill: var(--qs-muted) !important; }
#toolcontainer .js-plotly-plot .xtick text, #toolcontainer .js-plotly-plot .ytick text { fill: var(--qs-muted) !important; font-size: 11px !important; }
#toolcontainer .boxcontent > div { padding: 10px 6px 18px; border-bottom: 1px solid var(--qs-border); }
#toolcontainer .boxcontent > div:last-child { border-bottom: 0; padding-bottom: 8px; }
#toolcontainer .boxcontent .js-plotly-plot { height: 320px !important; }

/* intestazione della stazione */
#toolcontainer [id^=obsBoxStation] > .panel-heading h4, #toolcontainer [id^=obsBoxStation] h4 { font-size: 16px; }

/* =====================================================================
   Aspetto da app: striscia del previsore come riquadro, timeline piu' pulita
   ===================================================================== */
#advice_forecaster {
  margin: 4px 8px 4px !important;
  width: calc(100% - 16px) !important;
  min-height: 38px;
  border-radius: 12px !important;
  border: 0 !important;
  box-shadow: none !important;
}
#advice_forecaster h5 { font-size: 12px !important; line-height: 1.25 !important; }
#advice_forecaster h5 span { font-size: 10px !important; font-weight: 500; opacity: 0.8; }

/* timeline: niente righe grigie, giorni leggibili, cursore ben visibile */
#timeline-container svg .timebar { fill: rgba(255, 255, 255, 0.06) !important; stroke: none !important; }
#timeline-container svg .dayline { stroke: rgba(255, 255, 255, 0.28) !important; }
#timeline-container svg .hourline { stroke: rgba(255, 255, 255, 0.14) !important; }
#timeline-container svg .daytext { fill: var(--qs-muted) !important; font-size: 10px !important; font-weight: 600; }
#timeline-container svg .pastsquare, #timeline-container svg .futuresquare { fill: rgba(255, 255, 255, 0.04) !important; stroke: none !important; }

/* =====================================================================
   Forecast orario come da bozza: 4 ore per schermata, etichette compatte, separatori sottili
   ===================================================================== */
:root { --qs-hour: 5.1rem; }
.HourlyWrapper .Day .Hours .Hour { min-width: var(--qs-hour) !important; max-width: var(--qs-hour) !important; }
.HourlyWrapper .Legend { flex-basis: 84px !important; border-right: 1px solid rgba(255, 255, 255, 0.3) !important; background: #0a0a0a !important; }
.HourlyWrapper .Day { border-right: 1px solid rgba(255, 255, 255, 0.3) !important; }
.HourlyWrapper .Legend .hourval { font-size: 10.5px !important; padding-left: 4px !important; padding-right: 2px !important; text-align: left; }
.HourlyWrapper .Day .Hours .Hour { background-color: rgba(255, 255, 255, 0.04) !important; border-right: 1px solid rgba(255, 255, 255, 0.08); }
.HourlyWrapper .Day .Hours .Hour .HourTitle { font-size: 13px !important; font-weight: 700; }

/* =====================================================================
   Barra delle stazioni: da strumento di misura (etichetta piccola sopra, valore sotto), niente icone colorate
   ===================================================================== */
#groundstations { background: #0a0a0a !important; }
#groundstations .mabBoxStation { min-height: 56px; border-bottom: 1px solid var(--qs-border) !important; }

/* selettore stazione: rettangolo sobrio, non pillola */
#groundstations .grtitle .badge.bg-success {
  height: 36px;
  min-width: 64px;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  background: #161616 !important;
  font-size: 13px;
  letter-spacing: 0.3px;
}
#groundstations.qs-open .grtitle > .row { border-radius: 10px !important; }

/* celle dei valori */
#groundstations .grcontent > .row > div {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: 6px 12px !important;
  border: 0 !important;
  border-left: 1px solid var(--qs-border) !important;
  border-bottom: 0 !important;
  font-size: 15px !important;
  font-weight: 700;
  line-height: 1.15 !important;
  text-align: left !important;
}
#groundstations .grcontent > .row > div:first-child { border-left: 0 !important; }
#groundstations .grcontent > .row > div .qm { display: none !important; }
#groundstations .grcontent > .row > div::before {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--qs-muted);
}
/* con la pista: aria, pista, pioggia, direzione, vento, raffiche, umidita', pressione */
#groundstations .grcontent > .row > .el8:nth-child(1)::before { content: "Air"; }
#groundstations .grcontent > .row > .el8:nth-child(2)::before { content: "Track"; }
#groundstations .grcontent > .row > .el8:nth-child(3)::before { content: "Rain"; }
#groundstations .grcontent > .row > .el8:nth-child(4)::before { content: "Dir"; }
#groundstations .grcontent > .row > .el8:nth-child(5)::before { content: "Wind"; }
#groundstations .grcontent > .row > .el8:nth-child(6)::before { content: "Gust"; }
#groundstations .grcontent > .row > .el8:nth-child(7)::before { content: "Hum"; }
#groundstations .grcontent > .row > .el8:nth-child(8)::before { content: "Press"; }
/* senza la pista */
#groundstations .grcontent > .row > .el7:nth-child(1)::before { content: "Air"; }
#groundstations .grcontent > .row > .el7:nth-child(2)::before { content: "Rain"; }
#groundstations .grcontent > .row > .el7:nth-child(3)::before { content: "Dir"; }
#groundstations .grcontent > .row > .el7:nth-child(4)::before { content: "Wind"; }
#groundstations .grcontent > .row > .el7:nth-child(5)::before { content: "Gust"; }
#groundstations .grcontent > .row > .el7:nth-child(6)::before { content: "Hum"; }
#groundstations .grcontent > .row > .el7:nth-child(7)::before { content: "Press"; }
/* la direzione resta una freccia */
#groundstations .grcontent > .row > .el8:nth-child(4) .qm,
#groundstations .grcontent > .row > .el7:nth-child(3) .qm { display: inline-block !important; margin-top: 1px; }
#groundstations .grcontent > .row > .el8:nth-child(4) .qm-wind-direction,
#groundstations .grcontent > .row > .el7:nth-child(3) .qm-wind-direction { display: none !important; }

/* pannello aperto: tessere quadrate, sobrie */
#groundstations.qs-open .grcontent > .row > div {
  align-items: flex-start;
  border: 1px solid var(--qs-border) !important;
  border-radius: 10px !important;
  background: #111 !important;
  padding: 8px 10px !important;
}

/* pannello stazioni aperto: etichetta sopra, valore sotto su una riga, spazio tra le tessere */
#groundstations.qs-open .mabBoxStation { padding: 12px !important; }
#groundstations.qs-open .grcontent > .row { gap: 8px !important; margin-top: 4px !important; }
#groundstations.qs-open .grcontent > .row > div {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center;
  gap: 4px !important;
  min-height: 56px;
  padding: 10px 10px !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.1 !important;
  text-align: left !important;
}
#groundstations.qs-open .grcontent > .row > div::before { font-size: 9px; margin-bottom: 1px; }
#groundstations.qs-open .grtitle { padding-bottom: 10px !important; }

/* Forecast orario: righe delle etichette alte quanto quelle dei valori, cosi' restano allineate */
.HourlyWrapper .Legend .hourval { min-height: 39px; display: flex !important; align-items: center; }
.HourlyWrapper .Legend .hourval.airtemp { min-height: 144px; }

/* =====================================================================
   Climate Summary: griglia a colonne fisse, righe alla stessa altezza, selettori sobri
   ===================================================================== */
/* confronto sessioni: etichetta | differenza | valori A | valori B */
#compare #comparedata .row,
#compare #comparefilter {
  display: grid !important;
  grid-template-columns: 92px 62px minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  margin: 0 !important;
  padding: 6px 0;
  border-bottom: 1px solid var(--qs-border);
}
#compare #comparefilter { border-bottom: 0; padding-bottom: 10px; row-gap: 6px; }
#compare #comparedata .row > div,
#compare #comparefilter > div { width: auto !important; max-width: none !important; flex: none !important; padding: 0 4px !important; min-width: 0; }
#compare #comparedata .row p {
  height: 26px; line-height: 26px; margin: 0 !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12.5px; font-weight: 600;
}
#compare #comparedata .legendcomp p { font-size: 10.5px; font-weight: 700; color: var(--qs-accent); text-transform: none; }
#compare #comparedata .diff p { color: var(--qs-muted); font-size: 11.5px; }
#compare #comparedata .value1, #compare #comparedata .value2 { text-align: center; }
#compare h6 { text-align: center; color: var(--qs-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; }

/* overview: etichette e grafici delle stesse altezze */
#overviewlegend > div[id$=_overview] { height: 106px !important; font-size: 11px; font-weight: 700; color: var(--qs-accent); }
#overviewgraphs > div[id^=graph_] { height: 106px !important; }
#overviewlegend > .titles_overview, #overviewgraphs > .titles_overview { height: 53px !important; }

/* selettori di stazione e di sessione: controllo segmentato scuro */
#overview .btn-group, #compare .btn-group { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.28); }
#overview .btn-group .btn, #compare .btn-group .btn {
  background: #161616 !important; color: #fff !important; border: 0 !important; border-right: 1px solid var(--qs-border) !important;
  border-radius: 0 !important; min-width: 36px; min-height: 36px; padding: 6px 10px !important; font-size: 12.5px; font-weight: 700; box-shadow: none !important;
}
#overview .btn-group .btn:last-child, #compare .btn-group .btn:last-child { border-right: 0 !important; }
#overview .btn-group .btn.active, #compare .btn-group .btn.active { background: #fff !important; color: #000 !important; }
#overview select.form-select, #compare select.form-select {
  background-color: #161616 !important; color: #fff !important; border: 1px solid rgba(255,255,255,0.28) !important;
  border-radius: 10px !important; min-height: 38px; font-size: 12.5px; padding: 4px 24px 4px 8px;
}
#overviewfilter { row-gap: 8px; margin-bottom: 8px !important; }
#overviewfilter .col-sm-6 { padding-top: 0 !important; }

/* confronto: selettori di stazione piu' stretti, cosi' ci stanno tutti (1 2 3 all); differenze senza troncamenti */
#compare #comparefilter .btn-group .btn { min-width: 25px !important; padding: 5px 5px !important; font-size: 11px !important; }
#compare #comparefilter select.form-select { font-size: 11.5px; padding-left: 6px; }
#compare #comparedata .diff p { font-size: 10.5px; text-overflow: clip; }

/* =====================================================================
   Forecast orario: testi del previsore dietro il tasto NOTES (come da bozza); griglia subito sotto il giorno
   ===================================================================== */
.HourlyWrapper:not(.qs-notes-open) .previousnight,
.HourlyWrapper:not(.qs-notes-open) .weatherconditions { display: none !important; }
#qs-notes-toggle {
  position: absolute;
  left: 8px;
  top: 72px;
  width: 68px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #161616;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  z-index: 6;
}
.HourlyWrapper.qs-notes-open #qs-notes-toggle { background: #fff; color: #000; }

/* timeline in basso: i nomi delle sessioni non entrano nei giorni stretti, restano le barre */
#timeline-container svg .schedulename { display: none !important; }

/* =====================================================================
   Pulsante di aggiornamento: riquadro compatto con icona e ora (barra in alto)
   ===================================================================== */
.qsmet-refresh {
  top: 8px !important;
  right: 8px !important;
  width: auto !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  gap: 6px !important;
  border-radius: 9px !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  background: #161616 !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.qsmet-refresh i { font-size: 12px; }
#header .navbar-header { max-width: calc(100% - 96px) !important; }

/* =====================================================================
   Forecast orario: frecce e NOTES, compatti e dentro la colonna delle etichette
   ===================================================================== */
.forecastarrowcontainer {
  left: 7px !important;
  top: 8px !important;
  width: 70px !important;
  height: 34px !important;
  padding: 0 !important;
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 9px !important;
  background: #161616 !important;
  overflow: hidden;
}
.forecastarrowcontainer:after { content: none !important; }
.forecastarrowcontainer a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0 !important;
  min-height: 0 !important;
  font-size: 13px !important;
  color: #fff;
  border: 0 !important;
}
.forecastarrowcontainer a + a { border-left: 1px solid rgba(255, 255, 255, 0.2) !important; }
#qs-notes-toggle { left: 7px; top: 50px; width: 70px; height: 30px; border-radius: 9px; }

.forecastarrowcontainer .forecastarrowback { border-right: 1px solid rgba(255, 255, 255, 0.2) !important; }
.forecastarrowcontainer a { padding: 0 !important; }

/* =====================================================================
   Daily: controlli e grafico in colonna (prima erano affiancati e il grafico finiva fuori dallo schermo)
   ===================================================================== */
#toolcontainer .overlay-temperature > .row { flex-wrap: wrap !important; margin: 0 !important; row-gap: 12px; }
#toolcontainer .overlay-temperature > .row > [class*="col-"] { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; }
#toolcontainer .overlay-temperature .chart-controls { max-height: none !important; overflow: visible !important; height: auto !important; }
#toolcontainer .overlay-temperature .chart-controls * { max-height: none; }
#toolcontainer .overlay-temperature .card { border: 1px solid var(--qs-border) !important; border-radius: var(--qs-radius) !important; background: var(--qs-surface) !important; }
#toolcontainer .overlay-temperature .card-body { padding: 10px !important; }

/* Daily: la riga era in colonna con altezza fissa e i blocchi andavano a capo a destra */
#toolcontainer .overlay-temperature > .row { flex-direction: row !important; height: auto !important; }

/* freccia per richiudere il pannello delle stazioni (resta aperto cambiando stazione) */
#qs-gs-close { display: none; }
#groundstations.qs-open #qs-gs-close {
  display: block;
  width: 100%;
  height: 30px;
  border: 0;
  border-top: 1px solid var(--qs-border);
  background: transparent;
  color: var(--qs-muted);
  font-size: 12px;
}
#groundstations.qs-open { flex-direction: column; }


/* =====================================================================
   Climate - Race Overview: una colonna per sessione, che aumentano ogni anno.
   Il grafico ha una larghezza minima per sessione e scorre di lato; le etichette restano fisse a sinistra.
   ===================================================================== */
#overviewdata { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 !important; }
#overviewdata > #overviewlegend {
  position: sticky;
  left: 0;
  z-index: 3;
  flex: 0 0 92px !important;
  width: 92px !important;
  max-width: 92px !important;
  background: var(--qs-surface);
  padding-right: 6px;
  border-right: 1px solid var(--qs-border);
}
#overviewdata > #overviewgraphs { flex: 1 0 auto !important; width: auto !important; max-width: none !important; }

/* barre di scorrimento sottili e discrete (telefono) */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
*::-webkit-scrollbar { height: 3px; width: 3px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 3px; }

/* =====================================================================
   Previous Sessions Data: filtri come due schede affiancate (sessione A e B), tasti grandi e leggibili
   ===================================================================== */
#compare #comparefilter {
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  padding: 12px 10px 16px !important;
  border-bottom: 1px solid var(--qs-border) !important;
}
#compare #comparefilter > div:nth-child(1),
#compare #comparefilter > div:nth-child(2) { display: none !important; }
#compare #comparestations1, #compare #comparestations2 {
  padding: 10px !important;
  background: #0e0e0e;
  border: 1px solid var(--qs-border);
  border-radius: 12px;
  text-align: left !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--qs-muted);
  line-height: 1.2;
}
#compare #comparestations1:before { content: "Session A"; display: block; color: var(--qs-accent); margin-bottom: 8px; }
#compare #comparestations2:before { content: "Session B"; display: block; color: var(--qs-accent); margin-bottom: 8px; }
#compare #comparestations1 br, #compare #comparestations2 br { display: none; }
#compare #comparestations1 select.form-select, #compare #comparestations2 select.form-select {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  font-size: 14px !important;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 12px;
  padding: 4px 28px 4px 10px;
}
#compare #comparestations1 .btn-group, #compare #comparestations2 .btn-group {
  display: flex !important;
  width: 100%;
  margin-top: 6px;
}
#compare #comparefilter .btn-group .btn {
  flex: 1 1 0;
  min-width: 0 !important;
  min-height: 40px !important;
  padding: 0 !important;
  font-size: 13px !important;
  text-transform: none;
  letter-spacing: 0;
}

/* Forecast orario: alba e tramonto in riga sotto il titolo del giorno, non sopra (prima erano in posizione assoluta a destra) */
.HourlyWrapper .date1 h4 {
  position: static !important;
  display: flex !important;
  align-items: center;
  gap: 16px;
  margin: 2px 0 0 !important;
  font-size: 13px !important;
  font-weight: 600;
}
.HourlyWrapper .date1 h4 br { display: none; }
.HourlyWrapper .date1 h4 i { font-size: 18px !important; margin: 0 2px 0 0 !important; vertical-align: middle; }

/* Forecast orario: i giorni con poche ore (primo e ultimo) non devono sconfinare sul giorno vicino.
   Le larghezze minime originali (384 px per le ore, 16 rem per i testi) valevano 3 colonne da 128 px:
   ora le colonne sono --qs-hour, quindi il minimo e' di 3 colonne nuove (il codice del portale usa lo stesso 3 per la larghezza del giorno). */
.HourlyWrapper .Day .Hours { min-width: calc(var(--qs-hour) * 3) !important; }
.HourlyWrapper .date1, .HourlyWrapper .previousnight, .HourlyWrapper .weatherconditions { min-width: calc(var(--qs-hour) * 3) !important; }

/* =====================================================================
   Forecast giornaliero: 8 tessere per giorno, due righe da quattro (come da bozza)
   ===================================================================== */
.ForecastDaily .details.row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0 !important;
}
.ForecastDaily .details.row > .col {
  flex: none !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  min-height: 84px;
  padding: 10px 4px !important;
  background: #171717;
  border: 1px solid var(--qs-border);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}
.ForecastDaily .details.row > .col .qm { font-size: 24px !important; line-height: 1; }
.ForecastDaily .details.row > .sunrise { order: 1; }
.ForecastDaily .details.row > .sunset { order: 2; }
.ForecastDaily .details.row > .temperature { order: 3; }
.ForecastDaily .details.row > .wind { order: 4; }
.ForecastDaily .details.row > .weatherPM { order: 5; }
.ForecastDaily .details.row > .weatherAM { order: 6; }
.ForecastDaily .details.row > .rain { order: 7; }
.ForecastDaily .details.row > .pressure { order: 8; }

/* Daily: la lista dei giorni non scorre in una finestra da 300 px: si vede intera */
.day-controls-scrollable { max-height: none !important; height: auto !important; overflow: visible !important; }

/* =====================================================================
   Pioggia nella barra stazioni: riquadro rosso leggibile (barra chiusa e pannello aperto)
   ===================================================================== */
#groundstations .grcontent > .row > div[style*="background-color:red"],
#groundstations .grcontent > .row > div[style*="background-color: red"] {
  background-color: #d4172c !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}
#groundstations .grcontent > .row > div[style*="background-color:red"]::before,
#groundstations .grcontent > .row > div[style*="background-color: red"]::before { color: rgba(255, 255, 255, 0.9) !important; }
#groundstations:not(.qs-open) .grcontent > .row > div[style*="red"] { border-radius: 8px; margin: 4px 2px; padding: 4px 9px !important; }

/* =====================================================================
   Radar: finestrina della pioggia ("it's raining", "rain expected"...) visibile anche sul telefono
   ===================================================================== */
#farinforecastalert.d-none { display: block !important; }
#farinforecastalert {
  left: 8px !important;
  right: 8px !important;
  bottom: 62px !important;   /* sopra il player del Radar (60 px) */
  width: auto !important;
  max-width: none !important;
  margin-bottom: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 14px !important;
  overflow: hidden;
  z-index: 1000;
}
#farinforecastalert .widget-card-content.top { padding: 10px 14px !important; display: flex; align-items: center; gap: 10px; }
#farinforecastalert .widget-card-content.top h4 { margin: 0; font-size: 15px; }
/* i dettagli (inizio, fine, intensita'...) si aprono con un tocco */
#farinforecastalert:not(.qs-open) .widget-card-content.bottom { display: none; }
#farinforecastalert.qs-open .widget-card-content.bottom { display: block; padding: 6px 14px 12px !important; font-size: 12.5px; }
#farinforecastalert .widget-card-content.top:after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 11px;
  margin-left: auto;
  opacity: 0.7;
}
#farinforecastalert.qs-open .widget-card-content.top:after { content: "\f077"; }
/* countdown della pioggia: sopra la barra del tempo, centrato */
#countdown { bottom: 120px !important; }

/* =====================================================================
   Impostazioni del Radar (ingranaggio): foglio dal basso, scuro e opaco, con interruttori
   ===================================================================== */
#settings.offcanvas-start {
  top: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: auto !important;
  max-height: 82vh;
  border: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 20px 20px 0 0 !important;
  background: #121212 !important;
  color: #fff;
  z-index: 2100;
}
#settings.offcanvas-start:not(.show) { transform: translateY(105%) !important; }
#settings.offcanvas-start.show { transform: none !important; }
#settings .offcanvas-header { padding: 18px 16px 8px !important; position: relative; }
#settings .offcanvas-header:before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; background: #555; border-radius: 2px; }
#settings .offcanvas-title { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--qs-accent); }
/* in fondo il foglio ha spazio quanto le barre del portale (barra del radar + schede + area sicura): senza, l'ultimo comando (Reset filter)
   finisce sotto le barre e non si raggiunge neanche scorrendo */
#settings .offcanvas-body { overflow-y: auto; padding: 4px 16px calc(var(--qs-bar, 60px) + var(--qs-tabs, 60px) + var(--qs-safe, 0px) + 16px) !important; }
#settings .offcanvas-body > .row { height: auto !important; flex-wrap: nowrap; margin: 0; gap: 14px; }
#settings .offcanvas-body > .row > .col-4 { flex: 0 0 84px; width: 84px; padding: 0; height: auto !important; }
#settings .offcanvas-body > .row > .col-8 { flex: 1 1 auto; width: auto; padding: 0; font-size: 13px; color: var(--qs-muted); }

/* cursori */
#settings .form-range { height: 32px; margin: 2px 0 10px; }
#settings .form-range::-webkit-slider-runnable-track { height: 4px; background: #3a3a3a; border-radius: 2px; }
#settings .form-range::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; background: #4488ff; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* righe con interruttore */
#settings .form-check {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
  margin: 0;
  padding: 0 !important;
  border-bottom: 1px solid var(--qs-border);
  color: #fff;
  font-size: 14px;
}
#settings .form-check-label { margin: 0; }
#settings .form-check-input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  float: none;
  flex: none;
  width: 46px;
  height: 26px;
  margin: 0 !important;
  border: 0;
  border-radius: 13px;
  background: #4a4a4a !important;
  background-image: none !important;
  transition: background 0.15s;
}
#settings .form-check-input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}
#settings .form-check-input[type="checkbox"]:checked { background: #4488ff !important; }
#settings .form-check-input[type="checkbox"]:checked::after { left: 23px; }
#settings #qs-cam-list { padding-left: 14px !important; }
#settings #qs-cam-list .form-check { min-height: 42px; font-size: 13px; color: var(--qs-muted); }

/* =====================================================================
   Barra del tempo unica: la timeline delle sezioni e la barra del Radar hanno stessa altezza, stesso bordo, stessi pulsanti
   ===================================================================== */
:root { --qs-bar: 60px; }
#timeline-container { height: calc(var(--qs-bar) + var(--qs-tabs) + var(--qs-safe)) !important; }
#cloudsPlayer { height: var(--qs-bar) !important; }

/* zoom della timeline: due pulsanti tondi scuri, come quelli del Radar */
#tlZoomButtons { position: absolute; top: 0; right: 0; width: 34px; height: var(--qs-bar); float: none; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 0; background: transparent; }
#tlZoomButtons a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 50% !important;
  background: #1a1a1a !important;
  color: #fff !important;
  font-size: 12px !important;
}
#tlZoomButtons a.disabled { opacity: 0.35; }

/* =====================================================================
   Barra del tempo unica: LIVE | ora iniziale | cursore | ora finale | ingranaggio
   ===================================================================== */
/* la striscia a giorni resta nel codice (la timeline ne ha bisogno) ma non si vede */
body:not(.qsmet-radar) #timeline-container svg#WPtimeline,
body:not(.qsmet-radar) #tlZoomButtons { visibility: hidden !important; position: absolute !important; pointer-events: none; }
#qs-bar { display: none; }
body.qsmet-has-tl:not(.qsmet-radar) #qs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--qs-bar);
  padding: 0 8px;
  z-index: 2;
}
#qs-live, #qs-radar-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 17px;
  background: #1a1a1a;
  color: var(--qs-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
}
#qs-live i, #qs-radar-live i { width: 7px; height: 7px; border-radius: 50%; background: #666; }
#qs-live.on, #qs-radar-live.on { color: #36d111; border-color: #36d111; background: rgba(54, 209, 17, 0.12); }
#qs-live.on i, #qs-radar-live.on i { background: #36d111; box-shadow: 0 0 6px #36d111; }
#qs-t0, #qs-t1 { flex: none; font-size: 12px; font-weight: 700; color: #fff; min-width: 36px; text-align: center; }
#qs-range { flex: 1 1 auto; min-width: 0; height: 32px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; --qs-pct: 100%; }
#qs-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, #4488ff var(--qs-pct), #3a3a3a var(--qs-pct)); }
#qs-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -11px; border-radius: 50%; background: #4488ff; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
#qs-gear { flex: none; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,0.28); border-radius: 50%; background: #1a1a1a; color: #fff; font-size: 14px; }

/* Radar: pulsante LIVE nella sua barra; solo play (niente salti ai fotogrammi) */
#cloudsPlayer > #goprevious, #cloudsPlayer > #gonext { display: none !important; }

/* foglio Time (ingranaggio delle sezioni) */
#qs-tscrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2090; }
#qs-tscrim.show { display: block; }
#qs-tsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2100; padding: 18px 16px 24px; background: #121212; border-top: 1px solid rgba(255,255,255,0.2); border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .2s; }
#qs-tsheet.show { transform: none; }
#qs-tsheet .qs-tgrab { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; background: #555; border-radius: 2px; }
#qs-tsheet h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--qs-accent); }
#qs-tsheet .qs-topts { display: flex; gap: 8px; }
#qs-tsheet .qs-topts button { flex: 1; height: 44px; border: 1px solid var(--qs-border); border-radius: 12px; background: #1a1a1a; color: #fff; font-size: 13px; font-weight: 700; }
#qs-tsheet .qs-topts button.on { background: #fff; color: #000; }

/* barra del tempo a due righe nelle sezioni: giorni (con LIVE) sopra, cursore del giorno scelto sotto */
body.qsmet-has-tl:not(.qsmet-radar) #qs-bar { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
#qs-bar .qs-days { display: flex; align-items: center; gap: 8px; height: 40px; padding: 4px 8px 0; flex: none; }
#qs-bar .qs-ctl { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; padding: 0 8px; }
#qs-daylist { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 auto; min-width: 0; padding: 2px 0; }
#qs-daylist::-webkit-scrollbar { display: none; }
#qs-daylist .qs-day {
  flex: none;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--qs-border);
  border-radius: 15px;
  background: #1a1a1a;
  color: var(--qs-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
#qs-daylist .qs-day.on { background: #fff; color: #000; border-color: #fff; }

/* foglio Time: periodo con inizio e fine */
#qs-tsheet h4 + .qs-topts { margin-bottom: 18px; }
#qs-tsheet .qs-plabel { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--qs-muted); text-transform: uppercase; letter-spacing: 0.6px; }
#qs-tsheet .qs-plabel input { flex: 1 1 auto; max-width: 230px; height: 44px; padding: 0 10px; border: 1px solid var(--qs-border); border-radius: 12px; background: #1a1a1a; color: #fff; font-size: 14px; color-scheme: dark; }
#qs-p-err { min-height: 18px; margin: 2px 0 6px; font-size: 12px; color: #ff6b6b; }
#qs-p-apply { width: 100%; height: 46px; border: 0; border-radius: 12px; background: #fff; color: #000; font-size: 14px; font-weight: 700; }

/* =====================================================================
   Radar con doppia barra: sopra la barra comune (LIVE, giorni, cursore dell'evento), poi il player (fotogrammi, play)
   ===================================================================== */
:root { --qs-bar: 92px; }
#timeline-container { height: calc(var(--qs-bar) + var(--qs-tabs) + var(--qs-safe)) !important; border-top: 1px solid rgba(255, 255, 255, 0.4) !important; }
#timeline-container svg#WPtimeline, #tlZoomButtons { visibility: hidden !important; position: absolute !important; pointer-events: none; }
body.qsmet-has-tl #qs-bar { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; top: 0; left: 0; right: 0; height: var(--qs-bar); padding: 0; z-index: 2; }
#cloudsPlayer { height: 60px !important; }
#qs-radar-live { display: none !important; }

/* Climate e Daily: niente barra del tempo comune (il contenitore resta, ma solo per lo spazio delle schede in basso) */
body.qsmet-notime { --qs-bar: 0px; }
body.qsmet-notime #qs-bar { display: none !important; }
body.qsmet-notime #timeline-container { border-top: 0 !important; }

/* =====================================================================
   Barra del tempo semplice: LIVE | data e ora | durata   (sostituisce giorni e cursore)
   ===================================================================== */
:root { --qs-bar: 56px; }
body.qsmet-notime { --qs-bar: 0px; }
body.qsmet-has-tl #qs-bar { flex-direction: row !important; align-items: center !important; gap: 8px !important; padding: 0 8px !important; }
#qs-bar .qs-days, #qs-bar .qs-ctl, #qs-gear { display: none !important; }
#qs-when, #qs-dur {
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  color-scheme: dark;
}
#qs-when { flex: 1 1 auto; min-width: 0; }
#qs-dur { flex: none; width: 92px; }
body.qsmet-forecast #qs-dur { display: none; }

/* Radar: il player mostra anche gli fps */
#cloudsPlayer > #fps { display: flex !important; align-items: center; }
#cloudsPlayer > #fps select { height: 34px; border-radius: 10px; background: #1a1a1a; color: #fff; border: 1px solid rgba(255, 255, 255, 0.28); font-size: 13px; font-weight: 700; padding: 0 6px; }
#cloudsPlayer > #fps { font-size: 0; }
#cloudsPlayer > #fps select { font-size: 13px; }

/* meno spazio rubato in basso: barra piu' bassa */
:root { --qs-bar: 48px; --qs-tabs: 54px; }
body.qsmet-notime { --qs-bar: 0px; }
#qs-live { height: 34px; }
#qs-when, #qs-dur { height: 34px; font-size: 13px; }
#cloudsPlayer { height: 52px !important; }
#qsmet-tabs .qs-tab { gap: 3px; }
#qsmet-tabs .qs-tab i { font-size: 17px; }
#qsmet-tabs .qs-tab img { height: 18px; }

/* Radar: la striscia del previsore in alto si toglie (c'e' gia' la finestrina sulla mappa): piu' spazio per la mappa */
body.qsmet-radar #advice_forecaster { display: none !important; }

/* Radar senza la striscia del previsore: anche il margine in alto del tema scende (101 -> 52 px), altrimenti resta il vuoto e la mappa copre il player */
body.qsmet-radar #app.app-header-fixed { padding-top: 52px !important; }

/* durata: pulsante + foglio dal basso */
#qs-dur { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 112px; }
#qs-dur i { font-size: 10px; opacity: 0.7; }
#qs-dscrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2090; }
#qs-dscrim.show { display: block; }
#qs-dsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2100; padding: 18px 16px 26px; background: #121212; border-top: 1px solid rgba(255,255,255,0.2); border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .2s; }
#qs-dsheet.show { transform: none; }
#qs-dsheet .qs-tgrab { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; background: #555; border-radius: 2px; }
#qs-dsheet h4 { margin: 0 0 12px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--qs-accent); }
#qs-dsheet .qs-dopts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#qs-dsheet .qs-dopts button { height: 46px; border: 1px solid var(--qs-border); border-radius: 12px; background: #1a1a1a; color: #fff; font-size: 13px; font-weight: 700; }
#qs-dsheet .qs-dopts button.on { background: #fff; color: #000; }
#qs-dsheet .qs-dopts .qs-dcustom { grid-column: span 1; }
