/* Ambre web : identite visuelle (bleu nuit, ambre), trois mises en page. */
@font-face { font-family: "Manrope"; src: url(/polices/manrope.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Sora"; src: url(/polices/sora-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --nuit: #0b111c; --nuit-2: #080d16; --surface: #121a29; --surface-2: #161f30; --surface-3: #1a2336;
  --trait: #1e2a3f; --trait-2: #2c3a55;
  --texte: #EAEFF7; --texte-2: #C3CCDA; --discret: #94A3B8; --discret-2: #6B7890;
  --ambre: #EF9F27; --ambre-fonce: #c9862c; --ambre-sur: #1a1205; --ambre-clair: #F3D9A8; --ambre-fond: #1d1708; --ambre-trait: #4a3410;
  --rouge: #E5534B; --rouge-clair: #F08A84; --vert: #3DD68C; --vert-clair: #7EE2A8; --vert-fond: #12261d; --bleu: #6FA8F5; --violet: #B78CF2;
  --rayon: 20px; --bas: env(safe-area-inset-bottom, 0px); --haut: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--nuit); color: var(--texte); font-family: Manrope, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--ambre); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--ambre); outline-offset: 2px; border-radius: 8px; }
.cache { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Coquille et navigation ---------- */
.coquille { display: flex; min-height: 100dvh; }
.principal { flex: 1; min-width: 0; padding: calc(var(--haut) + 22px) 20px calc(var(--bas) + 96px); display: flex; flex-direction: column; gap: 20px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 8px 24px calc(var(--bas) + 8px); background: rgba(14, 21, 34, .94); border-top: 1px solid var(--trait);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.nav-tete, .nav-collection, .nav-titre, .nav-pied { display: none; }
.onglet { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 72px; min-height: 48px; justify-content: center;
  border: 0; background: none; border-radius: 14px; color: var(--discret); font-size: 11px; font-weight: 700; }
.onglet[aria-current="page"] { color: var(--ambre); }

.marque { font-family: Sora, Manrope, sans-serif; font-weight: 700; color: var(--ambre); letter-spacing: -.5px; font-size: 34px; line-height: 1.1; }
.devise { font-size: 14px; color: var(--discret); }
.entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pastille { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pastille i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.p-veille { background: var(--vert-fond); color: var(--vert-clair); } .p-veille i { background: var(--vert); }
.p-coupe { background: #2a1d06; color: var(--ambre-clair); } .p-coupe i { background: var(--ambre); }
.p-off { background: var(--surface-3); color: #A9B4C6; } .p-off i { border: 1.5px solid #A9B4C6; }

/* ---------- Elements communs ---------- */
.carte { border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--trait); }
.titre-2 { font-size: 20px; font-weight: 800; letter-spacing: -.2px; }
.titre-1 { font-size: 30px; font-weight: 800; letter-spacing: -.4px; }
.retour { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; align-self: flex-start; border: 0; background: none; color: var(--ambre); font-size: 16px; font-weight: 600; padding: 0; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 16px; border: 0;
  background: var(--ambre); color: var(--ambre-sur); font-size: 16px; font-weight: 800; text-align: center; }
.bouton:disabled { opacity: .55; cursor: default; }
.bouton-2 { background: var(--surface-2); color: var(--texte); border: 1px solid var(--trait-2); }
.lien-bouton { border: 0; background: none; color: var(--ambre); font-weight: 700; font-size: 14px; min-height: 44px; }
.avis { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; font-size: 13px; line-height: 1.5; }
.avis-ambre { background: var(--ambre-fond); border: 1px solid var(--ambre-trait); color: var(--ambre-clair); }
.avis-ambre strong { color: #FFE7B8; }
.avis-info { background: var(--surface); border: 1px solid var(--trait); color: var(--texte-2); }
.avis-info strong { color: var(--texte); }
.avis-erreur { background: #2a0f0d; border: 1px solid #5a1f1b; color: #F6B5B0; }

/* Espace utilise */
.espace { display: flex; flex-direction: column; gap: 12px; padding: 16px; color: var(--texte); border: 1px solid var(--trait); background: var(--surface); border-radius: var(--rayon); text-align: left; width: 100%; }
.espace-ligne { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; color: var(--discret); }
.espace-ligne strong { font-size: 17px; color: var(--texte); }
.jauge { height: 8px; border-radius: 999px; background: var(--trait); overflow: hidden; display: flex; gap: 2px; }
.jauge > i { display: block; height: 100%; background: var(--ambre); border-radius: 999px; }
.urgent { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #F3C77B; }

/* Ma collection */
.rubriques { overflow: hidden; }
.rubrique { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; border: 0; background: none; text-align: left; color: var(--texte); min-height: 64px; }
.rubrique + .rubrique { border-top: 1px solid var(--trait); }
.rubrique .nom { flex: 1; font-size: 16px; font-weight: 700; }
.rubrique .nb { font-size: 15px; font-weight: 700; color: var(--discret); }
.carre { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.c-vu { background: var(--ambre-fonce); color: var(--ambre-sur); }
.c-sup { background: var(--rouge); color: #2a0b09; }
.c-st { background: var(--texte); color: var(--nuit); }
.exemple { padding: 2px 7px; border-radius: 6px; border: 1px solid #33415c; font-size: 10px; font-weight: 800; letter-spacing: .6px; color: var(--discret); }

/* Galerie */
.galerie { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.tuile { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; background: none; text-align: left; color: var(--texte); min-width: 0; }
.vignette { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: #9fb0cf; }
.vignette img, .vignette video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette .apercu-texte { padding: 14px; font-size: 14px; line-height: 1.45; color: var(--texte-2); display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; align-self: flex-start; }
.tuile[aria-pressed="true"] .vignette { outline: 2px solid var(--ambre); outline-offset: 2px; }
.minuterie { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: rgba(8, 12, 20, .82); color: var(--texte); }
.minuterie.presse { background: var(--ambre); color: var(--ambre-sur); }
.coeur-coin { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(8, 12, 20, .82); display: flex; align-items: center; justify-content: center; }
.lecture { position: absolute; width: 40px; height: 40px; border-radius: 50%; background: rgba(8, 12, 20, .6); display: flex; align-items: center; justify-content: center; }
.meta { display: flex; flex-direction: column; gap: 1px; padding: 0 2px; }
.meta .qui { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .quand { font-size: 12px; color: var(--discret); }
.vide { padding: 36px 16px; text-align: center; color: var(--discret); font-size: 14px; line-height: 1.6; }

.filtre { display: flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--trait); }
.filtre button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--discret); font-size: 14px; font-weight: 700; padding: 0 14px; }
.filtre button[aria-selected="true"] { background: #26324a; color: var(--texte); }
.action-flottante { position: fixed; left: 20px; right: 20px; bottom: calc(var(--bas) + 84px); z-index: 15; }
.action-flottante .bouton { width: 100%; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }

/* ---------- Visionneuse ---------- */
.visionneuse { position: fixed; inset: 0; z-index: 40; background: var(--nuit-2); display: flex; flex-direction: column; }
.v-tete { display: flex; align-items: center; gap: 6px; padding: calc(var(--haut) + 12px) 12px 10px; }
.v-tete .titres { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.v-tete .titres strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-tete .titres span { font-size: 12px; color: var(--discret); }
.icone-bouton { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; display: flex; align-items: center; justify-content: center; color: var(--texte); }
.v-corps { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #05080e; }
.v-corps img, .v-corps video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.v-corps audio { width: calc(100% - 40px); }
.v-texte { max-width: 560px; width: 100%; margin: 20px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--trait); font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 100%; overflow: auto; }
.v-pied { padding: 14px 20px calc(var(--bas) + 20px); display: flex; flex-direction: column; gap: 14px; }
.v-actions { display: flex; justify-content: space-around; }
.v-action { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 66px; border: 0; background: none; color: var(--texte); font-size: 12px; font-weight: 600; padding: 0; }
.v-action .rond { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.v-action.principal-action .rond { background: var(--ambre); color: var(--ambre-sur); }
.v-action.danger { color: var(--rouge-clair); }

/* ---------- Feuilles (liaison, confirmations) ---------- */
.voile { position: fixed; inset: 0; z-index: 60; background: rgba(3, 6, 12, .66); display: flex; align-items: flex-end; justify-content: center; }
.feuille { width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--nuit); border-radius: 24px 24px 0 0; border: 1px solid var(--trait);
  padding: 18px 20px calc(var(--bas) + 24px); display: flex; flex-direction: column; gap: 18px; }
.feuille .poignee { width: 40px; height: 5px; border-radius: 99px; background: var(--trait-2); align-self: center; }
.champ { display: flex; gap: 8px; }
.champ select, .champ input { min-height: 54px; border-radius: 14px; background: var(--surface); border: 1px solid var(--trait-2); color: var(--texte);
  font: 700 17px Manrope, sans-serif; padding: 0 14px; }
.champ select { max-width: 132px; -webkit-appearance: none; appearance: none; }
.champ input { flex: 1; min-width: 0; }
.etiquette { font-size: 13px; font-weight: 700; color: var(--discret); }
.cases { display: flex; align-items: center; justify-content: center; gap: 5px; }
.cases span { width: 36px; height: 48px; border-radius: 10px; background: var(--surface); border: 1px solid var(--trait-2); display: flex; align-items: center; justify-content: center;
  font: 700 22px ui-monospace, "SF Mono", Menlo, monospace; }
.cases i { width: 8px; height: 2px; background: #5B6880; display: block; margin: 0 2px; }
.etapes { display: flex; flex-direction: column; gap: 10px; }
.etapes p { display: flex; gap: 12px; align-items: baseline; font-size: 14px; line-height: 1.45; color: var(--texte-2); }
.etapes b { width: 22px; height: 22px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ambre); font-size: 12px; }
.etapes strong { color: var(--texte); }
.qr { align-self: center; padding: 14px; border-radius: 20px; background: #fff; line-height: 0; }
.qr svg { width: 220px; height: 220px; }
.code-saisie { letter-spacing: 10px; text-align: center; font-size: 26px !important; }

/* Bande d'installation */
.bande { position: fixed; left: 12px; right: 12px; bottom: calc(var(--bas) + 84px); z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--trait-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.bande p { flex: 1; font-size: 13px; line-height: 1.4; color: var(--texte-2); }
.bande p strong { color: var(--texte); }
.bande .bouton { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }

/* Parametres */
.section { display: flex; flex-direction: column; gap: 8px; }
.section > h2 { margin-left: 4px; font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--discret); text-transform: uppercase; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 13px 16px; font-size: 15px; min-height: 52px; }
.ligne + .ligne { border-top: 1px solid var(--trait); }
.ligne .lbl { flex: 1; font-weight: 600; }
.ligne .val { color: var(--discret); font-weight: 600; text-align: right; }
.ligne button { border: 0; background: none; color: var(--ambre); font-weight: 700; padding: 0; min-height: 44px; }
.repartition { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 13px; color: var(--texte-2); }
.repartition span { display: flex; align-items: center; gap: 8px; }
.repartition i { width: 10px; height: 10px; border-radius: 3px; display: block; flex: none; }
.abo { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.abo.essai { background: var(--ambre-fond); border-color: var(--ambre-trait); }
.abo.actif { background: var(--vert-fond); border-color: #1f4a35; }
.abo.expire { background: #2a0f0d; border-color: #5a1f1b; }
.abo .statut { font-size: 12px; font-weight: 800; letter-spacing: .6px; }
.abo .gros { font-size: 22px; font-weight: 800; }
.abo p { font-size: 13px; color: var(--texte-2); line-height: 1.5; }
.danger-texte { color: var(--rouge-clair) !important; }

/* Regles et accueil avant liaison */
.centre { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.regle { display: flex; gap: 14px; align-items: flex-start; }
.regle .carre { background: var(--surface-3); }
.regle h3 { font-size: 16px; font-weight: 800; }
.regle p { margin-top: 3px; font-size: 14px; line-height: 1.5; color: #A9B4C6; }
.accroche { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; background: var(--ambre-fond); border: 1px solid #5a3e0e; }
.accroche h2 { font-size: 19px; font-weight: 800; line-height: 1.3; }
.accroche p { font-size: 14px; line-height: 1.5; color: #E3CFA6; }
.accroche small { font-size: 12px; text-align: center; color: #C9B07E; }
.exemples { display: flex; gap: 10px; }
.exemples .vignette { flex: 1; aspect-ratio: 1; }
.exemples .vignette .exemple { position: absolute; left: 8px; top: 8px; background: rgba(8, 12, 20, .8); color: var(--texte-2); }

.notification { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bas) + 96px); z-index: 80; padding: 12px 18px; border-radius: 14px;
  background: var(--surface-3); border: 1px solid var(--trait-2); font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: calc(100% - 40px); }

/* La capture ouverte tient toujours dans l'ecran : l'image se reduit, les boutons restent visibles. */
.visionneuse > .v-boite { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.v-corps { overflow: hidden; }
/* La bande d'installation ne doit rien cacher du bas de la page. */
body.avec-bande .principal { padding-bottom: calc(var(--bas) + 190px); }

/* ---------- Tablette ---------- */
@media (min-width: 700px) {
  .coquille { padding-left: 100px; }
  .nav { top: 0; right: auto; width: 100px; flex-direction: column; justify-content: flex-start; align-items: center; gap: 10px;
    padding: calc(var(--haut) + 28px) 14px 28px; border-top: 0; border-right: 1px solid var(--trait); background: var(--nuit); }
  .nav-tete { display: block; margin-bottom: 14px; }
  .onglet { width: 72px; min-height: 60px; }
  .onglet[aria-current="page"] { background: var(--surface-3); }
  .principal { padding: calc(var(--haut) + 30px) 32px 40px; }
  .galerie { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
  .action-flottante { left: auto; right: 32px; bottom: 28px; width: 360px; }
  .bande { left: auto; right: 24px; bottom: 24px; width: 420px; }
  .notification { bottom: 28px; }
  .voile { align-items: center; }
  .feuille { border-radius: 24px; padding-bottom: 24px; }
  .visionneuse { inset: 0; background: rgba(3, 6, 12, .74); align-items: center; justify-content: center; padding: 24px; }
  .visionneuse > .v-boite { flex: 0 1 auto; width: min(600px, 100%); max-height: 100%; border-radius: 24px; overflow: hidden; background: #0f1624; border: 1px solid var(--trait); display: flex; flex-direction: column; }
  .v-corps { min-height: 380px; }
  .v-tete { padding-top: 14px; }
  .v-pied { padding-bottom: 22px; }
}

/* ---------- Ordinateur : menu, galerie, media ouvert a droite ---------- */
@media (min-width: 1100px) {
  .coquille { padding-left: 272px; }
  .nav { width: 272px; align-items: stretch; padding: 28px 18px; gap: 4px; }
  .nav-tete { padding: 0 12px; margin-bottom: 22px; }
  .nav-tete .marque { font-size: 28px; }
  .onglet { flex-direction: row; width: auto; min-height: 44px; justify-content: flex-start; gap: 12px; padding: 0 12px; font-size: 15px; font-weight: 600; color: var(--texte-2); }
  .onglet:hover { background: var(--surface); color: var(--texte); }
  .onglet[aria-current="page"] { background: var(--surface-3); color: var(--texte); }
  .onglet[aria-current="page"] svg { color: var(--ambre); }
  .nav-titre { display: block; margin: 16px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: .7px; color: var(--discret-2); }
  .nav-collection { display: flex; flex-direction: column; gap: 4px; }
  .nav-collection .carre { width: 30px; height: 30px; border-radius: 9px; }
  .nav-collection .nb { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--discret); }
  .nav-pied { display: flex; margin-top: auto; }
  .nav-pied .espace { padding: 14px; gap: 10px; }
  .nav-pied .espace-ligne { flex-direction: column; align-items: flex-start; gap: 4px; }
  .nav-collection .onglet { text-align: left; white-space: nowrap; font-size: 14px; gap: 10px; }
  .seulement-petit { display: none !important; }
  .principal { padding: 30px 32px; margin-right: 400px; }
  .galerie { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .visionneuse { inset: 0 0 0 auto; width: 400px; padding: 0; background: var(--nuit-2); border-left: 1px solid var(--trait); }
  .visionneuse > .v-boite { width: 100%; height: 100%; border-radius: 0; border: 0; background: none; }
  .visionneuse .fermer { display: none; }
  .v-corps { margin: 0 24px; border-radius: 16px; overflow: hidden; }
  .v-pied { padding: 16px 24px 26px; }
  .visionneuse.vide-panneau .v-corps { background: var(--surface); }
  .action-flottante { right: 432px; }
  .bande { right: 432px; }
}
@media (min-width: 700px) and (max-width: 1099px) { .seulement-grand { display: none !important; } }
@media (max-width: 699px) { .seulement-grand { display: none !important; } }
.seulement-tablette { display: none; }
@media (min-width: 700px) and (max-width: 1099px) { .seulement-tablette { display: block; } }
@media (prefers-reduced-motion: no-preference) {
  .feuille, .visionneuse { animation: apparition .18s ease-out; }
  @keyframes apparition { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ---------- Ecran hors connexion ---------- */
.vignette > .exemple { position: absolute; left: 8px; top: 8px; background: rgba(8, 12, 20, .8); color: var(--texte-2); }
.decouverte .galerie .tuile { opacity: .92; }
.decouverte .nav-pied { display: none; }
@media (min-width: 1100px) {
  .decouverte .nav-pied { display: flex; }
  .decouverte .nav-pied .bouton { width: 100%; }
  .decouverte .accroche { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 24px; }
  .decouverte .accroche h2, .decouverte .accroche p { flex: 1 1 100%; }
  .decouverte .accroche .bouton { width: auto; padding: 0 28px; }
  .decouverte .visionneuse .v-boite { display: flex; flex-direction: column; }
}
@media (min-width: 700px) { .feuille .poignee { display: none; } }
.decouverte .apercu-texte { padding-top: 40px; }
@media (min-width: 1100px) { .sans-panneau .principal { margin-right: 0; max-width: 860px; } }
