:root {
  --ivory: #fffaf5;
  --ivory-2: #f9f3ed;
  --nude: #e7d5c8;
  --nude-2: #d6b8a7;
  --powder: #f4dedf;
  --rose: #c98f95;
  --ink: #332b2a;
  --muted: #877976;
  --line: rgba(91, 70, 66, .12);
  --white: #fff;
  --danger: #a9444c;
  --shadow: 0 12px 40px rgba(83, 61, 57, .10);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ivory);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior-x: none; background: var(--ivory); }
body { touch-action: pan-y pinch-zoom; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
.hidden { display: none !important; }

#app { height: var(--app-height, 100dvh); max-height: var(--app-height, 100dvh); width:100%; overflow:hidden; }
.shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.topbar { padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 12px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,250,245,.93); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); z-index: 10; }
.topbar h1 { margin: 1px 0 0; font-size: 24px; letter-spacing: -.03em; }
.eyebrow, .sheet-header small { color: var(--rose); text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.top-actions { display: flex; gap: 8px; }
.icon-button { width: 42px; height: 42px; border-radius: 15px; background: var(--white); box-shadow: 0 4px 16px rgba(73,55,51,.07); font-size: 20px; }
.workspace { min-height: 0; overflow: hidden; }
.inbox-view, .chat-view { height: 100%; min-height: 0; }
.inbox-view { overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 120px; }
.filters { position: sticky; top: -14px; z-index: 4; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 14px 0 10px; background: linear-gradient(var(--ivory) 75%, rgba(255,250,245,0)); touch-action: pan-x; }
.filters::-webkit-scrollbar { display:none; }
.line-filters { display: contents; }
.filter { white-space: nowrap; border-radius: 999px; padding: 9px 13px; background: var(--white); border: 1px solid var(--line); color: var(--muted); }
.filter.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.filter .dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 7px; background: var(--line-color, var(--rose)); }

