:root {
  --bg: #0d1117; --fg: #e6edf3; --mut: #8b949e; --bdr: #30363d;
  /* final-evidence-test-2026-08-11-2056 */
  --acc: #58a6ff; --ok: #3fb950; --warn: #d29922; --bad: #f85149;
  --card: #161b22;
  --skeleton: #21262d;
  --skeleton-shine: #2d333b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--fg);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
header {
  background: linear-gradient(135deg, #0d1117 0%, #1f2937 100%);
  padding: 24px 20px; border-bottom: 1px solid var(--bdr);
  text-align: center;
}
h1 { margin: 0; font-size: 1.6em; }
.subtitle { color: var(--mut); font-size: 0.9em; margin-top: 4px; }
main { max-width: 1200px; margin: 0 auto; padding: 20px; }
section {
  background: var(--card); border: 1px solid var(--bdr); border-radius: 8px;
  padding: 16px; margin-bottom: 16px;
  animation: fadeIn 0.4s ease-out both;
}
section:nth-child(2) { animation-delay: 0.05s; }
section:nth-child(3) { animation-delay: 0.1s; }
section:nth-child(4) { animation-delay: 0.15s; }
section:nth-child(5) { animation-delay: 0.2s; }
section:nth-child(6) { animation-delay: 0.25s; }
section:nth-child(7) { animation-delay: 0.3s; }
section:nth-child(8) { animation-delay: 0.35s; }
section:nth-child(9) { animation-delay: 0.4s; }
section:nth-child(10) { animation-delay: 0.45s; }
h2 { margin-top: 0; font-size: 1.2em; color: var(--acc); }
h3 { font-size: 1em; margin: 8px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--bdr); }
th { background: var(--bg); color: var(--mut); font-weight: 600; }
.kpi {
  display: inline-block; background: var(--card); padding: 8px 14px;
  border-radius: 6px; margin: 4px; border: 1px solid var(--bdr);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--acc); }
