/* Discussion bleu ciel : en-tête encre, cartes et composeur unifiés. */
:is(#adminSupportSection,#clientSupportChat) .support-chat-messages {
  background-color:#d8eefb;
  background-image:linear-gradient(#eef8ffb3,#e0f1fbb3),url("assets/chat-wallpaper.svg"),linear-gradient(145deg,#edf8ff,#cbe8f8);
  background-size:100% 100%,520px 520px,100% 100%;
  scrollbar-color:#91bbd3 transparent;
  gap:12px;
}
:is(#adminSupportSection,#clientSupportChat) .support-chat-heading {
  background:linear-gradient(115deg,#0f2c44,#174b6c);
  border-bottom:1px solid #80c6ee66;
  box-shadow:0 3px 18px #123b5415;
}
#supportView.floating-client-chat .support-chat-heading { background:linear-gradient(115deg,#0f2c44,#174b6c); border-bottom-color:#80c6ee66; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-title { letter-spacing:-.025em; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-mark { box-shadow:0 0 0 3px #ffffff0a; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble { color:#14374d; background:#f7fcff; border:1px solid #fff; border-radius:7px 21px 21px 21px; padding:12px 14px 9px; box-shadow:0 3px 12px #2f648010; }
:is(#adminSupportSection,#clientSupportChat) .mine .support-chat-bubble { color:#103953; background-color:#b0dafa; background-image:linear-gradient(135deg,#ffffff61,#ffffff20); border-color:#9ac7e3; border-radius:21px 7px 21px 21px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-body { color:inherit; line-height:1.65; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-meta { color:#466c83; font-size:10px; }
:is(#adminSupportSection,#clientSupportChat) .support-copy-success { color:#176850; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options button:hover { background:#dfedf7; }
:is(#adminSupportSection,#clientSupportChat) .support-delivery-status { color:#416d89; }
:is(#adminSupportSection,#clientSupportChat) .support-delivery-status.is-read { color:#09658e; }
:is(#adminSupportSection,#clientSupportChat) .support-day-divider span { color:#456a80; border:1px solid #ffffffc9; background:#f7fcffe6; border-radius:20px; padding:6px 14px; box-shadow:0 2px 8px #245e8308; font-size:10px; font-weight:700; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options summary { color:#32617e; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options > div { border-color:#bdd7e7; background:#f4fbff; box-shadow:0 8px 24px #123c5822; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options button { color:#174667; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-empty { color:#385d73; border-color:#ffffffc9; background:#f0f9ffed; border-radius:22px; box-shadow:0 8px 24px #245e830a; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-empty strong { color:#1a4c6d; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-form { background:#f7fcff; border-top:1px solid #bad6e766; box-shadow:0 -6px 24px #245e8308; }
:is(#clientSupportMessageForm,#adminSupportMessageForm).support-chat-form.chat-media-form {
  grid-template-columns:44px minmax(0,1fr) 44px 50px; gap:4px; align-items:end; padding:12px 10px;
}
:is(#clientSupportMessageForm,#adminSupportMessageForm).chat-media-form > textarea { order:2; width:100%; box-sizing:border-box; padding:13px 6px; min-height:50px; border:0; border-radius:0; background:transparent; color:#173b54; box-shadow:none; }
:is(#clientSupportMessageForm,#adminSupportMessageForm).chat-media-form > textarea:focus { box-shadow:inset 0 -2px #78b8df; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-form textarea::placeholder { color:#6b879c; }
:is(#clientSupportMessageForm,#adminSupportMessageForm).chat-media-form > button[type=submit] { order:4; width:50px; min-width:50px; height:50px; min-height:50px; margin:0; color:#fff; background:linear-gradient(140deg,#299bd6,#14629e); border:1px solid #1f80bb; box-shadow:0 4px 12px #197bb632,inset 0 1px #ffffff40; }
.chat-media-tool { display:grid; place-items:center; box-sizing:border-box; width:44px; min-height:50px; padding:10px; border:0; border-radius:50%; background:transparent; color:#3b759b; cursor:pointer; transition:background .18s,color .18s; }
.chat-media-tool:hover { color:#12679e; background:#e3f1fb; }
.chat-media-tool svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.chat-media-attach { order:1; }
.chat-media-mic { order:3; }
.chat-media-tool.recording { color:#b52846; background:#ffe7ec; box-shadow:inset 0 0 0 1px #ecb3c0; }
.chat-media-tool.recording svg { fill:#b5284615; }
.chat-media-tool:disabled { opacity:.5; cursor:wait; }
.chat-media-tool:focus-visible,.chat-media-remove:focus-visible,.chat-media-link:focus-visible { outline:2px solid #196a9d; outline-offset:2px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-feedback:not(:empty) { padding:9px 16px; color:#365f78; background:#eef7fd; font-size:11px; border-top:1px solid #d4e7f3; }
.chat-media-preview { order:0; grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; gap:10px; min-width:0; margin:0 2px 8px; padding:13px; border:1px solid #c1deef; border-left:3px solid #379bd1; border-radius:16px; color:#164d6e; background:linear-gradient(120deg,#eaf6ff,#f7fcff); font-size:12px; line-height:1.5; box-shadow:0 3px 10px #245e8308; }
.chat-media-caption { flex:1; min-width:100px; overflow-wrap:anywhere; font-weight:700; }
.chat-media-preview audio { width:100%; height:42px; min-width:0; color-scheme:light; }
.chat-media-remove,.chat-media-retry { min-height:42px; padding:8px 12px; border:1px solid #c7dce9; border-radius:12px; background:#fff; color:#285f80; font:inherit; font-weight:700; cursor:pointer; }
.chat-media-remove { color:#9e4054; border-color:#ead0d7; }
.chat-media-message { display:grid; gap:10px; min-width:0; max-width:100%; width:252px; padding:3px 0; }
.chat-media-heading { display:flex; align-items:center; gap:10px; min-width:0; }
.chat-media-file-icon { display:grid; place-items:center; width:40px; height:44px; flex:0 0 40px; border:1px solid #ffffffb3; border-radius:13px; color:#196899; background:linear-gradient(145deg,#ffffffcc,#ecf8ff80); box-shadow:0 2px 5px #316e9410; }
.chat-media-file-icon svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.is-audio .chat-media-file-icon { border-radius:50%; height:40px; background:#197cad; color:#fff; border-color:#58a6d1; }
.chat-media-file-copy { min-width:0; display:grid; gap:3px; }
.chat-media-file-copy strong { color:inherit; font-size:12px; line-height:1.5; font-weight:800; overflow-wrap:anywhere; }
.chat-media-file-copy small { color:#4d738c; font-size:10px; font-weight:600; letter-spacing:.02em; }
.chat-media-message audio { display:block; width:100%; max-width:100%; min-width:0; height:44px; border:1px solid #ffffffb3; border-radius:24px; background:#edf7fd; color-scheme:light; }
.chat-media-message audio::-webkit-media-controls-panel,.chat-media-preview audio::-webkit-media-controls-panel { background:#edf7fd; }
.chat-media-message audio::-webkit-media-controls-volume-slider,.chat-media-message audio::-webkit-media-controls-mute-button { display:none; }
.chat-media-link { display:flex; align-items:center; justify-content:center; gap:6px; min-height:42px; max-width:100%; padding:7px 12px; box-sizing:border-box; border:1px solid #ffffffc9; border-radius:12px; color:#185d89; background:#f3faffb3; font-size:11px; line-height:1.5; font-weight:800; overflow-wrap:anywhere; text-decoration:none; }
.chat-media-link:hover { background:#fff; border-color:#a6cde5; }
.is-audio .chat-media-link { justify-content:flex-start; padding:0 2px; min-height:30px; background:none; border:0; color:#396e90; font-size:10px; font-weight:600; }
.chat-media-link:has(img) { display:block; padding:5px; text-align:center; }
.chat-media-link img { display:block; max-width:100%; max-height:260px; margin:0 auto 7px; border-radius:9px; object-fit:contain; }
.chat-media-load { font-size:11px; color:#3e6984; }
.chat-media-load:empty { display:none; }
@media(max-width:360px) {
  :is(#clientSupportMessageForm,#adminSupportMessageForm).support-chat-form.chat-media-form { gap:2px; padding:10px 6px; }
  .chat-media-message { width:230px; }
}
@media(prefers-reduced-motion:reduce) { .chat-media-tool { transition:none; } }

/* Bulles compactes : le contenu détermine la taille, métadonnées sur une ligne. */
:is(#adminSupportSection,#clientSupportChat) .support-chat-messages { gap:6px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble {
  width:fit-content; min-width:0; max-width:min(84%,440px); padding:7px 10px 4px;
  border-radius:5px 15px 15px 15px; box-shadow:0 1px 3px #245e8310;
}
:is(#adminSupportSection,#clientSupportChat) .mine .support-chat-bubble { border-radius:15px 5px 15px 15px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-body { font-size:14px; line-height:1.42; }
:is(#adminSupportSection,#clientSupportChat) .support-message-footer { gap:8px; min-height:20px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-meta { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:4px; margin:0; font-size:9px; line-height:1.2; }
:is(#adminSupportSection,#clientSupportChat) .support-delivery-status { display:inline; margin:0; font-size:9px; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options summary { width:24px; height:24px; font-size:16px; border-radius:7px; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options > div { bottom:26px; }
:is(#adminSupportSection,#clientSupportChat) .support-day-divider { margin:4px 0 6px; }
:is(#adminSupportSection,#clientSupportChat) .support-day-divider span { padding:4px 10px; }
.chat-media-message { width:232px; gap:6px; padding:1px 0; }
.chat-media-heading { gap:8px; }
.chat-media-file-icon { width:30px; height:34px; flex-basis:30px; border-radius:9px; }
.chat-media-file-icon svg { width:19px; height:19px; }
.chat-media-file-copy { gap:1px; }
.chat-media-file-copy strong { font-size:12px; line-height:1.35; }
.chat-media-link { min-height:30px; padding:4px 8px; border-radius:8px; font-size:10px; }
.chat-media-message.is-audio { position:relative; }
.chat-media-message.is-audio.chat-audio-ready { grid-template-columns:minmax(0,1fr) 24px; align-items:center; gap:4px; }
.chat-audio-ready > .chat-media-heading,.chat-audio-ready > audio { display:none; }
.chat-audio-ready > .chat-media-load { grid-column:1/-1; }
.chat-audio-player { display:grid; grid-template-columns:36px minmax(0,1fr); align-items:center; gap:8px; min-width:0; min-height:43px; }
.chat-audio-play { display:grid; place-items:center; width:36px; height:36px; min-height:36px; padding:8px; border:0; border-radius:50%; background:#237eaf; color:#fff; cursor:pointer; }
.chat-audio-play svg { width:20px; height:20px; fill:currentColor; }
.audio-pause-symbol,.is-playing .audio-play-symbol { display:none; }
.is-playing .audio-pause-symbol { display:block; }
.chat-audio-track { display:grid; gap:2px; min-width:0; }
.chat-audio-track input[type=range] { -webkit-appearance:none; appearance:none; box-sizing:border-box; width:100%; min-width:0; height:24px; min-height:24px; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; background:transparent; cursor:pointer; accent-color:#247fae; }
.chat-audio-track input::-webkit-slider-runnable-track { height:3px; border-radius:4px; background:linear-gradient(to right,#247fae var(--audio-progress,0%),#78a9c5 var(--audio-progress,0%)); }
.chat-audio-track input::-moz-range-track { height:3px; border-radius:4px; background:#78a9c5; }
.chat-audio-track input::-moz-range-progress { height:3px; background:#247fae; }
.chat-audio-track input::-webkit-slider-thumb { -webkit-appearance:none; width:10px; height:10px; margin-top:-3.5px; border:0; border-radius:50%; background:#247fae; }
.chat-audio-track input::-moz-range-thumb { width:10px; height:10px; border:0; border-radius:50%; background:#247fae; }
.chat-audio-track input:disabled { cursor:default; opacity:.65; }
.chat-audio-track output { color:#466c83; font-size:9px; line-height:1; font-variant-numeric:tabular-nums; }
.is-audio .chat-media-link { display:grid; place-items:center; width:24px; height:30px; min-height:30px; padding:3px; border:0; background:transparent; }
.is-audio .chat-media-link svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.chat-audio-play:hover { background:#1b6c9b; }
.chat-audio-play:focus-visible,.chat-audio-track input:focus-visible { outline:2px solid #196a9d; outline-offset:2px; }
@media(max-width:360px) { .chat-media-message { width:216px; } }

/* La commande d’options ne crée plus de ligne ni de largeur dans le message. */
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble { position:relative; max-width:min(calc(100% - 48px),440px); padding:6px 9px 4px; border-radius:5px 13px 13px 13px; }
:is(#adminSupportSection,#clientSupportChat) .mine .support-chat-bubble { border-radius:13px 5px 13px 13px; }
:is(#adminSupportSection,#clientSupportChat) .support-message-footer { justify-content:flex-end; min-height:12px; margin-top:2px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-meta { line-height:12px; gap:4px; }
:is(#adminSupportSection,#clientSupportChat) .support-delivery-status { display:inline-flex; gap:0; font-size:10px; letter-spacing:-1px; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options { position:absolute; right:calc(100% + 3px); bottom:50%; transform:translateY(50%); z-index:2; }
:is(#adminSupportSection,#clientSupportChat) .theirs .support-message-options { left:calc(100% + 3px); right:auto; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options summary { width:24px; height:28px; color:#547f99; background:transparent; }
.support-message-options summary svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options > div { bottom:28px; left:0; }
:is(#adminSupportSection,#clientSupportChat) .theirs .support-message-options > div { left:auto; right:0; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble:has(.support-message-options[open]) { z-index:4; }
@media(hover:hover) {
  :is(#adminSupportSection,#clientSupportChat) .support-message-options:not([open]) summary { opacity:0; }
  :is(#adminSupportSection,#clientSupportChat) .support-chat-bubble:hover .support-message-options summary,
  :is(#adminSupportSection,#clientSupportChat) .support-chat-bubble:focus-within .support-message-options summary { opacity:1; }
}
.chat-media-message.is-audio { width:208px; gap:2px; padding:0; }
.chat-media-message.is-audio.chat-audio-ready { grid-template-columns:minmax(0,1fr) 20px; }
.chat-audio-player { grid-template-columns:32px minmax(0,1fr); min-height:36px; gap:7px; }
.chat-audio-play { width:32px; height:32px; min-height:32px; padding:7px; }
.chat-audio-play svg { width:18px; height:18px; }
.chat-audio-track { gap:0; }
.is-audio .chat-media-link { width:20px; height:28px; min-height:28px; padding:2px; }
.is-audio .chat-media-link svg { width:15px; height:15px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble.voice-only { padding:6px 9px 13px; }
/* Le menu reste ancré à la bulle, pas au pied de page superposé du vocal. */
:is(#adminSupportSection,#clientSupportChat) .voice-only .support-message-footer { position:static; height:0; min-height:0; margin:0; }
:is(#adminSupportSection,#clientSupportChat) .voice-only .support-chat-meta { position:absolute; bottom:2px; right:9px; }
:is(#adminSupportSection,#clientSupportChat) .voice-only .support-message-options { position:absolute; bottom:50%; top:auto; transform:translateY(50%); }
@media(max-width:360px) { .chat-media-message.is-audio { width:198px; } }


/* Format rectangulaire, sans titre au-dessus des vocaux. */
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble,
:is(#adminSupportSection,#clientSupportChat) .mine .support-chat-bubble { border-radius:12px; padding:4px 7px 3px; box-shadow:0 1px 2px #245e830c; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-body { line-height:1.35; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-messages { gap:5px; }
:is(#adminSupportSection,#clientSupportChat) .support-message-footer { margin-top:1px; }
.chat-media-message { width:210px; gap:4px; }
.chat-media-file-icon { width:28px; flex-basis:28px; height:30px; border-radius:4px; }
.chat-media-link { border-radius:4px; }
.chat-media-message.is-audio { width:184px; }
.chat-audio-player { grid-template-columns:30px minmax(0,1fr); min-height:30px; gap:6px; }
.chat-audio-play { width:30px; height:30px; min-height:30px; padding:6px; }
.chat-audio-track { grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:5px; }
.chat-audio-track output { min-width:22px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble.voice-only { padding:4px 7px 11px; }
:is(#adminSupportSection,#clientSupportChat) .voice-only .support-chat-meta { right:7px; bottom:1px; }
@media(max-width:360px) {
  .chat-media-message { width:198px; }
  .chat-media-message.is-audio { width:176px; }
}

/* Le vocal préchargé occupe toute la largeur, sans bouton de téléchargement. */
.chat-media-message.is-audio.chat-audio-ready { grid-template-columns:minmax(0,1fr); }


/* Reçus discrets ; options au geste, sans commande à côté des bulles. */
:is(#adminSupportSection,#clientSupportChat) .support-delivery-status { font-size:7px; line-height:1; letter-spacing:-1px; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble { -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble:focus-visible { outline:2px solid #438eb8; outline-offset:2px; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options summary { display:none; }
:is(#adminSupportSection,#clientSupportChat) .support-chat-bubble .support-message-options { position:absolute; top:auto; bottom:calc(100% + 4px); right:0; left:auto; transform:none; z-index:6; }
:is(#adminSupportSection,#clientSupportChat) .theirs .support-chat-bubble .support-message-options { left:0; right:auto; }
:is(#adminSupportSection,#clientSupportChat) .support-message-options > div { position:static; width:145px; }

/* Motif décoratif en zigzag ; la couleur suit la position réelle de lecture. */
.chat-audio-track {
  --voice-wave:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='18' viewBox='0 0 48 18'%3E%3Cpath d='M0 9L3 6L6 12L9 3L12 15L15 7L18 11L21 4L24 14L27 1L30 17L33 5L36 13L39 7L42 11L45 4L48 9' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.chat-audio-track input::-webkit-slider-runnable-track {
  height:18px; border-radius:0;
  background:linear-gradient(to right,#247fae var(--audio-progress,0%),#78a9c5 var(--audio-progress,0%));
  -webkit-mask-image:var(--voice-wave); mask-image:var(--voice-wave);
  -webkit-mask-size:48px 18px; mask-size:48px 18px;
  -webkit-mask-repeat:repeat-x; mask-repeat:repeat-x;
}
.chat-audio-track input::-moz-range-track {
  height:18px; border-radius:0;
  background:linear-gradient(to right,#247fae var(--audio-progress,0%),#78a9c5 var(--audio-progress,0%));
  mask-image:var(--voice-wave); mask-size:48px 18px; mask-repeat:repeat-x;
}
.chat-audio-track input::-moz-range-progress { height:18px; background:transparent; }
.chat-audio-track input::-webkit-slider-thumb { width:5px; height:5px; margin-top:6.5px; }
.chat-audio-track input::-moz-range-thumb { width:5px; height:5px; }
