:root {
  --fond: #f6f1ea;
  --carte: #fffdf9;
  --encre: #17282e;
  --doux: #5b6d73;
  --trait: #e5dccf;
  --petrole: #1f4e5a;
  --petrole-nuit: #123a44;
  --or: #c9a227;
  --vert: #2e9e6b;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0e1b20;
    --carte: #16262c;
    --encre: #f0ebe2;
    --doux: #9db0b6;
    --trait: #27393f;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--fond);
  color: var(--encre);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.ecran-entree {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  color: #fff;
  background: radial-gradient(120% 80% at 80% 0%, #2c6c7a 0%, var(--petrole-nuit) 62%);
}

.marque {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: var(--or);
  font: 700 46px/1 Georgia, "Times New Roman", serif;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.5);
}

.ecran-entree h1 { margin: 12px 0 0; font-size: 34px; letter-spacing: -0.02em; }
.ecran-entree p { margin: 0; color: rgba(255, 255, 255, 0.78); font-size: 17px; line-height: 1.4; }

.principal {
  margin-top: 24px;
  width: 100%;
  max-width: 340px;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  color: var(--petrole-nuit);
  background: linear-gradient(135deg, #e0bd4a, var(--or));
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
}

.principal:disabled { opacity: 0.6; }
.message { min-height: 22px; font-size: 15px !important; }

.accueil {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
}

.bandeau {
  margin: 0 -16px;
  padding: calc(18px + env(safe-area-inset-top)) 20px 44px;
  color: #fff;
  background: radial-gradient(120% 110% at 90% 0%, #2c6c7a 0%, var(--petrole-nuit) 65%);
  border-radius: 0 0 28px 28px;
}

.bandeau-haut { display: flex; justify-content: space-between; align-items: center; }
.sur-titre { color: var(--or); font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.bandeau h1 { margin: 16px 0 2px; font-size: 30px; letter-spacing: -0.02em; }
.bandeau p { margin: 0; color: rgba(255, 255, 255, 0.75); font-size: 15px; }

.direct {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
}

.direct::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #d8a23a; }
.direct[data-etat="ok"]::before { background: #4fd18f; box-shadow: 0 0 0 0 rgba(79, 209, 143, 0.7); animation: pouls 2.4s infinite; }

@keyframes pouls { to { box-shadow: 0 0 0 10px rgba(79, 209, 143, 0); } }
@media (prefers-reduced-motion: reduce) { .direct::before { animation: none !important; } }

.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: -26px; }
.chiffres article, .carte, .conseil {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 18px;
}
.chiffres article { padding: 14px 12px; }
.chiffres strong { display: block; font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.chiffres span { color: var(--doux); font-size: 13px; }

.conseil { margin-top: 12px; padding: 14px 16px; font-size: 15px; line-height: 1.4; }
.carte { margin-top: 12px; padding: 16px; }
.carte h2 { margin: 0 0 8px; font-size: 17px; }

.fil { margin: 0; padding: 0; list-style: none; }
.fil li { padding: 11px 0; border-top: 1px solid var(--trait); font-size: 15px; line-height: 1.35; }
.fil li:first-child { border-top: 0; }
.fil li.nouveau { animation: arrivee 1.4s ease-out; }
.fil b { font-weight: 600; }
.fil time { display: block; color: var(--doux); font-size: 13px; }
.fil .vide { color: var(--doux); }

@keyframes arrivee { from { background: rgba(201, 162, 39, 0.28); } to { background: transparent; } }

.discret {
  display: block;
  margin: 20px auto 0;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--doux);
  font: inherit;
  font-size: 15px;
}
