/* Web app Cercle : même apparence que l'app Android (Material 3, couleurs calculées par theme.js comme Color.kt).
   Les variables --primary, --surface, --on-surface-variant… sont posées par applyTheme(). */
:root {
  color-scheme: dark;
  /* Valeurs de secours (thème Cercle sombre) avant que theme.js ne s'exécute. */
  --primary: rgb(224 123 83); --on-primary: #fff; --primary-container: rgb(85 59 49); --on-primary-container: rgb(241 196 178);
  --secondary: rgb(63 128 121); --on-secondary: #fff; --tertiary: rgb(224 180 83);
  --tertiary-container: rgb(83 67 40); --on-tertiary-container: rgb(240 217 165);
  --background: rgb(26 32 34); --surface: rgb(26 32 34); --on-surface: rgb(232 234 235); --on-background: rgb(232 234 235);
  --surface-variant: rgb(40 49 52); --on-surface-variant: rgb(158 166 170);
  --surface-container-lowest: rgb(18 22 24); --surface-container-low: rgb(31 39 41); --surface-container: rgb(34 42 45);
  --surface-container-high: rgb(39 48 50); --surface-container-highest: rgb(43 53 56);
  --outline: rgb(110 119 123); --outline-variant: rgb(45 55 58); --error: rgb(255 107 107); --bulle-base: rgb(39 48 50);
  --rouge: #E53935; /* pastilles « non lu », le même dans tous les thèmes */
  --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, system-ui, "Segoe UI", sans-serif;
  --police-titres: var(--police);
  --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
}
html[data-mode="clair"] { color-scheme: light; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* « hidden » gagne toujours (sinon display:flex des boutons l'emporte). */
[hidden] { display: none !important; }
/* Pas de sélection de texte ni de loupe à l'appui long (comme une vraie app) : seulement dans les champs à remplir. */
html { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
html, body { margin: 0; height: 100%; background: var(--background); color: var(--on-surface); font: 16px/1.4 var(--police); overscroll-behavior: none; }
#app { height: 100%; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--outline); border-radius: 12px; background: transparent;
  color: var(--on-surface); font-size: 16px; outline: none; }
input:focus, select:focus, textarea:focus { border: 2px solid var(--primary); padding: 13px 15px; }
select option { background: var(--surface-container-high); }
textarea { resize: none; }
label { display: block; margin: 12px 0; font-size: 13px; color: var(--on-surface-variant); }
label input, label select, label textarea { margin-top: 5px; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0 0 8px; font-family: var(--police-titres); }
.doux { color: var(--on-surface-variant); }
.petit { font-size: 13px; }
.grand { font-size: 26px; }
.centre { text-align: center; }
.icone { display: block; flex: none; }
.vide { padding: 48px 32px; text-align: center; color: var(--on-surface-variant); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.vide .icone { color: var(--outline); }
.vide p { margin: 0; }
.chargement { margin: auto; color: var(--on-surface-variant); }

/* ---------- Boutons (Material 3) */
.bouton { display: block; width: 100%; margin-top: 12px; padding: 12px 24px; min-height: 48px; border: 0; border-radius: 999px; background: var(--primary);
  color: var(--on-primary); font-weight: 600; font-size: 15px; letter-spacing: .1px; cursor: pointer; }
.bouton.secondaire { background: transparent; color: var(--primary); border: 1px solid var(--outline); }
.bouton:disabled { opacity: .38; }
.lien { background: none; border: 0; color: var(--primary); padding: 10px 0; cursor: pointer; font-weight: 600; font-size: 15px; }
.petit-bouton { border: 1px solid var(--outline); background: transparent; color: var(--on-surface); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 14px; font-weight: 500; }
.icone-bouton { border: 0; background: none; color: var(--on-surface-variant); width: 48px; height: 48px; border-radius: 50%; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.icone-bouton:active { background: var(--surface-container-highest); }
.fab { position: fixed; right: 16px; bottom: calc(16px + var(--bas)); width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--primary); color: var(--on-primary); box-shadow: 0 3px 6px #0004, 0 1px 3px #0003; cursor: pointer; z-index: 5;
  display: flex; align-items: center; justify-content: center; }

/* ---------- En-tête du cercle + onglets en haut (RoomsScreen d'Android) */
.haut-accueil { background: var(--surface); flex: none; }
.entete-cercle { display: flex; align-items: center; padding: calc(8px + var(--haut)) 4px 4px 12px; }
.titre-cercle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--on-surface);
  padding: 4px 8px; border-radius: 16px; cursor: pointer; text-align: left; }
.titre-cercle:active { background: var(--surface-container-high); }
.titre-cercle > .icone { color: var(--on-surface-variant); }
.titre-bloc { display: flex; flex-direction: column; min-width: 0; }
.titre-bloc b { font-family: var(--police-titres); font-size: 22px; font-weight: 700; letter-spacing: 1.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titre-bloc small { font-size: 11px; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onglets { display: flex; border-bottom: 1px solid var(--outline-variant); }
.onglets a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; font-size: 12px; font-weight: 500;
  color: var(--on-surface-variant); text-decoration: none; min-width: 0; }
.onglets a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.onglets a.actif { color: var(--primary); }
.onglets a.actif::after { content: ""; position: absolute; bottom: -1px; left: 50%; width: 48px; margin-left: -24px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.pastille-onglet { position: absolute; top: 4px; left: calc(50% + 6px); }
main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
main.avec-onglets { padding-bottom: calc(90px + var(--bas)); }
main.plein { display: flex; flex-direction: column; overflow: hidden; }

/* Barre du haut des autres écrans (TopAppBar) */
.barre-haut { display: flex; align-items: center; gap: 4px; padding: calc(4px + var(--haut)) 4px 4px; background: var(--surface); flex: none; min-height: calc(64px + var(--haut)); }
.barre-haut h2 { flex: 1; font-size: 20px; font-weight: 500; margin: 0 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-haut .petit-bouton { margin-right: 8px; }
.barre-haut .icone-bouton { color: var(--on-surface); }

/* ---------- Pastilles « Salons / Messages » (PillTabs) */
.pilules { display: flex; gap: 8px; padding: 12px 16px 8px; overflow-x: auto; scrollbar-width: none; }
.pilule { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 16px;
  background: var(--surface-container-high); color: var(--on-surface-variant); font-size: 14px; font-weight: 500; cursor: pointer; }
.pilule.choisie { background: var(--primary); color: var(--on-primary); }
.pilule.nouveau { font-weight: 800; color: var(--on-surface); padding-right: 8px; }
.pilule.choisie.nouveau { color: var(--on-primary); }
.pastille { display: inline-block; background: var(--rouge); color: #fff; border-radius: 999px; min-width: 18px; padding: 1px 6px; font-size: 11px; font-weight: 700; text-align: center; line-height: 16px; }

/* ---------- Avatars (Avatar / IconAvatar d'Android : fond sombre + anneau de couleur) */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--surface-container-high); box-shadow: inset 0 0 0 2px var(--anneau, var(--primary)); font-weight: 700; color: var(--anneau, var(--primary)); }
.avatar img { width: calc(100% - 4px); height: calc(100% - 4px); border-radius: 50%; object-fit: cover; }
.avatar-icone { color: var(--primary); --anneau: var(--primary); }

/* ---------- Listes (RoomRow) */
.liste { padding: 0 0 8px; }
.salon-ligne { display: flex; align-items: center; gap: 14px; padding: 10px 16px; color: var(--on-surface); text-decoration: none; }
.salon-ligne:active { background: var(--surface-container-high); }
.salon-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.salon-texte b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salon-texte .apercu, .salon-texte .doux { font-size: 14px; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salon-ligne.non-lu b { font-weight: 800; }
.salon-ligne.non-lu .apercu { color: var(--on-surface); font-weight: 700; }
.salon-fin { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.heure-salon { font-size: 11px; color: var(--on-surface-variant); font-weight: 500; }
.non-lu .heure-salon { color: var(--rouge); font-weight: 700; }
.jour { text-align: center; color: var(--on-surface-variant); font-size: 12px; font-weight: 500; margin: 14px 0 6px; text-transform: capitalize; }

/* ---------- Accueil (rejoindre / récupérer / créer) */
.accueil { padding: calc(32px + var(--haut)) 16px calc(32px + var(--bas)); max-width: 520px; margin: 0 auto; text-align: center; }
.accueil .logo { width: 96px; height: 96px; border-radius: 50%; }
.accueil h1 { font-size: 30px; letter-spacing: 2px; margin-top: 10px; }
.carte-blanche { background: var(--surface-container-low); border-radius: 16px; padding: 16px; margin: 12px 0; text-align: left; }
.carte-blanche h2, .carte-blanche h3 { font-size: 17px; }
.carte-blanche summary { font-weight: 600; cursor: pointer; }
.astuce { background: var(--tertiary-container); color: var(--on-tertiary-container); border-radius: 16px; padding: 12px 14px; text-align: left; font-size: 14px; margin: 14px 0; }
.icone-partage { display: inline-block; border: 1px solid currentColor; border-radius: 5px; padding: 0 4px; }

/* ---------- Discussion (ChatScreen d'Android) */
.chat-entete { gap: 0; }
.chat-titre { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--on-surface); cursor: pointer;
  text-align: left; padding: 4px; border-radius: 12px; }
.chat-titre .titre-bloc b { font-family: var(--police); font-size: 16px; font-weight: 600; letter-spacing: 0; }
.chat-titre .titre-bloc small { font-size: 12px; }
.messages { flex: 1; overflow-y: auto; padding: 8px 12px; -webkit-overflow-scrolling: touch; background: var(--background); }
.bulle-bloc { position: relative; display: flex; flex-direction: column; align-items: flex-start; margin-top: 8px; }
.bulle-bloc.suite { margin-top: 2px; }
.bulle-bloc.moi { align-items: flex-end; }
.bulle-tete { display: flex; gap: 6px; align-items: baseline; padding: 2px 6px; font-size: 11px; color: var(--on-surface-variant); }
.bulle-tete b { font-size: 12px; }
.bulle { max-width: min(300px, 82%); background: color-mix(in srgb, var(--teinte, var(--bulle-base)) 18%, var(--bulle-base)); color: var(--on-surface);
  border-radius: 20px 20px 20px 6px; overflow: hidden; overflow-wrap: anywhere; cursor: pointer; }
.bulle.a-moi { background: var(--primary); color: var(--on-primary); border-radius: 20px 20px 6px 20px; }
.bulle.a-moi a { color: inherit; }
.bulle.eclair { box-shadow: 0 0 0 4px color-mix(in srgb, var(--tertiary) 50%, transparent); }
.bulle .texte { white-space: pre-wrap; padding: 9px 14px; font-size: 16px; line-height: 1.45; }
.citation { display: flex; flex-direction: column; margin: 6px 6px 0; padding: 4px 10px 4px 10px; border-left: 3px solid currentColor; border-radius: 4px 12px 12px 4px;
  background: color-mix(in srgb, currentColor 10%, transparent); font-size: 13px; }
.citation b { font-size: 12px; }
.citation span { opacity: .9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reactions { display: flex; gap: 4px; padding: 2px 6px; }
.reaction { border: 0; border-radius: 12px; padding: 3px 8px; background: var(--surface-container-highest); color: var(--on-surface); font-size: 13px; cursor: pointer; }
.reaction.mienne { background: var(--primary-container); color: var(--on-primary-container); }
.marque { font-size: 11px; color: var(--on-surface-variant); padding: 0 6px; }
.media { border-radius: 16px; margin: 4px; background: color-mix(in srgb, currentColor 12%, transparent) center/cover no-repeat; }
.media.image { width: 240px; max-width: calc(100% - 8px); }
.media.video { width: 240px; max-width: calc(100% - 8px); aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; }
.media.video .lecture { font-size: 34px; color: #fff; text-shadow: 0 2px 8px #000; }
.media.charge { opacity: .5; }
.media.abime::after { content: "Image indisponible"; display: block; padding: 20px; font-size: 13px; }
.media.audio, .media.fichier { background: none; padding: 4px 6px; }
.media.fichier .petit-bouton { border-color: currentColor; color: inherit; }
.media audio { width: 240px; max-width: 100%; }
.sondage { display: flex; flex-direction: column; gap: 6px; min-width: 220px; padding: 10px 12px; }
.sondage .option { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px;
  border: 0; background: color-mix(in srgb, currentColor 10%, transparent); color: inherit; cursor: pointer; overflow: hidden; text-align: left; }
.sondage .option.choisie { font-weight: 700; box-shadow: inset 0 0 0 2px currentColor; }
.sondage .jauge { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, currentColor 18%, transparent); }
.sondage .option span { position: relative; }
.epingle { display: flex; align-items: center; gap: 10px; margin: 4px 12px; padding: 8px 12px; border-left: 3px solid var(--primary); border-radius: 4px 12px 12px 4px;
  background: var(--surface-container-high); font-size: 14px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.ecrit { min-height: 18px; padding: 0 16px; flex: none; font-size: 12px; color: var(--on-surface-variant); }
.reponse-barre { display: flex; align-items: center; gap: 8px; margin: 0 12px; padding: 4px 4px 4px 12px; border-left: 3px solid var(--primary);
  border-radius: 4px 12px 12px 4px; background: var(--surface-container-high); font-size: 14px; flex: none; }
.reponse-barre span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-envoi { display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px calc(6px + var(--bas)); background: var(--background); flex: none; }
.barre-envoi textarea { border: 0; border-radius: 24px; padding: 13px 18px; max-height: 140px; background: var(--surface-container-high); min-height: 50px; }
.barre-envoi textarea:focus { padding: 13px 18px; border: 0; }
.barre-envoi .envoyer { color: var(--primary); }
#micro.enregistre { background: var(--rouge); color: #fff; animation: battement 1s infinite; }
@keyframes battement { 50% { opacity: .6; } }
.plus-anciens { display: block; margin: 0 auto; }

/* ---------- Feuilles qui montent du bas (comme les fenêtres d'Android) */
#feuille { position: fixed; inset: 0; z-index: 1000; }
.voile { position: absolute; inset: 0; background: #0009; }
.feuille { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--surface-container-low); color: var(--on-surface);
  border-radius: 28px 28px 0 0; padding: 24px 20px calc(16px + var(--bas)); animation: monte .2s ease-out; }
.feuille h3 { font-size: 20px; font-weight: 500; margin-bottom: 12px; }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
.ligne-choix { display: block; width: 100%; text-align: left; padding: 14px 8px; background: none; border: 0; border-radius: 12px; color: var(--on-surface);
  cursor: pointer; text-decoration: none; font-size: 16px; }
.ligne-choix:active { background: var(--surface-container-highest); }
.ligne-choix.danger { color: var(--error); }
.ligne-choix.annuler { text-align: center; color: var(--primary); font-weight: 600; }
.ligne-choix.choisi { font-weight: 700; color: var(--primary); }
.case { display: flex; align-items: center; gap: 12px; color: var(--on-surface); font-size: 16px; padding: 4px 0; }
.case input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
.grand-case { padding: 8px 0; }
.deux { display: flex; gap: 10px; }
.deux label { flex: 1; }
.segments { display: flex; border: 1px solid var(--outline); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.segments button { flex: 1; padding: 10px; border: 0; background: none; color: var(--on-surface); cursor: pointer; font-weight: 500; }
.segments button + button { border-left: 1px solid var(--outline); }
.segments button.choisi { background: var(--secondary-container, var(--primary-container)); color: var(--on-primary-container); }
.segments button.choisi::before { content: "✓ "; }
#feuille.plein-ecran .feuille { top: 0; max-height: none; border-radius: 0; background: #000; padding: 0; display: flex; }
.visionneuse { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; }
.visionneuse img, .visionneuse video { max-width: 100%; max-height: 100vh; object-fit: contain; }
.visionneuse .fermer { position: absolute; top: calc(10px + var(--haut)); right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #fff3; color: #fff; font-size: 20px; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(24px + var(--bas)); z-index: 1100; background: var(--on-surface); color: var(--surface);
  padding: 14px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 3px 8px #0005; }

/* ---------- Galerie des thèmes */
.grille-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.carte-theme { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--outline-variant); border-radius: 18px; overflow: hidden; padding: 0 0 10px; cursor: pointer; text-align: left; }
.carte-theme.actuel { box-shadow: 0 0 0 3px var(--primary); }
.carte-theme .bande { display: flex; height: 44px; }
.carte-theme .bande span { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.carte-theme .bande span:first-child { flex: 2; }
.carte-theme b, .carte-theme small { padding: 0 10px; }
.carte-theme small { opacity: .7; font-size: 12px; }

/* ---------- Carte */
.carte { position: absolute; inset: 0; }
.avec-onglets:has(.carte) { padding-bottom: 0; overflow: hidden; }
.boutons-carte { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 10px; z-index: 500; }
.rond { width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--surface-container-high); color: var(--on-surface); box-shadow: 0 2px 6px #0004; font-size: 20px; cursor: pointer; }
.bandeau-carte { position: absolute; left: 12px; right: 72px; top: 12px; z-index: 500; background: var(--surface-container-high); border-radius: 16px; padding: 12px; box-shadow: 0 2px 6px #0004; font-size: 14px; }
.point-personne { background: none; border: 0; }
.epingle-personne { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 3px 8px #0006; display: flex; align-items: center; justify-content: center; }
.epingle-personne.moi .avatar { box-shadow: inset 0 0 0 3px var(--primary); }
.leaflet-container { background: var(--surface-container); font: inherit; }

/* ---------- Papier de l'agenda et des notes (comme Android : PaperSheet, anneaux dorés, police Élégante) */
@font-face { font-family: "papier"; src: url(/polices/playfairdisplay.ttf); font-display: swap; }
:root { --encre: #2A2A33; --encre-douce: #8C8677; --dimanche: #D0453F; --bleu-jour: #3D63DD; --police-papier: "papier", Georgia, serif; }
.feuille-papier { position: relative; padding-top: 12px; }
.papier { position: relative; border-radius: 6px; padding-top: 14px; color: var(--encre); box-shadow: 0 6px 16px #0006, 0 2px 4px #0003; height: 100%; }
.anneau { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; }
.papier .icone-bouton { color: var(--encre); }
.papier .icone-bouton:active { background: #0000000f; }
.pointe { position: relative; }
.pointe::after { content: ""; position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--rouge); }
.papier-trait { height: 1px; background: #2A2A3314; margin-top: 6px; flex: none; }
.papier-vide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 48px 24px; color: var(--encre-douce); text-align: center; }
.papier-vide p { margin: 4px 0 0; }
.papier-vide small { font-size: 12px; }
.papier-section { color: var(--encre-douce); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; padding: 16px 20px 4px; }
.papier-lien { background: none; border: 0; color: var(--encre-douce); font-size: 13px; padding: 10px 16px; cursor: pointer; }
.puces { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px; scrollbar-width: none; }
.puce { flex: none; border: 1px solid var(--outline); background: transparent; color: var(--on-surface-variant); border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.puce.choisie { background: var(--secondary-container, var(--primary-container)); color: var(--on-primary-container); border-color: transparent; }
.puce.choisie::before { content: "✓ "; }
.papier .puce { border-color: #2A2A3340; color: var(--encre); }
.papier .puce.choisie { background: #2A2A331a; color: var(--encre); }

/* Agenda : la feuille remplit l'onglet, la liste défile à l'intérieur */
.agenda { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 8px 16px 12px; }
.agenda > .feuille-papier { flex: 1; min-height: 0; }
.agenda .papier { display: flex; flex-direction: column; overflow: hidden; }
.papier-liste { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.papier-tete { display: flex; align-items: center; padding: 0 4px 0 20px; flex: none; }
.papier-titre { flex: 1; margin: 0; font-family: var(--police-papier); font-weight: 400; font-size: 30px; color: var(--encre); }
.papier-sous { margin: 2px 20px; color: var(--encre-douce); font-size: 13px; flex: none; }
.papier-cherche { padding: 4px 16px; flex: none; }
.papier-cherche input { color: var(--encre); border-color: #2A2A3366; background: #ffffff66; }
.papier-filtres { flex: none; }
.papier-filtres small { display: block; color: var(--encre-douce); font-size: 12px; padding: 4px 20px 0; }
.recap-jour { display: flex; gap: 12px; width: 100%; padding: 8px 16px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--encre); }
.recap-jour.passe { opacity: .55; }
.petite-feuille { width: 58px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px; background: #FFFFFF99; color: var(--encre); }
.petite-feuille.aujourdhui { background: var(--bleu-jour); color: #fff; }
.petite-feuille small { font-size: 11px; }
.petite-feuille b { font-family: var(--police-papier); font-weight: 400; font-size: 22px; line-height: 1.2; }
.recap-evts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.recap-evt { display: flex; gap: 8px; align-items: flex-start; }
.recap-evt i { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.recap-evt > span { min-width: 0; display: flex; flex-direction: column; }
.recap-titre { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-evt small { color: var(--encre-douce); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tache-papier { display: flex; align-items: center; gap: 4px; padding: 2px 16px 2px 8px; }
.case-papier { flex: none; width: 48px; height: 48px; background: none; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; font-size: 0; }
.case-papier::before { content: ""; width: 18px; height: 18px; border: 2px solid #2A2A3399; border-radius: 2px; box-sizing: border-box; }
.case-papier.cochee::before { background: var(--bleu-jour); border-color: var(--bleu-jour); }
.case-papier.cochee::after { content: "✓"; position: absolute; font-size: 13px; font-weight: 700; color: #fff; }
.tache-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; background: none; border: 0; color: var(--encre); padding: 6px 0; cursor: pointer; }
.tache-corps b { font-size: 15px; font-weight: 500; }
.tache-corps small { color: var(--encre-douce); font-size: 12px; }
.tache-corps small.retard { color: var(--dimanche); }
.tache-papier.faite .tache-corps { opacity: .55; }
.tache-papier.faite .tache-corps b { text-decoration: line-through; }
.evt-ligne { display: flex; align-items: flex-start; width: 100%; padding: 14px 20px; background: none; border: 0; text-align: left; color: var(--encre); cursor: pointer; }
.evt-heure { width: 60px; flex: none; font-size: 14px; font-weight: 500; padding-top: 1px; }
.evt-ligne i { flex: none; width: 10px; height: 10px; border-radius: 50%; margin: 5px 12px 0 0; }
.evt-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.evt-corps b { font-size: 16px; font-weight: 600; }
.evt-corps small { color: var(--encre-douce); font-size: 13px; }
.evt-lieu { color: var(--bleu-jour); font-size: 13px; text-decoration: underline; }
.evt-sep { height: 1px; background: #2A2A330f; margin: 0 16px 0 92px; }
.jour-tete { padding: 0 4px; }
.jour-titre { font-size: 26px; padding: 0 20px; flex: none; }
.aujourdhui-texte { margin: 2px 20px; color: var(--bleu-jour); font-size: 13px; font-weight: 600; }
/* Page du mois */
.mois-tete { display: flex; align-items: center; padding-top: 2px; flex: none; }
.mois-tete .espace, .papier-tete .espace { flex: 1; }
.mois-tete .icone-bouton { color: var(--on-surface); }
.choix-tete { display: flex; flex-direction: column; align-items: center; background: none; border: 0; color: var(--on-surface); font-size: 16px; font-weight: 600; padding: 4px 8px; cursor: pointer; }
.choix-tete i { width: 36px; height: 2px; border-radius: 2px; background: var(--primary); margin-top: 3px; }
.bloc-pages { position: relative; flex: 1; min-height: 0; margin-top: 4px; perspective: 1400px; }
.bloc-pages > .feuille-papier { position: absolute; inset: 0; }
.dessous { position: absolute; inset: 16px 0 0 0; border-radius: 6px; }
.dessous.d2 { background: #D9D2C3; transform: translate(3px, 5px); }
.dessous.d1 { background: #E9E3D6; inset: 14px 0 0 0; transform: translate(1.5px, 2.5px); }
.mois-feuille { display: flex; flex-direction: column; height: 100%; padding: 0 14px 10px; }
.mois-nom { display: flex; align-items: flex-end; padding: 6px 4px 0; }
.mois-nom span { flex: 1; font-family: var(--police-papier); font-size: 38px; line-height: 1.15; }
.mois-nom small { font-family: var(--police-papier); font-size: 16px; opacity: .7; padding-bottom: 8px; }
.jours-semaine { display: flex; margin-top: 14px; }
.jours-semaine span { flex: 1; text-align: center; font-size: 12px; font-weight: 500; }
.grille-mois { flex: 1; display: flex; flex-direction: column; }
.semaine { flex: 1; display: flex; border-bottom: 1px solid #2A2A330d; }
.semaine:last-child { border-bottom: 0; }
.case-jour { flex: 1; display: flex; align-items: center; justify-content: center; }
.jour-rond { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; padding: 0; cursor: pointer; display: flex; }
.jour-rond.aujourdhui { box-shadow: inset 0 0 0 1.5px var(--bleu-jour); padding: 3px; }
.jour-int { flex: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.jour-int.avec { box-shadow: inset 0 0 0 2.5px var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.jour-int b { font-size: 17px; line-height: 1; }
.points { display: flex; gap: 2px; margin-top: 2px; }
.points i { width: 4px; height: 4px; border-radius: 50%; }
.tourne-avant .papier { animation: tourneAvant .55s ease-out; transform-origin: left center; }
.tourne-arriere .papier { animation: tourneArriere .55s ease-out; transform-origin: left center; }
@keyframes tourneAvant { from { transform: rotateY(25deg) translateX(30%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tourneArriere { from { transform: rotateY(-25deg) translateX(-30%); opacity: 0; } to { transform: none; opacity: 1; } }
.choix-annee { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 20px; }
.grille-choix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.grille-choix button { padding: 12px; border-radius: 12px; border: 0; background: var(--surface-container-high); color: var(--on-surface); font-size: 15px; cursor: pointer; }
.grille-choix button.choisi { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.couleurs-evt { display: flex; gap: 12px; margin: 12px 0; }
.couleurs-evt button { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; }
.couleurs-evt button.choisie { box-shadow: 0 0 0 3px var(--surface-container-low), 0 0 0 5px var(--on-surface); }

/* ---------- Notes (NotesTab d'Android) */
.notes { position: absolute; inset: 0; display: flex; flex-direction: column; }
.notes-filtres { display: flex; align-items: center; padding-top: 4px; }
.notes-filtres .puces { flex: 1; }
.notes-cherche { display: flex; align-items: center; gap: 8px; margin: 0 12px 4px; padding: 0 14px; border: 1px solid var(--outline); border-radius: 24px; color: var(--on-surface-variant); }
.notes-cherche input, .notes-cherche input:focus { border: 0; padding: 12px 0; }
.grille-papier { flex: 1; overflow-y: auto; columns: 2; column-gap: 12px; padding: 12px 12px 96px; }
.carte-note { display: block; width: 100%; break-inside: avoid; margin: 0 0 14px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.carte-note .papier { height: auto; }
.note-contenu { display: flex; flex-direction: column; padding: 6px 12px 8px; }
.note-titre-carte { font-family: var(--police-papier); font-size: 18px; font-weight: 600; color: var(--encre); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-extrait { font-size: 14px; line-height: 19px; color: var(--encre); max-height: 152px; overflow: hidden; }
.note-extrait .n-titre { font-weight: 700; font-size: 14px; }
.note-extrait .n-ligne-case { min-height: 19px; }
.note-vignette { display: block; height: 90px; border-radius: 8px; margin-top: 6px; background: center/cover no-repeat; }
.note-pied { display: flex; align-items: center; gap: 3px; margin-top: 8px; color: var(--encre-douce); font-size: 11px; white-space: nowrap; overflow: hidden; }
.note-pied span { overflow: hidden; text-overflow: ellipsis; }
.note-pied .icone { color: var(--encre-douce); }
.note-ecran { display: flex; flex-direction: column; height: 100%; background: var(--background); padding-top: var(--haut); }
.note-barre { display: flex; align-items: center; padding: 4px; }
.note-barre h2 { flex: 1; margin: 0; font-family: var(--police); font-size: 16px; font-weight: 500; }
.note-barre .icone-bouton { color: var(--on-surface); }
.pastille-papier { width: 22px; height: 22px; border-radius: 50%; margin: 0 3px; border: 1px solid #00000033; padding: 0; cursor: pointer; flex: none; }
.pastille-papier.choisie { border: 2px solid var(--primary); }
.bouton-texte { background: none; border: 0; color: var(--primary); font-weight: 600; font-size: 14px; padding: 10px 12px; cursor: pointer; }
.bouton-tonal { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; border: 0; border-radius: 999px; padding: 10px 18px;
  background: var(--secondary-container, var(--primary-container)); color: var(--on-secondary-container, var(--on-primary-container)); font-weight: 600; font-size: 14px; cursor: pointer; }
.note-outils { display: flex; align-items: center; padding: 0 4px 0 8px; }
.note-outils .icone-bouton { color: var(--on-surface); }
.note-outils .icone-bouton.actif { color: var(--primary); }
.audience { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--on-surface-variant); font-size: 14px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audience.grise { opacity: .5; }
.barre-format { display: flex; gap: 6px; padding: 4px 12px 8px; overflow-x: auto; }
.barre-format button { flex: none; border: 0; border-radius: 8px; padding: 8px 12px; background: var(--surface-container-high); color: var(--on-surface); font-size: 14px; cursor: pointer; }
.note-feuille { flex: 1; min-height: 0; padding: 0 12px 12px; display: flex; flex-direction: column; }
.note-feuille > .feuille-papier { flex: 1; min-height: 0; }
.note-feuille .papier { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.note-page-papier { padding: 8px 16px 16px; }
.note-titre-papier, .note-titre-papier:focus { font-family: var(--police-papier); font-size: 24px; font-weight: 600; color: var(--encre); border: 0; background: transparent; padding: 0; width: 100%; outline: none; }
.note-titre-papier::placeholder, .muet { color: var(--encre-douce); font-weight: 400; }
/* Lignes de cahier (tous les 28 px) avec la marge rouge, comme RuledLines() d'Android */
.lignes-cahier, .lignes-cahier:focus { display: block; width: 100%; min-height: 600px; margin-top: 10px; padding: 5px 0 0 18px; border: 0; border-radius: 0; outline: none; resize: none;
  font: 17px/28px var(--police); color: var(--encre); background-color: transparent;
  background-image: linear-gradient(to right, transparent 9.5px, #D0453F55 9.5px, #D0453F55 10.5px, transparent 10.5px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 27px, #2A6FB033 27px, #2A6FB033 28px); background-attachment: local; }
.lignes-cahier::placeholder { color: var(--encre-douce); }
.lignes-cahier a { color: #3D63DD; }
.n-titre { font-weight: 700; font-size: 19px; }
.n-ligne-case { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; min-height: 28px; cursor: pointer; }
.n-case { flex: none; width: 16px; height: 16px; border: 2px solid #2A2A3399; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
.n-case.cochee { background: #3D63DD; border-color: #3D63DD; }
.n-ligne-case.faite span:last-child { text-decoration: line-through; opacity: .6; }
.note-pieces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.note-photo { position: relative; width: calc(50% - 4px); aspect-ratio: 1; border-radius: 10px; background: #0000001a center/cover no-repeat; cursor: pointer; }
.note-fichier { position: relative; width: 100%; }
.note-fichier button:first-child { width: 100%; text-align: left; border: 1px solid #2A2A3333; background: #FFFFFF80; color: var(--encre); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.note-modif { color: var(--encre-douce); font-size: 12px; margin: 8px 0 0; }

/* ---------- Appareils */
.appareil { display: flex; align-items: center; gap: 12px; margin: 8px 16px; padding: 12px; border-radius: 16px; background: var(--surface-container-high); color: var(--on-surface); text-decoration: none; }
.appareil.alerte { box-shadow: inset 0 0 0 2px var(--error); }
.appareil-page { flex: 1; overflow-y: auto; padding: 12px 16px; }
.video-direct { width: 100%; border-radius: 16px; background: #000; min-height: 180px; display: block; }
.alerte-boite { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: color-mix(in srgb, var(--error) 18%, transparent);
  border-radius: 16px; padding: 12px; margin: 10px 0; font-weight: 700; }
.valeurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.valeurs div { background: var(--surface-container-high); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.commandes { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.commandes label { width: 100%; }
.commandes.grise { opacity: .5; }

/* ---------- Réglages */
.reglages { padding: 4px 16px calc(20px + var(--bas)); overflow-y: auto; flex: 1; }
.profil { text-align: center; }
.photo-profil { background: none; border: 0; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; color: var(--primary); cursor: pointer; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: 2px; -webkit-user-select: all; user-select: all; }

/* ---------- Position permanente (OwnTracks) */
.owntracks { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--outline-variant); }
.owntracks h4 { margin: 0 0 6px; font-size: 15px; }
.owntracks ol { padding-left: 20px; margin: 8px 0; line-height: 1.6; }

/* ---------- Carte : personnes proches groupées sans se chevaucher (comme Android) */
.groupe-personnes { position: relative; display: grid; gap: 0; }
.groupe-personnes .epingle-personne { margin: 1px; }
.plus-n { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }

/* ---------- Paramètres (SettingsScreen d'Android) */
#app { zoom: var(--zoom, 1); }
.reglages { display: flex; flex-direction: column; gap: 20px; padding: 16px 16px calc(24px + var(--bas)); }
.carte-profil, .carte-inviter { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px; border: 0; border-radius: 20px; text-align: left; cursor: pointer; }
.carte-profil { background: var(--surface-container); color: var(--on-surface); }
.carte-inviter { background: var(--primary-container); color: var(--on-primary-container); }
.carte-profil > span:not(.avatar), .carte-inviter > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.carte-profil b { font-size: 22px; font-weight: 700; }
.carte-inviter b { font-size: 16px; font-weight: 700; }
.carte-profil small, .carte-inviter small { font-size: 12px; opacity: .8; }
.carte-profil small { color: var(--on-surface-variant); opacity: 1; }
.carte-profil em { font-style: normal; font-size: 11px; color: var(--primary); font-weight: 500; }
.carte-profil > .icone { color: var(--on-surface-variant); }
.section-reglages { display: flex; flex-direction: column; gap: 8px; }
.section-reglages h4 { margin: 0 0 0 4px; font-size: 12px; font-weight: 500; letter-spacing: 1.2px; color: var(--on-surface-variant); }
.carte-reglages { background: var(--surface-container); border-radius: 20px; overflow: hidden; }
.carte-reglages hr { border: 0; height: 1px; background: var(--outline-variant); margin: 0; }
.ligne-menu, .ligne-reglage { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 16px; border: 0; background: none; color: var(--on-surface); text-align: left; cursor: pointer; }
.ligne-menu { gap: 14px; padding: 12px 16px; }
.ligne-menu:active, .ligne-reglage:active { background: var(--surface-container-highest); }
.ligne-menu > span:not(.pastille-groupe), .ligne-reglage > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ligne-menu b, .ligne-reglage b { font-size: 14px; font-weight: 500; }
.ligne-menu small, .ligne-reglage small { font-size: 12px; color: var(--on-surface-variant); }
.ligne-menu small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-menu > .icone:last-child { color: var(--on-surface-variant); }
.pastille-groupe { flex: none; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; }
.ligne-reglage > .icone { color: var(--primary); }
.ligne-reglage.danger > .icone, .ligne-reglage.danger b { color: var(--error); }
.ligne-reglage:disabled { opacity: .5; }
/* Interrupteur Material 3 */
.interrupteur input { position: absolute; opacity: 0; pointer-events: none; }
.interrupteur i { flex: none; position: relative; width: 52px; height: 32px; border-radius: 16px; background: var(--surface-container-highest); box-shadow: inset 0 0 0 2px var(--outline); transition: background .2s; }
.interrupteur i::after { content: ""; position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--outline); transition: all .2s; }
.interrupteur input:checked + i { background: var(--primary); box-shadow: none; }
.interrupteur input:checked + i::after { left: 24px; top: 4px; width: 24px; height: 24px; background: var(--on-primary); }
.bloc-theme { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; }
.ligne-theme { display: flex; align-items: center; gap: 14px; border: 0; background: none; color: var(--on-surface); text-align: left; cursor: pointer; padding: 4px 0; }
.ligne-theme > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.ligne-theme b { font-size: 16px; font-weight: 600; }
.ligne-theme small { font-size: 12px; color: var(--on-surface-variant); }
.ligne-theme em { font-style: normal; color: var(--primary); font-weight: 500; font-size: 14px; }
.pastille-theme { flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pastille-theme i:first-child { grid-row: span 2; }
.titre-petit { font-size: 14px; font-weight: 500; }
.bloc-theme .segments { margin-top: 0; }
.note-reglages { margin: 0 4px; font-size: 12px; color: var(--on-surface-variant); }
.code-invitation { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 16px; margin-bottom: 8px; border: 0; border-radius: 16px; background: var(--primary-container); color: var(--on-primary-container); cursor: pointer; }
.code-invitation b { font-size: 28px; letter-spacing: 3px; font-weight: 700; }
.code-invitation small { font-size: 12px; }
.grand-code { font-size: 20px; text-align: center; margin: 16px 0; }
.carte-reglages .owntracks { margin: 0; padding: 12px 16px 16px; border: 0; }

/* Recadrage de la photo de profil */
.recadrage { position: fixed; inset: 0; z-index: 1050; background: #000; color: #fff; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.recadrage p { margin: 0; padding: 20px; font-size: 18px; }
.recadrage .scene { position: relative; flex: 1; overflow: hidden; touch-action: none; }
.recadrage .scene img { position: absolute; left: 50%; top: 50%; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.recadrage .fond { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border-radius: 50%; }
.recadrage .cercle { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 9999px #0009; pointer-events: none; }
.recadrage .actions { display: flex; gap: 12px; padding: 0 20px 20px; }
.recadrage .actions .bouton { margin-top: 12px; }
.recadrage .actions .secondaire { color: #fff; border-color: #fff8; }

/* Bandeau « Nouvelle version » */
#maj { position: fixed; left: 12px; right: 12px; top: calc(8px + env(safe-area-inset-top)); z-index: 1200; display: flex; align-items: center; gap: 12px;
  background: var(--primary-container); color: var(--on-primary-container); border-radius: 16px; padding: 10px 10px 10px 16px; box-shadow: 0 3px 10px #0005; font-size: 14px; }
#maj span { flex: 1; }
#maj button { border: 0; border-radius: 999px; padding: 10px 16px; background: var(--primary); color: var(--on-primary); font-weight: 600; cursor: pointer; }

/* Glisser une bulle (à droite : répondre, à gauche : réagir), comme sur Android */
.bulle { touch-action: pan-y; }
.glisse { position: absolute; top: 50%; transform: translateY(-50%) scale(.6); opacity: 0; font-size: 22px; pointer-events: none; }
.g-rep { left: 6px; }
.g-emo { right: 6px; }
.emojis-rapides { display: flex; justify-content: space-between; gap: 6px; margin: 8px 0 4px; }
.emoji-rond { width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; font-size: 26px; cursor: pointer; padding: 0; }
.emoji-rond.choisi { background: var(--primary-container); }
.emoji-rond.plus { background: var(--surface-container-highest); color: var(--on-surface); font-size: 24px; }
.emojis-onglets { display: flex; gap: 2px; overflow-x: auto; margin: 8px 0; }
.emojis-onglets button { flex: none; border: 0; background: transparent; font-size: 22px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.emojis-onglets button.actif { background: var(--primary-container); }
.emojis-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); max-height: 40vh; overflow-y: auto; }
.emojis-grille button { border: 0; background: transparent; font-size: 26px; height: 46px; cursor: pointer; padding: 0; }

/* Message vocal, comme sur Android : barre d'enregistrement et lecteur */
.barre-envoi.enregistre > :not(.vocal-barre) { display: none !important; }
.vocal-barre { display: flex; align-items: center; gap: 6px; flex: 1; }
.vocal-barre .rouge { color: var(--rouge); }
.vocal-temps { flex: 1; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 24px; background: var(--surface-container-high); font-size: 16px; }
.point-rouge { width: 10px; height: 10px; border-radius: 50%; background: #E53935; animation: battement 1s infinite; flex: none; }
.vocal-envoyer { width: 50px; height: 50px; border: 0; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; flex: none; }
.media.audio { display: flex; align-items: center; gap: 10px; width: 230px; max-width: 100%; padding: 4px 6px; }
.vocal-rond { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, transparent); }
.bulle.a-moi .vocal-rond { color: inherit; background: color-mix(in srgb, currentColor 18%, transparent); }
.vocal-piste { flex: 1; min-width: 0; }
.vocal-avance { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--primary) 25%, transparent); overflow: hidden; }
.bulle.a-moi .vocal-avance { background: color-mix(in srgb, currentColor 25%, transparent); }
.vocal-avance i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 4px; }
.bulle.a-moi .vocal-avance i { background: currentColor; }
.vocal-piste small { display: block; margin-top: 4px; font-size: 11px; }

/* Aperçu des photos et vidéos avant l'envoi (avec un texte) */
.apercu-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 46vh; overflow-y: auto; margin-bottom: 12px; }
.apercu-grille:has(> :only-child) { grid-template-columns: 1fr; }
.apercu-case { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-container-high); }
.apercu-grille:has(> :only-child) .apercu-case { aspect-ratio: auto; max-height: 46vh; }
.apercu-case img, .apercu-case video { width: 100%; height: 100%; object-fit: cover; display: block; }
.apercu-grille:has(> :only-child) .apercu-case img, .apercu-grille:has(> :only-child) .apercu-case video { object-fit: contain; max-height: 46vh; }
.apercu-case .lecture { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; color: #fff; text-shadow: 0 2px 8px #000; pointer-events: none; }
.apercu-retirer { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 28px; padding: 0; }

/* Crédit OpenStreetMap sur la carte : obligatoire, mais tout petit et discret */
.leaflet-control-attribution.leaflet-control { font-size: 9px; line-height: 1.3; padding: 0 4px; margin: 0 0 2px 2px !important; background: rgba(255,255,255,.55); color: #333; border-radius: 4px; }
.leaflet-control-attribution a { color: #333; text-decoration: none; }

/* ---------- Ordinateur (écran large) : barre à gauche, liste + discussion côte à côte, fenêtres centrées */
@media (min-width: 960px) {
  .bureau { display: flex; height: 100%; min-height: 0; }
  .barre-cote { width: 248px; flex: none; display: flex; flex-direction: column; background: var(--surface-container-low);
    border-right: 1px solid var(--outline-variant); overflow-y: auto; }
  .barre-cote .entete-cercle { padding: 12px 4px 8px 8px; }
  .barre-cote .titre-bloc b { font-size: 19px; }
  .onglets-cote { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
  .onglets-cote a { position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 999px;
    color: var(--on-surface-variant); text-decoration: none; font-weight: 500; font-size: 15px; }
  .onglets-cote a:hover { background: var(--surface-container-high); color: var(--on-surface); }
  .onglets-cote a.actif { background: var(--primary-container); color: var(--on-primary-container); font-weight: 600; }
  .onglets-cote a:last-child { margin-top: 12px; }
  .onglets-cote .pastille-onglet { position: static; margin-left: auto; }
  .cote-liste { width: 360px; flex: none; position: relative; overflow-y: auto; border-right: 1px solid var(--outline-variant);
    background: var(--surface); padding-bottom: 88px; }
  .cote-liste .fab { position: fixed; left: calc(248px + 360px - 72px); right: auto; bottom: 16px; }
  .bureau-ecran { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; overflow-y: auto; }
  .bureau-vide { margin: auto; }
  .salon-ligne.ouverte { background: var(--surface-container-high); }
  .salon-ligne:hover { background: var(--surface-container); }
  /* Fenêtres (feuilles qui montent du bas sur téléphone) : centrées comme une boîte de dialogue */
  #feuille:not(.plein-ecran) .feuille { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(560px, 92vw);
    max-height: 86vh; border-radius: 24px; }
  /* Pages lisibles sur grand écran (pas la carte ni la discussion) : largeur limitée, centrées */
  .bureau-ecran > .agenda, .bureau-ecran > .notes, .bureau-ecran > .note-ecran, .bureau-ecran > #appareils { width: 100%; max-width: 960px; margin: 0 auto; }
  .bureau-ecran:has(> .barre-haut:not(.chat-entete)) > * { width: 100%; max-width: 860px; margin-left: auto; margin-right: auto; }
  /* La liste est déjà à gauche : pas de flèche retour dans la discussion */
  .bureau .chat-entete #retour { visibility: hidden; width: 8px; }
  /* Bulles un peu plus larges sur grand écran */
  .bulle { max-width: min(520px, 70%); }
}

/* ---------- Liste de courses (Notes) */
.courses-ecran { display: flex; flex-direction: column; min-height: 100%; }
.course-ajout { display: flex; gap: 8px; padding: 8px 16px; }
.course-ajout input { flex: 1; border-radius: 24px; padding: 12px 18px; }
.bouton-rond { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.courses-liste { padding: 4px 8px 32px; }
.course { display: flex; align-items: center; }
.course-case { flex: 1; display: flex; align-items: center; gap: 14px; background: none; border: 0; color: var(--on-surface); font: inherit; font-size: 17px; text-align: left; padding: 12px 8px; cursor: pointer; min-width: 0; }
.course-case .n-case { width: 22px; height: 22px; border-color: var(--outline); font-size: 14px; }
.course.faite .course-case { color: var(--on-surface-variant); text-decoration: line-through; }
.course-panier { display: flex; align-items: center; justify-content: space-between; padding: 16px 8px 4px; color: var(--primary); }
