/* ============================================================
   Météon — feuille de style
   La palette est pilotée par js/theme.js : elle découle de la météo et de
   l'heure du lieu affiché. Les valeurs ci-dessous ne servent qu'au tout
   premier rendu, avant que l'ambiance ne soit appliquée.
   ============================================================ */

:root {
  --bg:            #0b1220;
  --bg-2:          #0e1728;
  --panel:         rgba(24, 36, 60, .72);
  --panel-solid:   #16223a;
  --panel-2:       rgba(31, 46, 74, .66);
  --stroke:        rgba(255, 255, 255, .08);
  --stroke-strong: rgba(255, 255, 255, .16);
  --text:          #eaf1ff;
  --text-2:        #a8bad4;
  --text-3:        #7c8fab;
  --accent:        #4f9dff;
  --accent-2:      #7cc4ff;
  --accent-mid:    rgba(79, 157, 255, .55);
  --accent-soft:   rgba(79, 157, 255, .26);
  --accent-dim:    rgba(79, 157, 255, .10);
  --glow-1:        rgba(79, 157, 255, .22);
  --glow-2:        rgba(181, 139, 255, .16);
  --chrome-1:      rgba(14, 23, 40, .86);
  --chrome-2:      rgba(11, 18, 32, .94);
  --warm:          #ff9f43;
  --hot:           #ff6b5b;
  --cold:          #56a9ff;
  --green:         #3ddc97;
  --amber:         #ffc65c;
  --violet:        #b58bff;
  --danger:        #ff5f6d;
  --shadow:        0 18px 40px rgba(0, 0, 0, .42);
  --r-lg: 22px;
  --r:    16px;
  --r-sm: 11px;
  --sidebar: 248px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 78% -12%, var(--glow-1), transparent 60%),
    radial-gradient(900px 600px at 8% 108%, var(--glow-2), transparent 60%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  transition: background-color .9s ease, color .5s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- Layout ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--chrome-1), var(--chrome-2));
  border-right: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
/* Le logo porte déjà le nom : il tient la place de l'icône et du titre. */
.brand-logo { width: auto; height: 50px; max-width: 100%; object-fit: contain;
  object-position: left center; flex: 1; min-width: 0; user-select: none; }
.sidebar-close { display: none; margin-left: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text-2); cursor: pointer;
  font-size: 14.5px; text-align: left; position: relative;
  transition: background .16s, color .16s, transform .16s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.is-active { background: linear-gradient(100deg, var(--accent-soft), var(--accent-dim)); color: var(--text); font-weight: 600; }
.nav-item.is-active::before { content:""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-ic { font-size: 15px; width: 20px; text-align: center; }
.badge[hidden] { display: none; }
.badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700;
}

