/*!
 * Morgan Wealth — lot « Espace membres ».
 * Préfixes : mw-esp- (tableau de bord, bandeaux), mw-chat / mw-msg- / mw-react / mw-conv (salons et messages),
 * mw-res- (ressources imprimables), mw-notif (notifications). Tokens du socle uniquement (aucune couleur en dur).
 * Mobile d'abord (base 360 px), ruptures 48rem / 64rem / 80rem. Hauteurs : barre d'onglets fixe sous 64rem.
 */

/* =============================================================================
   01. Bandeau de maquette, sélecteur d'états, en-têtes
   ========================================================================== */
.mw-esp-banner {
  display: flex; align-items: flex-start; gap: var(--mw-s-2);
  margin: 0; padding: var(--mw-s-2) var(--mw-s-3);
  border: 1px dashed color-mix(in srgb, var(--mw-warn) 50%, transparent);
  border-radius: var(--mw-r-md);
  background: var(--mw-warn-soft);
  color: var(--mw-text-2);
  font-size: var(--mw-fs-xs); line-height: 1.45;
}
.mw-esp-banner .mw-icon { width: 16px; height: 16px; margin-top: 1px; color: var(--mw-warn); }
.mw-esp-banner strong { color: var(--mw-text); font-weight: 650; }

.mw-esp-states {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--mw-s-2) var(--mw-s-3);
  margin-bottom: var(--mw-s-3); padding: var(--mw-s-2) var(--mw-s-3);
  border: 1px dashed var(--mw-line-strong); border-radius: var(--mw-r-md);
}
.mw-esp-states__label { font-size: var(--mw-fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mw-text-2); }
.mw-esp-states__list { display: flex; flex-wrap: wrap; gap: var(--mw-s-2); }

.mw-esp-risk { margin-top: var(--mw-s-5); }
.mw-esp-muted { color: var(--mw-text-2); font-size: var(--mw-fs-sm); }
.mw-esp-head--chat .mw-page-header__title { font-size: var(--mw-fs-xl); }
@media (max-width: 47.99rem) { .mw-esp-head--chat .mw-page-header__lead { display: none; } .mw-esp-head--chat { padding-block: var(--mw-s-2) var(--mw-s-3); } }

/* =============================================================================
   02. Tableau de bord
   ========================================================================== */
.mw-esp-dash { display: flex; flex-direction: column; gap: var(--mw-s-4); }
.mw-esp-col { display: contents; }
/* Ordre de lecture (rééquilibrage du 25/11) : démarrage, salons, outils, articles, puis le live. */
.mw-esp-start { order: 1; }
.mw-esp-rooms { order: 2; }
.mw-esp-tools { order: 3; }
.mw-esp-journal { order: 4; }
.mw-esp-posts { order: 5; }
.mw-esp-livestrip { order: 6; }
@media (min-width: 80rem) {
  .mw-esp-dash { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--mw-s-5); align-items: start; }
  .mw-esp-col { display: flex; flex-direction: column; gap: var(--mw-s-5); min-width: 0; }
  .mw-esp-livestrip { grid-column: 1 / -1; }
}

.mw-esp-card { display: flex; flex-direction: column; gap: var(--mw-s-4); padding: var(--mw-s-4); min-width: 0; }
@media (min-width: 48rem) { .mw-esp-card { padding: var(--mw-s-5); } }
.mw-esp-card__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--mw-s-2) var(--mw-s-4); }
.mw-esp-card__head .mw-eyebrow { margin-bottom: var(--mw-s-2); }
.mw-esp-card__title { font-family: var(--mw-font-display); font-size: var(--mw-fs-lg); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }

