/* DChan Studio Messenger v8386 — isolated, mobile-first personalization. */
.dm-banner-v8386{--dm-tone:#4faee8;min-height:112px;position:relative;overflow:hidden;margin:0 0 12px;border:1px solid rgba(134,187,235,.5);border-radius:20px;background:linear-gradient(125deg,#0c385c,#162951 54%,#173d50);background-size:cover;background-position:center;box-shadow:0 13px 24px #010a1e42}
.dm-banner-v8386[data-theme="midnight"]{--dm-tone:#a8b5f1;background-color:#10152d;background-image:linear-gradient(120deg,#08172e,#313756 55%,#081725)}
.dm-banner-v8386[data-theme="champagne"]{--dm-tone:#f1cd82;background-color:#332b23;background-image:linear-gradient(120deg,#2f2b24,#75583d 60%,#1d2944)}
.dm-banner-v8386[data-theme="ocean"]{--dm-tone:#73d9ed}
.dm-banner-v8386 .dm-banner-content-v8386{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:space-between;gap:10px;padding:15px;background:linear-gradient(0deg,rgba(3,13,30,.9),rgba(3,13,30,.14) 80%)}
.dm-banner-v8386 strong{display:block;color:#fff;font-size:16px;font-weight:850;text-shadow:0 2px 6px #061222}
.dm-banner-v8386 small{display:block;margin-top:3px;color:#e1efff;font-size:11px}
.dm-banner-v8386 .dm-edit-v8386{width:auto!important;min-height:38px!important;padding:7px 11px!important;margin:0!important;background:#0b2342dd!important;border:1px solid #8bc9f4!important;border-radius:11px;font-size:12px!important;box-shadow:none!important;flex:0 0 auto}
.dm-appearance-v8386{margin:0 0 11px;border:1px solid #355574;background:#0b1b2e;border-radius:15px;overflow:hidden}
.dm-appearance-v8386[hidden]{display:none}
.dm-appearance-v8386 summary{font-size:12px;font-weight:800;cursor:pointer;padding:12px;color:#d7eaff;list-style:none}
.dm-appearance-v8386 summary::-webkit-details-marker{display:none}
.dm-appearance-v8386 summary::before{content:"⚙";margin-right:8px;color:#9dd9ff}
.dm-fields-v8386{padding:4px 12px 13px;display:grid;gap:11px}
.dm-fields-v8386 label{margin:0!important;font-size:12px!important;color:#d1e4fb}
.dm-fields-v8386 select,.dm-fields-v8386 input[type=file]{display:block;width:100%;margin-top:5px;border:1px solid #4b709a;background:#0a1728;color:#fff;border-radius:10px;padding:10px;font-size:14px}
.dm-fields-v8386 input[type=checkbox]{width:auto;min-width:18px;min-height:18px;margin:0 8px 0 0;vertical-align:middle}
.dm-fields-v8386 .dm-row-v8386{display:flex;gap:9px;flex-wrap:wrap}
.dm-fields-v8386 button{width:auto!important;min-height:38px!important;margin:0!important;padding:8px 11px!important;font-size:12px!important;box-shadow:none!important}
.dm-fields-v8386 .dm-hint-v8386{font-size:11px;color:#9fb5d0;line-height:1.4;margin:0}
.dm-fields-v8386 .dm-state-v8386{font-size:11px;color:#91e7c2;min-height:16px}
.cs-thread .cs-message-text-v8332{line-height:1.5}
.cs-thread .cs-message-text-v8332.dm-collapsed-v8386{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.cs-thread .dm-more-v8386{display:block;width:auto!important;min-height:29px!important;margin:5px 0 0!important;padding:2px 5px!important;color:#9cd8ff!important;background:transparent!important;border:0!important;box-shadow:none!important;font-size:11px!important;text-decoration:underline;text-underline-offset:2px}
.cs-message-effect-row-v8332 select{max-width:calc(100% - 88px)}
/* The three choices reuse the existing server-validated effects and keep old messages readable. */
.cs-thread .cs-message-text-v8332[data-content-effect-v8332="holographic"]{background-image:linear-gradient(100deg,#e6faff 20%,#9dddfb 41%,#fff 50%,#a1e6ff 59%,#d1eeff 80%);background-size:250% auto;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:dmShimmerV8386 8s linear infinite}
.cs-thread .cs-message-text-v8332[data-content-effect-v8332="liquid-gold"]{color:#fff3d2!important;background:none!important;-webkit-text-fill-color:currentColor!important;text-shadow:0 0 8px #ffd89860,0 0 14px #ffe1ad36;animation:dmGlowV8386 6s ease-in-out infinite}
.cs-thread .cs-message-text-v8332[data-content-effect-v8332="aurora"]{background-image:linear-gradient(110deg,#adf5ed,#bfc9ff,#f3d3ec,#bbf4ec);background-size:250% auto;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:dmShimmerV8386 14s ease-in-out infinite alternate}
@keyframes dmShimmerV8386{from{background-position:100% center}to{background-position:-100% center}}
@keyframes dmGlowV8386{50%{text-shadow:0 0 11px #ffe8ad99,0 0 20px #ffe2b255}}
.dm-popup-v8386{position:fixed!important;top:max(12px,calc(env(safe-area-inset-top,0px) + 12px));right:12px;width:min(355px,calc(100vw - 24px));z-index:2147482500;padding:12px 14px;border:1px solid #6da2d9;border-radius:18px;background:linear-gradient(145deg,#0c2b4c,#141f39);color:#f1f7ff;box-shadow:0 18px 36px #020718c7;box-sizing:border-box;overflow-wrap:anywhere}
.dm-popup-v8386 *{box-sizing:border-box}
.dm-popup-v8386 .dm-top-v8386{display:flex;gap:10px;align-items:flex-start;justify-content:space-between}
.dm-popup-v8386 strong{display:block;font-size:13px;line-height:1.3}
.dm-popup-v8386 small{font-size:10px;color:#a3c0dd}
.dm-popup-v8386 .dm-snippet-v8386{font-size:12px;line-height:1.4;color:#d6e7fa;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;white-space:pre-wrap;margin:9px 0 0}
.dm-popup-v8386[data-expanded="true"] .dm-snippet-v8386{display:block;max-height:190px;overflow-y:auto}
.dm-popup-v8386 button,.dm-popup-v8386 a{width:auto!important;min-height:36px!important;margin:0!important;padding:8px 11px!important;font-size:12px!important;line-height:1.3;box-shadow:none!important;border-radius:10px;text-decoration:none}
.dm-popup-v8386 .dm-close-v8386{min-width:31px!important;min-height:31px!important;padding:2px 8px!important;background:#162b45!important}
.dm-popup-v8386 .dm-actions-v8386{display:flex;gap:8px;flex-wrap:wrap;margin-top:11px}
@media(max-width:480px){.dm-banner-v8386{min-height:100px}.dm-banner-v8386 .dm-banner-content-v8386{padding:12px}.dm-popup-v8386{top:max(10px,calc(env(safe-area-inset-top,0px) + 10px));right:9px;width:calc(100vw - 18px)}}
@media(prefers-reduced-motion:reduce),(prefers-contrast:more){.cs-thread .cs-message-text-v8332[data-content-effect-v8332]{animation:none!important;color:#f6faff!important;-webkit-text-fill-color:currentColor!important;background:none!important;text-shadow:none!important}}


/* v8393 — calm, iPhone-first conversations inspired by familiar private chats.
   Scoped to the real 1:1 conversation page, not Staff Room, room DJ or profiles. */
.dm-chat-v8393{
  display:flex;flex-direction:column;min-width:0;gap:0;
  height:min(740px,var(--dm-chat-available-v8393,calc(100dvh - env(safe-area-inset-top,0px) - 145px)));
  min-height:min(200px,var(--dm-chat-available-v8393,200px));max-height:var(--dm-chat-available-v8393,calc(100dvh - env(safe-area-inset-top,0px) - 72px));
  border:1px solid rgba(109,159,202,.42);border-radius:22px;
  background:#0a1a2d;overflow:hidden;
}
.dm-chat-v8393 .dm-chat-header-v8393{
  display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;
  min-height:74px;flex:0 0 auto;padding:10px 13px;margin:0;
  background:#122d43;border-bottom:1px solid #6d9bc044;gap:10px
}
.dm-chat-v8393 .dm-chat-back-v8393{
  flex:0 0 auto;width:34px;min-height:42px;display:grid;place-items:center;
  color:#90d7ff;font-size:30px;text-decoration:none;font-weight:600
}
.dm-chat-v8393 .dm-chat-person-v8393{
  flex:1;min-width:0;display:flex;align-items:center;gap:10px;text-decoration:none
}
.dm-chat-v8393 .dm-chat-avatar-v8393{
  flex:0 0 44px;width:44px;height:44px;display:grid;place-items:center;
  border-radius:50%;border:1px solid #84b7e17a;background:#254c69;
  color:#fff;font-weight:800;font-size:21px;overflow:hidden
}
.dm-chat-v8393 .dm-chat-avatar-v8393 img{width:100%;height:100%;object-fit:cover}
.dm-chat-v8393 .dm-chat-identity-v8393{
  display:flex;flex-direction:column;min-width:0;line-height:1.32
}
.dm-chat-v8393 .dm-chat-identity-v8393 strong{
  display:block;max-width:100%;font-size:clamp(15px,4.6vw,20px)!important;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.dm-chat-v8393 .dm-chat-identity-v8393 small{
  color:#9ec4da;font-size:11px;line-height:1.35;margin-top:2px
}
.dm-chat-v8393 .dm-chat-identity-v8393 small[data-online="true"]{color:#8de5c7}
.dm-chat-v8393 .dm-chat-label-v8393{color:#9ebdd4;font-size:11px;white-space:nowrap}
.dm-chat-v8393 .dm-edit-v8386{
  flex:0 0 auto;width:auto!important;margin:0!important;
  min-width:0!important;min-height:34px!important;
  background:#183a54!important;color:#dceefa!important;
  border:1px solid #456f91!important;border-radius:999px!important;
  padding:6px 9px!important;font-size:11px!important;box-shadow:none!important
}
.dm-chat-v8393 .dm-banner-v8386[hidden]{display:none!important}
.dm-chat-v8393 .dm-appearance-v8386{flex:0 0 auto;margin:0;border-radius:0}
.dm-chat-v8393 .dm-appearance-v8386:not([open]){display:none!important}
.dm-chat-v8393 .dm-appearance-v8386[open]{max-height:45%;overflow-y:auto}
.dm-chat-v8393 .cs-thread{
  flex:1 1 auto;min-height:0;max-height:none;margin:0;border:0;border-radius:0;
  padding:20px 13px 13px;gap:12px;
  background:#071827;overflow-y:auto;overscroll-behavior:contain;
  background-size:cover;background-position:center
}
.dm-chat-v8393 .cs-thread[data-dm-wallpaper-v8393="true"]{
  background-image:linear-gradient(#061524d1,#061524d9),url("/api/social/messenger/banner");
}
.dm-chat-v8393 .dm-chat-day-v8393{
  align-self:center;margin:5px 0;color:#b9c8d9;font-size:11px;
  letter-spacing:.03em;font-weight:700;background:#0b263bc7;
  border:1px solid #7297b233;padding:5px 11px;border-radius:999px
}
.dm-chat-v8393 .cs-bubble{
  position:relative;max-width:82%;border-radius:18px 18px 18px 5px;
  padding:11px 13px 9px;background:#183548;color:#f4f9ff;
  border:1px solid #a8c7dc1a;font-size:15px;line-height:1.43;box-shadow:0 3px 9px #0002
}
.dm-chat-v8393 .cs-bubble.mine{
  border-radius:18px 18px 5px 18px;background:#60b9ec;
  border-color:#83d7ff;color:#061625
}
.dm-chat-v8393 .cs-bubble.mine .cs-message-text-v8332:not([data-content-effect-v8332="none"]){color:#071827}
.dm-chat-v8393 .cs-msgmeta{
  font-size:10px;color:#a9c5d8;text-align:left;margin-top:5px
}
.dm-chat-v8393 .cs-bubble.mine .cs-msgmeta{color:#123c52;text-align:right}
.dm-chat-v8393 .cs-composer{
  flex:0 0 auto;display:flex;align-items:flex-end;gap:8px;
  padding:9px 11px max(10px,env(safe-area-inset-bottom,0px));
  margin:0;border-top:1px solid #5a7b986b;background:#12293b
}
.dm-chat-v8393 .cs-composer textarea{
  min-height:44px;max-height:115px;resize:none;
  border:1px solid #517895;border-radius:24px;
  padding:11px 15px;background:#05101f;color:#fff;font-size:16px
}
.dm-chat-v8393 .cs-composer button{
  border-radius:999px!important;min-height:44px!important;
  background:#1470a5!important;border:1px solid #75c4ed!important;
  padding:8px 13px!important;font-size:12px!important
}
.dm-chat-v8393 .cs-message-effect-row-v8332{
  flex:0 0 auto;margin:0!important;padding:3px 13px!important;
  background:#102438;border:0!important
}
.dm-chat-v8393 .cs-status{
  flex:0 0 auto;margin:0;padding:0 13px;color:#b8cde0;
  min-height:0;font-size:11px;line-height:1.4
}
.dm-chat-v8393 .cs-status:empty{display:none}
@media(max-width:480px){
  .dm-chat-v8393{width:100%;height:min(740px,var(--dm-chat-available-v8393,calc(100dvh - env(safe-area-inset-top,0px) - 120px)))}
  .dm-chat-v8393 .dm-chat-label-v8393{display:none}
  .dm-chat-v8393 .dm-chat-header-v8393{min-height:63px;padding:7px 10px}
  .dm-chat-v8393 .cs-thread{padding:13px 10px}
  .dm-chat-v8393 .cs-bubble{max-width:87%}
}
@media(max-height:550px){
  .dm-chat-v8393{height:var(--dm-chat-available-v8393,calc(100dvh - 65px));min-height:min(150px,var(--dm-chat-available-v8393,150px))}
  .dm-chat-v8393 .dm-chat-header-v8393{min-height:52px}
}
@media(prefers-reduced-motion:reduce){
  .dm-chat-v8393 *{scroll-behavior:auto!important}
}

/* v8397: Messenger-only iPhone cleanup. Verified role styling is retained. */
.dm-chat-v8393 .dm-chat-identity-v8393 strong{white-space:normal!important;overflow-wrap:anywhere;text-overflow:clip;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;line-height:1.26}
.dm-chat-v8393 .dm-chat-person-v8393{flex:1;min-width:0}
.dm-chat-v8393 .dm-chat-header-v8393{gap:6px}
.dm-chat-v8393 .dm-edit-v8386{flex:0 0 auto}
.dm-chat-v8393 .cs-message-effect-row-v8332[hidden]{display:none!important}
.dm-chat-v8393 .dm-effects-button-v8397{align-self:flex-start;flex:none;width:auto!important;min-height:28px!important;margin:0 11px 0!important;padding:2px 10px!important;border:1px solid #496987!important;border-radius:999px!important;background:#142d44!important;color:#a8ddfc!important;font-size:11px!important;box-shadow:none!important}
.dm-inbox-v8397{max-width:690px}
.dm-inbox-v8397 .dm-inbox-toolbar-v8397{display:flex;align-items:center;gap:10px;margin:8px 0 12px}
.dm-inbox-v8397 .dm-inbox-toolbar-v8397 input{min-width:0;flex:1;width:100%;min-height:43px;border:1px solid #52799d;border-radius:15px;padding:10px 13px;font:normal 16px system-ui;background:#0b1f32;color:#f7fbff}
.dm-inbox-v8397 .dm-inbox-toolbar-v8397 a{flex:none;color:#8ee4bf;font-size:12px;text-decoration:none;white-space:nowrap}
.dm-inbox-v8397 #csInbox{max-width:690px}
.dm-inbox-v8397 #csInbox .cs-row{min-height:65px;margin:0;padding:9px 7px;border-radius:11px}
.dm-inbox-v8397 #csInbox .cs-row[hidden]{display:none!important}
.dm-inbox-v8397 #csInbox .cs-row .cs-row-info{min-width:0;flex:1}
.dm-inbox-v8397 #csInbox .cs-row .cs-row-name{overflow-wrap:anywhere;white-space:normal}
.dm-inbox-v8397 #csInbox .cs-row .cs-row-desc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dm-inbox-v8397 #csInbox .cs-row .btn{min-width:0;min-height:34px;padding:7px 10px;font-size:11px}
.dm-inbox-v8397 .dm-inbox-links-v8397{display:flex;gap:17px;flex-wrap:wrap;padding:12px 2px 2px}
.dm-inbox-v8397 .dm-inbox-links-v8397 a{color:#a7cbea;font-size:12px;text-decoration:underline;text-underline-offset:3px}
@media(max-width:480px){.dm-chat-v8393 .dm-chat-header-v8393{gap:5px;padding:7px}.dm-chat-v8393 .dm-chat-avatar-v8393{flex-basis:37px;width:37px;height:37px}.dm-chat-v8393 .dm-chat-back-v8393{width:27px}.dm-chat-v8393 .dm-edit-v8386{font-size:10px!important;padding:5px 7px!important}.dm-inbox-v8397 .dm-inbox-toolbar-v8397{gap:7px}}

/* v8404: match the dock's single-row iPhone conversation composer. */
.dm-chat-v8393 .cs-composer{
  align-items:center;gap:7px;padding:8px 10px max(10px,env(safe-area-inset-bottom,0px));
  background:#12293b;border-top-color:#557b9855
}
.dm-chat-v8393 .cs-composer .dm-effects-button-v8397{
  flex:0 0 34px;width:34px!important;height:34px;min-height:34px!important;
  display:grid;place-items:center;align-self:center;margin:0!important;padding:0!important;
  border:1px solid #4d7392!important;border-radius:50%!important;
  background:transparent!important;color:#b7ddfa!important;
  font-size:15px!important;font-weight:500!important;box-shadow:none!important
}
.dm-chat-v8393 .cs-composer textarea{
  flex:1 1 auto;min-width:0;width:100%;height:42px;min-height:42px;
  max-height:110px;line-height:1.4;padding:10px 13px;border-radius:23px;
  background:#091b2d;overflow-y:auto
}
.dm-chat-v8393 .cs-composer #csSend{
  flex:0 0 42px;width:42px!important;height:42px;min-width:42px!important;
  min-height:42px!important;margin:0!important;padding:0!important;
  border-radius:50%!important;font-size:18px!important
}
.dm-chat-v8393 .cs-bubble{box-shadow:none}
.dm-chat-v8393 .dm-chat-header-v8393{background:#12293b}
@media(max-width:570px){
  .dm-chat-v8393 .dm-chat-header-v8393{min-height:62px;padding:7px 10px}
  .dm-chat-v8393 .cs-thread{padding:13px 10px 10px}
  .dm-chat-v8393 .cs-composer{gap:7px}
}
@media(max-height:520px){
  .dm-chat-v8393 .cs-composer{padding-top:5px;padding-bottom:6px}
}

/* v8407: authenticated profile avatars align with message groups, not every
   consecutive bubble. Keep iPhone messages unclipped and preserve sent/read. */
.dm-chat-v8393 .dm-chat-msg-row-v8407{
  display:flex;align-items:flex-end;gap:7px;width:100%;min-width:0;flex:0 0 auto;
  justify-content:flex-start
}
.dm-chat-v8393 .dm-chat-msg-row-v8407.mine{justify-content:flex-end}
.dm-chat-v8393 .dm-chat-msg-row-v8407 .cs-bubble{
  align-self:auto;min-width:0;max-width:min(82%,calc(100% - 37px));
  box-sizing:border-box
}
.dm-chat-v8393 .dm-chat-msg-avatar-v8407{
  position:relative;display:grid;place-items:center;overflow:hidden;
  width:30px;height:30px;flex:0 0 30px;border-radius:50%;
  background:linear-gradient(140deg,#17496c,#465680);
  border:1px solid rgba(147,206,242,.63);color:#e9f5ff;
  font-size:10px;font-weight:850;line-height:1;letter-spacing:.02em
}
.dm-chat-v8393 .dm-chat-msg-avatar-v8407 img{
  position:absolute;inset:0;display:block;width:100%;height:100%;
  object-fit:cover;border-radius:50%
}
.dm-chat-v8393 .dm-chat-avatar-spacer-v8407{
  visibility:hidden;pointer-events:none;border-color:transparent
}
@media(max-width:480px){
  .dm-chat-v8393 .dm-chat-msg-row-v8407{gap:6px}
  .dm-chat-v8393 .dm-chat-msg-avatar-v8407{width:27px;height:27px;flex-basis:27px}
  .dm-chat-v8393 .dm-chat-msg-row-v8407 .cs-bubble{max-width:min(86%,calc(100% - 33px))}
}

/* v8498: content-sized 1:1 chat bubbles; avatars, composer and receipts unchanged. */
.dm-chat-v8393 .cs-bubble{
  box-sizing:border-box;width:fit-content;min-width:0;max-width:84%;
  flex:0 1 auto;overflow-wrap:anywhere;
}
.dm-chat-v8393 .dm-chat-msg-row-v8407 .cs-bubble{
  max-width:min(84%,calc(100% - 37px));
}
@media(max-width:480px){
  .dm-chat-v8393 .dm-chat-msg-row-v8407 .cs-bubble{
    max-width:min(84%,calc(100% - 33px));
  }
}

/* v8530: permanently suppress retired floating Messenger UI even in legacy pages. */
.dm-popup-v8386{display:none!important;visibility:hidden!important;pointer-events:none!important}
