/* MeteoAtlas: dark cartographic theme. The accent colour (--acc) follows the current temperature. */
:root {
  --fons: #060a12;
  --fons2: #0a101c;
  --sup: rgba(255, 255, 255, .045);
  --sup2: rgba(255, 255, 255, .08);
  --sup-solid: #0e1524;
  --vora: rgba(255, 255, 255, .09);
  --vora2: rgba(255, 255, 255, .16);
  --text: #e9eef7;
  --suau: #8d99ae;
  --molt-suau: #5b6679;
  --acc: #8fd3c8;
  --acc-text: #06110f;
  --graella: rgba(255, 255, 255, .07);
  --groc: #f4d03f;
  --taronja: #f08a24;
  --vermell: #e0393e;
  --bo: #4ade80;
  --pluja: #4ea8ff;
  --rosada: #7dd3fc;
  --hum: #38bdf8;
  --press: #c4b5fd;
  --vent: #a3e635;
  --ratxa: #fbbf24;
  --sol: #fbbf24;
  --radi: 22px;
  --radi-p: 14px;
  --ombra: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -30px rgba(0,0,0,.8);
  --display: 'Unbounded', 'Inter', system-ui, sans-serif;
  --cos: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-tema="clar"] {
  --fons: #eef1f6;
  --fons2: #e5e9f0;
  --sup: rgba(255, 255, 255, .78);
  --sup2: rgba(255, 255, 255, .95);
  --sup-solid: #ffffff;
  --vora: rgba(15, 25, 45, .09);
  --vora2: rgba(15, 25, 45, .18);
  --text: #0c1424;
  --suau: #566176;
  --molt-suau: #8a93a3;
  --graella: rgba(15, 25, 45, .08);
  --ombra: 0 1px 2px rgba(15,25,45,.05), 0 18px 40px -28px rgba(15,25,45,.35);
  --pluja: #1d74d8;
  --rosada: #0284c7;
  --hum: #0369a1;
  --press: #7c3aed;
  --vent: #4d7c0f;
  --ratxa: #c2410c;
  --sol: #d97706;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--fons); color: var(--text);
  font: 15px/1.5 var(--cos); font-feature-settings: 'cv11', 'ss01';
  display: grid; grid-template-columns: 232px 1fr;
  overflow-x: hidden;
}
svg { display: block; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h1 { font: 500 clamp(26px, 4vw, 40px)/1.1 var(--display); letter-spacing: -.02em; }
h2 { font: 500 15px/1.3 var(--display); letter-spacing: -.005em; }
p { margin: 0; }
.suau { color: var(--suau); }
.petit { font-size: 13px; }
.num-tab, .stats, .taula, .records { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Background: contour lines and an aura tinted by the temperature */
.topo { position: fixed; inset: 0; width: 100%; height: 100%; color: var(--text); opacity: .05; pointer-events: none; z-index: 0; }
.aura {
  position: fixed; inset: -20vh -10vw auto auto; width: 70vw; height: 70vh; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--acc) 30%, transparent), transparent);
  filter: blur(40px); opacity: .55; transition: background 2s;
}
:root[data-tema="clar"] .aura { opacity: .35; }

/* Navigation rail (desktop) / tab bar (mobile) */
.rail {
  position: sticky; top: 0; height: 100vh; z-index: 5; display: flex; flex-direction: column; gap: 28px;
  padding: 24px 16px; border-right: 1px solid var(--vora);
  background: color-mix(in oklab, var(--fons) 70%, transparent); backdrop-filter: blur(18px);
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px; }
.marca .logo { width: 34px; height: 34px; color: var(--text); }
.marca span { font: 400 18px/1 var(--display); letter-spacing: -.02em; }
.marca b { font-weight: 700; color: var(--acc); transition: color 2s; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; color: var(--suau); font-weight: 500; transition: background .2s, color .2s;
}
.nav a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { background: var(--sup); color: var(--text); }
.nav a.actiu { background: var(--sup2); color: var(--text); }
.nav a.actiu::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--acc); }
.pastilla { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--taronja); color: #1a0d00; font: 700 11px/20px var(--cos); text-align: center; font-style: normal; }
.rail-peu { margin-top: auto; display: flex; gap: 8px; }
.rail-peu .nav-mobil { display: none; }
.boto-icona {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--vora);
  background: var(--sup); cursor: pointer; color: var(--text); text-decoration: none;
}
.boto-icona:hover { background: var(--sup2); }
.boto-icona svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { position: relative; z-index: 1; padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1320px; width: 100%; min-width: 0; }
.vista { display: flex; flex-direction: column; gap: 18px; animation: entra .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }
.vista-cap { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 6px; }
.sobretitol { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 600; color: var(--acc); margin-bottom: 6px; transition: color 2s; }