/* Étapes de démarrage */
.mw-esp-steps { display: flex; flex-direction: column; gap: var(--mw-s-2); }
.mw-esp-step {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: var(--mw-s-1) var(--mw-s-3);
  padding: var(--mw-s-2) var(--mw-s-3) var(--mw-s-2) var(--mw-s-2);
  border: 1px solid var(--mw-line); border-radius: var(--mw-r-md); background: var(--mw-bg-2);
  transition: border-color var(--mw-dur);
}
.mw-esp-step.is-done { border-color: color-mix(in srgb, var(--mw-up) 35%, var(--mw-line)); }
.mw-esp-step__form { display: contents; }
.mw-esp-step__check {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--mw-line-strong); background: transparent; color: transparent; cursor: pointer;
  transition: background-color var(--mw-dur), border-color var(--mw-dur), color var(--mw-dur);
}
.mw-esp-step__check .mw-icon { width: 20px; height: 20px; }
.mw-esp-step__check:hover { border-color: var(--mw-accent); }
.mw-esp-step__check[aria-pressed="true"] { background: var(--mw-up); border-color: var(--mw-up); color: var(--mw-bg); }
.mw-esp-step__title { font-weight: 600; font-size: var(--mw-fs-base); line-height: 1.35; }
.mw-esp-step.is-done .mw-esp-step__title { color: var(--mw-text-2); }
.mw-esp-step__desc { font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-esp-step__link { grid-column: 2; min-height: 44px; display: inline-flex; align-items: center; justify-self: start; font-size: var(--mw-fs-sm); }
@media (min-width: 48rem) {
  .mw-esp-step { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .mw-esp-step__link { grid-column: auto; justify-self: end; }
}
.mw-esp-start__done { display: flex; align-items: center; gap: var(--mw-s-2); color: var(--mw-up); font-size: var(--mw-fs-sm); font-weight: 600; }
.mw-esp-start__done .mw-icon { width: 20px; height: 20px; }

/* Salons (aperçu), raccourcis */
.mw-esp-rooms .mw-rooms { margin-inline: calc(var(--mw-s-2) * -1); }
.mw-room__go { width: 18px; height: 18px; color: var(--mw-text-3); flex: none; }
.mw-esp-tools__list { display: grid; gap: var(--mw-s-1); }
@media (min-width: 48rem) and (max-width: 79.99rem) { .mw-esp-tools__list { grid-template-columns: 1fr 1fr; gap: var(--mw-s-2); } }
.mw-esp-tool {
  display: flex; align-items: center; gap: var(--mw-s-3); min-height: 56px; padding: var(--mw-s-2) var(--mw-s-3);
  border-radius: var(--mw-r-md); color: var(--mw-text); text-decoration: none; border: 1px solid transparent;
  transition: background-color var(--mw-dur), border-color var(--mw-dur);
}
.mw-esp-tool:hover { background: var(--mw-surface-2); border-color: var(--mw-line); }
.mw-esp-tool__icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--mw-surface-2); border: 1px solid var(--mw-line); color: var(--mw-accent-2); }
.mw-esp-tool__icon .mw-icon { width: 18px; height: 18px; }
.mw-esp-tool__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mw-esp-tool__name { font-weight: 600; line-height: 1.3; }
.mw-esp-tool__desc { font-size: var(--mw-fs-sm); color: var(--mw-text-2); line-height: 1.4; }
.mw-esp-tool__go { width: 18px; height: 18px; color: var(--mw-text-3); flex: none; }

/* Derniers articles */
.mw-esp-posts__list { display: grid; }
.mw-esp-post { padding-block: var(--mw-s-3); border-top: 1px solid var(--mw-line); }
.mw-esp-post:first-child { border-top: 0; padding-top: 0; }
.mw-esp-post__meta { display: flex; gap: var(--mw-s-2); font-size: var(--mw-fs-xs); color: var(--mw-text-2); }
.mw-esp-post__title { font-family: var(--mw-font-display); font-size: var(--mw-fs-md); font-weight: 700; letter-spacing: -.015em; line-height: 1.3; }
.mw-esp-post__title a { display: flex; align-items: center; min-height: 44px; color: var(--mw-text); text-decoration: none; }
.mw-esp-post__title a:hover { color: var(--mw-accent); }
.mw-esp-post__text { color: var(--mw-text-2); font-size: var(--mw-fs-sm); max-width: 62ch; }
.mw-esp-empty { border-style: dashed; }

