
  /**
 * Obrolan Umum chat room.
 *
 * @package AkuAjae_Community_Core
 */

  .acc-page-chat {
    display: flex;
    flex-direction: column;
    min-height: min(70vh, 720px);
    /* Removed max-height to avoid double scroll in app-shell */

    /* Local chat bubble design tokens */
    --acc-chat-avatar: 36px;
    --acc-chat-bubble-max: min(85%, 440px);
    --acc-chat-radius: 18px;
    --acc-chat-radius-tail: 6px;
    --acc-chat-pad-y: var(--acc-space-2);
    --acc-chat-pad-x: 0.875rem;
    --acc-chat-list-gap: var(--acc-space-3);
    --acc-chat-cluster-gap: var(--acc-space-1);
    --acc-chat-media-max: min(100%, 320px);
    --acc-chat-media-max-h: min(50vh, 360px);
    /* Darker accent mix for white text ~AA on sm type */
    --acc-chat-self-bg: color-mix(in srgb, var(--acc-color-accent) 78%, #1a1a2e 22%);
    --acc-chat-self-bg-end: color-mix(in srgb, var(--acc-color-accent-hover, #7a6aef) 72%, #1a1a2e 28%);
    --acc-chat-self-fg: #fff;
    --acc-chat-other-bg: var(--acc-color-bg-elevated);
    --acc-chat-other-border: color-mix(in srgb, var(--acc-color-border) 85%, transparent);
    --acc-chat-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
    --acc-chat-caption-self-bg: color-mix(in srgb, var(--acc-color-accent) 12%, #fff);
    --acc-chat-media-letterbox: #0f0f12;
  }

  .acc-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--acc-space-3);
    padding-bottom: var(--acc-space-3);
    margin-bottom: var(--acc-space-2);
    border-bottom: 1px solid var(--acc-color-border);
    flex-shrink: 0;
  }

  .acc-chat-header-wrap .acc-chat-archive {
    margin: calc(var(--acc-space-2) * -1) 0 var(--acc-space-3);
    padding: 0 0 var(--acc-space-2);
  }

  .acc-chat-archive__link {
    font-size: var(--acc-font-size-sm);
  }

  .acc-chat-header__title {
    margin: 0;
    font-size: var(--acc-font-size-xl);
    font-weight: var(--acc-font-weight-bold);
    line-height: var(--acc-line-height-tight);
    letter-spacing: -0.02em;
  }

  .acc-chat-header__sub {
    margin: var(--acc-space-1) 0 0;
    font-size: var(--acc-font-size-sm);
    color: var(--acc-color-text-muted);
  }

  .acc-chat-room {
    flex: 1 1 auto;
    min-height: 240px;
    padding: var(--acc-space-2) 0 calc(var(--acc-composer-height, 120px) + 24px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(var(--acc-composer-height, 120px) + 24px + env(safe-area-inset-bottom, 0px));
    /* Removed overflow-y: auto to allow native scrolling in .acc-feed-content */
  }

  .acc-chat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--acc-chat-list-gap, var(--acc-space-3));
  }

  .acc-chat-status {
    text-align: center;
    font-size: var(--acc-font-size-xs);
    color: var(--acc-color-text-muted);
    padding: var(--acc-space-2);
  }

  /* Jump to latest when user scrolled up and new messages arrive */
  .acc-chat-scroll-chips-wrapper {
    position: sticky;
    bottom: calc(var(--acc-composer-height, 120px) + 16px + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    margin: 0 auto var(--acc-space-2);
    width: fit-content;
  }

  .acc-chat-scroll-chips-wrapper > * {
    pointer-events: auto;
    position: relative;
    bottom: auto;
  }

  .acc-chat-new-msg-chip {
    position: sticky;
    bottom: calc(var(--acc-composer-height, 88px) + 16px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: block;
    margin: 0 auto var(--acc-space-2);
    padding: 8px 14px;
    border: 1px solid var(--acc-color-border);
    border-radius: var(--acc-radius-pill, 9999px);
    background: var(--acc-color-bg-elevated, #fff);
    color: var(--acc-color-accent-text, var(--acc-color-accent));
    font-size: var(--acc-font-size-xs);
    font-weight: var(--acc-font-weight-semibold);
    box-shadow: var(--acc-shadow-soft);
    cursor: pointer;
  }

  .acc-chat-new-msg-chip[hidden] {
    display: none !important;
  }

  .acc-chat-bubble__pending-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acc-space-2);
    justify-content: center;
    padding: var(--acc-space-2) var(--acc-chat-pad-x, 0.875rem) var(--acc-space-3);
    border-top: 1px solid color-mix(in srgb, var(--acc-color-danger, #b91c1c) 18%, transparent);
    background: color-mix(in srgb, var(--acc-color-danger, #b91c1c) 6%, transparent);
  }

  .acc-chat-bubble__pending-retry {
    font-weight: var(--acc-font-weight-semibold);
    color: var(--acc-color-accent-text, var(--acc-color-accent));
  }

  .acc-chat-loading,
  .acc-chat-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--acc-space-2);
    padding: var(--acc-space-8) var(--acc-space-4);
    color: var(--acc-color-text-muted);
    font-size: var(--acc-font-size-sm);
  }

  .acc-chat-loading[hidden],
  .acc-chat-empty[hidden],
  .acc-chat-status[hidden] {
    display: none;
  }

  /* ─── Bubbles ────────────────────────────────────────────── */

  .acc-chat-bubble {
    display: flex;
    gap: var(--acc-space-2);
    max-width: var(--acc-chat-bubble-max, min(85%, 440px));
    align-items: flex-end;
  }

  .acc-chat-bubble--self {
    align-self: flex-end;
    flex-direction: row-reverse;
  }

  .acc-chat-bubble--other {
    align-self: flex-start;
  }

  /* Optional cluster (CSS ready; JS deferred) */
  .acc-chat-bubble--continued {
    margin-top: calc(var(--acc-chat-cluster-gap, 4px) - var(--acc-chat-list-gap, 12px));
  }

  .acc-chat-bubble--continued .acc-chat-bubble__avatar {
    visibility: hidden;
  }

  .acc-chat-bubble--continued .acc-chat-bubble__author {
    display: none;
  }

  .acc-chat-bubble__avatar {
    flex-shrink: 0;
    width: var(--acc-chat-avatar, 36px);
    height: var(--acc-chat-avatar, 36px);
    border-radius: 50%;
    overflow: hidden;
    background: var(--acc-color-bg-soft);
    border: 1px solid var(--acc-color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: var(--acc-font-weight-semibold);
    color: var(--acc-color-text-muted);
  }

  /* Own avatar: reclaim horizontal space (DOM kept for a11y/structure) */
  .acc-chat-bubble--self .acc-chat-bubble__avatar {
    display: none;
  }

  .acc-chat-bubble__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .acc-chat-bubble__stack {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
  }

  .acc-chat-bubble--self .acc-chat-bubble__stack {
    align-items: flex-end;
  }

  .acc-chat-bubble__meta {
    display: flex;
    align-items: baseline;
    gap: var(--acc-space-2);
    padding: 0 var(--acc-chat-pad-x, 0.875rem);
    font-size: var(--acc-font-size-xs);
    color: var(--acc-color-text-muted);
    max-width: 100%;
  }

  .acc-chat-bubble__author {
    font-weight: var(--acc-font-weight-semibold);
    color: var(--acc-color-accent-text, var(--acc-color-text));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14ch;
  }

  .acc-chat-bubble__time {
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
    color: var(--acc-color-text-subtle, var(--acc-color-text-muted));
    flex-shrink: 0;
  }

  /* ── Body base ── */
  .acc-chat-bubble__body {
    min-width: 48px;
    font-size: var(--acc-font-size-sm);
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
    border-radius: var(--acc-chat-radius, 18px);
    box-shadow: var(--acc-chat-shadow);
    transition:
      box-shadow var(--acc-transition-fast, 0.15s ease),
      border-color var(--acc-transition-fast, 0.15s ease);
  }

  /* Text shell (default / type-text) */
  .acc-chat-bubble--type-text .acc-chat-bubble__body,
  .acc-chat-bubble:not([class*="acc-chat-bubble--type-"]) .acc-chat-bubble__body {
    padding: var(--acc-chat-pad-y, 0.5rem) var(--acc-chat-pad-x, 0.875rem);
    white-space: pre-wrap;
  }

  .acc-chat-bubble--other .acc-chat-bubble__body {
    background: var(--acc-chat-other-bg, var(--acc-color-bg-elevated));
    border: 1px solid var(--acc-chat-other-border, var(--acc-color-border));
    border-bottom-left-radius: var(--acc-chat-radius-tail, 6px);
    color: var(--acc-color-text);
  }

  /* Self TEXT: darker accent fill for AA contrast with white */
  .acc-chat-bubble--self.acc-chat-bubble--type-text .acc-chat-bubble__body,
  .acc-chat-bubble--self:not([class*="--type-image"]):not([class*="--type-video"]):not([class*="--type-thread"]) .acc-chat-bubble__body {
    background: linear-gradient(
      145deg,
      var(--acc-chat-self-bg) 0%,
      var(--acc-chat-self-bg-end) 100%
    );
    color: var(--acc-chat-self-fg, #fff);
    border: 0;
    border-bottom-right-radius: var(--acc-chat-radius-tail, 6px);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--acc-color-accent) 22%, transparent);
  }

  /* Self MEDIA / SHARE shell: elevated (content-first, not purple wash) */
  .acc-chat-bubble--self.acc-chat-bubble--type-image .acc-chat-bubble__body,
  .acc-chat-bubble--self.acc-chat-bubble--type-video .acc-chat-bubble__body,
  .acc-chat-bubble--self.acc-chat-bubble--type-video-link .acc-chat-bubble__body,
  .acc-chat-bubble--self.acc-chat-bubble--type-thread-share .acc-chat-bubble__body,
  .acc-chat-bubble--self.acc-chat-bubble--pending .acc-chat-bubble__body {
    background: var(--acc-chat-other-bg, var(--acc-color-bg-elevated));
    color: var(--acc-color-text);
    border: 1px solid var(--acc-chat-other-border, var(--acc-color-border));
    border-bottom-right-radius: var(--acc-chat-radius-tail, 6px);
    box-shadow: var(--acc-chat-shadow);
  }

  /* Media / video flush body */
  .acc-chat-bubble--type-image .acc-chat-bubble__body,
  .acc-chat-bubble--type-video .acc-chat-bubble__body,
  .acc-chat-bubble--type-video-link .acc-chat-bubble__body,
  .acc-chat-bubble--pending .acc-chat-bubble__body {
    padding: 0;
    overflow: hidden;
    white-space: normal;
    max-width: var(--acc-chat-media-max, min(100%, 320px));
  }

  .acc-chat-bubble--type-thread-share .acc-chat-bubble__body {
    padding: var(--acc-chat-pad-y, 0.5rem) var(--acc-chat-pad-x, 0.875rem);
    white-space: normal;
  }

  .acc-chat-bubble--other.acc-chat-bubble--type-image .acc-chat-bubble__body,
  .acc-chat-bubble--other.acc-chat-bubble--type-video .acc-chat-bubble__body,
  .acc-chat-bubble--other.acc-chat-bubble--type-video-link .acc-chat-bubble__body {
    border-bottom-left-radius: var(--acc-chat-radius-tail, 6px);
  }

  /* ── Reply / Quote Block ── */
  .acc-chat-bubble__quote {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    margin: 2px 0 6px 0;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, opacity 0.15s ease;
  }

  .acc-chat-bubble--other .acc-chat-bubble__quote {
    background: color-mix(in srgb, var(--acc-color-accent) 8%, var(--acc-color-bg-soft, #f8fafc));
    border-left: 3px solid var(--acc-color-accent, #8C7EFF);
  }

  .acc-chat-bubble--other .acc-chat-bubble__quote:hover {
    background: color-mix(in srgb, var(--acc-color-accent) 15%, var(--acc-color-bg-soft, #f8fafc));
  }

  .acc-chat-bubble--self .acc-chat-bubble__quote {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid rgba(255, 255, 255, 0.9);
  }

  .acc-chat-bubble--self .acc-chat-bubble__quote:hover {
    background: rgba(0, 0, 0, 0.3);
  }

  .acc-chat-bubble__quote-author {
    font-size: 0.75rem;
    font-weight: var(--acc-font-weight-semibold, 600);
    line-height: 1.2;
  }

  .acc-chat-bubble--other .acc-chat-bubble__quote-author {
    color: var(--acc-color-accent-text, var(--acc-color-accent, #8C7EFF));
  }

  .acc-chat-bubble--self .acc-chat-bubble__quote-author {
    color: #ffffff;
  }

  .acc-chat-bubble__quote-text {
    font-size: 0.8125rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .acc-chat-bubble--other .acc-chat-bubble__quote-text {
    color: var(--acc-color-text-muted, #64748b);
  }

  .acc-chat-bubble--self .acc-chat-bubble__quote-text {
    color: rgba(255, 255, 255, 0.9);
  }

  .acc-chat-bubble__quote--unavailable {
    opacity: 0.7;
    cursor: default;
    font-style: italic;
  }

  /* Caption (below media) */
  .acc-chat-caption {
    padding: var(--acc-space-2) var(--acc-chat-pad-x, 0.875rem) var(--acc-space-3);
    font-size: var(--acc-font-size-sm);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: var(--acc-color-text);
  }

  .acc-chat-bubble--other .acc-chat-caption {
    border-top: 1px solid var(--acc-color-border);
    background: transparent;
  }

  .acc-chat-bubble--self .acc-chat-caption {
    background: var(--acc-chat-caption-self-bg);
    color: var(--acc-color-text);
    border-top: 1px solid color-mix(in srgb, var(--acc-color-accent) 18%, transparent);
  }

  /* Hover polish (fine pointer) */
  @media (hover: hover) and (pointer: fine) {
    .acc-chat-bubble--other:hover .acc-chat-bubble__body {
      border-color: color-mix(in srgb, var(--acc-color-accent) 35%, var(--acc-color-border));
      box-shadow: var(--acc-shadow-soft, var(--acc-chat-shadow));
    }

    .acc-chat-bubble__media img:hover {
      filter: brightness(0.97);
    }
  }

  /* Enter animation — only nodes with --enter (gated in JS) */
  @keyframes acc-chat-bubble-in {
    from {
      opacity: 0;
      transform: translateY(6px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .acc-chat-bubble--enter {
    animation: acc-chat-bubble-in var(--acc-transition-base, 0.22s) both;
  }

  @media (prefers-reduced-motion: reduce) {
    .acc-chat-bubble--enter {
      animation: none;
    }
  }

  /* Shared spinner (history load + pending send) */
  .acc-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: acc-spin 0.7s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
  }

  .acc-chat-loading .acc-spinner {
    border-color: color-mix(in srgb, var(--acc-color-text-muted, #6b7280) 35%, transparent);
    border-top-color: var(--acc-color-accent, #6d5efc);
  }

  @media (prefers-reduced-motion: reduce) {
    .acc-spinner {
      animation: none;
      border-top-color: inherit;
      opacity: 0.7;
    }
  }

  /* Pending send (WhatsApp-style loading bubble) */
  .acc-chat-bubble--pending .acc-chat-bubble__body {
    position: relative;
  }

  .acc-chat-bubble__media--pending {
    position: relative;
    min-width: 140px;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    background: transparent;
  }

  .acc-chat-bubble__media--pending img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    object-fit: initial;
    opacity: 0.78;
    background: transparent;
  }

  .acc-chat-bubble__pending-video {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: var(--acc-chat-media-max-h, min(60vh, 420px));
    aspect-ratio: auto;
    object-fit: contain;
    opacity: 0.78;
    background: transparent;
  }

  .acc-chat-bubble__pending-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--acc-space-2);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: var(--acc-font-size-xs, 0.75rem);
    font-weight: var(--acc-font-weight-semibold, 600);
  }

  .acc-chat-bubble--pending.is-failed .acc-chat-bubble__pending-overlay {
    background: rgba(127, 29, 29, 0.58);
  }

  .acc-chat-bubble__pending-dismiss {
    display: block;
    width: 100%;
    margin: 0;
    padding: var(--acc-space-2) var(--acc-chat-pad-x, 0.875rem) var(--acc-space-3);
    text-align: center;
    font-size: var(--acc-font-size-xs);
    font-weight: var(--acc-font-weight-semibold);
    color: var(--acc-color-danger, #b91c1c);
    text-decoration: underline;
    background: color-mix(in srgb, var(--acc-color-danger) 6%, transparent);
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--acc-color-danger) 18%, transparent);
    cursor: pointer;
  }

  .acc-chat-bubble__pending-dismiss:hover,
  .acc-chat-bubble__pending-dismiss:focus-visible {
    background: var(--acc-color-danger-soft, rgba(185, 28, 28, 0.1));
    outline: none;
  }

  .acc-chat-bubble__media-missing {
    padding: var(--acc-space-3) var(--acc-chat-pad-x, 0.875rem);
    font-size: var(--acc-font-size-xs, 0.75rem);
    color: var(--acc-color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--acc-space-2);
    min-height: 72px;
    background: var(--acc-color-bg-soft);
    border: 1px dashed var(--acc-color-border);
  }

  /* Standalone Chat Actions (positioned beside bubble) */
  .acc-chat-bubble__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 2px;
    z-index: 10;
    transition:
      opacity var(--acc-transition-fast, 0.15s ease),
      transform var(--acc-transition-fast, 0.15s ease);
  }

  @media (hover: hover) and (pointer: fine) {
    .acc-chat-bubble__actions {
      opacity: 0;
      pointer-events: none;
      transform: scale(0.92);
    }

    .acc-chat-bubble:hover .acc-chat-bubble__actions,
    .acc-chat-bubble:focus-within .acc-chat-bubble__actions,
    .acc-chat-bubble__actions:has([aria-expanded="true"]) {
      opacity: 1;
      pointer-events: auto;
      transform: scale(1);
    }
  }

  @media (hover: none) {
    .acc-chat-bubble__actions {
      opacity: 0.88;
      pointer-events: auto;
    }
  }

  .acc-chat-action-btn {
    appearance: none;
    border: 1px solid var(--acc-color-border, #e2e8f0);
    background: var(--acc-color-bg-elevated, #ffffff);
    color: var(--acc-color-text-muted, #64748b);
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition:
      background-color var(--acc-transition-fast, 0.15s ease),
      color var(--acc-transition-fast, 0.15s ease),
      border-color var(--acc-transition-fast, 0.15s ease),
      transform var(--acc-transition-fast, 0.15s ease),
      box-shadow var(--acc-transition-fast, 0.15s ease);
  }

  @media (hover: hover) and (pointer: fine) {
    .acc-chat-action-btn:hover {
      color: var(--acc-color-accent, #6d5efc);
      background: var(--acc-color-bg-soft, #f8fafc);
      border-color: color-mix(in srgb, var(--acc-color-accent) 40%, var(--acc-color-border));
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
      transform: translateY(-1px);
    }
  }

  .acc-chat-action-btn:active {
    transform: scale(0.94);
  }

  .acc-chat-action-btn:focus-visible {
    outline: 2px solid var(--acc-color-accent, #6d5efc);
    outline-offset: 2px;
  }

  /* More Dropdown Menu */
  .acc-chat-more-dropdown {
    position: relative;
    display: inline-flex;
  }

  .acc-chat-action-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 160px;
    padding: 4px;
    margin: 0;
    list-style: none;
    background: var(--acc-color-bg-elevated, #ffffff);
    border: 1px solid var(--acc-color-border, #e2e8f0);
    border-radius: var(--acc-radius-md, 12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    z-index: 100;
    animation: accChatMenuPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .acc-chat-bubble--self .acc-chat-action-menu {
    left: 0;
    right: auto;
  }

  .acc-chat-action-menu.acc-chat-action-menu--down {
    top: calc(100% + 6px);
    bottom: auto;
  }

  @keyframes accChatMenuPop {
    from {
      opacity: 0;
      transform: translateY(4px) scale(0.96);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .acc-chat-action-menu[hidden] {
    display: none !important;
  }

  .acc-chat-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    border-radius: var(--acc-radius-sm, 6px);
    font-family: inherit;
    font-size: var(--acc-font-size-xs, 0.8125rem);
    font-weight: var(--acc-font-weight-medium, 500);
    color: var(--acc-color-text, #0f172a);
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--acc-transition-fast, 0.15s ease);
  }

  @media (hover: hover) and (pointer: fine) {
    .acc-chat-action-item:hover {
      background: var(--acc-color-bg-soft, #f8fafc);
      color: var(--acc-color-accent, #6d5efc);
    }

    .acc-chat-action-item.acc-dropdown__item--danger:hover {
      background: var(--acc-color-danger-soft, rgba(239, 68, 68, 0.1));
      color: var(--acc-color-danger, #ef4444);
    }
  }

  .acc-chat-action-item:focus-visible {
    outline: 2px solid var(--acc-color-accent);
    outline-offset: -2px;
  }

  .acc-chat-bubble__retain.is-retained {
    color: var(--acc-color-primary, #2563eb);
  }

  .acc-chat-bubble--retained .acc-chat-bubble__body {
    box-shadow: inset 0 0 0 1px var(--acc-color-primary-soft, rgba(37, 99, 235, 0.35));
  }

  /* Share card inside bubble — elevated readable for self & other */
  .acc-chat-share-card {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
    border: 1px solid var(--acc-color-border);
    background: var(--acc-color-bg-elevated);
    overflow: hidden;
    text-decoration: none;
    color: var(--acc-color-text);
    transition:
      box-shadow var(--acc-transition-fast),
      border-color var(--acc-transition-fast);
  }
  @media (hover: hover) and (pointer: fine) {
    .acc-chat-share-card:hover {
      border-color: var(--acc-color-accent);
      box-shadow: var(--acc-shadow-soft);
    }
  }

  .acc-chat-share-card:focus-visible {
    outline: 2px solid var(--acc-color-accent);
    outline-offset: 2px;
  }

  .acc-chat-share-card__thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--acc-color-bg-soft);
  }

  .acc-chat-share-card__body {
    padding: var(--acc-space-2) var(--acc-space-3);
  }

  .acc-chat-share-card__cat {
    font-size: var(--acc-font-size-xs);
    color: var(--acc-color-text-muted);
    margin-bottom: 2px;
  }

  .acc-chat-share-card__title {
    font-size: var(--acc-font-size-sm);
    font-weight: var(--acc-font-weight-semibold);
    line-height: var(--acc-line-height-tight);
    margin: 0 0 4px;
    color: var(--acc-color-text);
  }

  .acc-chat-share-card__excerpt {
    font-size: var(--acc-font-size-xs);
    color: var(--acc-color-text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: var(--acc-line-clamp, 2);
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .acc-chat-share-card__listing {
    margin-top: 6px;
    font-size: var(--acc-font-size-xs);
    font-weight: var(--acc-font-weight-semibold);
    color: var(--acc-color-accent-text, var(--acc-color-accent));
  }

  .acc-chat-share-card--unavailable {
    opacity: 0.7;
    pointer-events: none;
  }

  .acc-chat-share-note {
    margin-bottom: var(--acc-space-2);
    font-size: var(--acc-font-size-sm);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--acc-color-text);
  }

  /* ─── Sticky composer ────────────────────────────────────── */

  .acc-chat-composer-wrap {
    flex-shrink: 0;
    position: fixed;
    bottom: calc(16px + var(--acc-keyboard-height, 0px) + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: var(--acc-content-max, 760px);
    z-index: var(--acc-z-sticky, 40);
    padding: 0 !important;
    background: transparent !important;
    background-image: none !important;
    margin-top: auto;
    pointer-events: none;
    transition: bottom var(--acc-transition-fast);
  }

  .acc-chat-composer-wrap > * {
    pointer-events: auto;
  }

  .acc-chat-composer {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--acc-space-2);
    padding: var(--acc-space-2) var(--acc-space-3);
    border: 1px solid var(--acc-composer-border, rgba(255, 255, 255, 0.65));
    border-radius: 28px;
    background: var(--acc-composer-bg, rgba(255, 255, 255, 0.82));
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: var(--acc-composer-shadow);
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
  }

  @supports not ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
    .acc-chat-composer {
      background: var(--acc-composer-bg-solid) !important;
    }
  }

  .acc-chat-composer:focus-within {
    border-color: rgba(140, 126, 255, 0.65) !important;
    box-shadow: var(--acc-composer-shadow), var(--acc-halo-glow) !important;
    background: var(--acc-composer-bg) !important;
  }

  /* Quoted reply context bar (above media draft) */
  .acc-chat-composer__reply-context {
    display: flex;
    align-items: center;
    gap: var(--acc-space-2);
    padding: 6px var(--acc-space-3);
    border-radius: var(--acc-radius-md, 10px);
    background: var(--acc-color-accent-softer, rgba(140, 126, 255, 0.08));
    border-left: 3.5px solid var(--acc-color-accent-text, #6b5ce6);
  }

  .acc-chat-composer__reply-context[hidden] {
    display: none !important;
  }

  .acc-chat-composer__reply-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .acc-chat-composer__reply-label {
    font-size: var(--acc-font-size-xs);
    font-weight: var(--acc-font-weight-semibold);
    color: var(--acc-color-accent-text, #6b5ce6);
  }

  .acc-chat-composer__reply-name {
    font-size: var(--acc-font-size-xs);
    color: var(--acc-color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .acc-chat-composer__reply-snippet {
    font-size: var(--acc-font-size-xs);
    color: var(--acc-color-text-muted, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .acc-chat-composer__reply-cancel {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px;
    margin: 0;
    min-width: 36px;
    min-height: 36px;
    border-radius: var(--acc-radius-pill, 9999px);
    cursor: pointer;
    color: var(--acc-color-text-muted, #64748b);
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.15s ease, background 0.15s ease;
  }

  .acc-chat-composer__reply-cancel:hover,
  .acc-chat-composer__reply-cancel:focus-visible {
    background: var(--acc-color-bg-muted, rgba(100, 116, 139, 0.12));
    color: var(--acc-color-text);
    transform: rotate(90deg);
    outline: none;
  }

  /* Emoji Picker Popover */
  .acc-emoji-popover {
    position: fixed;
    bottom: calc(var(--acc-composer-height, 80px) + 24px);
    right: 16px;
    left: auto;
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: min(400px, 60vh);
    background: var(--acc-color-bg-elevated);
    border: 1px solid var(--acc-color-border);
    border-radius: var(--acc-radius-card);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    z-index: 100200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: accEmojiPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes accEmojiPopIn {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .acc-emoji-popover[hidden] {
    display: none !important;
  }

  .acc-emoji-popover__header {
    padding: var(--acc-space-2);
    border-bottom: 1px solid var(--acc-color-border);
  }

  .acc-emoji-popover__search {
    width: 100%;
    border: 1px solid var(--acc-color-border);
    border-radius: var(--acc-radius-pill);
    padding: 6px 12px;
    font-size: var(--acc-font-size-xs);
    background: var(--acc-color-bg-soft);
    color: var(--acc-color-text);
    outline: none;
    box-sizing: border-box;
  }

  .acc-emoji-popover__search:focus {
    border-color: var(--acc-color-accent);
  }

  .acc-emoji-popover__tabs {
    display: flex;
    border-bottom: 1px solid var(--acc-color-border);
    background: var(--acc-color-bg-soft);
  }

  .acc-emoji-popover__tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    opacity: 0.6;
  }

  .acc-emoji-popover__tab.is-active,
  .acc-emoji-popover__tab:hover {
    opacity: 1;
    border-bottom-color: var(--acc-color-accent);
  }

  .acc-emoji-popover__body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: var(--acc-space-2);
    overflow-y: auto;
    max-height: 200px;
    font-size: 20px;
  }

  .acc-emoji-btn {
    appearance: none;
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 6px 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, background 0.12s ease;
    user-select: none;
  }

  .acc-emoji-btn:hover,
  .acc-emoji-btn:focus-visible {
    background: var(--acc-color-accent-soft);
    transform: scale(1.25);
    outline: none;
  }

  .acc-chat-composer__tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
  }

  .acc-chat-composer__tool {
    min-width: 36px;
    min-height: 36px;
    padding: 8px;
    border-radius: 50%;
    color: var(--acc-color-text-muted);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    touch-action: manipulation;
  }

  .acc-chat-composer__tool:hover {
    background: var(--acc-color-accent-softer, rgba(140, 126, 255, 0.1));
    color: var(--acc-color-accent-text, #6b5ce6);
    transform: scale(1.08);
  }

  .acc-chat-composer__tool:focus-visible {
    outline: 2px solid var(--acc-color-accent);
    outline-offset: 2px;
  }

  .acc-chat-composer__row {
    display: flex;
    align-items: flex-end;
    gap: var(--acc-space-2);
    width: 100%;
  }

  .acc-chat-composer__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0 !important;
    background: transparent !important;
    resize: none;
    outline: none !important;
    box-shadow: none !important;
    font-family: var(--acc-font-family);
    font-size: 0.9375rem;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: var(--acc-color-text);
    max-height: 120px;
    padding: 6px 0;
    min-height: 36px;
  }

  .acc-chat-composer__input:focus-visible {
    outline: none !important;
  }

  .acc-chat-composer__input::placeholder {
    color: var(--acc-color-text-subtle);
    opacity: 0.8;
  }

  .acc-chat-composer__char-count {
    font-size: var(--acc-font-size-xs);
    color: var(--acc-color-text-muted);
    align-self: center;
    padding: 0 4px;
    opacity: 0.85;
    font-weight: 500;
  }

  .acc-chat-composer__char-count.is-warning {
    color: var(--acc-color-warning);
    font-weight: 600;
    opacity: 1;
  }

  .acc-chat-composer__send {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--acc-color-brand-purple, #8c7eff) !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(140, 126, 255, 0.4) !important;
    cursor: pointer;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    touch-action: manipulation;
  }

  @media (hover: hover) and (pointer: fine) {
    .acc-chat-composer__send:hover:not(:disabled) {
      background: var(--acc-color-brand-purple-hover, #7a6aef) !important;
      transform: scale(1.08) translateY(-2px);
      box-shadow: 0 8px 22px rgba(140, 126, 255, 0.55) !important;
    }
    .acc-chat-composer__send:hover:not(:disabled) svg {
      transform: rotate(-12deg) scale(1.1);
    }
  }

  .acc-chat-composer__send:active:not(:disabled) {
    background: var(--acc-color-brand-purple-active, #6b5ce6) !important;
    transform: scale(0.92) translateY(0);
  }

  .acc-chat-composer__send svg {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .acc-chat-composer__send:disabled {
    background: rgba(0, 0, 0, 0.06);
    color: var(--acc-color-text-subtle);
    box-shadow: none;
    transform: scale(0.92);
    cursor: not-allowed;
    opacity: 0.5;
  }

  .acc-chat-composer__send:disabled svg {
    transform: scale(0.9);
  }

  .acc-chat-composer__send:not(:disabled):hover {
    transform: scale(1.08) translateY(-1px);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--acc-color-accent-text, #6b5ce6) 50%, transparent);
  }

  .acc-chat-composer__send:not(:disabled):hover svg {
    transform: rotate(-12deg) scale(1.08);
  }

  .acc-chat-composer__send:not(:disabled):active {
    transform: scale(0.94);
  }

  .acc-chat-composer-wrap__notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--acc-space-3);
    flex-wrap: wrap;
    padding: var(--acc-space-3) var(--acc-space-4);
    border-radius: 20px;
    border: 1px solid var(--acc-color-border);
    background: var(--acc-color-bg-elevated);
    font-size: var(--acc-font-size-sm);
    color: var(--acc-color-text-muted);
    text-align: center;
  }

  /* When chat page is in feed column, hide default sticky thread composer spacing if needed */
  .acc-page-chat + .acc-composer-sticky,
  .acc-feed-content:has(.acc-page-chat) ~ .acc-composer-sticky {
    display: none;
  }

  @media (max-width: 768px) {
    .acc-page-chat {
      --acc-chat-avatar: 32px;
      --acc-chat-bubble-max: 90%;
      --acc-chat-media-max: 100%;
      --acc-chat-list-gap: var(--acc-space-2);
    }

    .acc-chat-bubble--self .acc-chat-bubble__actions,
    .acc-chat-bubble--other .acc-chat-bubble__actions {
      position: static;
      opacity: 1;
      pointer-events: auto;
      margin-top: 4px;
      background: transparent;
      border: none;
      box-shadow: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      padding: 0;
    }
  }

  @media (max-width: 360px) {
    .acc-page-chat {
      --acc-chat-pad-x: 0.625rem;
    }
  }

  /* ─── UI/UX Enhancements & Scoped Enhancements ─────────────── */

  /* Presence Badge in Room Header */
  .acc-chat-header__presence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--acc-space-1);
    font-size: var(--acc-font-size-xs);
    color: var(--acc-color-text-muted);
  }

  .acc-chat-header__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    animation: acc-pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  @keyframes acc-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
  }

  /* Touch Targets (WCAG AA 44x44px Minimum) */
  .acc-chat-composer__reply-cancel,
  .acc-chat-composer__draft-remove {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  .acc-chat-new-msg-chip {
    min-height: 44px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  /* Monospace Code Block Scoped Formatting */
  .acc-chat-bubble pre {
    margin: var(--acc-space-2) 0;
    padding: var(--acc-space-2) var(--acc-space-3);
    background: color-mix(in srgb, var(--acc-color-bg-soft, #f1f5f9) 85%, #0f172a);
    border: 1px solid var(--acc-color-border, #e2e8f0);
    border-radius: var(--acc-radius-md, 8px);
    overflow-x: auto;
    font-family: var(--acc-font-family-mono, monospace);
    font-size: 0.8125rem;
    line-height: 1.4;
  }

  .acc-chat-bubble--self pre {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f8fafc;
  }

  .acc-chat-bubble code {
    font-family: var(--acc-font-family-mono, monospace);
    font-size: 0.8125rem;
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* Micro-Reaction Pill Badge System */
  .acc-chat-reactions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    padding: 0 var(--acc-chat-pad-x, 0.875rem);
  }

  .acc-chat-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 8px 0 6px;
    border-radius: 9999px;
    background: var(--acc-color-bg-elevated, #ffffff);
    border: 1px solid var(--acc-color-border, #e2e8f0);
    font-size: 11px;
    font-weight: var(--acc-font-weight-semibold, 600);
    color: var(--acc-color-text-muted, #64748b);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.15s ease, background-color 0.15s ease;
  }

  .acc-chat-reaction-pill:hover {
    transform: scale(1.06);
  }

  .acc-chat-reaction-pill.is-active {
    background: color-mix(in srgb, var(--acc-color-accent, #6d5efc) 12%, #fff);
    border-color: color-mix(in srgb, var(--acc-color-accent, #6d5efc) 40%, transparent);
    color: var(--acc-color-accent-text, var(--acc-color-accent));
  }

  /* Mobile Swipe-to-Reply Gesture Indicator */
  .acc-chat-bubble {
    touch-action: pan-y;
  }

  .acc-chat-bubble.is-swiping .acc-chat-bubble__body {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .acc-chat-swipe-indicator {
    position: absolute;
    left: -36px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    opacity: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--acc-color-accent, #6d5efc);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, opacity 0.15s ease;
    pointer-events: none;
  }

  .acc-chat-bubble.is-swiping .acc-chat-swipe-indicator {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }

  /* Long-Press Action Sheet & Backdrop Blur Overlay */
  .acc-chat-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100090;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: acc-fade-in 0.18s ease-out;
  }

  .acc-chat-action-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100100;
    background: var(--acc-color-bg-elevated, #ffffff);
    border-radius: 20px 20px 0 0;
    padding: var(--acc-space-4);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
    animation: acc-slide-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .acc-chat-reaction-picker {
    display: flex;
    justify-content: space-around;
    padding-bottom: var(--acc-space-3);
    margin-bottom: var(--acc-space-3);
    border-bottom: 1px solid var(--acc-color-border, #e2e8f0);
  }

  .acc-chat-reaction-btn {
    appearance: none;
    border: none;
    background: transparent;
    font-size: 24px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.15s ease;
  }

  .acc-chat-reaction-btn:hover,
  .acc-chat-reaction-btn:active {
    transform: scale(1.25);
    background: var(--acc-color-bg-soft);
  }

  @keyframes acc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes acc-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Screen Reader Announcer Utility */
  .acc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* ── Skeleton Loading Shimmer ── */
  .acc-chat-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--acc-space-3);
    width: 100%;
    padding: var(--acc-space-4) 0;
  }

  .acc-chat-skeleton__item {
    display: flex;
    align-items: flex-end;
    gap: var(--acc-space-2);
    width: 100%;
  }

  .acc-chat-skeleton__item--self {
    justify-content: flex-end;
  }

  .acc-chat-skeleton__avatar {
    width: var(--acc-chat-avatar, 36px);
    height: var(--acc-chat-avatar, 36px);
    border-radius: 50%;
    background: var(--acc-color-bg-soft, #e2e8f0);
    flex-shrink: 0;
  }

  .acc-chat-skeleton__bubble {
    height: 40px;
    border-radius: var(--acc-chat-radius, 18px);
    background: linear-gradient(
      90deg,
      var(--acc-color-bg-soft, #f1f5f9) 25%,
      color-mix(in srgb, var(--acc-color-bg-soft, #f1f5f9) 70%, #ffffff) 50%,
      var(--acc-color-bg-soft, #f1f5f9) 75%
    );
    background-size: 200% 100%;
    animation: acc-shimmer 1.6s infinite ease-in-out;
  }

  .acc-chat-skeleton__bubble--w-60 { width: min(60%, 280px); }
  .acc-chat-skeleton__bubble--w-40 { width: min(40%, 200px); }
  .acc-chat-skeleton__bubble--w-80 { width: min(80%, 360px); }

  @keyframes acc-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .acc-chat-loading__status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--acc-space-2);
    margin-top: var(--acc-space-2);
  }

  /* ── Drag & Drop Overlay Zone ── */
  .acc-chat-dropzone {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px dashed var(--acc-color-accent, #6d5efc);
    border-radius: var(--acc-radius-lg, 12px);
    padding: var(--acc-space-4);
    animation: acc-fade-in 0.15s ease-out;
  }

  .acc-chat-dropzone[hidden] {
    display: none !important;
  }

  .acc-chat-dropzone__content {
    text-align: center;
    color: #ffffff;
    pointer-events: none;
  }

  .acc-chat-dropzone__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--acc-color-accent, #6d5efc) 30%, transparent);
    color: #ffffff;
    margin-bottom: var(--acc-space-2);
    animation: acc-pulse-drop 1.4s infinite ease-in-out;
  }

  @keyframes acc-pulse-drop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
  }

  .acc-chat-dropzone__text {
    margin: 0;
    font-size: var(--acc-font-size-base, 1rem);
    font-weight: var(--acc-font-weight-semibold, 600);
  }

  /* ── Lightbox Image Modal ── */
  .acc-chat-lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--acc-z-lightbox, 100300);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .acc-chat-lightbox[hidden] {
    display: none !important;
  }

  .acc-chat-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 14, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: acc-fade-in 0.2s ease-out;
  }

  .acc-chat-lightbox__container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    max-width: min(92vw, 1000px);
    max-height: min(90vh, 800px);
    width: 100%;
    background: var(--acc-color-bg-elevated, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--acc-radius-xl, 16px);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: acc-pop-modal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes acc-pop-modal {
    from {
      opacity: 0;
      transform: scale(0.94) translateY(12px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  .acc-chat-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--acc-space-3) var(--acc-space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
  }

  .acc-chat-lightbox__author {
    font-size: var(--acc-font-size-sm, 0.875rem);
    font-weight: var(--acc-font-weight-semibold, 600);
  }

  .acc-chat-lightbox__actions {
    display: flex;
    align-items: center;
    gap: var(--acc-space-2);
  }

  .acc-chat-lightbox__actions .acc-btn {
    color: #ffffff;
    opacity: 0.85;
  }

  .acc-chat-lightbox__actions .acc-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
  }

  .acc-chat-lightbox__body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--acc-space-3);
    overflow: hidden;
    background: #09090b;
  }

  .acc-chat-lightbox__img {
    max-width: 100%;
    max-height: calc(80vh - 100px);
    object-fit: contain;
    border-radius: var(--acc-radius-md, 8px);
    transition: transform 0.2s ease;
  }

  .acc-chat-lightbox__caption {
    padding: var(--acc-space-3) var(--acc-space-4);
    background: rgba(0, 0, 0, 0.4);
    color: #f8fafc;
    font-size: var(--acc-font-size-sm, 0.875rem);
    line-height: 1.45;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* ── Parent Message Jump Flash Glow ── */
  .acc-chat-bubble--parent-flash .acc-chat-bubble__body {
    animation: acc-reply-flash 1.8s ease-out;
  }

  @keyframes acc-reply-flash {
    0% {
      box-shadow: 0 0 0 3px var(--acc-color-accent, #6d5efc), 0 0 20px color-mix(in srgb, var(--acc-color-accent, #6d5efc) 50%, transparent);
      transform: scale(1.02);
    }
    50% {
      box-shadow: 0 0 0 3px var(--acc-color-accent, #6d5efc), 0 0 12px color-mix(in srgb, var(--acc-color-accent, #6d5efc) 30%, transparent);
    }
    100% {
      box-shadow: var(--acc-chat-shadow);
      transform: scale(1);
    }
  }

  /* ── Return to Bottom Floating Chip ── */
  .acc-chat-return-chip {
    position: sticky;
    bottom: calc(130px + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto var(--acc-space-2);
    padding: 8px 16px;
    border: 1px solid var(--acc-color-accent, #6d5efc);
    border-radius: var(--acc-radius-pill, 9999px);
    background: var(--acc-color-accent, #6d5efc);
    color: #ffffff;
    font-size: var(--acc-font-size-xs, 0.75rem);
    font-weight: var(--acc-font-weight-semibold, 600);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--acc-color-accent, #6d5efc) 35%, transparent);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
  }

  .acc-chat-return-chip:hover {
    transform: translateY(-2px);
    background: color-mix(in srgb, var(--acc-color-accent, #6d5efc) 88%, #000);
  }

  .acc-chat-return-chip[hidden] {
    display: none !important;
  }

  /* ── Desktop Floating Context Action Bar ── */
  @media (hover: hover) and (pointer: fine) {
    .acc-chat-bubble__floating-bar {
      position: absolute;
      top: -16px;
      display: inline-flex;
      align-items: center;
      gap: 2px;
      padding: 3px 6px;
      background: var(--acc-color-bg-elevated, #ffffff);
      border: 1px solid var(--acc-color-border, rgba(0, 0, 0, 0.12));
      border-radius: var(--acc-radius-pill, 9999px);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
      opacity: 0;
      pointer-events: none;
      transform: translateY(4px);
      transition: opacity 0.18s ease, transform 0.18s ease;
      z-index: 20;
    }

    .acc-chat-bubble--self .acc-chat-bubble__floating-bar {
      left: 12px;
    }

    .acc-chat-bubble--other .acc-chat-bubble__floating-bar {
      right: 12px;
    }

    .acc-chat-bubble:hover .acc-chat-bubble__floating-bar,
    .acc-chat-bubble:focus-within .acc-chat-bubble__floating-bar {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    .acc-chat-bubble__floating-btn {
      appearance: none;
      border: 0;
      background: transparent;
      padding: 4px 8px;
      font-size: 13px;
      line-height: 1;
      cursor: pointer;
      border-radius: var(--acc-radius-pill, 9999px);
      color: var(--acc-color-text-muted, #64748b);
      transition: background-color 0.12s ease, transform 0.12s ease;
    }

    .acc-chat-bubble__floating-btn:hover {
      background: var(--acc-color-bg-soft, #f1f5f9);
      color: var(--acc-color-text, #0f172a);
      transform: scale(1.15);
    }
  }

  /* ── Reduced Motion Accessibility Overrides ── */
  @media (prefers-reduced-motion: reduce) {
    .acc-chat-skeleton__bubble,
    .acc-chat-dropzone__icon,
    .acc-chat-bubble--enter,
    .acc-chat-bubble--parent-flash .acc-chat-bubble__body,
    .acc-chat-lightbox__container,
    .acc-chat-lightbox__backdrop,
    .acc-chat-action-sheet {
      animation: none !important;
      transition: none !important;
    }
  }

  /* ── High Contrast Accessibility Fallback ── */
  @media (prefers-contrast: more) {
    .acc-chat-bubble--other .acc-chat-bubble__body {
      background: #ffffff !important;
      border: 2px solid #000000 !important;
      color: #000000 !important;
    }

    .acc-chat-bubble--self.acc-chat-bubble--type-text .acc-chat-bubble__body {
      background: #000000 !important;
      color: #ffffff !important;
      border: 2px solid #ffffff !important;
    }
  }