.avis-demo, .avis-offline { padding: 10px 16px; border-radius: 12px; margin-bottom: 14px; font-size: 13px; font-weight: 500; border: 1px dashed var(--vora2); background: var(--sup); }
.avis-demo { border-color: color-mix(in oklab, var(--groc) 50%, transparent); color: var(--groc); }
:root[data-tema="clar"] .avis-demo { color: #8a6d00; }

/* Cards */
.targeta {
  position: relative; background: var(--sup); border: 1px solid var(--vora); border-radius: var(--radi);
  padding: 20px; box-shadow: var(--ombra); backdrop-filter: blur(14px); min-width: 0;
}
.targeta-cap { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.targeta-cap .suau { font-size: 13px; margin-top: 3px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.enllac { color: var(--acc); text-decoration: none; font-weight: 500; font-size: 13px; }

/* Hero */
.heroi {
  position: relative; overflow: hidden; border-radius: 28px; border: 1px solid var(--vora);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: clamp(20px, 3vw, 36px); min-height: 360px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--acc) 26%, transparent), transparent 60%),
    linear-gradient(160deg, var(--cel1, #0d1830), var(--cel2, #070b14));
  box-shadow: var(--ombra);
}
:root[data-tema="clar"] .heroi { background: radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--acc) 40%, transparent), transparent 60%), linear-gradient(160deg, var(--cel1c, #dce8f7), var(--cel2c, #f5f8fc)); }
#cel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.heroi-cos { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.heroi-cap { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.lloc { font: 500 17px/1.2 var(--display); }
.coord { font-size: 12px; color: var(--suau); letter-spacing: .06em; margin-top: 4px; }
.viu { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--sup); border: 1px solid var(--vora); font-size: 12px; color: var(--suau); white-space: nowrap; }
.viu i { width: 8px; height: 8px; border-radius: 50%; background: var(--molt-suau); }
.viu.ok i { background: var(--bo); box-shadow: 0 0 0 0 var(--bo); animation: batec 2s infinite; }
.viu.vell i { background: var(--taronja); }
@keyframes batec { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--bo) 70%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.heroi-temp { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); flex-wrap: wrap; margin-top: 6px; }
.temp-gran { display: flex; align-items: flex-start; font: 300 clamp(88px, 15vw, 168px)/.86 var(--display); letter-spacing: -.06em; }
.temp-gran .grau { font-size: .42em; margin-top: .12em; color: var(--acc); transition: color 2s; }
.temp-gran .num { background: linear-gradient(180deg, var(--text) 40%, color-mix(in oklab, var(--acc) 70%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.temp-costat { display: flex; flex-direction: column; gap: 12px; }
.sensacio { font-size: 15px; color: var(--suau); }
.sensacio b { color: var(--text); font-weight: 600; }
.minmax { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
.minmax-barra { position: relative; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--fred-c, #6a9bd8), var(--calor-c, #f08a3c)); opacity: .9; }
.minmax-barra i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--fons); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--acc); }
.minmax-text { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--suau); }
.minmax-text b { color: var(--text); font-weight: 600; }
.frase { font: 400 clamp(16px, 2vw, 20px)/1.4 var(--cos); max-width: 46ch; text-wrap: balance; }
.heroi-dades { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.dada-xip { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 12px; background: var(--sup); border: 1px solid var(--vora); font-size: 13px; color: var(--suau); }
.dada-xip b { color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.heroi-brujola { position: relative; align-self: center; width: clamp(220px, 24vw, 300px); }

/* Warnings banner */
.banda-avisos { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radi-p); text-decoration: none; border: 1px solid; }
.banda-avisos.groc { background: color-mix(in oklab, var(--groc) 14%, transparent); border-color: color-mix(in oklab, var(--groc) 45%, transparent); }
.banda-avisos.taronja { background: color-mix(in oklab, var(--taronja) 16%, transparent); border-color: color-mix(in oklab, var(--taronja) 50%, transparent); }
.banda-avisos.vermell { background: color-mix(in oklab, var(--vermell) 18%, transparent); border-color: color-mix(in oklab, var(--vermell) 55%, transparent); }
.banda-avisos .ico { width: 34px; height: 34px; flex: none; }
.banda-avisos b { display: block; }
.banda-avisos span { font-size: 13px; color: var(--suau); }
.banda-avisos .fletxa { margin-left: auto; font-size: 20px; color: var(--suau); }

/* Bento grid of current values */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.peca { grid-column: span 2; display: flex; flex-direction: column; gap: 10px; min-height: 172px; }
.peca.doble { grid-column: span 3; }
.peca .etiqueta { display: flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--suau); }
.peca .etiqueta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.valor { font: 400 34px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.valor small { font: 500 14px var(--cos); color: var(--suau); margin-left: 4px; letter-spacing: 0; }
.peca .detall { font-size: 13px; color: var(--suau); margin-top: auto; }
.peca .detall b { color: var(--text); font-weight: 600; }
.peca-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.anell { width: 76px; height: 76px; flex: none; }
.tub { width: 26px; height: 84px; flex: none; }
.uv-escala { position: relative; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #4ade80 0 18%, #facc15 18% 45%, #fb923c 45% 64%, #ef4444 64% 82%, #a855f7 82%); }
.uv-escala i { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 3px; background: var(--text); transform: translateX(-50%); box-shadow: 0 0 0 2px var(--fons); }
.sparkline { width: 100%; height: 44px; }
.arc-sol { width: 100%; height: 70px; }

/* Chips and segmented controls */
.xips { display: flex; gap: 6px; flex-wrap: wrap; }
.xip {
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--vora); background: transparent; color: var(--suau);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.xip:hover { color: var(--text); border-color: var(--vora2); }
.xip.actiu { background: var(--text); color: var(--fons); border-color: var(--text); }
.xip i { width: 8px; height: 8px; border-radius: 50%; }
.segmentat { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--sup); border: 1px solid var(--vora); gap: 2px; flex-wrap: wrap; }
.segmentat button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--suau); cursor: pointer; white-space: nowrap; }
.segmentat button:hover { color: var(--text); }
.segmentat button.actiu { background: var(--sup-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.segmentat.petit button { padding: 5px 9px; font-size: 12px; }
select, input[type="date"], input[type="number"], input[type="time"] {
  background: var(--sup-solid); border: 1px solid var(--vora2); border-radius: 10px; padding: 7px 10px; font-size: 14px; min-height: 36px;
}
select:focus-visible, input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.boto {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--acc); color: var(--acc-text); font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px; transition: filter .2s, background 2s;
}
.boto:hover { filter: brightness(1.08); }
.boto.secundari { background: var(--sup); color: var(--text); border-color: var(--vora2); }
.boto.text { background: transparent; color: var(--suau); }
.boto svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.botons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Charts */
.grafic { position: relative; height: 260px; width: 100%; touch-action: pan-y; }
.grafic.alt { height: 340px; }
.grafic svg { width: 100%; height: 100%; overflow: visible; }
.grafic .eix text { fill: var(--suau); font-size: 11px; font-family: var(--cos); }
.grafic .eix line, .grafic .graella line { stroke: var(--graella); }
.grafic .creu { stroke: var(--vora2); stroke-dasharray: 3 3; }
.grafic .buit { fill: var(--suau); font-size: 13px; }
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; padding: 10px 12px; border-radius: 12px; min-width: 150px;
  background: color-mix(in oklab, var(--sup-solid) 92%, transparent); border: 1px solid var(--vora2); backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); font-size: 13px; font-variant-numeric: tabular-nums;
}
.tooltip .tt-cap { font-weight: 600; margin-bottom: 6px; color: var(--suau); font-size: 12px; }
.tooltip .tt-fila { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-fila span { display: inline-flex; align-items: center; gap: 6px; color: var(--suau); }
.tooltip .tt-fila i { width: 8px; height: 8px; border-radius: 2px; }
.tooltip .tt-fila b { font-weight: 600; }

/* History */
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.desplaca { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; }
.dates-pers { display: flex; gap: 8px; align-items: center; }
#xipsHist { margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; margin-top: 16px; }
.stat { padding: 12px 14px; border-radius: var(--radi-p); background: var(--sup); border: 1px solid var(--vora); }
.stat p { font-size: 12px; color: var(--suau); }
.stat b { display: block; font: 400 22px/1.2 var(--display); letter-spacing: -.02em; margin-top: 4px; }
.stat b small { font: 500 12px var(--cos); color: var(--suau); margin-left: 2px; }
.stat span { font-size: 12px; color: var(--molt-suau); }
.graella-clima { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.graella-clima .ample { grid-column: 1 / -1; }
.controls-petits { display: flex; gap: 8px; flex-wrap: wrap; }
.calendari { overflow-x: auto; padding-bottom: 4px; }
.calendari svg rect.dia { cursor: pointer; transition: stroke .15s; }
.calendari svg rect.dia:hover { stroke: var(--text); stroke-width: 1.5; }
.calendari text { fill: var(--suau); font-size: 10px; font-family: var(--cos); }
.escala { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--suau); margin-top: 10px; }
.escala .degradat { height: 8px; flex: 0 1 260px; border-radius: 8px; }
.ratlles { height: 150px; border-radius: var(--radi-p); overflow: hidden; }
.ratlles svg { width: 100%; height: 100%; }
.ratlles text { font-size: 11px; font-family: var(--cos); }
.tendencia { text-align: right; }
.tendencia b { font: 400 26px/1 var(--display); letter-spacing: -.02em; display: block; }
.tendencia span { font-size: 12px; color: var(--suau); }
.rosa { display: grid; place-items: center; }
.rosa svg { width: min(100%, 330px); height: auto; }
.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.record { text-align: left; padding: 14px; border-radius: var(--radi-p); background: var(--sup); border: 1px solid var(--vora); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.record:hover { border-color: var(--vora2); background: var(--sup2); }
.record p { font-size: 12px; color: var(--suau); }
.record b { font: 400 24px/1.1 var(--display); letter-spacing: -.02em; }
.record b small { font: 500 12px var(--cos); color: var(--suau); }
.record span { font-size: 12px; color: var(--suau); }
.taula-scroll { overflow-x: auto; }
.taula { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.taula th { text-align: right; font-weight: 600; color: var(--suau); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px; border-bottom: 1px solid var(--vora); }
.taula td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--vora); }
.taula th:first-child, .taula td:first-child { text-align: left; }
.taula tbody tr { cursor: pointer; }
.taula tbody tr:hover td { background: var(--sup); }
.taula .barra-cel { position: relative; }
.taula .barra-cel i { position: absolute; left: 0; top: 50%; height: 3px; transform: translateY(8px); border-radius: 3px; opacity: .7; }

/* Search */
.frase-cerca { font: 400 clamp(17px, 2.2vw, 22px)/2.1 var(--cos); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.frase-cerca select, .frase-cerca input { font-size: inherit; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--vora2); background: var(--sup-solid); min-height: 44px; }
.frase-cerca input { width: 110px; }
.filtres-cerca { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; font-size: 13px; color: var(--suau); }
.filtres-cerca label, .anar-dia label { display: inline-flex; align-items: center; gap: 8px; }
.anar-dia { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--vora); font-size: 13px; color: var(--suau); }
.resultats { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.resultats .resultat-xifra { position: sticky; top: 20px; }
.resultats .taula-scroll { max-height: 70vh; overflow-y: auto; }
.resultats .taula thead th { position: sticky; top: 0; background: var(--sup-solid); z-index: 1; }
.resultat-xifra { display: flex; flex-direction: column; gap: 6px; }
.resultat-xifra .gran { font: 300 72px/1 var(--display); letter-spacing: -.05em; color: var(--acc); }
.per-any { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.per-any div { display: grid; grid-template-columns: 42px 1fr 36px; align-items: center; gap: 8px; font-size: 13px; }
.per-any i { height: 10px; border-radius: 4px; background: var(--acc); min-width: 2px; }
.per-any span:last-child { text-align: right; font-weight: 600; }

/* Forecast */
.dies-previsio { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(108px, 1fr); gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
.dia-prev {
  scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px; border-radius: var(--radi);
  background: var(--sup); border: 1px solid var(--vora); cursor: pointer; text-align: center; transition: border-color .2s, transform .2s;
}
.dia-prev:hover { transform: translateY(-2px); border-color: var(--vora2); }
.dia-prev.actiu { border-color: var(--acc); background: color-mix(in oklab, var(--acc) 10%, var(--sup)); }
.dia-prev .nom { font-weight: 600; font-size: 13px; }
.dia-prev .data { font-size: 11px; color: var(--suau); margin-top: -6px; }
.dia-prev svg.ico { width: 46px; height: 46px; }
.dia-prev .rang { display: flex; gap: 8px; font-variant-numeric: tabular-nums; }
.dia-prev .rang b { font-weight: 600; }
.dia-prev .rang span { color: var(--suau); }
.dia-prev .barra-rang { width: 70%; height: 56px; position: relative; }
.dia-prev .barra-rang i { position: absolute; left: 50%; width: 8px; border-radius: 6px; transform: translateX(-50%); }
.dia-prev .prob { font-size: 12px; color: var(--pluja); font-weight: 600; min-height: 18px; }
.fila-vents { display: flex; justify-content: space-between; margin: 6px 0 0 44px; margin-right: 44px; }
.fila-vents span { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--suau); gap: 2px; }
.fila-vents svg { width: 16px; height: 16px; }
.tira-hores { display: grid; grid-auto-flow: column; grid-auto-columns: 62px; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.hora { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; font-size: 12px; color: var(--suau); }
.hora:first-child { background: var(--sup2); color: var(--text); }
.hora svg { width: 30px; height: 30px; }
.hora b { font-size: 15px; color: var(--text); font-weight: 600; }
.hora .p { color: var(--pluja); font-weight: 600; min-height: 16px; }
.contrast-graella { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }

/* Warnings map */
.mapa-envoltori { position: relative; border-radius: 28px; overflow: hidden; border: 1px solid var(--vora); box-shadow: var(--ombra); }
.mapa { height: min(68vh, 620px); min-height: 380px; background: var(--fons2); }
.mapa-controls { position: absolute; top: 14px; left: 14px; right: 14px; z-index: 500; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.mapa-controls > * { pointer-events: auto; backdrop-filter: blur(14px); background: color-mix(in oklab, var(--sup-solid) 80%, transparent); }
.llegenda { position: absolute; bottom: 14px; left: 14px; z-index: 500; display: flex; gap: 12px; padding: 8px 12px; border-radius: 12px; font-size: 12px; background: color-mix(in oklab, var(--sup-solid) 85%, transparent); border: 1px solid var(--vora); backdrop-filter: blur(12px); flex-wrap: wrap; }
.llegenda span { display: inline-flex; align-items: center; gap: 6px; }
.llegenda i { width: 12px; height: 12px; border-radius: 3px; }
.llegenda .n0 { background: color-mix(in oklab, var(--text) 12%, transparent); border: 1px solid var(--vora2); }
.groc { background: var(--groc); } .taronja { background: var(--taronja); } .vermell { background: var(--vermell); }
.leaflet-container { background: var(--fons2) !important; font-family: var(--cos) !important; }
.leaflet-tooltip.comarca-tt { background: var(--sup-solid); color: var(--text); border: 1px solid var(--vora2); border-radius: 10px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); padding: 8px 10px; font-size: 12px; }
.leaflet-tooltip.comarca-tt::before { display: none; }
.leaflet-control-attribution { background: color-mix(in oklab, var(--sup-solid) 70%, transparent) !important; color: var(--suau) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--suau) !important; }
.leaflet-bar a { background: var(--sup-solid) !important; color: var(--text) !important; border-color: var(--vora) !important; }
.marcador-estacio { width: 18px; height: 18px; border-radius: 50%; background: var(--acc); border: 3px solid var(--fons); box-shadow: 0 0 0 2px var(--acc), 0 0 22px var(--acc); }
.llista-avisos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.avis { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-left: 4px solid; }
.avis.groc, .avis.taronja, .avis.vermell { background: var(--sup); }
.avis.groc { border-left-color: var(--groc); } .avis.taronja { border-left-color: var(--taronja); } .avis.vermell { border-left-color: var(--vermell); }
.avis-cap { display: flex; align-items: center; gap: 10px; }
.avis-cap .ico { width: 28px; height: 28px; flex: none; }
.nivell { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #1a1000; margin-left: auto; }
.avis .comarques { display: flex; flex-wrap: wrap; gap: 4px; }
.avis .comarques span { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--sup2); }
.avis .franja { font-size: 12px; color: var(--suau); }
.cap-avis { grid-column: 1 / -1; text-align: center; padding: 40px 20px; }
.cap-avis svg { width: 54px; height: 54px; margin: 0 auto 12px; color: var(--bo); }

/* Notifications and install */
.prefs { display: flex; flex-direction: column; gap: 14px; }
.prefs fieldset { border: 1px solid var(--vora); border-radius: var(--radi-p); padding: 14px 16px; margin: 0; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.prefs legend { padding: 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--suau); }
.prefs label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.prefs input[type="number"] { width: 72px; }
.prefs.inactiu { opacity: .5; pointer-events: none; }
.interruptor input { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor span { width: 40px; height: 24px; border-radius: 24px; background: var(--sup2); border: 1px solid var(--vora2); position: relative; transition: background .2s; flex: none; }
.interruptor span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--suau); transition: transform .2s, background .2s; }
.interruptor input:checked + span { background: var(--acc); }
.interruptor input:checked + span::after { transform: translateX(16px); background: var(--acc-text); }
.interruptor input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }
.nota { font-size: 13px; color: var(--suau); margin-top: 10px; }
.instal h2, .targeta > h2 { margin-bottom: 8px; }

