/* Messagerie AquaNAC — couleurs et polices du site aquanac.fr */
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url(/polices/fredoka-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url(/polices/fredoka-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url(/polices/nunito-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 600; font-display: swap; src: url(/polices/nunito-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url(/polices/nunito-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 800; font-display: swap; src: url(/polices/nunito-sans-latin-800-normal.woff2) format("woff2"); }

:root {
  --abysse: #0f2a43;
  --abysse-2: #17395a;
  --abysse-3: #21486e;
  --aqua: #bfe8ff;
  --sable: #f6dfa4;
  --eau: #1d6fa8;
  --eau-fort: #155a8a;
  --ecume: #e5f1f9;
  --ecume-2: #d3e7f4;
  --fond: #eef4f8;
  --surface: #ffffff;
  --encre: #17283a;
  --doux: #566b7f;
  --pale: #8a9cad;
  --ligne: #dbe6ee;
  --feuille: #2f7a24;
  --feuille-fond: #e4f2dc;
  --terre: #84522a;
  --terre-fond: #f9ecd0;
  --danger: #b3261e;
  --danger-fond: #fde8e6;
  --ombre: 0 1px 2px rgba(15, 42, 67, .08), 0 8px 24px rgba(15, 42, 67, .08);
  --titre: "Fredoka", "Nunito Sans", system-ui, sans-serif;
  --texte: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --barre: 232px;
  --liste: 384px;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --abysse: #08192a;
    --abysse-2: #10304d;
    --abysse-3: #1a4468;
    --eau: #66b6ea;
    --eau-fort: #8ccaf2;
    --ecume: #143553;
    --ecume-2: #1b4268;
    --fond: #0b2036;
    --surface: #0f2a43;
    --encre: #e7eff6;
    --doux: #a3b7c9;
    --pale: #7890a6;
    --ligne: #21425f;
    --feuille: #9bd88a;
    --feuille-fond: #1d3b2a;
    --terre: #f0c98a;
    --terre-fond: #3d3122;
    --danger: #ffb4ab;
    --danger-fond: #4a1f1c;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font: 400 15px/1.45 var(--texte); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--eau); }
h1, h2, h3 { font-family: var(--titre); font-weight: 600; letter-spacing: .005em; margin: 0; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--eau); outline-offset: 2px; border-radius: 6px; }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.demarrage { height: 100vh; display: grid; place-items: center; }
.demarrage img { animation: flotte 1.6s ease-in-out infinite; }
@keyframes flotte { 50% { transform: translateY(-6px); } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--ligne); border-radius: 10px; background: var(--surface); color: var(--encre);
  font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--ecume); border-color: var(--ecume-2); }
.btn.principal { background: var(--eau); border-color: var(--eau); color: #fff; }
.btn.principal:hover { background: var(--eau-fort); border-color: var(--eau-fort); }
@media (prefers-color-scheme: dark) { .btn.principal { color: #06233a; } }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-fond); border-color: transparent; }
.btn.discret { border-color: transparent; background: transparent; }
.btn.discret:hover { background: var(--ecume); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-ic {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 0; background: transparent; color: var(--doux);
}
.btn-ic:hover { background: var(--ecume); color: var(--encre); }
.btn-ic.actif { color: var(--eau); }

/* ---------- Connexion ---------- */
.connexion {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% 110%, rgba(29, 111, 168, .16), transparent 70%),
    var(--fond);
}
.connexion form {
  width: min(400px, 100%); background: var(--surface); border-radius: 20px; padding: 28px 26px 24px;
  box-shadow: var(--ombre); display: grid; gap: 14px;
}
.connexion .logo { width: 220px; max-width: 70%; justify-self: center; margin-bottom: 4px; }
@media (prefers-color-scheme: dark) { .connexion .logo { background: #fff; border-radius: 12px; padding: 8px 12px; } }
.connexion p.intro { margin: 0 0 6px; text-align: center; color: var(--doux); font-size: 14px; }
.champ { display: grid; gap: 6px; }
.champ label { font-weight: 700; font-size: 13.5px; }
.champ input, .champ textarea, .champ select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 10px;
  background: var(--surface); font-size: 16px;
}
.champ textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.champ input:focus, .champ textarea:focus { outline: 2px solid var(--eau); outline-offset: -1px; border-color: transparent; }
.champ .aide { color: var(--doux); font-size: 13px; }
.erreur-form { color: var(--danger); background: var(--danger-fond); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.connexion .btn.principal { min-height: 46px; justify-content: center; font-size: 15px; }
.connexion .pied { text-align: center; color: var(--pale); font-size: 12.5px; }

/* ---------- Structure générale ---------- */
.coquille {
  display: grid; grid-template-columns: var(--barre) var(--liste) 1fr; height: 100vh; height: 100dvh;
}
.barre {
  background: var(--abysse); color: #dcebf6; display: flex; flex-direction: column; min-height: 0;
  padding: calc(14px + var(--haut)) 12px calc(12px + var(--bas));
}
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; }
.marque img { width: 36px; height: 36px; border-radius: 50%; }
.marque .mot { font-family: var(--titre); font-weight: 600; font-size: 21px; line-height: 1; letter-spacing: .01em; }
.marque .mot .a { color: var(--aqua); }
.marque .mot .n { color: var(--sable); }
.marque small { display: block; color: #93b2c9; font: 600 11.5px/1.2 var(--texte); margin-top: 3px; }
.ecrire {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; margin: 0 4px 14px;
  border: 0; border-radius: 16px; background: var(--aqua); color: #0f2a43;
  font: 600 16px var(--titre); letter-spacing: .01em;
}
.ecrire:hover { background: #d6f1ff; }
.ecrire svg.ic { stroke-width: 2; }
.dossiers { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.dossiers a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 12px;
  color: #cfe2f0; text-decoration: none; font-weight: 600; font-size: 14.5px;
}
.dossiers a:hover { background: var(--abysse-2); color: #fff; }
.dossiers a[aria-current="page"] { background: var(--abysse-3); color: #fff; }
.dossiers a .nb { margin-left: auto; font-size: 12.5px; font-weight: 800; color: var(--aqua); }
.dossiers a.sous { padding-left: 28px; font-weight: 400; }
.dossiers .sep { height: 1px; background: rgba(191, 232, 255, .12); margin: 10px 8px; }
.bas-barre { border-top: 1px solid rgba(191, 232, 255, .12); padding-top: 10px; display: grid; gap: 2px; }
.bas-barre a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 12px; color: #cfe2f0; text-decoration: none; font-weight: 600; font-size: 14.5px; }
.bas-barre a:hover, .bas-barre a[aria-current="page"] { background: var(--abysse-2); color: #fff; }
.bas-barre .moi { gap: 10px; }
.bas-barre .moi small { display: block; color: #93b2c9; font-weight: 600; font-size: 12px; }

/* ---------- Liste des messages ---------- */
.colonne-liste { background: var(--surface); border-right: 1px solid var(--ligne); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.entete-liste { padding: calc(14px + var(--haut)) 16px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--ligne); }
.entete-liste .ligne1 { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.entete-liste h1 { font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-mobile { display: none; }
.recherche { position: relative; }
.recherche svg.ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pale); width: 18px; height: 18px; }
.recherche input {
  width: 100%; height: 42px; padding: 0 38px 0 40px; border-radius: 12px; border: 1px solid transparent;
  background: var(--fond); font-size: 15px;
}
.recherche input:focus { outline: none; border-color: var(--eau); background: var(--surface); }
.recherche .effacer { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; }
.filtres { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px; }
.filtres::-webkit-scrollbar { display: none; }
.filtres button {
  flex: none; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ligne); background: transparent;
  font-size: 13.5px; font-weight: 700; color: var(--doux);
}
.filtres button[aria-pressed="true"] { background: var(--abysse); border-color: var(--abysse); color: #fff; }
@media (prefers-color-scheme: dark) { .filtres button[aria-pressed="true"] { background: var(--aqua); border-color: var(--aqua); color: #0f2a43; } }
.barre-selection {
  display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--ligne); background: var(--ecume);
}
.barre-selection .compte { font-weight: 800; padding: 0 8px; margin-right: auto; font-size: 14px; }
.messages { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.msg {
  position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; padding: 12px 16px 12px 12px;
  border-bottom: 1px solid var(--ligne); cursor: pointer; text-decoration: none; color: inherit;
}
.msg:focus-visible { outline: 2px solid var(--eau); outline-offset: -2px; border-radius: 0; }
.msg:hover { background: color-mix(in srgb, var(--ecume) 55%, transparent); }
.msg[aria-current="true"] { background: var(--ecume); }
.msg.choisi { background: var(--ecume-2); }
.msg .pastille {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 0; padding: 0;
  font: 600 15px var(--titre); color: #fff; align-self: start; position: relative;
}
.msg .pastille .coche { display: none; }
.msg.choisi .pastille, .msg .pastille:hover { background: var(--eau) !important; }
.msg .pastille:hover .init, .msg.choisi .pastille .init { display: none; }
.msg .pastille:hover .coche, .msg.choisi .pastille .coche { display: block; }
.msg .corps { min-width: 0; display: grid; gap: 1px; }
.msg .l1 { display: flex; align-items: baseline; gap: 8px; }
.msg .qui { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--doux); font-weight: 600; }
.msg .quand { flex: none; font-size: 12.5px; color: var(--pale); font-weight: 600; }
.msg .sujet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; color: var(--doux); }
.msg .apercu { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--pale); }
.msg.nonlu .qui, .msg.nonlu .sujet { color: var(--encre); font-weight: 800; }
.msg.nonlu .quand { color: var(--eau); font-weight: 800; }
/* Goutte d'eau : message non lu */
.msg.nonlu::before {
  content: ""; position: absolute; left: 4px; top: 27px; width: 7px; height: 7px; background: var(--eau);
  border-radius: 50% 0 50% 50%; transform: rotate(-45deg);
}
.msg .marques { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.msg .marques:empty { display: none; }
.marque-pj, .marque-favori { color: var(--pale); display: inline-flex; }
.marque-pj svg.ic, .marque-favori svg.ic { width: 15px; height: 15px; }
.marque-favori { color: #d39a14; }
.marque-favori svg.ic { fill: currentColor; }
.puce {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.puce svg.ic { width: 13px; height: 13px; stroke-width: 2.2; }
.puce.pris { background: var(--terre-fond); color: var(--terre); }
.puce.repondu { background: var(--feuille-fond); color: var(--feuille); }
.puce.envoye { background: var(--ecume); color: var(--eau); }
.plus { padding: 16px; display: grid; place-items: center; }
.vide { padding: 48px 24px; text-align: center; color: var(--doux); }
.vide h2 { font-size: 19px; color: var(--encre); margin-bottom: 6px; }
.vide p { margin: 0 auto; max-width: 32ch; }
.vide svg.illus { width: 120px; height: 90px; margin-bottom: 12px; }
.chargement { padding: 12px 16px; display: grid; gap: 14px; }
.chargement div { height: 54px; border-radius: 10px; background: linear-gradient(90deg, var(--fond), var(--ecume), var(--fond)); background-size: 200% 100%; animation: miroir 1.2s linear infinite; }
@keyframes miroir { to { background-position: -200% 0; } }

/* ---------- Lecture ---------- */
.colonne-lecture { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--fond); }
.lecture-vide { flex: 1; display: grid; place-items: center; color: var(--pale); text-align: center; padding: 24px; }
.lecture-vide img { width: 84px; opacity: .55; filter: grayscale(.3); }
.lecture-vide p { margin: 10px 0 0; font-weight: 600; }
.barre-lecture {
  display: flex; align-items: center; gap: 2px; padding: calc(10px + var(--haut)) 16px 10px; background: var(--fond);
}
.barre-lecture .espace { flex: 1; }
.retour { display: none; }
.lecture { flex: 1; overflow-y: auto; padding: 0 24px 32px; min-height: 0; overscroll-behavior: contain; }
.lecture-inner { max-width: 860px; margin: 0 auto; }
.lecture h1.sujet { font-size: 24px; line-height: 1.25; margin: 6px 0 14px; overflow-wrap: anywhere; }
.feuille-mail { background: var(--surface); border-radius: 18px; box-shadow: var(--ombre); padding: 18px 20px 14px; }
.expediteur { display: grid; grid-template-columns: 44px 1fr auto; gap: 0 12px; align-items: center; }
.expediteur .pastille { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 600 17px var(--titre); }
.expediteur .nom { font-weight: 800; font-size: 15.5px; overflow-wrap: anywhere; }
.expediteur .adresse { color: var(--doux); font-weight: 400; font-size: 14px; }
.expediteur .dest { color: var(--doux); font-size: 13.5px; overflow-wrap: anywhere; }
.expediteur .date { color: var(--pale); font-size: 13px; font-weight: 600; text-align: right; align-self: start; padding-top: 3px; }
.suivi-bandeau { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 2px; }
.suivi-bandeau .btn { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 999px; }
.suivi-bandeau .btn.prendre { border-color: var(--terre-fond); background: var(--terre-fond); color: var(--terre); }
.alerte-images {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--fond); color: var(--doux); font-size: 13.5px;
}
.alerte-images .btn { min-height: 32px; padding: 0 12px; font-size: 13px; margin-left: auto; }
.cadre-mail { width: 100%; border: 0; display: block; margin-top: 14px; min-height: 120px; background: #fff; border-radius: 6px; }
@media (prefers-color-scheme: dark) { .cadre-mail { padding: 0; outline: 10px solid #fff; outline-offset: 0; border-radius: 2px; margin: 24px 10px 10px; width: calc(100% - 20px); } }
.pjs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ligne); }
.pj {
  display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 12px 8px 10px; border-radius: 12px;
  border: 1px solid var(--ligne); text-decoration: none; color: var(--encre); background: var(--surface);
}
.pj:hover { background: var(--ecume); border-color: var(--ecume-2); }
.pj .type { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--ecume); color: var(--eau); font: 800 10px var(--texte); flex: none; }
.pj .type.pdf { background: #fde3e0; color: #a3271c; }
.pj .type.img { background: var(--feuille-fond); color: var(--feuille); }
.pj .nom { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.pj small { display: block; color: var(--pale); font-size: 12px; }
.reponses-rapides { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions-bas { display: none; }

/* ---------- Rédaction ---------- */
.voile { position: fixed; inset: 0; background: rgba(8, 25, 42, .38); z-index: 40; }
.redaction {
  position: fixed; z-index: 41; right: 24px; bottom: 0; width: min(640px, calc(100vw - 48px)); height: min(680px, calc(100vh - 40px));
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 10px 40px rgba(8, 25, 42, .35);
  display: flex; flex-direction: column; overflow: hidden;
}
.redaction header {
  display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--haut)) 10px 10px 18px; background: var(--abysse); color: #fff;
}
.redaction header h2 { font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.redaction header .btn-ic { color: #cfe2f0; }
.redaction header .btn-ic:hover { background: var(--abysse-2); color: #fff; }
.redaction .champs { border-bottom: 1px solid var(--ligne); }
.ligne-champ { display: flex; align-items: flex-start; gap: 8px; padding: 4px 14px; border-bottom: 1px solid var(--ligne); position: relative; }
.ligne-champ:last-child { border-bottom: 0; }
.ligne-champ label { flex: none; width: 52px; color: var(--doux); font-size: 14px; padding-top: 9px; }
.ligne-champ input { flex: 1; min-width: 0; border: 0; background: transparent; height: 38px; font-size: 15.5px; }
.ligne-champ input:focus { outline: none; }
.ligne-champ .basculer { flex: none; border: 0; background: none; color: var(--eau); font-weight: 700; font-size: 13px; padding: 10px 2px; }
.destinataires { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 38px; padding: 3px 0; min-width: 0; }
.destinataires input { flex: 1 1 140px; height: 32px; }
.jeton {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 28px; padding: 0 4px 0 10px; border-radius: 999px;
  background: var(--ecume); font-size: 13.5px; font-weight: 600;
}
.jeton.faux { background: var(--danger-fond); color: var(--danger); }
.jeton span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jeton button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; padding: 0; color: var(--doux); }
.jeton button:hover { background: var(--ecume-2); }
.jeton svg.ic { width: 14px; height: 14px; }
.suggestions {
  position: absolute; z-index: 5; left: 60px; right: 14px; top: 100%; margin-top: -2px; list-style: none; padding: 6px; margin-bottom: 0;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: 12px; box-shadow: var(--ombre); max-height: 260px; overflow-y: auto;
}
.suggestions li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: grid; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--ecume); }
.suggestions small { color: var(--doux); }
.outils { display: flex; gap: 2px; padding: 4px 8px; border-bottom: 1px solid var(--ligne); }
.outils .btn-ic { width: 36px; height: 36px; }
.editeur {
  flex: 1; min-height: 120px; overflow-y: auto; padding: 14px 18px; font-size: 15.5px; line-height: 1.55; outline: none;
}
.editeur:empty::before { content: attr(data-placeholder); color: var(--pale); }
.editeur blockquote { margin: 0 0 0 .4em; padding-left: .8em; border-left: 3px solid var(--ecume-2); color: var(--doux); }
.apercu-signature { padding: 0 18px 10px; color: var(--pale); font-size: 13.5px; white-space: pre-line; }
.citation-origine { margin: 0 18px 10px; border: 1px dashed var(--ligne); border-radius: 12px; padding: 8px 12px; font-size: 13.5px; color: var(--doux); display: grid; gap: 6px; }
.citation-origine label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.citation-origine input { width: 18px; height: 18px; accent-color: var(--eau); }
.fichiers { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.fichiers .jeton { background: var(--fond); }
.pied-redaction { display: flex; align-items: center; gap: 6px; padding: 10px 14px calc(10px + var(--bas)); border-top: 1px solid var(--ligne); }
.pied-redaction .btn.principal { min-height: 44px; padding: 0 22px; border-radius: 12px; font-size: 15px; }
.pied-redaction .etat { color: var(--pale); font-size: 12.5px; margin-left: auto; }
.depot { outline: 3px dashed var(--eau); outline-offset: -8px; }

/* ---------- Pages Équipe et Mon compte ---------- */
.page { grid-column: 2 / 4; overflow-y: auto; padding: calc(24px + var(--haut)) 32px calc(40px + var(--bas)); background: var(--fond); min-height: 0; }
.page-inner { max-width: 760px; margin: 0 auto; display: grid; gap: 20px; }
.page h1 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
.page .menu-mobile { margin-left: -8px; }
.bloc { background: var(--surface); border-radius: 18px; box-shadow: var(--ombre); padding: 20px; display: grid; gap: 14px; }
.bloc h2 { font-size: 18px; }
.bloc > p { margin: 0; color: var(--doux); }
.membres { list-style: none; margin: 0; padding: 0; display: grid; }
.membre { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--ligne); }
.membre:first-child { border-top: 0; }
.membre .pastille { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 600 17px var(--titre); }
.membre .nom { font-weight: 800; }
.membre .info { color: var(--doux); font-size: 13.5px; }
.membre .actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.etiquette-admin { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--ecume); color: var(--eau); font-size: 12px; font-weight: 800; vertical-align: 1px; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.case { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.case input { width: 20px; height: 20px; accent-color: var(--eau); }
.acces-cree { background: var(--feuille-fond); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.acces-cree pre { margin: 0; white-space: pre-wrap; font: 600 14px/1.5 var(--texte); color: var(--encre); }
.acces-cree .boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.journal { list-style: none; margin: 0; padding: 0; display: grid; font-size: 13.5px; }
.journal li { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--ligne); }
.journal li:first-child { border-top: 0; }
.journal time { color: var(--pale); font-weight: 600; }
.etapes { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--encre); }

/* ---------- Petites fenêtres et messages ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + var(--bas)); transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: 14px; background: var(--abysse); color: #fff;
  box-shadow: 0 8px 30px rgba(8, 25, 42, .35); font-weight: 600; font-size: 14.5px; animation: monte .18s ease-out;
}
.toast.erreur { background: #8c1d16; }
.toast button { border: 0; background: none; color: var(--aqua); font-weight: 800; padding: 4px 6px; }
@keyframes monte { from { transform: translateY(8px); opacity: 0; } }
.menu-deroulant {
  position: fixed; z-index: 50; min-width: 220px; max-height: 60vh; overflow-y: auto; background: var(--surface); border-radius: 14px;
  box-shadow: 0 10px 34px rgba(8, 25, 42, .25); padding: 6px; border: 1px solid var(--ligne);
}
.menu-deroulant button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 10px 12px; border-radius: 9px; text-align: left; font-weight: 600; font-size: 14px; }
.menu-deroulant button:hover, .menu-deroulant button:focus-visible { background: var(--ecume); }
.menu-deroulant .titre { padding: 8px 12px 4px; color: var(--pale); font-size: 12.5px; font-weight: 700; }
.bandeau-info { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: var(--terre-fond); color: var(--terre); font-weight: 700; font-size: 13.5px; }
.bandeau-info .btn { min-height: 32px; font-size: 13px; margin-left: auto; }
.hors-ligne { background: var(--danger-fond); color: var(--danger); }
.fab { display: none; }

/* ---------- Tablette : la barre devient un tiroir ---------- */
@media (max-width: 1099px) {
  .coquille { grid-template-columns: var(--liste) 1fr; }
  .barre {
    position: fixed; z-index: 45; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease, visibility .22s;
    visibility: hidden;
  }
  .tiroir-ouvert .barre { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(8, 25, 42, .4); }
  .tiroir-ouvert .voile-tiroir { position: fixed; inset: 0; z-index: 44; background: rgba(8, 25, 42, .38); }
  .menu-mobile { display: inline-grid; }
  .page { grid-column: 1 / 3; }
  .messages { padding-bottom: 90px; }
  .fab {
    display: flex; position: fixed; z-index: 30; right: 18px; bottom: calc(18px + var(--bas)); height: 56px; padding: 0 22px 0 18px; gap: 10px;
    align-items: center; border: 0; border-radius: 18px; background: var(--aqua); color: #0f2a43; font: 600 16px var(--titre);
    box-shadow: 0 6px 20px rgba(15, 42, 67, .3);
  }
  .fab svg.ic { stroke-width: 2; }
}

/* ---------- Téléphone : une colonne à la fois ---------- */
@media (max-width: 759px) {
  :root { --liste: 100vw; }
  body { font-size: 16px; }
  .coquille { grid-template-columns: 1fr; }
  .colonne-liste { border-right: 0; }
  .colonne-lecture { position: fixed; inset: 0; z-index: 20; transform: translateX(100%); transition: transform .2s ease; background: var(--surface); }
  .en-lecture .colonne-lecture { transform: none; }
  .en-lecture .fab { display: none; }
  .colonne-lecture .lecture-vide { display: none; }
  .barre-lecture { background: var(--surface); padding-left: 6px; padding-right: 6px; border-bottom: 1px solid var(--ligne); }
  .retour { display: inline-grid; }
  .barre-lecture .large { display: none; }
  .lecture { padding: 0 0 calc(84px + var(--bas)); background: var(--surface); }
  .lecture h1.sujet { font-size: 21px; margin: 14px 16px 10px; }
  .feuille-mail { border-radius: 0; box-shadow: none; padding: 4px 16px 14px; }
  .expediteur { grid-template-columns: 40px 1fr; }
  .expediteur .pastille { width: 40px; height: 40px; }
  .expediteur .date { grid-column: 2; text-align: left; padding: 0; }
  .reponses-rapides { display: none; }
  .actions-bas {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; gap: 4px; padding: 8px 10px calc(8px + var(--bas));
    background: var(--surface); border-top: 1px solid var(--ligne);
  }
  .actions-bas button {
    flex: 1; display: grid; justify-items: center; gap: 2px; border: 0; background: none; padding: 6px 0; border-radius: 12px;
    font-size: 12px; font-weight: 700; color: var(--doux);
  }
  .actions-bas button:active { background: var(--ecume); }
  .actions-bas svg.ic { width: 22px; height: 22px; }
  .redaction { inset: 0; width: 100%; height: 100%; border-radius: 0; right: 0; }
  .voile { display: none; }
  .page { grid-column: 1; padding: calc(12px + var(--haut)) 14px calc(32px + var(--bas)); }
  .bloc { padding: 16px; border-radius: 16px; }
  .grille-2 { grid-template-columns: 1fr; }
  .membre { grid-template-columns: 40px 1fr; }
  .membre .actions { grid-column: 1 / 3; justify-content: flex-start; }
  .journal li { grid-template-columns: 1fr; gap: 0; }
  .msg { padding-right: 14px; }
  .toasts { bottom: calc(88px + var(--bas)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
