/* =========================================================================
   BigoMail — système de design
   Idée directrice : l'enveloppe et la lettre. Le cadre de l'application est
   l'enveloppe (vert profond du nom BigoMail, motif gravé ton sur ton), le
   contenu est la lettre (papier blanc, net, sans effet). Le jaune du rabat
   ne sert qu'à l'action d'écrire et aux repères actifs.
   ========================================================================= */

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

:root {
  --bg: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --surface-3: #e4ece9;
  --hover: rgba(23, 60, 48, .06);
  --press: rgba(23, 60, 48, .1);
  --line: #e3e9e6;
  --line-strong: #ccd8d3;
  --fg: #15231e;
  --fg-2: #33433d;
  --muted: #5f6f69;
  --faint: #9aa8a3;
  --brand: #237257;
  --brand-strong: #22634d;
  --brand-ink: #ffffff;
  --brand-soft: #dcf0e8;
  --brand-softer: #edf7f3;
  --yellow: #f5e29a;
  --yellow-soft: #fbf2cc;
  --yellow-ink: #4d3f05;
  --danger: #c0392f;
  --danger-soft: #fdeceb;
  --warn: #9a6200;
  --warn-soft: #fff4d9;
  --ok: #1e7a55;
  --ok-soft: #e2f4eb;
  --unread: #0f1d18;
  --scrim: rgba(10, 22, 18, .42);
  --glass: rgba(255, 255, 255, .14);
  /* Cadre « enveloppe » */
  --frame: #2a6852;
  --frame-img: url("/img/motif-vert.jpg");
  --on-frame: #ffffff;
  --on-frame-2: rgba(255, 255, 255, .78);
  --on-frame-3: rgba(255, 255, 255, .56);
  --frame-hover: rgba(255, 255, 255, .08);
  --frame-on: rgba(255, 255, 255, .15);
  --frame-line: rgba(255, 255, 255, .2);
  --flap: #f6e3a0;
  --flap-ink: #3b3104;
  --shadow-1: 0 1px 2px rgba(16, 40, 32, .08);
  --shadow-2: 0 10px 28px rgba(16, 40, 32, .14), 0 2px 6px rgba(16, 40, 32, .06);
  --shadow-3: 0 24px 64px rgba(16, 40, 32, .26), 0 4px 14px rgba(16, 40, 32, .1);
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --brand-font: "Montserrat", var(--font);
  --row-pad: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1110; --surface: #151a18; --surface-2: #1c2321; --surface-3: #252e2b;
  --hover: rgba(200, 240, 225, .06); --press: rgba(200, 240, 225, .1);
  --line: #232c29; --line-strong: #33403b;
  --fg: #e8f0ec; --fg-2: #c3cfca; --muted: #8e9e98; --faint: #66756f;
  --brand: #5cc39f; --brand-strong: #7fd5b4; --brand-ink: #062a1e; --brand-soft: #193a2f; --brand-softer: #132620;
  --yellow: #f1da86; --yellow-soft: #39321b; --yellow-ink: #f6e7ad;
  --danger: #f07e72; --danger-soft: #3a1c19; --warn: #f2b94f; --warn-soft: #382c14; --ok: #5cc39f; --ok-soft: #15302a;
  --unread: #ffffff; --scrim: rgba(0, 0, 0, .6); --glass: rgba(255, 255, 255, .1);
  --frame: #12201b; --flap: #ecd88c;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px rgba(0, 0, 0, .5); --shadow-3: 0 24px 60px rgba(0, 0, 0, .65);
  color-scheme: dark;
}
:root[data-density="compact"] { --row-pad: 7px; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
body.is-auth { overflow: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-strong); }
img { max-width: 100%; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.inline { width: 16px; height: 16px; vertical-align: -3px; }
.ic.inline-ok { width: 14px; height: 14px; vertical-align: -2px; color: #fff; background: var(--ok); border-radius: 50%; padding: 2px; stroke-width: 3; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--yellow); color: #1b1600; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; word-break: break-all; }
.small { font-size: 12px; }

/* Ouverture : animation officielle (vidéo aux bords fondus dans la couleur du fond, js/splash.js).
   Le logo garde la même taille relative sur tous les écrans : les bords de la vidéo, unis, peuvent dépasser. */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; background: #fbfdfe; cursor: pointer; }
.boot .splash-media { --w: clamp(486px, 97vmin, 973px); position: absolute; width: var(--w); height: calc(var(--w) * 9 / 16); left: calc(50% - var(--w) / 2); top: calc(50% - var(--w) * 9 / 32); }
.boot .splash-media video, .boot .splash-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.boot .splash-veil { position: absolute; inset: 0; background: #fbfdfe; opacity: 0; transition: opacity .26s ease; pointer-events: none; }
.boot .splash-veil.on { opacity: 1; }
.boot .splash-skip { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); padding: 8px 14px; border: 0; border-radius: 999px; background: rgba(23, 60, 48, .07); color: #33433d; font: 500 13px/1 system-ui, sans-serif; cursor: pointer; }
.boot.out { opacity: 0; transition: opacity .3s ease; pointer-events: none; }

.wordmark { font-family: var(--brand-font); font-weight: 800; letter-spacing: -.02em; color: var(--brand-strong); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  background: var(--surface-2); color: var(--fg); font-weight: 600; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-3); }
.btn:active { filter: brightness(.94); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.outline { background: transparent; border-color: var(--line-strong); color: var(--brand-strong); }
.btn.outline:hover { background: var(--brand-softer); }
.btn.ghost { background: transparent; color: var(--brand-strong); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-text { color: var(--danger); }
.btn.sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; min-height: 46px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.loading { color: transparent !important; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--brand-ink); border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--fg-2);
  transition: background .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.icon-btn:active { background: var(--press); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.icon-btn.round { background: var(--surface-2); }
.icon-btn.on { color: var(--danger); background: var(--danger-soft); }
.text-btn { border: 0; background: none; color: var(--brand-strong); font-weight: 600; padding: 6px 10px; border-radius: var(--r-sm); }
.text-btn:hover { background: var(--hover); }
.text-btn.sm { font-size: 12px; padding: 4px 8px; }

/* ---------- Champs ---------- */
.form { display: grid; gap: 16px; }
.field-label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--fg-2); }
.field-label .opt { font-weight: 400; color: var(--muted); }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.input {
  display: flex; align-items: center; min-height: 46px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-strong); transition: border-color .15s, box-shadow .15s;
}
.input:focus-within { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.input input, .input textarea { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 11px 14px; font-size: 15px; font-weight: 400; }
.input textarea { resize: vertical; line-height: 1.5; }
.input em { font-style: normal; color: var(--muted); padding-inline-end: 14px; white-space: nowrap; }
.input .reveal { border: 0; background: none; color: var(--muted); padding: 0 12px; height: 44px; }
.form-error { color: var(--danger); margin: 0; font-size: 13px; }
.form-error:empty { display: none; }

.switch {
  appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line-strong);
  position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0;
}
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- Avatars ---------- */
.avatar {
  --s: 40px; --c: var(--brand);
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 600; font-size: calc(var(--s) * .38); letter-spacing: .02em;
  user-select: none;
}
.avatar.avatar-sys { background: #fff; overflow: hidden; border: 1px solid var(--line); }
.avatar.avatar-sys img { width: 100%; height: 100%; object-fit: cover; }
.avatar-badge {
  position: absolute; inset-inline-end: -2px; bottom: -2px; width: 40%; height: 40%; min-width: 14px; min-height: 14px;
  display: grid; place-items: center; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface);
}
.avatar-badge .ic { width: 70%; height: 70%; stroke: #fff; stroke-width: 3.5; }

/* ---------- Puces ---------- */
.chip-s {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--fg-2); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.chip-s .ic { width: 13px; height: 13px; }
.chip-s.danger { background: var(--danger-soft); color: var(--danger); }
.chip-s.draft { background: var(--danger-soft); color: var(--danger); }
.chip-s.cat-factures { background: var(--yellow-soft); color: var(--yellow-ink); }
.chip-s.cat-administration { background: var(--brand-soft); color: var(--brand-strong); }
.chip-s.cat-promotions { background: #e6eefb; color: #2d5ea8; }
:root[data-theme="dark"] .chip-s.cat-promotions { background: #1b2a40; color: #8fb6f0; }

/* =========================================================================
   Connexion
   ========================================================================= */
/* Connexion, verre façon iOS : la carte, les champs et les boutons sont des plaques de verre
   dépoli posées sur le motif vert de la marque (flou + saturation, liseré lumineux en haut). */
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px;
  background: var(--frame) var(--frame-img) 0 0 / 520px auto repeat;
}
.auth-top { display: none; }
.auth-card {
  width: min(380px, 100%); padding: 34px 28px 26px; border-radius: 34px;
  background: rgba(255, 255, 255, .64);
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .3), 0 30px 80px -24px rgba(0, 20, 12, .45);
}
.auth-logo { display: block; width: 52px; margin: 0 auto; line-height: 0; }
.auth-logo img { width: 100%; height: auto; }
.auth-title { margin: 18px 0 24px; text-align: center; font: 700 22px/1.2 var(--brand-font); letter-spacing: -.02em; color: var(--fg); }
.auth-form { display: grid; gap: 10px; }

/* Champ capsule en verre */
.nf {
  display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 6px 0 18px; border-radius: 999px; cursor: text;
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 2px rgba(20, 50, 40, .08); transition: background .2s, box-shadow .2s;
}
.nf:focus-within { background: rgba(255, 255, 255, .9); box-shadow: inset 0 1px 2px rgba(20, 50, 40, .06), 0 0 0 3px rgba(34, 99, 77, .18); }
.nf input { flex: 1; min-width: 0; width: 0; height: 100%; border: 0; outline: none; background: none; font-size: 15px; color: var(--fg); }
.nf input::placeholder { color: #6f807a; }
.nf em { font-style: normal; font-size: 14px; color: var(--muted); white-space: nowrap; padding-inline-end: 12px; }
.nf .reveal { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.nf .reveal .ic { width: 17px; height: 17px; }

/* Boutons en verre (le principal est teinté du vert de la marque) */
.neu-btn {
  position: relative; width: 100%; height: 44px; border-radius: 999px; color: var(--fg); font: 600 14.5px var(--font); letter-spacing: .005em;
  background: rgba(255, 255, 255, .45); border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 14px -6px rgba(0, 20, 12, .2); transition: background .15s;
}
.neu-btn:hover { background: rgba(255, 255, 255, .7); }
.neu-btn:active { background: rgba(255, 255, 255, .85); }
.neu-btn.primary {
  margin-top: 6px; color: #fff; background: rgba(28, 88, 68, .92); border-color: rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(0, 0, 0, .15), 0 8px 20px -8px rgba(0, 30, 20, .55);
}
.neu-btn.primary:hover { background: rgba(24, 78, 60, .96); }
.neu-btn.primary:active { background: #164536; }
.neu-btn:disabled { opacity: .6; }
.neu-btn.loading { color: transparent !important; }
.neu-btn.loading::after { content: ""; position: absolute; inset-inline-start: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #fff; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.auth .form-error { text-align: center; font-size: 13px; color: #a3261c; }

@media (max-width: 760px) {
  .auth { padding: calc(var(--safe-t) + 20px) 14px calc(var(--safe-b) + 20px); }
  .auth-card { padding: 30px 20px 22px; border-radius: 30px; }
  .nf { height: 48px; }
  .nf input { font-size: 16px; }
  .neu-btn { height: 46px; }
}

/* =========================================================================
   Structure (bureau) : le cadre vert entoure la feuille de travail
   ========================================================================= */
.shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 76px 248px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  grid-template-areas: "top top top" "rail side stage";
  background: var(--frame) var(--frame-img) 0 0 / 560px auto repeat;
  color: var(--on-frame);
}
:root[data-theme="dark"] .shell { background-color: #0f1a16; background-blend-mode: multiply; }
.shell.collapsed { grid-template-columns: 76px 0 minmax(0, 1fr); }
.shell.collapsed .sidebar { visibility: hidden; }

.topbar { grid-area: top; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; min-width: 0; }
.topbar > .icon-btn, .top-actions > .icon-btn { color: var(--on-frame-2); }
.topbar > .icon-btn:hover, .top-actions > .icon-btn:hover { background: var(--frame-hover); color: var(--on-frame); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; width: 218px; flex: none; padding-inline-start: 6px; }
.brand img { width: 36px; height: auto; }
/* Le nom officiel est vert foncé : il ne se pose pas sur le cadre vert. Le cadre porte l'enveloppe seule. */
.brand .wordmark { display: none; }
.searchbar {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 720px; height: 44px; padding: 0 8px 0 14px;
  background: var(--surface); border-radius: var(--r); color: var(--muted); transition: box-shadow .15s;
}
.searchbar:focus-within { box-shadow: 0 0 0 3px var(--flap); }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 15px; color: var(--fg); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 2px; }
.data-chip, .net-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--frame-line); background: transparent; color: var(--on-frame); font-weight: 600; font-size: 12px; margin-inline-end: 6px;
}
.data-chip .ic, .net-chip .ic { width: 16px; height: 16px; }
.net-chip { color: var(--flap-ink); border-color: transparent; background: var(--flap); }
.me-btn { border: 0; background: none; padding: 2px; border-radius: 50%; margin-inline-start: 6px; box-shadow: 0 0 0 2px var(--frame-line); }
.me-btn:hover { box-shadow: 0 0 0 2px var(--on-frame); }

.rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 16px; }
.rail-item { display: grid; justify-items: center; gap: 4px; width: 68px; padding: 4px 0; color: var(--on-frame-2); text-decoration: none; font-size: 11.5px; font-weight: 600; }
.rail-ic { position: relative; display: grid; place-items: center; width: 52px; height: 32px; border-radius: var(--r); transition: background .15s; }
.rail-item:hover { color: var(--on-frame); }
.rail-item:hover .rail-ic { background: var(--frame-hover); }
.rail-item.active .rail-ic { background: var(--flap); color: var(--flap-ink); }
.rail-item.active { color: var(--on-frame); }
.rail-item.active .ic { stroke-width: 2.1; }
.rail-item[data-badge] .rail-ic::after, .tab-item[data-badge]::after {
  content: ""; position: absolute; top: 4px; inset-inline-end: 12px; width: 8px; height: 8px; border-radius: 50%; background: #e2574c; border: 2px solid var(--frame);
}
.rail-spacer { flex: 1; }

.sidebar { grid-area: side; min-height: 0; display: flex; overflow: hidden; }
.sidebar-main { flex: 1; min-width: 0; overflow-y: auto; padding: 8px 12px 16px 4px; display: flex; flex-direction: column; scrollbar-color: var(--frame-line) transparent; }
.drawer-accounts { display: none; }
.scrim { display: none; }

/* « Écrire » : la seule grande surface jaune du cadre, comme le rabat de l'enveloppe */
.compose-btn {
  display: flex; align-items: center; gap: 12px; width: calc(100% - 8px);
  height: 48px; padding: 0 18px 0 16px; margin: 0 0 18px 8px; border: 0; border-radius: var(--r);
  background: var(--flap); color: var(--flap-ink); font-weight: 700; font-size: 14px;
  transition: filter .15s;
}
.compose-btn:hover { filter: brightness(1.04); }
.compose-btn:active { filter: brightness(.95); }
.compose-btn .ic { width: 20px; height: 20px; }

.folder-nav { display: grid; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 14px; height: 36px; padding: 0 12px 0 16px; margin-inline-start: 8px;
  border-radius: var(--r); color: var(--on-frame-2); text-decoration: none; font-size: 14px;
}
.nav-item:hover { background: var(--frame-hover); color: var(--on-frame); }
.nav-item.active { background: var(--frame-on); color: var(--on-frame); font-weight: 700; }
.nav-item.active::before { content: ""; position: absolute; inset-inline-start: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 2px 2px 0; background: var(--flap); }
.nav-item.active .ic { stroke-width: 2.1; }
.nav-item .ic { width: 19px; height: 19px; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; font-weight: 700; color: var(--flap); font-variant-numeric: tabular-nums; }
.nav-section { margin-top: 22px; }
.nav-section h3 { margin: 0 0 6px 24px; font-size: 11px; font-weight: 700; color: var(--on-frame-3); text-transform: uppercase; letter-spacing: .08em; }

.side-card {
  margin: 22px 0 0 8px; padding: 12px 14px; border-radius: var(--r); background: transparent; border: 1px solid var(--frame-line); cursor: pointer; color: var(--on-frame);
}
.side-card:hover { background: var(--frame-hover); }
.side-card-head { display: flex; align-items: center; gap: 8px; color: var(--on-frame); }
.side-card-head .ic { width: 18px; height: 18px; color: var(--flap); }
.side-card p { margin: 6px 0 8px; font-size: 12px; color: var(--on-frame-2); }
.side-card b { color: var(--on-frame); }
.meter { height: 4px; border-radius: 2px; background: var(--frame-line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--flap); border-radius: 2px; transition: width .4s; }
.side-foot { margin-top: auto; padding: 18px 0 0 24px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--on-frame-3); }
.side-foot .ic { width: 14px; height: 14px; color: var(--on-frame-2); }
.side-hint { color: var(--on-frame-2); font-size: 12.5px; padding: 0 24px; }
/* Tout ce qui vit dans le cadre (agenda, contacts, réglages) reprend ses couleurs */
.sidebar {
  --fg: #ffffff; --fg-2: rgba(255, 255, 255, .82); --muted: rgba(255, 255, 255, .6); --faint: rgba(255, 255, 255, .38);
  --hover: rgba(255, 255, 255, .08); --press: rgba(255, 255, 255, .12); --line: rgba(255, 255, 255, .16);
  --brand-soft: rgba(255, 255, 255, .15); --brand-softer: rgba(255, 255, 255, .1); --brand-strong: #ffffff;
  color: var(--fg);
}
.sidebar .set-group { background: transparent; box-shadow: none; border: 0; overflow: visible; }
.sidebar .set-row { min-height: 38px; margin-inline-start: 8px; border-radius: var(--r); color: var(--fg-2); }
.sidebar .set-row + .set-row::before, .sidebar .set-row .chev { display: none; }
.sidebar .set-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .set-row.active { color: var(--fg); font-weight: 700; }
.sidebar .set-group-title { margin-inline-start: 24px; font-size: 11px; letter-spacing: .08em; }
.sidebar .set-row.active { background: var(--frame-on); }
.sidebar .mc-day.today { background: var(--flap); color: var(--flap-ink); }
.sidebar .mc-day.has::after { background: var(--flap); }
.sidebar .mc-day.today.has::after { background: var(--flap-ink); }

.stage { grid-area: stage; min-width: 0; min-height: 0; padding: 0 12px 12px 0; color: var(--fg); }
.stage > section { height: 100%; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.tabbar, .fab, .m-hero, [data-mobile] { display: none; }
/* Bouton « écrire » flottant quand la barre latérale est masquée (tablette, menu replié) */
.fab { place-items: center; position: fixed; inset-inline-end: 28px; bottom: 28px; z-index: 25; width: 56px; height: 56px; border: 0; border-radius: 16px;
  background: var(--flap); color: var(--flap-ink); box-shadow: var(--shadow-2); }
.fab .ic { width: 24px; height: 24px; }
.shell.collapsed .mail-view .fab { display: grid; }

/* ---------- Spinner, états vides ---------- */
.spinner { width: 28px; height: 28px; margin: 28px auto; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-state img { display: none; }
.empty-state strong { color: var(--fg); font: 700 17px var(--brand-font); letter-spacing: -.01em; }
.empty-state p { margin: 0; max-width: 300px; }
.list-note { text-align: center; color: var(--muted); padding: 24px; }

/* =========================================================================
   Messagerie
   ========================================================================= */
.mail-view { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); }
.list-pane { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--line); }
.list-head { flex: none; border-bottom: 1px solid var(--line); }
.list-title { margin: 0; padding: 16px 20px 12px; font: 700 18px var(--brand-font); letter-spacing: -.01em; }
.cat-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  position: relative; display: flex; align-items: center; gap: 8px; flex: 1 0 auto; height: 52px; padding: 0 14px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap;
}
.cat-tab:hover { background: var(--hover); }
.cat-tab .ic { width: 18px; height: 18px; }
.cat-tab.on { color: var(--brand-strong); }
.cat-tab.on::after { content: ""; position: absolute; inset-inline-start: 10px; inset-inline-end: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.cat-tab b, .chip b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-size: 11px; display: inline-grid; place-items: center; }
.cat-tab:nth-child(2) b { background: var(--flap); color: var(--flap-ink); }

.list-tools { flex: none; display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--line); }
.list-tools.selecting { background: var(--brand-softer); }
.tools-spacer { flex: 1; }
.list-range { color: var(--muted); font-size: 12px; margin-inline-end: 4px; }
.sel-count { font-weight: 700; margin: 0 8px 0 4px; white-space: nowrap; }
.tool-group { display: flex; overflow-x: auto; scrollbar-width: none; flex: 1; }
.check-all, .row-check { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; }
.check-all:hover, .row-check:hover { background: var(--hover); }
.check-all input, .row-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.check-all span, .row-check span { width: 18px; height: 18px; border: 2px solid var(--faint); border-radius: 5px; transition: all .12s; }
.check-all input:checked + span, .row-check input:checked + span {
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
  border-color: var(--brand);
}

.list-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ptr { height: 0; overflow: hidden; display: grid; place-items: center; color: var(--brand); transition: height .2s; }
.ptr .ic { transition: transform .2s; }
.ptr.ready .ic { transform: rotate(180deg); }
.ptr.spin .ic { animation: spin .8s linear infinite; }
.msg-list { list-style: none; margin: 0; padding: 0; }
.group-head { position: sticky; top: 0; z-index: 2; padding: 12px 20px 6px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface); text-transform: uppercase; letter-spacing: .08em; }

.row { position: relative; overflow: hidden; cursor: pointer; }
.row-inner {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  padding: var(--row-pad) 12px var(--row-pad) 8px; background: var(--surface); transition: transform .25s ease, background .12s;
  box-shadow: inset 0 -1px 0 var(--line);
}
.row.swiping .row-inner { transition: none; }
.row:hover .row-inner { background: color-mix(in srgb, var(--surface) 92%, var(--brand)); }
.row.active .row-inner { background: var(--brand-soft); }
.row.selected .row-inner { background: var(--yellow-soft); }
.row.unread .row-inner::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.row-check { margin-top: 2px; display: none; }
.row:hover .row-check, .row.selected .row-check, .list-tools.selecting ~ .list-scroll .row-check { display: inline-grid; }
.row:hover .row-avatar, .row.selected .row-avatar, .list-tools.selecting ~ .list-scroll .row-avatar { display: none; }
.row-avatar { padding: 0 0 0 4px; }
:root[data-density="compact"] .row-avatar .avatar { --s: 32px !important; }
.row-main { flex: 1; min-width: 0; }
.row-top { display: flex; align-items: center; gap: 6px; }
.row-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; color: var(--fg-2); }
.row time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row.unread .row-from, .row.unread .row-subject { font-weight: 700; color: var(--unread); }
.row.unread time { color: var(--brand-strong); font-weight: 700; }
.row-subject { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); margin-top: 1px; }
.row-snippet { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
:root[data-density="compact"] .row-snippet { display: none; }
.row-icons { display: inline-flex; color: var(--muted); }
.row-icons .ic { width: 15px; height: 15px; }
.row-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.verified-dot { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--ok); flex: none; }
.verified-dot .ic { width: 10px; height: 10px; stroke: #fff; stroke-width: 4; }
.row-star { position: absolute; inset-inline-end: 8px; bottom: calc(var(--row-pad) - 4px); border: 0; background: none; color: var(--faint); padding: 4px; border-radius: 50%; opacity: 0; }
.row-star .ic { width: 18px; height: 18px; }
.row:hover .row-star, .row-star.on { opacity: 1; }
.row-star.on { color: #e0a800; }
.row-star.on .ic, .star-btn.on .ic { fill: #f2c12e; stroke: #d39b00; }
.row-hover { position: absolute; inset-inline-end: 8px; top: 6px; display: none; gap: 0; background: inherit; border-radius: 20px; }
.row:hover .row-hover { display: flex; background: var(--surface); box-shadow: var(--shadow-1); }
.row:hover .row-top time { visibility: hidden; }
.swipe-bg { position: absolute; inset: 0; display: none; align-items: center; gap: 8px; padding: 0 24px; color: #fff; font-weight: 700; }
.swipe-bg.left { justify-content: flex-end; background: var(--brand); }
.swipe-bg.right { justify-content: flex-start; background: #3b6fb5; }
.row[data-dir="left"].swiping .swipe-bg.left, .row[data-dir="right"].swiping .swipe-bg.right { display: flex; }
.list-end { min-height: 24px; }

/* ---------- Lecture ---------- */
.read-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.read-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; color: var(--muted); padding: 24px; height: 100%; }
.read-empty img { display: none; }
.read-empty > .ic { width: 56px; height: 56px; stroke-width: 1.2; }
.read-empty strong { display: inline-block; margin-bottom: 4px; color: var(--fg); font: 700 17px var(--brand-font); letter-spacing: -.01em; }
.read-loading { flex: 1; display: grid; place-items: center; }
.reader { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reader-bar { flex: none; display: flex; align-items: center; height: 52px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.reader-actions { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.bar-sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 6px; flex: none; }
.reader-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 32px 40px; }
.reader-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.reader-head h1 { flex: 1; margin: 0; font: 700 24px/1.25 var(--brand-font); letter-spacing: -.02em; word-wrap: break-word; }
.reader-tags { display: flex; align-items: center; gap: 6px; padding-top: 4px; }
.star-btn { border: 0; background: none; color: var(--faint); padding: 4px; border-radius: 50%; }
.star-btn:hover { background: var(--hover); }
.star-btn.on { color: #e0a800; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); margin: 0 0 16px; font-size: 13.5px; }
.banner > .ic { width: 22px; height: 22px; margin-top: 1px; }
.banner > div { flex: 1; }
.banner strong { display: block; margin-bottom: 2px; }
.banner ul { margin: 6px 0; padding-inline-start: 18px; }
.banner p { margin: 4px 0 0; }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.danger strong, .banner.danger p, .banner.danger li { color: var(--fg); }
.banner.danger strong { color: var(--danger); }
.banner.warn { background: var(--warn-soft); }
.banner.warn > .ic { color: var(--warn); }
.banner.ok { background: var(--ok-soft); }
.banner.ok > .ic { color: var(--ok); }
.banner.ok strong { color: var(--ok); }
.banner.plain { background: var(--surface-2); align-items: center; color: var(--fg-2); }
.banner.plain > .ic { color: var(--brand); }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.sender { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.sender-main { flex: 1; min-width: 0; }
.sender-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.sender-line strong { font-size: 15px; }
.sender-addr { color: var(--muted); font-size: 13px; word-break: break-all; }
.sender-to { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 2px 0; color: var(--muted); font-size: 13px; max-width: 100%; text-align: start; }
.sender-to .ic { width: 16px; height: 16px; transition: transform .2s; }
.sender-to.open .ic { transform: rotate(180deg); }
.sender-details { margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; }
.sender-details dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.sender-details dt { color: var(--muted); }
.sender-details dd { margin: 0; word-break: break-word; }
.sender-side { display: flex; align-items: center; gap: 2px; }
.sender-side time { color: var(--muted); font-size: 12.5px; white-space: nowrap; margin-inline-end: 4px; }

.mail-body { margin-bottom: 8px; }
.mail-frame { width: 100%; border: 0; min-height: 120px; display: block; background: #fff; border-radius: 10px; }
.mail-frame.on-dark { border-radius: 12px; }
.mail-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; }

.voices { display: grid; gap: 10px; margin-bottom: 16px; }
.voice-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--brand-softer); border: 1px solid var(--brand-soft); }
.voice-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); flex: none; }
.voice-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.voice-main small { color: var(--muted); }
.voice-main audio { width: 100%; height: 40px; margin-top: 6px; }

.atts { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.atts h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--fg); transition: border-color .15s, box-shadow .15s; }
.att:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.att-preview { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex: none; background: var(--surface-2); display: grid; place-items: center; }
.att-preview img { width: 100%; height: 100%; object-fit: cover; }
.att-ic { display: grid; justify-items: center; color: var(--brand-strong); }
.att-ic em { font-style: normal; font-size: 9px; font-weight: 800; }
.att-meta { flex: 1; min-width: 0; display: grid; }
.att-meta strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta small { color: var(--muted); }
.att-dl { color: var(--muted); }

.receipt-card { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.receipt-card header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); }
.receipt-card header > .ic { color: var(--brand); }
.receipt-card header div { flex: 1; display: grid; }
.receipt-card header small { color: var(--muted); font-size: 12px; }
.receipt-card ul { list-style: none; margin: 0; padding: 4px 0; }
.receipt-card li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 13px; }
.dl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); flex: none; }
.dl-ok .dl-dot { background: var(--ok); }
.dl-ko .dl-dot { background: var(--danger); }
.dl-rcpt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dl-status { font-weight: 600; }
.dl-ok .dl-status { color: var(--ok); }
.dl-ko .dl-status { color: var(--danger); }
.receipt-card time { color: var(--muted); font-size: 12px; }

.reply-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.reader-dock { display: none; }

