:root {
  --fond: #0e0f11;
  --carte: #18191c;
  --carte-2: #212226;
  --bord: #2a2b30;
  --texte: #eceef2;
  --texte-2: #a3a7b0;
  --texte-3: #6f737c;
  --accent: #3b82f6;
  --accent-texte: #ffffff;
  --chaud: #f06a2a;
  --froid: #5aa9ff;
  --pluie: #4ea1ff;
  --pluie-pale: rgba(78, 161, 255, .22);
  --bon: #4cc38a;
  --moyen: #e6b23a;
  --mauvais: #e5534b;
  --nuit: rgba(255, 255, 255, .035);
  --ombre: 0 10px 40px rgba(0, 0, 0, .45);
  --rayon: 16px;
}
@media (prefers-color-scheme: light) {
  :root {
    --fond: #f3f4f6;
    --carte: #ffffff;
    --carte-2: #f1f2f5;
    --bord: #e2e4e9;
    --texte: #16181d;
    --texte-2: #555a64;
    --texte-3: #8a8f99;
    --chaud: #e0581a;
    --froid: #2f7fe0;
    --pluie: #2a7fe6;
    --pluie-pale: rgba(42, 127, 230, .16);
    --nuit: rgba(0, 0, 0, .035);
    --ombre: 0 10px 40px rgba(0, 0, 0, .15);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h2, h3 { margin: 0; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.petit { width: 16px; height: 16px; }

/* ---------- barre du haut */
.barre {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px max(16px, calc((100% - 1100px) / 2));
  background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}
.lieu-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  font-weight: 650; font-size: 16px; min-width: 0;
}
.lieu-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-actions { display: flex; gap: 4px; }
.icone-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  background: none; border: 0; border-radius: 10px; cursor: pointer; color: var(--texte-2);
}
.icone-btn:hover { background: var(--carte-2); color: var(--texte); }
.icone-btn[aria-pressed="true"] { color: #f6c23c; }
.icone-btn[aria-pressed="true"] .ic { fill: #f6c23c; }
.icone-btn.tourne .ic { animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

main { max-width: 1100px; margin: 0 auto; padding: 14px 16px 8px; }

/* ---------- puces de lieux */
.puces { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puce {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  background: var(--carte); border: 1px solid var(--bord); font-size: 14px;
}
.puce:hover { border-color: var(--texte-3); }
.puce.actif { background: var(--texte); color: var(--fond); border-color: var(--texte); }
.puce .ic { width: 15px; height: 15px; }

/* ---------- cartes et grille */
#s-heros { margin-bottom: 16px; }
.colonnes { display: flex; flex-direction: column; gap: 16px; }
.col { display: contents; }
@media (min-width: 900px) {
  .colonnes { flex-direction: row; align-items: flex-start; }
  .col { display: flex; flex-direction: column; gap: 16px; flex: 1; min-width: 0; }
}
.carte {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 18px; min-width: 0;
}
.contenu-p > h2 {
  font-size: 16px; font-weight: 650; margin-bottom: 14px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; border-radius: 6px;
}
.contenu-p > h2::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--texte-3); border-bottom: 2px solid var(--texte-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; flex: none; }
.contenu-p > h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.panneau.replie .contenu-p > h2 { margin-bottom: 0; }
.panneau.replie .contenu-p > h2::after { transform: rotate(-45deg); }
.panneau.replie .contenu-p > :not(h2) { display: none !important; }

/* mode personnalisation */
.outils { display: none; align-items: center; gap: 6px; margin: -6px -6px 12px; padding: 6px; border-radius: 10px; background: var(--carte-2); }
.outils-nom { flex: 1; font-weight: 650; font-size: 14px; padding-left: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outils button { min-width: 36px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--bord); background: var(--carte); cursor: pointer; font-weight: 600; font-size: 14px; }
.outils button:hover { border-color: var(--texte-3); }
body.edition .outils { display: flex; }
body.edition .panneau .contenu-p { max-height: 120px; overflow: hidden; opacity: .45; pointer-events: none; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
body.edition .panneau { border-style: dashed; }
.seulement-large { display: none; }
@media (min-width: 900px) { .seulement-large { display: inline-block; } }
.barre-edition { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: center; margin-bottom: 16px; border-color: var(--accent); }
.barre-edition > div:first-child { flex: 1 1 320px; }
.puces.masques { flex-wrap: wrap; padding: 10px 0 0; }
.sous { color: var(--texte-2); font-size: 13px; }
.discret { color: var(--texte-3); font-size: 12.5px; }

/* ---------- accueil */
.accueil { display: grid; gap: 16px; }
@media (min-width: 700px) { .accueil { grid-template-columns: 1fr 1fr; } }
.accueil h1 { font-size: 18px; margin: 0 0 18px; }
.accueil p { margin: 0; color: var(--texte-2); }
.boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 600;
  background: var(--carte-2); border: 1px solid var(--bord);
}
.btn:hover { border-color: var(--texte-3); }
.btn.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.btn.principal:hover { filter: brightness(1.08); }
.btn.large { width: 100%; }

/* ---------- héros */
.heros { display: grid; gap: 20px; }
@media (min-width: 760px) { .heros { grid-template-columns: 1.1fr 1fr; } }
.heros-lieu { font-size: 18px; font-weight: 700; }
.heros-actuel { display: flex; align-items: center; gap: 14px; margin: 14px 0 10px; }
.heros-actuel .meteo-ic { width: 78px; height: 78px; color: var(--texte); }
.heros-temp { font-size: 64px; font-weight: 300; line-height: 1; letter-spacing: -2px; }
.heros-cond { font-size: 15px; margin-top: 6px; }
.ligne-infos { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--texte-2); font-size: 13.5px; margin-bottom: 8px; }
.ligne-infos span { display: inline-flex; align-items: center; gap: 5px; }
.ligne-infos .ic { width: 16px; height: 16px; }
.titre-section { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); margin-bottom: 10px; }
.tuiles-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tuile { background: var(--carte-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.tuile .grand { font-size: 22px; font-weight: 650; }
.tuile .etq { font-size: 13px; color: var(--texte-2); }
.mini { font-size: 12px; color: var(--texte-3); }
.phrase { font-weight: 600; margin: 12px 0; font-size: 14.5px; }
.accord { display: flex; align-items: center; gap: 8px; color: var(--texte-2); font-size: 13px; margin-top: 10px; }

details.repli { background: var(--carte-2); border-radius: 10px; margin-top: 8px; }
details.repli > summary {
  list-style: none; cursor: pointer; padding: 9px 12px; display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; font-weight: 600;
}
details.repli > summary::-webkit-details-marker { display: none; }
details.repli > summary::after { content: "⌄"; color: var(--texte-3); transition: transform .15s; }
details.repli[open] > summary::after { transform: rotate(180deg); }
details.repli > .corps { padding: 0 12px 12px; }

details.simple > summary { cursor: pointer; color: var(--texte-2); font-size: 13px; padding: 10px 0 2px; }

/* barres d'accord */
.barres { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.barres i { width: 3px; background: var(--texte-3); opacity: .35; border-radius: 1px; }
.barres i:nth-child(1) { height: 5px; } .barres i:nth-child(2) { height: 8px; }
.barres i:nth-child(3) { height: 11px; } .barres i:nth-child(4) { height: 14px; }
.barres i.on { background: var(--texte); opacity: 1; }

/* ---------- heure par heure */
.jours-onglets { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.onglet {
  flex: none; width: 52px; padding: 7px 0 6px; border-radius: 12px; cursor: pointer;
  background: var(--carte-2); border: 1px solid transparent; text-align: center; font-size: 12px; color: var(--texte-2);
}
.onglet b { display: block; font-size: 16px; color: var(--texte); }
.onglet .meteo-ic { width: 22px; height: 22px; margin: 3px auto 0; display: block; }
.onglet.actif { background: var(--texte); color: var(--fond); }
.onglet.actif b { color: var(--fond); }
.resume-jour { font-weight: 600; font-size: 14px; margin: 6px 0 10px; }
.table-heures { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-heures th { font-size: 11px; font-weight: 600; color: var(--texte-3); text-align: left; padding: 4px 6px; text-transform: uppercase; letter-spacing: .04em; }
.table-heures th:last-child, .table-heures td:last-child { text-align: right; }
.table-heures td { padding: 7px 6px; border-top: 1px solid var(--bord); vertical-align: middle; }
.table-heures tr.heure { cursor: pointer; }
.table-heures tr.heure:hover td { background: var(--carte-2); }
.table-heures tr.heure.ouvert td { background: var(--carte-2); }
.table-heures tr.groupe td { text-align: left !important; border: 0; padding: 12px 6px 2px; font-size: 11px; font-weight: 700; color: var(--texte-3); text-transform: uppercase; letter-spacing: .06em; }
.cel-temp { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.cel-temp .meteo-ic { width: 24px; height: 24px; }
.pluie-txt { color: var(--pluie); font-size: 13px; }
.vent-cel { display: inline-flex; align-items: center; gap: 6px; color: var(--texte-2); }
.fleche { width: 14px; height: 14px; display: inline-block; }
.detail-heure td { padding: 0 6px 10px; background: var(--carte-2); }
.comparatif { width: 100%; border-collapse: collapse; font-size: 13px; }
.comparatif th, .comparatif td { padding: 5px 6px; text-align: right; border-top: 1px solid var(--bord); white-space: nowrap; }
.comparatif th:first-child, .comparatif td:first-child { text-align: left; }
.comparatif th { color: var(--texte-3); font-weight: 600; font-size: 11.5px; }
.comparatif tr.med td { font-weight: 700; }
.comparatif .meteo-ic { width: 18px; height: 18px; vertical-align: middle; }
.defile { overflow-x: auto; }

/* ---------- jours à venir */
.liste-jours { display: flex; flex-direction: column; }
.jour { border-top: 1px solid var(--bord); }
.jour:first-child { border-top: 0; }
.jour > summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 58px 30px 34px 1fr 34px 58px 22px; align-items: center; gap: 8px;
  padding: 9px 2px; font-size: 14px;
}
.jour > summary::-webkit-details-marker { display: none; }
.jour-nom b { display: block; font-size: 14px; }
.jour-nom span { font-size: 11.5px; color: var(--texte-3); }
.jour .meteo-ic { width: 26px; height: 26px; }
.tmin { color: var(--texte-2); text-align: right; }
.tmax { font-weight: 650; }
.plage { position: relative; height: 6px; border-radius: 3px; background: var(--carte-2); }
.plage i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, var(--froid), var(--chaud)); }
.jour-pluie { text-align: right; font-size: 12.5px; line-height: 1.2; }
.jour-pluie b { color: var(--pluie); font-weight: 650; display: block; }
.jour-pluie span { color: var(--texte-3); }
.jour .corps { padding: 0 0 12px; }
@media (max-width: 420px) {
  .jour > summary { grid-template-columns: 48px 26px 28px 1fr 28px 52px 18px; gap: 6px; font-size: 13px; }
}

/* ---------- graphiques */
.commandes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.segments { display: inline-flex; background: var(--carte-2); border-radius: 10px; padding: 3px; }
.segments button { background: none; border: 0; padding: 5px 11px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--texte-2); }
.segments button.actif { background: var(--carte); color: var(--texte); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.graphe { width: 100%; height: auto; display: block; overflow: visible; }
.graphe text { fill: var(--texte-3); font-size: 12px; }
.graphe .axe { stroke: var(--bord); stroke-width: 1; }
.graphe .nuitzone { fill: var(--nuit); }
.graphe .lab-src { fill: var(--texte-2); font-size: 11.5px; }
.legende-g { font-size: 12px; color: var(--texte-3); margin-bottom: 4px; }
.vide-g { fill: var(--texte-2); font-size: 12px; font-weight: 600; }
.tableau-valeurs { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.tableau-valeurs th, .tableau-valeurs td { padding: 4px 6px; border-top: 1px solid var(--bord); text-align: right; white-space: nowrap; }
.tableau-valeurs th:first-child, .tableau-valeurs td:first-child { text-align: left; position: sticky; left: 0; background: var(--carte); }
.tableau-valeurs th { color: var(--texte-3); font-weight: 600; }

/* ---------- mesures et conditions */
.obs-tete { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.obs-tete .meteo-ic { width: 44px; height: 44px; }
.obs-temp { font-size: 34px; font-weight: 400; line-height: 1; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tuile .valeur { font-size: 20px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.tuile .valeur .ic { width: 18px; height: 18px; }
.constat { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13.5px; color: var(--texte-2); }
.constat .ic { color: var(--bon); width: 18px; height: 18px; margin-top: 1px; }
.ecarts { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.ecarts li { display: grid; grid-template-columns: 110px 1fr 54px; gap: 8px; align-items: center; padding: 4px 0; }
.ecart-barre { position: relative; height: 6px; background: var(--carte-2); border-radius: 3px; }
.ecart-barre::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--texte-3); }
.ecart-barre i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.ecarts li span:last-child { text-align: right; color: var(--texte-2); }

/* ---------- linge */
.linge-tete { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.linge-tete b { font-size: 15px; }
.linge-badge { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 12px; border-radius: 12px; font-weight: 700; font-size: 14px; }
.linge-badge.dehors { background: rgba(76, 195, 138, .16); color: var(--bon); }
.linge-badge.demain { background: rgba(230, 178, 58, .16); color: var(--moyen); }
.linge-badge.dedans { background: var(--pluie-pale); color: var(--pluie); }
.linge-frise { display: grid; grid-template-columns: 40px repeat(14, 1fr); gap: 3px; align-items: center; font-size: 11px; color: var(--texte-3); }
.linge-frise > i { height: 22px; border-radius: 4px; }
.linge-frise > i.vide { background: transparent; border: 1px dashed var(--bord); }
.linge-frise > i.passe { opacity: .25; }
.linge-frise > i.fenetre { box-shadow: inset 0 0 0 2px var(--texte); }
.linge-jour { font-size: 12.5px; color: var(--texte-2); font-weight: 600; }
.linge-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--texte-2); margin: 10px 0 4px; }
.linge-legende span { display: inline-flex; align-items: center; gap: 5px; }
.linge-legende i { width: 10px; height: 10px; border-radius: 3px; }
.linge-conseil { margin: 8px 0 0; }

/* ---------- air */
.aqi-tete { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.aqi-pastille { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-weight: 750; font-size: 20px; color: #10131a; flex: none; }
.aqi-echelle { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-bottom: 14px; }
.aqi-echelle i { height: 7px; border-radius: 4px; }
.aqi-curseur { position: absolute; top: -4px; width: 4px; height: 15px; border-radius: 2px; background: var(--texte); box-shadow: 0 0 0 2px var(--carte); }
.polluants { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 14px; }
.polluants .tuile { padding: 8px 10px; }
.pollen { display: grid; grid-template-columns: 1fr 80px 74px; gap: 8px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.pollen .jauge { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.pollen .jauge i { height: 6px; border-radius: 2px; background: var(--carte-2); }
.pollen > span:last-child { text-align: right; color: var(--texte-2); }

/* ---------- sources */
.sources-liste { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.sources-liste li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; }
.point { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.etat-sources { margin: 16px 2px 0; }

/* ---------- états */
.chargement { display: grid; place-items: center; min-height: 240px; color: var(--texte-2); gap: 10px; }
.roue { width: 28px; height: 28px; border: 3px solid var(--bord); border-top-color: var(--accent); border-radius: 50%; animation: tourne .8s linear infinite; }
.erreur { color: var(--mauvais); }

/* ---------- modales */
.modale {
  width: min(440px, calc(100% - 24px)); max-height: min(640px, calc(100% - 40px));
  padding: 16px; border: 1px solid var(--bord); border-radius: 18px;
  background: var(--carte); color: var(--texte); box-shadow: var(--ombre);
}
.modale::backdrop { background: rgba(0, 0, 0, .55); }
.modale-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modale-tete h2 { font-size: 16px; }
.etiquette { display: block; font-size: 13px; color: var(--texte-2); margin: 16px 0 6px; }
.champ input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--bord);
  background: var(--fond); color: var(--texte); font: inherit; font-size: 16px;
}
.champ input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.resultats { list-style: none; margin: 8px 0 0; padding: 0; }
.resultats li button {
  width: 100%; text-align: left; background: none; border: 0; padding: 9px 8px; border-radius: 10px; cursor: pointer;
}
.resultats li button:hover, .resultats li button:focus-visible { background: var(--carte-2); outline: none; }
.resultats b { display: block; }
.resultats span { font-size: 12.5px; color: var(--texte-2); }
.resultats .vide { color: var(--texte-2); padding: 10px 8px; font-size: 13.5px; }
.texte p { margin: 0 0 10px; color: var(--texte-2); font-size: 14px; }
.texte strong { color: var(--texte); }

/* ---------- infobulle */
.infobulle {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--carte-2); border: 1px solid var(--bord); border-radius: 10px;
  padding: 7px 10px; font-size: 12.5px; box-shadow: var(--ombre); max-width: 240px;
}
.infobulle b { display: block; margin-bottom: 2px; }

.pied { max-width: 1100px; margin: 0 auto; padding: 10px 16px 32px; font-size: 12px; color: var(--texte-3); }
.pied a { color: var(--texte-2); }

.meteo-ic { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.meteo-ic .soleil { stroke: #f6b73c; }
.meteo-ic .lune { stroke: #c9cfe0; }
.meteo-ic .goutte { stroke: var(--pluie); }
.meteo-ic .flocon { stroke: #b9dcff; }
.meteo-ic .eclair { stroke: #f6c23c; }
