/* Scope shared accents to this conversation, including inherited legacy controls. */
:is(#dmThreadActive,.dm-mini-chat).chat-shared-theme {
  --accent-primary:var(--shared-accent);
  --accent-strong:var(--shared-accent);
  --accent-light:var(--shared-control,color-mix(in srgb,var(--shared-accent) 65%,white));
  --accent-rgb:var(--shared-accent-rgb);
  --accent-soft:color-mix(in srgb,var(--shared-accent) 12%,transparent);
  --accent-border:color-mix(in srgb,var(--shared-control,var(--shared-accent)) 45%,transparent);
  --chat-purple:var(--shared-accent);
}

/* Scene colours match the mobile artwork; colour-only themes keep the site's surfaces. */
:is(#dmThreadActive,.dm-mini-chat).chat-shared-theme .dm-mini-row.is-mine .dm-mini-bubble:not(.is-emoji-only),
:is(#dmThreadActive,.dm-mini-chat).chat-shared-theme .dm-bubble-row.mine .dm-bubble:not(.chat-emoji-only) { background:var(--shared-gradient)!important; color:#fff!important; }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-messages,
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme #dmMessages { background:var(--shared-bg) var(--shared-image) center/cover no-repeat!important; }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-row.is-theirs .dm-mini-bubble:not(.is-emoji-only),
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-bubble-row:not(.mine) .dm-bubble:not(.chat-emoji-only) { background:var(--shared-incoming)!important; color:var(--shared-text)!important; }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-sender-name,
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-bubble-sender { color:var(--shared-meta)!important; }
.chat-theme-notice { text-align:center; font-size:11px; line-height:1.5; padding:10px 8px; color:var(--shared-meta,var(--muted)); }
.chat-theme-notice span,
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-date-sep,
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-date-divider span { background:var(--shared-pill,transparent); border-radius:8px; padding:4px 8px; color:var(--shared-meta,inherit); }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-header,
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-composer { background:var(--shared-bg)!important; color:var(--shared-bar-text)!important; border-color:var(--shared-line)!important; }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-name,
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-header button { color:var(--shared-bar-text)!important; }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-input { background:transparent!important; color:var(--shared-bar-text)!important; }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-input::placeholder { color:var(--shared-meta)!important; }

#dmThreadActive.chat-scene-theme .dm-thread-header,
#dmThreadActive.chat-scene-theme .dm-composer { background:var(--shared-bg)!important; color:var(--shared-bar-text)!important; border-color:var(--shared-line)!important; }
#dmThreadActive.chat-scene-theme :is(.dm-thread-name,.dm-thread-header button,#dmInput) { color:var(--shared-bar-text)!important; }
#dmThreadActive.chat-scene-theme .dm-composer-input-wrap,
.dm-mini-chat.chat-scene-theme .dm-mini-input-wrap { background:var(--shared-input)!important; }
#dmThreadActive.chat-scene-theme #dmInput { background:transparent!important; }
#dmThreadActive.chat-scene-theme #dmInput::placeholder { color:var(--shared-meta)!important; }

/* Scene controls need the mobile palette's readable icon colour even when the
   website appearance differs from the scene (for example Night sky in light mode). */
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme :is(.dm-mini-attach,.dm-mini-gift,.dm-mini-emoji,.dm-mini-send,.dm-composer-btn,.dm-composer-emoji,.dm-send-btn,.chats-gif-btn,.chats-gift-btn) { color:var(--shared-control)!important; }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-unread-divider { color:var(--shared-control); }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-unread-divider::before,
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .dm-mini-unread-divider::after { background:var(--shared-line); }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme :is(.dm-mini-new-messages,.chat-new-message) { background:var(--shared-bg); color:var(--shared-control); border-color:var(--shared-line); }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme :is(.chat-reply-preview,.chat-gift-card) { background:var(--shared-pill); color:var(--shared-text); }
:is(#dmThreadActive,.dm-mini-chat).chat-scene-theme .chat-reply-label { color:var(--shared-meta); }
