/* ==========================================================================
   IRONITT v2 — Whispers (direct messages)
   --------------------------------------------------------------------------
   The conversation itself: header extras, bubbles, replies, shared posts,
   Notes, the phone's whisper list and the avatar strip shown when the
   chats column is closed. The frame (header bar, composer) is in
   communication.css; the call stage stays with the voice surface.

   Bubbles are the one place colour fills a shape in chat: yours sit on the
   accent's softest step, theirs on the surface fill. Nothing floats here,
   so nothing has a shadow, and nothing animates in on render (re-renders
   would replay it for every bubble).
   JS contracts kept: .own/.other and .cluster-start/.cluster-end on rows;
   .visible on the jump button; .mobile-dm-list-open on .dms-panel;
   .reply-bar is rebuilt by _renderReplyBar for channels and whispers.
   ========================================================================== */

/* ---- Layout ------------------------------------------------------------ */
.dm-chat-main,
.dm-messages-area,
.dm-messages-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dm-conversation-col {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
}
.dm-messages-area.with-thread { flex-direction: row; gap: var(--space-sm); min-width: 0; }
.dm-messages-area.with-thread > .thread-panel { flex: 0 0 clamp(320px, 38%, 420px); min-width: 0; }

/* ---- Header extras ------------------------------------------------------ */
.dm-thread-recipient {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-thread-header .iron-ai-trigger,
.dm-call-start-btn { height: 34px; }
.dm-call-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.dm-call-start-btn:hover { border-color: var(--border-strong); background: var(--bg-hover); color: var(--text-primary); }
.dm-call-start-btn:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.dm-mobile-list-back { display: none; }

/* ---- Bubbles ------------------------------------------------------------ */
.dm-bubble-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  padding: var(--space-md) var(--space-lg);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.dm-bubble-row { display: flex; align-items: flex-end; gap: var(--space-sm); max-width: 72%; }
.dm-bubble-row.own { align-self: flex-end; flex-direction: row-reverse; }
.dm-bubble-row.other { align-self: flex-start; }
.dm-bubble-row.cluster-end { margin-bottom: var(--space-sm); }

.dm-bubble-stack { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.dm-bubble-row.own .dm-bubble-stack { align-items: flex-end; }
.dm-bubble-row.other .dm-bubble-stack { align-items: flex-start; }

.dm-bubble-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-bottom: 22px;           /* sits beside the bubble, above the time */
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
}
.dm-bubble-avatar-spacer { flex: 0 0 28px; width: 28px; }

.dm-bubble {
  position: relative;
  min-width: 0;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.dm-bubble.own { background: var(--accent-subtle); }
.dm-bubble.other { background: var(--bg-secondary); }
/* A cluster reads as one block: the corners that face each other tighten. */
.dm-bubble-row.own:not(.cluster-start) .dm-bubble { border-top-right-radius: var(--radius-sm); }
.dm-bubble-row.own:not(.cluster-end) .dm-bubble { border-bottom-right-radius: var(--radius-sm); }
.dm-bubble-row.other:not(.cluster-start) .dm-bubble { border-top-left-radius: var(--radius-sm); }
.dm-bubble-row.other:not(.cluster-end) .dm-bubble { border-bottom-left-radius: var(--radius-sm); }
.thread-root .dm-bubble { max-width: 100%; }

.dm-bubble-content strong { color: var(--text-primary); font-weight: var(--font-weight-semibold); }
.dm-bubble-content del { opacity: 0.6; }
.dm-bubble-content--embed { padding: 0; background: transparent; }
.dm-bubble .reaction-row { margin-top: var(--space-xs); }
.dm-bubble:hover .reaction-add-btn { opacity: 1; }

.dm-bubble-time { margin-top: 4px; color: var(--text-muted); font-size: var(--font-size-2xs); font-variant-numeric: tabular-nums; }
.dm-bubble-row.own .dm-bubble-time { text-align: right; }
/* Read receipts (js/communication.js _paintDMTicks): one tick sent, two seen. */
.dm-tick { display: inline-block; margin-left: 4px; color: var(--text-muted); font-size: 0.95em; }
.dm-tick[hidden] { display: none; }
.dm-tick.is-seen { color: var(--accent-color); }
.light-mode .dm-tick.is-seen { color: var(--accent-solid); }
.dm-edited-tag { color: var(--text-muted); font-size: var(--font-size-2xs); }

.dm-bubble-menu-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-round);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 150ms ease, color 150ms ease;
}
.dm-bubble:hover .dm-bubble-menu-btn,
.dm-bubble-menu-btn:focus-visible { opacity: 1; }
.dm-bubble-menu-btn:hover { color: var(--text-primary); }
@media (hover: none) { .dm-bubble-menu-btn { display: none; } }