/* ---------- Attestation ---------- */
.attest { font-size: 13.5px; }
.attest-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--brand); margin-bottom: 14px; }
.attest-head img { width: 72px; }
.attest-head div { display: grid; }
.attest-head strong { font-family: var(--brand-font); font-size: 18px; color: var(--brand-strong); }
.attest dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0 0 18px; }
.attest dt { color: var(--muted); }
.attest dd { margin: 0; }
.attest h3 { font-size: 14px; margin: 0 0 8px; }
.attest table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.attest th, .attest td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.attest th { color: var(--muted); font-weight: 600; }
.attest-note { color: var(--muted); font-size: 12px; margin-top: 14px; }
.print-page { overflow: auto; padding: 32px; background: #fff; color: #111; }

/* =========================================================================
   Rédaction
   ========================================================================= */
.composer {
  position: fixed; inset-inline-end: 24px; bottom: 0; z-index: 60; width: 560px; height: min(640px, calc(100dvh - 80px));
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-3); transform: translateY(24px); opacity: 0; transition: transform .2s ease, opacity .2s ease, width .2s, height .2s;
}
.composer.in { transform: none; opacity: 1; }
.composer.min { height: 48px; width: 340px; overflow: hidden; }
.composer.max { inset-inline-end: 50%; bottom: 50%; transform: translate(50%, 50%); width: min(1000px, 88vw); height: 86dvh; border-radius: 16px; }
.composer.drop { outline: 3px dashed var(--brand); outline-offset: -8px; }
.composer-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 16px; background: var(--frame); color: var(--on-frame); border-radius: var(--r-lg) var(--r-lg) 0 0; cursor: default; flex: none; }
.composer-head .composer-win .icon-btn { color: var(--on-frame-2); }
.composer-head .composer-win .icon-btn:hover { background: var(--frame-hover); color: var(--on-frame); }
.composer-head > .round, .send-round { display: none; }
.composer-title { flex: 1; min-width: 0; display: grid; }
.composer-title strong { font-size: 14px; }
.composer-from { display: none; }
.composer-win { display: flex; }
.composer-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; position: relative; }
.c-field { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.c-field > span { color: var(--muted); font-size: 14px; min-width: 40px; }
.c-field > input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 14.5px; padding: 10px 0; }
.rcpt-input { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 0; cursor: text; }
.rcpt-input input { flex: 1; min-width: 120px; border: 0; outline: none; background: none; font-size: 14.5px; padding: 4px 0; }
.chips { display: contents; list-style: none; margin: 0; padding: 0; }
.r-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 3px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; max-width: 100%; }
.r-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-chip.bad { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.r-chip button { border: 0; background: none; padding: 2px; border-radius: 50%; color: var(--muted); display: grid; }
.r-chip button .ic { width: 14px; height: 14px; }
.r-chip .avatar { --s: 22px !important; font-size: 9px; }
.suggest { position: absolute; inset-inline-start: 56px; inset-inline-end: 16px; top: 100%; z-index: 5; list-style: none; margin: 0; padding: 6px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-2); }
.suggest li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.suggest li.on, .suggest li:hover { background: var(--brand-softer); }
.suggest li span { display: grid; min-width: 0; }
.suggest small { color: var(--muted); }
.composer-body textarea { flex: 1; min-height: 160px; border: 0; outline: none; resize: none; padding: 14px 16px; background: none; font-size: 15px; line-height: 1.6; }
.recorder { display: flex; align-items: center; gap: 10px; margin: 0 16px 10px; padding: 10px 12px; border-radius: 14px; background: var(--danger-soft); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; flex: none; }
@keyframes blink { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 38px; }
.rec-wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 28px; overflow: hidden; }
.rec-wave i { flex: 1; max-width: 4px; height: 100%; border-radius: 2px; background: var(--danger); transform: scaleY(.15); transition: transform .08s; }
.att-chips { list-style: none; margin: 0; padding: 0 16px 8px; display: grid; gap: 8px; }
.att-chip { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 12px; background: var(--surface-2); }
.att-chip.voice { background: var(--brand-softer); border: 1px solid var(--brand-soft); }
.att-chip-ic { color: var(--brand-strong); display: grid; }
.att-chip-main { flex: 1; min-width: 0; display: grid; }
.att-chip-main strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-chip-main small { color: var(--muted); font-size: 12px; }
.att-chip-main audio { height: 34px; width: 100%; margin-top: 6px; }
.att-chip button { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 50%; display: grid; }
.att-chip button:hover { background: var(--hover); }
.att-total { color: var(--muted); font-size: 12px; text-align: end; }
.composer .form-error { padding: 0 16px 8px; }
.composer-foot { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 12px 12px 16px; border-top: 1px solid var(--line); }
.c-tools { display: flex; align-items: center; }
.c-tools label.icon-btn { cursor: pointer; }
.voice-btn.on { color: #fff; background: var(--danger); }
.save-state { flex: 1; text-align: end; color: var(--muted); font-size: 12px; padding-inline-end: 4px; }

/* =========================================================================
   Feuilles, notifications, menus
   ========================================================================= */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--scrim); opacity: 0; transition: opacity .2s; }
.sheet-wrap.in { opacity: 1; }
.sheet { width: min(460px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); transform: translateY(16px) scale(.98); transition: transform .22s ease; }
.sheet.wide { width: min(760px, 100%); }
.sheet-wrap.in .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 6px 22px; }
.sheet-head h2 { flex: 1; margin: 0; font: 700 18px var(--brand-font); letter-spacing: -.01em; }
.sheet-body { padding: 8px 22px 16px; overflow-y: auto; }
.sheet-text { margin: 0; color: var(--fg-2); font-size: 14.5px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 16px; flex-wrap: wrap; }
.choice-list { display: grid; margin: 0 -10px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 12px; border: 0; background: none; border-radius: 12px; text-align: start; color: var(--fg); text-decoration: none; font-size: 14.5px; }
.choice:hover { background: var(--hover); }
.choice .ic { color: var(--brand-strong); }

.toast-zone { position: fixed; inset-inline-start: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100% - 24px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 8px 8px 16px; border-radius: 12px; background: #1e2a26; color: #f1f6f4; box-shadow: var(--shadow-2); font-size: 14px; pointer-events: auto; opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.toast.in { opacity: 1; transform: none; }
.toast .ic { width: 18px; height: 18px; color: #8fe0c2; }
.toast span { padding-inline-end: 8px; }
.toast button { border: 0; background: none; color: #f5e29a; font-weight: 700; padding: 8px 12px; border-radius: 8px; }
.toast button:hover { background: rgba(255,255,255,.08); }

.account-pop { position: fixed; top: 60px; inset-inline-end: 12px; z-index: 70; width: 340px; background: var(--surface-2); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow-3); }
.account-card { display: grid; justify-items: center; gap: 4px; padding: 20px 16px 16px; background: var(--surface); border-radius: var(--r); text-align: center; }
.account-card strong { font-size: 18px; margin-top: 8px; }
.account-card > span:not(.avatar) { color: var(--muted); margin-bottom: 12px; }
.account-links { display: grid; margin-top: 6px; background: var(--surface); border-radius: var(--r); padding: 4px; }
.account-links a, .account-links button { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 0; background: none; border-radius: var(--r-sm); text-decoration: none; color: var(--fg); text-align: start; }
.account-links a:hover, .account-links button:hover { background: var(--hover); }
.account-foot { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
.account-foot .ic { width: 14px; height: 14px; }

/* =========================================================================
   Agenda
   ========================================================================= */
.mini-cal { padding: 4px 8px 0 12px; }
.mc-head { display: flex; align-items: center; gap: 2px; padding: 0 0 6px 6px; }
.mc-head strong { flex: 1; font-size: 13.5px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.mc-grid > span { font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.mc-day { position: relative; aspect-ratio: 1; border: 0; background: none; border-radius: 50%; font-size: 12px; color: var(--fg-2); }
.mc-day:hover { background: var(--hover); }
.mc-day.out { color: var(--faint); }
.mc-day.today { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.mc-day.sel:not(.today) { background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; }
.mc-day.has::after { content: ""; position: absolute; bottom: 3px; inset-inline-start: 50%; width: 4px; height: 4px; margin-inline-start: -2px; border-radius: 50%; background: var(--brand); }
.mc-day.today.has::after { background: var(--brand-ink); }
.cal-legend { display: grid; gap: 6px; padding: 4px 16px; font-size: 13px; color: var(--fg-2); }
.cal-legend span { display: flex; align-items: center; gap: 10px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; }

.agenda-view { display: flex; flex-direction: column; }
.cal-toolbar { display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.cal-toolbar h2 { margin: 0 0 0 8px; font: 700 20px var(--brand-font); letter-spacing: -.02em; }
.cal-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.month { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--line); }
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); flex: none; }
.month-head span { padding: 10px 10px 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.month-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, minmax(0, 1fr)); }
.m-cell { min-width: 0; padding: 4px 4px 2px; border-top: 1px solid var(--line); border-inline-end: 1px solid var(--line); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.m-cell:nth-child(7n) { border-inline-end: 0; }
.m-cell:hover { background: var(--hover); }
.m-cell.out { background: var(--surface-2); }
.m-cell.out .m-num { color: var(--faint); }
.m-cell.sel { background: var(--brand-softer); }
.m-num { align-self: flex-start; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; font-size: 12.5px; font-weight: 600; }
.m-cell.today .m-num { background: var(--brand); color: var(--brand-ink); }
.m-evs { display: grid; gap: 2px; min-height: 0; }
.m-ev { display: flex; gap: 4px; align-items: center; height: 20px; padding: 0 6px; border: 0; border-radius: 5px; background: color-mix(in srgb, var(--ec) 16%, var(--surface)); color: var(--fg); font-size: 11.5px; text-align: start; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-inline-start: 3px solid var(--ec); }
.m-ev time { color: var(--ec); font-weight: 700; }
.m-more { font-size: 11px; color: var(--muted); padding-inline-start: 6px; }
.m-dots { display: none; }
.day-panel { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.day-panel header { display: flex; align-items: center; padding: 14px 10px 8px 18px; }
.day-panel h3 { flex: 1; margin: 0; font-size: 15px; }
.day-list { list-style: none; margin: 0; padding: 0 10px 16px; display: grid; gap: 6px; }
.day-list button { width: 100%; display: flex; gap: 12px; align-items: stretch; padding: 10px 12px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--ec) 10%, var(--surface)); text-align: start; border-inline-start: 4px solid var(--ec); }
.dl-time { display: grid; align-content: start; font-weight: 700; font-size: 13px; min-width: 46px; color: var(--ec); }
.dl-time small { color: var(--muted); font-weight: 500; }
.dl-main { display: grid; gap: 2px; min-width: 0; }
.dl-main small { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.dl-main small .ic { width: 13px; height: 13px; }
.day-empty { display: grid; justify-items: center; gap: 8px; padding: 32px 16px; color: var(--muted); text-align: center; }
.day-empty > .ic { width: 40px; height: 40px; stroke-width: 1.3; }
.ev-detail p { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; color: var(--fg-2); }
.ev-detail .ic { color: var(--ec); }
.ev-notes { white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: 10px; }
.ev-when { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; }
.color-pick { border: 0; padding: 0; margin: 0; display: flex; gap: 10px; }
.color-pick legend { font-weight: 600; font-size: 13px; color: var(--fg-2); margin-bottom: 8px; }
.color-pick label { cursor: pointer; }
.color-pick input { position: absolute; opacity: 0; }
.color-pick i { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.color-pick input:checked + i { box-shadow: 0 0 0 2px var(--fg); }

/* =========================================================================
   Contacts
   ========================================================================= */
.contacts-view { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
.ct-pane { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--line); }
.ct-search { padding: 12px; border-bottom: 1px solid var(--line); }
.ct-search .searchbar { height: 42px; max-width: none; }
.ct-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 0 16px; }
.ct-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; cursor: pointer; }
.ct-row:hover { background: var(--hover); }
.ct-row.active { background: var(--brand-soft); }
.ct-row > span:not(.avatar) { flex: 1; min-width: 0; display: grid; }
.ct-row strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-row em { font-style: normal; }
.ct-detail { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.ct-card { display: grid; justify-items: center; gap: 8px; padding: 32px 24px; text-align: center; }
.ct-card h2 { margin: 8px 0 4px; font-size: 24px; }
.ct-actions { display: flex; gap: 22px; margin: 10px 0 18px; }
.round-act { display: grid; justify-items: center; gap: 6px; border: 0; background: none; color: var(--brand-strong); font-size: 12px; font-weight: 600; text-decoration: none; }
.round-act .ic { box-sizing: content-box; padding: 13px; border-radius: 50%; background: var(--brand-soft); }
.ct-info { width: 100%; max-width: 480px; display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; text-align: start; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ct-info dt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ct-info dt .ic { width: 16px; height: 16px; }
.ct-info dd { margin: 0; word-break: break-word; white-space: pre-wrap; }

/* =========================================================================
   Paramètres
   ========================================================================= */
.set-side { padding: 0 4px 24px 8px; }
.set-group-title { margin: 18px 0 6px 12px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.set-group-title:first-child { margin-top: 6px; }
.set-group { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.set-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px 0 14px; color: var(--fg); text-decoration: none; position: relative; }
.set-row + .set-row::before { content: ""; position: absolute; top: 0; inset-inline-start: 52px; inset-inline-end: 0; height: 1px; background: var(--line); }
.set-row:hover { background: var(--hover); }
.set-row.active { background: var(--brand-soft); }
.set-ic { display: grid; place-items: center; width: 28px; color: var(--fg-2); }
.set-label { flex: 1; min-width: 0; }
.set-val { color: var(--muted); font-size: 13px; white-space: nowrap; }
.set-side .set-val { display: none; }
.set-side .set-row { min-height: 44px; }
.chev { width: 16px; height: 16px; color: var(--faint); }
.settings-view { display: flex; flex-direction: column; }
.set-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex: none; }
.set-head h1 { flex: 1; margin: 0; font: 700 20px var(--brand-font); text-align: start; letter-spacing: -.02em; }
.set-head > a { color: var(--fg); }
.set-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.set-page { max-width: 680px; margin: 0 auto; display: grid; gap: 16px; }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.set-card h3 { margin: 0 0 8px; font-size: 15px; }
.set-card h2 { margin: 10px 0 2px; }
.set-card p { margin: 0 0 6px; }
.set-card.center { display: grid; justify-items: center; text-align: center; gap: 8px; }
.set-card.form { gap: 12px; }
.set-card .input { background: var(--surface); }
.set-card.stat { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; background: none; padding: 0; }
.big-stat { display: grid; gap: 4px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.big-stat span { font-family: var(--brand-font); font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.big-stat small { color: var(--muted); }
.big-stat.green { background: var(--brand-soft); }
.big-stat.green span { color: var(--brand-strong); }
.set-toggle { display: flex; align-items: center; gap: 16px; justify-content: space-between; cursor: pointer; }
.set-toggle span { display: grid; gap: 4px; }
.set-toggle small { color: var(--muted); font-size: 13px; font-weight: 400; }
.hero-card { display: flex; gap: 16px; align-items: flex-start; background: var(--brand-softer); border-color: var(--brand-soft); }
.hero-card > .ic { width: 34px; height: 34px; color: var(--brand-strong); flex: none; }
.hero-card p { color: var(--fg-2); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .ic { color: var(--brand); margin-top: 1px; }
.tips { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; }
.cat-explain { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.cat-explain li { display: flex; gap: 12px; }
.cat-explain .ic { color: var(--brand-strong); margin-top: 2px; }
.cat-explain span { display: grid; color: var(--muted); }
.cat-explain strong { color: var(--fg); }
.theme-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 8px 0 12px; }
.theme-opt { display: grid; gap: 8px; cursor: pointer; text-align: center; font-weight: 600; font-size: 13px; }
.theme-opt input { position: absolute; opacity: 0; }
.theme-opt > span:last-child { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.theme-opt .ic { width: 16px; height: 16px; }
.theme-prev { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: 4px; height: 76px; padding: 8px; border-radius: 14px; border: 2px solid var(--line-strong); background: #f2f5f4; }
.theme-prev i { border-radius: 5px; background: #fff; }
.theme-prev i:first-child { grid-row: span 2; background: #dcf0e8; }
.theme-opt.dark .theme-prev { background: #0d1110; }
.theme-opt.dark .theme-prev i { background: #1c2321; }
.theme-opt.dark .theme-prev i:first-child { background: #193a2f; }
.theme-opt.auto .theme-prev { background: linear-gradient(135deg, #f2f5f4 50%, #0d1110 50%); }
.theme-opt input:checked + .theme-prev { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.seg { display: grid; gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.keys dd { margin: 0; color: var(--fg-2); }
kbd { display: inline-block; min-width: 24px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); font: 600 12px var(--font); text-align: center; }
.set-account { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); color: var(--fg); text-decoration: none; margin-bottom: 4px; }
.set-account > span:not(.avatar) { flex: 1; display: grid; }
.set-account small { color: var(--muted); }
.set-logout { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--danger); font-weight: 600; }
.set-version { text-align: center; color: var(--muted); font-size: 12px; }
.invite-logo { width: 200px; border-radius: 22px; background: #fff; padding: 12px; }
.set-card.center .btn { width: min(320px, 100%); }

/* =========================================================================
   Tablette : lecture par-dessus la liste
   ========================================================================= */
@media (max-width: 1180px) {
  .cal-body { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .shell, .shell.collapsed { grid-template-columns: 76px 0 minmax(0, 1fr); }
  .sidebar { visibility: hidden; }
  .shell.drawer .sidebar { visibility: visible; position: fixed; inset-inline-start: 76px; top: 64px; bottom: 12px; width: 268px; z-index: 40; background: var(--frame) var(--frame-img) 0 0 / 560px auto repeat; border-radius: 0 var(--r-lg) var(--r-lg) 0; box-shadow: var(--shadow-3); padding-top: 8px; }
  .shell.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--scrim); }
  .brand { width: auto; padding-inline-end: 16px; }
  .mail-view { grid-template-columns: minmax(0, 1fr); }
  .mail-view .read-pane { display: none; }
  .mail-view.reading .read-pane { display: flex; }
  .mail-view.reading .list-pane { display: none; }
  .mail-view [data-mobile] { display: inline-grid; }
  .mail-view .fab { display: grid; }
  .contacts-view { grid-template-columns: minmax(0, 1fr); }
  .contacts-view .ct-detail { display: none; }
  .contacts-view.reading .ct-detail { display: flex; }
  .contacts-view.reading .ct-pane { display: none; }
  .contacts-view [data-mobile] { display: inline-grid; }
  .cal-body { grid-template-columns: minmax(0, 1fr); }
  .day-panel { display: none; }
}

/* =========================================================================
   Mobile : style Outlook iOS
   ========================================================================= */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell, .shell.collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "stage";
  }
  .topbar, .rail { display: none; }
  .stage { padding: 0; }
  .stage > section { border-radius: 0; box-shadow: none; background: var(--bg); }

  /* Tiroir latéral */
  .sidebar {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 50; width: min(88vw, 360px); visibility: visible !important;
    background: var(--frame) var(--frame-img) 0 0 / 480px auto repeat; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-3);
    padding-top: var(--safe-t);
  }
  .shell.drawer .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .shell.drawer .scrim { opacity: 1; pointer-events: auto; }
  .drawer-accounts { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 76px; padding: 16px 0; border-inline-end: 1px solid var(--line); flex: none; }
  .drawer-me { border: 0; background: none; padding: 2px; border-radius: 50%; box-shadow: 0 0 0 2px var(--flap); }
  .drawer-app { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r); background: var(--hover); color: var(--fg-2); }
  .sidebar-main { padding: 18px 12px calc(24px + var(--safe-b)) 0; }
  .sidebar .compose-btn { display: none; }
  .nav-item { height: 48px; font-size: 16px; gap: 18px; padding-inline-start: 20px; margin-inline-start: 10px; }
  .nav-item .ic { width: 22px; height: 22px; }

  /* Barre d'onglets : posée au bas de la feuille, pleine largeur */
  .tabbar {
    display: flex; justify-content: space-around; position: fixed; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; z-index: 30;
    padding: 6px 8px calc(6px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab-item { position: relative; display: grid; justify-items: center; gap: 3px; min-width: 72px; padding: 4px 10px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; }
  .tab-item .ic { width: 24px; height: 24px; }
  .tab-item.active { color: var(--brand-strong); }
  .tab-item.active .ic { stroke-width: 2.2; }
  .tab-item.active::before { content: ""; position: absolute; top: -7px; inset-inline-start: 22px; inset-inline-end: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .tab-item[data-badge]::after { top: 2px; inset-inline-end: 22px; border-color: var(--surface); }
  .shell[data-view="settings"] .tabbar, .mail-view.reading ~ .tabbar { display: none; }
  body:has(.mail-view.reading) .tabbar, body:has(.contacts-view.reading) .tabbar, body:has(.settings-view.page) .tabbar { display: none; }

  .fab {
    display: grid; place-items: center; position: fixed; inset-inline-end: 16px; bottom: calc(80px + var(--safe-b)); z-index: 25;
    width: 56px; height: 56px; border: 0; border-radius: 16px; background: var(--brand-strong); color: #fff;
    box-shadow: var(--shadow-2);
  }
  .fab .ic { width: 26px; height: 26px; }
  .mail-view .fab { background: var(--flap); color: var(--flap-ink); }

  /* En-tête : le cadre vert de l'enveloppe, la liste glisse dessous comme une lettre */
  .m-hero {
    display: block; flex: none; position: relative; padding: calc(var(--safe-t) + 8px) 14px 16px;
    background: var(--frame) var(--frame-img) center top / 420px auto repeat; color: var(--on-frame);
  }
  :root[data-theme="dark"] .m-hero { background-color: #0f1a16; background-blend-mode: multiply; }
  .m-hero-top { display: flex; align-items: center; gap: 12px; min-height: 56px; }
  .m-hero h1 { flex: 1; min-width: 0; margin: 0; font: 800 28px/1.1 var(--brand-font); letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-frame); }
  .m-avatar { border: 0; background: none; padding: 0; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; color: var(--on-frame); flex: none; box-shadow: 0 0 0 2px var(--frame-line); }
  .glass { display: flex; gap: 2px; }
  .glass .icon-btn { width: 42px; height: 42px; color: var(--on-frame); }
  .glass .icon-btn:hover { background: var(--frame-hover); }
  .glass .ic { width: 23px; height: 23px; }
  .m-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 0 0; }
  .m-chips::-webkit-scrollbar { display: none; }
  .chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r); background: var(--glass); color: var(--on-frame); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; flex: none; border: 0; }
  .chip.on { background: var(--flap); color: var(--flap-ink); }
  .chip.on b { background: var(--flap-ink); color: var(--flap); }

  /* Liste */
  .mail-view { grid-template-columns: minmax(0, 1fr); }
  .list-pane { border: 0; }
  .list-head { display: none; }
  .list-tools { display: none; }
  .list-tools.selecting { display: flex; position: sticky; top: 0; z-index: 3; background: var(--brand-soft); }
  .mail-view .list-pane { background: var(--frame) var(--frame-img) center top / 420px auto repeat; }
  :root[data-theme="dark"] .mail-view .list-pane { background-color: #0f1a16; background-blend-mode: multiply; }
  .list-scroll { padding-bottom: calc(96px + var(--safe-b)); background: var(--surface); border-radius: 16px 16px 0 0; }
  .group-head { background: var(--surface); padding: 14px 18px 6px; border-radius: 16px 16px 0 0; }
  .row-inner { background: var(--surface); padding: 12px 16px 12px 12px; gap: 12px; box-shadow: none; }
  .row + .row .row-inner::after { content: ""; position: absolute; top: 0; inset-inline-start: 68px; inset-inline-end: 0; height: 1px; background: var(--line); }
  .row:hover .row-inner { background: var(--surface); }
  .row.active .row-inner { background: var(--surface); }
  .row:hover .row-check, .row:hover .row-hover { display: none; }
  .row:hover .row-avatar { display: block; }
  .row:hover .row-top time { visibility: visible; }
  .row-star { display: none; }
  .row-from { font-size: 16px; }
  .row-subject { font-size: 15px; }
  .row-snippet { font-size: 14px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .row.unread .row-inner::before { display: none; }
  .row.unread .row-from::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-inline-end: 7px; vertical-align: 2px; }

  /* Lecture plein écran, glissée depuis la droite */
  .read-pane {
    display: flex !important; position: fixed; inset: 0; z-index: 35; background: var(--surface);
    transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
  }
  .mail-view.reading .read-pane { transform: none; visibility: visible; }
  .mail-view.reading .list-pane { display: flex; }
  .mail-view [data-mobile], .contacts-view [data-mobile] { display: inline-grid; }
  .reader-bar { padding-top: var(--safe-t); height: calc(56px + var(--safe-t)); border: 0; }
  .reader-actions { justify-content: flex-end; }
  .reader-actions [data-read="unread"], .reader-actions [data-read="spam"], .reader-actions [data-read="notspam"], .reader-actions .bar-sep { display: none; }
  .reader-scroll { padding: 6px 18px calc(96px + var(--safe-b)); }
  .reader-head h1 { font-size: 22px; font-weight: 700; }
  .reply-row { display: none; }
  .reader-dock {
    display: flex; justify-content: space-around; position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 0;
    padding: 6px 12px calc(6px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line);
  }
  .reader-dock .icon-btn { width: 52px; height: 44px; border-radius: var(--r); color: var(--fg); }
  .att-grid { grid-template-columns: 1fr; }

  /* Rédaction plein écran, façon Outlook iOS */
  .composer, .composer.max, .composer.min {
    inset: 0; inset-inline-end: 0; bottom: 0; width: 100%; height: 100dvh; border-radius: 0; transform: translateY(100%);
  }
  .composer.in { transform: none; }
  .composer-head { height: auto; padding: calc(var(--safe-t) + 10px) 14px 12px; background: var(--surface); color: var(--fg); border-radius: 0; border-bottom: 1px solid var(--line); gap: 12px; }
  .composer-head > .round { display: inline-grid; width: 44px; height: 44px; }
  .composer-win { display: none; }
  .composer-title { justify-items: start; }
  .composer-title strong { font-size: 17px; }
  .composer-from { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .composer-from .avatar { --s: 18px !important; font-size: 8px; }
  .send-round { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--brand); color: var(--brand-ink); }
  .send-round .ic { width: 22px; height: 22px; margin-inline-start: -2px; }
  .c-field { min-height: 52px; padding: 0 18px; }
  .c-field > span, .c-field > input, .rcpt-input input { font-size: 16px; }
  .composer-body textarea { font-size: 16px; padding: 16px 18px; }
  .composer-foot {
    position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; border: 0; border-top: 1px solid var(--line);
    padding: 6px 10px calc(6px + var(--safe-b)); background: var(--surface);
  }
  .composer-foot .send-split { display: none; }
  .composer-body { padding-bottom: 90px; }
  .c-tools { flex: 1; justify-content: space-around; }
  .c-tools .icon-btn { width: 46px; height: 46px; }
  .c-tools .ic { width: 23px; height: 23px; }
  .save-state { display: none; }

  /* Feuilles en bas d'écran */
  .sheet-wrap { place-items: end stretch; padding: 0; }
  .sheet, .sheet.wide { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; padding-bottom: var(--safe-b); transform: translateY(100%); }
  /* Poignée : une vraie zone de 24 px qu'on attrape au doigt pour faire glisser la fenêtre vers le bas */
  .sheet-grip { display: grid; place-items: center; height: 22px; margin-bottom: -6px; touch-action: none; cursor: grab; }
  .sheet-grip span { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); }
  .sheet-head { touch-action: none; }
  .sheet-foot .btn { flex: 1; min-height: 48px; }
  .toast-zone { bottom: calc(84px + var(--safe-b)); }
  .account-pop { top: auto; bottom: 0; inset-inline-end: 0; inset-inline-start: 0; width: auto; border-radius: 16px 16px 0 0; padding-bottom: calc(10px + var(--safe-b)); }

  /* Recherche mobile */
  .m-search { position: fixed; inset: 0; z-index: 70; background: var(--bg); padding: calc(var(--safe-t) + 10px) 14px 14px; display: flex; flex-direction: column; animation: fade .18s; }
  @keyframes fade { from { opacity: 0; } }
  .m-search-bar { display: flex; align-items: center; gap: 8px; }
  .m-search-bar .searchbar { height: 46px; background: var(--surface-2); }
  .m-search .chip { background: var(--surface-2); color: var(--fg); }
  .m-search .chip.on { background: var(--brand-strong); color: #fff; }
  .m-search-results { display: flex; flex-wrap: wrap; gap: 16px; padding: 18px 4px; }
  .person { display: grid; justify-items: center; gap: 4px; width: 84px; border: 0; background: none; text-align: center; }
  .person span:not(.avatar) { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 84px; }
  .person small { display: none; }

  /* Agenda mobile : mois compact + liste du jour */
  .agenda-view { overflow-y: auto; }
  .cal-toolbar { display: none; }
  .cal-body { display: block; }
  .month { border: 1px solid var(--line); background: var(--surface); margin: 12px 10px 0; border-radius: var(--r-lg); overflow: hidden; }
  .month-head span { text-align: center; padding: 10px 0 4px; }
  .month-grid { grid-template-rows: repeat(6, 54px); }
  .m-cell { align-items: center; border-inline-end: 0; padding: 4px 0; }
  .m-cell.out { background: none; }
  .m-cell.sel { background: var(--brand-softer); }
  .m-evs { display: none; }
  .m-dots { display: flex; gap: 3px; }
  .m-dots i { width: 5px; height: 5px; border-radius: 50%; }
  .day-panel { display: flex; padding-bottom: calc(96px + var(--safe-b)); }
  .day-panel header { padding: 18px 12px 8px 20px; }
  .day-list { padding: 0 12px 16px; }
  .ev-when { grid-template-columns: 1fr 1fr; }
  .ev-when .field-label:first-child { grid-column: span 2; }

  /* Contacts mobile */
  .contacts-view { display: flex; flex-direction: column; }
  .ct-pane { border: 0; flex: 1; }
  .ct-search { border: 0; padding: 4px 14px 8px; background: var(--bg); }
  .ct-search .searchbar { background: var(--surface-2); }
  .ct-list { padding-bottom: calc(96px + var(--safe-b)); }
  .ct-detail { display: flex !important; position: fixed; inset: 0; z-index: 35; background: var(--surface); transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); visibility: hidden; }
  .contacts-view.reading .ct-detail { transform: none; visibility: visible; }
  .ct-detail .reader-bar { border: 0; }

  /* Paramètres mobile : listes groupées iOS */
  .settings-view { background: var(--bg) !important; }
  .set-head { border: 0; padding: calc(var(--safe-t) + 10px) 14px 6px; display: grid; grid-template-columns: 44px 1fr 44px; }
  .set-head h1 { text-align: center; font-size: 17px; }
  .set-head .icon-btn.round { width: 40px; height: 40px; }
  .set-scroll { padding: 12px 16px calc(40px + var(--safe-b)); }
  .set-row { min-height: 54px; font-size: 16px; }
  .set-ic .ic { width: 22px; height: 22px; }
  .set-card { background: var(--surface); }
  .set-card .input { background: var(--surface-2); }
  .set-card.stat { grid-template-columns: 1fr; }
  .big-stat { background: var(--surface); }
  .ev-when { gap: 8px; }
}


@media (max-width: 380px) {
  .tab-item { min-width: 64px; }
  .m-hero h1 { font-size: 26px; }
}

/* Écrans très larges */
@media (min-width: 1500px) {
  .mail-view { grid-template-columns: 480px minmax(0, 1fr); }
}

/* Mouvements réduits */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Impression d'un message */
@media print {
  body { overflow: visible; background: #fff; }
  .topbar, .rail, .sidebar, .list-pane, .reader-bar, .reader-dock, .reply-row, .tabbar, .fab, .toast-zone, #layer > *:not(.sheet-wrap) { display: none !important; }
  .shell { display: block; height: auto; }
  .stage, .stage > section, .read-pane, .reader, .reader-scroll { display: block !important; position: static; overflow: visible; height: auto; box-shadow: none; padding: 0; transform: none; visibility: visible; }
}

/* =========================================================================
   Conversations, agent IA, dossiers, tâches, assistant
   ========================================================================= */
.ask-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 12px; margin-inline-end: 6px;
  border: 1px solid var(--frame-line); border-radius: var(--r); font-weight: 700; font-size: 13px; color: var(--on-frame); background: transparent;
}
.ask-btn:hover { background: var(--frame-hover); border-color: var(--on-frame-3); }
.ask-btn .ic { width: 18px; height: 18px; color: var(--flap); }
.ask-card { display: grid; gap: 6px; width: calc(100% - 8px); text-align: start; font: inherit; }
.side-card-text { font-size: 12.5px; color: var(--on-frame-2); line-height: 1.45; }

.row-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.row.unread .row-count { color: var(--fg); }

.ai-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px; border-radius: var(--r); border: 0;
  background: var(--yellow-soft); color: var(--yellow-ink); font-weight: 700; font-size: 13px; flex: none;
}
.ai-btn .ic { width: 17px; height: 17px; }
.ai-btn:hover { background: var(--yellow); }
.btn.ai-outline { background: var(--yellow-soft); color: var(--yellow-ink); border: 0; }
.btn.ai-outline:hover { background: var(--yellow); }

.ai-card { position: relative; display: grid; gap: 8px; padding: 16px 18px; margin: 0 0 18px; border-radius: var(--r-lg);
  background: var(--brand-softer); border: 1px solid var(--brand-soft); }
.ai-card > .ic { color: var(--brand-strong); }
.ai-card.loading, .ai-card.error { grid-template-columns: auto 1fr; align-items: start; }
.ai-card.error { background: var(--surface-2); border-color: var(--line); }
.ai-card header { display: flex; align-items: center; gap: 8px; color: var(--brand-strong); }
.ai-card header strong { flex: 1; }
.ai-card h4 { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.ai-card p { margin: 0; }
.ai-summary { font-size: 15px; line-height: 1.55; }
.ai-actions { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.ai-actions li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); }
.ai-actions li > .ic { color: var(--brand); }
.ai-actions li > span { flex: 1; display: grid; min-width: 0; }
.ai-actions small { color: var(--muted); }
.ai-note { font-size: 12px; color: var(--muted); }
.ai-bar { height: 4px; border-radius: 2px; background: var(--brand-soft); overflow: hidden; margin-top: 8px; width: 220px; max-width: 100%; }
.ai-bar i { display: block; width: 40%; height: 100%; background: var(--brand); border-radius: 2px; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
/* Repères de la conversation : une ligne discrète, le détail à la demande */
.rp-chip { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 14px; padding: 9px 12px; border: 1px solid var(--brand-soft); border-radius: var(--r-lg);
  background: var(--brand-softer); color: var(--brand-strong); font: inherit; font-size: 13.5px; font-weight: 600; text-align: start; cursor: pointer; }
.rp-chip > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-chip .ic { width: 17px; height: 17px; flex: none; }
.rp-chip:hover { background: var(--brand-soft); }
.rp-card h4 { margin: 6px 0 0; }
.rp-card .ai-actions strong { overflow-wrap: anywhere; }
.rp-card .rp-act { background: none; padding: 0; }
.plain-list { margin: 8px 0 12px; padding-inline-start: 20px; display: grid; gap: 8px; }
.done-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 700; font-size: 13px; }
.done-tag .ic { width: 16px; height: 16px; }

.dossier-links { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 16px; }
.dossier-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--yellow-soft);
  color: var(--yellow-ink); text-decoration: none; font-weight: 600; font-size: 13px; }
.dossier-chip .ic { width: 15px; height: 15px; }

/* Messages d'une conversation */
.conv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.msg-card { min-width: 0; }
.msg-summary .sender-main { min-width: 0; }
.msg-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.msg-card.is-draft { border-style: dashed; }
.msg-summary { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; border-radius: var(--r-lg); }
.msg-summary:hover { background: var(--hover); }
.msg-card.open .msg-summary:hover { background: none; }
.msg-summary time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.msg-peek { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-card .sender-to { display: none; color: var(--muted); font-size: 13px; }
.msg-card.open .sender-to { display: block; }
.msg-card.open .msg-peek { display: none; }
.msg-full { display: none; padding: 0 16px 14px 66px; }
.msg-card.open .msg-full { display: block; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.msg-actions .text-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); font-weight: 600; }
.msg-actions .ic { width: 16px; height: 16px; }
.translation { margin-bottom: 14px; }

/* Assistant */
.assistant {
  position: fixed; top: 76px; inset-inline-end: 12px; bottom: 12px; z-index: 65; width: 400px; max-width: calc(100% - 24px);
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  transform: translateX(calc(100% + 24px)); transition: transform .25s ease;
}
.assistant.in { transform: none; }
.assistant-head { display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; border-bottom: 1px solid var(--line); }
.assistant-head div { flex: 1; display: grid; }
.assistant-head small { color: var(--muted); font-size: 12px; }
.assistant-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r); background: var(--yellow-soft); color: var(--yellow-ink); }
.assistant-feed { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.assistant-hello p { color: var(--fg-2); margin: 0 0 12px; }
.assistant-sugg { display: grid; gap: 8px; }
.chip-btn { text-align: start; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r); padding: 10px 12px; color: var(--fg); }
.chip-btn:hover { background: var(--brand-softer); border-color: var(--brand-soft); }
.bubble { max-width: 92%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; }
.bubble p { margin: 0; }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble.bot small { display: block; color: var(--muted); margin-top: 4px; }
.bubble .err { color: var(--danger); }
.bubble sup { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); font-size: 10px; font-weight: 700; margin: 0 1px; }
.sources { display: grid; gap: 6px; margin-top: 10px; }
.source { display: flex; gap: 10px; align-items: center; text-align: start; border: 0; background: var(--surface); border-radius: 10px; padding: 8px 10px; color: var(--fg); }
.source:hover { box-shadow: var(--shadow-1); }
.source b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: 11px; flex: none; }
.source span { display: grid; min-width: 0; }
.source strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source small { color: var(--muted); font-size: 12px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
.assistant-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); }
.assistant-form textarea { flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 10px 14px; background: var(--bg); outline: none; max-height: 140px; line-height: 1.4; }
.assistant-form textarea:focus { border-color: var(--brand); }
.assistant .send-round { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--brand); color: var(--brand-ink); flex: none; }

.sheet-sub { font-size: 13px; color: var(--muted); margin: 18px 0 6px; }
.choice select { margin-inline-start: auto; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; background: var(--surface); }
.composer textarea.ai-busy { opacity: .5; }
.c-tools .ai-tool { color: var(--brand-strong); }
.input select { flex: 1; border: 0; background: none; padding: 11px 14px; font-size: 15px; outline: none; }

/* Dossiers et tâches */
.dossiers-view, .dossier-view { display: flex; flex-direction: column; }
.page-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.page-head h2 { flex: 1; margin: 0; font: 700 20px var(--brand-font); letter-spacing: -.02em; }
.page-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.d-card { display: grid; gap: 8px; align-content: start; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--fg); transition: box-shadow .15s, border-color .15s; }
.d-card:hover { border-color: var(--brand); }
.d-card-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--yellow-soft); color: var(--yellow-ink); }
.d-card strong { font-size: 16px; }
.d-card p { margin: 0; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--fg-2); }
.d-meta span { display: inline-flex; align-items: center; gap: 4px; }
.d-meta .ic { width: 15px; height: 15px; color: var(--muted); }
.d-meta .late { color: var(--danger); }
.d-card small { color: var(--muted); font-size: 12px; }