/* Journal : aperçu des chiffres */
.mw-esp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mw-s-2); }
.mw-esp-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--mw-s-3); border-radius: var(--mw-r-md); background: var(--mw-bg-2); border: 1px solid var(--mw-line); min-width: 0; }
.mw-esp-stat__v { font-family: var(--mw-font-display); font-size: var(--mw-fs-xl); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.mw-esp-stat__l { font-size: var(--mw-fs-xs); color: var(--mw-text-2); line-height: 1.3; }
.mw-esp-stat .mw-skeleton { margin: 0; }
.mw-esp-stats__msg { grid-column: 1 / -1; color: var(--mw-text-2); font-size: var(--mw-fs-sm); }
.mw-esp-stats__demo { grid-column: 1 / -1; justify-self: start; }
.mw-esp-stats:has(.mw-esp-stats__msg) { display: flex; flex-direction: column; align-items: flex-start; gap: var(--mw-s-3); }
.mw-esp-journal__note { font-size: var(--mw-fs-xs); color: var(--mw-text-2); border-top: 1px solid var(--mw-line); padding-top: var(--mw-s-3); }

/* =============================================================================
   03. Salons et messages privés (MAQUETTE)
   ========================================================================== */
.mw-chat {
  --mw-chat-tab: calc(70px + env(safe-area-inset-bottom));
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--mw-line); border-radius: var(--mw-r-lg);
  background: var(--mw-surface); box-shadow: var(--mw-highlight);
  overflow: hidden;
  scroll-margin-top: calc(var(--mw-header-h) + var(--mw-s-2));
}
.mw-chat [hidden] { display: none !important; }
.mw-chat > .mw-esp-banner { border: 0; border-bottom: 1px dashed color-mix(in srgb, var(--mw-warn) 50%, transparent); border-radius: 0; }
.mw-chat__safety {
  display: flex; align-items: flex-start; gap: var(--mw-s-2);
  margin: 0; padding: var(--mw-s-2) var(--mw-s-3);
  background: var(--mw-accent-soft); border-bottom: 1px solid var(--mw-line);
  color: var(--mw-text); font-size: var(--mw-fs-sm); line-height: 1.45;
}
.mw-chat__safety .mw-icon { width: 18px; height: 18px; margin-top: 1px; color: var(--mw-accent-2); }
.mw-chat__body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.mw-chat__body--state { display: block; padding: var(--mw-s-4); }
.mw-chat__statecard .mw-empty { border: 0; background: transparent; }