/* A quoted message inside a reply. */
.dm-reply-quote {
  display: grid;
  gap: 1px;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-left: 2px solid var(--accent-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-hover);
  font-size: var(--font-size-xs);
  line-height: 1.4;
}
.dm-reply-quote-author { color: var(--accent-color); font-size: var(--font-size-2xs); font-weight: var(--font-weight-semibold); }
.dm-reply-quote-text { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }

/* ---- Replying to … (channels and whispers) ------------------------------ */
/* Sits on top of the round composer as one piece with it. */
.chat-input-area .reply-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0 var(--space-md) -1px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border-color);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
}
.reply-bar > i { flex-shrink: 0; font-size: 12px; }
.reply-bar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar-text strong { color: var(--text-primary); font-weight: var(--font-weight-semibold); }
.reply-bar-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--radius-round);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.reply-bar-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* The field inside the composer never draws its own ring; the round field
   shows focus as a whole. */
.chat-input-wrapper input:focus,
.chat-input-wrapper input:focus-visible { outline: 0; box-shadow: none; }
.chat-input-wrapper:focus-within { border-color: var(--accent-color); }

/* ---- Jump to latest (floats over the messages) -------------------------- */
.dm-scroll-bottom-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-round);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transform: translate(-50%, 6px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.dm-scroll-bottom-btn.visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.dm-scroll-bottom-btn:hover { color: var(--text-primary); }

/* ---- A post shared into a whisper -------------------------------------- */
.dm-post-embed {
  display: grid;
  gap: var(--space-sm);
  max-width: 380px;
  margin-top: var(--space-xs);
  padding: var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color 150ms ease;
}
.dm-post-embed:hover { border-color: var(--border-strong); }
.dm-post-embed-header { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.dm-post-embed-avatar { flex-shrink: 0; width: 36px; height: 36px; font-size: var(--font-size-sm); }
.dm-post-embed-meta { flex: 1; min-width: 0; }
.dm-post-embed-author { overflow: hidden; color: var(--text-primary); font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.dm-post-embed-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--text-muted); font-size: var(--font-size-xs); }
.dm-post-embed-sub i { color: var(--accent-color); font-size: var(--font-size-2xs); }
.dm-post-embed-content {
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.dm-post-embed-footer { display: flex; justify-content: flex-end; }
.dm-post-embed-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.dm-post-embed-open:hover,
.dm-post-embed:hover .dm-post-embed-open { background: var(--bg-hover); color: var(--accent-color); }

/* ---- Notes: flat cards, full width -------------------------------------- */
.dm-bubble.note-rect {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  transition: border-color 150ms ease;
}
.dm-bubble.note-rect:hover,
.dm-bubble.note-rect.pinned { border-color: var(--border-strong); }
.dm-bubble.note-rect .dm-bubble-menu-btn,
.dm-bubble.note-rect .dm-bubble-time { display: none; }

/* ---- Empty and loading -------------------------------------------------- */
.dm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 100%;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}
.dm-empty i { color: var(--text-muted); font-size: var(--font-size-lg); }
.dm-empty p { max-width: 40ch; margin: 0; line-height: 1.5; }
.dm-empty b { color: var(--text-primary); }

.dm-loading-state { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-lg); pointer-events: none; }
.dm-loading-row { display: flex; align-items: center; gap: var(--space-sm); }
.dm-loading-row.own { justify-content: flex-end; }
.dm-loading-row .sk { background: var(--bg-tertiary); }
.dm-loading-row .sk-icon { width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--radius-round); }
.dm-loading-row .sk-line { height: 34px; max-width: min(360px, 60vw); border-radius: var(--radius-lg); }

