/* Desire District chat skin. Only active chat surfaces; session and drawer logic stay in app.js. */
body.chat-active {
  display: flex;
  flex-direction: column;
  --chat-panel: #19151f;
  --chat-panel-soft: #211a28;
  --chat-canvas: #100d15;
  --chat-text: #f8f4f7;
  --chat-muted: #b6aaba;
  --chat-line: rgba(226, 198, 234, .12);
  --chat-highlight: rgba(224, 68, 130, .12);
  --chat-own: #54213d;
  --chat-pink: #f08cb5;
}
/* The site header wraps on phones; reserve its actual height instead of a fixed 76px. */
body.chat-active > main { flex: 1 1 0; height: auto !important; min-height: 0; overflow: hidden; }
html[data-theme="light"] body.chat-active {
  --chat-panel: #fff;
  --chat-panel-soft: #f4edf4;
  --chat-canvas: #faf6fa;
  --chat-text: #302335;
  --chat-muted: #706076;
  --chat-line: rgba(74, 36, 84, .16);
  --chat-highlight: #f9e7f0;
  --chat-own: #f6dbe8;
  --chat-pink: #a82d61;
}
body.chat-active #chat-section {
  width: min(calc(100% - 2 * var(--dd-page-gutter, 24px)), 1320px) !important;
  max-width: 1320px;
  margin-inline: auto;
  padding: 12px 0 !important;
  color: var(--chat-text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
body.chat-active #chat-layout { gap: 12px !important; }
body.chat-active #chat-section :is(.chat-shell, .chat-sidebar) {
  border: 1px solid var(--chat-line) !important;
  border-radius: 20px !important;
  background: var(--chat-panel) !important;
  box-shadow: 0 12px 36px #0002 !important;
}
body.chat-active #chat-section .chat-header {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 18px 20px !important;
  background: linear-gradient(115deg, var(--chat-highlight), transparent 75%), var(--chat-panel);
  border-bottom: 1px solid var(--chat-line);
  box-shadow: none;
}
body.chat-active #chat-section .chat-header > div:first-child { min-width: 0; text-align: left; }
body.chat-active #chat-section .chat-header h2 {
  margin: 0 0 5px;
  font-size: 1.4rem !important;
  line-height: 1.25;
  letter-spacing: -.035em;
}
body.chat-active #chat-section :is(.chat-header, .sidebar-heading) .eyebrow {
  margin-bottom: 7px;
  color: var(--chat-pink);
  font-size: .625rem;
  line-height: 1.4;
  letter-spacing: .14em;
}
body.chat-active #chat-section :is(#chat-welcome, .chat-bio-help) {
  margin: 4px 0 0;
  color: var(--chat-muted);
  font-size: .75rem;
  line-height: 1.5;
}
body.chat-active #chat-section .chat-header-actions {
  width: auto !important;
  max-width: 100%;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 6px;
}
body.chat-active #chat-section :is(.chat-header-actions .button, .sidebar-close, .chat-icon-button) {
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
}
body.chat-active #chat-section :is(.chat-header-actions .button--ghost, .sidebar-close) {
  color: var(--chat-text);
  border-color: var(--chat-line);
  background: var(--chat-panel-soft);
  box-shadow: none;
}
body.chat-active #chat-section .online-pill {
  min-height: 36px;
  padding: 7px 10px;
  background: var(--chat-panel);
  border-color: var(--chat-line);
  color: var(--chat-muted);
  font-size: .6875rem;
}
body.chat-active #chat-section .online-pill strong { color: var(--chat-text); }
body.chat-active #chat-section .system-banner {
  padding: 10px 20px;
  gap: 5px 10px;
  background: var(--chat-panel);
  border-bottom: 1px solid var(--chat-line);
  color: var(--chat-muted);
  font-size: .75rem;
  line-height: 1.5;
}
body.chat-active #chat-section .system-banner strong { color: var(--chat-pink); }
body.chat-active #chat-section .message-list {
  padding: 20px;
  background: radial-gradient(ellipse at top right, var(--chat-highlight), transparent 70%), var(--chat-canvas);
  scrollbar-color: var(--chat-line) transparent;
  scrollbar-width: thin;
}
body.chat-active #chat-section .message { gap: 10px; margin-bottom: 18px; }
body.chat-active #chat-section .message-meta { flex-wrap: wrap; gap: 4px 7px; color: var(--chat-muted); font-size: .6875rem; line-height: 1.5; }
body.chat-active #chat-section .message-bubble:not(.message-bubble--boosted) {
  padding: 11px 14px;
  border: 1px solid var(--chat-line);
  border-radius: 4px 16px 16px 16px;
  background: var(--chat-panel-soft);
  color: var(--chat-text);
  font-size: .9375rem;
  line-height: 1.6;
  box-shadow: 0 3px 10px #0001;
}
body.chat-active #chat-section .message--mine .message-bubble:not(.message-bubble--boosted) {
  border-radius: 16px 4px 16px 16px;
  border-color: color-mix(in srgb, var(--chat-pink) 25%, transparent);
  background: var(--chat-own);
}
body.chat-active #chat-section :is(.message-avatar, .member-avatar).is-online {
  box-shadow: 0 0 0 1px rgba(99, 214, 177, .6);
}
body.chat-active #chat-section .composer {
  gap: 10px;
  padding: 14px 16px 10px;
  border-top: 1px solid var(--chat-line);
  background: var(--chat-panel);
  box-shadow: none;
}
body.chat-active #chat-section #message-input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--chat-line);
  border-radius: 13px;
  background: var(--chat-canvas);
  color: var(--chat-text);
  font: inherit;
  font-size: 1rem;
}
body.chat-active #chat-section #message-input::placeholder { color: var(--chat-muted); opacity: 1; }
body.chat-active #chat-section #message-send {
  min-height: 48px;
  border-radius: 13px;
  padding-inline: 18px;
  background: linear-gradient(120deg, #d8397a, #bb397f);
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}
body.chat-active #chat-section .chat-footnote {
  padding: 0 14px 10px;
  background: var(--chat-panel);
  color: var(--chat-muted);
  font-size: .625rem;
  line-height: 1.5;
}
body.chat-active #chat-section .sidebar-heading { padding: 16px; border-color: var(--chat-line); }
body.chat-active #chat-section .sidebar-heading h2 { color: var(--chat-text); font-size: .9375rem; }
body.chat-active #chat-section .room-list { padding: 10px; gap: 8px; }
body.chat-active #chat-section .room-button {
  min-height: 62px;
  padding: 10px;
  background: var(--chat-panel-soft);
  border-color: var(--chat-line) !important;
  box-shadow: none !important;
  color: var(--chat-text);
}
body.chat-active #chat-section .room-button.is-active {
  background: var(--chat-highlight) !important;
  border-color: color-mix(in srgb, var(--room-accent) 55%, var(--chat-line)) !important;
  box-shadow: inset 3px 0 0 var(--room-accent) !important;
}
body.chat-active #chat-section .room-copy strong { font-size: .8125rem; }
body.chat-active #chat-section .room-copy small { color: var(--chat-muted); font-size: .6875rem; }
body.chat-active #chat-section :is(.sidebar-note, .member-sidebar-note) { color: var(--chat-muted); border-color: var(--chat-line); font-size: .6875rem; line-height: 1.5; }
body.chat-active #chat-section #chat-staff-contact { border-color: var(--chat-line); background: var(--chat-panel-soft); border-radius: 12px; }
body.chat-active #chat-section #chat-staff-contact:not(.has-online-admin) strong { color: var(--chat-text); }
body.chat-active #chat-section #chat-staff-contact span { color: var(--chat-muted); }
body.chat-active #chat-section #online-member-list { padding-inline: 10px; scrollbar-width: thin; scrollbar-color: var(--chat-line) transparent; }
body.chat-active #chat-section #dm-inbox-open { min-height: 44px; padding: 10px; border: 1px solid var(--chat-line); border-radius: 12px; background: var(--chat-highlight); color: var(--chat-text); font-size: .8125rem; }
body.chat-active #chat-section .member-item { padding-block: 9px; min-height: 48px; }
body.chat-active #chat-section .member-item:hover { background: var(--chat-highlight); }
body.chat-active #chat-section .member-group-title { color: var(--chat-muted); }
body.chat-active #chat-section .chat-tools :is(a, button) { border-color: var(--chat-line); background: var(--chat-panel-soft); color: var(--chat-muted); font-size: .6875rem; }
body.chat-active #chat-section .chat-text-ad { border-color: var(--chat-line); background: var(--chat-highlight); }
body.chat-active #chat-section .chat-text-ad small { color: var(--chat-muted); }
body.chat-active #chat-section .chat-text-ad a { color: var(--chat-text); }
body.chat-active #chat-section :is(button, input, a):focus-visible { outline: 2px solid var(--chat-pink); outline-offset: 3px; }
body.chat-active #dm-dialog { border: 1px solid var(--chat-line); border-radius: 20px; background: var(--chat-panel); color: var(--chat-text); box-shadow: 0 24px 80px #0006; }
body.chat-active #dm-dialog :is(.dm-header, #dm-sidebar, .dm-composer) { background: var(--chat-panel); border-color: var(--chat-line); }
body.chat-active #dm-dialog #dm-messages { background: var(--chat-canvas); }
body.chat-active #dm-dialog .dm-message-bubble { background: var(--chat-panel-soft); color: var(--chat-text); border: 1px solid var(--chat-line); font-size: .9375rem; line-height: 1.6; }
body.chat-active #dm-dialog .dm-message--mine .dm-message-bubble { background: var(--chat-own); }
body.chat-active #dm-dialog #dm-input { background: var(--chat-canvas); color: var(--chat-text); border-color: var(--chat-line); font-size: 1rem; min-height: 44px; }
/* Preserve profile colours with readable contrast on the light surfaces. */
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) :is(.identity-name--vrouw, .identity-age--vrouw b) { color: #a62f66 !important; }
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) :is(.identity-name--man, .identity-age--man b) { color: #2367a2 !important; }
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) .identity-name--couples { color: #825e1e !important; }
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) :is(.identity-name--trans, .identity-age--trans b) { color: #7743a6 !important; }
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) :is(.identity-name--non_binary, .identity-age--non_binary b) { color: #226f65 !important; }
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) .identity-name--other { color: #625269 !important; }
html[data-theme="light"] body.chat-active #chat-section .message-meta { color: var(--chat-muted); }
html[data-theme="light"] body.chat-active #chat-section #chat-status { color: #825e1e; }
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) .verified-chat-badge { color: #226c60; border-color: #b4d6cd; background: #eaf7f2; }
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) .real-chatter-badge { color: #28648f; border-color: #b6cfe0; background: #edf5fc; }
html[data-theme="light"] body.chat-active :is(#chat-section, #dm-dialog) .gold-badge { color: #805b15; border-color: #c2a66a; background: #fbf4e4; text-shadow: none; }
@media (max-width: 1180px) {
  body.chat-active #sidebar-backdrop { z-index: 1050; }
  body.chat-active #chat-section :is(.left-sidebar-stack, .member-sidebar) { z-index: 1100; }
  body.chat-active #chat-section .left-sidebar-stack { background: var(--chat-panel); }
  body.chat-active #chat-section { width: calc(100% - 24px) !important; }
  body.chat-active #chat-section .chat-header { gap: 10px !important; padding: 14px 16px !important; }
  body.chat-active #chat-section :is(.chat-header-actions .button, .sidebar-close) { min-width: 44px !important; min-height: 44px !important; flex-shrink: 0; }
  body.chat-active #chat-section .chat-tools :is(a, button) { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 600px) {
  body.chat-active #chat-section { width: calc(100% - 12px) !important; padding: 6px 0 !important; }
  body.chat-active #chat-section .chat-shell { border-radius: 16px !important; }
  body.chat-active #chat-section .chat-header { padding: 12px !important; gap: 8px !important; }
  body.chat-active #chat-section .chat-header h2 { font-size: 1.2rem !important; }
  body.chat-active #chat-section .chat-bio-help { display: none; }
  body.chat-active #chat-section .chat-header-actions { gap: 5px; }
  body.chat-active #chat-section .chat-header-actions .button { padding-inline: 10px; }
  body.chat-active #chat-section .system-banner { padding: 8px 12px; grid-template-columns: 1fr; gap: 2px; font-size: .6875rem; }
  body.chat-active #chat-section .message-list { padding: 12px 10px; }
  body.chat-active #chat-section .message { gap: 8px; margin-bottom: 14px; }
  body.chat-active #chat-section .message-bubble:not(.message-bubble--boosted) { max-width: 100%; padding: 9px 11px; }
  body.chat-active #chat-section .composer { padding: 10px 10px 8px; gap: 6px; }
  body.chat-active #chat-section #message-send { padding-inline: 12px; }
  body.chat-active #chat-section .chat-footnote { padding-bottom: max(8px, env(safe-area-inset-bottom)); font-size: .5625rem; }
}
@media (max-height: 520px) {
  body.chat-active #chat-section .chat-header { padding: 6px 10px !important; gap: 6px !important; }
  body.chat-active #chat-section .chat-bio-help { display: none; }
  body.chat-active #chat-section :is(.system-banner, .chat-footnote, .chat-header .eyebrow, .chat-header .muted) { display: none !important; }
  body.chat-active #chat-section .composer { padding-block: 6px; }
}
@media (max-height: 520px) and (max-width: 1180px) {
  body.chat-active > header.dd-header > .site-navigation { display: none !important; }
}

/* Scrolling is owned by chat-scroll.js; browser anchoring must not double-adjust it. */
:is(#message-list, #dm-messages) { overflow-anchor: none; scroll-behavior: auto; }
.chat-option-label { display: none; }
.chat-more-tools[hidden], #chat-more-panel[hidden] { display: none !important; }
body.chat-active #chat-section .chat-footnote:empty { display: none; }
body.chat-active #chat-section .chat-header { flex: 0 0 auto; }

@media (max-width: 760px) {
  body.chat-active > header.dd-header {
    position: relative !important;
    top: auto !important;
    flex: 0 0 auto;
    min-height: 60px !important;
    padding: 8px 12px !important;
    z-index: 100;
  }
  body.chat-active > header.dd-header .brand-copy { display: none !important; }
  body.chat-active > header.dd-header .site-menu-toggle { display: inline-flex !important; padding-inline: 12px; }
  body.chat-active > header.dd-header > .site-navigation {
    display: none !important;
    position: absolute !important;
    inset: 100% 8px auto !important;
    width: auto !important;
    max-height: calc(var(--chat-viewport-height, 100dvh) - 76px);
    overflow-y: auto !important;
    background: var(--chat-panel) !important;
    border: 1px solid var(--chat-line);
    border-radius: 14px;
    padding: 8px !important;
    box-shadow: 0 12px 32px #0005;
  }
  body.chat-active > header.dd-header > .site-navigation.is-open { display: grid !important; grid-template-columns: 1fr 1fr; gap: 4px !important; }
  body.chat-active > header.dd-header > .site-navigation > a { justify-content: flex-start !important; padding: 10px 12px !important; min-height: 44px; }
  body.chat-active #chat-section .chat-header { position: relative; flex-direction: row; flex-wrap: nowrap; padding: 8px 10px !important; gap: 6px !important; z-index: 50; }
  body.chat-active #chat-section .chat-header > div:first-child { flex: 1 1 auto; }
  body.chat-active #chat-section .chat-header h2 { margin: 0; font-size: 1rem !important; letter-spacing: normal; }
  body.chat-active #chat-section .chat-header :is(.eyebrow, #chat-welcome, .chat-bio-help) { display: none !important; }
  body.chat-active #chat-section .chat-header-actions { flex: 0 0 auto; flex-wrap: nowrap !important; gap: 4px; }
  body.chat-active #chat-section .mobile-panel-actions { gap: 4px; }
  body.chat-active #chat-section .online-pill { order: -1; padding: 4px 6px; min-height: 30px; gap: 4px; font-size: .625rem; }
  .chat-more-tools { position: relative; }
  body.chat-active #chat-section .chat-more-tools > button { font-size: 1.5rem; padding: 0; line-height: 1; }
  #chat-more-panel {
    position: absolute; right: 0; top: calc(100% + 8px); display: grid; gap: 6px;
    width: 232px; max-height: calc(var(--chat-viewport-height, 100dvh) - 140px); overflow-y: auto;
    padding: 8px; border: 1px solid var(--chat-line); border-radius: 14px;
    background: var(--chat-panel); box-shadow: 0 12px 32px #0005;
  }
  body.chat-active #chat-section #chat-more-panel .button { display: flex !important; width: 100% !important; height: auto !important; min-height: 44px !important; padding: 10px !important; justify-content: flex-start; gap: 10px; border-radius: 8px !important; font-size: .8125rem !important; font-weight: 500; white-space: nowrap; }
  #chat-more-panel .chat-option-label { display: inline; }
  body.chat-active #chat-section .composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 8px 10px; }
  body.chat-active #chat-section #message-input { grid-column: 1; grid-row: 1; }
  body.chat-active #chat-section .composer-actions { grid-column: 2; grid-row: 1; display: flex; align-self: stretch; }
  body.chat-active #chat-section #message-send { min-width: 78px; font-size: .8125rem; font-weight: 600; }
  body.chat-active #chat-section #message-boost { min-height: 32px; padding: 4px 10px; font-size: .6875rem; font-weight: 500; }
  body.chat-active #chat-section .system-banner { padding-block: 5px; font-size: .625rem; }
  body.chat-active #chat-section .chat-footnote { padding: 0 10px max(6px, env(safe-area-inset-bottom)); font-size: .5625rem; }
}
@media (max-width: 360px) {
  body.chat-active #chat-section .online-pill { font-size: 0 !important; gap: 3px; }
  body.chat-active #chat-section .online-pill strong { font-size: .6875rem; }
}

/* Consecutive messages share one visible sender header, while retaining
   individual timestamps and moderation/report controls. */
body.chat-active #chat-section .message:has(+ .message--continued),
body.chat-active #chat-section .message--continued {
  margin-bottom: 5px;
}
body.chat-active #chat-section .message--continued .message-avatar {
  visibility: hidden;
}
body.chat-active #chat-section .message--continued .message-meta {
  margin-bottom: 2px;
  line-height: 1.2;
  opacity: .82;
}
body.chat-active #chat-section .message--continued .message-meta button {
  min-height: 24px;
  padding: 2px 6px;
  font-size: .625rem;
  line-height: 1.2;
}
