/* @portee: carriere */
/* =========================================================================
   Messagerie RH ↔ comptes carrière (agent 1) — préfixe .mx-
   Variables du thème uniquement (clair / sombre), vert de la charte en accent discret.
   ========================================================================= */

.mx-page { min-height: 0; }
.mx-app {
  --mx-radius: 18px;
  display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 0;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1);
}
@media (min-width: 1024px) { body.is-fit .mx-app { flex: 1; } }
@media (min-width: 1440px) { .mx-app { grid-template-columns: 380px minmax(0, 1fr); } }
/* Petits écrans d'ordinateur (1024–1279 px, menu ouvert) : plus de place pour la discussion */
@media (min-width: 1024px) and (max-width: 1279px) {
  .mx-app:not(.is-single) { grid-template-columns: 290px minmax(0, 1fr); }
  .mx-hint { display: none; }
}
.mx-app.is-single { grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------------------------ Liste des conversations */
.mx-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg-elev); }
.mx-side-top { padding: .8rem .8rem .65rem; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .6rem; flex-shrink: 0; }
.mx-filters { display: flex; flex-wrap: wrap; gap: .3rem; }
.mx-filters::-webkit-scrollbar { display: none; }
.mx-filter { white-space: nowrap; display: inline-flex; gap: .35rem; align-items: center; padding: .3rem .65rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--bg-elev); font: inherit; font-size: .78rem; font-weight: 650; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.mx-filter:hover { color: var(--text); border-color: var(--line-strong); }
.mx-filter.is-active { background: var(--bg-inverse); color: var(--text-inverse); border-color: var(--bg-inverse); }
.mx-filter-n { font-size: .66rem; font-weight: 800; background: var(--bg-sunken); color: var(--text-2); border-radius: var(--r-pill); padding: 0 .38rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.mx-filter-n.is-hot { background: var(--brand); color: #000; }
.mx-filter.is-active .mx-filter-n:not(.is-hot) { background: color-mix(in srgb, var(--text-inverse) 18%, transparent); color: var(--text-inverse); }
.mx-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.mx-conv { display: flex; gap: .75rem; align-items: center; width: 100%; padding: .72rem .9rem; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--text); position: relative; font: inherit; transition: background .12s; }
.mx-conv + .mx-conv::before { content: ""; position: absolute; top: 0; left: 4.4rem; right: .9rem; height: 1px; background: var(--line); opacity: .7; }
.mx-conv:hover { background: var(--bg-hover); }
.mx-conv.is-active { background: var(--bg-sunken); }
.mx-conv.is-active::after { content: ""; position: absolute; left: 0; top: .6rem; bottom: .6rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.mx-conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.mx-conv-top, .mx-conv-bot { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.mx-conv-top b { flex: 1; font-size: .92rem; font-weight: 650; }
.mx-conv-time { font-size: .72rem; color: var(--text-3); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mx-conv-prev { flex: 1; font-size: .82rem; color: var(--text-3); }
.mx-conv.is-unread .mx-conv-top b { font-weight: 800; }
.mx-conv.is-unread .mx-conv-prev { color: var(--text); font-weight: 600; }
.mx-conv.is-unread .mx-conv-time { color: var(--brand-ink); font-weight: 750; }
.mx-conv .count { flex-shrink: 0; }
.mx-pin { color: var(--text-3); font-size: .82rem; flex-shrink: 0; }
.mx-asg { width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--bg-sunken); color: var(--text-2); font-size: .56rem; font-weight: 800; display: inline-grid; place-items: center; border: 1px solid var(--line); flex-shrink: 0; letter-spacing: .02em; }
.mx-asg.is-menu { width: 1.6rem; height: 1.6rem; font-size: .62rem; }
.mx-list-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: 2.5rem 1.2rem; color: var(--text-2); }
.mx-loading { display: flex; justify-content: center; padding: 1rem; }

/* Avatars */
.mx-av { position: relative; width: 2.75rem; height: 2.75rem; border-radius: 50%; flex-shrink: 0; background: var(--bg-inverse); color: var(--text-inverse); display: grid; place-items: center; font-weight: 750; font-size: .9rem; letter-spacing: .02em; }
.mx-av > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mx-av.is-sm { width: 2.25rem; height: 2.25rem; font-size: .78rem; }
.mx-av.is-md { width: 2.55rem; height: 2.55rem; }
.mx-av.is-lg { width: 3.1rem; height: 3.1rem; }
.mx-av.is-team { background: #fff; } /* lettres du logo transparentes : fond blanc derrière (comme la barre latérale) */
.mx-av.is-team > img { object-fit: contain; }
[data-theme="dark"] .mx-av.is-team { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.mx-dot { position: absolute; right: -1px; bottom: -1px; width: .8rem; height: .8rem; border-radius: 50%; background: var(--brand); border: 2px solid var(--bg-elev); }

/* ------------------------------------------------------------------ Fil */
.mx-main { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background-color: var(--bg-sunken);
  background-image: radial-gradient(color-mix(in srgb, var(--line-strong) 55%, transparent) 1px, transparent 1.2px);
  background-size: 20px 20px; }
.mx-thread { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.mx-head { display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); background: var(--bg-elev); min-height: 3.9rem; flex-shrink: 0; position: relative; z-index: 6; }
.mx-head-id { min-width: 0; flex: 1; line-height: 1.25; }
.mx-head-id b { display: block; font-size: .98rem; font-weight: 750; }
.mx-head-sub { font-size: .78rem; color: var(--text-3); display: flex; gap: .35rem; min-width: 0; white-space: nowrap; overflow: hidden; }
.mx-head-sub .is-online { color: var(--brand-ink); font-weight: 650; }
.mx-typing-txt { color: var(--brand-ink); font-style: italic; font-weight: 600; }
.mx-head-acts { display: flex; gap: .15rem; align-items: center; flex-shrink: 0; }
.mx-head-acts .menu { min-width: 240px; }
.mx-back { display: none; }
.mx-wide-only { display: none; }
@media (min-width: 1280px) { .mx-wide-only { display: inline; } }
.mx-secure { font-size: .75rem; color: var(--text-3); display: inline-flex; gap: .35rem; align-items: center; padding: .25rem .65rem; border: 1px solid var(--line); border-radius: var(--r-pill); }
.mx-banner { display: flex; gap: .5rem; align-items: center; padding: .45rem .9rem; font-size: .8rem; background: var(--info-soft); color: var(--text); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.mx-banner .ph { color: var(--info); }
.mx-banner.is-warn { background: var(--warning-soft); } .mx-banner.is-warn .ph { color: var(--warning); }

.mx-body-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mx-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; overscroll-behavior: contain; }
.mx-msgs { padding: .9rem clamp(.75rem, 2.4vw, 2.2rem) .7rem; display: flex; flex-direction: column; max-width: 1080px; margin: 0 auto; width: 100%; }
.mx-older { display: flex; justify-content: center; padding: .2rem 0 .6rem; }
.mx-day { display: flex; justify-content: center; margin: 1rem 0 .45rem; }
.mx-day span { background: var(--bg-elev); border: 1px solid var(--line); padding: .18rem .75rem; border-radius: var(--r-pill); font-size: .72rem; font-weight: 700; color: var(--text-2); box-shadow: var(--shadow-1); }
.mx-item:first-child .mx-day { margin-top: .2rem; }

.mx-row { display: flex; flex-direction: column; padding: 1px 0; }
.mx-row.is-first { margin-top: .5rem; }
.mx-row.is-out { align-items: flex-end; }
.mx-row.is-in { align-items: flex-start; }
.mx-who { display: flex; align-items: center; gap: .4rem; font-size: .74rem; font-weight: 700; color: var(--text-2); margin: 0 .35rem .22rem; }
.mx-who-av { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--bg-inverse); color: var(--text-inverse); font-size: .52rem; font-weight: 800; display: grid; place-items: center; overflow: hidden; }
.mx-who-av img { width: 100%; height: 100%; object-fit: cover; }
.mx-line { display: flex; align-items: center; gap: .4rem; max-width: min(76%, 640px); min-width: 0; }
.is-out .mx-line { flex-direction: row-reverse; }

.mx-bubble {
  position: relative; min-width: 0; padding: .42rem .7rem .42rem; border-radius: var(--mx-radius);
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  font-size: .935rem; line-height: 1.45; overflow-wrap: anywhere; transition: box-shadow .3s;
}
.is-out .mx-bubble { background: var(--bg-inverse); color: var(--text-inverse); border-color: var(--bg-inverse); }
.is-in.is-first .mx-bubble { border-top-left-radius: 6px; }
.is-out.is-first .mx-bubble { border-top-right-radius: 6px; }
.is-in:not(.is-first) .mx-bubble { border-top-left-radius: 7px; }
.is-in:not(.is-last) .mx-bubble { border-bottom-left-radius: 7px; }
.is-out:not(.is-first) .mx-bubble { border-top-right-radius: 7px; }
.is-out:not(.is-last) .mx-bubble { border-bottom-right-radius: 7px; }
.mx-row.is-tmp .mx-bubble { opacity: .82; }
.mx-row.is-flash .mx-bubble { animation: mx-flash 1.5s var(--ease); }
@keyframes mx-flash { 0%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent); } }

.mx-text { display: inline; white-space: normal; }
.mx-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mx-text::after { content: ""; display: inline-block; width: 2.9rem; height: 1px; }
.is-out .mx-text::after { width: 3.9rem; }
.mx-meta { position: absolute; right: .6rem; bottom: .26rem; display: inline-flex; gap: .2rem; align-items: center; font-size: .67rem; line-height: 1; opacity: .6; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: auto; }
.is-out .mx-meta { opacity: .72; }
.mx-tick { font-size: .92rem; }
.mx-tick.is-read { color: var(--brand); opacity: 1; }
.mx-tick.is-err { color: var(--danger); }
.mx-bubble.no-text { padding-bottom: 1.15rem; }
.mx-bubble.no-text.is-media { padding: 3px; }
.mx-bubble.no-text.is-media .mx-meta { right: .5rem; bottom: .45rem; background: rgba(0, 0, 0, .5); color: #fff; padding: .2rem .45rem; border-radius: var(--r-pill); opacity: 1; }

/* Émojis seuls : grands, sans bulle */
.mx-bubble.is-jumbo { background: transparent !important; border-color: transparent !important; box-shadow: none; color: var(--text) !important; font-size: 2.6rem; line-height: 1.15; padding: 0 .1rem 1.05rem; }
.mx-bubble.is-jumbo .mx-text::after { display: none; }
.mx-bubble.is-jumbo .mx-meta { right: .1rem; bottom: 0; color: var(--text-3); }
.mx-bubble.is-deleted { background: transparent !important; color: var(--text-3) !important; border: 1px dashed var(--line-strong) !important; box-shadow: none; }
.mx-deleted { display: flex; gap: .35rem; align-items: center; font-style: italic; font-size: .85rem; padding-right: 2.6rem; }

/* Citation (réponse) */
.mx-quote { display: block; width: 100%; min-width: 9rem; text-align: left; border: 0; border-left: 3px solid var(--brand); background: color-mix(in srgb, currentColor 8%, transparent); color: inherit; border-radius: 8px; padding: .32rem .55rem; margin: .05rem 0 .35rem; cursor: pointer; font: inherit; font-size: .8rem; line-height: 1.35; }
.mx-quote b { display: block; font-size: .75rem; }
.mx-quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; opacity: .78; }
.mx-bubble.is-media.has-quote { padding: .35rem; }

/* Image */
.mx-img { display: block; width: min(300px, 62vw); max-height: 380px; border-radius: calc(var(--mx-radius) - 4px); overflow: hidden; border: 0; padding: 0; cursor: zoom-in; background: var(--bg-sunken); }
.mx-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.mx-img:hover img { transform: scale(1.025); }
.mx-bubble.is-media:not(.no-text) .mx-img { margin: -.12rem -.38rem .4rem; width: calc(min(300px, 62vw)); }

/* Fichier */
.mx-file { width: min(310px, 66vw); }
.mx-file-main { display: flex; gap: .65rem; align-items: center; width: 100%; background: color-mix(in srgb, currentColor 6%, transparent); border-radius: 11px; padding: .55rem .6rem; border: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.mx-file-main:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.mx-file-ic { width: 2.45rem; height: 2.45rem; border-radius: 10px; display: grid; place-items: center; background: var(--muted-soft); color: var(--text-2); font-size: 1.35rem; flex-shrink: 0; }
.mx-file-ic.is-pdf { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.mx-file-ic.is-doc { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.mx-file-ic.is-sheet { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand-ink); }
.mx-file-ic.is-slides { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.is-out .mx-file-ic:not([class*="is-"]) { background: color-mix(in srgb, currentColor 12%, transparent); color: inherit; }
/* Thème sombre : la bulle sortante est claire → teintes assombries pour rester lisibles */
[data-theme="dark"] .is-out .mx-file-ic.is-pdf { color: color-mix(in srgb, var(--danger) 45%, var(--text-inverse)); }
[data-theme="dark"] .is-out .mx-file-ic.is-doc { color: color-mix(in srgb, var(--info) 45%, var(--text-inverse)); }
[data-theme="dark"] .is-out .mx-file-ic.is-sheet { color: color-mix(in srgb, var(--brand) 60%, var(--text-inverse)); }
[data-theme="dark"] .is-out .mx-file-ic.is-slides { color: color-mix(in srgb, var(--orange) 45%, var(--text-inverse)); }
[data-theme="dark"] .is-out .mx-tick.is-read { color: color-mix(in srgb, var(--brand) 75%, var(--text-inverse)); }
.mx-file-txt { min-width: 0; flex: 1; line-height: 1.3; }
.mx-file-txt b { display: block; font-size: .86rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-file-txt small { font-size: .73rem; opacity: .7; }
.mx-file-acts { display: flex; gap: .3rem; margin-top: .35rem; }
.mx-file-btn { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: .35rem; font: inherit; font-size: .77rem; font-weight: 650; padding: .34rem .4rem; border-radius: 8px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); background: transparent; color: inherit; text-decoration: none !important; cursor: pointer; }
.mx-file-btn:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.mx-bubble.is-file:not(.no-text) .mx-file { margin-bottom: .4rem; }

/* Note vocale */
.mx-voice { display: flex; align-items: center; gap: .6rem; width: min(300px, 64vw); padding: .1rem 0 0; }
.mx-play { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--brand); color: #000; font-size: 1.02rem; cursor: pointer; flex-shrink: 0; transition: transform .12s; }
.mx-play:active { transform: scale(.94); }
.mx-play.is-sm { width: 2rem; height: 2rem; font-size: .9rem; }
.mx-wave { flex: 1; height: 30px; display: flex; align-items: center; gap: 1.5px; cursor: pointer; min-width: 0; overflow: hidden; }
.mx-wave i { flex: 1 1 0; min-width: 1px; max-width: 3px; border-radius: 2px; background: color-mix(in srgb, currentColor 32%, transparent); transition: background .15s; }
.mx-wave i.is-on { background: currentColor; }
.mx-voice-t { font-size: .72rem; opacity: .75; min-width: 2.1rem; flex-shrink: 0; text-align: right; }
.mx-speed { font: inherit; font-size: .68rem; font-weight: 800; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); background: transparent; color: inherit; border-radius: var(--r-pill); padding: .08rem .42rem; cursor: pointer; min-width: 2.3rem; flex-shrink: 0; }
.mx-progress { display: block; height: 3px; margin-top: .4rem; border-radius: 3px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; }
.mx-progress i { display: block; height: 100%; background: var(--brand); transition: width .2s; }

/* Actions d'un message (hors flux : n'élargissent jamais la ligne) */
.mx-line { position: relative; }
.mx-acts { position: absolute; top: 50%; transform: translateY(-50%); display: flex; gap: 3px; opacity: 0; transition: opacity .15s; z-index: 3; }
.is-in .mx-acts { left: calc(100% + .4rem); }
.is-out .mx-acts { right: calc(100% + .4rem); flex-direction: row-reverse; }
.mx-row:hover .mx-acts, .mx-row.is-picked .mx-acts, .mx-acts:focus-within { opacity: 1; }
.mx-acts button { width: 1.85rem; height: 1.85rem; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-elev); box-shadow: var(--shadow-1); color: var(--text-2); display: grid; place-items: center; cursor: pointer; font-size: .95rem; padding: 0; }
.mx-acts button:hover { color: var(--text); border-color: var(--line-strong); }
.mx-acts button.is-danger:hover { color: var(--danger); }
@media (hover: none) {
  .mx-acts { display: none; top: auto; bottom: calc(100% + .3rem); transform: none; padding: 3px; border-radius: var(--r-pill); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
  .is-in .mx-acts { left: 0; } .is-out .mx-acts { right: 0; }
  .mx-acts button { box-shadow: none; border-color: transparent; }
  .mx-row.is-picked .mx-acts { display: flex; opacity: 1; }
  .mx-row.is-picked .mx-bubble { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 45%, transparent); }
}

/* En train d'écrire */
.mx-typing .mx-bubble { display: inline-flex; gap: .5rem; align-items: center; padding: .55rem .8rem; }

/* Bouton « derniers messages » */
.mx-jump-wrap { position: sticky; bottom: 0; height: 0; z-index: 5; }
.mx-jump { position: absolute; right: 1rem; bottom: .9rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-2); display: grid; place-items: center; cursor: pointer; font-size: 1.15rem; }
.mx-jump .count { position: absolute; top: -.4rem; right: -.3rem; }

/* Dépôt de fichiers */
.mx-drop { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(3px); pointer-events: none; }
.mx-drop > div { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 2rem 2.6rem; border: 2px dashed var(--brand); border-radius: var(--r-lg); background: var(--bg-elev); color: var(--text-2); text-align: center; }
.mx-drop .ph { font-size: 2.2rem; color: var(--brand-ink); }
.mx-drop b { color: var(--text); }

/* États vides */
.mx-empty-thread { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: 3rem 1rem 1rem; max-width: 420px; margin: 0 auto; }
.mx-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .7rem; padding: 2rem; max-width: 460px; margin: auto; }
.mx-placeholder p { margin: 0; }
.mx-placeholder-art { width: 6rem; height: 6rem; border-radius: 28px; background: var(--bg-elev); border: 1px solid var(--line); display: grid; place-items: center; font-size: 2.8rem; color: var(--text-2); box-shadow: var(--shadow-2); margin-bottom: .4rem; position: relative; }
.mx-placeholder-art::after { content: ""; position: absolute; right: -.35rem; top: -.35rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--brand); border: 3px solid var(--bg-sunken); }
.mx-welcome { display: flex; gap: .85rem; max-width: 600px; width: 100%; margin: .4rem auto 1rem; padding: 1rem 1.1rem; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.mx-welcome p { margin: .25rem 0 .6rem; font-size: .88rem; color: var(--text-2); line-height: 1.5; }
.mx-welcome-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.mx-welcome-tags span { display: inline-flex; gap: .3rem; align-items: center; font-size: .72rem; font-weight: 650; color: var(--text-2); padding: .18rem .55rem; border-radius: var(--r-pill); background: var(--bg-sunken); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ Composeur */
.mx-compose { position: relative; border-top: 1px solid var(--line); background: var(--bg-elev); padding: .6rem .75rem calc(.5rem + env(safe-area-inset-bottom)); flex-shrink: 0; z-index: 8; }
.mx-bar { display: flex; align-items: flex-end; gap: .35rem; }
.mx-tools { display: flex; gap: .05rem; padding-bottom: .2rem; flex-shrink: 0; }
.mx-tool { width: 2.35rem; height: 2.35rem; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); font-size: 1.32rem; display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; padding: 0; }
.mx-tool:hover, .mx-tool.is-on { background: var(--bg-hover); color: var(--text); }
.mx-input { flex: 1; position: relative; min-width: 0; }
.mx-input textarea { width: 100%; resize: none; border: 1px solid var(--line-strong); background: var(--bg); border-radius: 22px; padding: .64rem 1rem; font: inherit; font-size: .95rem; line-height: 1.4; max-height: 180px; min-height: 2.75rem; color: var(--text); display: block; transition: border-color .15s, box-shadow .15s; scrollbar-width: thin; }
.mx-input textarea::placeholder { color: var(--text-3); }
.mx-input textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.mx-count { position: absolute; right: .9rem; top: -1.15rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mx-count.is-low { color: var(--danger); font-weight: 700; }
.mx-send { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: var(--bg-inverse); color: var(--text-inverse); font-size: 1.15rem; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: transform .12s, opacity .15s; padding: 0; }
.mx-send:hover { opacity: .88; }
.mx-send:active { transform: scale(.93); }
.mx-send:disabled { opacity: .35; cursor: default; }
.mx-hint { text-align: right; margin-top: .3rem; padding-right: 3.2rem; }
.mx-locked { display: flex; gap: .6rem; align-items: center; justify-content: center; padding: .85rem; color: var(--text-2); font-size: .86rem; background: var(--bg-sunken); border-radius: var(--r); text-align: center; }

.mx-reply { display: flex; align-items: center; gap: .6rem; padding: .42rem .5rem .42rem .65rem; margin-bottom: .5rem; border-left: 3px solid var(--brand); background: var(--bg-sunken); border-radius: 8px; font-size: .82rem; }
.mx-reply > .ph { color: var(--brand-ink); }
.mx-reply b { display: block; font-size: .76rem; }
.mx-reply span { display: block; color: var(--text-2); }

.mx-pieces { display: flex; gap: .5rem; overflow-x: auto; padding: .15rem .1rem .6rem; scrollbar-width: thin; }
.mx-piece { position: relative; flex-shrink: 0; width: 5.2rem; height: 5.2rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-sunken); overflow: hidden; animation: mx-pop .2s var(--ease); }
.mx-piece:not(.is-img) { width: 12.5rem; }
.mx-piece img { width: 100%; height: 100%; object-fit: cover; }
.mx-piece-doc { display: flex; gap: .55rem; align-items: center; padding: .6rem 1.6rem .6rem .6rem; height: 100%; }
.mx-piece-txt { min-width: 0; line-height: 1.3; }
.mx-piece-txt b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .76rem; overflow-wrap: anywhere; }
.mx-piece-txt small { font-size: .7rem; color: var(--text-3); }
.mx-piece-x { position: absolute; top: .25rem; right: .25rem; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: rgba(0, 0, 0, .62); color: #fff; border: 0; display: grid; place-items: center; font-size: .78rem; cursor: pointer; padding: 0; }
.mx-piece-add { flex-shrink: 0; width: 5.2rem; height: 5.2rem; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: transparent; color: var(--text-3); font-size: 1.4rem; cursor: pointer; }
.mx-piece-add:hover { color: var(--text); border-color: var(--text-3); }
@keyframes mx-pop { from { opacity: 0; transform: scale(.92); } }

.mx-rec { display: flex; align-items: center; gap: .45rem; }
.mx-rec-live { flex: 1; display: flex; align-items: center; gap: .65rem; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 22px; padding: .35rem .85rem; min-height: 2.75rem; min-width: 0; }
.mx-rec-dot { width: .62rem; height: .62rem; border-radius: 50%; background: var(--danger); animation: mx-pulse 1.1s ease-in-out infinite; flex-shrink: 0; }
@keyframes mx-pulse { 50% { opacity: .25; } }
.mx-rec-bars { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 2px; height: 26px; overflow: hidden; min-width: 0; }
.mx-rec-bars i { width: 3px; flex-shrink: 0; border-radius: 2px; background: var(--text-2); transition: height .1s; }
.mx-rec-bars.is-done { justify-content: flex-start; }
.mx-rec-bars.is-done i { flex: 1; width: auto; max-width: 4px; }
.mx-rec-x:hover { color: var(--danger); }

/* Fenêtres flottantes du composeur */
.mx-pop { position: absolute; left: .75rem; bottom: calc(100% + .4rem); z-index: 30; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.mx-emoji { width: min(368px, calc(100vw - 1.5rem)); overflow: hidden; }
.mx-emoji-cats { display: flex; gap: 2px; padding: .35rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.mx-emoji-cats button { flex: 1; min-width: 2.1rem; height: 2.1rem; border: 0; background: transparent; color: var(--text-3); border-radius: 8px; display: grid; place-items: center; cursor: pointer; font-size: 1.12rem; position: relative; }
.mx-emoji-cats button:hover { background: var(--bg-hover); color: var(--text); }
.mx-emoji-cats button.is-active { color: var(--text); }
.mx-emoji-cats button.is-active::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: 1px; height: 2px; border-radius: 2px; background: var(--brand); }
.mx-emoji-label { padding: .45rem .7rem 0; font-weight: 700; }
.mx-emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1px; padding: .3rem .4rem .5rem; height: 232px; overflow-y: auto; align-content: start; scrollbar-width: thin; }
.mx-emoji-grid button { aspect-ratio: 1; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 1.42rem; line-height: 1; padding: 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif; transition: transform .1s, background .1s; }
.mx-emoji-grid button:hover { background: var(--bg-hover); transform: scale(1.12); }
.mx-emoji-empty { grid-column: 1 / -1; padding: 1.5rem .5rem; text-align: center; }
.mx-quick { width: min(440px, calc(100vw - 1.5rem)); }
.mx-quick-head { display: flex; gap: .4rem; align-items: center; padding: .55rem; border-bottom: 1px solid var(--line); }
.mx-quick-list { max-height: 290px; overflow-y: auto; padding: .3rem; }
.mx-quick-item { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; color: var(--text); font: inherit; }
.mx-quick-item:hover { background: var(--bg-hover); }
.mx-quick-item b { display: block; font-size: .84rem; }
.mx-quick-item span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .78rem; color: var(--text-2); white-space: pre-line; }