/* ---- Avatar strip (chats column closed) --------------------------------- */
.dm-avatar-strip {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}
.dm-avatar-strip::-webkit-scrollbar { display: none; }
.dm-strip-item { display: flex; flex-direction: column; flex-shrink: 0; align-items: center; gap: 4px; cursor: pointer; }
.dm-strip-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.dm-strip-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border: 2px solid transparent;
  background: var(--bg-secondary);
  color: var(--accent-color);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  transition: border-color 150ms ease;
}
.dm-strip-item:hover .dm-strip-avatar { border-color: var(--border-strong); }
.dm-strip-item.active .dm-strip-avatar { border-color: var(--accent-color); }
.dm-strip-item.notes-dm .dm-strip-avatar { color: var(--text-secondary); }
.dm-strip-item.notes-dm .dm-strip-avatar i { font-size: 18px; }
.dm-strip-name { max-width: 64px; overflow: hidden; color: var(--text-muted); font-size: var(--font-size-2xs); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.dm-strip-item.active .dm-strip-name { color: var(--text-primary); font-weight: var(--font-weight-semibold); }
.dm-strip-status { display: none; max-width: 100%; color: var(--text-muted); font-size: var(--font-size-2xs); }
.dm-strip-status.has-emoji,
.dm-strip-status.has-text,
.dm-strip-status.has-activity { display: inline-flex; }
.dm-strip-status .status-text:not(:empty) { display: inline; }
.dm-strip-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
  border-radius: var(--radius-pill);
  background: var(--accent-color);
  color: var(--accent-text);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-bold);
}

/* ---- Phones: the whisper list, then one conversation -------------------- */
.dm-mobile-list { display: none; }
@media (max-width: 768px) {
  .dm-avatar-strip { display: none; }
  .dms-panel.mobile-dm-list-open .dm-mobile-list { display: flex; }
  .dms-panel.mobile-dm-list-open .dm-chat-main { display: none; }

  .dm-mobile-list {
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: var(--space-sm) var(--space-md) 0;
    overflow: hidden;
  }
  .dm-mobile-list-header { display: grid; flex-shrink: 0; gap: var(--space-md); padding: var(--space-sm) 0 var(--space-md); }
  .dm-mobile-list-heading { display: flex; align-items: center; gap: var(--space-sm); }
  .dm-mobile-list-heading h2 { margin: 0; color: var(--text-primary); font-family: var(--font-display); font-size: var(--font-size-xl); font-weight: var(--font-weight-bold); }
  .dm-mobile-list-count { color: var(--text-muted); font-size: var(--font-size-sm); font-variant-numeric: tabular-nums; }
  .dm-mobile-list-search {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: border-color 150ms ease;
  }
  .dm-mobile-list-search:focus-within { border-color: var(--accent-color); }
  .dm-mobile-list-search input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--font-size-md); }
  .dm-mobile-list-search input:focus-visible { box-shadow: none; }
  .dm-mobile-list-search input::placeholder { color: var(--text-muted); }

  .dm-mobile-list-rows {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 0 var(--space-xl);
    overflow-y: auto;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .dm-mobile-list-rows::-webkit-scrollbar { display: none; }
  .dm-mobile-list-item {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 68px;
    padding: 10px var(--space-md);
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    transition: background-color 150ms ease;
  }
  .dm-mobile-list-item:active { background: var(--bg-tertiary); }
  .dm-mobile-list-item:focus-visible { background: var(--bg-hover); outline: 0; }
  .dm-mobile-list-item[hidden] { display: none; }
  .dm-mobile-list-avatar {
    position: relative;
    border: 0;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    color: var(--accent-color);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
  }
  .dm-mobile-list-avatar .status-dot { right: 0; bottom: 0; border-color: var(--bg-primary); }
  .dm-mobile-list-copy { display: grid; flex: 1; gap: 2px; min-width: 0; }
  .dm-mobile-list-top,
  .dm-mobile-list-bottom { display: flex; gap: var(--space-sm); min-width: 0; }
  .dm-mobile-list-top { align-items: baseline; }
  .dm-mobile-list-bottom { align-items: center; }
  .dm-mobile-list-name,
  .dm-mobile-list-preview { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dm-mobile-list-name { color: var(--text-primary); font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); }
  .dm-mobile-list-preview,
  .dm-mobile-list-time { color: var(--text-muted); font-size: var(--font-size-xs); }
  .dm-mobile-list-time { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
  .dm-mobile-list-unread {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--accent-color);
    color: var(--accent-text);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-bold);
  }

  .dm-mobile-list-back {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--radius-round);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 150ms ease;
  }
  .dm-mobile-list-back:hover,
  .dm-mobile-list-back:focus-visible { background: var(--bg-hover); outline: 0; }
  .communication-view:not(.comm-menu-open) .comm-back-btn.dm-detail-open { display: none; }

  /* Opening a conversation: a short fade, once. */
  .dm-chat-main.dm-mobile-conversation-enter { animation: dm-mobile-conversation-enter 180ms ease both; }

  .chat-input-area .reply-bar { margin: 0 var(--space-sm) -1px; }
}
@media (max-width: 900px) {
  .dm-messages-area.with-thread { gap: 0; }
  .dm-messages-area.with-thread > .dm-conversation-col { display: none; }
  .dm-messages-area.with-thread > .thread-panel { flex: 1 1 auto; border-left: 0; }
}
@media (max-width: 640px) {
  .dm-bubble-messages { padding: var(--space-sm) var(--space-md); }
  .dm-bubble-row { max-width: 88%; }
}

