:root {
  --bg: #111214;
  --card: #1b1c1f;
  --accent: #7fb0ff;
  --txt: #e8eaf0;
  --muted: #8b93a3;
  --line: #2a2d34;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.bar {
  position: sticky; top: 0; z-index: 9;
  background: rgba(17, 18, 20, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar-in {
  max-width: 640px; margin: 0 auto; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
main { max-width: 640px; margin: 0 auto; padding: 12px 14px 44px; }
h2 { font-size: 14px; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.source { margin-top: 22px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 11px; min-width: 106px;
}
.chip b { font-size: 16px; display: block; letter-spacing: -0.2px; }
.chip span { color: var(--muted); font-size: 10.5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
/* les graphiques touchent le haut de la carte (traits de semaine jusqu'en haut) */
.card.chart { padding-top: 0; }
.chart svg { display: block; width: 100%; height: auto; }
.leg { font-size: 11px; color: var(--muted); margin: 6px 0 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin: 0 3px 0 10px; vertical-align: middle; }
.dot:first-child { margin-left: 0; }
.dot.accent { background: var(--accent); }
.dot.dim { background: #39404e; }
table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
th, td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Sélecteur de plateforme (Tout / iOS / Android) */
.seg {
  display: flex; gap: 6px; margin: 10px 0 2px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; width: max-content;
}
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.2px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seg button.on { background: var(--accent); color: #10131a; }

/* Ligne « aujourd'hui » du tableau (journée en cours, hors graphs) */
#tbl tr.today td {
  color: var(--accent); font-weight: 600;
  background: rgba(127, 176, 255, 0.08);
}
#tbl tr.today td span { font-weight: 400; }

/* Dernier jour de la fenêtre : en consolidation (latence GA4 ~24 h) */
#tbl tr.conso td { color: var(--muted); }

/* K61 — la porte de connexion (auth.js bascule l'overlay). */
.gate {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  /* opaque : avant connexion, RIEN du tableau de bord ne transparaît */
  background: var(--bg);
  padding: 24px;
}
.gate[hidden] { display: none; }
.gate-card {
  width: 100%; max-width: 320px; text-align: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px 18px;
}
.gate-card b { display: block; margin-bottom: 6px; }
.gate-card button {
  margin-top: 12px; width: 100%;
  padding: 11px 14px; border-radius: 10px; border: 0;
  background: var(--accent); color: #0b0c0e;
  font: inherit; font-weight: 600;
}
.gate-card button:active { opacity: 0.85; }
#gateMsg:empty { display: none; }