.inbox-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin: 4px 0 12px; }
.search-wrap { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 0 12px; }
.search-wrap input { min-width:0; width:100%; border:0; outline:0; background:transparent; padding: 12px 0; }
.soft-button { padding: 10px 13px; border-radius: 14px; background: var(--ivory-2); border: 1px solid var(--line); }
.soft-button.active { background: var(--powder); border-color: rgba(201,143,149,.35); }
.inbox-summary { color: var(--muted); font-size: 12px; margin: 0 5px 8px; }
.chat-list { display: grid; gap: 9px; }
.chat-card { position: relative; width: 100%; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 11px; align-items: center; text-align:left; padding: 13px; border-radius: 20px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 5px 18px rgba(75,56,53,.045); }
.avatar { width: 48px; height: 48px; border-radius: 17px; display:grid; place-items:center; background: color-mix(in srgb, var(--line-color) 18%, var(--ivory)); color: var(--line-color); font-weight:800; font-size:17px; }
.chat-main { min-width:0; }
.chat-row { display:flex; align-items:center; gap:7px; min-width:0; }
.chat-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; }
.line-chip { max-width: 45%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:3px 7px; border-radius:999px; color: var(--line-color); background: color-mix(in srgb, var(--line-color) 12%, white); font-size:10px; font-weight:800; }
.chat-preview { margin-top:5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:13px; }
.chat-side { align-self:stretch; display:flex; flex-direction:column; align-items:flex-end; justify-content:space-between; }
.chat-time { color: var(--muted); font-size:10px; }
.unread { min-width:21px; height:21px; padding:0 6px; border-radius:999px; display:grid; place-items:center; background: var(--line-color); color:#fff; font-size:11px; font-weight:800; }

.bottom-nav { padding: 8px 18px calc(8px + var(--safe-bottom)); display:grid; grid-template-columns:1fr 1fr; gap:8px; border-top:1px solid var(--line); background:rgba(255,250,245,.96); backdrop-filter:blur(18px); z-index:10; }
.nav-item { display:flex; justify-content:center; align-items:center; gap:7px; padding:9px; border-radius:14px; background:transparent; color:var(--muted); font-size:12px; font-weight:700; }
.nav-item.active { color:var(--ink); background:var(--powder); }

.chat-view {
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:0;
  overflow:hidden;
  background:linear-gradient(180deg, var(--ivory-2), var(--ivory));
}
.chat-header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:9px; align-items:center; padding:10px 12px; background:rgba(255,250,245,.95); border-bottom:1px solid var(--line); }
.chat-heading { min-width:0; display:flex; flex-direction:column; }
.chat-heading strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-heading span { margin-top:2px; color:var(--line-color, var(--rose)); font-size:11px; font-weight:800; }
.chat-action-bar { display:flex; justify-content:flex-end; gap:8px; padding:7px 12px; background:var(--white); border-bottom:1px solid var(--line); }
.chat-action-bar button { padding:7px 10px; border-radius:10px; background:var(--ivory-2); font-size:12px; }
.danger-text { color:var(--danger)!important; }
.messages {
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding:18px 12px 24px;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.date-separator { align-self:center; margin:9px 0; padding:5px 9px; border-radius:999px; background:rgba(255,255,255,.8); color:var(--muted); font-size:10px; border:1px solid var(--line); }
.message-wrap { max-width:86%; display:flex; flex-direction:column; gap:3px; }
.message-wrap.from-me { align-self:flex-end; }
.message-wrap.from-them { align-self:flex-start; }
.message { border-radius:18px; padding:9px 11px 7px; background:var(--white); box-shadow:0 3px 12px rgba(70,52,49,.06); overflow:hidden; }
.from-me .message { background: color-mix(in srgb, var(--line-color, var(--rose)) 18%, white); border-bottom-right-radius:6px; }
.from-them .message { border-bottom-left-radius:6px; }
.quoted { border-left:3px solid var(--line-color, var(--rose)); padding:5px 7px; margin-bottom:6px; background:rgba(255,255,255,.45); border-radius:8px; color:var(--muted); font-size:11px; }
.message-text { white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.38; }
.message-meta { display:flex; justify-content:flex-end; gap:5px; margin-top:4px; color:var(--muted); font-size:9px; }
.reactions { display:flex; flex-wrap:wrap; gap:3px; margin-top:4px; }
.reaction-pill { padding:2px 5px; border-radius:999px; background:rgba(255,255,255,.75); font-size:12px; border:1px solid var(--line); }
.msg-actions { display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; padding:2px 3px; touch-action:pan-x; }
.msg-actions button { flex:0 0 auto; padding:5px 7px; border-radius:9px; background:rgba(255,255,255,.72); border:1px solid var(--line); font-size:11px; }
.media-placeholder, .media-box { margin-top:6px; max-width:100%; }
.media-placeholder { padding:9px; border-radius:12px; background:rgba(255,255,255,.65); }
.media-box img, .media-box video { display:block; max-width:100%; max-height:52dvh; border-radius:12px; }
.media-box audio { width:250px; max-width:100%; }
.media-box a { color:var(--rose); font-weight:700; }

.reply-preview, .attachment-preview { margin:0 10px; padding:8px 10px; border:1px solid var(--line); background:var(--white); border-radius:13px 13px 0 0; }
.reply-preview { display:flex; justify-content:space-between; gap:8px; }
.reply-preview div { min-width:0; display:flex; flex-direction:column; }
.reply-preview small { color:var(--rose); font-weight:700; }
.reply-preview span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; }
.reply-preview button { background:transparent; font-size:20px; }
.attachment-preview { font-size:12px; color:var(--muted); }
.composer {
  position:relative;
  z-index:30;
  flex:0 0 auto;
  width:100%;
  min-width:0;
  padding:8px 10px calc(8px + var(--safe-bottom));
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto auto;
  gap:7px;
  align-items:end;
  background:rgba(255,250,245,.98);
  border-top:1px solid var(--line);
  box-shadow:0 -8px 24px rgba(83,61,57,.06);
}
.composer textarea {
  width:100%;
  min-width:0;
  resize:none;
  max-height:120px;
  border:1px solid var(--line);
  outline:none;
  border-radius:18px;
  padding:10px 12px;
  background:var(--white);
}
.composer-button { width:39px; height:39px; border-radius:14px; background:var(--ivory-2); }
.composer-button.recording { background:var(--danger); color:white; animation:pulse 1s infinite; }
.send-button, .primary { border-radius:14px; padding:10px 13px; background:var(--ink); color:white; font-weight:800; }
@keyframes pulse { 50% { opacity:.55; } }