/* The name is a JS contract: the animationend handler removes the class. */
@keyframes dm-mobile-conversation-enter { from { opacity: 0.72; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .dm-chat-main.dm-mobile-conversation-enter { animation: none; }
  .dm-mobile-list-rows { scroll-behavior: auto; }
  .dm-scroll-bottom-btn { transition: opacity 120ms ease; }
}

/* Desktop: the conversation uses the whole pane, its header line runs edge to
   edge (owner, 2026-11-02: it used a narrow centred strip). */
@media (min-width: 1001px) {
  .dm-conversation-col { max-width: none; }
}

/* ---- A big file sent with ITT Share (js/itt-share-bridge.js) ------------ */
.itt-share-card {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
/* The card is the message's surface: the bubble around it steps back (no box in a box). */
.dm-bubble:has(> .itt-share-card) { padding: 0; background: none; }
/* A picture is the message's surface too: no bubble padding/fill around it. */
.dm-bubble:has(> .msg-attachment--image):not(:has(> .dm-bubble-content)) { padding: 0; background: none; }
.dm-bubble > .itt-share-card { margin-top: 0; }
.itt-share-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.itt-share-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.itt-share-card__name { overflow: hidden; color: var(--text-primary); font-weight: var(--font-weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.itt-share-card__meta { color: var(--text-muted); font-size: var(--font-size-xs); }
.itt-share-card__btn {
  flex: none;
  min-width: 84px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--itt-share-cyan);
  color: var(--itt-share-ink);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
}
.itt-share-card__btn:hover:not(:disabled) { background: var(--itt-share-cyan-hover); }
/* The "Send with ITT Share?" question (App.confirm, js/itt-share-bridge.js): every
   accent in it, the focus ring on Cancel included, is ITT Share's cyan. */
.confirm-modal.itt-share-ask {
  --accent-color: var(--itt-share-cyan);
  --accent-hover: var(--itt-share-cyan-hover);
  --accent-text: var(--itt-share-ink);
  --accent-subtle: color-mix(in srgb, var(--itt-share-cyan) 16%, transparent);
  --focus-ring-inner: var(--itt-share-cyan);
  --focus-ring: 0 0 0 var(--focus-ring-w) var(--focus-ring-inner),
                0 0 0 calc(var(--focus-ring-w) * 2) var(--focus-ring-outer);
}
.itt-share-card__btn:disabled { background: var(--bg-tertiary); color: var(--text-secondary); }

/* ---- A file dragged over an open chat (js/file-upload-card.js initPageDrop) ---- */
.fuc-page-drop {
  position: fixed;
  inset: var(--space-md);
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent-color);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-primary) 72%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
html.fuc-page-drag .fuc-page-drop { opacity: 1; }
.fuc-page-drop__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}
.fuc-page-drop__label i { color: var(--accent-color); }
@media (prefers-reduced-motion: reduce) { .fuc-page-drop { transition: none; } }

/* ---- Sending: your message springs out of its corner (owner, 2026-11-04) ----
   Whispers grow from the bottom right, Nest messages from the bottom left.
   One shot, 240ms, transform/opacity; reduced motion turns it off. */
@keyframes msg-sent-spring {
  from { opacity: 0; transform: scale(0.55); }
  45%  { opacity: 1; }
  to   { opacity: 1; transform: none; }
}
.dm-bubble-row.own.is-sent .dm-bubble {
  transform-origin: 100% 100%;
  animation: msg-sent-spring 240ms var(--island-ease-spring) both;
}
.message-group-item.is-sent,
.message-group.is-sent .message-group-item {
  transform-origin: 0 100%;
  animation: msg-sent-spring 240ms var(--island-ease-spring) both;
}
.message-group.is-new.is-sent { animation: none; }
html.reduced-motion .dm-bubble-row.own.is-sent .dm-bubble,
html.reduced-motion .message-group-item.is-sent,
html.reduced-motion .message-group.is-sent .message-group-item { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .dm-bubble-row.own.is-sent .dm-bubble,
  .message-group-item.is-sent,
  .message-group.is-sent .message-group-item { animation: none; }
}

/* ---- Who has seen a message (right click > Info) ---- */
.readers-modal { width: min(420px, calc(100vw - 2 * var(--space-md))); }
.readers-count { margin-bottom: var(--space-sm); color: var(--text-muted); font-size: var(--font-size-sm); }
.readers-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.readers-row { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--border-color); }
.readers-row:last-child { border-bottom: 0; }
.readers-avatar { width: 32px; height: 32px; flex: none; font-size: var(--font-size-sm); }
.readers-name { flex: 1; min-width: 0; overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }
.readers-tick { color: var(--accent-color); font-size: var(--font-size-xs); }
.light-mode .readers-tick { color: var(--accent-solid); }
.readers-empty { display: flex; align-items: center; gap: var(--space-sm); color: var(--text-muted); }