/* Hauteur : vue « salon » plein écran sur mobile, collée au-dessus de la barre d'onglets */
@media (max-width: 47.99rem) {
  .mw-chat[data-view="room"] {
    height: calc(var(--mw-vvh, 100dvh) - var(--mw-header-h) - var(--mw-chat-tab) - var(--mw-s-5));
    min-height: 320px;
  }
  .mw-chat[data-view="list"] .mw-chat__panels, .mw-chat[data-view="list"] .mw-chat__infos { display: none; }
  .mw-chat[data-view="room"] .mw-chat__list { display: none; }
  body:has(.mw-chat[data-view="room"]) .mw-espace__subnav { display: none; }
  body:has(.mw-chat[data-view="room"]) .mw-esp-head--chat {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
body.mw-chat-typing .mw-tabbar { display: none; }
body.mw-chat-typing .mw-chat { --mw-chat-tab: 0px; }
body.mw-chat-typing .mw-chat__composer { padding-bottom: calc(var(--mw-s-3) + env(safe-area-inset-bottom)); }

@media (min-width: 48rem) {
  .mw-chat { height: clamp(540px, calc(100dvh - var(--mw-header-h) - var(--mw-chat-tab) - 240px), 820px); }
  .mw-chat__body { grid-template-columns: 240px minmax(0, 1fr); }
  .mw-chat--dm .mw-chat__body { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .mw-chat__list { border-right: 1px solid var(--mw-line); }
  .mw-chat__back { display: none !important; }
}
@media (min-width: 64rem) { .mw-chat { --mw-chat-tab: 0px; } }
@media (min-width: 80rem) {
  .mw-chat[data-mw-chat="rooms"] .mw-chat__body { grid-template-columns: 224px minmax(0, 1fr) 216px; }
}

/* --- liste (salons / conversations) */
.mw-chat__list { min-height: 0; overflow-y: auto; padding: var(--mw-s-3); background: var(--mw-bg-2); }
.mw-chat__listhead { display: flex; align-items: center; justify-content: space-between; gap: var(--mw-s-2); margin-bottom: var(--mw-s-3); }
.mw-chat__listtitle { font-family: var(--mw-font-display); font-size: var(--mw-fs-md); font-weight: 700; letter-spacing: -.015em; padding: var(--mw-s-1) var(--mw-s-2) var(--mw-s-2); }
.mw-chat__listhead .mw-chat__listtitle { padding: 0; }
.mw-chat__list .mw-room { padding-inline: var(--mw-s-2); }
.mw-chat__list .mw-room.is-active::before { left: 0; }
.mw-room__unread {
  display: grid; place-items: center; flex: none; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--mw-r-pill); background: var(--mw-accent); color: var(--mw-accent-ink);
  font-size: 11px; font-weight: 700;
}
.mw-conv { gap: var(--mw-s-3); }
.mw-conv__preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-conv__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.mw-conv__time { font-size: var(--mw-fs-xs); color: var(--mw-text-3); }
.mw-chat__search { position: relative; display: flex; align-items: center; gap: var(--mw-s-2); margin-bottom: var(--mw-s-3); }
.mw-chat__search > .mw-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--mw-text-3); pointer-events: none; z-index: 1; }
.mw-chat__search .mw-input { padding-left: 42px; }
.mw-js .mw-chat__searchgo { display: none; }
.mw-chat__muted { font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-chat__noresult { padding: var(--mw-s-3) var(--mw-s-2); }
.mw-chat__skrow { display: flex; gap: var(--mw-s-3); padding: var(--mw-s-3); align-items: center; }
.mw-chat__skbody { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mw-chat .mw-skeleton { display: block; }

/* --- fil */
.mw-chat__panels { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.mw-chat__main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mw-chat__welcome { flex: 1; display: grid; place-items: center; padding: var(--mw-s-4); }
.mw-chat__welcome .mw-empty { border: 0; background: transparent; }
.mw-chat__head { display: flex; align-items: center; gap: var(--mw-s-2); min-height: 60px; padding: var(--mw-s-2) var(--mw-s-2) var(--mw-s-2) var(--mw-s-3); border-bottom: 1px solid var(--mw-line); flex: none; }
.mw-chat__head .mw-room__icon { flex: none; }
.mw-chat__title { flex: 1; min-width: 0; }
.mw-chat__title h2 { font-family: var(--mw-font-display); font-size: var(--mw-fs-md); font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.mw-chat__title h2:focus { outline: none; }
.mw-chat__title h2:focus-visible { outline: 2px solid var(--mw-focus); outline-offset: 2px; border-radius: 4px; }
.mw-chat__title p { font-size: var(--mw-fs-xs); color: var(--mw-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-chat__iconbtn, .mw-chat__back {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--mw-text-2); cursor: pointer; text-decoration: none;
  transition: background-color var(--mw-dur), color var(--mw-dur);
}
.mw-chat__iconbtn:hover, .mw-chat__back:hover { background: var(--mw-accent-soft); color: var(--mw-text); }
.mw-chat__iconbtn .mw-icon, .mw-chat__back .mw-icon { width: 20px; height: 20px; }
@media (min-width: 80rem) { .mw-chat__head [data-chat-info-open] { display: none; } }

.mw-chat__pin { flex: none; border-bottom: 1px solid var(--mw-line); background: var(--mw-bg-2); font-size: var(--mw-fs-sm); }
.mw-chat__pin > summary { display: flex; align-items: center; gap: var(--mw-s-2); min-height: 44px; padding: 0 var(--mw-s-3); cursor: pointer; list-style: none; color: var(--mw-text-2); }
.mw-chat__pin > summary::-webkit-details-marker { display: none; }
.mw-chat__pin > summary > .mw-icon:first-child { width: 18px; height: 18px; color: var(--mw-accent-2); flex: none; }
.mw-chat__pin > summary span { flex: 1; min-width: 0; }
.mw-chat__pin > summary strong { color: var(--mw-text); font-weight: 650; }
.mw-chat__pinchev { width: 16px; height: 16px; flex: none; transition: transform var(--mw-dur); }
.mw-chat__pin[open] .mw-chat__pinchev { transform: rotate(180deg); }
.mw-chat__pin ol { list-style: decimal; display: grid; gap: var(--mw-s-1); margin: 0; padding: 0 var(--mw-s-3) var(--mw-s-3) calc(var(--mw-s-3) + 1.5em); color: var(--mw-text-2); }

.mw-chat__log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--mw-s-4) var(--mw-s-3); }
.mw-chat__log:focus-visible { outline-offset: -3px; }
.mw-chat__log > .mw-empty, .mw-chat__log .mw-empty { margin: auto; }
.mw-chat__skeleton { display: flex; flex-direction: column; gap: var(--mw-s-2); }
.mw-chat__new { display: flex; align-items: center; gap: var(--mw-s-3); color: var(--mw-accent); font-size: var(--mw-fs-xs); font-weight: 600; }
.mw-chat__new::before, .mw-chat__new::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--mw-accent) 45%, transparent); }