.sheet-backdrop { position:fixed; inset:0; z-index:40; background:rgba(50,39,37,.28); backdrop-filter:blur(3px); }
.sheet { position:fixed; z-index:50; left:0; right:0; bottom:0; max-height:88dvh; overflow-y:auto; padding:8px 14px calc(20px + var(--safe-bottom)); background:var(--ivory); border-radius:28px 28px 0 0; box-shadow:0 -20px 50px rgba(50,38,36,.15); }
.sheet-handle { width:42px; height:5px; border-radius:999px; background:var(--nude); margin:2px auto 10px; }
.sheet-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.sheet-header h2 { margin:2px 0 0; font-size:22px; }
.new-line-form { display:grid; grid-template-columns:1fr auto; gap:8px; margin-bottom:13px; }
.new-line-form input, .connect-panel input, .login-card input { width:100%; border:1px solid var(--line); border-radius:14px; background:white; outline:none; padding:11px 12px; }
.line-cards { display:grid; gap:9px; }
.line-card { --line-color: var(--rose); padding:13px; border-radius:19px; background:white; border:1px solid var(--line); border-left:5px solid var(--line-color); }
.line-card-top { display:flex; justify-content:space-between; gap:10px; }
.line-card h3 { margin:0; font-size:16px; }
.status { font-size:10px; font-weight:800; padding:4px 7px; border-radius:999px; background:var(--ivory-2); }
.status.online { color:#397459; background:#e8f4ec; }
.line-info { margin:8px 0; display:grid; gap:3px; color:var(--muted); font-size:12px; }
.line-actions { display:flex; flex-wrap:wrap; gap:6px; }
.line-actions button { padding:7px 9px; border-radius:10px; background:var(--ivory-2); font-size:11px; }
.connect-tabs { display:flex; gap:7px; margin-bottom:12px; }
.connect-panel { display:grid; gap:12px; }
.connect-panel label { display:grid; gap:6px; }
.qr-image { width:min(320px, 90vw); aspect-ratio:1; object-fit:contain; background:white; padding:8px; border-radius:18px; justify-self:center; }
.pairing-code { min-height:52px; display:grid; place-items:center; font-size:28px; letter-spacing:.12em; font-weight:900; background:white; border-radius:16px; }

.login-view { min-height:100dvh; display:grid; place-items:center; padding:24px; background:radial-gradient(circle at 80% 10%, var(--powder), transparent 33%), radial-gradient(circle at 10% 75%, var(--nude), transparent 30%), var(--ivory); }
.login-card { width:min(390px,100%); display:grid; gap:13px; padding:25px; border-radius:26px; background:rgba(255,255,255,.88); box-shadow:var(--shadow); }
.brand-mark { width:54px; height:54px; display:grid; place-items:center; border-radius:18px; background:linear-gradient(145deg,var(--rose),var(--nude-2)); color:white; font-size:25px; font-weight:900; }
.login-card h1 { margin:0; }
.login-card p { margin:-6px 0 4px; color:var(--muted); }
.login-card label { display:grid; gap:5px; font-size:12px; font-weight:700; }
.form-error { min-height:16px; color:var(--danger); font-size:12px; }

.toast { position:fixed; z-index:80; left:50%; bottom:calc(84px + var(--safe-bottom)); transform:translateX(-50%); max-width:90vw; padding:10px 14px; border-radius:13px; color:white; background:var(--ink); box-shadow:var(--shadow); font-size:12px; }
.empty-state { text-align:center; color:var(--muted); padding:35px 15px; }

@media (min-width: 780px) {
  #app { max-width:980px; margin:0 auto; box-shadow:0 0 60px rgba(65,49,46,.08); }
  .chat-card { padding:15px; }
  .message-wrap { max-width:68%; }
}


/* Parité fonctionnelle avec la version Azure validée. */
.quoted { width:100%; max-width:100%; min-width:0; border:0; text-align:left; cursor:pointer; overflow:hidden; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; }
.message-highlight .message { outline:3px solid color-mix(in srgb, var(--line-color, var(--rose)) 55%, transparent); transition:outline-color .8s ease; }
.media-clickable { cursor:zoom-in; }
.connect-status, .form-status { min-height:18px; color:var(--muted); font-size:12px; line-height:1.4; }
.success-text { color:#397459 !important; font-weight:700; }
.settings-section { display:grid; gap:10px; margin:12px 0; padding:14px; background:var(--white); border:1px solid var(--line); border-radius:18px; }
.settings-section h3 { margin:0 0 2px; font-size:15px; }
.settings-row { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.password-form label { display:grid; gap:6px; font-size:12px; font-weight:700; }
.password-form input { width:100%; border:1px solid var(--line); border-radius:14px; background:white; outline:none; padding:11px 12px; }
.settings-logout { width:100%; margin-top:6px; }
.media-viewer { position:fixed; inset:0; z-index:120; display:grid; place-items:center; padding:24px; background:rgba(25,20,20,.92); }
.media-viewer-content { max-width:min(1100px,96vw); max-height:92dvh; display:grid; place-items:center; }
.media-viewer-content img, .media-viewer-content video { max-width:100%; max-height:90dvh; object-fit:contain; border-radius:14px; }
.media-viewer-close { position:absolute; top:calc(12px + env(safe-area-inset-top,0px)); right:14px; width:44px; height:44px; border-radius:50%; background:rgba(255,255,255,.92); font-size:26px; }


/* Citations médias et réactions : parité avec le POC Azure. */
.quoted { box-sizing:border-box; white-space:normal; overflow-wrap:anywhere; word-break:break-word; }
.quotedAuthor { display:block; max-width:100%; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--rose); font-size:10px; font-weight:800; margin-bottom:4px; }
.quotedText { display:-webkit-box !important; max-width:100%; min-width:0; overflow:hidden !important; white-space:normal !important; overflow-wrap:anywhere; word-break:break-word; text-overflow:ellipsis; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; line-height:1.3; }
.quotedMediaImageLink { display:block; width:fit-content; max-width:100%; min-width:0; overflow:hidden; }
.quotedMediaImage { display:block; width:min(180px,100%) !important; max-width:100% !important; height:auto !important; border-radius:9px; }
.quotedMediaVideo { width:100% !important; max-width:220px !important; min-width:0 !important; border-radius:9px; }
.quotedMediaAudio { width:100% !important; max-width:250px !important; min-width:0 !important; }
.quotedMediaDocument, .quotedMediaKind { box-sizing:border-box; max-width:100%; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reaction-pill.mine { box-shadow:inset 0 0 0 1px var(--line-color, var(--rose)); }
.reaction-pill > span { margin-left:3px; font-size:10px; font-weight:800; }


/* Rendu média direct et accusés détaillés : parité Azure. */
.message-image-link { display:block; text-decoration:none; max-width:100%; }
.message-image { display:block; width:min(320px,76vw); max-width:100%; max-height:52dvh; object-fit:contain; border-radius:10px; cursor:zoom-in; }
.message-video { display:block; width:min(320px,76vw); max-width:100%; max-height:420px; border-radius:8px; background:#000; }
.message-audio { display:block; width:min(300px,72vw); max-width:100%; height:38px; margin:2px; }
.message-caption { margin-top:6px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.38; }
.document-card { display:flex; align-items:center; gap:10px; width:min(300px,70vw); max-width:100%; padding:10px; border-radius:9px; background:rgba(0,0,0,.05); color:inherit; text-decoration:none; }
.document-icon { flex:0 0 auto; width:42px; height:42px; display:grid; place-items:center; border-radius:8px; background:rgba(255,255,255,.75); font-size:11px; font-weight:800; }
.document-info { min-width:0; display:flex; flex-direction:column; }
.document-name { font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.document-type { margin-top:3px; font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.message-ack { display:inline-block; min-width:12px; font-weight:800; }
.message-ack.read { color:#4d8fc9; }


/* Sélecteur de pièces jointes final du POC Azure, adapté au thème production. */
.attachment-sheet {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(76px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 20px), 680px);
  display: grid;
  gap: 3px;
  padding: 8px;
  background: rgba(255,250,245,.98);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(50,38,36,.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.attachment-action {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--white);
  text-align: left;
  font-size: 15px;
}
.attachment-action:active { transform: scale(.98); background: var(--ivory-2); }
.attachment-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--ivory-2);
  font-size: 18px;
}
.attachment-preview {
  position: fixed;
  z-index: 55;
  left: 50%;
  bottom: calc(76px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 20px), 680px);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(50,38,36,.14);
}
.attachment-preview-visual {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ivory-2);
  font-size: 24px;
}
.attachment-preview-visual img,
.attachment-preview-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attachment-preview-info { flex: 1; min-width: 0; }
.attachment-preview-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-preview-size { margin-top: 3px; color: var(--muted); font-size: 12px; }
.remove-attachment {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: var(--ivory-2);
  font-size: 21px;
}


/* Actions messages finales du POC Azure : footer compact + bottom sheet tactile. */
.message { position:relative; }
.message-footer {
  display:flex;
  align-items:center;
  gap:5px;
  min-height:28px;
  margin-top:7px;
  padding-top:5px;
  border-top:1px solid rgba(0,0,0,.10);
  white-space:normal;
}
.message-reactions-host {
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
}
.message-reactions-host:empty { display:block; }
.message-footer .reactions { margin-top:0; align-items:center; gap:3px; }
.message-action-button {
  position:static;
  flex:0 0 25px;
  width:25px;
  height:25px;
  padding:0;
  margin:0;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:50%;
  background:rgba(255,255,255,.78);
  color:var(--muted);
  font-size:16px;
  font-weight:800;
  line-height:1;
}
.message-action-button:active { transform:scale(.92); }
.message-footer .message-meta {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:3px;
  margin:0;
  padding:0;
  white-space:nowrap;
}
.message-action-backdrop {
  position:fixed;
  z-index:130;
  inset:0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:12px 12px calc(12px + var(--safe-bottom));
  background:rgba(36,27,26,.30);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
}
.message-action-sheet {
  width:min(100%,520px);
  padding:12px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--ivory);
  box-shadow:0 24px 60px rgba(50,38,36,.22);
  animation:message-sheet-in .20s cubic-bezier(.2,.8,.2,1);
}
.message-action-preview {
  overflow:hidden;
  margin:0 2px 10px;
  color:var(--muted);
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}
.reaction-picker {
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:6px;
  margin-bottom:10px;
}
.reaction-picker button {
  min-width:0;
  height:44px;
  padding:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--white);
  font-size:23px;
  transition:transform .13s ease,background .13s ease,border-color .13s ease;
}
.reaction-picker button.active {
  border-color:var(--line-color,var(--rose));
  background:var(--powder);
}
.reaction-picker button:active { transform:scale(.86); }
.message-action-buttons { display:grid; gap:7px; }
.message-action-buttons button {
  min-height:44px;
  border-radius:12px;
  background:var(--white);
  border:1px solid var(--line);
  font-weight:700;
}
@keyframes message-sheet-in {
  from { opacity:0; transform:translateY(12px) scale(.985); }
  to { opacity:1; transform:translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .message-action-sheet,
  .reaction-picker button,
  .message-action-button { animation:none!important; transition:none!important; }
}


/* Une conversation remplace entièrement la navigation globale sur mobile et bureau. */
.shell.chat-open {
  grid-template-rows: minmax(0, 1fr);
}
.shell.chat-open > .topbar,
.shell.chat-open > .bottom-nav {
  display: none;
}
.shell.chat-open > .workspace,
.shell.chat-open .chat-view {
  height:100%;
  min-height:0;
}
.shell.chat-open > .workspace {
  overflow:hidden;
}
.shell.chat-open .chat-header,
.shell.chat-open .chat-action-bar,
.shell.chat-open .reply-preview,
.shell.chat-open .attachment-preview,
.shell.chat-open .composer {
  flex:0 0 auto;
}
.shell.chat-open .attachment-preview {
  position:static;
  left:auto;
  bottom:auto;
  transform:none;
  width:auto;
  margin:0 10px;
}
.shell.chat-open .attachment-sheet {
  bottom:calc(66px + var(--safe-bottom));
}
@media (max-width: 420px) {
  .composer {
    grid-template-columns:38px minmax(0,1fr) 38px auto;
    gap:5px;
    padding-left:7px;
    padding-right:7px;
  }
  .composer-button {
    width:38px;
    height:38px;
  }
  .send-button {
    padding-left:10px;
    padding-right:10px;
  }
}


/* Enregistreur vocal : comportement validé sur Azure. */
.voice-recorder-bar {
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  background:var(--white);
  border-top:1px solid var(--line);
}
.voice-recording-status {
  min-width:0;
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--danger);
  font-size:12px;
  font-weight:800;
}
.voice-recording-dot {
  width:9px;
  height:9px;
  flex:0 0 9px;
  border-radius:50%;
  background:var(--danger);
  animation:pulse 1s infinite;
}
.voice-timer {
  min-width:42px;
  font-variant-numeric:tabular-nums;
  color:var(--ink);
}
.voice-recorder-actions {
  display:flex;
  gap:7px;
  align-items:center;
}
.voice-recorder-actions button {
  min-height:38px;
  padding:8px 11px;
}
.attachment-preview-visual.voice-audio-preview {
  width:min(280px,62vw);
  height:auto;
  min-height:48px;
  overflow:visible;
  background:transparent;
}
.attachment-preview-visual.voice-audio-preview audio {
  width:100%;
  max-width:100%;
  height:40px;
}
@media (max-width:420px) {
  .voice-recorder-bar {
    gap:6px;
    padding-left:7px;
    padding-right:7px;
  }
  .voice-recording-status {
    gap:5px;
    font-size:11px;
  }
  .voice-recorder-actions {
    gap:4px;
  }
  .voice-recorder-actions button {
    padding-left:8px;
    padding-right:8px;
    font-size:12px;
  }
}