/* ---- Group Whispers (js/group-whispers.js) ---- */
.dm-bubble-sender { margin: 0 0 2px 12px; color: var(--text-secondary); font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); }
.group-modal { width: min(460px, calc(100vw - 2 * var(--space-md))); }
.group-search { display: flex; align-items: center; gap: var(--space-sm); height: 40px; margin-bottom: var(--space-sm); padding: 0 14px; border: 1px solid var(--border-color); border-radius: var(--radius-pill); background: var(--bg-input); color: var(--text-muted); }
.group-search:focus-within { border-color: var(--accent-color); }
.group-search input, .group-search input:focus, .group-search input:focus-visible { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; box-shadow: none; outline: 0; }
.group-list { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; }
.group-list > li { list-style: none; }
.group-list > li[hidden] { display: none; }
.group-row, .group-modal label.group-row { display: flex; align-items: center; width: 100%; margin: 0; text-transform: none; letter-spacing: normal; font-weight: var(--font-weight-regular, 400); color: inherit; font-size: var(--font-size-sm); gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--border-color); cursor: default; }
.group-list > li:last-child .group-row, .group-list > .group-row:last-child { border-bottom: 0; }
label.group-row { cursor: pointer; }
.group-row-avatar { width: 32px; height: 32px; flex: none; font-size: var(--font-size-sm); }
.group-row-name { flex: 1; min-width: 0; overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }
.group-modal input.group-check { flex: none; width: 18px; min-width: 0; height: 18px; padding: 0; border: 0; accent-color: var(--accent-color); }
.group-tag { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--bg-tertiary); color: var(--text-secondary); font-size: var(--font-size-2xs); }
.group-remove { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-round); color: var(--text-muted); }
.group-remove:hover { background: var(--bg-hover); color: var(--color-danger); }
.group-rename { display: flex; gap: var(--space-sm); }
.group-rename input { flex: 1; min-width: 0; }
.group-empty { display: flex; align-items: center; gap: var(--space-sm); color: var(--text-muted); }
.dm-mobile-new-group { display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; border-radius: var(--radius-round); color: var(--text-secondary); }
.dm-mobile-new-group:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ---- A group's call (js/group-whispers.js callBarHTML) ---- */
.group-call-bar { display: flex; align-items: center; gap: var(--space-sm); margin: var(--space-sm) var(--space-md) 0; padding: var(--space-sm) var(--space-md); border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.group-call-bar[hidden] { display: none; }
.group-call-bar.is-in { border-color: var(--accent-color); }
.group-call-icon { color: var(--accent-color); }
.light-mode .group-call-icon { color: var(--accent-solid); }
.group-call-label { color: var(--text-primary); font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); white-space: nowrap; }
.group-call-faces { display: flex; flex: 1; min-width: 0; align-items: center; }
.group-call-face { width: 28px; height: 28px; margin-left: -6px; font-size: var(--font-size-xs); box-shadow: 0 0 0 2px var(--bg-secondary); }
.group-call-face:first-child { margin-left: 0; }
.group-call-face.is-muted { opacity: 0.55; }
.group-call-more { margin-left: var(--space-xs); color: var(--text-muted); font-size: var(--font-size-xs); }
.group-call-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-round); background: var(--bg-tertiary); color: var(--text-primary); }
.group-call-btn:hover { background: var(--bg-hover); }
.group-call-btn.is-leave { background: var(--color-danger); color: var(--text-on-danger); }
.group-call-join { min-height: 34px; }
.dm-call-start-btn.is-live { border-color: var(--accent-color); color: var(--accent-color); }

/* ---- A picture on its way: a quiet placeholder of a fixed size, no alt text ---- */
.msg-attachment--image.is-loading { display: inline-block; width: 220px; height: 160px; border-radius: var(--radius-md); background: var(--bg-tertiary); }
.msg-attachment--image.is-loading img { opacity: 0; width: 220px; height: 160px; }
.msg-attachment--image img { transition: opacity var(--transition-fast); }