/* ------------------------------------------------------------------ Modales */
.mx-pick-list { max-height: 360px; overflow-y: auto; margin: 0 -.4rem; }
.mx-pick { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .6rem; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; color: var(--text); font: inherit; }
.mx-pick:hover { background: var(--bg-hover); }
.mx-mf { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.mx-mf-list { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: .45rem; }
.mx-mf-item { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); }
.mx-mf-item.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.mx-mf-item .xsmall { white-space: pre-line; margin-top: .15rem; }
.mx-mf-form { padding: .9rem; border-radius: var(--r); background: var(--bg-sunken); border: 1px solid var(--line); }
@media (max-width: 720px) { .mx-mf { grid-template-columns: minmax(0, 1fr); } .mx-mf-list { max-height: 240px; } }

/* ------------------------------------------------------------------ Points d'entrée (bouton, carte d'accueil) */
.mx-btn-msg { position: relative; }
.mx-btn-count { min-width: 1.15rem; height: 1.15rem; border-radius: var(--r-pill); background: var(--brand); color: #000; font-size: .66rem; font-weight: 800; display: inline-grid; place-items: center; padding: 0 .3rem; }
.mx-card-last { display: flex; gap: .7rem; align-items: center; color: var(--text); text-decoration: none !important; padding: .15rem 0; }
.mx-card-last:hover .strong { text-decoration: underline; text-underline-offset: 3px; }
.mx-card .mx-av { width: 2.4rem; height: 2.4rem; }

/* ------------------------------------------------------------------ Espace Carrière : page pleine hauteur */
body.mx-cbody .content > * { animation: none; }
@media (min-width: 1024px) {
  body.mx-cbody .cshell { height: 100dvh; }
  body.mx-cbody .cmain { height: 100dvh; overflow: hidden; }
  body.mx-cbody .content { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 1.25rem; }
  body.mx-cbody .mx-cpage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.mx-cbody .mx-app.is-single { flex: 1; min-height: 0; width: 100%; max-width: 1180px; margin: 0 auto; }
}

/* ------------------------------------------------------------------ Mobile et tablette */
@media (max-width: 1023px) {
  .mx-page .page-sub { display: none; }
  .mx-page .page-head { margin-bottom: .8rem; }
  .mx-app:not(.is-single) { grid-template-columns: minmax(0, 1fr); height: var(--mx-h, calc(100dvh - var(--topbar-h) - 8rem)); min-height: 420px; }
  .mx-app:not(.is-single) .mx-side { border-right: 0; }
  .mx-app:not(.is-single) .mx-main { display: none; }
  .mx-app.show-fil .mx-main { display: flex; position: fixed; inset: 0; z-index: 70; }
  .mx-app.show-fil .mx-back { display: inline-flex; }
  .mx-head { padding: .45rem .55rem; gap: .5rem; min-height: 3.6rem; }
  .mx-line { max-width: 86%; }
  .mx-msgs { padding-inline: .6rem; }
  .mx-pop { left: .4rem; }
  body.mx-cbody .content { padding-bottom: 0; }
  body.mx-cbody .mx-app.is-single { position: fixed; left: 0; right: 0; top: var(--mx-top, var(--topbar-h)); bottom: var(--mx-bottom, calc(65px + env(safe-area-inset-bottom))); border: 0; border-radius: 0; z-index: 20; box-shadow: none; }
  body.mx-cbody .mx-compose { padding-bottom: .5rem; }
  body.mx-cbody .mx-back.is-always-mobile { display: inline-flex; }
}
@media (max-width: 560px) {
  .mx-tools .mx-tool { width: 2.15rem; }
  .mx-file, .mx-voice { width: min(260px, 68vw); }
}
