:root {
  --bleu: #0066cc;
  --bleu-fonce: #0057ad;
  --bleu-pale: #e6f0fb;
  --jaune: #ffcc00;
  --encre: #0d1b2e;
  --texte: #2d3a4c;
  --gris: #5b6778;
  --trait: #dce2ea;
  --fond: #f3f5f9;
  --carte: #ffffff;
  --vert: #0a7a3d;
  --vert-pale: #e3f5ea;
  --rouge: #b42318;
  --rouge-pale: #fde8e6;
  --titre: 'Barlow Condensed', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond);
  color: var(--encre);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--bleu-fonce); }

#appli { display: flex; flex-direction: column; height: 100%; max-width: 640px; margin: 0 auto; background: var(--fond); }

/* ── En-tête ── */
.entete {
  background: var(--bleu); color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.logo {
  width: 42px; height: 42px; border-radius: 50%; background: var(--jaune); color: #0a3d7a;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--titre); font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.titres { flex: 1; min-width: 0; }
.entete h1 { margin: 0; font-family: var(--titre); font-weight: 700; font-size: 24px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sous-titre { font-size: 13px; opacity: .85; margin-top: 3px; }
.retour, .btn-profil {
  width: 44px; height: 44px; border: none; border-radius: 12px; background: rgba(255,255,255,.14);
  color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.retour { background: transparent; margin-left: -8px; width: 36px; }
.retour[hidden] { display: none; }
.retour[hidden] + .logo { display: flex; }
.retour:not([hidden]) + .logo { display: none; }

/* ── Contenu ── */
#contenu { flex: 1; overflow-y: auto; min-height: 0; padding: 16px; outline: none; -webkit-overflow-scrolling: touch; }
.pile { display: flex; flex-direction: column; gap: 12px; }

.carte { background: var(--carte); border-radius: 16px; padding: 16px; box-shadow: 0 1px 2px rgba(13,27,46,.06); }
.carte h2 { margin: 0; font-family: var(--titre); font-weight: 700; font-size: 22px; line-height: 1.15; }
.carte p { margin: 6px 0 0; line-height: 1.45; color: var(--texte); }
.meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.etiquette { background: var(--bleu-pale); color: var(--bleu-fonce); font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .4px; }
.etiquette.jaune { background: var(--jaune); color: var(--encre); }
.etiquette.rouge { background: var(--rouge-pale); color: var(--rouge); }
.etiquette.vert { background: var(--vert-pale); color: var(--vert); }
.discret { font-size: 13px; color: var(--gris); }
.pied-carte { display: flex; gap: 16px; font-size: 14px; color: var(--gris); border-top: 1px solid #eef1f5; padding-top: 10px; margin-top: 12px; }
.pied-carte a { margin-left: auto; font-weight: 700; text-decoration: none; }

/* ── Bandeau d'alerte (sortie modifiée / annulée) ── */
.bandeau { display: flex; gap: 12px; align-items: flex-start; background: var(--encre); color: #fff; border-radius: 16px; padding: 14px 16px; text-decoration: none; }
.bandeau-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--jaune); color: var(--encre); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bandeau.annule .bandeau-ico { background: #ff6b5e; }
.bandeau-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bandeau-txt strong { font-size: 15px; line-height: 1.3; }
.bandeau-txt span { font-size: 14px; opacity: .8; }
.bandeau-txt em { font-style: normal; font-weight: 700; font-size: 14px; color: var(--jaune); margin-top: 8px; }

/* ── Liste des sorties ── */
.sortie {
  display: flex; gap: 14px; align-items: stretch; text-decoration: none; color: inherit;
  background: var(--carte); border-radius: 16px; padding: 14px; box-shadow: 0 1px 2px rgba(13,27,46,.06);
}
.sortie.annulee { opacity: .7; }
.pave-date {
  width: 58px; flex-shrink: 0; background: var(--bleu); color: #fff; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0;
}
.pave-date.sans { background: #8a96a8; }
.pave-date .j { font-size: 12px; font-weight: 700; letter-spacing: .6px; }
.pave-date .n { font-family: var(--titre); font-weight: 700; font-size: 30px; line-height: 1; }
.pave-date .m { font-size: 12px; font-weight: 600; opacity: .85; }
.sortie-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sortie-titre { font-family: var(--titre); font-weight: 700; font-size: 21px; line-height: 1.1; }
.sortie-bas { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--texte); }
.filtres { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filtre { border: 1px solid var(--trait); background: var(--carte); color: var(--texte); font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 999px; white-space: nowrap; cursor: pointer; min-height: 40px; }
.filtre[aria-pressed="true"] { background: var(--encre); color: #fff; border-color: var(--encre); }

/* ── Fiche sortie ── */
.surtitre { font-size: 13px; font-weight: 700; color: var(--bleu-fonce); text-transform: uppercase; letter-spacing: .4px; }
.grand-titre { margin: 4px 0 0; font-family: var(--titre); font-weight: 700; font-size: 30px; line-height: 1.05; }
.alerte { border-radius: 14px; padding: 12px 14px; font-weight: 600; line-height: 1.4; }
.alerte.jaune { background: #fff4c2; color: #5c4700; }
.alerte.rouge { background: var(--rouge-pale); color: var(--rouge); }
.grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.case { background: var(--carte); border-radius: 12px; padding: 12px; }
.case .l { font-size: 13px; color: var(--gris); }
.case .v { font-weight: 700; font-size: 17px; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { background: var(--carte); border: 1px solid var(--trait); font-size: 14px; font-weight: 500; padding: 5px 10px; border-radius: 999px; }
.puce.moi { border-color: var(--bleu); color: var(--bleu-fonce); font-weight: 700; }
.lien-carte { display: flex; gap: 10px; align-items: center; background: var(--carte); border-radius: 12px; padding: 12px; text-decoration: none; color: inherit; font-weight: 600; }

/* ── Boutons ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 54px; border-radius: 14px; border: none; font-weight: 700; font-size: 17px;
  cursor: pointer; text-decoration: none;
}
.btn.principal { background: var(--jaune); color: var(--encre); }
.btn.bleu { background: var(--bleu); color: #fff; }
.btn.contour { background: var(--carte); color: var(--encre); border: 2px solid var(--encre); }
.btn.leger { background: transparent; color: var(--bleu-fonce); min-height: 44px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.collant { position: sticky; bottom: -16px; background: linear-gradient(transparent, var(--fond) 30%); padding: 18px 0 16px; margin-bottom: -16px; }

/* ── Formulaires ── */
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label { font-weight: 600; font-size: 14px; }
.champ input, .champ select, .champ textarea {
  min-height: 48px; border: 1px solid #cfd7e2; border-radius: 12px; padding: 10px 14px;
  background: var(--carte); font-size: 16px; width: 100%;
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: 3px solid rgba(0,102,204,.25); border-color: var(--bleu); }
.case-a-cocher { display: flex; gap: 10px; align-items: center; font-weight: 600; min-height: 44px; }
.case-a-cocher input { width: 22px; height: 22px; }
.erreur { color: var(--rouge); font-weight: 600; }

/* ── Discussions ── */
.salon-tete { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.salon-ini { width: 44px; height: 44px; border-radius: 12px; background: var(--bleu-pale); color: var(--bleu-fonce); display: flex; align-items: center; justify-content: center; font-family: var(--titre); font-weight: 700; font-size: 20px; flex-shrink: 0; }
.salon-nom { font-weight: 700; font-size: 17px; }
.fil { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #eef1f5; text-decoration: none; color: inherit; font-size: 15px; }
.fil:first-of-type { margin-top: 10px; }
.fil .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Onglets bas ── */
.onglets {
  flex-shrink: 0; background: var(--carte); border-top: 1px solid #e3e8ef;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
}
.onglets a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 54px; font-size: 13px; font-weight: 700; color: #6b7686; text-decoration: none;
}
.onglets a[aria-current="page"] { color: var(--bleu); }

/* ── Divers ── */
.vide { text-align: center; color: var(--gris); padding: 40px 16px; line-height: 1.5; }
.chargement { display: flex; flex-direction: column; gap: 12px; }
.chargement div { height: 96px; border-radius: 16px; background: linear-gradient(90deg, #e9edf3, #f6f8fb, #e9edf3); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
#toast {
  position: fixed; left: 50%; top: calc(84px + env(safe-area-inset-top)); transform: translateX(-50%);
  background: var(--encre); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 10;
}
.astuce { background: var(--bleu-pale); color: #0a3d7a; border-radius: 14px; padding: 14px; line-height: 1.45; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .chargement div { animation: none; } }

/* ── Club : campagnes, tenues, adhésion ── */
.campagne { display: block; background: var(--bleu); color: #fff; border-radius: 16px; padding: 14px 16px; text-decoration: none; }
.campagne .bandeau-txt span { opacity: .9; }
.titre-section { font-family: var(--titre); font-weight: 700; font-size: 22px; margin: 10px 0 0; }
.article { display: flex; flex-direction: column; gap: 12px; }
.article-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.prix { font-family: var(--titre); font-weight: 700; font-size: 22px; color: var(--bleu-fonce); white-space: nowrap; }
.article-choix { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.demande { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #eef1f5; }
.demande:first-child { border-top: none; }
.btn-mini { border: 1px solid var(--trait); background: var(--carte); border-radius: 10px; min-height: 36px; padding: 0 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.choix-groupe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.choix { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--trait); border-radius: 12px; padding: 12px; cursor: pointer; line-height: 1.3; }
.choix:has(input:checked) { border-color: var(--bleu); background: var(--bleu-pale); }
.choix input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; }

/* ── Appli réservée aux adhérents : pas d'onglets tant que l'accès n'est pas complet ── */
.sans-nav .onglets { display: none; }

/* Date de la sortie sur une annonce */
.date-annonce { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px; border-radius: 10px;
                background: var(--jaune); color: var(--encre); font-weight: 700; font-size: 15px; }
.date-annonce.passee { background: #eef1f5; color: var(--gris); }
.date-annonce.annulee { background: var(--rouge-pale); color: var(--rouge); text-decoration: line-through; }