/* --- messages */
.mw-chat .mw-msg { align-items: flex-start; }
.mw-chat .mw-msg__body { max-width: min(600px, calc(100% - 44px)); }
.mw-chat .mw-msg--me .mw-msg__body { max-width: min(600px, 92%); }
.mw-chat .mw-msg__meta { flex-wrap: wrap; }
.mw-chat .mw-msg:not(.mw-msg--me) .mw-bubble { border-radius: 4px 16px 16px 16px; }
.mw-chat .mw-msg--me .mw-bubble { border-radius: 16px 4px 16px 16px; }
.mw-chat .mw-bubble { white-space: pre-line; }
.mw-msg__local { font-size: 11px; color: var(--mw-text-3); }
.mw-msg__quote { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding-left: var(--mw-s-2); border-left: 2px solid var(--mw-line-strong); font-size: var(--mw-fs-xs); color: var(--mw-text-2); line-height: 1.4; }
.mw-msg__quote .mw-icon { width: 14px; height: 14px; margin-top: 1px; flex: none; }
.mw-msg__blocked { display: flex; align-items: center; flex-wrap: wrap; gap: var(--mw-s-2); margin: 0; font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-msg__blocked .mw-link { min-height: 44px; padding: 0; background: none; border: 0; cursor: pointer; }
.mw-msg.is-blocked:not(.is-peek) .mw-bubble, .mw-msg.is-blocked:not(.is-peek) .mw-msg-tools, .mw-msg.is-blocked:not(.is-peek) .mw-msg__quote { display: none; }
.mw-msg.is-blocked:not(.is-peek) .mw-msg__meta strong { filter: blur(4px); }

.mw-msg-tools { display: none; }
.mw-js .mw-msg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 2px; }
.mw-msg-tools__reacts { display: contents; }
.mw-react {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border-radius: var(--mw-r-pill); border: 1px solid var(--mw-line); background: transparent; color: var(--mw-text-2);
  font-size: var(--mw-fs-xs); font-weight: 600; cursor: pointer;
  transition: background-color var(--mw-dur), border-color var(--mw-dur), color var(--mw-dur);
}
.mw-react .mw-icon { width: 15px; height: 15px; }
.mw-react:hover { border-color: var(--mw-line-strong); color: var(--mw-text); }
.mw-react[aria-pressed="true"] { background: var(--mw-accent-soft); border-color: color-mix(in srgb, var(--mw-accent) 55%, transparent); color: var(--mw-text); }
.mw-react.is-empty { display: none; }
.mw-msg-tools.is-picking .mw-react.is-empty { display: inline-flex; }
.mw-react__n:empty { display: none; }
.mw-msg-tools__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 10px;
  border: 0; border-radius: var(--mw-r-md); background: transparent; color: var(--mw-text-2);
  font-size: var(--mw-fs-xs); font-weight: 600; cursor: pointer;
  transition: background-color var(--mw-dur), color var(--mw-dur);
}
.mw-msg-tools__btn .mw-icon { width: 18px; height: 18px; }
.mw-msg-tools__btn:hover, .mw-msg-tools__btn[aria-expanded="true"] { background: var(--mw-accent-soft); color: var(--mw-text); }

/* --- saisie */
.mw-chat__composer { display: block; flex: none; padding: var(--mw-s-2) var(--mw-s-3) var(--mw-s-3); border-top: 1px solid var(--mw-line); background: var(--mw-surface); }
.mw-chat__row, .mw-chat__hint { display: none; }
.mw-js .mw-chat__row { display: flex; align-items: flex-end; gap: var(--mw-s-2); }
.mw-js .mw-chat__hint { display: flex; justify-content: space-between; gap: var(--mw-s-3); margin-top: 4px; font-size: var(--mw-fs-xs); color: var(--mw-text-2); }
.mw-chat__row .mw-textarea { flex: 1; min-height: 48px; max-height: 140px; resize: none; }
.mw-chat__send { flex: none; width: 48px; height: 48px; }
.mw-chat__nojs { font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-js .mw-chat__nojs { display: none; }
.mw-chat__count { flex: none; }
.mw-chat__locked { display: flex; align-items: center; flex-wrap: wrap; gap: var(--mw-s-2) var(--mw-s-3); margin: 0; font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-chat__locked .mw-icon { width: 18px; height: 18px; color: var(--mw-accent-2); flex: none; }
.mw-chat__locked > span { flex: 1; min-width: 12rem; }
.mw-chat__blockednote { flex: none; padding: var(--mw-s-3); border-top: 1px solid var(--mw-line); background: var(--mw-surface); }
.mw-chat__replybar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--mw-s-2);
  margin-bottom: var(--mw-s-2); padding: 2px 4px 2px var(--mw-s-3);
  border-left: 3px solid var(--mw-accent); border-radius: var(--mw-r-sm); background: var(--mw-accent-soft);
  font-size: var(--mw-fs-sm); color: var(--mw-text-2);
}
.mw-chat__replybar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-chat__replyclose { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--mw-text-2); cursor: pointer; }
.mw-chat__replyclose:hover { color: var(--mw-text); }
.mw-chat__replyclose .mw-icon { width: 18px; height: 18px; }