.bad { color: var(--bad); } .warn { color: var(--warn); } .ok { color: var(--ok); }
.na { color: var(--mut); }
.indice-1 { color: #50cc50; } .indice-2 { color: #cccc00; } .indice-3 { color: #ff8800; } .indice-4 { color: #ff0000; } .indice-5 { color: #800080; }
#map { height: 420px; border-radius: 6px; border: 1px solid var(--bdr); }
.tab-row { cursor: pointer; transition: background 0.15s ease; }
.tab-row:hover { background: rgba(88, 166, 255, 0.08); }
.small { color: var(--mut); font-size: 0.85em; }
.row-loading { color: var(--mut); font-style: italic; }
.skeleton-row td {
  padding: 8px;
}
.skeleton-bar {
  display: inline-block;
  height: 12px;
  width: 80%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 50%, var(--skeleton) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton-bar.short { width: 40%; }
.skeleton-bar.medium { width: 60%; }
#filters { margin-bottom: 12px; }
#filters input {
  background: var(--bg); color: var(--fg); border: 1px solid var(--bdr);
  padding: 6px 10px; border-radius: 4px;
  transition: border-color 0.2s ease;
}
#filters input:focus { outline: none; border-color: var(--acc); }
footer { color: var(--mut); font-size: 0.85em; border-top: 1px solid var(--bdr); margin-top: 40px; padding: 16px 20px; }
a { color: var(--acc); }

/* === Phase 1 brief matinal ===
   Mobile-first, glanceable. Hero en haut, 3 jours, timeline horaire.
   Chiffres tabulaires (font-variant-numeric) pour alignement. */
#brief { max-width: 720px; margin: 0 auto 32px; }
.brief-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.brief-commune { display: flex; align-items: center; gap: 8px; }
.brief-commune #brief-commune-name { font-size: 1.1em; font-weight: 600; }
.brief-commune button, .brief-notif-btn {
  background: var(--card); border: 1px solid var(--bdr); color: var(--fg);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 1em; line-height: 1;
}
.brief-commune button:hover, .brief-notif-btn:hover { border-color: var(--acc); }
#brief-city-select { background: var(--card); color: var(--fg); border: 1px solid var(--bdr); border-radius: 8px; padding: 6px; }

.brief-hero {
  background: linear-gradient(160deg, var(--card), #1c2330);
  border: 1px solid var(--bdr); border-radius: 16px; padding: 20px;
  font-variant-numeric: tabular-nums;
}
.brief-hero.skeleton { min-height: 160px; }
.brief-hero-main { display: flex; align-items: center; gap: 14px; }
.brief-temp { font-size: 3.4em; font-weight: 300; line-height: 1; }
.brief-icon { font-size: 2.6em; }
.brief-hero-sub { color: var(--mut); margin: 10px 0 14px; font-size: 0.98em; }
.brief-clothing { background: rgba(88,166,255,0.08); border: 1px solid rgba(88,166,255,0.25); border-radius: 10px; padding: 10px 12px; font-size: 0.95em; margin-bottom: 10px; }
.brief-air { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brief-air-pill {
  background: var(--atmo-color); color: #0d1117; font-weight: 700;
  padding: 3px 12px; border-radius: 999px; font-size: 0.9em;
  border: 2px solid rgba(255,255,255,0.15); /* bordure pour daltoniens (WCAG 1.4.1) */
}
.brief-air-meta { color: var(--mut); font-size: 0.88em; }
.brief-alerts { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.brief-alert { background: rgba(248,81,73,0.12); border-left: 3px solid var(--bad); border-radius: 6px; padding: 8px 10px; font-size: 0.9em; }
.brief-alert-uv { background: rgba(210,153,34,0.12); border-left-color: var(--warn); }
.brief-alert-vent { background: rgba(88,166,255,0.12); border-left-color: var(--acc); }
.brief-alert-gel { background: rgba(88,166,255,0.12); border-left-color: var(--acc); }
.brief-alert-air { background: rgba(248,81,73,0.12); border-left-color: var(--bad); }

.brief-section-title { font-size: 1em; color: var(--mut); margin: 24px 0 10px; font-weight: 600; }
.brief-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.brief-day { background: var(--card); border: 1px solid var(--bdr); border-radius: 12px; padding: 14px 8px; text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; user-select: none; }
.brief-day:hover { border-color: var(--acc); background: #1a2230; }
.brief-day:active { transform: scale(.97); }
.brief-day:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.brief-day.brief-day-today { border-color: var(--acc); }
.brief-day.active { border-color: var(--acc); background: #1a2230; box-shadow: 0 0 0 2px var(--acc); }
.brief-atmo-none { color: var(--mut); font-size: 0.85em; }
.brief-day-label { font-size: 0.82em; color: var(--mut); font-weight: 600; }
.brief-day-icon { font-size: 1.8em; margin: 4px 0; }
.brief-day-temp { display: flex; justify-content: center; gap: 6px; font-size: 1.05em; }
.brief-day-air { display: inline-block; margin-top: 6px; background: var(--atmo-color); color: #0d1117; font-size: 0.72em; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.brief-day-rain { font-size: 0.78em; color: var(--acc); margin-top: 4px; }

.brief-hours-wrap { margin-top: 24px; }
.brief-hours { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; font-variant-numeric: tabular-nums; scrollbar-width: thin; }
.brief-hour { min-width: 52px; text-align: center; background: var(--card); border: 1px solid var(--bdr); border-radius: 10px; padding: 8px 4px; }
.brief-hour-h { font-size: 0.78em; color: var(--mut); }
.brief-hour-icon { font-size: 1.3em; margin: 2px 0; }
.brief-hour-t { font-size: 1em; font-weight: 600; }
.brief-hour-rain { font-size: 0.68em; color: var(--acc); }

/* Pollen (Phase 3) */
.brief-pollen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.brief-pollen-label { font-size: 0.85em; color: var(--mut); }
.brief-pollen-chip { background: var(--pollen-color); color: #0d1117; font-size: 0.78em; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.15); }
.brief-pollen-none { font-size: 0.8em; color: var(--mut); }
.brief-day-pollen { font-size: 0.74em; margin-top: 3px; font-weight: 600; }
.brief-alert-pollen { background: rgba(128,0,128,0.12); border-left-color: #800080; }

@media (max-width: 520px) {
  .brief-temp { font-size: 2.8em; }
  .brief-icon { font-size: 2.2em; }
  .brief-day { padding: 10px 4px; }
}
/* Phase 3.3 — Accessibility / polish */
/* Daltonisme (WCAG 1.4.1) : la couleur seule ne suffit pas, on ajoute une bordure
   contrastée aux pastilles ATMO pour distinguer les niveaux sans la couleur. */
.atmo-pill { display: inline-block; padding: 3px 12px; border-radius: 12px;
  border: 2px solid rgba(0,0,0,0.35); font-weight: 600; font-size: 0.9em; }
/* Respect des préférences motion réduite (WCAG 2.3.3) : on neutralise les animations. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton-bar { background: var(--skeleton); }
  @keyframes skeleton-shine { from { background: var(--skeleton); } to { background: var(--skeleton-shine); } }
}
/* Chiffres tabulaires pour toutes les valeurs mesurées (alignement colonnes). */
.cell.val, .kpi-value, .brief-temp, .brief-day-temp, .brief-hour-temp,
.brief-hour-h { font-variant-numeric: tabular-nums; }
}