/**
 * METEO SANTA SUSANNA
 * Fitxer: public/assets/css/historic.css
 * Versió: 1.6.1
 */
.historic-page{max-width:1200px;margin:0 auto;padding:16px}
.historic-heading{border-radius:0}
.historic-panel{background:var(--panel,#fff);border:1px solid var(--line,#d5e1e7);border-radius:18px;padding:18px;box-shadow:0 8px 24px rgba(22,46,72,.06)}
.historic-tabs{display:flex;gap:8px;flex-wrap:wrap;padding-bottom:16px;border-bottom:1px solid var(--line,#d5e1e7)}
.historic-tab{appearance:none;border:1px solid var(--line,#d5e1e7);background:var(--panel,#fff);color:var(--text,#173246);padding:10px 15px;border-radius:9px;font:inherit;font-weight:700;cursor:pointer}
.historic-tab.is-active{background:var(--nav,#16354b);border-color:var(--nav,#16354b);color:#fff}
.historic-tab:disabled{cursor:default;opacity:.48}
.historic-controls{display:flex;gap:14px;align-items:end;flex-wrap:wrap;padding:16px 0}
.historic-control{display:grid;gap:6px;min-width:190px;color:var(--muted,#687c8a);font-size:.85rem;font-weight:700}
.historic-control input,.historic-control select{width:100%;min-height:42px;border:1px solid var(--line,#d5e1e7);border-radius:8px;background:var(--panel,#fff);color:var(--text,#173246);padding:8px 11px;font:inherit;font-size:1rem}
.historic-status{min-height:24px;margin-bottom:8px;color:var(--muted,#687c8a);font-size:.92rem}
.historic-status.is-error{color:#b34242}
.historic-table-wrap{width:100%;overflow-x:auto;border:1px solid var(--line,#d5e1e7);border-radius:10px}
.historic-table{width:100%;min-width:1020px;border-collapse:collapse;font-variant-numeric:tabular-nums}
.historic-table th{position:sticky;top:0;background:var(--nav,#16354b);color:#fff;padding:11px 10px;text-align:center;font-size:.86rem;white-space:nowrap}
.historic-table th:first-child,.historic-table td:first-child{text-align:left;font-weight:700}
.historic-table td{padding:10px;border-bottom:1px solid var(--line,#d5e1e7);text-align:center;white-space:nowrap;background:var(--panel,#fff)}
.historic-table tbody tr:last-child td{border-bottom:0}
.historic-table tbody tr:nth-child(even) td:not(.temperature-cell){background:color-mix(in srgb,var(--panel,#fff) 94%,var(--line,#d5e1e7))}
.historic-table .temperature-cell{font-weight:800;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.28)}
.historic-table .empty-row td{padding:24px;color:var(--muted,#687c8a);font-weight:400;text-align:center;background:var(--panel,#fff)}
html[data-theme="dark"] .historic-panel{box-shadow:none}
html[data-theme="dark"] .historic-tab:not(.is-active),html[data-theme="dark"] .historic-control input,html[data-theme="dark"] .historic-control select{background:#172533;border-color:#304454;color:#e6f0f6}
html[data-theme="dark"] .historic-table td{background:#172533;border-color:#304454}
html[data-theme="dark"] .historic-table tbody tr:nth-child(even) td:not(.temperature-cell){background:#1d2d3a}
@media(max-width:650px){.historic-page{padding:14px}.historic-panel{padding:14px;border-radius:16px}.historic-tabs{display:grid;grid-template-columns:1fr}.historic-tab{width:100%}.historic-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px}.historic-control{min-width:0}.historic-table th,.historic-table td{padding:9px 8px;font-size:.86rem}}
@media(max-width:430px){.historic-controls{grid-template-columns:1fr}}

/* v1.6.0b: sortierbare Spalten + PDF-Export */
.historic-controls-row{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
.historic-controls-row .historic-controls{flex:1}
.historic-pdf-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:48px;margin-bottom:16px;padding:9px 16px;border:1px solid var(--line,#d5e1e7);border-radius:10px;background:var(--panel,#fff);color:var(--text,#173246);text-decoration:none;font-size:1rem;font-weight:800;white-space:nowrap;transition:background .15s ease,border-color .15s ease,transform .15s ease}
.historic-pdf-button:hover{background:color-mix(in srgb,var(--panel,#fff) 94%,#d71920);border-color:#d71920;transform:translateY(-1px)}
.historic-pdf-button .historic-pdf-icon{width:24px;height:24px;flex:0 0 24px;color:#d71920;fill:none}
.historic-pdf-button span{color:inherit}
.historic-sort-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;border:0;background:transparent;color:inherit;padding:0;font:inherit;font-weight:inherit;cursor:pointer;white-space:nowrap}
.historic-sort-button:focus-visible{outline:2px solid #fff;outline-offset:3px;border-radius:3px}
.historic-sort-icon{display:inline-block;min-width:10px;font-size:.64rem;line-height:1;opacity:.65}
.historic-sort-button.is-active .historic-sort-icon{opacity:1}
html[data-theme="dark"] .historic-pdf-button{background:#172533;border-color:#304454;color:#e6f0f6}
@media(max-width:650px){.historic-controls-row{align-items:stretch}.historic-pdf-button{align-self:flex-end}.historic-sort-button{gap:4px}}
@media(max-width:430px){.historic-controls-row{display:grid;grid-template-columns:1fr auto}.historic-controls-row .historic-controls{grid-column:1/-1}.historic-pdf-button{grid-column:2;margin-top:-8px}}


/* v1.6.0h: optimització específica per a tauleta i mòbil */
@media(max-width:900px){
    .historic-tabs{flex-wrap:nowrap;gap:6px}
    .historic-tab{flex:0 0 auto;width:auto;padding:8px 10px;font-size:.82rem}
    .historic-controls{display:grid;grid-template-columns:160px 145px;gap:10px;align-items:end}
    .historic-control{min-width:0;width:auto}
    .historic-control input,.historic-control select{min-height:40px;padding:7px 9px;font-size:.94rem}
    .historic-table{width:820px;min-width:820px;table-layout:fixed}
    .historic-table th{padding:8px 4px;font-size:.74rem}
    .historic-table td{padding:8px 4px;font-size:.84rem;overflow:hidden;text-overflow:clip}
    .historic-table th:nth-child(1),.historic-table td:nth-child(1){width:58px}
    .historic-table th:nth-child(2),.historic-table td:nth-child(2){width:82px}
    .historic-table th:nth-child(3),.historic-table td:nth-child(3){width:66px}
    .historic-table th:nth-child(4),.historic-table td:nth-child(4){width:84px}
    .historic-table th:nth-child(5),.historic-table td:nth-child(5){width:105px}
    .historic-table th:nth-child(6),.historic-table td:nth-child(6){width:84px}
    .historic-table th:nth-child(7),.historic-table td:nth-child(7){width:67px}
    .historic-table th:nth-child(8),.historic-table td:nth-child(8){width:86px}
    .historic-table th:nth-child(9),.historic-table td:nth-child(9){width:44px}
    .historic-table th:nth-child(10),.historic-table td:nth-child(10){width:88px}
    .historic-sort-button{gap:2px}
    .historic-sort-icon{min-width:7px;font-size:.55rem}
}
@media(max-width:650px){
    .historic-page{padding:14px}
    .historic-panel{padding:14px;border-radius:16px}
    .historic-tabs{display:flex;grid-template-columns:none;flex-wrap:nowrap;gap:5px;padding-bottom:13px}
    .historic-tab{width:auto;min-width:0;flex:0 0 auto;padding:7px 8px;font-size:.76rem;line-height:1.15}
    .historic-controls{display:grid;grid-template-columns:145px 130px;gap:8px}
    .historic-table{width:760px;min-width:760px}
    .historic-table th{padding:7px 3px;font-size:.69rem}
    .historic-table td{padding:7px 3px;font-size:.80rem}
    .historic-table th:nth-child(1),.historic-table td:nth-child(1){width:54px}
    .historic-table th:nth-child(2),.historic-table td:nth-child(2){width:78px}
}
@media(max-width:430px){
    .historic-controls{grid-template-columns:132px 112px;gap:7px}
    .historic-control input,.historic-control select{font-size:.88rem;padding:6px 7px}
    .historic-tab{padding:7px 6px;font-size:.70rem}
    .historic-table{width:735px;min-width:735px}
    .historic-table th{font-size:.66rem}
    .historic-table td{font-size:.78rem}
}


/* v1.6.0i: 9 columnes visibles; camp de data més compacte a tauleta/mòbil */
@media(max-width:900px){
    .historic-controls{grid-template-columns:132px 145px}
    .historic-table{width:732px;min-width:732px}
    .historic-table th:nth-child(1),.historic-table td:nth-child(1){width:56px}
    .historic-table th:nth-child(2),.historic-table td:nth-child(2){width:78px}
    .historic-table th:nth-child(3),.historic-table td:nth-child(3){width:62px}
    .historic-table th:nth-child(4),.historic-table td:nth-child(4){width:78px}
    .historic-table th:nth-child(5),.historic-table td:nth-child(5){width:102px}
    .historic-table th:nth-child(6),.historic-table td:nth-child(6){width:80px}
    .historic-table th:nth-child(7),.historic-table td:nth-child(7){width:63px}
    .historic-table th:nth-child(8),.historic-table td:nth-child(8){width:82px}
    .historic-table th:nth-child(9),.historic-table td:nth-child(9){width:42px}
}
@media(max-width:650px){
    .historic-controls{grid-template-columns:124px 130px}
    .historic-table{width:700px;min-width:700px}
}
@media(max-width:430px){
    .historic-controls{grid-template-columns:116px 112px}
    .historic-table{width:680px;min-width:680px}
}


/* v1.6.0j: correcció del solapament Data / Resolució a tauleta i mòbil */
@media(max-width:900px){
    .historic-controls-row{gap:10px}
    .historic-controls-row .historic-controls{flex:0 1 auto}
    .historic-controls{grid-template-columns:108px 132px;gap:8px}
    .historic-control{min-width:0;max-width:100%;overflow:visible}
    .historic-control input,.historic-control select{
        min-width:0;
        max-width:100%;
        width:100%;
        box-sizing:border-box;
    }
    .historic-control input[type="date"]{
        inline-size:100%;
        min-inline-size:0;
        max-inline-size:100%;
        padding-left:6px;
        padding-right:4px;
    }
    .historic-pdf-button{flex:0 0 auto}
}
@media(max-width:650px){
    .historic-controls-row{gap:8px}
    .historic-controls{grid-template-columns:102px 124px;gap:7px}
    .historic-control input[type="date"]{padding-left:5px;padding-right:3px}
}
@media(max-width:430px){
    .historic-controls-row{
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        align-items:end;
        column-gap:8px;
    }
    .historic-controls-row .historic-controls{
        grid-column:1;
        display:grid;
        grid-template-columns:96px 116px;
        gap:6px;
        min-width:0;
        padding-bottom:16px;
    }
    .historic-pdf-button{
        grid-column:2;
        align-self:end;
        margin:0 0 16px 0;
    }
    .historic-control input,.historic-control select{font-size:.84rem;padding-top:6px;padding-bottom:6px}
    .historic-control input[type="date"]{padding-left:4px;padding-right:2px}
}

/* v1.6.0k: més separació entre Data i Resolució a tauleta/mòbil */
@media(max-width:900px){
    .historic-controls{column-gap:20px}
}
@media(max-width:650px){
    .historic-controls{column-gap:16px}
}
@media(max-width:430px){
    .historic-controls-row .historic-controls{column-gap:12px}
}


/* v1.6.0l: selector de la cinquena columna exclusiu per a mòbil */
.historic-mobile-metric-control{display:none}
@media(max-width:650px){
    .historic-table-wrap{overflow-x:hidden}
    .historic-table{width:100%;min-width:0;table-layout:fixed}
    .historic-table th:nth-child(n+6),.historic-table td:nth-child(n+6){display:none}
    .historic-table th:nth-child(1),.historic-table td:nth-child(1){width:15%}
    .historic-table th:nth-child(2),.historic-table td:nth-child(2){width:23%}
    .historic-table th:nth-child(3),.historic-table td:nth-child(3){width:19%}
    .historic-table th:nth-child(4),.historic-table td:nth-child(4){width:23%}
    .historic-table th:nth-child(5),.historic-table td:nth-child(5){width:20%}
    .historic-desktop-wind-sort{display:none}
    .historic-mobile-metric-control{display:flex;align-items:center;justify-content:center;gap:2px;width:100%}
    .historic-mobile-metric-control select{
        appearance:auto;
        min-width:0;
        width:calc(100% - 19px);
        border:0;
        background:transparent;
        color:#fff;
        padding:0 1px;
        font:inherit;
        font-weight:inherit;
        text-align:center;
        cursor:pointer;
    }
    .historic-mobile-metric-control select option{color:#173246;background:#fff}
    .historic-mobile-metric-sort{
        flex:0 0 17px;
        width:17px;
        min-width:17px;
        border:0;
        background:transparent;
        color:#fff;
        padding:0;
        font:inherit;
        font-size:.62rem;
        line-height:1;
        cursor:pointer;
        opacity:.72;
    }
    .historic-mobile-metric-sort.is-active{opacity:1}
    .historic-table td{overflow:hidden;text-overflow:clip}
    .historic-table td:nth-child(5){font-size:.74rem}
}
@media(max-width:430px){
    .historic-table{width:100%;min-width:0}
    .historic-table th{font-size:.64rem}
    .historic-table td{font-size:.77rem}
    .historic-table td:nth-child(5){font-size:.70rem}
}


/* v1.6.1: UV / hores de sol seleccionables a escriptori i tauleta */
.historic-uv-metric-control{display:flex;align-items:center;justify-content:center;gap:2px;width:100%}
.historic-uv-metric-control select{appearance:auto;min-width:0;width:calc(100% - 19px);border:0;background:transparent;color:#fff;padding:0 1px;font:inherit;font-weight:inherit;text-align:center;cursor:pointer}
.historic-uv-metric-control select option{color:#173246;background:#fff}
.historic-uv-metric-sort{flex:0 0 17px;width:17px;min-width:17px;border:0;background:transparent;color:#fff;padding:0;font:inherit;font-size:.62rem;line-height:1;cursor:pointer;opacity:.72}
.historic-uv-metric-sort.is-active{opacity:1}
@media(max-width:650px){.historic-uv-metric-control{display:none}}

/* v1.6.2c: Valors mensuals – capçalera doble refinada */
.historic-view[hidden]{display:none!important}
.historic-month-controls{padding-bottom:16px}
.historic-month-controls .historic-control{min-width:210px}
.historic-month-table{min-width:980px;table-layout:fixed}
.historic-month-table th,.historic-month-table td{padding:9px 6px}
/* Doble capçalera: grups a dalt, Mín./Màx./Ø sempre visibles a sota */
.historic-month-table thead tr{display:table-row}
.historic-month-table thead tr:nth-child(2) th{display:table-cell!important;top:39px}
.historic-month-table thead tr:first-child th{border-bottom:0!important;box-shadow:none!important}
.historic-month-table thead tr:nth-child(2) th{border-top:0!important;box-shadow:none!important}
/* Mateixa aparença tipogràfica que la taula diària, sense negreta extra */
.historic-month-table th,.historic-month-table .historic-sort-button,.historic-month-variable select{font-weight:inherit}
.historic-month-table th:nth-child(1){width:38px;padding-left:4px;padding-right:4px}
.historic-month-table td:nth-child(1){width:38px;padding-left:5px;padding-right:5px;text-align:center}
.historic-month-table th:nth-child(2),.historic-month-table th:nth-child(3),.historic-month-table th:nth-child(4){width:86px}
.historic-month-table th:nth-child(5),.historic-month-table th:nth-child(6){width:72px}
.historic-month-table th:nth-child(7),.historic-month-table th:nth-child(8){width:92px}
.historic-month-table th:nth-child(9){width:90px}
.historic-month-table th:nth-child(10){width:100px}
.historic-month-variable select{border:0;background:transparent;color:#fff;font:inherit;max-width:95px}
.historic-month-variable select option{color:#173246;background:#fff}
@media(max-width:900px){
    .historic-month-table{min-width:900px;width:900px}
    .historic-month-table th{font-size:.70rem}
    .historic-month-table td{font-size:.80rem}
    .historic-month-controls{grid-template-columns:180px}
}
@media(max-width:650px){
    .historic-month-controls-row{display:flex}
    .historic-month-controls{display:block}
    .historic-month-controls .historic-control{min-width:165px}
    .historic-month-table-wrap{overflow-x:auto}
    .historic-month-table{min-width:860px;width:860px}
    .historic-month-table th:nth-child(n),.historic-month-table td:nth-child(n){display:table-cell}
    .historic-month-table th{font-size:.66rem}
    .historic-month-table td{font-size:.76rem}
}

/* v1.6.2c: capçalera mensual com un únic bloc, sense línia horitzontal entre nivells */
.historic-month-table thead tr:first-child th:not([rowspan]){border-bottom-color:var(--nav,#16354b)!important}
.historic-month-table thead tr:nth-child(2) th{border-top-color:var(--nav,#16354b)!important}
.historic-month-table thead tr:first-child th,.historic-month-table thead tr:nth-child(2) th{outline:0!important}


/* v1.6.2d: capçalera mensual alineada amb Valors diaris */
.historic-month-table thead th{position:static!important;top:auto!important;border:0!important;box-shadow:none!important;outline:0!important;background:var(--nav,#16354b)!important;color:#fff;font-size:.86rem;font-weight:bold}
.historic-month-table thead tr:first-child th,.historic-month-table thead tr:nth-child(2) th{border-top:0!important;border-bottom:0!important}
.historic-month-table .historic-sort-button{font:inherit;font-weight:inherit}
.historic-month-metric-control{display:flex;align-items:center;justify-content:center;gap:2px;width:100%}
.historic-month-metric-control select{appearance:auto;min-width:0;width:calc(100% - 19px);border:0;background:transparent;color:#fff;padding:0 1px;font:inherit;font-weight:inherit;text-align:center;cursor:pointer}
.historic-month-metric-control select option{color:#173246;background:#fff}
.historic-month-metric-sort{flex:0 0 17px;width:17px;min-width:17px;border:0;background:transparent;color:#fff;padding:0;font:inherit;font-size:.62rem;line-height:1;cursor:pointer;opacity:.72}
.historic-month-metric-sort.is-active{opacity:1}
@media(max-width:900px){.historic-month-table thead th{font-size:.70rem}}
@media(max-width:650px){.historic-month-table thead th{font-size:.66rem}}


/* v1.6.2e: Vent amb subcapçalera Màx. i Dia més estret al mòbil */
@media(max-width:650px){
  .historic-month-table th:nth-child(1),
  .historic-month-table td:nth-child(1){width:34px!important;max-width:34px!important;padding-left:2px!important;padding-right:2px!important}
  .historic-month-table thead th:nth-child(1){font-size:.61rem!important;white-space:normal;overflow-wrap:anywhere}
}


/* v1.6.2f: Solar/UV amb subcapçalera Màx.; més espai útil al mòbil */
.historic-month-table #historicMonthMetricQualifier{font:inherit;font-weight:inherit;text-align:center}
@media(max-width:650px){
  .historic-month-table{min-width:790px;width:790px}
  .historic-month-table tbody td:nth-child(1){width:24px!important;max-width:24px!important;padding-left:1px!important;padding-right:1px!important}
  .historic-month-table thead tr:first-child th:first-child{width:24px!important;max-width:24px!important;padding-left:1px!important;padding-right:1px!important;font-size:.56rem!important}
  .historic-month-table tbody td:nth-child(5),
  .historic-month-table tbody td:nth-child(6){width:48px!important;max-width:48px!important;padding-left:2px!important;padding-right:2px!important}
  .historic-month-table thead tr:nth-child(2) th:nth-child(4),
  .historic-month-table thead tr:nth-child(2) th:nth-child(5){width:48px!important;max-width:48px!important;padding-left:2px!important;padding-right:2px!important}
}


/* v1.6.2h: taula mensual mòbil separada; desktop i tablet queden exactament com v1.6.2f */
.historic-month-mobile-table-wrap{display:none}
@media(max-width:650px){
  .historic-month-table-wrap{display:none!important}
  .historic-month-mobile-table-wrap{display:block!important;overflow-x:hidden!important}
  .historic-month-mobile-table{width:100%!important;min-width:0!important;table-layout:fixed!important}
  .historic-month-mobile-table th:nth-child(n),.historic-month-mobile-table td:nth-child(n){display:table-cell!important}
  .historic-month-mobile-table thead th{position:static!important;top:auto!important;border:0!important;box-shadow:none!important;outline:0!important;background:var(--nav,#16354b)!important;color:#fff;font-size:.62rem!important;font-weight:bold!important;padding:6px 1px!important;white-space:normal!important;line-height:1.05!important}
  .historic-month-mobile-table thead tr:first-child th,.historic-month-mobile-table thead tr:nth-child(2) th{border-top:0!important;border-bottom:0!important}
  .historic-month-mobile-table .historic-sort-button{gap:1px!important;font:inherit!important;font-weight:inherit!important;white-space:normal!important}
  .historic-month-mobile-table .historic-sort-icon{min-width:6px!important;font-size:.50rem!important}
  .historic-month-mobile-table td{padding:8px 1px!important;font-size:.69rem!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:clip!important;text-align:center!important}
  .historic-month-mobile-table td.temperature-cell{font-size:.66rem!important}
  .historic-month-mobile-table th:nth-child(1),.historic-month-mobile-table td:nth-child(1){width:10%!important;max-width:10%!important;padding-left:1px!important;padding-right:1px!important}
  .historic-month-mobile-table thead tr:first-child th:nth-child(2){width:42%!important}
  .historic-month-mobile-table thead tr:first-child th:nth-child(3){width:22%!important}
  .historic-month-mobile-table thead tr:first-child th:nth-child(4){width:26%!important}
  .historic-month-mobile-table tbody td:nth-child(2),.historic-month-mobile-table tbody td:nth-child(3),.historic-month-mobile-table tbody td:nth-child(4){width:14%!important}
  .historic-month-mobile-table tbody td:nth-child(5),.historic-month-mobile-table tbody td:nth-child(6){width:11%!important;padding-left:0!important;padding-right:0!important}
  .historic-month-mobile-table tbody td:nth-child(7){width:26%!important;font-size:.64rem!important}
  .historic-month-mobile-variable{width:26%!important;max-width:26%!important;padding-left:1px!important;padding-right:1px!important;vertical-align:middle!important}
  .historic-month-mobile-variable .historic-month-metric-control{gap:1px!important}
  .historic-month-mobile-variable select{width:calc(100% - 15px)!important;max-width:none!important;font-size:.56rem!important;padding:0!important;text-align:center!important}
  .historic-month-mobile-variable .historic-month-metric-sort{flex:0 0 14px!important;width:14px!important;min-width:14px!important;font-size:.54rem!important}
}
@media(max-width:390px){
  .historic-month-mobile-table thead th{font-size:.58rem!important}
  .historic-month-mobile-table td{font-size:.65rem!important}
  .historic-month-mobile-table td.temperature-cell{font-size:.62rem!important}
  .historic-month-mobile-table tbody td:nth-child(7){font-size:.60rem!important}
}

/* v1.6.2i: Monatsansicht Handy – feste kompakte Kernspalten + separate variable Messgröße */
.historic-month-mobile-picker{display:none}
@media(max-width:650px){
  .historic-month-mobile-picker{display:block;margin:0 0 10px;padding:10px 12px;background:var(--nav,#16354b);border-radius:12px 12px 0 0}
  .historic-month-mobile-picker .historic-control{display:block;min-width:0!important;margin:0}
  .historic-month-mobile-picker .historic-control>span{display:block;color:#fff;text-align:center;font-size:.72rem;font-weight:600;margin-bottom:6px}
  .historic-month-mobile-picker select{width:100%;min-width:0;max-width:100%;font-size:.78rem;padding:7px 9px;background:#fff;color:#173246;border:1px solid rgba(255,255,255,.45);border-radius:8px}
  .historic-month-mobile-table-wrap{margin-top:0!important;border-radius:0 0 12px 12px!important}
  .historic-month-mobile-table{width:100%!important;min-width:0!important;table-layout:fixed!important}
  .historic-month-mobile-table col.m-day{width:8%}
  .historic-month-mobile-table col.m-temp{width:14.33%}
  .historic-month-mobile-table col.m-hum{width:11%}
  .historic-month-mobile-table col.m-var{width:27%}
  .historic-month-mobile-table thead th{font-size:.60rem!important;padding:6px 1px!important;line-height:1.08!important;overflow:hidden!important}
  .historic-month-mobile-table thead tr:first-child th:first-child{font-size:.50rem!important;padding-left:0!important;padding-right:0!important;overflow-wrap:anywhere!important}
  .historic-month-mobile-table thead tr:first-child th:nth-child(2),
  .historic-month-mobile-table thead tr:first-child th:nth-child(3),
  .historic-month-mobile-table thead tr:first-child th:nth-child(4){width:auto!important;max-width:none!important}
  .historic-month-mobile-table th:nth-child(1),.historic-month-mobile-table td:nth-child(1){width:auto!important;max-width:none!important;padding-left:0!important;padding-right:0!important}
  .historic-month-mobile-table tbody td:nth-child(1){font-size:.72rem!important;font-weight:600!important}
  .historic-month-mobile-table tbody td:nth-child(2),.historic-month-mobile-table tbody td:nth-child(3),.historic-month-mobile-table tbody td:nth-child(4),
  .historic-month-mobile-table tbody td:nth-child(5),.historic-month-mobile-table tbody td:nth-child(6),.historic-month-mobile-table tbody td:nth-child(7){width:auto!important;max-width:none!important}
  .historic-month-mobile-table td{padding:8px 1px!important;font-size:.68rem!important;text-align:center!important;white-space:nowrap!important;overflow:hidden!important}
  .historic-month-mobile-table td.temperature-cell{font-size:.67rem!important;font-weight:600!important}
  .historic-month-mobile-table tbody td:nth-child(5),.historic-month-mobile-table tbody td:nth-child(6){font-size:.67rem!important;padding-left:0!important;padding-right:0!important}
  .historic-month-mobile-table tbody td:nth-child(7){font-size:.64rem!important}
  .historic-month-mobile-sort{justify-content:center!important;gap:1px!important;width:100%!important}
  #historicMonthMobileMetricGroup{white-space:normal!important;overflow-wrap:anywhere!important}
}
@media(max-width:390px){
  .historic-month-mobile-picker{padding:9px 10px}
  .historic-month-mobile-picker select{font-size:.72rem}
  .historic-month-mobile-table thead th{font-size:.56rem!important}
  .historic-month-mobile-table thead tr:first-child th:first-child{font-size:.46rem!important}
  .historic-month-mobile-table td{font-size:.64rem!important}
  .historic-month-mobile-table td.temperature-cell{font-size:.63rem!important}
  .historic-month-mobile-table tbody td:nth-child(7){font-size:.60rem!important}
}


/* v1.6.2j: PDF-Button einheitlich für Tages-, Monats- und künftige Jahresansicht */
.historic-pdf-button .historic-pdf-icon{display:block}

/* v1.6.3: Valors Anuals clona l'estructura mensual; al mòbil es prova primer el nom complet del mes. */
@media(max-width:650px){
  .historic-year-mobile-table col.m-day{width:16%!important}
  .historic-year-mobile-table col.m-temp{width:12%!important}
  .historic-year-mobile-table col.m-hum{width:9.5%!important}
  .historic-year-mobile-table col.m-var{width:29%!important}
  .historic-year-mobile-table thead tr:first-child th:first-child{font-size:.52rem!important;overflow-wrap:anywhere!important}
  .historic-year-mobile-table tbody td:first-child{font-size:.58rem!important;white-space:normal!important;line-height:1.05!important;overflow-wrap:anywhere!important}
}

/* v1.6.3b: selector mòbil unificat i unitats als valors */
.historic-day-mobile-picker{display:none}
.historic-day-mobile-sort{display:none}
@media(max-width:650px){
  .historic-day-mobile-picker{display:block;margin:0 0 10px;padding:10px 12px;background:var(--nav,#16354b);border-radius:12px 12px 0 0}
  .historic-day-mobile-picker .historic-control{display:block;min-width:0!important;margin:0}
  .historic-day-mobile-picker .historic-control>span{display:block;color:#fff;text-align:center;font-size:.72rem;font-weight:600;margin-bottom:6px}
  .historic-day-mobile-picker select{width:100%;min-width:0;max-width:100%;font-size:.78rem;padding:7px 9px;background:#fff;color:#173246;border:1px solid rgba(255,255,255,.45);border-radius:8px}
  .historic-day-mobile-sort{display:flex!important;justify-content:center!important;gap:2px!important;width:100%!important}
}


/* v1.6.3c: Valors diaris – més separació Data/Resolució només a tauleta */
@media (min-width:651px) and (max-width:900px){
    #historicDayView .historic-controls .historic-control:nth-child(2){margin-left:10px}
}