.places { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1; }
.places-head { display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.place-list { list-style: none; margin: 0; padding: 0; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.place {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; cursor: pointer; color: var(--text-2); font-size: 14px;
}
.place:hover { background: var(--panel-2); color: var(--text); }
.place-list li { border-radius: 12px; }
.place-list li.glisse .place { opacity: .4; }
.place-list li.cible { box-shadow: inset 0 2px 0 var(--accent); }
.place-list li.cible-bas { box-shadow: inset 0 -2px 0 var(--accent); }
.place[draggable="true"] { cursor: grab; }
.place:active { cursor: grabbing; }
.place.is-active { background: var(--panel); border-color: var(--stroke-strong); color: var(--text); }
.place .p-ic { font-size: 16px; }
.place .p-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place .p-temp { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.place .p-wx { font-size: 14px; min-width: 18px; text-align: center; line-height: 1; }
.place-empty { padding: 10px; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

.side-foot { display: flex; flex-direction: column; gap: 8px; }
/* Bas de la barre latérale : la case et le bouton de son partagent une ligne */
.side-row { display: flex; gap: 8px; align-items: stretch; }
.side-row .check { flex: 1; min-width: 0; }

.audio { position: relative; flex: none; }
.audio[hidden] { display: none; }
.audio-btn { width: 40px; height: 100%; border-radius: 12px; cursor: pointer; font-size: 15px;
  border: 1px solid var(--stroke); background: var(--panel-2); color: var(--text-2);
  transition: border-color .16s, color .16s; }
.audio-btn:hover { color: var(--text); border-color: var(--stroke-strong); }
.audio-btn.off { opacity: .55; }
.audio-btn.attente { border-color: var(--amber); color: var(--amber); }
/* Le réglage n'apparaît qu'au survol, pour ne pas encombrer la barre */
.audio-pop { position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) scale(.96); transform-origin: bottom center;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 9px 9px; border-radius: 13px; background: var(--panel-solid);
  border: 1px solid var(--stroke-strong); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; z-index: 45; }
.audio:hover .audio-pop, .audio:focus-within .audio-pop { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); }
.audio-pop input[type=range] { -webkit-appearance: slider-vertical; appearance: slider-vertical;
  writing-mode: vertical-lr; direction: rtl; width: 7px; height: 92px; }
.audio-val { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.check { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 12px;
  border: 1px solid var(--stroke); background: var(--panel-2); font-size: 12.5px;
  color: var(--text-2); cursor: pointer; user-select: none; }
.check:hover { color: var(--text); border-color: var(--stroke-strong); }
.check input { appearance: none; width: 16px; height: 16px; flex: none; margin: 0; cursor: pointer;
  border: 1.5px solid var(--stroke-strong); border-radius: 5px; background: transparent;
  display: grid; place-items: center; transition: background .16s, border-color .16s; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: "\2713"; font-size: 11px; font-weight: 700; color: #fff; line-height: 1; }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mood-tag { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 12px;
  border: 1px solid var(--stroke); background: var(--panel-2); font-size: 12.5px; color: var(--text-2); }
.mood-tag b { color: var(--text); font-weight: 600; }
.mood-tag .m-ic { font-size: 14px; }
.unit-switch { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--panel-2); }
.unit-switch button { flex: 1; border: 0; background: transparent; color: var(--text-3); padding: 7px 4px; border-radius: 9px; cursor: pointer; font-size: 12.5px; }
.unit-switch button.is-active { background: var(--panel-solid); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 13px; border-radius: 12px; cursor: pointer; font-size: 13.5px;
  border: 1px solid var(--stroke); background: var(--panel-2); color: var(--text-2);
  transition: border-color .16s, color .16s, background .16s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--stroke-strong); }
.ghost-btn.wide { width: 100%; }

.scrim { display: none; }

/* ---------------- Topbar ---------------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, var(--chrome-1), transparent);
}
.menu-btn { display: none; }

.search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 14px; border-radius: 14px; border: 1px solid var(--stroke);
  background: var(--panel); box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--accent-mid); }
.search input { flex: 1; border: 0; background: transparent; outline: 0; font-size: 14.5px; padding: 4px 0; }
.search input::placeholder { color: var(--text-3); }
.search-ic { color: var(--text-3); }

.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 50;
  background: var(--panel-solid); border: 1px solid var(--stroke-strong);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; max-height: 330px; overflow-y: auto;
}
.sg-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px;
  border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 14px; }
.sg-item:hover, .sg-item.is-hl { background: var(--panel-2); }
.sg-item .sg-sub { color: var(--text-3); font-size: 12.5px; }
.sg-item .sg-flag { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 4px 6px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--stroke); color: var(--text-3); line-height: 1; }
.sg-msg { padding: 13px 15px; color: var(--text-3); font-size: 13.5px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
/* Le bouton des favoris annonce son geste : ajouter ou retirer le lieu affiché */
.icon-btn.retrait { color: var(--warm); }
.icon-btn.retrait:hover { color: var(--danger); }
.spin-anim { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Content ---------------- */
.content { padding: 4px 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.view { display: none; flex-direction: column; gap: 16px; animation: fade .28s ease; }
.view.is-active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  transition: background-color .6s ease, border-color .6s ease;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); padding: 13px 15px; min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { font-size: 16.5px; }
.sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

.tabs { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--stroke); }
.tabs button { border: 0; background: transparent; color: var(--text-3); padding: 6px 11px; border-radius: 8px; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.tabs button.is-active { background: var(--panel-solid); color: var(--text); font-weight: 600; }
.tabs.small button { padding: 5px 9px; font-size: 12px; }

.select { padding: 7px 11px; border-radius: 11px; border: 1px solid var(--stroke); background: var(--panel-2); cursor: pointer; font-size: 13px; outline: 0; }

/* ---------------- Hero ---------------- */
.hero { position: relative; overflow: hidden; padding: 0; min-height: 330px; }
.hero-sky { position: absolute; inset: 0; background: linear-gradient(170deg, #1b3a63, #0f2440 60%, #0b1220); transition: background 1.2s ease; }
.hero-scene { position: absolute; inset: 0; pointer-events: none; }
.hero-scene canvas { width: 100%; height: 100%; display: block; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.05fr); gap: 18px; padding: 22px 22px 24px; }
.hero-grid::before { content: ""; position: absolute; inset: 0; background: linear-gradient(95deg, rgba(8,14,26,.82) 22%, rgba(8,14,26,.30) 55%, rgba(8,14,26,.10)); pointer-events: none; }
[data-lum="light"] .hero-grid::before { background: linear-gradient(95deg, rgba(10,32,58,.50) 16%, rgba(10,32,58,.16) 50%, transparent); }
[data-lum="light"] .city, [data-lum="light"] .temp { text-shadow: 0 2px 16px rgba(6,26,48,.55); }
[data-lum="light"] .glass { background: rgba(12,34,62,.44); border-color: rgba(255,255,255,.18); }
.hero-left, .hero-right { position: relative; }

.city { font-size: 38px; line-height: 1.05; text-shadow: 0 2px 18px rgba(0,0,0,.5); color: #fff; }
.region { display: flex; align-items: center; gap: 6px; color: #cfe0f5; font-size: 13.5px; margin-top: 5px; }
.hero-now { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.pill { padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); font-size: 12.5px; color: #fff; backdrop-filter: blur(6px); }
.stamp { font-size: 12.5px; color: #cfe0f5; }

.temp-row { display: flex; align-items: center; gap: 16px; margin-top: 4px; }

/* Horloge du lieu : lisible de loin sur un écran d'affichage, teintée par l'ambiance */
.hero-clock { margin-left: auto; display: flex; align-items: baseline; gap: 8px; padding-right: 6px;
  font-size: clamp(38px, 5.4vw, 96px); font-weight: 300; line-height: .95; letter-spacing: -.04em;
  color: var(--clock); font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 30px rgba(0,0,0,.28); transition: color .7s ease; white-space: nowrap; }
.hero-clock .sec { font-size: .34em; font-weight: 500; letter-spacing: -.01em; opacity: .85; }
.hero-clock .sec[hidden] { display: none; }
.big-ic { font-size: 74px; line-height: 1; filter: drop-shadow(0 8px 22px rgba(0,0,0,.45)); animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.temp { font-size: 66px; font-weight: 300; line-height: 1; color: #fff; letter-spacing: -.03em; text-shadow: 0 4px 24px rgba(0,0,0,.45); }
.cond { font-size: 21px; font-weight: 600; color: #fff; margin-top: 2px; }
.summary { max-width: 42ch; color: #d6e5f8; font-size: 14px; line-height: 1.5; margin-top: 7px; }
.minmax { display: flex; gap: 18px; margin-top: 12px; font-size: 19px; color: #fff; }
.minmax .up b { color: #ffb08a; } .minmax .down b { color: #9ec9ff; }
.minmax span { display: flex; gap: 6px; align-items: baseline; }
.minmax .up { color: var(--hot); } .minmax .down { color: var(--cold); }

.hero-right { display: grid; grid-template-columns: 1.32fr 1fr; gap: 10px; align-items: stretch; }
.glass { background: rgba(14, 26, 46, .52); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r); backdrop-filter: blur(14px); padding: 12px 14px; color: #eaf3ff; }
.glass .k { font-size: 11.5px; color: #b9cde6; }
.glass .k2 { font-size: 11.5px; color: #b9cde6; margin-top: 3px; }
.feel-line { display: flex; align-items: baseline; gap: 7px; margin-top: 12px; font-size: 14.5px; color: #eaf3ff; }
.feel-line .ic { font-size: 15px; }
.feel-line b { color: #fff; }
.feel-line b:last-child { font-size: 17px; }
.sun { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.sun-row { display: flex; align-items: center; gap: 9px; }
.sun-row b { font-size: 16.5px; }
.sun-row .ic { font-size: 16px; }
.sun-arc { height: 118px; margin: 2px 0 1px; }
.sun-arc canvas { width: 100%; height: 100%; display: block; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; align-content: space-between; gap: 12px 14px; }
.stat { display: flex; align-items: center; gap: 9px; min-width: 0; }
.stat .ic { font-size: 19px; opacity: .92; }
.stat .k { font-size: 11.5px; color: #b9cde6; line-height: 1.25; }
.stat b { font-size: 19px; font-weight: 600; display: block; white-space: nowrap; letter-spacing: -.01em; margin-top: 1px; }
.tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: 2px; }
.tag.low { background: rgba(61,220,151,.2); color: #7ff0c0; }
.tag.mid { background: rgba(255,198,92,.2); color: #ffd98b; }
.tag.high { background: rgba(255,95,109,.22); color: #ff9aa2; }
/* Phase lunaire : une bande compacte au pied du cycle solaire */
.moon-strip { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding-top: 9px;
  border-top: 1px solid rgba(255,255,255,.12); }
.moon-strip canvas { width: 38px; height: 38px; flex: none; }
.moon-strip b { font-size: 13.5px; }
.moon-strip .k2 { margin-top: 1px; }

/* ---------------- Rangées ---------------- */
.row { display: grid; gap: 16px; align-items: stretch; }
.row-3 { grid-template-columns: 1.15fr 1fr 1.1fr; align-items: start; }
.row-chart { grid-template-columns: 1.7fr .78fr .78fr; }
.row-2 { grid-template-columns: 1fr; }
.col-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Horaires */
.hour-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
.hour {
  flex: 0 0 auto; width: 58px; padding: 7px 4px 6px; border-radius: 12px;
  border: 1px solid var(--stroke); background: var(--panel-2); text-align: center;
  scroll-snap-align: start; transition: transform .16s, border-color .16s, background .16s; cursor: default;
}
.hour:hover { transform: translateY(-3px); border-color: var(--stroke-strong); }
.hour.is-now { border-color: var(--accent-mid); background: linear-gradient(180deg, var(--accent-soft), var(--panel-2)); }
.hour .h-t { font-size: 11.5px; color: var(--text-3); }
.hour.is-now .h-t { color: var(--accent-2); font-weight: 650; }
.hour .h-ic { font-size: 19px; margin: 3px 0 2px; }
.hour .h-v { font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.hour .h-s { font-size: 10.5px; color: var(--text-3); margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.hour .h-bar { height: 3px; border-radius: 3px; margin-top: 4px; background: var(--stroke); overflow: hidden; }
.hour .h-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--cold), var(--accent)); }

/* 7 jours */
.day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.day { display: grid; grid-template-columns: 94px 22px 32px 1fr 34px 56px; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.day:hover, .day.is-sel { background: var(--panel-2); }
.day .d-name { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.today .d-name { color: var(--text); font-weight: 650; }
.day .d-ic { font-size: 17px; text-align: center; }
.day .d-min, .day .d-max { font-style: normal; font-size: 13px; }
.day .d-min { color: var(--cold); text-align: right; }
.day .d-max { color: var(--text); font-weight: 600; }
.trackbar { height: 5px; border-radius: 5px; background: var(--stroke); position: relative; overflow: hidden; min-width: 30px; }
.trackbar i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, #56a9ff, #ffc65c, #ff6b5b); }
.day .d-pop { font-size: 12px; color: var(--text-3); text-align: right; white-space: nowrap; }
.day .d-pop.wet { color: var(--accent-2); }

/* Radar / carte */
.radar-wrap { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--stroke);
  aspect-ratio: 16 / 7; max-height: 205px; }
.radar-wrap.big { aspect-ratio: 21 / 9; max-height: 540px; }
.radar-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.radar-legend { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 7px; border-radius: 10px; background: var(--panel); border: 1px solid var(--stroke);
  backdrop-filter: blur(8px); font-size: 10px; color: var(--text-2); }
.legend-scale { width: 8px; height: 68px; border-radius: 5px; }
.radar-ctrl { display: flex; align-items: center; gap: 11px; margin-top: 8px; }
.radar-ctrl input[type=range] { flex: 1; }
.icon-btn.play { background: var(--panel-2); border-color: var(--stroke); }

input[type=range] { -webkit-appearance: none; appearance: none; height: 5px; border-radius: 5px; background: var(--stroke-strong); outline: 0; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); }

/* Graphique */
.chart-card .legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); margin-top: 5px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.t { background: var(--warm); } .dot.p { background: var(--accent-2); margin-left: 6px; }
.chart-wrap { position: relative; height: 230px; }
.chart-wrap.sm { height: 190px; margin-top: 14px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-tip { position: absolute; pointer-events: none; transform: translate(-50%, -110%); padding: 7px 10px; border-radius: 10px;
  background: var(--panel-solid); border: 1px solid var(--stroke-strong); box-shadow: var(--shadow); font-size: 12px; white-space: nowrap; z-index: 5; opacity: 0; transition: opacity .12s; }
.chart-tip.show { opacity: 1; }
.chart-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.chart-tip .cl { display: flex; align-items: center; gap: 5px; }

/* Mini cartes */
.mini-col { display: flex; flex-direction: column; gap: 16px; }
.mini, .activity, .tip { text-align: left; position: relative; font-family: inherit; color: inherit; }
button.card { cursor: pointer; transition: transform .16s, border-color .16s; }
button.card:hover { transform: translateY(-3px); border-color: var(--stroke-strong); }
.mini-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; margin-bottom: 9px; }
.mini-head.plain { font-weight: 500; color: var(--text-2); font-size: 12.5px; margin-bottom: 2px; }
.ic { display: inline-grid; place-items: center; }
.mini-head .ic { width: 27px; height: 27px; border-radius: 9px; font-size: 14px; }
.ic.green { background: rgba(61,220,151,.16); } .ic.amber { background: rgba(255,198,92,.16); }
.ic.violet { background: rgba(181,139,255,.16); } .ic.blue { background: rgba(79,157,255,.16); }
.ic.big { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; flex: none; }
.mini-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mini-main b { font-size: 26px; font-weight: 650; }
.mini-main.sm b { font-size: 19px; }
.mini-k { font-size: 12px; color: var(--text-3); }
.meter { height: 6px; border-radius: 6px; background: var(--stroke); margin: 9px 0 9px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 6px; width: 0; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.mini p, .tip p, .activity p { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.arrow { position: absolute; right: 16px; bottom: 14px; color: var(--text-3); font-size: 14px; }
.arrow.big { position: static; margin-left: auto; font-size: 20px; }
.tip b { display: block; font-size: 15px; margin-bottom: 5px; }
.tip-icons { display: flex; gap: 8px; margin-top: 10px; font-size: 21px; }

.activity { display: flex; align-items: center; gap: 16px; }
.activity.vigil { gap: 12px; }
.activity.vigil p { margin-top: 2px; }
.act-left { display: flex; align-items: center; gap: 13px; flex: 1; min-width: 0; }
.activity b { font-size: 16px; display: block; margin: 2px 0 4px; }
.good { color: var(--green); }
.score-ring { position: relative; width: 64px; height: 64px; flex: none; display: grid; place-items: center; }
.score-ring canvas { width: 64px; height: 64px; position: absolute; inset: 0; }
.score-ring span { position: relative; display: flex; align-items: baseline; gap: 1px; }
.score-ring b { font-size: 19px; margin: 0; }
.score-ring i { font-style: normal; font-size: 11px; color: var(--text-3); }

/* ---------------- Vues secondaires ---------------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.tile { padding: 14px; border-radius: var(--r); border: 1px solid var(--stroke); background: var(--panel-2); }
.tile .t-k { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.tile .t-v { font-size: 23px; font-weight: 600; margin: 7px 0 3px; }
.tile .t-s { font-size: 12px; color: var(--text-3); }
.tile .meter { margin: 9px 0 0; }

.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.act-card { padding: 15px; border-radius: var(--r); border: 1px solid var(--stroke); background: var(--panel-2); display: flex; gap: 13px; align-items: flex-start; }
.act-card .ic { width: 38px; height: 38px; border-radius: 12px; font-size: 19px; flex: none; }
.act-card h3 { font-size: 14.5px; }
.act-card .score { font-size: 13px; font-weight: 650; margin: 4px 0 5px; }
.act-card p { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

.alert-list { display: flex; flex-direction: column; gap: 11px; }
.alert-item { display: flex; gap: 13px; padding: 14px 15px; border-radius: var(--r); border: 1px solid var(--stroke);
  background: var(--panel-2); border-left-width: 4px; }
.alert-item.sev-1 { border-left-color: var(--green); }
.alert-item.sev-2 { border-left-color: var(--amber); }
.alert-item.sev-3 { border-left-color: var(--warm); }
.alert-item.sev-4 { border-left-color: var(--danger); }
.alert-item .a-ic { font-size: 22px; }
.alert-item h3 { font-size: 15px; margin-bottom: 4px; }
.alert-item p { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.alert-item .a-when { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.news { padding: 15px; border-radius: var(--r); border: 1px solid var(--stroke); background: var(--panel-2); }
.news .n-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-2); font-weight: 650; }
.news h3 { font-size: 15px; margin: 7px 0 6px; line-height: 1.35; }
.news p { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.news .n-time { font-size: 11.5px; color: var(--text-3); margin-top: 9px; }

.fc-detail { display: flex; flex-direction: column; gap: 9px; }
.fc-day { border: 1px solid var(--stroke); border-radius: var(--r); background: var(--panel-2); overflow: hidden; }
.fc-head { display: grid; grid-template-columns: 150px 34px 1fr auto auto; align-items: center; gap: 12px;
  padding: 13px 15px; cursor: pointer; width: 100%; border: 0; background: transparent; text-align: left; color: inherit; }
.fc-head:hover { background: var(--panel); }
.fc-head .f-name { font-size: 14.5px; font-weight: 600; }
.fc-head .f-desc { font-size: 12px; color: var(--text-3); }
.fc-head .f-ic { font-size: 25px; }
.fc-head .f-temps { font-size: 15px; display: flex; gap: 10px; }
.fc-head .f-chev { color: var(--text-3); transition: transform .2s; }
.fc-day.open .f-chev { transform: rotate(180deg); }
.fc-body { display: none; padding: 0 15px 15px; }
.fc-day.open .fc-body { display: block; }
.fc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fc-stat { padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--stroke); }
.fc-stat .k { font-size: 11.5px; color: var(--text-3); }
.fc-stat b { font-size: 15px; }

.foot { text-align: center; font-size: 12px; color: var(--text-3); padding: 6px 0 2px; }
.foot #relayNote { display: block; margin-top: 3px; opacity: .85; }

/* ---------------- Affichage plein écran ---------------- */
.kiosk { position: fixed; inset: 0; z-index: 60; display: none; overflow: hidden;
  background: var(--bg); color: #eef5ff; }
body.is-kiosk { overflow: hidden; }
body.is-kiosk .kiosk { display: block; }
body.is-kiosk > .app { display: none; }

.k-sky { position: absolute; inset: 0; transition: background 1.2s ease; }
.k-scene { position: absolute; inset: 0; pointer-events: none; }
.k-scene canvas { width: 100%; height: 100%; display: block; }
/* Voile : le texte doit rester lisible quelle que soit l'ambiance */
.k-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(6,12,24,.80) 18%, rgba(6,12,24,.42) 52%, rgba(6,12,24,.62)); }

.k-grid { position: relative; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 16px; padding: 20px clamp(18px, 2.2vw, 40px) clamp(14px, 1.8vh, 26px); overflow: hidden; }
.k-grid > * { min-width: 0; min-height: 0; }
.k-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.k-logo { height: clamp(34px, 3.4vh, 46px); flex: none; }

.k-body { display: grid; gap: clamp(16px, 2vw, 34px); align-items: stretch; min-height: 0;
  /* Colonnes latérales de largeur identique : la colonne centrale, donc
     l'horloge, tombe exactement au milieu de l'écran. */
  grid-template-columns: minmax(320px, 1fr) auto minmax(320px, 1fr); }
.k-body > * { min-width: 0; min-height: 0; }

.k-city { display: flex; align-items: center; gap: 10px; }
.k-city .ic { font-size: clamp(20px, 2vw, 30px); }
.k-city h1 { font-size: clamp(38px, 4.4vw, 74px); line-height: 1; letter-spacing: -.03em;
  text-shadow: 0 4px 26px rgba(0,0,0,.5); }
.k-region { font-size: clamp(14px, 1.2vw, 20px); color: #c6d8ee; margin: 6px 0 clamp(14px, 2.4vh, 34px) 40px; }
.k-now { display: flex; align-items: center; gap: clamp(12px, 1.4vw, 24px); }
.k-ic { font-size: clamp(56px, 6vw, 108px); line-height: 1; filter: drop-shadow(0 10px 26px rgba(0,0,0,.45)); }
.k-temp { font-size: clamp(64px, 7.4vw, 132px); font-weight: 200; line-height: .95; letter-spacing: -.04em; }
.k-cond { font-size: clamp(18px, 1.7vw, 30px); font-weight: 600; margin-top: 2px; }
.k-feel { display: flex; align-items: baseline; gap: 8px; margin-top: clamp(10px, 1.6vh, 22px);
  font-size: clamp(14px, 1.15vw, 20px); color: #dceaf9; }
.k-feel b:last-child { color: #fff; }
.k-summary { margin-top: 10px; max-width: 30ch; font-size: clamp(13px, 1.05vw, 18px);
  line-height: 1.5; color: #c6d8ee; }
.k-minmax { display: flex; gap: 10px; margin-top: clamp(12px, 2vh, 26px); }
.k-minmax > div { flex: 1; max-width: 170px; padding: 10px 16px; border-radius: 14px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.k-minmax span { font-size: clamp(17px, 1.6vw, 26px); }
.k-minmax .up { color: var(--hot); } .k-minmax .down { color: var(--cold); }
.k-minmax b { color: #fff; }
.k-minmax small { display: block; margin-top: 2px; font-size: 11.5px; color: #a9bdd4; }

.k-center { text-align: center; padding-top: clamp(4px, 2vh, 30px); }
.k-clock { display: flex; align-items: baseline; justify-content: center; gap: 10px;
  font-size: clamp(56px, 8.2vw, 168px); font-weight: 200; line-height: .92; letter-spacing: -.05em;
  white-space: nowrap;
  color: var(--clock); font-variant-numeric: tabular-nums; text-shadow: 0 8px 40px rgba(0,0,0,.35);
  transition: color .7s ease; }
.k-clock .k-sec { font-size: .28em; font-weight: 400; letter-spacing: -.01em; opacity: .8; }
.k-clock .k-sec[hidden] { display: none; }
.k-date { margin-top: 6px; font-size: clamp(14px, 1.3vw, 23px); color: #c6d8ee; text-transform: capitalize; }

.k-panel { position: relative; display: flex; flex-direction: column;
  justify-self: end; width: min(100%, clamp(340px, 27vw, 440px)); }
.k-exit { white-space: nowrap; flex: none;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border-radius: 13px;
  font-size: 13.5px; cursor: pointer; color: #dceaf9;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); }
.k-exit:hover { background: rgba(255,255,255,.14); }
/* Vigilance : posée au-dessus des sept jours, bordée par la gravité */
.k-alert { flex: none; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px;
  padding: clamp(10px, 1.1vw, 15px) clamp(12px, 1.2vw, 17px); border-radius: 18px;
  background: rgba(10,18,32,.55); border: 1px solid rgba(255,255,255,.12);
  border-left-width: 4px; backdrop-filter: blur(16px); }
.k-alert[data-sev="0"] { border-left-color: var(--green); }
.k-alert[data-sev="1"] { border-left-color: var(--green); }
.k-alert[data-sev="2"] { border-left-color: var(--amber); }
.k-alert[data-sev="3"] { border-left-color: var(--warm); }
.k-alert[data-sev="4"] { border-left-color: var(--danger); }
.k-alert-ic { font-size: clamp(20px, 1.7vw, 28px); line-height: 1.1; }
.k-alert-k { font-size: clamp(11px, .85vw, 13.5px); color: #a9bdd4; }
.k-alert b { display: block; margin: 1px 0 3px; font-size: clamp(15px, 1.25vw, 21px); }
.k-alert p { font-size: clamp(11.5px, .92vw, 15px); line-height: 1.45; color: #c2d4e8; }

.k-card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(14px, 1.5vw, 22px); border-radius: 20px;
  background: rgba(10,18,32,.55); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); }
.k-card h2 { font-size: clamp(16px, 1.3vw, 22px); margin-bottom: 8px; }

.k-days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  flex: 1; min-height: 0; justify-content: space-evenly; }
.k-days li { display: grid; grid-template-columns: 108px 26px 38px 1fr 38px 62px; align-items: center;
  gap: 8px; padding: clamp(4px, .8vh, 11px) 2px; font-size: clamp(12.5px, 1.02vw, 17px); }
.k-days li + li { border-top: 1px solid rgba(255,255,255,.06); }
.k-days .kd-name { color: #cfdff0; }
.k-days .today .kd-name { color: #fff; font-weight: 650; }
.k-days .kd-name i { display: block; font-style: normal; font-size: .8em; color: #9fb4cc; font-weight: 400; }
.k-days .kd-ic { font-size: 1.25em; text-align: center; }
.k-days .kd-min, .k-days .kd-max { font-style: normal; text-align: right; }
.k-days .kd-min { color: var(--cold); } .k-days .kd-max { color: #fff; font-weight: 600; }
.k-days .kd-pop { text-align: right; color: #9fb4cc; white-space: nowrap; }
.k-days .kd-pop.wet { color: var(--accent-2); }

.k-releves { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.k-stat { display: flex; align-items: center; gap: 9px; padding: clamp(7px, .9vh, 12px) 12px;
  border-radius: 14px; min-width: 0;
  background: rgba(10,18,32,.55); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); }
.k-stat > div { min-width: 0; }
.k-stat .ic { font-size: clamp(16px, 1.3vw, 21px); }
.k-stat .k { font-size: clamp(10.5px, .78vw, 13px); color: #a9bdd4; line-height: 1.25; }
.k-stat b { font-size: clamp(15px, 1.2vw, 21px); white-space: nowrap; display: block; }
/* Seconde ligne d'une tuile : unité, secteur de vent ou appréciation */
.k-stat .k-sub { display: block; margin-top: 2px; font-size: .62em; font-weight: 500;
  letter-spacing: 0; color: #c2d4e8; }
.k-stat .k-sub .tag { margin-left: 5px; vertical-align: 1px; font-size: 10.5px; padding: 1px 6px; }

.k-hours { padding: clamp(10px, 1.4vh, 18px) clamp(12px, 1.2vw, 20px); border-radius: 20px;
  background: rgba(10,18,32,.55); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); }
.k-hours-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.k-hours-head h2 { font-size: clamp(15px, 1.2vw, 20px); }
.k-hours-head .sub { font-size: 12.5px; color: #a9bdd4; }
.k-hours-head .tabs { margin-left: auto; }
.k-hours .hour-strip { gap: 8px; overflow-x: auto; }
.k-hours .hour { width: clamp(62px, 5.4vw, 92px); background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10); }
.k-hours .hour.is-now { background: linear-gradient(180deg, var(--accent-soft), rgba(255,255,255,.05)); }
.k-hours .hour .h-t { color: #b9cde6; }
.k-hours .hour .h-ic { font-size: clamp(20px, 1.8vw, 28px); }
.k-hours .hour .h-v { font-size: clamp(15px, 1.25vw, 21px); }

@media (max-width: 1100px) {
  .k-body { grid-template-columns: 1fr; }
  .k-center { text-align: left; }
  .k-clock { justify-content: flex-start; }
  .k-exit { padding: 8px 12px; font-size: 12.5px; }
}

/* ---------------- Toast / loader ---------------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(14px);
  padding: 11px 17px; border-radius: 13px; background: var(--panel-solid); border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow); font-size: 13.5px; z-index: 90; opacity: 0; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.loader { position: fixed; inset: 0; background: rgba(6,11,20,.45); display: grid; place-items: center; z-index: 80; backdrop-filter: blur(2px); }
.loader[hidden] { display: none; }
.spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--stroke-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }

.skeleton { position: relative; overflow: hidden; background: var(--panel-2); border-radius: var(--r); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); animation: sweep 1.4s infinite; }
@keyframes sweep { to { transform: translateX(100%); } }

/* ---------------- Responsive ---------------- */
@media (max-width: 1400px) {
  .row-3 { grid-template-columns: 1fr 1fr; }
  .row-3 .radar { grid-column: 1 / -1; }
  .row-3 .radar .radar-wrap { aspect-ratio: 24 / 9; max-height: 260px; }
  .row-chart { grid-template-columns: 1.4fr 1fr; }
  .row-chart .mini-col:last-child { grid-column: 1 / -1; flex-direction: row; }
  .row-chart .mini-col:last-child > * { flex: 1; }
}
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid::before { background: linear-gradient(180deg, rgba(8,14,26,.72), rgba(8,14,26,.86)); }
  .row-3, .row-chart, .row-2 { grid-template-columns: 1fr; }
  .row-3 .radar, .row-chart .mini-col:last-child { grid-column: auto; }
  .row-chart .mini-col { flex-direction: row; }
  .row-chart .mini-col > * { flex: 1; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-102%); transition: transform .24s ease; }
  .sidebar.open { transform: none; }
  .sidebar-close, .menu-btn { display: grid; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(4,8,16,.6); opacity: 0; pointer-events: none; transition: opacity .24s; z-index: 35; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .content { padding: 4px 13px 22px; }
  .topbar { padding: 12px 13px; }
  .hide-sm { display: none; }
  .city { font-size: 30px; } .temp { font-size: 52px; } .big-ic { font-size: 56px; }
  .temp-row { flex-wrap: wrap; }
  .hero-clock { margin: 6px 0 0; width: 100%; font-size: 46px; }
  .hero-right { grid-template-columns: 1fr; }
  .sun, .stat-grid { grid-column: 1; grid-row: auto; }
  .row-chart .mini-col { flex-direction: column; }
  .fc-head { grid-template-columns: 1fr auto auto; }
  .fc-head .f-ic { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