.d-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.d-head-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--yellow-soft); color: var(--yellow-ink); flex: none; }
.d-head-ic .ic { width: 26px; height: 26px; }
.d-head h1 { margin: 0; font: 700 24px var(--brand-font); letter-spacing: -.02em; }
.d-head p { margin: 2px 0 0; font-size: 13px; }
.d-section { margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.d-section h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; }
.d-section h2 .ic { width: 18px; height: 18px; color: var(--brand); }
.d-section.summary textarea { width: 100%; border: 0; resize: vertical; background: none; outline: none; font-size: 15px; line-height: 1.55; min-height: 70px; }
.count-badge { font-size: 12px; color: var(--muted); font-weight: 600; }
.d-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 18px; }
.task-list, .item-list, .d-threads, .people, .docs, .timeline, .imports { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.task { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 10px; }
.task:hover { background: var(--hover); }
.task > span { flex: 1; display: grid; min-width: 0; }
.task small { color: var(--muted); font-size: 12px; }
.task small.late { color: var(--danger); font-weight: 600; }
.task.done > span { color: var(--muted); text-decoration: line-through; }
.task-check { border: 0; background: none; color: var(--brand); padding: 2px; display: grid; }
.task-check .ic { width: 22px; height: 22px; }
.task .icon-btn { opacity: 0; }
.task:hover .icon-btn { opacity: 1; }
.task-dossier { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; text-decoration: none; color: var(--yellow-ink); }
.task-dossier .ic { width: 13px; height: 13px; }
.inline-add { display: flex; gap: 6px; align-items: center; margin-top: 8px; padding: 4px 4px 4px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.inline-add:focus-within { border-style: solid; border-color: var(--brand); }
.inline-add input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 6px 0; }
.inline-add input[type=date] { flex: none; width: 140px; color: var(--muted); }
.inline-add.big { padding: 6px 6px 6px 16px; margin: 0 0 20px; }
.item-list li { display: flex; gap: 8px; align-items: baseline; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.item-list li span { flex: 1; }
.item-list small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.item-list .icon-btn { opacity: 0; }
.item-list li:hover .icon-btn { opacity: 1; }
.d-threads li { display: flex; align-items: center; gap: 6px; }
.d-threads a { flex: 1; display: grid; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--fg); }
.d-threads a:hover { background: var(--hover); }
.d-threads small, .docs small, .people small { color: var(--muted); font-size: 12px; }
.timeline li { display: grid; gap: 2px; padding: 8px 0 8px 16px; border-inline-start: 2px solid var(--brand-soft); position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline time { color: var(--muted); font-size: 12px; }
.timeline small { color: var(--muted); }
.people li { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.people li > span:not(.avatar) { display: grid; min-width: 0; }
.docs a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--fg); }
.docs a:hover { background: var(--hover); }
.docs a > span { display: grid; min-width: 0; }
.docs strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.docs .ic { color: var(--brand); }
.tasks-page { max-width: 760px; margin: 0 auto; }
.t-group { font-size: 13px; color: var(--muted); margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.t-group span { color: var(--fg); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.imports li { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.imports small { color: var(--muted); }
.imp-ok { color: var(--ok); font-weight: 600; }
.imp-ko { color: var(--danger); font-weight: 600; }
.imp-run { color: var(--warn); font-weight: 600; }

@media (max-width: 1100px) {
  .d-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .ask-btn { display: none; }
  .assistant { inset: 0; top: 0; width: 100%; max-width: none; border-radius: 0; padding-top: var(--safe-t); }
  .assistant-form { padding-bottom: calc(12px + var(--safe-b)); }
  .msg-full { padding: 0 14px 14px; }
  .reader-actions .ai-btn span { display: none; }
  .reader-actions .ai-btn { padding: 0 10px; }
  .reader-actions [data-read="dossier"] { display: none; }
  .page-head { display: none; }
  .page-scroll { padding: 12px 14px calc(110px + var(--safe-b)); }
  .dossier-view .page-scroll { padding-bottom: calc(40px + var(--safe-b)); }
  .dossier-view .reader-bar { padding-top: var(--safe-t); height: calc(56px + var(--safe-t)); }
  .d-section { background: var(--surface); }
  .d-head h1 { font-size: 21px; }
  .inline-add input[type=date] { width: 120px; }
  .task .icon-btn, .item-list .icon-btn { opacity: 1; }
}

/* =========================================================================
   Téléphone : calqué sur Outlook iOS (version claire)
   Barre d'onglets et outils en capsules flottantes, listes groupées arrondies,
   en-tête à grand titre. Écran verrouillé : rien ne glisse hors du cadre.
   ========================================================================= */
html { -webkit-text-size-adjust: 100%; }
body:not(.is-auth) { position: fixed; inset: 0; overscroll-behavior: none; }
@media (max-width: 760px) {
  input, textarea, select { font-size: max(16px, 1em); }
  .list-scroll, .reader-scroll, .page-scroll, .set-scroll, .ct-list, .agenda-view, .assistant-feed { overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; }
  .stage > section { background: #f3f5f4; }

  /* En-tête : grand titre, capsule d'icônes, sélecteur segmenté */
  .m-hero { padding: calc(var(--safe-t) + 6px) 16px 14px; }
  .m-hero-top { gap: 12px; min-height: 58px; }
  .m-hero h1 { font: 700 32px/1.1 var(--brand-font); letter-spacing: -.025em; }
  .m-avatar { box-shadow: none; }
  .glass { gap: 0; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
  .glass .icon-btn { width: 44px; height: 44px; border-radius: 999px; }
  .m-chips { width: fit-content; max-width: 100%; gap: 0; margin-top: 10px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
  .chip { height: 34px; padding: 0 16px; border-radius: 999px; background: transparent; font-size: 15px; }
  .chip.on { background: #fff; color: var(--fg); }
  .chip.on b { background: var(--brand-strong); color: #fff; }
  .list-scroll { border-radius: 18px 18px 0 0; padding-bottom: calc(110px + var(--safe-b)); }
  .group-head { border-radius: 18px 18px 0 0; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }

  /* Barre d'onglets : capsule flottante */
  .tabbar {
    inset-inline-start: 50%; inset-inline-end: auto; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%);
    gap: 2px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-2);
  }
  .tab-item { min-width: 80px; padding: 7px 12px 6px; border-radius: 999px; color: var(--fg-2); }
  .tab-item.active { background: var(--brand-soft); color: var(--brand-strong); }
  .tab-item.active::before { display: none; }
  .tab-item[data-badge]::after { top: 6px; inset-inline-end: 26px; }

  /* Écrire : cercle blanc posé au-dessus de la barre */
  .fab, .mail-view .fab {
    inset-inline-end: 16px; bottom: calc(84px + var(--safe-b)); width: 60px; height: 60px; border-radius: 50%;
    background: var(--surface); color: var(--brand-strong); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  }

  /* Lecture et rédaction : outils en capsule flottante */
  .reader-dock {
    inset-inline-start: 12px; inset-inline-end: 12px; bottom: calc(10px + var(--safe-b)); padding: 5px; border: 1px solid var(--line);
    border-radius: 999px; box-shadow: var(--shadow-2);
  }
  .reader-dock .icon-btn { border-radius: 999px; }
  .composer-foot {
    inset-inline-start: 12px; inset-inline-end: 12px; bottom: calc(10px + var(--safe-b)); padding: 5px 8px; border: 1px solid var(--line);
    border-radius: 999px; box-shadow: var(--shadow-2);
  }
  .composer-head > .round { background: var(--surface-2); }
  .send-round { background: var(--brand-strong); }

  /* Réglages : feuille modale, listes groupées arrondies */
  .settings-view, .set-scroll { background: #f3f5f4 !important; }
  .set-head { padding: calc(var(--safe-t) + 10px) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .set-head h1 { font: 600 17px var(--font); letter-spacing: 0; }
  .set-head .icon-btn.round { width: 44px; height: 44px; background: var(--surface-2); }
  .set-group-title { margin: 22px 0 8px 16px; font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
  .set-group { border: 0; border-radius: 20px; }
  .set-row { min-height: 56px; padding: 0 16px; }
  .set-row + .set-row::before { inset-inline-start: 56px; }
  .set-card, .set-account, .set-logout, .big-stat { border: 0; border-radius: 20px; }

  /* Agenda : grille pleine largeur */
  .month { margin: 0; border: 0; border-radius: 0; }
  .m-cell { border-inline-end: 1px solid var(--line); }
  .m-cell:nth-child(7n) { border-inline-end: 0; }
  .m-cell.today .m-num { border-radius: 999px; padding: 0 10px; }
}

/* Tiroir du téléphone : blanc, comme Outlook */
@media (max-width: 760px) {
  :root:not([data-theme="dark"]) .sidebar {
    background: #fff;
    --fg: #15231e; --fg-2: #33433d; --muted: #687872; --faint: #9aa8a3; --hover: rgba(23, 60, 48, .06); --press: rgba(23, 60, 48, .1);
    --line: #e3e9e6; --brand-soft: #dcf0e8; --brand-softer: #edf7f3; --brand-strong: #22634d;
  }
  :root:not([data-theme="dark"]) .sidebar .nav-item { color: var(--fg-2); }
  :root:not([data-theme="dark"]) .sidebar .nav-item.active { background: var(--brand-soft); color: var(--brand-strong); }
  :root:not([data-theme="dark"]) .sidebar .nav-count { color: var(--brand-strong); }
  :root:not([data-theme="dark"]) .sidebar .nav-section h3 { color: var(--muted); }
  :root:not([data-theme="dark"]) .sidebar .drawer-me { box-shadow: 0 0 0 2px var(--brand-strong); }
  :root:not([data-theme="dark"]) .sidebar .mc-day.today { background: var(--brand-strong); color: #fff; }
  .nav-item.active::before { display: none; }
  .nav-item { border-radius: 999px; }
}
@media (max-width: 760px) {
  .cal-hero h1 { font-size: 24px; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Colonne du tiroir (bureau : transparente, sans en-tête) */
.drawer-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.drawer-head { display: none; }

/* =========================================================================
   Téléphone — réplique d'Outlook iOS (thème clair)
   Typo système (SF), en-tête image + capsules de verre sombres, liste blanche
   à bord droit, barre d'onglets et bouton d'écriture en verre clair flottant.
   ========================================================================= */
@media (max-width: 760px) {
  :root { --ios-fill: rgba(118, 118, 128, .12); --ios-sep: rgba(60, 60, 67, .18); --ios-label: #000; --ios-2: rgba(60, 60, 67, .6); --ios-bg: #f2f2f7; }
  body { font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }

  /* En-tête */
  .m-hero { padding: calc(var(--safe-t) + 4px) 16px 12px; }
  .m-hero-top { gap: 12px; min-height: 60px; }
  .m-avatar { width: 40px; height: 40px; box-shadow: none; }
  .m-hero h1 { font: 700 34px/1.1 -apple-system, system-ui, sans-serif; letter-spacing: -.02em; color: #fff; }
  .glass {
    gap: 0; padding: 2px; border-radius: 999px; background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .2);
    -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  }
  .glass .icon-btn { width: 50px; height: 46px; border-radius: 999px; color: #fff; }
  .glass .ic { width: 25px; height: 25px; stroke-width: 1.6; }
  .m-chips {
    width: fit-content; max-width: 100%; gap: 0; margin-top: 12px; padding: 3px; border-radius: 999px;
    background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
  .chip { height: 36px; padding: 0 16px; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .92); font-size: 17px; font-weight: 600; }
  .chip.on { background: rgba(255, 255, 255, .3); color: #fff; }
  .chip b, .chip.on b { background: #fff; color: #000; }

  /* Liste : blanche, bord droit sous l'image */
  .mail-view .list-pane { background: var(--surface); }
  .list-scroll, .group-head { border-radius: 0; }
  .group-head { padding: 12px 16px 4px; font-size: 15px; font-weight: 600; color: var(--ios-2); }
  .row-inner { padding: 12px 16px; gap: 12px; }
  .row-avatar { padding: 0; }
  .row + .row .row-inner::after { inset-inline-start: 68px; background: var(--ios-sep); height: .5px; }
  .row-from { font-size: 17px; color: var(--ios-label); }
  .row-subject { font-size: 15px; color: var(--ios-label); }
  .row-snippet { font-size: 15px; color: var(--ios-2); }
  .row time { font-size: 15px; color: var(--ios-2); }

  /* Barre d'onglets : verre clair flottant */
  .tabbar {
    bottom: calc(8px + var(--safe-b)); gap: 0; padding: 4px; border-radius: 999px;
    background: rgba(255, 255, 255, .82); border: 1px solid rgba(0, 0, 0, .08);
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  }
  .tab-item { min-width: 78px; padding: 8px 12px 7px; gap: 3px; border-radius: 999px; color: var(--ios-label); font-size: 12.5px; font-weight: 500; }
  .tab-item .ic { width: 27px; height: 27px; stroke-width: 1.6; }
  .tab-item.active { background: rgba(0, 0, 0, .07); color: var(--brand); }
  .fab, .mail-view .fab {
    inset-inline-end: 16px; bottom: calc(86px + var(--safe-b)); width: 64px; height: 64px; border-radius: 50%; color: var(--ios-label);
    background: rgba(255, 255, 255, .85); border: 1px solid rgba(0, 0, 0, .08);
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  }
  .fab .ic { width: 27px; height: 27px; stroke-width: 1.6; }

  /* Lecture / rédaction : barres d'outils en verre clair */
  .reader-dock, .composer-foot {
    background: rgba(255, 255, 255, .85); border: 1px solid rgba(0, 0, 0, .08);
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  }
  .reader-dock .icon-btn, .c-tools .icon-btn { color: var(--ios-label); }
  .composer-head { padding: calc(var(--safe-t) + 10px) 16px 12px; gap: 12px; }
  .composer-head > .round, .send-round {
    width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--ios-label);
    border: 1px solid rgba(0, 0, 0, .1); box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
  }
  .send-round { color: var(--ios-2); }
  .composer-title strong { font-size: 19px; font-weight: 600; }
  .composer-from { font-size: 15px; }
  .composer-from .avatar { display: none; }
  .c-field { min-height: 56px; padding: 0 16px; border-bottom: .5px solid var(--ios-sep); }
  .c-field > span { font-size: 17px; color: var(--ios-2); }

  /* Réglages : feuille iOS */
  .settings-view, .set-scroll { background: var(--ios-bg) !important; }
  .set-head { grid-template-columns: 52px 1fr 52px; padding: calc(var(--safe-t) + 10px) 16px 12px; background: #f9f9fb; border-bottom: .5px solid var(--ios-sep); }
  .set-head h1 { font: 600 20px -apple-system, system-ui, sans-serif; }
  .set-head .icon-btn.round { width: 52px; height: 52px; background: #fff; border: 1px solid rgba(0, 0, 0, .1); box-shadow: 0 4px 12px rgba(0, 0, 0, .08); color: var(--ios-label); }
  .set-scroll { padding: 14px 16px calc(40px + var(--safe-b)); }
  .set-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; margin-bottom: 6px; border-radius: 999px; background: var(--ios-fill); color: var(--ios-2); }
  .set-search .ic { width: 20px; height: 20px; }
  .set-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 17px; color: var(--ios-label); }
  .set-search input::-webkit-search-cancel-button { display: none; }
  .set-group-title { margin: 24px 0 8px 18px; font-size: 15px; font-weight: 400; color: var(--ios-2); }
  .set-group, .set-account, .set-card, .set-logout { border-radius: 22px; border: 0; }
  .set-row { min-height: 58px; padding: 0 18px; gap: 16px; font-size: 17px; color: var(--ios-label); }
  .set-row + .set-row::before { inset-inline-start: 62px; height: .5px; background: var(--ios-sep); }
  .set-ic { width: 26px; color: rgba(60, 60, 67, .85); }
  .set-ic .ic { width: 24px; height: 24px; stroke-width: 1.6; }
  .set-val { font-size: 17px; color: var(--ios-2); }
  .chev { color: rgba(60, 60, 67, .3); width: 18px; height: 18px; }

  /* Recherche */
  .m-search { background: #fff; }
  .m-search-bar .searchbar { height: 44px; border-radius: 999px; background: var(--ios-fill); }
  .m-search-bar .text-btn { font-size: 17px; font-weight: 400; color: var(--brand); }

  /* Tiroir : colonne de comptes + dossiers, sans fond sur l'élément actif */
  .drawer-accounts { width: 84px; gap: 16px; padding: calc(var(--safe-t) + 16px) 0 16px; border-inline-end: 0; }
  .drawer-me { padding: 0; box-shadow: none !important; }
  .drawer-app { width: 56px; height: 56px; border-radius: 50%; background: var(--ios-fill); color: var(--ios-label); }
  .drawer-head { display: grid; gap: 2px; padding: calc(var(--safe-t) + 18px) 16px 8px 4px; }
  .drawer-head strong { font-size: 22px; font-weight: 600; color: var(--ios-label); }
  .drawer-head span { font-size: 15px; color: var(--ios-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-main { padding: 8px 12px calc(24px + var(--safe-b)) 0; }
  .folder-nav::before { content: "Dossiers"; display: block; padding: 10px 0 6px 4px; font-size: 17px; color: var(--ios-2); }
  .sidebar .nav-item, :root:not([data-theme="dark"]) .sidebar .nav-item { height: 54px; margin-inline-start: 0; padding: 0 4px; gap: 22px; border-radius: 0; font-size: 19px; color: var(--ios-label); background: none; }
  .sidebar .nav-item .ic { width: 26px; height: 26px; stroke-width: 1.5; color: rgba(60, 60, 67, .7); }
  .sidebar .nav-item.active, :root:not([data-theme="dark"]) .sidebar .nav-item.active { background: none; color: var(--brand); font-weight: 600; }
  .sidebar .nav-item.active .ic { color: var(--brand); }
  .nav-section h3 { margin-inline-start: 4px; font-size: 17px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ios-2); }

  /* Agenda : grille plein écran façon Outlook */
  .month-head span { padding: 10px 0; font-size: 15px; font-weight: 600; color: var(--ios-label); border-inline-end: .5px solid var(--ios-sep); border-bottom: .5px solid var(--ios-sep); }
  .month-grid { grid-template-rows: repeat(6, 72px); }
  .m-cell { border-top: 0; border-inline-end: .5px solid var(--ios-sep); border-bottom: .5px solid var(--ios-sep); align-items: center; padding-top: 8px; }
  .m-num { font-size: 15px; font-weight: 400; }
  .m-cell.today .m-num { background: var(--brand); color: #fff; min-width: 44px; }
  .m-cell.sel { background: var(--brand-softer); }
  .cal-hero h1 { font-size: 34px; }
}
@media (max-width: 760px) {
  .m-num { align-self: center; }
  .m-search-bar .searchbar:focus-within { box-shadow: none; }
  .set-val { font-size: 15px; }
  .set-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Outlook iOS — 2e ligne de l'en-tête, feuille Applications, ajout de compte */
.m-row2 { display: none; }
@media (max-width: 760px) {
  .m-row2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
  .m-row2 .m-chips { margin-top: 0; }
  .m-filter {
    display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; color: #fff; font-size: 17px; font-weight: 500;
    background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
  .m-filter .ic { width: 22px; height: 22px; stroke-width: 1.6; }
  .m-chips .chip { height: 36px; padding: 0 18px; }

  .tab-item { min-width: 96px; border: 0; background: none; font-family: inherit; }
  .tab-item.active { background: rgba(0, 0, 0, .07); }

  .apps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 8px; padding: 6px 0 12px; }
  .app-tile { display: grid; justify-items: center; gap: 8px; border: 0; background: none; color: var(--ios-label); font-size: 14px; text-decoration: none; font-family: inherit; }
  .app-tile span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; border: 1.5px solid rgba(60, 60, 67, .25); color: rgba(60, 60, 67, .8); }
  .app-tile .ic { width: 30px; height: 30px; stroke-width: 1.5; }
  .sheet-head h2 { font: 600 17px -apple-system, system-ui, sans-serif; }

  .drawer-app { border: 0; }
  .drawer-app .ic { width: 26px; height: 26px; }
  .drawer-me .avatar { --s: 56px !important; }
  .choice { font-size: 17px; }
  .choice small { font-size: 14px; }
}

/* Photo de profil */
.avatar-photo { background: var(--surface-2); overflow: hidden; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-edit { position: relative; display: inline-block; cursor: pointer; border-radius: 50%; }
.photo-badge { position: absolute; inset-inline-end: -2px; bottom: -2px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-strong); color: #fff; border: 3px solid var(--surface); }
.photo-badge .ic { width: 16px; height: 16px; }
.photo-actions { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.photo-actions .btn { width: auto !important; cursor: pointer; }

/* =========================================================================
   Nouveau message (ordinateur) : fenêtres façon Gmail, plusieurs à la fois,
   ancrées en bas à droite ou déplacées librement par leur en-tête
   ========================================================================= */
@media (min-width: 761px) {
  .composer { width: 520px; height: min(600px, calc(100dvh - 80px)); border-radius: 12px 12px 0 0; z-index: 60; transition: opacity .2s ease, transform .2s ease; }
  .composer.focus { z-index: 62; }
  .composer.min { width: 300px; height: 44px; }
  .composer.free { border-radius: 12px; box-shadow: 0 24px 64px rgba(16, 40, 32, .3), 0 4px 14px rgba(16, 40, 32, .12); }
  .composer.dragging { transition: none; user-select: none; }
  .composer.max { inset-inline-start: auto !important; top: auto !important; }
  .composer-head { height: 44px; padding: 0 6px 0 16px; background: #edf2ef; color: var(--fg); border-radius: 12px 12px 0 0; cursor: move; }
  .composer.free .composer-head { border-radius: 12px 12px 0 0; }
  .composer.min .composer-head { border-radius: 12px 12px 0 0; }
  .composer-title strong { font-size: 14px; font-weight: 600; }
  .composer-head .composer-win .icon-btn { color: var(--fg-2); }
  .composer-head .composer-win .icon-btn:hover { background: rgba(0, 0, 0, .06); color: var(--fg); }
  .c-field { min-height: 40px; padding: 0 16px; }
  .c-field > span { font-size: 14px; }
  .composer-foot .btn.primary { border-radius: 999px; padding: 0 22px; min-height: 38px; }
}

/* =========================================================================
   Ordinateur — organisation d'Outlook sur le web, aux couleurs BigoMail
   Barre du haut verte, rail d'applications, ruban « Accueil », volet des
   dossiers sur fond clair, liste et lecture sur des cartes blanches.
   ========================================================================= */
.ribbon { display: none; }
@media (min-width: 761px) {
  .shell {
    grid-template-columns: 56px 236px minmax(0, 1fr);
    grid-template-rows: 48px auto minmax(0, 1fr);
    grid-template-areas: "top top top" "rail ribbon ribbon" "rail side stage";
    background: #f3f5f4; color: var(--fg);
  }
  .shell.collapsed { grid-template-columns: 56px 0 minmax(0, 1fr); }
  :root[data-theme="dark"] .shell { background: #0f1412; }

  /* Barre du haut */
  .topbar { height: 48px; padding: 0 12px 0 0; gap: 4px; background: var(--brand-strong); }
  .launcher { width: 56px; height: 48px; border-radius: 0; color: #fff !important; }
  .launcher:hover { background: rgba(255, 255, 255, .1) !important; }
  .brand { width: auto; height: 38px; gap: 10px; padding: 0 12px 0 6px; margin-inline-end: 24px; border-radius: 8px; }
  .brand:hover { background: rgba(255, 255, 255, .1); }
  .brand:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
  .brand-tile { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #fff; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
  .brand-tile img { width: 24px; height: auto; }
  .brand-name { font: 600 17px var(--font); color: #fff; letter-spacing: -.005em; }
  .searchbar { max-width: 460px; height: 34px; border-radius: 6px; padding: 0 6px 0 12px; }
  .searchbar input { font-size: 14px; }
  .top-actions .icon-btn { color: rgba(255, 255, 255, .92); }
  .me-btn { box-shadow: none; }

  /* Ruban */
  .ribbon { grid-area: ribbon; display: block; padding: 0 12px 8px 4px; min-width: 0; }
  .shell:not([data-view="mail"]) .ribbon { display: none; }
  .ribbon-tabs { display: flex; align-items: center; gap: 4px; height: 40px; }
  .ribbon-tabs .icon-btn { color: var(--fg-2); }
  .ribbon-tab { position: relative; padding: 8px 10px; font-size: 14px; color: var(--fg-2); text-decoration: none; border-radius: 6px; }
  a.ribbon-tab:hover { background: rgba(0, 0, 0, .05); }
  .ribbon-tab.on { color: var(--fg); font-weight: 600; }
  .ribbon-tab.on::after { content: ""; position: absolute; inset-inline-start: 10px; inset-inline-end: 10px; bottom: 0; height: 2px; border-radius: 2px; background: var(--brand-strong); }
  .ribbon-bar {
    display: flex; align-items: center; gap: 2px; height: 46px; padding: 0 8px; overflow-x: auto; scrollbar-width: none;
    background: var(--surface); border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .03);
  }
  .rb-new { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 10px; border: 0; border-radius: 6px; background: var(--brand-strong); color: #fff; font: 600 14px var(--font); white-space: nowrap; flex: none; }
  .rb-new:hover { background: #1b5240; }
  .rb-new .ic { width: 18px; height: 18px; }
  .rb { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--fg-2); font-size: 14px; white-space: nowrap; flex: none; }
  .rb:hover { background: #eef2f0; color: var(--fg); }
  .rb .ic { width: 18px; height: 18px; color: var(--brand); }
  .rb-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--line-strong); flex: none; }

  /* Rail d'applications : icônes seules */
  .rail { padding-top: 4px; gap: 2px; }
  .rail-item { width: 56px; color: #4f5b56; }
  .rail-item > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rail-ic { width: 40px; height: 40px; border-radius: 8px; }
  .rail-item:hover .rail-ic { background: rgba(0, 0, 0, .05); }
  .rail-item.active .rail-ic { background: #dcebe5; color: var(--brand-strong); }
  .rail-item[data-badge] .rail-ic::after { top: 6px; inset-inline-end: 6px; border-color: #f3f5f4; }

  /* Volet des dossiers */
  .sidebar {
    --fg: #1d2622; --fg-2: #2f3a35; --muted: #66726d; --faint: #9aa8a3; --hover: rgba(0, 0, 0, .05); --press: rgba(0, 0, 0, .08);
    --line: #e1e7e4; --brand-soft: #dcebe5; --brand-softer: #edf5f1; --brand-strong: #22634d;
    color: var(--fg);
  }
  .sidebar-main { padding: 0 8px 16px 4px; }
  #compose-btn { display: none; }
  .drawer-head { display: flex; align-items: center; gap: 6px; padding: 6px 12px 4px; }
  .drawer-head strong { display: none; }
  .drawer-head span { font-size: 14px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-item { height: 34px; margin-inline-start: 0; padding: 0 10px 0 14px; gap: 12px; border-radius: 6px; color: var(--fg-2); font-size: 14px; }
  .nav-item:hover { background: var(--hover); color: var(--fg); }
  .nav-item.active { background: var(--brand-soft); color: var(--fg); font-weight: 600; }
  .nav-item.active::before { display: none; }
  .nav-item .ic { width: 18px; height: 18px; color: var(--muted); }
  .nav-item.active .ic { color: var(--brand-strong); }
  .nav-count { color: var(--brand-strong); }
  .nav-section { margin-top: 16px; }
  .nav-section h3 { margin: 0 0 4px 12px; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--fg); }
  .side-foot, .side-hint { color: var(--muted); }
  .sidebar .compose-btn { box-shadow: none; }

  /* Zone de travail : cartes blanches séparées */
  .stage { padding: 0 12px 12px 0; }
  .stage > section { border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .03); }
  .stage > .mail-view { background: transparent; box-shadow: none; gap: 8px; overflow: visible; }
  .mail-view .list-pane, .mail-view .read-pane { background: var(--surface); border: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .03); }
  .cat-tabs { justify-content: flex-start; gap: 4px; padding: 0 8px; }
  .cat-tab { flex: none; height: 44px; padding: 0 10px; font-size: 14px; color: var(--fg-2); }
  .cat-tab.on { color: var(--fg); font-weight: 600; }
  .cat-tab.on::after { inset-inline-start: 10px; inset-inline-end: 10px; height: 2px; background: var(--brand-strong); }
  .cat-tab b { display: none; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .shell, .shell.collapsed { grid-template-columns: 56px 0 minmax(0, 1fr); }
  .shell.drawer .sidebar { inset-inline-start: 56px; top: 48px; background: #f3f5f4; }
  .rb span { display: none; }
  .rb-new span { display: inline; }
}

/* Choix de la langue */
.lang-pick { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--fg); font-size: 15px; }
.auth-lang { display: flex; justify-content: center; margin-top: 18px; }
.auth-lang .lang-pick { height: 34px; border-radius: 999px; background: rgba(255, 255, 255, .6); border-color: rgba(255, 255, 255, .8); font-size: 14px; }
.lang-list .set-row { cursor: pointer; }
.lang-list input { accent-color: var(--brand); width: 20px; height: 20px; }
.adv-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adv-checks { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 14px; }
.adv-checks input { accent-color: var(--brand); }
.m-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 4px; }
.m-filters .chip { background: var(--ios-fill, #eef1ef); color: var(--fg); border: 0; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 15px; gap: 6px; }
.m-filters .chip.on { background: var(--brand-strong); color: #fff; }
.m-filters .chip .ic { width: 16px; height: 16px; }

/* Squelettes de chargement */
.skel { padding: 8px 0; }
.skel-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; }
.skel-row span { flex: 1; display: grid; gap: 8px; padding-top: 2px; }
.skel b, .skel-av { display: block; height: 11px; border-radius: 6px; background: linear-gradient(90deg, #eceff0 25%, #f6f8f8 37%, #eceff0 63%) 0 0 / 400% 100%; animation: skel 1.3s ease infinite; }
.skel-av { flex: none; width: 40px; height: 40px; border-radius: 50%; }
.skel-read { display: grid; gap: 12px; padding: 24px; }
.skel-read .skel-row { padding: 6px 0; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
:root[data-theme="dark"] .skel b, :root[data-theme="dark"] .skel-av { background: #222a27; animation: none; }

/* Lecture sur téléphone, façon Outlook : grand objet, cartes de messages aérées */
@media (max-width: 760px) {
  .reader-scroll { padding: 4px 16px calc(100px + var(--safe-b)); }
  .reader-head h1 { font: 700 24px/1.25 -apple-system, system-ui, sans-serif; letter-spacing: -.01em; }
  .msg-card { border: 0; border-radius: 0; border-bottom: .5px solid var(--ios-sep); }
  .msg-summary { padding: 14px 0; }
  .msg-full { padding: 0 0 16px; }
  .reader-bar .icon-btn { color: var(--ios-label); }
}

/* =========================================================================
   Arabe (droite à gauche) : les propriétés logiques retournent la mise en page ;
   on retourne ici les déplacements horizontaux et les flèches.
   ========================================================================= */
[dir="rtl"] .switch:checked::after { transform: translateX(-18px); }
[dir="rtl"] .composer.max { transform: translate(-50%, 50%); }
[dir="rtl"] .toast-zone { transform: translateX(50%); }
[dir="rtl"] .assistant { transform: translateX(calc(-100% - 24px)); }
[dir="rtl"] .assistant.in { transform: none; }
[dir="rtl"] .ic-flip, [dir="rtl"] [data-read="back"] .ic, [dir="rtl"] .chev, [dir="rtl"] .set-head > a .ic { transform: scaleX(-1); }
@media (max-width: 760px) {
  [dir="rtl"] .sidebar { transform: translateX(102%); }
  [dir="rtl"] .shell.drawer .sidebar { transform: none; }
  [dir="rtl"] .read-pane, [dir="rtl"] .ct-detail { transform: translateX(-100%); }
  [dir="rtl"] .mail-view.reading .read-pane, [dir="rtl"] .contacts-view.reading .ct-detail { transform: none; }
  [dir="rtl"] .tabbar { transform: translateX(50%); }
}
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", system-ui, sans-serif; }
[dir="rtl"] .mono, [dir="rtl"] .sender-addr, [dir="rtl"] .r-chip span { direction: ltr; unicode-bidi: isolate; }

/* Bandeau d installation au-dessus de la barre d onglets */
@media (max-width: 760px) {
  body:not(.is-auth) { --ig-bottom: 92px; }
}

/* Réglages (ordinateur) : libellés complets, jamais tronqués */
@media (min-width: 761px) {
  .sidebar .set-label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
  .sidebar .set-row { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
}

/* Libellés de navigation complets (tiroir mobile, tablette) */
.sidebar .nav-label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }
@media (max-width: 760px) { .sidebar .nav-item { height: auto; min-height: 54px; } }
/* Ordinateur : une seule action de création (dans le volet), pas de doublon dans l'en-tête */
@media (min-width: 1101px) { #d-add, #cal-add { display: none; } }

.sidebar .set-label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
.settings-view .set-label { white-space: normal; overflow: visible; text-overflow: clip; }

/* Assistant IA désactivé sur le serveur */
.no-ai #ask-btn, .no-ai .ai-btn, .no-ai .ai-outline, .no-ai .ai-tool, .no-ai [data-read="aireply"], .no-ai [data-read="translate"],
.no-ai [data-proxy="analyze"], .no-ai [data-ask], .no-ai [data-c="analyze"], .no-ai [data-d="ai"], .no-ai #m-ask { display: none !important; }

/* =========================================================================
   Fonctionnalités avancées : nouveaux expéditeurs, programmés, équipe,
   devis et factures, paiements, adresses masquées
   ========================================================================= */
.chip-s.later { background: var(--brand-soft); color: var(--brand-strong); }
.chip-s.via { background: var(--surface-2); color: var(--muted); font-weight: 500; }

/* Bandeau dans la boîte de réception */
.screener-banner { display: flex; align-items: center; gap: 12px; margin: 8px 12px 4px; padding: 11px 14px; border-radius: var(--r); background: var(--brand-softer); border: 1px solid var(--brand-soft); color: var(--fg); text-decoration: none; font-size: 13.5px; }
.screener-banner > .ic:first-child { width: 20px; height: 20px; color: var(--brand-strong); flex: none; }
.screener-banner span { flex: 1; min-width: 0; }
.screener-banner > .ic:last-child { width: 16px; height: 16px; color: var(--muted); }
.screener-banner:hover { border-color: var(--brand); }

/* Cartes de la liste : nouveaux expéditeurs, envois programmés */
.screener-intro { display: flex; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--fg-2); list-style: none; }
.screener-intro > .ic { width: 22px; height: 22px; color: var(--brand-strong); flex: none; margin-top: 2px; }
.screener-intro p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.screen-card, .sched-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--line); list-style: none; }
.screen-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.screen-top { display: flex; align-items: baseline; gap: 10px; }
.screen-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-top time { color: var(--muted); font-size: 12px; flex: none; }
.screen-addr { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-subj { color: var(--fg-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-main .chip-s { justify-self: start; margin-top: 4px; }
.screen-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sched-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-softer); color: var(--brand-strong); flex: none; }
.sched-ic .ic { width: 20px; height: 20px; }
.sched-when { color: var(--brand-strong); font-size: 13px; font-weight: 600; }
.sched-when::first-letter { text-transform: uppercase; }

/* Bouton Envoyer avec menu d'options */
.send-split { display: inline-flex; }
.send-split > .btn.primary:first-child { border-start-end-radius: 0; border-end-end-radius: 0; }
.send-split > .send-more { border-start-start-radius: 0; border-end-start-radius: 0; padding: 0 8px; min-width: 0; border-inline-start: 1px solid rgba(255,255,255,.28); }
.send-split > .send-more .ic { width: 16px; height: 16px; margin: 0; }
.send-flags { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.send-flags:empty { display: none; }
.send-flags span { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--brand-softer); color: var(--brand-strong); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.choice .opt-ic { display: grid; place-items: center; flex: none; }
.choice > span:not(.opt-ic) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.choice > span small { font-size: 12px; font-weight: 400; }
.choice select { border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 6px 8px; font-size: 13px; color: var(--fg); }
.choice-hint { margin-inline-start: auto; font-size: 12.5px; white-space: nowrap; }

/* Boîte partagée */
.box-bar { display: flex; align-items: center; gap: 10px; padding: 7px 16px; background: var(--brand); color: var(--brand-ink); font-size: 13px; position: relative; z-index: 5; }
.box-bar > .ic { width: 17px; height: 17px; flex: none; }
.box-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-bar button { border: 1px solid currentColor; background: none; color: inherit; border-radius: 99px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.box-bar button:hover { background: rgba(255,255,255,.14); }
.box-panel { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--yellow-soft); background: color-mix(in srgb, var(--yellow-soft) 45%, var(--surface)); }
.box-panel header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.box-panel header > .ic { width: 18px; height: 18px; color: var(--yellow-ink); }
.box-panel header strong { margin-inline-end: auto; }
.box-panel .assign { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-2); }
.box-panel select { border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 5px 8px; font-size: 13px; color: var(--fg); }
.box-notes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.box-notes li { font-size: 13.5px; }
.box-notes li strong { font-size: 12.5px; }
.box-notes li time { margin-inline-start: 8px; color: var(--muted); font-size: 11.5px; }
.box-notes li p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.box-panel .inline-add { background: var(--surface); }
.account-links.boxes { display: grid; }
.acct-sub { margin: 4px 14px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.account-links.boxes button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 8px 14px; text-align: start; color: var(--fg); border-radius: var(--r); }
.account-links.boxes button:hover { background: var(--hover); }
.account-links.boxes button.on { background: var(--brand-softer); }
.account-links.boxes button span { display: grid; min-width: 0; font-size: 13.5px; font-weight: 600; }
.account-links.boxes small { font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Réglages : listes */
.sender-list, .mask-list { list-style: none; margin: 10px 0 0; padding: 0; }
.sender-list li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sender-list li:first-child { border-top: 0; }
.sender-list li > span { min-width: 0; overflow-wrap: anywhere; }
.sender-list small { display: block; }
.mask-list li { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.mask-list li:first-child { border-top: 0; }
.mask-list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mask-list li.off strong, .mask-list li.off .mono { color: var(--muted); text-decoration: line-through; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.small { font-size: 12.5px; }
.input.addr input { padding-inline-end: 4px; }
.box-card h3 { display: flex; align-items: center; gap: 8px; }
.box-card h3 .ic { width: 18px; height: 18px; color: var(--brand-strong); }
.box-card > p.mono { margin: -4px 0 6px; color: var(--muted); }
.box-card > .btn { margin-top: 12px; }
.set-card + .set-card { margin-top: 14px; }

/* Devis et factures */
.doc-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; font-size: 14px; }
.doc-table th { text-align: start; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; background: var(--surface-2); }
.doc-table td { padding: 12px 14px; border-top: 1px solid var(--line); }
.doc-table tbody tr { cursor: pointer; }
.doc-table tbody tr:hover { background: var(--hover); }
.num { font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.doc-status { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--fg-2); white-space: nowrap; }
.doc-status.s-envoye { background: #e6eefb; color: #2d5ea8; }
.doc-status.s-accepte, .doc-status.s-paye { background: var(--ok-soft); color: var(--ok); }
.doc-status.s-refuse { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .doc-status.s-envoye { background: #1b2a40; color: #8fb6f0; }
.doc-editor .reader-bar { gap: 8px; padding-inline-end: 14px; }
.doc-title { font-size: 16px; }
.doc-form { display: grid; gap: 14px; max-width: 980px; margin: 0 auto; }
.doc-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
.doc-form .set-card + .set-card { margin-top: 0; }
.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.doc-lines { display: grid; gap: 8px; margin: 10px 0 8px; }
.doc-line { display: grid; grid-template-columns: minmax(0, 1fr) 80px 130px 120px 32px; gap: 8px; align-items: center; }
.doc-line input { min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 9px 10px; font-size: 14px; color: var(--fg); }
.doc-line input:focus { outline: none; border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.dl-total { font-weight: 600; font-size: 14px; }
.doc-totals { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc-totals label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.doc-totals input, .doc-totals select { border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 8px 10px; font-size: 14px; width: 110px; color: var(--fg); }
.doc-sum { margin-inline-start: auto; display: grid; gap: 4px; text-align: end; font-size: 13.5px; color: var(--fg-2); }
.doc-sum b { font-variant-numeric: tabular-nums; margin-inline-start: 10px; }
.doc-sum .grand { font-size: 17px; color: var(--fg); font-weight: 700; }
.doc-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-bottom: 24px; }
.doc-form .banner a { overflow-wrap: anywhere; }

/* Paiements */
.bills-intro { margin: 0 0 14px; font-size: 13.5px; max-width: 640px; }
.bill-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.bill-list .empty-state { border: 0; }
.bill-total { padding: 12px 16px; background: var(--surface-2); font-size: 14px; color: var(--fg-2); }
.bill-total strong { color: var(--fg); font-variant-numeric: tabular-nums; }
.bill { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); }
.bill-total + .bill, .bill:first-child { border-top: 0; }
.bill-total + .bill { border-top: 1px solid var(--line); }
.bill-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--yellow-soft); color: var(--yellow-ink); flex: none; }
.bill-ic .ic { width: 20px; height: 20px; }
.bill-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bill-main span { color: var(--fg-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-main small { color: var(--muted); font-size: 12.5px; }
.bill-main small.soon { color: var(--warn); font-weight: 600; }
.bill-main small.late { color: var(--danger); font-weight: 600; }
.bill-side { display: grid; justify-items: end; gap: 6px; }
.bill-amount { font-weight: 700; font-size: 15.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-actions { display: flex; align-items: center; gap: 4px; }

@media (max-width: 760px) {
  .doc-cols { grid-template-columns: 1fr; }
  .doc-line { grid-template-columns: 1fr 64px 1fr 32px; }
  .doc-line .dl-label { grid-column: 1 / -1; }
  .doc-line .dl-total { display: none; }
  .doc-totals input, .doc-totals select { width: 92px; }
  .doc-sum { margin-inline-start: 0; width: 100%; }
  .doc-table thead { display: none; }
  .doc-table, .doc-table tbody { display: block; }
  .doc-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .doc-table tr:first-child { border-top: 0; }
  .doc-table td { padding: 0; border: 0; }
  .doc-table td:nth-child(5) { color: var(--muted); font-size: 12.5px; }
  .doc-actions .btn { flex: 1; }
  .bill { flex-wrap: wrap; }
  .bill-side { width: 100%; grid-template-columns: auto 1fr; align-items: center; justify-items: start; padding-inline-start: 54px; }
  .bill-actions { justify-self: end; }
  .box-bar { padding-top: calc(7px + var(--safe-t, 0px)); }
  .screener-banner { margin: 8px 16px 4px; }
  .composer-foot .send-flags { order: -1; width: 100%; }
}
.c-tools .c-opts { display: none; }
@media (max-width: 760px) { .c-tools .c-opts { display: inline-grid; } }
/* Corrections après vérification visuelle */
.composer-foot { flex-wrap: wrap; }
.composer-foot .send-flags { order: -1; width: 100%; padding: 0 0 4px; }
.send-split { gap: 0; }
.send-split > .send-more { width: 36px; padding: 0; justify-content: center; }
.doc-cols > .set-card { align-content: start; }
.set-card .inline-add.big { margin-bottom: 0; }
body.in-box .shell { height: calc(100dvh - 36px); }
.box-bar { min-height: 36px; }
.choice-hint { max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  body.in-box .shell { height: auto; }
  .box-bar {
    position: fixed; z-index: 40; inset-inline-start: 16px; max-width: calc(100% - 112px);
    bottom: calc(100px + var(--safe-b, 0px)); min-height: 0; padding: 8px 8px 8px 14px; border-radius: 99px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  }
  .box-bar span { font-size: 12.5px; }
  .box-bar .bb-lbl, .box-bar .bb-addr { display: none; }
  .box-bar button { padding: 5px 10px; font-size: 12px; }
  .c-tools [data-c=from] { display: none; }
  .m-hero h1.long { font-size: 22px; }
}
.box-bar em { font-style: normal; }

/* =========================================================================
   Discussions : échanges par correspondant, en bulles, fichiers à côté
   ========================================================================= */
.chat-view { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) auto; }
.cv-list-pane { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--line); background: var(--surface); }
.cv-search { padding: 12px 12px 6px; }
.cv-search .searchbar { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.cv-search .searchbar .ic { width: 18px; height: 18px; flex: none; }
.cv-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 14px; color: var(--fg); }
.cv-chips { display: flex; gap: 6px; padding: 4px 12px 10px; border-bottom: 1px solid var(--line); }
.cv-chips .chip { height: 28px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 99px; font-size: 13px; text-decoration: none; color: var(--fg-2); background: var(--surface-2); }
.cv-chips .chip.on { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.cv-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.cv-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.cv-row:hover { background: var(--hover); }
.cv-row.active { background: var(--brand-softer); box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .cv-row.active { box-shadow: inset -3px 0 0 var(--brand); }
.cv-row-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.cv-row-top { display: flex; align-items: baseline; gap: 8px; }
.cv-row-top strong { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-row-top time { flex: none; font-size: 12px; color: var(--muted); }
.cv-row-sub { display: flex; align-items: center; gap: 8px; }
.cv-row-sub > span { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-row-sub em { font-style: normal; color: var(--fg-2); }
.cv-row-sub .ic { width: 14px; height: 14px; vertical-align: -2px; margin-inline-end: 3px; }
.cv-row.unread .cv-row-top strong { font-weight: 700; }
.cv-row.unread .cv-row-top time { color: var(--brand-strong); font-weight: 600; }
.cv-row.unread .cv-row-sub > span { color: var(--fg-2); }
.cv-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.cv-av-group { position: relative; width: 46px; height: 46px; flex: none; }
.cv-av-group > * { position: absolute; border: 2px solid var(--surface); border-radius: 50%; }
.cv-av-group > :first-child { top: 0; inset-inline-start: 0; }
.cv-av-group > :last-child { bottom: 0; inset-inline-end: 0; }
.cv-head .cv-av-group { width: 42px; height: 42px; }

/* Fil de la discussion */
.cv-chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.cv-chat .read-empty { margin: auto; display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 24px; }
.cv-chat .read-empty .ic { width: 40px; height: 40px; color: var(--line-strong); }
.cv-chat .read-empty strong { color: var(--fg); font-size: 16px; }
.cv-chat .read-empty p { margin: 0; }
.cv-chat.drop::after { content: "Déposez les fichiers pour les joindre"; position: absolute; inset: 8px; display: grid; place-items: center; border: 2px dashed var(--brand); border-radius: 12px; background: color-mix(in srgb, var(--brand-softer) 88%, transparent); color: var(--brand-strong); font-weight: 600; z-index: 5; }
.cv-head { flex: none; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.cv-head [data-a="back"] { display: none; }
.cv-head-who { flex: 1; min-width: 0; display: grid; }
.cv-head-who strong { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-head-who span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-files-btn { gap: 6px; }
.cv-files-btn b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--surface-3); font-size: 11px; display: inline-grid; place-items: center; }
.cv-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 3px; background: var(--bg); }
.cv-older { align-self: center; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 6px 14px; font-size: 12.5px; color: var(--fg-2); margin-bottom: 8px; }
.cv-day { align-self: center; margin: 14px 0 6px; }
.cv-day span { display: inline-block; padding: 3px 12px; border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.cv-day span::first-letter { text-transform: uppercase; }
.cv-subject { align-self: center; margin: 8px 0 6px; max-width: 86%; }
.cv-subject button { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: none; color: var(--fg-2); font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.cv-subject button:hover { background: var(--surface-3); }
.cv-subject .ic { width: 14px; height: 14px; color: var(--brand-strong); flex: none; }
.cv-subject span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bubble { position: relative; max-width: min(72%, 640px); padding: 8px 12px 6px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 1px 1px rgba(0, 0, 0, .03); align-self: flex-start; margin-top: 4px; transition: box-shadow .2s; }
.bubble.in { border-start-start-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--brand-softer); box-shadow: 0 0 0 1px var(--brand-soft); border-start-end-radius: 4px; }
.bubble.pending { opacity: .7; }
.bubble.focus { box-shadow: 0 0 0 2px var(--brand); }
.bubble.flash { animation: cv-flash 1.4s ease-out; }
@keyframes cv-flash { 0%, 30% { box-shadow: 0 0 0 4px var(--brand); } 100% { box-shadow: 0 0 0 1px var(--line); } }
.b-name { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.b-text { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
.b-text a { color: var(--brand-strong); }
.bubble footer { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.bubble footer time { white-space: nowrap; }
.b-full { margin-inline-end: auto; color: var(--brand-strong); text-decoration: none; font-weight: 600; }
.b-full:hover { text-decoration: underline; }
.b-sent .ic { width: 14px; height: 14px; color: var(--brand); vertical-align: -3px; }

/* Pièces jointes rattachées à la bulle */
.b-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.b-file { display: inline-flex; align-items: center; gap: 10px; max-width: 280px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: start; color: var(--fg); }
.bubble.out .b-file { border-color: var(--brand-soft); }
.b-file:hover { border-color: var(--brand); }
.b-file-ic { position: relative; display: grid; place-items: center; width: 38px; height: 42px; border-radius: 7px; background: var(--surface-3); color: var(--fg-2); flex: none; }
.b-file-ic .ic { width: 20px; height: 20px; margin-top: -8px; }
.b-file-ic em { position: absolute; bottom: 4px; font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.b-file-ic b { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--fg); color: var(--surface); font-size: 10.5px; display: grid; place-items: center; border: 2px solid var(--surface); }
.b-file.k-pdf .b-file-ic { background: #fde8e6; color: #b3261e; }
.b-file.k-sheet .b-file-ic { background: #e3f3e9; color: #17683f; }
.b-file.k-doc .b-file-ic { background: #e5edfb; color: #2a5bb0; }
.b-file.k-audio .b-file-ic, .b-file.k-video .b-file-ic { background: #efe8fb; color: #6a3fb0; }
.b-file.k-zip .b-file-ic { background: var(--yellow-soft); color: var(--yellow-ink); }
:root[data-theme="dark"] .b-file .b-file-ic { background: var(--surface-3); color: var(--fg-2); }
.b-file-name { min-width: 0; display: grid; font-size: 13px; font-weight: 600; }
.b-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-file-name small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.b-thumbs { position: relative; display: flex; gap: 3px; padding: 0; border: 0; background: none; border-radius: 10px; overflow: hidden; }
.b-thumbs img { width: 84px; height: 84px; object-fit: cover; background: var(--surface-3); }
.b-thumbs:only-child img:only-of-type { width: 220px; height: 160px; }
.b-thumbs b { position: absolute; inset-inline-end: 0; top: 0; bottom: 0; width: 84px; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff; font-size: 18px; }
.b-thumbs:hover img { filter: brightness(.94); }

/* Zone de réponse */
.cv-compose { flex: none; padding: 8px 12px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.cv-ctx { display: flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: none; padding: 2px 6px 6px; font-size: 12.5px; color: var(--muted); border-radius: 6px; }
.cv-ctx span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-ctx strong { color: var(--fg-2); }
.cv-ctx .ic { width: 14px; height: 14px; flex: none; }
.cv-ctx:hover { color: var(--fg); }
.cv-att { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cv-att:empty { display: none; }
.cv-att li { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; height: 30px; padding: 0 4px 0 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.cv-att li .ic { width: 15px; height: 15px; flex: none; color: var(--muted); }
.cv-att li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-att li small { color: var(--muted); flex: none; }
.cv-att li button { border: 0; background: none; width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; }
.cv-att li button .ic { width: 14px; height: 14px; }
.cv-row-in { display: flex; align-items: flex-end; gap: 6px; }
.cv-row-in textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line-strong); border-radius: 20px; padding: 10px 16px; font: inherit; font-size: 14.5px; line-height: 1.4; max-height: 180px; overflow-y: hidden; background: var(--surface); color: var(--fg); outline: none; }
.cv-row-in textarea:focus { border-color: var(--brand); }
.cv-send { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.cv-send .ic { width: 20px; height: 20px; }
.cv-send:disabled { opacity: .5; }

/* Visionneuse de fichiers */
.cv-viewer { display: flex; flex-direction: column; min-height: 0; background: var(--surface); position: relative; }
.cv-viewer[hidden] { display: none; }
.cv-viewer.mode-dock { width: 460px; min-width: 320px; border-inline-start: 1px solid var(--line); }
.cv-viewer.mode-float {
  position: fixed; z-index: 70; right: 24px; bottom: 24px; width: 520px; height: 600px; min-width: 300px; min-height: 260px;
  max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); resize: both; overflow: hidden;
  border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .06);
}
.mode-float .vw-head { cursor: move; }
.vw-resize { position: absolute; top: 0; bottom: 0; inset-inline-start: -4px; width: 8px; cursor: col-resize; z-index: 2; }
.vw-resize:hover, .vw-resize:active { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.vw-head { flex: none; display: flex; align-items: center; gap: 2px; min-height: 56px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); user-select: none; }
.vw-title { flex: 1; min-width: 0; display: grid; }
.vw-title strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-title small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); touch-action: none; }
.vw-stage.k-pdf, .vw-stage.k-text { place-items: stretch; touch-action: auto; }
.vw-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; transition: transform .12s; cursor: zoom-in; user-select: none; }
.vw-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.vw-text { margin: 0; padding: 16px; overflow: auto; font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); }
.vw-stage video { max-width: 100%; max-height: 100%; }
.vw-card { display: grid; justify-items: center; gap: 10px; padding: 28px; text-align: center; color: var(--muted); max-width: 320px; }
.vw-card > .ic { width: 52px; height: 52px; color: var(--fg-2); }
.vw-card strong { color: var(--fg); overflow-wrap: anywhere; }
.vw-card p { margin: 0; font-size: 13px; }
.vw-card audio { width: 280px; max-width: 100%; }
.vw-foot { flex: none; display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--line); }
.vw-foot .text-btn { display: inline-flex; align-items: center; gap: 4px; }
.vw-foot .text-btn .ic { width: 15px; height: 15px; }
.vw-zoom { min-width: 46px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vw-strip { flex: none; display: flex; gap: 6px; padding: 8px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
.vw-strip button { position: relative; flex: none; width: 52px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--fg-2); }
.vw-strip button.on { border-color: var(--brand); }
.vw-strip img { width: 100%; height: 100%; object-fit: cover; }
.vw-strip .ic { width: 18px; height: 18px; margin-top: -10px; }
.vw-strip em { position: absolute; bottom: 5px; font-style: normal; font-size: 9px; font-weight: 800; }
.vw-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 14px 16px; }
.vw-grid section + section { margin-top: 12px; }
.vw-grid h4 { margin: 8px 0; font-size: 13px; color: var(--fg-2); }
.vw-grid h4 span { color: var(--muted); font-weight: 400; }
.vw-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; }
.vw-imgs button { padding: 0; border: 0; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.vw-imgs img { width: 100%; height: 100%; object-fit: cover; }
.vw-docs { display: grid; gap: 2px; }
.vw-docs button { display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; background: none; border-radius: 8px; text-align: start; color: var(--fg); min-width: 0; }
.vw-docs button:hover { background: var(--hover); }
.vw-docs .ic { width: 22px; height: 22px; color: var(--muted); flex: none; }
.vw-docs span { display: grid; min-width: 0; font-size: 13.5px; }
.vw-docs strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-docs small { color: var(--muted); font-size: 12px; }

@media (min-width: 761px) {
  .stage > .chat-view { background: transparent; box-shadow: none; gap: 8px; overflow: visible; }
  .chat-view .cv-list-pane, .chat-view .cv-chat, .chat-view .cv-viewer.mode-dock { border: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .03); }
  .chat-view .m-hero { display: none; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  .chat-view.viewing { grid-template-columns: 0 minmax(0, 1fr) auto; }
  .chat-view.viewing .cv-list-pane { display: none; }
}
@media (max-width: 760px) {
  .chat-view { display: block; position: relative; }
  .cv-chips[data-desktop] { display: none; }
  .cv-list-pane { border: 0; min-height: 100%; background: var(--surface); }
  .cv-list-pane .m-hero { display: block; }
  .cv-search { padding: 10px 16px 4px; }
  .cv-row { padding: 12px 16px; border-bottom: 0; }
  .cv-row-main { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: -12px; }
  .cv-chat { position: fixed; inset: 0; z-index: 30; display: none; }
  .chat-view.open .cv-chat { display: flex; }
  body:has(.chat-view.open) .tabbar { display: none; }
  .cv-head { padding: calc(var(--safe-t, 0px)) 6px 0 4px; height: calc(60px + var(--safe-t, 0px)); }
  .cv-head [data-a="back"] { display: inline-grid; }
  .cv-files-btn span { display: none; }
  .cv-scroll { padding: 10px 10px 14px; }
  .bubble { max-width: 86%; }
  .cv-compose { padding: 6px 8px calc(8px + var(--safe-b, 0px)); }
  .cv-row-in textarea { font-size: 16px; }
  .cv-viewer.mode-sheet {
    position: fixed; z-index: 45; inset-inline: 0; bottom: 0; height: 56dvh; border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); padding-bottom: var(--safe-b, 0px); transition: height .2s;
  }
  .cv-viewer.mode-sheet.tall { height: calc(100dvh - 24px); }
  .vw-grip { flex: none; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
  .vw-head { min-height: 50px; }
  .chat-view.viewing .cv-compose { visibility: hidden; }
  .b-thumbs img { width: 72px; height: 72px; }
  .b-thumbs b { width: 72px; }
}
.cv-row-main > *, .cv-head-who > * { min-width: 0; }
.cv-list, .cv-scroll { overflow-x: hidden; }
.bubble { min-width: 0; }
.b-file { max-width: min(280px, 100%); }
@media (max-width: 1599px) and (min-width: 1181px) {
  .chat-view.viewing { grid-template-columns: 0 minmax(0, 1fr) auto; gap: 0 8px; }
  .chat-view.viewing .cv-list-pane { display: none; }
}

/* Connexion : récupération du mot de passe, saisie automatique du navigateur */
.nf input:-webkit-autofill, .nf input:-webkit-autofill:hover, .nf input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg); -webkit-box-shadow: 0 0 0 40px transparent inset; transition: background-color 600000s 0s;
}
.auth-link { justify-self: center; margin-top: 2px; border: 0; background: none; color: #1c5844; font: 600 13.5px var(--font); padding: 6px 10px; border-radius: 8px; }
.auth-link:hover { text-decoration: underline; }
.auth-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, .4); border: 1px solid rgba(255, 255, 255, .7); }
.auth-seg label { position: relative; }
.auth-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.auth-seg span { display: grid; place-items: center; min-height: 40px; padding: 4px 8px; border-radius: 12px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--fg-2); line-height: 1.25; }
.auth-seg input:checked + span { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(0, 20, 12, .15); }
.auth-seg input:focus-visible + span { outline: 2px solid #1c5844; outline-offset: 1px; }
.auth-form [data-mode="code"] { display: grid; gap: 10px; }
.auth-form [data-mode][hidden] { display: none; }
.auth-note { margin: 2px 4px; font-size: 12.5px; line-height: 1.45; color: #3f524b; text-align: center; }
.auth-ok { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(226, 244, 235, .9); color: #17583f; font-size: 13px; text-align: center; }

/* Code de secours */
.rc-sheet { display: grid; gap: 12px; }
.rc-sheet p { margin: 0; }
.rc-code { padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); text-align: center; font: 700 22px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--fg); user-select: all; overflow-wrap: anywhere; }
.rc-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rc-confirm { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--brand-softer); font-weight: 600; font-size: 14px; cursor: pointer; }
.rc-confirm input { width: 18px; height: 18px; accent-color: var(--brand); }

/* Réglages : sécurité et administration */
.sec-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.sec-row > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.sec-row small { color: var(--muted); font-size: 13px; }
.sec-row .input { margin-top: 6px; }
.sec-row > .btn { flex: none; margin-top: 2px; }
.sec-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; }
.sec-ic .ic { width: 16px; height: 16px; }
.sec-ic.ok { background: var(--ok-soft); color: var(--ok); }
.sec-ic.warn { background: var(--warn-soft); color: var(--warn); }
.danger-card h3 { color: var(--danger); }
.adm-list { list-style: none; margin: 4px 0 0; padding: 0; }
.adm-list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.adm-list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.adm-sel { flex: none; width: 22px; display: grid; place-items: center; }
.adm-sel input { width: 18px; height: 18px; accent-color: var(--brand); }
.adm-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 2px; }
.adm-bulk .btn { margin-inline-start: auto; }
.adm-bulk .btn:disabled { opacity: .45; }
.adm-list .chip-s { margin-inline-start: 6px; }
@media (max-width: 760px) {
  .sec-row { flex-wrap: wrap; }
  .sec-row > div { flex-basis: calc(100% - 42px); }
  .sec-row > .btn { margin-inline-start: 42px; }
  .adm-list li { flex-wrap: wrap; }
}
.chat-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; margin-inline-end: 6px; border: 0; border-radius: 99px; background: var(--brand-soft); color: var(--brand-strong); font: 600 13.5px var(--font); white-space: nowrap; flex: none; }
.chat-btn .ic { width: 17px; height: 17px; }
.chat-btn:hover { background: var(--brand); color: #fff; }
@media (max-width: 760px) { .chat-btn span { display: none; } .chat-btn { width: 40px; padding: 0; justify-content: center; background: none; } .chat-btn .ic { width: 22px; height: 22px; } }
.nav-chat { display: flex; align-items: center; gap: 12px; margin: 4px 4px 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-softer); border: 1px solid var(--brand-soft); color: var(--fg); text-decoration: none; }
.nav-chat .ic { width: 22px; height: 22px; color: var(--brand-strong); flex: none; }
.nav-chat span { display: grid; min-width: 0; }
.nav-chat strong { font-size: 14px; }
.nav-chat small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chat:hover { border-color: var(--brand); }

/* Modèles de réponses */
.set-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.set-card-head h3 { margin: 0; }
.tpl-list { list-style: none; margin: 8px 0 10px; padding: 0; }
.tpl-list li { display: flex; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.tpl-list li:first-child { border-top: 0; }
.tpl-list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tpl-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-pick .choice > span { display: grid; min-width: 0; }
.tpl-pick .choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.tpl-empty { padding: 8px 10px; }
.tpl-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tpl-field { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font: 600 12px ui-monospace, Menlo, Consolas, monospace; color: var(--fg-2); cursor: pointer; }
.tpl-field:hover { border-color: var(--brand); color: var(--brand-strong); }

/* Désinscription d'une liste de diffusion */
.unsub-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 12px 10px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 13.5px; color: var(--fg-2); }
.unsub-bar > .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
.unsub-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Coffre de documents */
.vault-intro { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; font-size: 13.5px; max-width: 720px; }
.vault-intro .ic { width: 18px; height: 18px; flex: none; color: var(--brand-strong); margin-top: 1px; }
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vault-grid > .empty-state { grid-column: 1 / -1; }
.vault-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.vault-thumb { display: grid; place-items: center; height: 150px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); cursor: zoom-in; overflow: hidden; }
.vault-thumb:disabled { cursor: default; }
.vault-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vault-pdf, .vault-none { display: grid; justify-items: center; gap: 4px; color: var(--muted); }
.vault-pdf .ic { width: 40px; height: 40px; color: #b3261e; }
.vault-pdf em { font-style: normal; font-weight: 800; font-size: 12px; color: #b3261e; }
.vault-none .ic { width: 28px; height: 28px; }
.vault-none small { font-size: 12px; }
.vault-body { display: grid; gap: 3px; padding: 12px 14px 6px; }
.vault-kind { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.vault-body strong { font-size: 15px; }
.vault-holder { font-size: 13px; color: var(--fg-2); }
.vault-num { justify-self: start; border: 0; background: none; padding: 0; font: 600 13px ui-monospace, Menlo, Consolas, monospace; color: var(--fg-2); cursor: pointer; letter-spacing: .04em; }
.vault-exp { justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--fg-2); }
.vault-exp.ok { background: var(--ok-soft); color: var(--ok); }
.vault-exp.soon { background: var(--warn-soft); color: var(--warn); }
.vault-exp.late { background: var(--danger-soft); color: var(--danger); }
.vault-actions { display: flex; align-items: center; gap: 4px; margin-top: auto; padding: 6px 8px 8px 10px; }
.vault-actions .btn { margin-inline-end: auto; }
.vault-file { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 400; }
.vault-file > span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-2); }
.vault-file .ic { width: 16px; height: 16px; }
.vault-picked { font-style: normal; font-size: 13px; color: var(--brand-strong); }
.vault-view-file { display: grid; place-items: center; background: var(--surface-2); border-radius: var(--r); overflow: hidden; }
.vault-view-file img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.vault-view-file iframe { width: 100%; height: 70vh; border: 0; background: #fff; }
@media (max-width: 760px) {
  .vault-grid { grid-template-columns: 1fr; gap: 10px; }
  .vault-card { flex-direction: row; flex-wrap: wrap; }
  .vault-thumb { width: 104px; height: auto; min-height: 104px; border-bottom: 0; border-inline-end: 1px solid var(--line); }
  .vault-body { flex: 1; min-width: 0; padding: 10px 12px 4px; }
  .vault-actions { width: 100%; border-top: 1px solid var(--line); }
}
.adv-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.input select { flex: 1; min-width: 0; width: 100%; border: 0; background: none; outline: none; padding: 11px 14px; font-size: 15px; color: var(--fg); }
.input input[type="date"] { min-width: 0; }
.sheet-body { overflow-x: hidden; }

/* =========================================================================
   Conversation en bulles dans le lecteur Mail
   ========================================================================= */
.read-pane.viewing { flex-direction: row; }
.read-pane.viewing > .reader { flex: 1; min-width: 0; }
.read-pane .cv-viewer.mode-dock { border-inline-start: 1px solid var(--line); flex: none; }
.conv-with { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.conv-with strong { color: var(--fg-2); font-weight: 600; }
.files-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; margin: 0 4px; border: 0; border-radius: 99px; background: var(--surface-2); color: var(--fg-2); font: 600 13px var(--font); white-space: nowrap; flex: none; }
.files-btn .ic { width: 16px; height: 16px; }
.files-btn b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--surface); font-size: 11px; display: inline-grid; place-items: center; }
.files-btn:hover { background: var(--brand-soft); color: var(--brand-strong); }

.conv.bubbles { display: flex; flex-direction: column; gap: 4px; grid-template-columns: none; }
.conv.bubbles .cv-day { align-self: center; margin: 14px 0 6px; }
.msg-card.bubble-msg {
  position: relative; align-self: flex-start; max-width: min(78%, 680px); min-width: 140px; padding: 8px 12px 5px;
  border: 0; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 1px 1px rgba(0, 0, 0, .03);
  margin-top: 4px; transition: box-shadow .2s;
}
.msg-card.bubble-msg.in { border-start-start-radius: 4px; }
.msg-card.bubble-msg.out { align-self: flex-end; background: var(--brand-softer); box-shadow: 0 0 0 1px var(--brand-soft); border-start-end-radius: 4px; }
.msg-card.bubble-msg.rich { align-self: stretch; max-width: none; padding: 10px 12px 6px; }
.msg-card.bubble-msg.is-draft { box-shadow: 0 0 0 1px var(--line-strong); background: repeating-linear-gradient(135deg, transparent 0 8px, var(--surface-2) 8px 9px); }
.msg-card.bubble-msg.pending { opacity: .65; }
.msg-card.bubble-msg.focus-msg { box-shadow: 0 0 0 2px var(--brand); }
.msg-card.bubble-msg.flash { animation: cv-flash 1.4s ease-out; }
.bubble-msg .b-who { display: flex; align-items: center; gap: 6px; }
.bubble-msg .b-who:empty { display: none; }
.bubble-msg .b-who { margin-bottom: 4px; }
.bubble-msg .b-name { font-size: 12.5px; font-weight: 700; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble-msg .mail-text { font-size: 14.5px; line-height: 1.5; }
.bubble-msg .mail-frame { width: 100%; border: 0; border-radius: 8px; background: #fff; }
.bubble-msg .banner { margin: 4px 0 8px; }
.bubble-msg .banner.slim { padding: 8px 10px; font-size: 13px; }
.bubble-msg .banner.slim > .ic { width: 18px; height: 18px; }
.bubble-msg .chip-s.draft { margin-bottom: 4px; }
.bubble-msg .voices { margin: 2px 0 6px; }
.bubble-msg .translation { margin-bottom: 6px; }
.b-quote-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 99px; background: none; color: var(--muted); font-size: 12px; }
.b-quote-btn .ic { width: 14px; height: 14px; }
.b-quote-btn:hover { color: var(--fg); border-color: var(--fg-2); }
.b-quote { margin-top: 8px; padding-inline-start: 10px; border-inline-start: 3px solid var(--line-strong); color: var(--muted); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-msg .receipt-card { margin: 8px 0 2px; }
.bubble-msg .receipt-card:empty { display: none; }
.b-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.b-foot time { white-space: nowrap; }
.b-tools { display: inline-flex; margin-inline-end: auto; opacity: 0; transition: opacity .15s; }
.b-tools .icon-btn { width: 28px; height: 28px; color: var(--muted); }
.b-tools .icon-btn .ic { width: 15px; height: 15px; }
.bubble-msg:hover .b-tools, .bubble-msg:focus-within .b-tools { opacity: 1; }
.b-sent .ic { width: 14px; height: 14px; color: var(--brand); vertical-align: -3px; }

/* Réponse rapide */
.quick-reply { flex: none; padding: 8px 14px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.qr-to { display: flex; align-items: center; gap: 6px; padding: 0 2px 6px; font-size: 12.5px; color: var(--muted); }
.qr-to > .ic { width: 14px; height: 14px; flex: none; }
.qr-to span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-to strong { color: var(--fg-2); }
.qr-to .text-btn { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.qr-to .text-btn .ic { width: 14px; height: 14px; }
.reader .reply-row, .reader .reader-dock { display: none !important; }

@media (max-width: 760px) {
  .msg-card.bubble-msg { max-width: 88%; }
  .msg-card.bubble-msg.rich { max-width: none; }
  .b-tools { opacity: 1; }
  .quick-reply { padding: 6px 8px calc(8px + var(--safe-b, 0px)); }
  .quick-reply textarea { font-size: 16px; }
  .reader-scroll { padding-bottom: 16px !important; }
  .read-pane.viewing .quick-reply { visibility: hidden; }
  .files-btn span { display: none; }
}
.b-proof { border: 0; background: none; padding: 0; color: var(--brand-strong); font: 600 11.5px var(--font); cursor: pointer; }
.b-proof:hover { text-decoration: underline; }
@media (min-width: 761px) and (max-width: 1699px) {
  .mail-view:has(.read-pane.viewing) { grid-template-columns: minmax(0, 1fr); }
  .mail-view:has(.read-pane.viewing) .list-pane { display: none; }
}

/* Repères des messageries classiques dans la conversation */
.reader { container-type: inline-size; }
.rd-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--fg-2); font: 500 13.5px var(--font); white-space: nowrap; flex: none; }
.rd-btn .ic { width: 18px; height: 18px; color: var(--brand); }
.rd-btn:hover { background: var(--hover); color: var(--fg); }
.rd-btn.primary { background: var(--brand); color: #fff; font-weight: 600; }
.rd-btn.primary .ic { color: #fff; }
.rd-btn.primary:hover { background: var(--brand-strong); color: #fff; }
@container (max-width: 880px) { .rd-btn:not(.primary) span { display: none; } .rd-btn:not(.primary) { width: 38px; padding: 0; justify-content: center; } .ai-btn span, .files-btn span { display: none; } }
@container (max-width: 560px) { .rd-btn.primary span { display: none; } .rd-btn.primary { width: 38px; padding: 0; justify-content: center; } }

.conv-tip { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--brand-softer); border: 1px solid var(--brand-soft); }
.conv-tip > .ic { width: 22px; height: 22px; color: var(--brand-strong); flex: none; margin-top: 2px; }
.conv-tip > div { flex: 1; min-width: 0; }
.conv-tip strong { font-size: 14px; }
.conv-tip p { margin: 3px 0 0; font-size: 13px; color: var(--fg-2); }
.conv-tip .btn { flex: none; align-self: center; }

.bubble-msg .b-who { flex-wrap: wrap; row-gap: 0; }
.bubble-msg .b-name.me { color: var(--brand-strong); }
.bubble-msg .b-addr { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.b-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 2px 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.b-meta[hidden] { display: none; }
.b-meta dt { color: var(--muted); font-weight: 600; }
.b-meta dd { margin: 0; overflow-wrap: anywhere; color: var(--fg-2); }
.b-act { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--fg-2); font: 600 12px var(--font); white-space: nowrap; }
.b-act .ic { width: 14px; height: 14px; color: var(--muted); }
.b-act.icon { width: 26px; padding: 0; justify-content: center; }
.b-act:hover { background: var(--hover); color: var(--fg); }
.b-tools { gap: 0; flex-wrap: wrap; }
.conv.bubbles > .bubble-msg:last-of-type .b-tools { opacity: 1; }

.qr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.qr-modes { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.qr-mode { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); color: var(--fg-2); font: 600 12.5px var(--font); white-space: nowrap; }
.qr-mode .ic { width: 15px; height: 15px; }
.qr-mode:hover { border-color: var(--brand); color: var(--fg); }
.qr-mode.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.qr-head .text-btn { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.qr-head .text-btn .ic { width: 14px; height: 14px; }
.quick-reply .qr-to { display: grid; gap: 3px; padding: 0 2px 8px; }
.qr-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.qr-line b { min-width: 22px; color: var(--fg-2); }
.qr-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--surface-2); color: var(--fg); font-size: 12.5px; }
@media (max-width: 760px) {
  .qr-head .text-btn span { display: none; }
  .qr-mode { height: 32px; }
  .conv-tip { flex-wrap: wrap; }
  .conv-tip > div { flex-basis: calc(100% - 34px); }
  .conv-tip .btn { margin-inline-start: 34px; }
  /* Les bandeaux passent au-dessus de la zone de réponse, jamais dessus */
  body:has(#read-pane .quick-reply) .toast-zone { bottom: calc(92px + var(--safe-b, 0px)); }
  body:has(#read-pane .quick-reply.open) .toast-zone { bottom: calc(200px + var(--safe-b, 0px)); }
}
/* Annulation d'un envoi, directement dans la bulle */
.b-undo { border: 0; background: none; padding: 2px 6px; margin-inline-end: auto; border-radius: 6px; color: var(--brand-strong); font: inherit; font-weight: 700; cursor: pointer; }
.b-undo:hover { background: var(--brand-softer); }
.b-undo:disabled { opacity: .5; cursor: default; }
.msg-card.bubble-msg.pending:has(.b-undo) { opacity: .85; }
.b-foot { flex-wrap: wrap; }
.b-tools { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.b-proof { white-space: nowrap; }
.qr-to .qr-line, .qr-to .qr-chip { flex: none; }
.qr-mode .l-short { display: none; }
@media (max-width: 760px) {
  .b-act:not(.icon) span { display: none; }
  .b-act:not(.icon) { width: 30px; padding: 0; justify-content: center; }
  .b-act[data-read="reply-one"] span { display: inline; }
  .b-act[data-read="reply-one"] { width: auto; padding: 0 8px; }
  .qr-modes { flex-wrap: nowrap; }
  .qr-mode { padding: 0 10px; }
  .qr-mode .l-long { display: none; }
  .qr-mode .l-short { display: inline; }
}

/* Audit : un seul jeu d'actions sur ordinateur (le ruban), pas d'icône « Applications » en doublon du rail */
@media (min-width: 761px) {
  .topbar .launcher { display: none; }
  .topbar .brand { margin-inline-start: 12px; }
  .reader-actions [data-read="reply"], .reader-actions [data-read="replyall"], .reader-actions [data-read="forward"],
  .reader-actions [data-read="archive"], .reader-actions [data-read="inbox"], .reader-actions [data-read="delete"],
  .reader-actions [data-read="unread"], .reader-actions [data-read="spam"], .reader-actions [data-read="notspam"],
  .reader-actions .bar-sep:nth-of-type(-n+2) { display: none; }
}

/* Conversation : fond discret (motif de l'accueil en gris), teinte pastel par correspondant */
.reader { position: relative; isolation: isolate; }
.reader::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url(/img/nappe.jpg) 0 0 / 460px auto repeat; filter: grayscale(1) brightness(1.04); opacity: .42;
}
:root[data-theme="dark"] .reader::before { opacity: .06; filter: grayscale(1) invert(1); }
.reader-bar, .quick-reply { position: relative; z-index: 1; background: var(--surface); }
.read-pane { background: var(--bg); }
.msg-card.bubble-msg.in { background: var(--tint, var(--surface)); box-shadow: 0 0 0 1px var(--tint-line, var(--line)), 0 1px 2px rgba(0, 0, 0, .04); }
.msg-card.bubble-msg.in .b-name { color: var(--tint-ink, var(--fg)); }
.msg-card.bubble-msg.rich { background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .04); }
.msg-card.bubble-msg.system { background: #fdf8e6; box-shadow: 0 0 0 1px #efe2b0; }
.msg-card.bubble-msg.out { background: #e7f4ee; box-shadow: 0 0 0 1px #cfe7db; }
:root[data-theme="dark"] .msg-card.bubble-msg.in { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
:root[data-theme="dark"] .msg-card.bubble-msg.out { background: #173328; box-shadow: 0 0 0 1px #24493a; }
.conv.bubbles .cv-day span { background: rgba(255, 255, 255, .9); backdrop-filter: blur(4px); }
.b-proof { padding: 1px 7px; border-radius: 99px; background: #d9f0e4; }
.bubble-msg .chip-s.draft { background: #fdecea; }
/* Mouvements discrets : le dernier message et celui qui part apparaissent en douceur */
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.conv.bubbles > .bubble-msg:last-of-type, .bubble-msg.pending { animation: bubble-in .24s ease-out both; }
.bubble-msg.pending { animation-duration: .18s; }
.msg-card.bubble-msg { transition: box-shadow .2s, transform .2s; }
.qr-mode, .b-act, .rd-btn, .files-btn { transition: background .15s, border-color .15s, color .15s; }
@media (prefers-reduced-motion: reduce) {
  .conv.bubbles > .bubble-msg:last-of-type, .bubble-msg.pending, .msg-card.bubble-msg.flash { animation: none; }
}
@media (max-width: 760px) {
  .reader-actions [data-read="reply"], .reader-actions [data-read="replyall"], .reader-actions [data-read="forward"] { display: none; }
  .reader-actions .rd-btn { width: 40px; height: 40px; padding: 0; justify-content: center; background: none; }
  .reader-actions .rd-btn .ic { width: 22px; height: 22px; color: inherit; }
  .reader-actions .rd-btn span { display: none; }
}

/* Relecture avant envoi */
.rl { display: grid; gap: 16px; }
.rl-intro { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; }
.rl-intro .ic { width: 16px; height: 16px; color: var(--ok); flex: none; margin-top: 2px; }
.rl-sec header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rl-sec h3 { margin: 0; font-size: 14.5px; }
.rl-sec h3 span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 99px; background: var(--surface-3); font-size: 11.5px; }
.rl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.rl-list label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.rl-list input { grid-row: span 2; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.rl-fix { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.rl-fix .ic { width: 14px; height: 14px; color: var(--muted); }
.rl-fix del { color: var(--danger); text-decoration: line-through; background: var(--danger-soft); padding: 0 4px; border-radius: 4px; }
.rl-fix ins { color: var(--ok); text-decoration: none; background: var(--ok-soft); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.rl-list small { font-size: 12.5px; color: var(--muted); }
.rl-t { display: inline-block; margin-inline-end: 6px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.rl-t.t-orthographe { background: #fdecea; color: #b3261e; }
.rl-t.t-grammaire { background: #efe8fb; color: #6a3fb0; }
.rl-t.t-typographie { background: #e5edfb; color: #2a5bb0; }
.rl-t.t-style { background: #fdf3e1; color: #8a5a0a; }
.rl-ok { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ok); font-weight: 600; font-size: 14px; }
.rl-ok .ic { width: 16px; height: 16px; }
.rl-tone { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface-2); }
.rl-tone button { border: 0; background: none; padding: 4px 12px; border-radius: 99px; font: 600 12.5px var(--font); color: var(--fg-2); }
.rl-tone button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.rl-parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.rl-parts li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line-strong); font-size: 13.5px; }
.rl-parts li.ok { border-style: solid; border-color: var(--ok-soft); background: color-mix(in srgb, var(--ok-soft) 50%, transparent); }
.rl-parts li > .ic { width: 15px; height: 15px; flex: none; color: var(--muted); }
.rl-parts li.ok > .ic { color: var(--ok); }
.rl-parts li > span { flex: 1; min-width: 0; font-weight: 600; }
.rl-parts small { color: var(--muted); font-size: 12px; }
.rl-add { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--brand-strong); font-weight: 600; cursor: pointer; }
.rl-add input { accent-color: var(--brand); }
.rl-preview { margin: 0; max-height: 240px; overflow: auto; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font: 14px/1.55 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .c-tools { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; scrollbar-width: none; }
  .c-tools .icon-btn { flex: none; }
  .rl-parts { grid-template-columns: 1fr; }
}

/* Messages confidentiels */
.conf-opts { display: grid; gap: 10px; margin: 2px 0 6px 52px; }
.conf-opts[hidden] { display: none; }
.conf-chip { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; padding: 6px 10px; border-radius: 10px; background: #efe8fb; color: #4b2f86; font-size: 12.5px; }
.conf-chip .ic { width: 15px; height: 15px; flex: none; }
.conf-chip span { flex: 1; min-width: 0; }
.conf-chip.off { background: var(--surface-3); color: var(--muted); }
@media (max-width: 760px) { .conf-opts { margin-inline-start: 0; } }

/* Rendez-vous */
.rdv-slots { display: grid; gap: 8px; }
.rdv-slot { display: grid; grid-template-columns: 24px minmax(0, 1.3fr) minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.rdv-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 700; }
.rdv-gap { width: 32px; }
.rdv-days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-weight: 400; }
.rdv-days label { position: relative; }
.rdv-days input { position: absolute; opacity: 0; }
.rdv-days span { display: inline-grid; place-items: center; min-width: 46px; height: 34px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; color: var(--fg-2); cursor: pointer; }
.rdv-days input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.rdv-days input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.input .pre { padding: 0 0 0 14px; font-style: normal; color: var(--muted); white-space: nowrap; }
.rdv-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Gros fichiers */
.tr-up { display: flex; gap: 12px; align-items: flex-start; }
.tr-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-softer); color: var(--brand-strong); flex: none; }
.tr-ic .ic { width: 20px; height: 20px; }
.tr-up > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.tr-up strong { overflow-wrap: anywhere; }
.tr-up small { color: var(--muted); }
.tr-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .2s; }
.tr-state.err { color: var(--danger); font-weight: 600; }
.tr-usage { display: grid; gap: 6px; margin: 8px 0 14px; }
.tr-usage small { color: var(--muted); font-size: 12.5px; }
.tr-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.tr-plan { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.tr-plan.on { border-color: var(--brand); background: var(--brand-softer); }
.tr-plan ul { margin: 6px 0 4px; padding-inline-start: 18px; font-size: 13px; color: var(--fg-2); }
.tr-list { list-style: none; margin: 6px 0 0; padding: 0; }
.tr-list li { display: flex; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.tr-list li:first-child { border-top: 0; }
.tr-list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tr-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-plan { border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 4px 6px; font-size: 12.5px; color: var(--fg); }
.adm-log { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.adm-log li { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.adm-log li:first-child { border-top: 0; }

/* Barre du message : l'essentiel visible, le reste dans « Insérer » */
.c-tools .in-menu { display: none; }
.c-tools .voice-btn.on, .c-tools .voice-btn.recording { display: inline-grid; }

/* Nouveaux expéditeurs dans la boîte de réception */
.sb-cards { margin: 8px 12px 6px; padding: 10px; border-radius: var(--r-lg); background: var(--brand-softer); border: 1px solid var(--brand-soft); display: grid; gap: 8px; }
.sb-title { display: flex; align-items: flex-start; gap: 8px; margin: 0 2px; font-size: 13px; color: var(--fg-2); }
.sb-title .ic { width: 16px; height: 16px; color: var(--brand-strong); flex: none; margin-top: 1px; }
.sb-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); }
.sb-main { flex: 1; min-width: 0; display: grid; }
.sb-main strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-main span { font-size: 13px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-main small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-acts { display: flex; gap: 6px; flex: none; }
.sb-more { display: inline-flex; align-items: center; gap: 4px; justify-self: start; margin: 0 4px; font-size: 13px; font-weight: 600; color: var(--brand-strong); text-decoration: none; }
.sb-more .ic { width: 14px; height: 14px; }
@media (max-width: 480px) {
  .sb-acts .btn span { display: none; }
  .sb-acts .btn { width: 36px; padding: 0; justify-content: center; }
}
/* Le bouton « Nouveau message » flottant ne recouvre jamais la réponse ni l'envoi */
.mail-view.reading .fab, body:has(.composer) .fab { display: none !important; }
/* Téléphone à l'horizontale et petites hauteurs : l'essentiel de l'écran pour la conversation */
@media (max-height: 520px) and (min-width: 761px) {
  .ribbon { display: none !important; }
  .shell { grid-template-rows: 44px 0 minmax(0, 1fr) !important; }
  .topbar { height: 44px; }
  .quick-reply .qr-to { display: none; }
  .quick-reply { padding-top: 4px; padding-bottom: 6px; }
  .qr-head { margin-bottom: 2px; }
  .reader-bar { height: 44px; }
  .reader-scroll { padding-top: 8px; }
  .conv-tip p { display: none; }
}

/* =========================================================================
   Réunions : liste, fiche, appel
   ========================================================================= */
.mt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mt-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; }
.mt-card:hover { border-color: var(--brand); }
.mt-card.live { border-color: #b9a7e6; background: #f6f2fd; }
.mt-date { display: grid; place-items: center; width: 52px; height: 56px; border-radius: 12px; background: #efe8fb; color: #4b2f86; font-size: 12px; text-transform: uppercase; flex: none; line-height: 1.1; }
.mt-date b { font-size: 20px; }
.mt-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.mt-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-main small { color: var(--muted); font-size: 12.5px; }
.mt-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-s.live { background: #efe8fb; color: #4b2f86; }
.chip-s.rs-ok { background: var(--ok-soft); color: var(--ok); }
.chip-s.rs-no { background: var(--danger-soft); color: var(--danger); }
.chip-s.rs-maybe { background: var(--warn-soft); color: var(--warn); }
.mt-pick { display: grid; gap: 4px; margin: 4px 0 6px; max-height: 180px; overflow-y: auto; font-weight: 400; }
.mt-pick label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mt-pick small { color: var(--muted); }
.mt-opts summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand-strong); }
.mt-opts[open] { display: grid; gap: 10px; }
.mt-chk { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--fg-2); margin: 6px 0; }
.mt-chk input { margin-top: 3px; accent-color: var(--brand); }
.md-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; max-width: 1180px; margin: 0 auto; align-items: start; }
.md-main, .md-side { display: grid; gap: 14px; min-width: 0; }
.md-main .set-card + .set-card, .md-side .set-card + .set-card { margin-top: 0; }
.md-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; }
.md-hero > div { flex: 1; min-width: 240px; }
.md-when { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 4px; }
.md-when .ic { width: 18px; height: 18px; color: #6a46a8; }
.md-hero .hint { flex-basis: 100%; margin: 0; }
.md-agenda { margin: 6px 0 0; padding-inline-start: 22px; display: grid; gap: 4px; }
.md-docs, .md-people { list-style: none; margin: 8px 0 0; padding: 0; }
.md-docs li, .md-people li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.md-docs li:first-child, .md-people li:first-child { border-top: 0; }
.md-docs li > span, .md-people li > span:first-child { flex: 1; min-width: 0; display: grid; }
.md-docs strong, .md-people strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.md-docs small, .md-people small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-docs > li > .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
.md-docs select, .md-people select { border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 4px 6px; font-size: 12.5px; color: var(--fg); max-width: 130px; }
.md-recip { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; font-size: 13.5px; }
.md-recip label { display: inline-flex; align-items: center; gap: 6px; }
.md-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ho-link code { display: block; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; overflow-wrap: anywhere; }
#md-memory h4 { margin: 10px 0 4px; font-size: 13.5px; }
#md-memory ul { margin: 0; padding-inline-start: 18px; font-size: 13.5px; }
@media (max-width: 960px) { .md-grid { grid-template-columns: 1fr; } }

/* ---------- Avant l'entrée ---------- */
.call-prejoin { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(12, 24, 20, .55); }
.pj-card { width: min(860px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); display: grid; color: var(--fg); }
.pj-card header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.pj-card h2 { flex: 1; margin: 0; font-size: 18px; }
.pj-x, .cb-ic { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.pj-x:hover, .cb-ic:hover { background: rgba(127, 127, 127, .16); }
.pj-x .ic, .cb-ic .ic { width: 20px; height: 20px; }
.pj-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; padding: 10px 18px; }
.pj-preview { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #1d2a25; }
.pj-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pj-nocam { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 8px; color: #cfe0d8; }
.pj-nocam .ic { width: 36px; height: 36px; }
.nocam .pj-nocam { display: grid; }
.nocam .pj-preview video { visibility: hidden; }
.pj-meter { position: absolute; inset-inline: 12px; bottom: 12px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.pj-meter i { display: block; height: 100%; width: 0; background: #7ee2b4; transition: width .08s; }
.pj-side { display: grid; gap: 10px; align-content: start; font-size: 13.5px; }
.pj-side label { display: grid; gap: 4px; font-weight: 600; color: var(--fg-2); }
.pj-side select { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: 400 14px var(--font); background: var(--surface); color: var(--fg); min-width: 0; }
.pj-side .pj-chk { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.pj-toggles { display: flex; gap: 8px; }
.pj-tg { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font: 600 14px var(--font); color: var(--fg); cursor: pointer; }
.pj-tg[aria-pressed="false"] { background: #fdecea; border-color: #f2c4bf; color: #b3261e; }
.pj-tg .ic { width: 18px; height: 18px; }
.pj-test { justify-self: start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--brand-strong); font: 600 13.5px var(--font); cursor: pointer; padding: 4px 0; }
.pj-test .ic { width: 16px; height: 16px; }
.pj-hint { margin: 0; color: var(--muted); font-size: 12.5px; }
.pj-err { margin: 0 18px; color: #b3261e; font-size: 13px; }
.pj-err:empty { display: none; }
.pj-card footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; }
.pj-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid transparent; font: 600 14px var(--font); cursor: pointer; text-decoration: none; }
.pj-btn .ic { width: 16px; height: 16px; }
.pj-btn.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.pj-btn.primary { background: #1c5844; color: #fff; }
.pj-btn.primary:hover { background: #164536; }
.pj-btn.ghost { background: transparent; border-color: currentColor; color: inherit; }
@media (max-width: 760px) { .pj-body { grid-template-columns: 1fr; } .pj-card footer .pj-btn { flex: 1; } }

/* ---------- Appel ---------- */
body.in-call:not(.call-min) { overflow: hidden; }
.call { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: #111a17; color: #eef4f1; font-family: var(--font); }
.call.minimized { inset: auto; width: 0; height: 0; background: none; }
.call.minimized > :not(.call-mini):not(audio) { display: none; }
.call-top { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t, 0px)) 12px 8px 16px; }
.ct-title { flex: 1; min-width: 0; display: grid; }
.ct-title strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-sub { font-size: 12px; color: #a9bdb4; font-variant-numeric: tabular-nums; }
.ct-state { font-size: 12.5px; color: #ffd38a; font-weight: 600; }
.ct-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); font-size: 12px; font-weight: 600; }
.badge .ic { width: 14px; height: 14px; }
.badge.share { background: #e9dcff; color: #3d2470; }
.ct-acts { display: flex; gap: 2px; }
.call-main { display: flex; min-height: 0; gap: 8px; padding: 0 8px; }
.call-stage { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.call-grid { flex: 1; min-height: 0; display: grid; gap: 8px; align-content: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.call-grid:has(> .tile:only-child) { grid-template-columns: minmax(0, 1fr); }
.call-grid.speaker { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-template-rows: minmax(0, 1fr) 110px; align-content: stretch; }
.call-grid.speaker .tile.main { grid-column: 1 / -1; grid-row: 1; }
.call-grid.speaker .tile:not(.main) { grid-row: 2; }
.call-grid.speaker:has(> .tile:only-child) { grid-template-rows: minmax(0, 1fr); }
.tile { position: relative; min-height: 0; aspect-ratio: 16 / 9; max-height: 100%; border-radius: 14px; overflow: hidden; background: var(--tint, #263530); box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .15s; }
.call-grid.speaker .tile { aspect-ratio: auto; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.tile.video-on video { display: block; }
.tile.local video { transform: scaleX(-1); }
.tile.screen video { object-fit: contain; background: #000; transform: none; }
.tile.speaking { box-shadow: inset 0 0 0 3px #7ee2b4; }
.tile.pinned::after { content: ""; position: absolute; top: 12px; inset-inline-start: 12px; width: 10px; height: 10px; border-radius: 50%; background: #e9dcff; }
.t-av { position: absolute; inset: 0; display: grid; place-items: center; }
.tile.video-on .t-av { display: none; }
.t-av b { display: grid; place-items: center; width: clamp(48px, 28%, 96px); aspect-ratio: 1; border-radius: 50%; background: rgba(0, 0, 0, .18); color: #1c2a25; font-size: clamp(16px, 4vw, 30px); }
.t-name { position: absolute; inset-inline-start: 8px; bottom: 8px; max-width: calc(100% - 16px); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 99px; background: rgba(10, 18, 15, .7); color: #fff; font-size: 12.5px; }
.t-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-mic .ic, .t-hand .ic, .t-q .ic { width: 15px; height: 15px; }
.t-mic.off { color: #ff9b91; }
.t-hand, .t-q { color: #ffd38a; }
.t-pin { position: absolute; top: 8px; inset-inline-end: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(10, 18, 15, .6); color: #fff; opacity: 0; cursor: pointer; transition: opacity .15s; }
.t-pin .ic { width: 16px; height: 16px; }
.tile:hover .t-pin, .tile:focus-within .t-pin, .tile.pinned .t-pin { opacity: 1; }
.call-pager { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; }
.call-pager:empty { display: none; }
.call-pager .cb-ic { font-size: 22px; }
.call-pager .cb-ic:disabled { opacity: .3; }
.call.with-doc .call-grid { flex: none; height: 120px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-template-rows: 1fr; overflow: hidden; }
.call.with-doc .call-grid .tile { aspect-ratio: auto; }
.call-doc { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 8px; border-radius: 14px; overflow: hidden; background: #fff; color: var(--fg); }
.call-doc[hidden] { display: none; }
.call-doc header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.call-doc header > span { flex: 1; min-width: 0; display: grid; }
.call-doc header > span .ic { display: none; }
.call-doc header small { color: var(--muted); font-size: 12px; }
.call-doc .pj-btn.ghost { color: var(--fg-2); }
.dk-ro { color: var(--muted); font-size: 12px; }
.dv-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface-2); }
.dv-body > iframe { flex: 1; }
/* Présentation synchronisée : la page garde ses proportions, la barre d'outils reste sous la page */
.dv-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.dv-page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .12), 0 6px 18px rgba(16, 24, 40, .08); }
.dv-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dv-ink.drawing { cursor: crosshair; touch-action: none; }
.dv-ink.pointing { cursor: none; }
.dv-load { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; color: var(--muted); font-size: 14px; }
.dv-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.dv-tools .cb-ic { color: var(--fg-2); width: 36px; height: 36px; border-radius: 10px; }
.dv-tools .cb-ic:hover:not(:disabled) { background: var(--surface-2); }
.dv-tools .cb-ic.on { background: var(--brand-soft); color: var(--brand-strong); }
.dv-tools .cb-ic:disabled { opacity: .35; }
.dv-nav, .dv-draw { display: inline-flex; align-items: center; gap: 4px; }
.dv-num { min-width: 92px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.dv-colors { display: inline-flex; gap: 4px; margin: 0 4px; }
.dv-color { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.dv-color.on { box-shadow: 0 0 0 2px var(--brand); }
.dv-inkall { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-2); white-space: nowrap; }
.dv-inkall input { accent-color: var(--brand); }
.call-doc header { flex-wrap: wrap; }
.ct-badges button.badge { border: 0; cursor: pointer; font: inherit; }
.dv-body iframe { width: 100%; height: 100%; border: 0; }
.dv-pointer { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: rgba(214, 64, 52, .85); box-shadow: 0 0 0 6px rgba(214, 64, 52, .25); pointer-events: none; transition: left .06s linear, top .06s linear; }
.call-float-react { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fr { position: absolute; bottom: 10px; display: grid; justify-items: center; animation: fr-up 3s ease-out forwards; }
.fr b { font-size: 34px; }
.fr small { font-size: 11px; background: rgba(10, 18, 15, .7); padding: 1px 6px; border-radius: 99px; }
@keyframes fr-up { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-60vh); opacity: 0; } }
.call-panel { width: 360px; flex: none; display: flex; flex-direction: column; min-height: 0; border-radius: 14px; background: var(--surface); color: var(--fg); overflow: hidden; }
.call-panel[hidden] { display: none; }
.call-panel header { display: flex; align-items: center; padding: 10px 8px 6px 16px; }
.call-panel h3 { flex: 1; margin: 0; font-size: 15px; }
.call-panel h4 { margin: 12px 16px 6px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pn-note { margin: 0 16px 8px; font-size: 12.5px; color: var(--muted); }
.pp-host { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 6px; color: var(--fg-2); }
.pp-list, .chat-list, .dk-list, .dc-list, .ag-list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; }
.pp-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.pp-list li:hover { background: var(--hover); }
.pp-av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 700; flex: none; color: #1c2a25; }
.pp-n { flex: 1; min-width: 0; font-size: 13.5px; }
.pp-n small { color: var(--muted); }
.pp-n .hand { color: #8a5a0a; display: inline-flex; align-items: center; gap: 2px; }
.pp-n .hand .ic { width: 13px; height: 13px; }
.pp-st .ic { width: 16px; height: 16px; color: var(--muted); }
.pp-list .pj-btn.ghost { color: var(--fg-2); }
.pp-all { justify-content: flex-end; }
.chat-list { flex: 1; display: grid; align-content: start; gap: 6px; padding: 4px 12px; }
.chat-list li { position: relative; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.chat-list li.mine { background: var(--brand-softer); }
.chat-list li.empty { background: none; color: var(--muted); }
.chat-list b { font-size: 12.5px; }
.chat-list time { margin-inline-start: 6px; font-size: 11px; color: var(--muted); }
.chat-list p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-task { position: absolute; top: 4px; inset-inline-end: 4px; display: none; align-items: center; gap: 2px; border: 0; background: var(--surface); border-radius: 6px; padding: 2px 6px; font-size: 11px; color: var(--brand-strong); cursor: pointer; }
.chat-task .ic { width: 12px; height: 12px; }
.chat-list li:hover .chat-task, .chat-list li:focus-within .chat-task { display: inline-flex; }
.chat-form { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); margin-top: auto; }
.chat-form input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 99px; padding: 8px 14px; font: 14px var(--font); background: var(--surface); color: var(--fg); }
.nt-tabs { display: flex; gap: 4px; margin: 0 16px 6px; padding: 3px; border-radius: 99px; background: var(--surface-2); }
.nt-tabs button { flex: 1; border: 0; background: none; padding: 6px; border-radius: 99px; font: 600 12.5px var(--font); color: var(--fg-2); cursor: pointer; }
.nt-tabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.nt-text { flex: 1; margin: 0 12px; min-height: 200px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; font: 14px/1.5 var(--font); resize: none; background: var(--surface); color: var(--fg); }
.nt-save { margin: 6px 16px 12px; font-size: 12px; color: var(--muted); }
.ag-list { padding: 0 16px 0 34px; list-style: decimal; display: grid; gap: 6px; font-size: 14px; }
.dc-list { display: grid; gap: 8px; padding: 0 12px 12px; }
.dc { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13.5px; }
.dc.empty { border: 0; color: var(--muted); }
.dc p { margin: 4px 0; }
.dc-st { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--fg-2); }
.dc.s-proposee .dc-st { background: #fdf3e1; color: #8a5a0a; }
.dc.s-confirmee .dc-st { background: var(--ok-soft); color: var(--ok); }
.dc.s-rejetee .dc-st { background: var(--danger-soft); color: var(--danger); }
.dc-votes { color: var(--muted); font-size: 12.5px; }
.dc-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dc-acts .pj-btn.ghost { color: var(--fg-2); }
.dc-acts [aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.dc details { margin-top: 6px; font-size: 12px; color: var(--muted); }
.dc details ul { margin: 4px 0 0; padding-inline-start: 16px; }
.dk-list { display: grid; gap: 6px; padding: 0 12px; }
.dk-list li { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.dk-list li.empty { background: none; color: var(--muted); }
.dk-list li > span { flex: 1; min-width: 0; display: grid; font-size: 13px; }
.dk-list li > span .ic { display: none; }
.dk-list small { color: var(--muted); font-size: 11.5px; }
.dk-list .pj-btn.ghost { color: var(--fg-2); }
.cu-body { padding: 0 16px 16px; font-size: 13.5px; overflow-y: auto; }
.cu-body ul { padding-inline-start: 16px; }
.cu-body small { display: block; color: var(--muted); font-size: 12px; }
.call-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 0 12px 6px; padding: 8px 12px; border-radius: 12px; background: #fdf3e1; color: #4a3304; font-size: 13.5px; }
.call-banner[hidden] { display: none; }
.call-banner .pj-btn.ghost { color: #4a3304; }
.call-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 12px calc(10px + var(--safe-b, 0px)); flex-wrap: wrap; position: relative; }
.cb-group { display: flex; gap: 6px; }
.cb { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 72px; padding: 8px 10px 6px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #eef4f1; font: 600 11.5px var(--font); cursor: pointer; transition: background .15s; }
.cb:hover { background: rgba(255, 255, 255, .16); }
.cb .ic { width: 22px; height: 22px; }
.cb.off { background: #f3d7d3; color: #7a1d14; }
.cb.on, .cb.active { background: #e9dcff; color: #3d2470; }
.cb.leave { background: #c62f24; color: #fff; min-width: 84px; }
.cb.leave:hover { background: #a8261d; }
.cb-badge { position: absolute; top: 4px; inset-inline-end: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ffd38a; color: #4a3304; font-size: 11px; display: grid; place-items: center; }
.cb-badge[hidden] { display: none; }
.cb:focus-visible, .cb-ic:focus-visible, .pj-btn:focus-visible, .tile button:focus-visible { outline: 2px solid #7ee2b4; outline-offset: 2px; }
.react-pop, .more-pop { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; border-radius: 16px; background: var(--surface); color: var(--fg); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); z-index: 2; }
.react-pop button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; font-size: 24px; cursor: pointer; }
.react-pop button:hover { background: var(--hover); }
.more-pop { display: grid; min-width: 260px; }
.more-pop button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; font: 500 14px var(--font); color: var(--fg); text-align: start; cursor: pointer; }
.more-pop button:hover { background: var(--hover); }
.more-pop .ic { width: 18px; height: 18px; color: var(--muted); }
.call-dialog { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.call-dialog > div { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px; border-radius: 16px; background: var(--surface); color: var(--fg); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.call-dialog h3 { margin: 0 0 8px; }
.call-dialog p { margin: 0 0 10px; color: var(--fg-2); font-size: 14px; }
.call-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.call-dialog .pj-btn.ghost { color: var(--fg-2); }
.pm-list { display: grid; gap: 4px; margin-bottom: 8px; }
.pm-list button { text-align: start; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--surface-2); font: 500 14px var(--font); color: var(--fg); cursor: pointer; }
.pm-list button:hover { background: var(--surface-3); }
.pm-list button.danger { color: var(--danger); }
.tk-form { display: grid; gap: 10px; }
.tk-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.tk-form label.cd-extra { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; color: var(--fg); }
.cd-extra small { display: block; color: var(--muted); font-size: 12px; }
.tk-form input, .tk-form select { border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 10px; font: 400 14px var(--font); background: var(--surface); color: var(--fg); }
.call.reconnecting .call-stage { opacity: .6; }

/* Mini-fenêtre : la réunion continue pendant que l'on consulte BigoMail ou une autre application */
.call-mini { position: fixed; z-index: 85; right: 16px; bottom: calc(96px + var(--safe-b, 0px)); width: 260px; border-radius: 16px; overflow: hidden; background: #111a17; color: #eef4f1; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); touch-action: none; cursor: grab; }
.call-mini[hidden] { display: none; }
.cm-video { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; background: #263530; }
.cm-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.cm-video.video-on video { display: block; }
.cm-av { font-size: 26px; font-weight: 700; }
.cm-bar { display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; }
.cm-title { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-bar .cb-ic { width: 36px; height: 36px; }
.cm-bar .cb-ic.off, .cm-bar .cb-ic.danger { color: #ff9b91; }
.pip-body { margin: 0; background: #111a17; }
.pip-body .call-mini { position: static; width: 100%; border-radius: 0; box-shadow: none; }
@media (max-width: 760px) {
  .call-main { padding: 0 4px; }
  .call-panel { position: fixed; inset-inline: 0; bottom: 0; top: 30%; width: auto; z-index: 3; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .4); padding-bottom: var(--safe-b, 0px); }
  .call-bar { gap: 6px; padding-inline: 6px; }
  .cb-group { gap: 4px; }
  .cb { min-width: 0; width: 58px; padding: 8px 4px 6px; font-size: 10.5px; }
  .cb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .cb[data-c="react"], .cb[data-c="hand"] { display: none; }
  .ct-badges .badge:not(.share) { display: none; }
  .ct-acts [data-c="pip"] { display: none; }
  .call-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
  .call-grid.speaker { grid-template-rows: minmax(0, 1fr) 90px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .call-mini { width: 168px; right: 10px; }
  .call-mini .cm-title { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fr { animation: none; display: none; } .tile, .cb { transition: none; } }

/* Page des invités */
.guest-meeting { min-height: 100dvh; display: grid; place-items: center; padding: 16px; margin: 0; background: #eef3f0 url(/img/nappe.jpg) 0 0 / 460px auto repeat; }
.gm-card { width: min(460px, 100%); padding: 28px 24px; border-radius: 20px; background: var(--surface); box-shadow: 0 20px 60px -20px rgba(20, 50, 40, .35); text-align: center; display: grid; gap: 8px; justify-items: center; }
.gm-card h1 { margin: 6px 0 0; font-size: 22px; }
.gm-when { margin: 0; color: var(--muted); font-size: 13.5px; }
#gm-body { width: 100%; }
#gm-form { display: grid; gap: 10px; text-align: start; margin-top: 10px; }
#gm-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
#gm-form input { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font: 16px var(--font); }
.gm-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.gm-err { color: var(--danger); font-weight: 600; }
.gm-wait { display: grid; justify-items: center; gap: 4px; margin-top: 10px; }
.gm-wait p { margin: 0; }
.gm-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); animation: gm-pulse 1.4s ease-in-out infinite; }
@keyframes gm-pulse { 50% { transform: scale(1.6); opacity: .4; } }
.gm-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99; padding: 10px 16px; border-radius: 12px; background: #1d2a25; color: #fff; font-size: 14px; }

/* Mosaïque : les vignettes remplissent l'espace (colonnes et lignes calculées) */
.call-grid:not(.speaker) { align-content: stretch; }
.call-grid:not(.speaker) .tile { aspect-ratio: auto; }
@media (max-width: 760px) {
  .cb[data-c="share"] { display: none; }
  .call-bar { flex-wrap: nowrap; }
  .cb.leave { min-width: 0; width: 58px; }
}

/* Lecture à voix haute : barre de contrôle persistante au-dessus de la barre d'onglets */
.tts-bar { position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; width: min(440px, calc(100vw - 32px)); padding: 8px 8px 8px 14px; border-radius: 14px; background: #1e2a26; color: #f1f6f4; box-shadow: var(--shadow-2); }
.tts-bar[hidden] { display: none; }
.tts-bar .tts-ic { display: grid; place-items: center; width: 28px; height: 28px; color: #9fd8c2; }
.tts-bar .tts-txt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.tts-bar strong { font-size: 14px; font-weight: 600; }
.tts-bar .tts-pos { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tts-bar .btn { color: inherit; border-color: rgba(255,255,255,.25); background: transparent; }
.tts-bar .btn:not(.ghost) { background: #f1f6f4; color: #1e2a26; border-color: transparent; }
.b-act.on { color: var(--brand-strong); background: var(--brand-softer); }
@media (max-width: 760px) { .tts-bar { bottom: calc(72px + env(safe-area-inset-bottom)); } .tts-bar .btn span { display: none; } }

/* ---------- Regroupement par contact et sujets ---------- */
.group-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.group-toggle .ic { width: 16px; height: 16px; }
.group-toggle.on { background: var(--brand-softer); border-color: var(--brand-soft); color: var(--brand-strong); }
.m-row2-end { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .m-row2 .group-toggle { height: 42px; padding: 0 14px; color: #fff; font-size: 15px; font-weight: 500; background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .18); }
  .m-row2 .group-toggle.on { background: rgba(255, 255, 255, .92); color: var(--brand-strong); }
  .m-row2 .group-toggle span { display: none; }
  .m-row2 .group-toggle .ic { width: 20px; height: 20px; }
  .list-tools .group-toggle { display: none; }
}
.group-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-softer); color: var(--brand-strong); }
.group-av .ic { width: 20px; height: 20px; }
.row .subj-n { color: var(--brand-strong); font-weight: 600; }
.row-count.unread-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-size: 11.5px; }

/* Objet affiché sur chaque bulle */
.bubble-msg .b-subj { display: flex; align-items: center; gap: 5px; max-width: 100%; margin: 0 0 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--tint-ink, var(--muted)); text-align: start; cursor: default; }
.bubble-msg.out .b-subj { color: var(--muted); }
.bubble-msg .b-subj .ic { width: 13px; height: 13px; flex: none; opacity: .7; }
.bubble-msg .b-subj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader.merged .bubble-msg .b-subj { cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 2px; }
.reader.merged .bubble-msg .b-subj:hover { text-decoration-color: currentColor; }

/* Barre des sujets avec les mêmes personnes */
.subj-strip { margin: 0 0 14px; display: grid; gap: 6px; }
.subj-strip .ss-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.subj-strip .ss-head span { display: inline-flex; align-items: center; gap: 6px; }
.subj-strip .ss-head .ic { width: 15px; height: 15px; }
.subj-strip .ss-wider { margin-top: 4px; }
.ss-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ss-chips::-webkit-scrollbar { display: none; }
.ss-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg-2); font: inherit; font-size: 13px; cursor: pointer; }
.ss-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-chip small { color: var(--faint); font-size: 11.5px; }
.ss-chip em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ss-chip.unread span { font-weight: 700; color: var(--fg); }
.ss-chip.on { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-strong); }
.ss-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.merged-note { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .merged-note { display: none; } }

/* ---------- Relecture : onglets, cartes de correction, structure ---------- */
.rl2 { display: grid; gap: 12px; }
.rl2-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.rl2-lang { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--brand-softer); color: var(--brand-strong); font-weight: 600; }
.rl2-lang.s-orthographe { background: #fdf3e1; color: #8a5a0a; }
.rl2-lang.s-non { background: var(--surface-3); color: var(--muted); }
.rl2-priv { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: auto; color: var(--muted); }
.rl2-priv .ic { width: 14px; height: 14px; color: var(--ok); }
.rl2-notice { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 10px; font-size: 13px; background: var(--surface-2); color: var(--fg-2); }
.rl2-notice .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.rl2-notice.n-warn { background: #fdf3e1; color: #6b4708; }
.rl2-notice.n-error { background: var(--danger-soft); color: var(--danger); }
.rl2-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 12px; background: var(--surface-2); }
.rl2-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 0; border-radius: 9px; background: none; font: 600 13.5px var(--font); color: var(--fg-2); cursor: pointer; }
.rl2-tabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.rl2-tabs b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-3); font-size: 11px; display: inline-grid; place-items: center; }
.rl2-tabs button[aria-selected="true"] b { background: var(--brand); color: #fff; }
.rl2-pane { min-height: 120px; }
.rl2-bulk { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.rl2-bulk span { flex: 1; }
.rl2-hint, .rl2-empty { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.rl2-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: min(46vh, 420px); overflow-y: auto; }
.rl2-card { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.rl2-card.accepted { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.rl2-card.ignored { opacity: .62; }
.rl2-ctx { margin: 0; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.rl2-ctx del { color: var(--danger); background: var(--danger-soft); text-decoration: line-through; padding: 0 3px; border-radius: 4px; }
.rl2-ctx ins { color: var(--ok); background: var(--ok-soft); text-decoration: none; font-weight: 600; padding: 0 3px; border-radius: 4px; margin-inline-start: 2px; }
.rl2-card.ignored .rl2-ctx ins { display: none; }
.rl2-card.ignored .rl2-ctx del { text-decoration: none; background: none; color: inherit; }
.rl2-why { margin: 0; font-size: 12.5px; color: var(--muted); }
.rl-t.t-accord, .rl-t.t-conjugaison { background: #efe8fb; color: #6a3fb0; }
.rl-t.t-ponctuation { background: #e5edfb; color: #2a5bb0; }
.rl-t.t-verifier { background: var(--surface-3); color: var(--fg-2); }
.rl2-alts { display: flex; flex-wrap: wrap; gap: 6px; }
.rl2-alt { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font: 13px var(--font); color: var(--fg); cursor: pointer; }
.rl2-alt.on { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-strong); font-weight: 600; }
.rl2-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.rl2-state { margin-inline-end: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rl2-state.ok { color: var(--ok); }
.rl2-state .ic { width: 14px; height: 14px; }
.rl2-struct { display: grid; gap: 10px; }
.rl2-switch { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.rl2-switch input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.rl2-switch span { display: grid; gap: 2px; }
.rl2-switch small { color: var(--muted); font-size: 12.5px; }
.rl2-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 40vh; overflow-y: auto; }
.rl2-parts li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; }
.rl2-plabel { font-size: 11.5px; font-weight: 700; color: var(--brand-strong); text-transform: uppercase; letter-spacing: .02em; padding-top: 3px; }
.rl2-parts p { margin: 0; font-size: 14px; line-height: 1.5; padding-inline-start: 10px; border-inline-start: 2px solid var(--brand-soft); }
.rl2-opt { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.rl2-opt h4 { width: 100%; margin: 0; font-size: 13.5px; }
.rl2-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.rl2-check input { accent-color: var(--brand); width: 16px; height: 16px; }
.rl2-preview summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.rl2-preview pre { margin: 8px 0 0; max-height: 200px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font: 13.5px/1.5 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .rl2-parts li { grid-template-columns: 1fr; gap: 2px; }
  .rl2-priv { margin-inline-start: 0; width: 100%; }
  .rl2-list { max-height: none; }
}

/* ---------- Grandes réunions : recherche, filtres, file des demandes de parole, liste virtualisée ---------- */
.pp-search { display: flex; align-items: center; gap: 8px; margin: 2px 12px 8px; padding: 0 10px; height: 36px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.pp-search .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pp-search input { flex: 1; min-width: 0; border: 0; background: none; font: 14px var(--font); color: var(--fg); outline: none; }
.pp-filters { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
.pp-filters button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font: 600 12.5px var(--font); color: var(--fg-2); cursor: pointer; }
.pp-filters button b { font-size: 11px; color: var(--muted); }
.pp-filters button[aria-selected="true"] { background: var(--brand-softer); border-color: var(--brand-soft); color: var(--brand-strong); }
.pp-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg-2); }
.pp-mode select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: 12.5px var(--font); color: var(--fg); padding: 0 6px; }
.pp-queue li { background: color-mix(in srgb, #fdf3e1 60%, transparent); margin-bottom: 4px; }
.pp-queue .pp-n small { display: block; }
.pp-scroll { flex: 1; min-height: 120px; overflow-y: auto; padding: 0 0 8px; contain: strict; }
.pp-spacer { position: relative; }
.pp-virtual { position: absolute; inset-inline: 0; top: 0; overflow: visible; will-change: transform; }
.pp-virtual li { height: 52px; box-sizing: border-box; }
.pp-list li.speaking .pp-av { box-shadow: 0 0 0 2px var(--brand); }
.pp-st.on .ic { color: var(--brand-strong); }
.pp-st.warn .ic { color: #b3261e; }
.pp-shown { text-transform: none; letter-spacing: 0; font-weight: 500; }
.call-panel h4 .pp-shown { color: var(--muted); }
.hl-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 4px 16px 16px; font-size: 13.5px; }
.hl-list dt { color: var(--muted); }
.hl-list dd { margin: 0; font-weight: 600; text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- Discussion unique par personne : sujets comme les pièces jointes ---------- */
.files-btn.subj-btn.on { background: var(--brand-softer); color: var(--brand-strong); }
.subj-filter { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--brand-softer); color: var(--fg-2); font-size: 13px; }
.subj-filter .ic { width: 15px; height: 15px; color: var(--brand-strong); flex: none; }
.subj-filter span { flex: 1; min-width: 0; }
.subj-list { display: grid; gap: 6px; }
.subj-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; color: var(--fg); text-align: start; cursor: pointer; }
.subj-row:hover { background: var(--hover); }
.subj-row.on { border-color: var(--brand); background: var(--brand-softer); }
.subj-row .subj-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--brand-strong); flex: none; }
.subj-row .subj-ic .ic { width: 17px; height: 17px; }
.subj-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.subj-main strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subj-row.unread .subj-main strong { font-weight: 800; }
.subj-main small { color: var(--muted); font-size: 12.5px; }
.subj-h { display: flex; align-items: center; gap: 6px; margin: 10px 2px 2px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.subj-h .ic { width: 14px; height: 14px; }
.qr-subj { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 2px 6px; font-size: 13px; }
.qr-subj label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; min-width: 0; }
.qr-subj select { max-width: min(420px, 70vw); height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: 13px var(--font); color: var(--fg); padding: 0 6px; }
.qr-subj input { flex: 1; min-width: 180px; height: 30px; border-radius: 8px; border: 1px solid var(--line); padding: 0 8px; font: 13px var(--font); background: var(--surface); color: var(--fg); }

/* Téléphone : défilement de l'agenda, bas de page dégagé de la barre d'onglets, champs sur une colonne */
@media (max-width: 760px) {
  .stage > .agenda-view { height: 100%; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(110px + var(--safe-b, 0px)); }
  .agenda-view .day-panel { overflow: visible; max-height: none; }
  .meeting-detail .page-scroll { padding-bottom: calc(110px + var(--safe-b, 0px)); }
  .adv-dates { grid-template-columns: minmax(0, 1fr); }
  .field-label .input, .field-label .input input, .field-label .input select, .field-label .input textarea { min-width: 0; max-width: 100%; }
}

/* Échec d'une réunion : explication, réessayer, détails techniques */
.call-fail { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: rgba(10, 18, 15, .55); }
.cf-card { width: min(440px, 100%); padding: 20px; border-radius: 16px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-2); display: grid; gap: 10px; }
.cf-card h3 { margin: 0; font-size: 18px; }
.cf-card p { margin: 0; font-size: 14.5px; line-height: 1.5; }
.cf-hint { color: var(--muted); }
.cf-card details summary { cursor: pointer; font-size: 13px; color: var(--fg-2); }
.cf-card pre { margin: 8px 0 0; max-height: 160px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-card footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Fiche réunion : titre dans la carte principale, cartes compactes, états vides sur une ligne */
.meeting-detail .md-crumb { font-weight: 600; color: var(--muted); }
.md-hero { display: grid; gap: 8px; }
.md-hero .md-title { margin: 0; font: 700 22px/1.25 var(--brand-font, inherit); letter-spacing: -.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.md-hero .md-when { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 0; }
.md-hero .md-when .ic { width: 20px; height: 20px; color: #7a4fb5; flex: none; margin-top: 2px; }
.md-hero .md-when > span { display: grid; gap: 1px; }
.md-hero .md-when strong { font-size: 15.5px; }
.md-hero .md-when span span { color: var(--muted); font-size: 13.5px; }
.md-hero .md-by { margin: 0; color: var(--muted); font-size: 13.5px; }
.md-hero .md-live { color: var(--brand-strong); }
.md-hero .md-desc { margin: 0; }
.md-hero .md-join { justify-self: start; margin-top: 6px; }
.md-compact { padding-block: 14px; }
.md-compact h3 { font-size: 15px; }
.md-empty { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; list-style: none; }
.md-note { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; }
.md-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 99px; background: var(--surface-3); font-size: 12px; }
.md-menu { display: grid; gap: 6px; }
.md-menu-item { display: grid; gap: 2px; text-align: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: 600 15px var(--font); color: var(--fg); cursor: pointer; }
.md-menu-item small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.md-menu-item.danger { color: var(--danger); }
@media (max-width: 760px) {
  .md-hero .md-join { justify-self: stretch; justify-content: center; height: 48px; font-size: 16px; }
  .md-hero .md-title { font-size: 20px; }
}

/* ---------- Conversation aérée ---------- */
/* Barre de lecture : peu d'actions visibles, le reste dans « ⋮ » */
.reader-bar .reader-actions { gap: 4px; }
.reader-head h1 { margin-bottom: 2px; }
.conv-with { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.conv.bubbles { gap: 14px; }
.bubble-msg .b-who { margin-bottom: 2px; }
.bubble-msg .b-subj { margin-bottom: 4px; }
/* Pied de bulle : actions discrètes, visibles au survol sur ordinateur */
.bubble-msg .b-foot { gap: 4px; margin-top: 4px; }
.bubble-msg .b-act.icon { width: 30px; height: 30px; color: var(--muted); }
@media (hover: hover) and (min-width: 761px) {
  .bubble-msg .b-tools { opacity: 0; transition: opacity .15s ease; }
  .bubble-msg:hover .b-tools, .bubble-msg:focus-within .b-tools { opacity: 1; }
}
.choice-list.grouped .choice-h { margin: 10px 12px 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.choice-list.grouped .choice-h:first-child { margin-top: 0; }
/* Réponse rapide repliée sur une ligne ; dépliée quand on écrit */
/* Repliée : le choix du type de réponse, du sujet et des destinataires attend qu'on écrive ;
   les outils (pièce jointe, insertion, correcteur) restent toujours visibles */
.quick-reply:not(.open) .qr-head, .quick-reply:not(.open) .qr-subj, .quick-reply:not(.open) .qr-to { display: none; }
.quick-reply:not(.open) { padding-block: 8px; }
.quick-reply.open .qr-head { margin-bottom: 6px; }

/* Réunion : réglages, participant, partage, fin pour tous */
.call .tile.mirror video { transform: scaleX(-1); }
.cd-extra { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; font-size: 13.5px; }
.cd-extra input { margin-top: 2px; accent-color: var(--brand); }
.tk-proc { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 4px 0 0; }
.tk-proc legend { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.pm-vol { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: 13.5px; }
.pm-vol span { grid-column: 2; }
.pm-vol input { grid-column: 1 / -1; width: 100%; accent-color: var(--brand); }
.pm-vol output { grid-column: 3; grid-row: 1; font-variant-numeric: tabular-nums; color: var(--muted); }
.pm-vol .ic { width: 18px; height: 18px; }
.pm-list .pm-h { margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cd-stack { flex-wrap: wrap; }
.pj-btn.danger { background: #c62828; color: #fff; border-color: transparent; }
.chat-mode { margin: 0 16px 8px; }
.chat-closed { margin: 8px 16px 14px; }
/* Sondages, quiz et questions-réponses (panneaux de la réunion) */
.pl-new { padding: 0 12px 8px; }
.pl-list, .qa-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 10px; align-content: start; overflow-y: auto; flex: 1; }
.pl-list .empty, .qa-list .empty { color: var(--muted); font-size: 13px; padding: 8px 4px; }
.pl { padding: 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13.5px; }
.pl.closed { background: var(--surface-2); }
.pl h4 { margin: 2px 0 10px; font-size: 14.5px; text-transform: none; letter-spacing: 0; color: var(--fg); }
.pl-tags { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.pl-vote { display: grid; gap: 6px; }
.pl-choice { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line-strong); cursor: pointer; }
.pl-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-softer); }
.pl-choice input { accent-color: var(--brand); margin: 0; }
.pl-vote .pj-btn { justify-self: start; margin-top: 4px; }
.pl-res { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl-res li { position: relative; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.pl-bar { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--brand-soft); transition: width .3s ease; }
.pl-res li.good .pl-bar { background: var(--ok-soft); }
.pl-o, .pl-res b { position: relative; }
.pl-o { flex: 1; min-width: 0; }
.pl-o small { color: var(--brand-strong); font-weight: 600; margin-inline-start: 4px; }
.pl-res li.good .pl-o small:last-child { color: var(--ok); }
.pl-res b { font-variant-numeric: tabular-nums; font-size: 13px; }
.pl-meta { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.pl-meta .text-btn { padding: 2px 4px; font-size: 12px; }
.pl-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pl-acts .pj-btn.ghost, .qa-acts .pj-btn.ghost { color: var(--fg-2); }
.pl details { margin-top: 8px; font-size: 12px; color: var(--muted); }
.pl details ul { margin: 4px 0 0; padding-inline-start: 16px; }
.pl-form { display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.pl-f { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.pl-form input[name=t], .pl-opts input[name=o] { height: 36px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font: 14px var(--font); color: var(--fg); padding: 0 10px; width: 100%; box-sizing: border-box; }
.pl-kind { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.pl-kind label, .pl-checks label, .qa-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pl-kind input, .pl-checks input, .qa-row input, .pl-good input { accent-color: var(--brand); margin: 0; }
.pl-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl-opts li { display: flex; align-items: center; gap: 8px; }
.pl-good { display: none; align-items: center; gap: 4px; font-size: 12px; color: var(--fg-2); white-space: nowrap; }
.pl-form:has(input[value=quiz]:checked) .pl-good { display: inline-flex; }
.pl-form:has(input[value=quiz]:checked) .pl-multi { display: none; }
.pl-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.pl-form .text-btn { justify-self: start; padding: 2px 4px; font-size: 13px; }
.qa-form { display: grid; gap: 6px; margin: 0 12px 10px; }
.qa-form textarea, .qa-answer textarea { width: 100%; box-sizing: border-box; resize: vertical; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font: 14px var(--font); color: var(--fg); padding: 8px 10px; }
.qa-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.qa { display: flex; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); font-size: 13.5px; }
.qa.s-attente { border-style: dashed; }
.qa.s-repondue { background: var(--surface-2); }
.qa.s-rejetee { opacity: .6; }
.qa-up { flex: none; align-self: start; display: grid; justify-items: center; align-content: center; width: 40px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-2); cursor: pointer; padding: 2px 0; }
.qa-up .ic { width: 16px; height: 16px; }
.qa-up b { font-size: 13px; font-variant-numeric: tabular-nums; }
.qa-up.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.qa-up:disabled { cursor: default; opacity: .6; }
.qa-b { flex: 1; min-width: 0; }
.qa-b > p { margin: 0 0 2px; overflow-wrap: anywhere; }
.qa-b > small { color: var(--muted); font-size: 12px; }
.qa-ans { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--ok-soft); font-size: 13px; }
.qa-ans b { display: block; font-size: 11.5px; color: var(--ok); }
.qa-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.qa-answer { display: grid; gap: 6px; margin-top: 8px; }
.qa-answer .pj-btn { justify-self: start; }
.call-panel > .pp-mode { margin: 0 16px 8px; }
/* Agenda : vues, agendas masquables, grille horaire, échéances, planning */
.cal-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cal-main > .month { flex: 1; }
.cal-body.no-panel { grid-template-columns: minmax(0, 1fr); }
.cal-body.no-panel .day-panel { display: none; }
.cal-body.no-panel .cal-main > .month { border-inline-end: 0; }
.cal-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); margin-inline-end: 8px; }
.cal-seg button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font: 600 13px var(--font); color: var(--fg-2); cursor: pointer; }
.cal-seg button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.cal-views-m { display: none; }
.cal-list { list-style: none; margin: 0; padding: 2px 8px 8px; display: grid; gap: 1px; }
.cal-list li { display: flex; align-items: center; border-radius: 8px; }
.cal-list li:hover { background: var(--hover); }
.cal-tog { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; background: none; font: 13.5px var(--font); color: var(--fg); text-align: start; cursor: pointer; }
.cal-tog i { flex: none; width: 14px; height: 14px; border-radius: 4px; background: var(--cc); border: 2px solid var(--cc); box-sizing: border-box; }
.cal-tog i.dl { --cc: var(--fg-2); background: repeating-linear-gradient(45deg, var(--fg-2) 0 2px, transparent 2px 4px); }
.cal-list li.off .cal-tog i { background: transparent; }
.cal-list li.off .cal-tog span { color: var(--muted); text-decoration: line-through; }
.cal-tog span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ren { opacity: 0; }
.cal-list li:hover .cal-ren, .cal-ren:focus-visible { opacity: 1; }
.m-dl { display: flex; gap: 4px; align-items: center; height: 20px; padding: 0 6px; border: 1px dashed var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--fg-2); font: 600 11px var(--font); text-align: start; overflow: hidden; white-space: nowrap; cursor: pointer; }
.m-dl .ic { width: 12px; height: 12px; flex: none; }
.m-dl span { overflow: hidden; text-overflow: ellipsis; }
.m-dots i.dl { background: var(--fg-2); }
.dl-row { background: var(--surface) !important; border: 1px dashed var(--line-strong) !important; border-inline-start-width: 1px !important; }
.dl-row .dl-time { color: var(--fg-2); }
.dl-row .dl-time .ic { width: 18px; height: 18px; }
.ev-detail .ev-swatch { flex: none; width: 14px; height: 14px; margin: 3px 4px 0 3px; border-radius: 4px; background: var(--ec); }
.ev-repeat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cal-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cal-pick legend { font-weight: 600; font-size: 13px; color: var(--fg-2); margin-bottom: 8px; }
.cal-pick label { cursor: pointer; position: relative; }
.cal-pick input { position: absolute; opacity: 0; }
.cal-pick span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 13px; }
.cal-pick i { width: 12px; height: 12px; border-radius: 50%; }
.cal-pick input:checked + span { border-color: var(--fg); background: var(--surface-2); font-weight: 600; }
.cal-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.tgrid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tg-head, .tg-allrow { display: grid; grid-template-columns: 56px repeat(var(--n), minmax(0, 1fr)); flex: none; border-bottom: 1px solid var(--line); }
.tg-day { display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; border: 0; background: none; cursor: pointer; color: var(--fg-2); font: 11px var(--font); text-transform: uppercase; letter-spacing: .04em; }
.tg-day b { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 15px; font-size: 17px; color: var(--fg); letter-spacing: 0; }
.tg-day.today b { background: var(--brand); color: var(--brand-ink); }
.tg-lab { align-self: center; font-size: 11px; color: var(--muted); text-align: end; padding-inline-end: 8px; }
.tg-all { min-width: 0; display: grid; gap: 2px; align-content: start; padding: 4px 3px; border-inline-start: 1px solid var(--line); min-height: 30px; }
.tg-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.tg-head, .tg-allrow { overflow-y: hidden; scrollbar-gutter: stable; }
.tg-body { position: relative; display: grid; grid-template-columns: 56px repeat(var(--n), minmax(0, 1fr)); background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px); }
.tg-hours { position: relative; }
.tg-h { position: absolute; inset-inline-end: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tg-col { position: relative; border-inline-start: 1px solid var(--line); cursor: copy; }
.tg-col.today { background: var(--brand-softer); }
.tg-ev { position: absolute; display: grid; align-content: start; gap: 1px; padding: 3px 6px; border: 0; border-inline-start: 3px solid var(--ec); border-radius: 6px; background: color-mix(in srgb, var(--ec) 18%, var(--surface)); color: var(--fg); text-align: start; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 1px var(--surface); }
.tg-ev b { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-ev small { font-size: 11px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-now { position: absolute; inset-inline: 0; height: 2px; background: var(--danger); pointer-events: none; }
.tg-now::before { content: ''; position: absolute; inset-inline-start: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.planning { flex: 1; overflow-y: auto; padding: 8px 16px 24px; max-width: 760px; }
.pl-day h3 { margin: 18px 4px 8px; font-size: 14px; color: var(--fg-2); }
.pl-day h3.today { color: var(--brand-strong); }
.planning .day-list { padding: 0; }
@media (max-width: 760px) {
  .cal-views-m { display: flex; }
  .cal-main { display: block; }
  .tgrid { display: block; }
  .tg-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
  .tg-scroll { overflow: visible; }
  .tg-head, .tg-allrow, .tg-body { grid-template-columns: 46px repeat(var(--n), minmax(0, 1fr)); }
  .tg-head, .tg-allrow, .tg-scroll { scrollbar-gutter: auto; }
  .tg-lab { font-size: 10px; padding-inline-end: 4px; }
  .tgrid { padding-bottom: calc(110px + var(--safe-b, 0px)); }
  .planning { padding: 4px 12px calc(110px + var(--safe-b, 0px)); }
  .ev-repeat { grid-template-columns: 1fr; }
}
/* Journal de fiabilité (administration) */
.adm-rel { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.adm-rel li { padding: 10px 0 10px 12px; border-top: 1px solid var(--line); border-inline-start: 3px solid var(--warn, #c99a12); }
.adm-rel li.serveur { border-inline-start-color: var(--danger); }
.adm-rel li:first-child { border-top: 0; }
.adm-rel li > div { display: grid; gap: 3px; min-width: 0; }
.adm-rel strong { overflow-wrap: anywhere; }
.adm-rel pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; max-height: 220px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: 8px; }

/* Discussion de réunion : destinataire, mentions, fichiers, messages privés */
.chat-list li.priv { background: color-mix(in srgb, var(--surface-2) 70%, #f5c56b 30%); }
.chat-list li.mentioned { box-shadow: inset 3px 0 0 var(--brand); }
.chat-priv { margin-inline-start: 6px; font-size: 11px; font-style: normal; font-weight: 600; color: var(--fg); opacity: .75; }
.chat-at { background: var(--brand-softer); color: var(--brand-strong); border-radius: 4px; padding: 0 2px; }
.chat-file { display: grid; gap: 4px; margin-top: 6px; color: inherit; text-decoration: none; }
.chat-file img { max-width: 100%; max-height: 160px; border-radius: 8px; object-fit: cover; }
.chat-file span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.chat-file small { font-weight: 400; color: var(--muted); }
.chat-file .ic { width: 15px; height: 15px; flex: none; }
.chat-rich { position: relative; display: grid; gap: 6px; }
.chat-to { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.chat-to select { flex: 1; min-width: 0; font: inherit; color: var(--fg); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.chat-row { display: flex; align-items: center; gap: 6px; }
.chat-row input[name=t] { flex: 1; min-width: 0; }
.chat-mention { position: absolute; bottom: 100%; inset-inline: 0; margin-bottom: 4px; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / .14); overflow: hidden; z-index: 3; }
.chat-mention button { text-align: start; border: 0; background: none; padding: 8px 12px; font: inherit; font-size: 13.5px; color: var(--fg); cursor: pointer; }
.chat-mention button:hover, .chat-mention button:focus-visible { background: var(--surface-2); }

/* Agenda : vue année, fériés, statuts, glisser-déposer, options d'événement, abonnements */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ev-form .ev-when { grid-template-columns: 1.4fr 1fr; }
.ev-form .ev-when .field-label:first-child { grid-column: auto; }
.ev-form .ev-when .field-label.t { align-self: end; }
.ev-form .ev-repeat { grid-template-columns: 1.3fr .9fr 1.1fr; }
.ev-every { display: flex; align-items: center; gap: 6px; }
.ev-every input { flex: 0 0 3.5em; width: 3.5em; min-width: 0; }
.ev-every small { color: var(--muted); white-space: nowrap; }
.ev-days, .ev-rem { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ev-days legend, .ev-rem legend { font-weight: 600; font-size: 13px; color: var(--fg-2); margin-bottom: 8px; }
.ev-days label, .ev-rem label { position: relative; cursor: pointer; }
.ev-days input, .ev-rem input { position: absolute; opacity: 0; }
.ev-days span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; }
.ev-rem span { display: inline-flex; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 12.5px; }
.ev-days input:checked + span, .ev-rem input:checked + span { background: var(--brand-softer); border-color: var(--brand); color: var(--brand-strong); }
.ev-days input:focus-visible + span, .ev-rem input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ev-adv { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 12px; }
.ev-adv summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--fg-2); }
.ev-adv[open] summary { margin-bottom: 4px; }
.ev-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ev-tools a.btn { text-decoration: none; }
.ev-hist ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.ev-hist time { color: var(--muted); font-size: 12px; }
.ev-detail a { color: var(--brand-strong); overflow-wrap: anywhere; }

.m-hol { display: block; height: 18px; padding: 0 6px; border-radius: 5px; background: color-mix(in srgb, #c2463e 10%, var(--surface)); color: #9d3a33; font: 600 11px/18px var(--font); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.m-cell.hol .m-num { color: #c2463e; font-weight: 700; }
/* Téléphone : cases étroites, le mois abrégé (« 1 janv. ») passerait sur deux lignes, sous le point du jour */
@media (max-width: 760px) { .m-num .m-mon { display: none; } }
.m-dots i.hol { background: #c2463e; }
.pl-hol, .day-hol { color: #9d3a33; font-size: 12.5px; font-weight: 600; }
.day-hol { margin: 0 0 8px; }
.cal-tog i.bd { --cc: #c99a12; background: radial-gradient(circle, #c99a12 35%, transparent 38%); }
.cal-tog i.hol { --cc: #c2463e; background: linear-gradient(#c2463e 0 0) center / 100% 3px no-repeat; }
.cal-err { color: #c2463e; font-weight: 600; }
.cal-none { padding: 4px 12px; font-size: 12.5px; color: var(--muted); }
.cal-more { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: 0; background: none; color: var(--brand-strong); font: 600 13px var(--font); cursor: pointer; border-radius: 8px; }
.cal-more:hover { background: var(--surface-2); }
.cal-more .ic { width: 16px; height: 16px; }
.cal-tools { display: grid; gap: 18px; }
.cal-tools h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; }
.cal-tools h4 .ic { width: 17px; height: 17px; }
.cal-tools .form + .form { border-top: 1px solid var(--line); padding-top: 16px; }
.cal-tools .btn { justify-self: start; }
.feed-url { display: flex; gap: 8px; }
.feed-url input { flex: 1; min-width: 0; font: 12.5px var(--mono, ui-monospace, monospace); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--fg); }
.sub-url { overflow-wrap: anywhere; }

/* Statuts : provisoire hachuré, disponible estompé, absent rayé ; lecture seule sans poignée */
.m-ev.st-provisoire, .tg-ev.st-provisoire { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ec) 16%, var(--surface)) 0 6px, var(--surface) 6px 10px); border-inline-start-style: dashed; }
.m-ev.st-libre, .tg-ev.st-libre { background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ec) 40%, transparent); }
.m-ev.st-absent, .tg-ev.st-absent { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--ec) 22%, var(--surface)) 0 4px, color-mix(in srgb, var(--ec) 10%, var(--surface)) 4px 8px); }
.m-ev .ic, .tg-ev b .ic { width: 11px; height: 11px; flex: none; vertical-align: -1px; margin-inline-end: 2px; }
.day-list button.st-provisoire .dl-main strong::after { content: ' · provisoire'; font-weight: 400; color: var(--muted); }
.tg-rs { position: absolute; inset-inline: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.tg-ev.dragging, .m-ev.dragging { z-index: 5; opacity: .88; box-shadow: 0 8px 24px rgb(0 0 0 / .18); cursor: grabbing; transition: none; }
.m-cell.drop { background: var(--brand-softer); }
@media (hover: hover) { .tg-ev:not(.ro), .m-ev[data-ev]:not(.ro) { cursor: grab; } }

/* Vue année */
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 26px; padding: 18px 20px 40px; overflow-y: auto; }
.yr-t { border: 0; background: none; padding: 0 0 6px; font: 700 15px var(--font); color: var(--fg); cursor: pointer; }
.yr-t:hover { color: var(--brand-strong); }
.yr-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.yr-g i { font-style: normal; font-size: 10.5px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.yr-d { position: relative; aspect-ratio: 1; border: 0; background: none; border-radius: 50%; font: 12px var(--font); color: var(--fg); cursor: pointer; }
.yr-d:hover { background: var(--surface-2); }
.yr-d.has::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--brand); }
.yr-d.hol { color: #c2463e; font-weight: 700; }
.yr-d.today { background: var(--brand); color: #fff; font-weight: 700; }
.yr-d.today::after { background: #fff; }
@media (max-width: 760px) {
  .year { grid-template-columns: 1fr 1fr; gap: 16px 14px; padding: 12px 14px 90px; }
  .yr-d { font-size: 11px; }
  .ev-form .ev-repeat { grid-template-columns: 1fr; }
  .feed-url { flex-direction: column; }
}

/* Réglages › Rendez-vous : types, disponibilités, demandes, statistiques */
.bk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.bk-head h3 { margin: 0; }
.bk-types, .bk-list, .bk-links ul, .av-ex, .bk-qs, .bk-st-types { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bk-types li, .bk-list li, .bk-links li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.bk-types li:last-child, .bk-list li:last-child, .bk-links li:last-child { border-bottom: 0; }
.bk-types li > i { flex: none; width: 10px; height: 34px; border-radius: 4px; }
.bk-types li.off { opacity: .55; }
.bk-types li > div, .bk-list li > div, .bk-links li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bk-types small, .bk-list small, .bk-links small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.bk-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.bk-st { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--fg-2); }
.bk-st.st-attente { background: #fbf1d9; color: #8a6510; }
.bk-st.st-confirme, .bk-st.st-venu { background: var(--brand-softer); color: var(--brand-strong); }
.bk-st.st-annule, .bk-st.st-refuse, .bk-st.st-absent { background: #f8e4e2; color: #9d3a33; }
.bk-pending { border-color: #e9cf8f; background: #fffaf0; }
.bk-links, .bk-past { margin-top: 10px; }
.bk-links summary, .bk-past summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--fg-2); padding: 6px 0; }
.av-week { display: grid; gap: 8px; margin: 10px 0 16px; }
.av-day { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.av-on { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.av-on input { accent-color: var(--brand); width: 17px; height: 17px; }
.av-ranges { display: flex; flex-wrap: wrap; gap: 6px; }
.av-r { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.av-r input { border: 0; background: none; font: 14px var(--font); color: var(--fg); width: 6.2em; }
.av-r > span { color: var(--muted); }
.av-day:has(.av-on input:not(:checked)) .av-ranges::before { content: 'Fermé'; color: var(--muted); font-size: 13px; }
.av-exi { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.av-exi input[type=date] { border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 8px; font: 14px var(--font); background: var(--surface); color: var(--fg); }
.av-closed { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
#av-form h4, .bk-menu h4 { margin: 14px 0 2px; font-size: 14px; }
.bk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 8px; }
.bk-stats span { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.bk-stats b { font-size: 22px; color: var(--fg); font-variant-numeric: tabular-nums; }
.bk-st-types li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.bk-q { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bk-q select { border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 8px; font: 13px var(--font); background: var(--surface); color: var(--fg); }
.bk-q textarea { grid-column: 1 / -1; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: 13.5px var(--font); background: var(--surface); color: var(--fg); }
.bk-req { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; }
.bk-menu { display: grid; gap: 10px; }
.bk-menu > .btn { justify-self: start; }
.bk-link, .bk-embed, .bk-danger { border-top: 1px solid var(--line); padding-top: 12px; }
.bk-link .btn { justify-self: start; }
.bk-embed textarea { width: 100%; box-sizing: border-box; font: 12px var(--mono, ui-monospace, monospace); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--fg); resize: vertical; margin: 6px 0; }
.bk-danger { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
  .av-day { grid-template-columns: 1fr auto; }
  .av-day .av-ranges { grid-column: 1 / -1; grid-row: 2; }
  .bk-types li, .bk-list li { flex-wrap: wrap; }
  .bk-list .bk-acts { width: 100%; justify-content: flex-start; }
  .bk-q { grid-template-columns: 1fr auto; }
}

/* =========================================================================
   Agenda et réunions : finitions (typographie, sélecteurs, états, grille)
   ========================================================================= */
select, button, input, textarea { font-family: inherit; }
.input select { font: 400 15px var(--font); color: var(--fg); appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2366756f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.field-label > .opt { font-size: 12px; margin-top: -4px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--brand-strong); font: 600 13px var(--font); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn .ic { width: 15px; height: 15px; }
:where(.agenda-view, .meetings-view, .sheet) :is(button, a, [tabindex]):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sheet input, .sheet textarea, .sheet select { scroll-margin-block: 96px; }
.sheet-body { overscroll-behavior: contain; }

/* Barre d'outils de l'agenda */
.cal-toolbar { gap: 8px; }
.cal-toolbar h2 { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-toolbar [data-nav] { width: 36px; height: 36px; border-radius: 10px; }
.cal-toolbar [data-nav]:hover, .cal-toolbar #cal-search:hover, .cal-toolbar #cal-time:hover { background: var(--hover); }
.cal-seg button { transition: background .15s, color .15s; }
.cal-seg button:hover:not(.on) { color: var(--fg); background: var(--hover); }
@media (max-width: 1240px) {
  #cal-add span { display: none; }
  #cal-add { width: 36px; padding: 0; justify-content: center; }
  .cal-seg button { padding: 5px 9px; }
  .cal-toolbar h2 { font-size: 18px; }
}
@media (max-width: 980px) and (min-width: 761px) {
  .cal-toolbar { flex-wrap: wrap; height: auto; padding: 10px 14px; row-gap: 8px; }
  .cal-toolbar h2 { order: -1; flex: 1 0 100%; margin: 0; }
  .cal-toolbar .tools-spacer { flex: 1; }
}

/* Chargement, erreur, rien de prévu */
.cal-main { position: relative; }
.cal-main.loading::before { content: ''; position: absolute; z-index: 6; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: cal-load 1s linear infinite; }
@keyframes cal-load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.cal-error { display: flex; align-items: center; gap: 10px; margin: 10px 14px; padding: 10px 14px; border-radius: 12px; background: var(--danger-soft, #fbe9e7); color: var(--danger); font-size: 13.5px; }
.cal-error.soft { background: var(--warn-soft); color: var(--warn); }
.cal-error span { flex: 1; }
.cal-error .ic { width: 18px; height: 18px; flex: none; }
.tg-empty { position: absolute; top: 132px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 96px); padding: 8px 14px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-2); color: var(--fg-2); font-size: 13px; pointer-events: none; }
.tg-empty .ic { width: 16px; height: 16px; color: var(--brand); flex: none; }
.month, .tgrid, .planning, .year { animation: cal-in .16s ease-out; }
@keyframes cal-in { from { opacity: .4; } to { opacity: 1; } }

/* Grille horaire : titres lisibles même serrés, événements courts sur une ligne */
.tg-ev { container-type: inline-size; transition: box-shadow .15s; }
.tg-ev:hover { box-shadow: 0 0 0 1px var(--surface), 0 4px 14px rgb(16 40 32 / .16); z-index: 3; }
.tg-ev b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; overflow-wrap: normal; word-break: normal; hyphens: auto; }
.tg-ev.hour b { -webkit-line-clamp: 1; }
.tg-ev.short { display: flex; align-items: baseline; gap: 6px; padding-block: 1px; }
.tg-ev.short b { -webkit-line-clamp: 1; flex: 0 1 auto; min-width: 0; }
.tg-ev.short small { flex: none; }
@container (max-width: 74px) {
  .tg-ev small { display: none; }
  .tg-ev b { font-size: 11px; -webkit-line-clamp: 3; }
}
.tg-ev.ov { background: color-mix(in srgb, var(--ec) 8%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--ec) 55%, transparent); border-inline-start: 3px solid var(--ec); }
.m-ev.ov { background: color-mix(in srgb, var(--ec) 8%, var(--surface)); }
.tg-task { --ec: var(--fg-2); background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); border: 1px dashed var(--line-strong); border-inline-start: 3px solid var(--fg-2); }
.tg-task b .ic { width: 12px; height: 12px; margin-inline-end: 3px; vertical-align: -2px; }
.tg-travel { position: absolute; z-index: 1; border-radius: 6px 6px 0 0; background: repeating-linear-gradient(45deg, rgb(100 116 139 / .14) 0 4px, transparent 4px 8px); pointer-events: none; }
.m-ev.st-concentration, .tg-ev.st-concentration { background: color-mix(in srgb, var(--ec) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ec) 45%, transparent); }
.tg-heavy { display: block; margin-top: 2px; padding: 1px 7px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font: 600 10px var(--font); font-style: normal; text-transform: none; letter-spacing: 0; }
.tg-day.sel:not(.today) b { box-shadow: inset 0 0 0 2px var(--brand); }
.tg-day:hover b { background: var(--hover); }
.tg-day.today:hover b { background: var(--brand); }

/* Mois : week-end distinct, sélection et focus nets */
.month-grid > .m-cell:nth-child(7n), .month-grid > .m-cell:nth-child(7n - 1) { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.month-grid > .m-cell.out { background: var(--surface-2); }
.month-grid > .m-cell.sel { background: var(--brand-softer); box-shadow: inset 0 0 0 2px var(--brand-soft); }
.m-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.m-ev { transition: filter .15s; }
.m-ev:hover { filter: brightness(.97) saturate(1.1); }
.m-more { font-weight: 600; color: var(--fg-2); }

/* Fiche d'un événement */
.ev-detail > p:first-child { color: var(--fg); font-weight: 600; font-size: 15px; }
.ev-att, .ev-res { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.ev-att h4 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; font-size: 14px; }
.ev-att h4 .ic { width: 17px; height: 17px; color: var(--ec, var(--brand)); }
.ev-att h4 small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.ev-att .spinner.sm { width: 18px; height: 18px; }
.att-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 2px; }
.att-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.att-list li:last-child { border-bottom: 0; }
.att-list.compact li { padding: 4px 0; font-size: 13px; }
.att-av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 13px; color: var(--fg-2); }
.att-who { flex: 1; min-width: 0; display: grid; gap: 1px; }
.att-who small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.att-msg { font-style: italic; }
.att-prop { color: var(--fg-2) !important; }
.att-acts { display: flex; gap: 2px; }
.rsvp-chip { flex: none; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--fg-2); }
.rsvp-chip.yes { background: var(--ok-soft, #e3f3ec); color: var(--ok); }
.rsvp-chip.no { background: var(--danger-soft, #fbe9e7); color: var(--danger); }
.rsvp-chip.maybe { background: var(--warn-soft); color: var(--warn); }
.att-add { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.att-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-2); white-space: nowrap; }
.att-opt input { accent-color: var(--brand); }
.rsvp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.rsvp-btn { min-height: 42px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); font: 600 14px var(--font); color: var(--fg); cursor: pointer; transition: background .15s, border-color .15s; }
.rsvp-btn:hover { background: var(--hover); }
.rsvp-btn.yes.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.rsvp-btn.maybe.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.rsvp-btn.no.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.rsvp-prop summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-strong); padding: 4px 0; }
.rsvp-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.rsvp-form .input { flex: 1 1 130px; min-height: 40px; }
.rsvp-form .input.wide { flex-basis: 100%; }
.ev-inv { display: grid; gap: 6px; }

/* Créneau commun */
.ft-out h4 { margin: 18px 0 8px; font-size: 14px; }
.ft-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ft-slot { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); font: 14px var(--font); color: var(--fg); cursor: pointer; transition: border-color .15s, background .15s; }
.ft-slot b { text-transform: capitalize; font-size: 12.5px; color: var(--fg-2); }
.ft-slot small { font-size: 11.5px; color: var(--muted); }
.ft-slot:hover { border-color: var(--brand); background: var(--brand-softer); }
.ft-grid { position: relative; display: grid; gap: 6px; padding-top: 20px; }
.ft-scale { position: absolute; top: 0; left: 130px; right: 0; height: 16px; }
.ft-scale span { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); }
.ft-lane { display: grid; grid-template-columns: 122px 1fr; gap: 8px; align-items: center; }
.ft-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-bar { position: relative; height: 22px; border-radius: 6px; background: var(--brand-softer); overflow: hidden; }
.ft-bar i { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--danger) 55%, var(--surface)); }
.ft-bar em { display: block; padding: 3px 8px; font-size: 11.5px; color: var(--muted); background: var(--surface-2); height: 100%; box-sizing: border-box; }

/* Partage, salles */
.share-list { list-style: none; margin: 0; padding: 0; display: grid; }
.share-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.share-list li > span { flex: 1; min-width: 0; display: grid; }
.share-list small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.share-add { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.cal-sub { color: var(--muted); font-size: 11.5px; font-weight: 400; }

/* Mon temps */
.tm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tm-kpis span { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.tm-kpis b { font-size: 21px; color: var(--fg); font-variant-numeric: tabular-nums; }
.tm-kpis small.up { color: var(--warn); }
.tm-kpis small.down { color: var(--ok); }
.tm h4 { margin: 18px 0 8px; font-size: 14px; }
.tm-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.tm-day { display: grid; justify-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.tm-day b { color: var(--fg); font-size: 12px; font-variant-numeric: tabular-nums; }
.tm-bar { width: 100%; max-width: 36px; height: 110px; display: flex; align-items: flex-end; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.tm-bar i { width: 100%; background: var(--brand); border-radius: 8px 8px 0 0; }
.tm-day.heavy .tm-bar i { background: var(--warn); }
.tm-cals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tm-cals li { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.tm-cals li i { height: 10px; border-radius: 6px; background: #2f8f6f; min-width: 4px; }
.tm-cals .c-jaune { background: #c99a12; }
.tm-cals .c-orange { background: #d8752b; }
.tm-cals .c-bleu { background: #3b6fb5; }
.tm-cals .c-violet { background: #8a4fb0; }
.tm-cals .c-rouge { background: #c2463e; }
.tm-cals b { text-align: end; font-variant-numeric: tabular-nums; }
.tm-tips { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--fg-2); }

/* Réunions : pastilles au lieu des listes déroulantes, interrupteurs, liste par jour */
.chip-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; min-width: 0; }
.chip-pick legend { font-weight: 600; font-size: 13px; color: var(--fg-2); margin-bottom: 8px; padding: 0; }
.chip-pick label { position: relative; cursor: pointer; }
.chip-pick input { position: absolute; opacity: 0; pointer-events: none; }
.chip-pick span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--fg); transition: background .15s, border-color .15s, color .15s; }
.chip-pick label:hover span { background: var(--hover); }
.chip-pick input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.chip-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.mt-chk.sw { flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 14px; padding: 6px 0; margin: 0; color: var(--fg); }
.mt-chk.sw .switch { margin: 0; }
.mt-day { list-style: none; padding: 14px 2px 2px; }
.mt-day:first-child { padding-top: 0; }
.mt-day h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--fg-2); letter-spacing: .01em; }
.mt-card { transition: border-color .15s, box-shadow .15s; }
.mt-card:hover { box-shadow: var(--shadow-1); }
.mt-card .mt-date { display: none; }
.mt-time { flex: none; display: grid; justify-items: center; gap: 1px; min-width: 62px; padding: 8px 6px; border-radius: 12px; background: var(--surface-2); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-time b { font-size: 16px; color: var(--fg); }
.mt-card.soon { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-softer); }
.mt-card.live .mt-time { background: #efe8fb; }
.mt-join { margin-inline-start: auto; flex: none; }

/* Tâches et équipe */
.task-title { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.task-title:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
.task small .ic { width: 12px; height: 12px; vertical-align: -2px; margin-inline-end: 2px; }
.task.prio-3 .task-prio { color: var(--danger); font-weight: 600; }
.task.prio-2 .task-prio { color: var(--warn); }
.task-list.sub { margin: 4px 0 8px; }
.bk-hosts, .bk-routing { margin-top: 8px; }
.bk-route-row { display: grid; grid-template-columns: 140px 1fr; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.bk-route-hosts { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.bk-route-hosts label { display: inline-flex; gap: 5px; align-items: center; }

@media (max-width: 760px) {
  .att-add, .share-add { grid-template-columns: 1fr auto; }
  .att-add .input, .share-add .input:first-child { grid-column: 1 / -1; }
  .ft-lane { grid-template-columns: 88px 1fr; }
  .ft-scale { left: 96px; }
  .tm-cals li { grid-template-columns: 90px 1fr 48px; }
  .bk-route-row { grid-template-columns: 1fr; }
  .tg-empty { top: 96px; }
  .chip-pick span { min-height: 40px; }
  .rsvp-btn { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .month, .tgrid, .planning, .year { animation: none; }
  .cal-main.loading::before { animation: none; }
  .tg-ev, .mt-card, .chip-pick span, .rsvp-btn { transition: none; }
}
.ev-form .ev-repeat { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tm-day b { text-transform: none; }
.ft-form .adv-dates { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* =========================================================================
   Accès au compte : connexion, création, récupération ; Réglages › Sécurité
   ========================================================================= */
.auth-sub { margin: -6px 0 14px; text-align: center; font-size: 14px; color: #3d5049; line-height: 1.45; }
.auth-check { display: flex; align-items: center; gap: 10px; padding: 2px 4px; font-size: 14px; color: #2b3d37; cursor: pointer; }
.auth-check input { width: 18px; height: 18px; accent-color: #22634d; }
.auth-sep { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; font-size: 12.5px; color: #557067; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: rgba(28, 88, 68, .2); }
.neu-btn .ic { width: 17px; height: 17px; margin-inline-end: 8px; vertical-align: -3px; }
.auth-avail { display: flex; align-items: center; gap: 6px; margin: -4px 4px 0; font-size: 13px; font-weight: 600; }
.auth-avail .ic { width: 15px; height: 15px; flex: none; }
.auth-avail.ok { color: #1c6b4e; }
.auth-avail.ko { color: #a33a30; }
.pw-meter { display: grid; gap: 6px; margin: -2px 4px 2px; }
.pw-bar { height: 5px; border-radius: 99px; background: rgba(28, 88, 68, .15); overflow: hidden; }
.pw-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: #c0392f; transition: width .2s, background .2s; }
.pw-meter[data-s="2"] .pw-bar i { background: #c98a12; }
.pw-meter[data-s="3"] .pw-bar i, .pw-meter[data-s="4"] .pw-bar i { background: #1c6b4e; }
.pw-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; color: #5a6b65; }
.pw-rules li { display: flex; align-items: center; gap: 6px; }
.pw-rules li .ic { width: 13px; height: 13px; flex: none; }
.pw-rules li.ok { color: #1c6b4e; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.auth-choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 14px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .62); text-align: start; color: #15231e; font: inherit; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(28, 88, 68, .12); transition: background .15s, box-shadow .15s; }
.auth-choice:hover { background: rgba(255, 255, 255, .85); box-shadow: inset 0 0 0 1.5px rgba(28, 88, 68, .4); }
.auth-choice:focus-visible { outline: 2px solid #22634d; outline-offset: 2px; }
.auth-choice > .ic { width: 24px; height: 24px; flex: none; color: #22634d; }
.auth-choice > .ic:last-child { width: 18px; height: 18px; color: #6f807a; }
.auth-choice span { flex: 1; display: grid; gap: 2px; }
.auth-choice strong { font-size: 14.5px; }
.auth-choice small { font-size: 12.5px; color: #4f625b; line-height: 1.35; }
.auth-number { justify-self: center; display: grid; place-items: center; width: 108px; height: 108px; margin: 6px 0; border-radius: 28px; background: #fff; box-shadow: 0 6px 22px rgba(20, 60, 45, .16); font: 800 52px var(--brand-font, var(--font)); color: #164536; font-variant-numeric: tabular-nums; }
.auth-wait { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; color: #3d5049; }
.auth-wait .ic { width: 16px; height: 16px; animation: spin 2.4s linear infinite; }
.auth-note.center { text-align: center; }
.auth-steps { margin: 0 0 4px; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 13px; color: #34463f; line-height: 1.45; }
.nf.area { height: auto; align-items: stretch; padding: 10px 14px; }
.nf.area textarea { flex: 1; border: 0; outline: none; background: none; resize: vertical; font: 15px var(--font); color: var(--fg); }
.auth-ok { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: #1c5844; font-weight: 600; line-height: 1.45; }
.auth-ok .ic { flex: none; width: 18px; height: 18px; margin-top: 2px; }

.sec-alert { border-color: #e9cf8f; background: #fffaf0; }
.sec-alert h3 { display: flex; align-items: center; gap: 8px; }
.sec-alert h3 .ic { width: 18px; height: 18px; color: var(--warn); }
.sec-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sec-btns.wrap { justify-content: flex-start; margin-top: 14px; }
.sec-score { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--fg-2); }
.sec-score i { width: 34px; height: 8px; border-radius: 99px; background: var(--surface-2); }
.sec-score span { margin-inline-start: 8px; }
.sec-score[data-s="1"] i:nth-child(-n+1) { background: var(--warn); }
.sec-score[data-s="2"] i:nth-child(-n+2) { background: var(--ok); }
.sec-score[data-s="3"] i { background: var(--ok); }
.sec-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.sec-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sec-list li:last-child { border-bottom: 0; }
.sec-list li > .ic { width: 20px; height: 20px; flex: none; color: var(--fg-2); }
.sec-list li > span { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sec-list small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.sec-ev li.ko > .ic, .sec-ev li.ko strong { color: var(--danger); }
.sec-ev li > .ic { width: 16px; height: 16px; color: var(--ok); }
.sec-ask p { margin: 0 0 10px; color: var(--fg-2); line-height: 1.5; }
.sec-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.sec-num { height: 72px; border-radius: 18px; border: 1.5px solid var(--line-strong); background: var(--surface); font: 800 30px var(--font); color: var(--fg); cursor: pointer; transition: background .15s, border-color .15s; }
.sec-num:hover { background: var(--brand-softer); border-color: var(--brand); }
.bk-codes { columns: 2; margin: 10px 0; padding-inline-start: 22px; font: 600 15px var(--mono, ui-monospace, monospace); line-height: 1.9; }
.sec-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--fg-2); font-size: 14px; }
.sec-qr { justify-self: center; width: 200px; height: 200px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.sec-qr svg { width: 100%; height: 100%; display: block; }
.sec-secret { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.sec-secret code { font-size: 14px; color: var(--fg); letter-spacing: .04em; overflow-wrap: anywhere; }
.sec-open { justify-self: center; }
@media (min-width: 761px) { .sec-open { display: none; } }
.adm-acc h4 { margin: 14px 0 4px; font-size: 14px; }
.adm-acc .check-list .ic { width: 15px; height: 15px; }
.chip-s.danger { background: var(--danger-soft, #fbe9e7); color: var(--danger); }
@media (max-width: 760px) {
  .sec-row { flex-wrap: wrap; }
  .sec-btns { width: 100%; justify-content: flex-start; }
  .bk-codes { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { .auth-wait .ic { animation: none; } .pw-bar i { transition: none; } }

/* Le zoom reste permis (accessibilité) : sur écran tactile, les champs font au moins 16 px
   pour que le téléphone ne zoome pas tout seul quand on touche un champ */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select { font-size: max(16px, 1em); }
}

/* Interactions tactiles : pas de sélection de texte ni de menu natif (copier, aperçu) sur ce qui se touche
   comme un bouton ; le contenu des messages reste sélectionnable et copiable volontairement */
.row, .row *, button, .btn, .choice, .chip-s, .tabbar, .topbar, .reader-bar, .rail, .sidebar a, .sheet-head, .qr-head, .b-foot, .rp-chip, .toast {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.mail-body, .mail-text, .mail-body *, .translation, .rl2-ctx, .ai-card .ai-actions strong, input, textarea, [contenteditable] {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}

.sheet-grip { display: none; }
@media (max-width: 760px) { .sheet-grip { display: grid; } }
.b-sig { margin-top: 6px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); font-size: 12.5px; line-height: 1.45; color: var(--muted); white-space: pre-line; }
.b-sig { margin-top: 6px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); font-size: 12.5px; line-height: 1.45; color: var(--muted); white-space: pre-line; }

/* Barre d'onglets (téléphone) : largeur proportionnée à l'écran, jamais collée aux bords ni sous les zones
   de sécurité ; les onglets se partagent la place, les libellés longs ne débordent pas */
@media (max-width: 760px) {
  .tabbar {
    box-sizing: border-box; justify-content: space-between;
    width: min(440px, calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  }
  .tab-item { flex: 1 1 0; min-width: 0; padding-inline: 4px; }
  .tab-item > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Signature manuscrite : cadre de dessin (toujours clair, l'encre est sombre), aperçu sur fond neutre */
.hs-pad { position: relative; height: clamp(170px, 32vh, 240px); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: #fff; touch-action: none; overflow: hidden; }
.hs-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.hs-line { position: absolute; inset-inline: 8%; bottom: 28%; border-bottom: 1.5px solid #d3dcd8; pointer-events: none; }
.hs-hint { position: absolute; inset-inline-start: 8%; bottom: calc(28% + 6px); color: #9aa8a2; font-size: 14px; pointer-events: none; }
.hs-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hs-tools .btn:disabled { opacity: .45; }
.hs-preview { display: flex; align-items: center; justify-content: center; min-height: 72px; margin: 10px 0; padding: 12px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); }
.hs-preview img { max-width: min(260px, 100%); max-height: 110px; height: auto; }
.hs-preview.big img { max-height: 140px; }
.hs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.b-sig-img { display: block; max-width: 200px; max-height: 90px; margin-top: 8px; padding: 4px 8px; border-radius: 8px; background: #fff; }
.hs-chip img { height: 30px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; }
.qr-hs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.qr-hs img { height: 26px; max-width: 80px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; }
.quick-reply:not(.open) .qr-hs { display: none; }

/* Vue année : les colonnes se partagent la largeur (une case ne peut plus élargir sa colonne au-delà de l'écran) */
.year { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.yr-m { min-width: 0; }
.yr-g { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.yr-d { min-width: 0; padding: 0; }
@media (max-width: 760px) { .year { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Écran tactile : zones de toucher d'au moins 40 px (l'apparence ne change pas, seule la surface utile grandit) */
@media (pointer: coarse) {
  .bubble-msg .b-act.icon { width: 40px; height: 40px; }
  .star-btn { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; }
  .rcpt-row .text-btn.sm, .composer [data-c="cc"] { min-height: 40px; padding-inline: 10px; }
  .cal-tog { min-height: 40px; }
  .task-check { min-width: 40px; min-height: 40px; place-items: center; }
  .b-subj { min-height: 32px; }
}

/* Paramètres : grilles qui restent dans la largeur de l'écran, quel que soit leur contenu */
.set-page { grid-template-columns: minmax(0, 1fr); }
/* Applications : grille de tuiles sur tous les écrans (styles de base ; le téléphone garde ses réglages propres) */
.apps-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 18px 8px; padding: 6px 0 12px; }
.app-tile { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 6px 2px; border: 0; border-radius: 14px; background: none; color: var(--fg); font: 500 13.5px var(--font); text-decoration: none; cursor: pointer; }
.app-tile span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; border: 1.5px solid var(--line-strong); color: var(--fg-2); background: var(--surface); }
.app-tile .ic { width: 30px; height: 30px; stroke-width: 1.5; }
.app-tile:hover span { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-softer); }
.app-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.app-tile { min-width: 0; text-align: center; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.app-tile span { width: min(64px, 100%) !important; height: auto !important; aspect-ratio: 1; }
@media (max-width: 374px) { .app-tile { font-size: 12px !important; letter-spacing: -.01em; } }

/* Tiroir (téléphone) : accès aux paramètres en bas, comme dans les messageries usuelles */
.drawer-settings { display: none; }
@media (max-width: 760px) {
  .drawer-settings { display: flex; align-items: center; gap: 14px; margin: 8px 8px calc(12px + var(--safe-b)); padding: 12px 14px; border-radius: 12px; color: var(--fg); text-decoration: none; font-weight: 600; border-top: 1px solid var(--line); }
  .drawer-settings .ic { width: 22px; height: 22px; color: var(--muted); }
  .drawer-settings:active { background: var(--hover); }
}
/* En-tête du téléphone : sur les écrans très étroits, la roue dentée laisse la place au titre (Paramètres
   restent dans le tiroir et dans Applications) */
@media (max-width: 374px) { .m-hero .glass a[href="#/settings"] { display: none; } }
/* Trois icônes dans l'en-tête : le titre (« Réception ») reste entier jusqu'à 375 px */
@media (max-width: 440px) {
  .m-hero h1 { font-size: 29px; }
  .m-hero .glass .icon-btn { width: 40px; height: 40px; }
  .m-hero-top { gap: 10px; }
}

/* Pièce jointe : nom complet sur deux lignes au plus, coupé proprement (jamais tranché au milieu d'une lettre) */
.att-meta { min-width: 0; }
.att-meta strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; white-space: normal; overflow-wrap: anywhere; text-overflow: ellipsis; }
.att-meta small { white-space: nowrap; }

/* Agenda (téléphone) : en-tête toujours visible (titre, vues, recherche) ; ligne des jours sous l'en-tête */
@media (max-width: 760px) {
  .agenda-view > .cal-hero { position: sticky; top: 0; z-index: 7; }
  .agenda-view .tg-head { top: var(--cal-hero-h, 0px); }
}
@media (pointer: coarse) {
  .cal-seg button { min-height: 40px; padding-inline: 12px; }
  .task-title { min-height: 36px; text-align: start; }
  .yr-g { gap: 0; }
}

/* Très petits téléphones (≤ 374 px) : titre et icônes de l'en-tête resserrés, libellés de la barre du bas lisibles */
@media (max-width: 374px) {
  .m-hero h1 { font-size: 26px !important; }
  .m-hero .glass .icon-btn { width: 40px; height: 40px; }
  .m-hero-top { gap: 8px; }
  .tab-item { font-size: 11px !important; }
  .tab-item .ic { width: 24px !important; height: 24px !important; }
}
.att-meta { grid-template-columns: minmax(0, 1fr); }
.att-meta > * { min-width: 0; }
@media (max-width: 374px) { .year { grid-template-columns: minmax(0, 1fr) !important; } }
/* Fichier dans une bulle : nom complet sur deux lignes au plus, coupé proprement ; la taille reste sur sa ligne */
.b-file { min-width: 0; max-width: 100%; }
.b-file-name { white-space: normal; }
.b-file-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }

/* Thème sombre sur ordinateur et tablette : la version « ruban » fixait des couleurs claires (volet, rail, barre du
   haut, ruban). Équivalents sombres, contrastes d'au moins 4,5:1 */
@media (min-width: 761px) {
  :root[data-theme="dark"] .topbar { background: #15382c; }
  :root[data-theme="dark"] .sidebar {
    --fg: #e8f0ec; --fg-2: #c3cfca; --muted: #93a39d; --faint: #6f7f79; --hover: rgba(200, 240, 225, .07); --press: rgba(200, 240, 225, .11);
    --line: #232c29; --brand-soft: #193a2f; --brand-softer: #132620; --brand-strong: #7fd5b4;
  }
  :root[data-theme="dark"] .shell.drawer .sidebar { background: #121816; }
  :root[data-theme="dark"] .rail-item { color: #a5b4ae; }
  :root[data-theme="dark"] .rail-item:hover .rail-ic { background: rgba(255, 255, 255, .07); }
  :root[data-theme="dark"] .rail-item.active .rail-ic { background: #193a2f; color: #7fd5b4; }
  :root[data-theme="dark"] .rail-item[data-badge] .rail-ic::after { border-color: #0f1412; }
  :root[data-theme="dark"] .rb-new { background: #2b7d61; color: #fff; }
  :root[data-theme="dark"] .rb-new:hover { background: #33906f; }
  :root[data-theme="dark"] .rb:hover { background: rgba(255, 255, 255, .07); }
  :root[data-theme="dark"] a.ribbon-tab:hover { background: rgba(255, 255, 255, .06); }
  :root[data-theme="dark"] .ribbon-bar, :root[data-theme="dark"] .mail-view .list-pane, :root[data-theme="dark"] .mail-view .read-pane, :root[data-theme="dark"] .stage > section { box-shadow: 0 0 0 1px var(--line); }
}
:root[data-theme="dark"] .row-count.unread-n { color: var(--brand-ink); }
:root[data-theme="dark"] .m-hol { color: #f2a097; }

/* Compteur de non-lus : chiffre lisible sur la pastille verte, en clair comme en sombre */
.row .row-count.unread-n { color: #fff; }
:root[data-theme="dark"] .row .row-count.unread-n { color: var(--brand-ink); }

/* Téléphone en thème sombre : fonds et libellés « iOS » qui étaient fixés en clair */
@media (max-width: 760px) {
  :root[data-theme="dark"] {
    --ios-label: #eef3f1; --ios-2: rgba(235, 245, 241, .62); --ios-fill: rgba(200, 240, 225, .1); --ios-sep: rgba(200, 240, 225, .14); --ios-bg: #0d1110;
  }
  :root[data-theme="dark"] .stage > section, :root[data-theme="dark"] .settings-view, :root[data-theme="dark"] .set-scroll { background: var(--bg) !important; }
  :root[data-theme="dark"] .sidebar .nav-item .ic { color: rgba(235, 245, 241, .7); }
  /* Astuces du tiroir : texte gris lisible sur le fond blanc du tiroir (thème clair) */
  :root:not([data-theme="dark"]) .sidebar .side-hint, :root:not([data-theme="dark"]) .sidebar .side-foot { color: var(--muted); }
}
@media (max-width: 760px) {
  :root[data-theme="dark"] .tabbar, :root[data-theme="dark"] .fab, :root[data-theme="dark"] .mail-view .fab,
  :root[data-theme="dark"] .reader-dock, :root[data-theme="dark"] .composer-foot {
    background: rgba(24, 31, 28, .86); border-color: rgba(200, 240, 225, .1); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
  :root[data-theme="dark"] .tab-item { color: var(--ios-label); }
  :root[data-theme="dark"] .tab-item.active { background: rgba(200, 240, 225, .1); color: var(--brand-strong); }
  :root[data-theme="dark"] .fab, :root[data-theme="dark"] .mail-view .fab { color: var(--fg); }
}
@media (pointer: coarse) {
  .m-ev { height: 24px; }
  .yr-t { min-height: 32px; padding-block: 4px; }
  .tg-all .tg-task, .tg-all .m-ev { min-height: 24px; }
}

/* Écran tactile : les échéances de la vue mois ont la même hauteur touchable que les événements (24 px) */
@media (pointer: coarse) { .m-dl { height: 24px; } }

/* Bouton Envoyer verrouillé pendant la relecture et l'envoi : on voit que l'appui est pris en compte */
.cv-send.busy, .send-round.busy { position: relative; cursor: progress; }
.cv-send.busy svg, .send-round.busy svg { opacity: 0; }
.cv-send.busy::after, .send-round.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: send-spin .7s linear infinite; }
@keyframes send-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cv-send.busy::after, .send-round.busy::after { animation-duration: 2s; } }
.btn.primary[data-c=send].busy { position: relative; cursor: progress; }
.btn.primary[data-c=send].busy .send-label { opacity: 0; }
.btn.primary[data-c=send].busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: send-spin .7s linear infinite; }