/* --- informations du salon (superposées sous 80rem, colonne dès 80rem) */
.mw-chat__infos { display: contents; }
.mw-chat__info { display: none; padding: var(--mw-s-4); overflow-y: auto; background: var(--mw-surface); border-left: 1px solid var(--mw-line); font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-chat[data-info="open"] .mw-chat__info:not([hidden]) {
  display: block; position: absolute; inset: 0 0 0 auto; z-index: 6; width: min(360px, 100%);
  box-shadow: var(--mw-shadow-2);
}
@media (min-width: 80rem) {
  .mw-chat[data-mw-chat="rooms"] .mw-chat__info:not([hidden]) { display: block; position: static; width: auto; box-shadow: none; background: var(--mw-bg-2); }
  .mw-chat__infoclose { display: none; }
}
.mw-chat__infohead { display: flex; align-items: center; justify-content: space-between; gap: var(--mw-s-2); margin-bottom: var(--mw-s-2); }
.mw-chat__infohead h3 { font-family: var(--mw-font-display); font-size: var(--mw-fs-md); font-weight: 700; letter-spacing: -.015em; color: var(--mw-text); }
.mw-chat__about { margin-bottom: var(--mw-s-3); }
.mw-chat__facts { display: grid; gap: var(--mw-s-2); margin-bottom: var(--mw-s-4); }
.mw-chat__facts > div { display: flex; flex-direction: column; gap: 2px; padding-bottom: var(--mw-s-2); border-bottom: 1px solid var(--mw-line); }
.mw-chat__facts dt { font-size: var(--mw-fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--mw-text-3); }
.mw-chat__facts dd { margin: 0; color: var(--mw-text); font-weight: 550; }
.mw-chat__infosub { margin: var(--mw-s-4) 0 var(--mw-s-2); font-size: var(--mw-fs-sm); font-weight: 650; color: var(--mw-text); }
ol.mw-chat__rules { list-style: decimal; display: grid; gap: var(--mw-s-2); margin: 0; padding-left: 1.3em; }
.mw-chat__blocked { display: grid; gap: var(--mw-s-1); }
.mw-chat__blockeditem { display: flex; align-items: center; justify-content: space-between; gap: var(--mw-s-2); color: var(--mw-text); }

/* --- modales de discussion */
.mw-chat-modal form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.mw-chat-modal .mw-modal__body { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: var(--mw-s-4); }
.mw-chat-reasons { border: 0; padding: 0; margin: 0; }
.mw-chat-reasons legend { padding: 0; margin-bottom: var(--mw-s-1); }

/* =============================================================================
   04. Journal Morgan
   ========================================================================== */
.mw-esp-journal-intro { margin-bottom: var(--mw-s-4); }
.mw-esp-jr-points { gap: var(--mw-s-3); }
.mw-esp-journal-view { margin-block: var(--mw-s-5); min-width: 0; }
.mw-esp-howto { margin-top: var(--mw-s-6); }
.mw-esp-howto .mw-esp-card__title { margin-bottom: var(--mw-s-3); }

/* =============================================================================
   05. Ressources imprimables
   ========================================================================== */
.mw-res-cards { display: grid; gap: var(--mw-s-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) { .mw-res-cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.mw-res-card {
  display: flex; align-items: center; gap: var(--mw-s-3); min-height: 72px; padding: var(--mw-s-3) var(--mw-s-4);
  border: 1px solid var(--mw-line); border-radius: var(--mw-r-md); background: var(--mw-surface);
  color: var(--mw-text); text-decoration: none;
  transition: border-color var(--mw-dur), transform var(--mw-dur) var(--mw-ease);
}
a.mw-res-card:hover { border-color: var(--mw-line-strong); transform: translateY(-2px); }
.mw-res-card--soon { border-style: dashed; background: transparent; color: var(--mw-text-2); }
.mw-res-card__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--mw-surface-2); border: 1px solid var(--mw-line); color: var(--mw-accent-2); }
.mw-res-card__icon .mw-icon { width: 20px; height: 20px; }
.mw-res-card__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mw-res-card__badge { font-size: var(--mw-fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--mw-text-2); }
.mw-res-card__title { font-weight: 650; line-height: 1.3; }
.mw-res-card__go { width: 18px; height: 18px; color: var(--mw-text-3); flex: none; }

.mw-res-sheet {
  margin-top: var(--mw-s-5); padding: var(--mw-s-4);
  border: 1px solid var(--mw-line); border-radius: var(--mw-r-lg);
  background: var(--mw-surface); color: var(--mw-text); box-shadow: var(--mw-shadow-1);
  min-width: 0;
}
@media (min-width: 48rem) { .mw-res-sheet { padding: var(--mw-s-6); } }
.mw-res-sheet__head { display: flex; flex-direction: column; gap: var(--mw-s-4); margin-bottom: var(--mw-s-4); }
@media (min-width: 64rem) { .mw-res-sheet__head { flex-direction: row; align-items: flex-start; justify-content: space-between; } }
.mw-res-sheet__head .mw-eyebrow { margin-bottom: var(--mw-s-2); }
.mw-res-sheet__title { font-family: var(--mw-font-display); font-size: var(--mw-fs-xl); font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.mw-res-sheet__lead { margin-top: var(--mw-s-2); color: var(--mw-text-2); max-width: 60ch; }
.mw-res-js { display: none; }
.mw-js .mw-res-js { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mw-s-2); flex: none; }
.mw-res-status { font-size: var(--mw-fs-xs); color: var(--mw-text-2); min-height: 1.2em; }
.mw-res-form > * + * { margin-top: var(--mw-s-4); }
.mw-res-group { border: 0; border-top: 1px solid var(--mw-line); margin: 0; padding: var(--mw-s-3) 0 0; min-width: 0; }
.mw-res-group > legend { padding: 0 var(--mw-s-2) 0 0; margin-bottom: var(--mw-s-2); font-family: var(--mw-font-display); font-size: var(--mw-fs-md); font-weight: 700; color: var(--mw-text); }
.mw-res-group > * + * { margin-top: var(--mw-s-3); }
.mw-res-grid { display: grid; gap: var(--mw-s-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) { .mw-res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 80rem) { .mw-res-grid--day { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mw-res-grid--week { max-width: 320px; grid-template-columns: minmax(0, 1fr); }
.mw-res-days { display: grid; gap: var(--mw-s-3); }
.mw-res-day { border: 1px solid var(--mw-line); border-radius: var(--mw-r-md); padding: var(--mw-s-2) var(--mw-s-4) var(--mw-s-4); }
.mw-res-day > legend { padding: 0 var(--mw-s-2); margin-left: calc(var(--mw-s-2) * -1); }
.mw-res-sheet__foot { margin-top: var(--mw-s-5); padding-top: var(--mw-s-3); border-top: 1px solid var(--mw-line); font-size: var(--mw-fs-xs); color: var(--mw-text-2); }
.mw-res-printhead { display: none; }
.mw-res-printval { display: none; }
.mw-res-localnote { display: flex; align-items: flex-start; gap: var(--mw-s-2); margin-top: var(--mw-s-5); font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-res-localnote .mw-icon { width: 18px; height: 18px; margin-top: 2px; color: var(--mw-accent-2); flex: none; }

/* =============================================================================
   06. Notifications
   ========================================================================== */
.mw-notifs { display: flex; flex-direction: column; gap: var(--mw-s-3); }
.mw-notifs [hidden] { display: none !important; }
.mw-notifs__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--mw-s-3); }
.mw-notifs__filters { display: flex; gap: var(--mw-s-2); }
.mw-notifs__count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: var(--mw-r-pill); background: var(--mw-accent); color: var(--mw-accent-ink); font-size: 11px; font-weight: 700; }
.mw-notifs__tools { display: flex; flex-wrap: wrap; gap: var(--mw-s-2); }
.mw-notifs__tools form { display: contents; }
.mw-notifs__summary { font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-notifs__summary:focus { outline: none; }
.mw-notifs__prefs { display: flex; align-items: flex-start; gap: var(--mw-s-2); font-size: var(--mw-fs-sm); color: var(--mw-text-2); }
.mw-notifs__prefs .mw-icon { width: 18px; height: 18px; margin-top: 2px; flex: none; color: var(--mw-accent-2); }
.mw-notif-list { display: flex; flex-direction: column; gap: var(--mw-s-2); }
.mw-notif {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--mw-s-2) var(--mw-s-3);
  padding: var(--mw-s-4); border: 1px solid var(--mw-line); border-radius: var(--mw-r-md); background: var(--mw-surface);
}
.mw-notif.is-unread { border-color: color-mix(in srgb, var(--mw-accent) 40%, var(--mw-line)); background: linear-gradient(90deg, var(--mw-accent-soft), transparent 60%), var(--mw-surface); }
.mw-notif.is-unread::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--mw-gradient); }
.mw-notif__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--mw-surface-2); border: 1px solid var(--mw-line); color: var(--mw-accent); }
.mw-notif__icon .mw-icon { width: 20px; height: 20px; }
.mw-notif--live .mw-notif__icon { color: var(--mw-live); }
.mw-notif--announce .mw-notif__icon, .mw-notif--system .mw-notif__icon { color: var(--mw-accent-2); }
.mw-notif__body { min-width: 0; }
.mw-notif__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mw-s-2); font-size: var(--mw-fs-xs); color: var(--mw-text-2); }
.mw-notif__status { display: inline-flex; align-items: center; }
.mw-notif__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mw-accent); }
.mw-notif__title { margin-top: 2px; font-family: var(--mw-font-body); font-size: var(--mw-fs-base); font-weight: 650; line-height: 1.35; letter-spacing: 0; }
.mw-notif__title a { display: inline-flex; align-items: center; min-height: 44px; color: var(--mw-text); text-decoration: none; }
.mw-notif__title a:hover { color: var(--mw-accent); text-decoration: underline; }
.mw-notif.is-read .mw-notif__title a { color: var(--mw-text-2); font-weight: 550; }
.mw-notif__text { color: var(--mw-text-2); font-size: var(--mw-fs-sm); max-width: 64ch; }
.mw-notif__form { grid-column: 2; }
@media (min-width: 48rem) {
  .mw-notif { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .mw-notif__form { grid-column: auto; align-self: center; }
}

/* =============================================================================
   07. Impression des ressources
   ========================================================================== */
@media print {
  .mw-noprint, .mw-esp-banner, .mw-res-nav, .mw-res-js, .mw-esp-risk, .mw-res-localnote,
  .mw-page-header, .mw-espace__subnav, .mw-skip { display: none !important; }
  html[data-mw-print] .mw-res-sheet:not(.is-print-target) { display: none !important; }
  .mw-espace { display: block; padding: 0; max-width: none; }
  .mw-res-sheet { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; break-after: page; }
  .mw-res-sheet:last-of-type { break-after: auto; }
  .mw-res-sheet__head { margin-bottom: var(--mw-s-3); }
  .mw-res-printhead { display: block; margin-bottom: var(--mw-s-3); font-size: var(--mw-fs-xs); color: var(--mw-text-2); }
  .mw-res-group, .mw-res-day { break-inside: avoid; }
  .mw-res-form .mw-input, .mw-res-form .mw-select, .mw-res-form .mw-textarea { background: transparent; box-shadow: none; border: 1px solid var(--mw-line-strong); border-radius: 4px; min-height: 36px; padding: 6px 8px; color: var(--mw-text); resize: none; }
  .mw-res-form .mw-textarea { min-height: 72px; }
  .mw-res-form .mw-select { background-image: none; }
  .mw-res-printval { display: block; white-space: pre-wrap; padding: 6px 8px; border: 1px solid var(--mw-line-strong); border-radius: 4px; color: var(--mw-text); font-size: var(--mw-fs-sm); }
  .mw-res-form textarea.is-mirrored { display: none; }
  .mw-res-form .mw-check input { border-color: var(--mw-text); }
}

/* =============================================================================
   08. Mouvement réduit
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .mw-esp-step__check, .mw-react, .mw-msg-tools__btn, .mw-chat__pinchev, .mw-res-card { transition: none; }
  a.mw-res-card:hover { transform: none; }
  .mw-chat__log { scroll-behavior: auto; }
}