/* Day modal */
.modal { width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 1px solid var(--vora2); border-radius: 24px; padding: 24px; background: var(--sup-solid); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
.modal::backdrop { background: rgba(3, 6, 12, .65); backdrop-filter: blur(6px); }
.modal .tanca { position: absolute; top: 16px; right: 16px; }
.modal h2 { font-size: 22px; margin-bottom: 4px; padding-right: 48px; }
.modal .stats { margin: 16px 0; }
.modal-nav { display: flex; gap: 8px; margin-top: 12px; }

/* Mobile */
@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(4, 1fr); }
  .peca, .peca.doble { grid-column: span 2; }
}
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .rail { display: contents; }
  .marca { position: fixed; z-index: 6; top: 0; left: 0; right: 0; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: color-mix(in oklab, var(--fons) 82%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--vora); }
  .rail-peu { position: fixed; z-index: 7; top: calc(8px + env(safe-area-inset-top)); right: 12px; margin: 0; }
  .nav { position: fixed; z-index: 6; bottom: 0; left: 0; right: 0; flex-direction: row; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--vora); background: color-mix(in oklab, var(--fons) 82%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .rail-peu .nav-mobil { display: inline-grid; }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 11px; flex: 1; text-align: center; border-radius: 10px; }
  .nav a.actiu::before { left: 30%; right: 30%; top: -7px; bottom: auto; width: auto; height: 3px; }
  .nav .nav-secundari { display: none; }
  .pastilla { position: absolute; top: 0; right: calc(50% - 22px); margin: 0; min-width: 17px; height: 17px; line-height: 17px; font-size: 10px; }
  main { padding: calc(74px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
  .heroi { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; }
  .heroi-brujola { width: min(260px, 72vw); justify-self: center; }
  .duo, .graella-clima, .resultats { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr 1fr; gap: 10px; }
  .peca, .peca.doble { grid-column: span 1; min-height: 150px; padding: 16px; }
  .peca.mobil-ample { grid-column: 1 / -1; }
  .valor { font-size: 28px; }
  .peca-fila { flex-wrap: wrap; }
  .lloc { font-size: 15px; }
  .targeta-cap .xips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .grafic { height: 220px; } .grafic.alt { height: 280px; }
  .targeta { padding: 16px; }
  .minmax { min-width: 180px; }
  .mapa { height: 62vh; }
  .modal { padding: 18px; border-radius: 20px; }
}
@media (max-width: 420px) {
  .temp-gran { font-size: 92px; }
  .anell { width: 62px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
input[type="checkbox"] { accent-color: var(--acc); width: 16px; height: 16px; }
