/* ── Content column (Slack-style max-width for readability) ── */
.chat-wrapper[data-controller="room"] #messages > *,
.chat-wrapper[data-controller="room"] .room-typing-bar {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.chat-wrapper[data-controller="room"] #messages {
  gap: 0;
}
.chat-wrapper[data-controller="room"] #chat-input-area {
  padding-left: 0;
  padding-right: 0;
}

/* ── Room-scoped overrides ── */
.chat-wrapper[data-controller="room"] .user-avatar-fallback {
  background: var(--color-room, #4B35C2);
}
.chat-wrapper[data-controller="room"] #input-container:focus-within {
  border-color: rgba(75,53,194,0.3);
  box-shadow: 0 0 0 3px rgba(75,53,194,0.06);
}
.chat-wrapper[data-controller="room"] #chat-input-area #send-btn {
  background: var(--color-room, #4B35C2);
}
.chat-wrapper[data-controller="room"] #chat-input-area #send-btn:hover {
  background: var(--color-room-hover, #332389);
}

/* ── Room header ── */
.room-header {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.room-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

/* ── Room title flyover trigger ── */
.room-title-wrapper { position: relative; }
.room-title-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  transition: background 0.12s;
}
.room-title-trigger:hover { background: rgba(0,0,0,0.04); }
.room-title-trigger.open { background: rgba(0,0,0,0.04); }
.room-title-hash {
  color: var(--color-room, #4B35C2);
  opacity: 0.5;
  font-size: 15px;
  font-weight: 600;
}
.room-title-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}
.room-title-trigger .room-member-count {
  font-size: 12px;
  color: var(--color-text-muted, #79716b);
  white-space: nowrap;
}
.room-title-avatars {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}
.room-title-avatars .room-avatar {
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-surface);
  margin-left: -6px;
}
.room-title-avatars .room-avatar:first-child { margin-left: 0; }
.room-title-chevron {
  opacity: 0;
  transition: opacity 0.15s, transform 0.2s;
  flex-shrink: 0;
}
.room-title-trigger:hover .room-title-chevron,
.room-title-trigger.open .room-title-chevron { opacity: 0.5; }
.room-title-trigger.open .room-title-chevron { transform: rotate(180deg); }

/* ── Room title flyover menu ── */
.room-title-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 6px;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.04),
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.1),
    0 24px 48px rgba(0,0,0,0.06);
  z-index: var(--z-dropdown, 100);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px) scale(0.97);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.2s;
}
.room-title-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ── 3-column layout ── */
.rm-columns {
  display: flex;
  min-width: 620px;
}
.rm-col {
  padding: 12px 0;
}
.rm-col + .rm-col {
  border-left: 1px solid rgba(0,0,0,0.06);
}
.rm-col-context {
  flex: 1;
  min-width: 180px;
}
.rm-col-members {
  flex: 1.2;
  min-width: 200px;
}
.rm-col-integrations {
  flex: 1.2;
  min-width: 200px;
}
.rm-col-label {
  padding: 0 14px 8px;
  font-size: 10px;
  font-weight: 500;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rm-col-label-room {
  text-transform: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
  letter-spacing: 0;
}
.rm-col-hash {
  color: var(--color-room, #4B35C2);
  opacity: 0.5;
  margin-right: 1px;
}
.rm-col-count {
  font-size: 10px;
  font-weight: 600;
  color: #999;
  background: rgba(0,0,0,0.05);
  border-radius: 8px;
  padding: 0 5px;
  line-height: 16px;
}
.rm-section { padding: 2px 6px; }
.rm-section .dropdown-menu-item { font-size: 13px; }
.rm-section .dropdown-divider { margin: 4px 8px; }

/* ── Context column ── */
.rm-rename-input { padding: 4px 8px; }
.rm-rename-input input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s;
}
.rm-rename-input input:focus { border-color: var(--color-brand, #144629); }
.rm-rename-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}
.rm-rename-cancel, .rm-rename-save {
  border: none;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}
.rm-rename-cancel {
  background: none;
  color: #999;
}
.rm-rename-cancel:hover { background: rgba(0,0,0,0.04); color: #555; }
.rm-rename-save {
  background: var(--color-brand, #144629);
  color: #fff;
}
.rm-rename-save:hover { opacity: 0.9; }
.rm-purpose-label {
  font-size: 10px;
  font-weight: 500;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 10px 2px;
}
.rm-purpose-text {
  font-size: 12px;
  color: #666;
  padding: 0 10px 4px;
  line-height: 1.4;
}
.rm-purpose-editable {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 10px;
  margin: 0 -2px;
  transition: background 0.12s;
}
.rm-purpose-editable:hover { background: rgba(0,0,0,0.04); }
.rm-purpose-edit { padding: 0 8px 4px; }
.rm-purpose-input {
  width: 100%;
  border: 1px solid var(--color-border, #e7e5e4);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  outline: none;
  box-sizing: border-box;
  background: transparent;
  color: inherit;
  transition: border-color 0.15s;
}
.rm-purpose-input:focus { border-color: var(--color-room, #4B35C2); }
.rm-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 10px;
  font-size: 12px;
}
.rm-meta-label { color: #999; }
.rm-meta-value { color: #555; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Members column ── */
.rm-member-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 0 6px;
}
.rm-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  transition: background 0.1s;
}
.rm-member:hover { background: rgba(0,0,0,0.03); }
.rm-member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.rm-member-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 11px;
  font-weight: 600;
}
.rm-member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.rm-member-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rm-member-role {
  font-size: 11px;
  color: #999;
}
.rm-member-remove {
  opacity: 0;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: #999;
  transition: opacity 0.1s, color 0.1s, background 0.1s;
}
.rm-member:hover .rm-member-remove { opacity: 1; }
.rm-member-remove:hover { color: #dc2626; background: rgba(220,38,38,0.08); }

/* ── Usage toggle (inline in context column) ── */
.rm-usage-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.rm-usage-toggle:hover { background: rgba(0,0,0,0.04); color: #333; }
.rm-usage-toggle svg:first-child { opacity: 0.5; flex-shrink: 0; }
.rm-usage-toggle-chevron {
  margin-left: auto;
  opacity: 0.3;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.rm-usage-toggle.open .rm-usage-toggle-chevron { transform: rotate(90deg); opacity: 0.5; }
.rm-usage-inline {
  padding: 4px 10px 2px;
}
.rm-usage-loading { font-size: 12px; color: #aaa; }
.rm-usage-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
  color: #666;
}
.rm-usage-value {
  font-weight: 500;
  color: #333;
  font-variant-numeric: tabular-nums;
}
.rm-usage-total {
  display: flex;
  justify-content: space-between;
  padding: 5px 0 2px;
  margin-top: 3px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 12px;
  font-weight: 600;
  color: #333;
}
.rm-usage-empty {
  font-size: 12px;
  color: #bbb;
  font-style: italic;
}

/* ── Integrations column ── */
.rm-integrations-body { padding: 0 6px; }
.rm-integrations-loading { font-size: 12px; color: #aaa; padding: 0 8px; }
.rm-int-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.1s;
}
.rm-int-item:hover { background: rgba(0,0,0,0.03); }
.rm-int-pending { background: rgba(255,180,0,0.04); }
.rm-int-pending:hover { background: rgba(255,180,0,0.08); }
.rm-int-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f4;
  border-radius: 6px;
  flex-shrink: 0;
}
.rm-int-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.rm-int-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}
.rm-int-email {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rm-int-meta {
  font-size: 11px;
  color: #999;
}
.rm-int-status {
  font-weight: 500;
}
.rm-int-status-active { color: #16a34a; }
.rm-int-status-error { color: #dc2626; }
.rm-int-status-pending { color: #d97706; }
.rm-int-status-action { color: #4B35C2; font-weight: 600; }
.rm-int-scope {
  font-size: 10px;
  font-weight: 500;
  background: rgba(75,53,194,0.08);
  color: var(--color-room, #4B35C2);
  padding: 0 4px;
  border-radius: 3px;
}
.rm-int-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 14px;
  text-align: center;
}
.rm-int-empty svg { color: #ccc; }
.rm-int-empty > span:first-of-type {
  font-size: 12px;
  color: #999;
  font-weight: 500;
}
.rm-int-hint {
  font-size: 11px;
  color: #bbb;
  line-height: 1.4;
}
.rm-int-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.rm-int-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: background 0.1s, border-color 0.15s, color 0.1s;
}
.rm-int-chip:hover {
  background: rgba(75,53,194,0.04);
  border-color: rgba(75,53,194,0.2);
  color: #333;
}
.rm-int-chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.rm-int-chip-other { border-style: dashed; color: #999; font-weight: 400; }
.rm-int-lock { margin-bottom: 6px; font-size: 11px; }

/* ── Room connection connect/granted states ── */
.room-conn-connecting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #888;
  padding: 6px 12px;
}
.room-conn-connecting .status-typing { margin: 0; }
.room-conn-granted-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.room-conn-granted-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-room, #4B35C2);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
.room-conn-granted-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
/* Room-scoped connect prompt: "shared" badge to distinguish from personal */
.chat-wrapper[data-controller="room"] .google-auth-prompt-inner strong::after {
  content: "shared";
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-room, #4B35C2);
  background: rgba(75,53,194,0.08);
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  position: relative;
  top: -0.5px;
}
.chat-wrapper[data-controller="room"] .google-auth-prompt-inner.connected strong::after {
  content: none;
}
.google-auth-btn-area {
  flex-shrink: 0;
}
.room-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-name-hash {
  color: var(--color-room, #4B35C2);
  opacity: 0.5;
  margin-right: 1px;
}
.room-member-count {
  font-size: 12px;
  color: var(--color-text-muted, #79716b);
  white-space: nowrap;
}

/* ── Presence bar ── */
.room-presence-bar {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.room-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  margin-left: -6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.room-avatar:first-child { margin-left: 0; }
.room-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.room-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50%;
}
.room-avatar-overflow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  margin-left: -6px;
  background: #e7e5e4;
  color: #78716c;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Header actions ── */
.room-header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.room-invite-btn, .room-delete-btn, .room-leave-btn {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  color: #78716c;
  transition: background 0.12s, color 0.12s;
}
.room-invite-btn:hover { background: rgba(75,53,194,0.08); color: var(--color-room, #4B35C2); }
.room-delete-btn:hover { background: rgba(220,38,38,0.08); color: #dc2626; }
.room-leave-btn:hover { background: rgba(220,38,38,0.08); color: #dc2626; }

/* ── Typing bar ── */
.room-typing-bar {
  padding: 4px 24px;
  font-size: 12px;
  color: var(--color-text-muted, #79716b);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}
.room-typing-bar .status-typing { transform: scale(0.7); }

/* ── Messages (Slack-style column layout, compact avatars) ──
   Avatar is absolutely positioned in a narrow reserved column on the left.
   Header (name + time) and body both start at the same column to the right. */
.room-message {
  padding: 2px 24px 2px 58px;
  position: relative;
}
.room-message.assistant {
  --user-color: var(--color-brand);
}
.room-message:not(.consecutive) {
  padding-top: 8px;
}
.room-msg-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 1px;
  min-height: 18px;
}
.room-msg-avatar,
.room-msg-avatar-fallback,
.room-msg-avatar-pine {
  position: absolute;
  left: 24px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  box-shadow: none;
}
.room-msg-avatar-fallback {
  background: var(--user-color, var(--color-room, #4B35C2));
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.room-msg-avatar-pine { background: transparent; }
.room-message.consecutive { padding-top: 0; }
/* SSR collapses consecutive rows by omitting the header element entirely.
   Broadcast shell HTML (rendering_v2_enabled) renders with last_user_id: nil,
   so the header is always present and message_hydrator#applyConsecutive
   only toggles this class. Hide the header here so the two paths produce
   visually identical collapsed rows. */
.room-message.consecutive .room-msg-header { display: none; }
.room-msg-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--user-color, var(--color-text-primary, #1c1917));
  cursor: pointer;
  border-radius: 4px;
  padding: 0 2px;
  margin: 0 -2px;
}
.room-msg-name:hover {
  background: rgba(0,0,0,0.05);
}
.room-msg-time {
  font-size: 12px;
  color: #a8a29e;
}
.room-msg-body {
  padding-left: 0;
}
.room-msg-body .content {
  font-size: 14px;
  line-height: 1.5;
  color: #44403c;
}
.room-msg-body .content p {
  margin: 0 0 4px;
}
.room-msg-body .content p:last-child {
  margin-bottom: 0;
}
.room-message.consecutive .room-msg-body {
  padding-left: 0;
}

/* Hide completed thinking blocks by default inside rooms; the toolbar
   toggle (.room-thinking-btn) reveals them per-message. Streaming thinking
   (no .done class) stays visible so Pine's "Thinking..." state shows. */
.room-message.assistant .thinking-inline.done { display: none; }
.room-message.assistant.show-thinking .thinking-inline.done { display: block; }
.room-thinking-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-text-muted, #79716b);
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}
.room-thinking-btn:hover { background: rgba(0,0,0,0.04); color: var(--color-text-primary, #1c1917); }
.room-message.assistant.show-thinking .room-thinking-btn { color: var(--color-room, #4b35c2); }

/* ── Message actions (pin + reply): floating hover toolbar ──
   Absolute-positioned so it reserves no space in the flow. Hover only
   changes opacity + pointer-events; no reflow, no feed jumping. */
.room-msg-actions {
  position: absolute;
  top: 4px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e7e5e4);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  z-index: 1;
}
.room-message:hover .room-msg-actions {
  opacity: 1;
  pointer-events: auto;
}
/* Pinned message keeps the toolbar visible without hover so the state is
   discoverable; mount it static so it doesn't obscure content. */
.room-message.pinned .room-msg-actions {
  opacity: 1;
  pointer-events: auto;
}
.room-comment-toggle {
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: #a8a29e;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s, color 0.12s;
}
.room-comment-toggle:hover { background: rgba(0,0,0,0.04); color: #57534e; }
.room-comment-count { font-weight: 600; }

/* ── Persistent thread-reply indicator (Slack-style "N replies" pill) ── */
.room-thread-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 0 5px;
  padding: 3px 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-room, #4B35C2);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s;
}
.room-thread-indicator:hover {
  background: var(--color-surface, #fff);
  border-color: var(--color-border, #e7e5e4);
}
.room-thread-indicator svg { flex-shrink: 0; }
.room-thread-indicator-count { font-weight: 600; }
.room-thread-indicator-label { color: var(--color-text-muted, #79716b); font-weight: 400; }

/* ── Comments thread ── */
.room-comments-thread {
  padding-left: 5px;
  margin-top: 4px;
  border-left: 2px solid rgba(75,53,194,0.15);
  padding-bottom: 4px;
}
.room-comment {
  padding: 3px 8px;
  font-size: 13px;
}
.room-comment-author {
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
  margin-right: 6px;
}
.room-comment-text { color: #57534e; }
.room-comment-form {
  display: flex;
  gap: 6px;
  padding: 4px 8px;
}
.room-comment-input {
  flex: 1;
  border: 1px solid #e7e5e4;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.room-comment-input:focus { border-color: var(--color-room, #4B35C2); }
.room-comment-submit {
  background: var(--color-room, #4B35C2);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

/* ── Tool cards ── */
.room-tool-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 4px 0;
  border-radius: 6px;
  background: rgba(0,0,0,0.03);
  font-size: 12px;
  color: #57534e;
}
.room-tool-icon { display: flex; opacity: 0.5; }
.room-tool-label { font-weight: 500; }
.room-tool-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.room-tool-status.running {
  background: #f59e0b;
  animation: toolPulse 1s ease-in-out infinite;
}
.room-tool-status.success { background: var(--color-brand, #144629); }
.room-tool-status.error { background: #dc2626; }
.room-tool-status.warning { background: #f59e0b; }
@keyframes toolPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Connection approval card ── */
.room-connection-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin: 8px 0;
  border-radius: 8px;
  background: rgba(75,53,194,0.04);
  border: 1px solid rgba(75,53,194,0.12);
  animation: secureCardAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.room-connection-card.approved {
  border-color: rgba(75,53,194,0.25);
  background: rgba(75,53,194,0.06);
}
.room-connection-card.denied {
  border-color: rgba(220,38,38,0.15);
  background: rgba(220,38,38,0.03);
}
.room-conn-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(75,53,194,0.1);
  color: var(--color-room, #4B35C2);
}
.room-conn-info {
  flex: 1;
  min-width: 0;
}
.room-conn-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #1c1917);
}
.room-conn-status {
  display: block;
  font-size: 12px;
  color: #a8a29e;
  margin-top: 2px;
}
.room-connection-card.approved .room-conn-status {
  color: var(--color-room, #4B35C2);
}
.room-connection-card.denied .room-conn-status {
  color: #dc2626;
}
.room-conn-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-self: center;
}
.room-conn-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.12s;
}
.room-conn-btn.approve {
  background: var(--color-room, #4B35C2);
  color: white;
}
.room-conn-btn.approve:hover { background: var(--color-room-hover, #3d328a); }
.room-conn-btn.approve-room {
  background: rgba(75,53,194,0.1);
  color: var(--color-room, #4B35C2);
}
.room-conn-btn.approve-room:hover { background: rgba(75,53,194,0.18); }
.room-conn-btn.deny {
  background: rgba(220,38,38,0.08);
  color: #dc2626;
}
.room-conn-btn.deny:hover { background: rgba(220,38,38,0.15); }
.room-conn-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Input override: match content column width ── */
.chat-wrapper[data-controller="room"] #chat-input-area form {
  max-width: 900px;
}
.chat-wrapper[data-controller="room"] #input-row {
  align-items: center;
}
.chat-wrapper[data-controller="room"] #chat-input-area textarea,
.chat-wrapper[data-controller="room"] #chat-input-area #send-btn {
  margin-bottom: 0;
}
.chat-wrapper[data-controller="room"] #chat-input-area textarea {
  padding-top: 10px;
  padding-bottom: 4px;
}
.chat-wrapper[data-controller="room"] #chat-input-area #send-btn {
  background: var(--color-room, #4B35C2);
}
.chat-wrapper[data-controller="room"] #chat-input-area #send-btn:hover {
  background: var(--color-room-hover, #332389);
}
.chat-wrapper[data-controller="room"] #chat-input-area #send-btn:disabled {
  background: rgba(180,170,160,0.35);
}
.chat-wrapper[data-controller="room"] #stop-btn {
  background: var(--color-room, #4B35C2);
}

/* ── Room intro banner ── */
.room-intro-banner {
  margin: 12px 24px 6px;
  background: color-mix(in srgb, var(--color-room, #4B35C2) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-room, #4B35C2) 12%, transparent);
  border-radius: 10px;
  padding: 8px 14px;
  animation: secureCardAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.room-intro-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-intro-banner[data-expanded="true"] .room-intro-header {
  margin-bottom: 10px;
}
.room-intro-shield {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-room, #4B35C2);
}
.room-intro-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-room, #4B35C2);
  letter-spacing: 0.01em;
  flex: 1;
}
.room-intro-expand {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-room, #4B35C2) 60%, var(--color-text-secondary, #666));
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}
.room-intro-expand:hover {
  background: color-mix(in srgb, var(--color-room, #4B35C2) 8%, transparent);
  color: var(--color-room, #4B35C2);
}
.room-intro-dismiss {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: color-mix(in srgb, var(--color-room, #4B35C2) 30%, var(--color-text-muted, #999));
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.12s;
}
.room-intro-dismiss:hover { color: color-mix(in srgb, var(--color-room, #4B35C2) 40%, var(--color-text-secondary, #666)); }
.room-intro-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.room-intro-row {
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.4;
}
.room-intro-label {
  width: 90px;
  flex-shrink: 0;
  font-weight: 600;
  color: color-mix(in srgb, var(--color-room, #4B35C2) 60%, var(--color-text-muted, #999));
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding-top: 1px;
}
.room-intro-value {
  color: color-mix(in srgb, var(--color-room, #4B35C2) 25%, var(--color-text-secondary, #666));
}

/* ── Pagination sentinel ── */
.room-pagination-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  min-height: 32px;
}
.room-pagination-load-btn {
  background: none;
  border: 1px solid color-mix(in srgb, var(--color-text-muted, #999) 30%, transparent);
  border-radius: 999px;
  color: var(--color-text-muted, #666);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.room-pagination-load-btn:hover {
  background: color-mix(in srgb, var(--color-text-muted, #999) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-text-muted, #999) 50%, transparent);
}
.room-pagination-load-btn:focus-visible {
  outline: 2px solid var(--color-brand, #4B35C2);
  outline-offset: 2px;
}
.room-pagination-spinner {
  color: var(--color-text-muted, #999);
  font-size: 12px;
}
.room-pagination-spinner[hidden] { display: none; }
.room-pagination-sentinel.loading .room-pagination-load-btn { display: none; }
.room-pagination-sentinel.error .room-pagination-load-btn {
  color: var(--color-danger, #c33);
  border-color: color-mix(in srgb, var(--color-danger, #c33) 40%, transparent);
}

/* ── Jump to latest floating button ── */
.room-jump-to-latest {
  position: absolute;
  right: 24px;
  bottom: 92px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-bg, #fff);
  border: 1px solid color-mix(in srgb, var(--color-text-muted, #999) 25%, transparent);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  color: var(--color-text, #111);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s cubic-bezier(0.25, 1, 0.5, 1),
              transform 0.15s cubic-bezier(0.25, 1, 0.5, 1);
}
.room-jump-to-latest.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.room-jump-to-latest:hover {
  background: color-mix(in srgb, var(--color-text-muted, #999) 6%, var(--color-bg, #fff));
}
.room-jump-to-latest:focus-visible {
  outline: 2px solid var(--color-brand, #4B35C2);
  outline-offset: 2px;
}

/* ── Unread divider (Slack-style) ── */
.room-unread-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  padding: 0 4px;
  color: var(--color-brand, #4B35C2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
}
.room-unread-divider::before,
.room-unread-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--color-brand, #4B35C2) 35%, transparent);
}
.room-unread-divider-label {
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-brand, #4B35C2) 10%, var(--color-bg, #fff));
  border: 1px solid color-mix(in srgb, var(--color-brand, #4B35C2) 25%, transparent);
  letter-spacing: 0.08em;
}
.room-unread-divider.is-fading {
  transition: opacity 400ms cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0;
}

/* ── Pagination seam (Feishu-style transient anchor) ── */
/*
 * Injected after a batch prepend at the boundary between newly-loaded
 * messages and the content the user was already reading. Tells the user
 * "here's where you were." Fades out after ~2.2s so it doesn't clutter
 * the transcript once it has served its purpose.
 */
.room-pagination-seam {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
  padding: 0 4px;
  color: var(--color-text-muted, #999);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  user-select: none;
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.25, 1, 0.5, 1);
}
.room-pagination-seam::before,
.room-pagination-seam::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--color-text-muted, #999) 30%, transparent);
}
.room-pagination-seam-label {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--color-surface, #faf9f7);
  border: 1px solid color-mix(in srgb, var(--color-text-muted, #999) 18%, transparent);
}
.room-pagination-seam.is-visible { opacity: 1; }
.room-pagination-seam.is-fading {
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── Empty state / welcome ── */
.room-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
  padding: 24px;
}
.room-welcome-icon {
  color: var(--color-room, #4B35C2);
  opacity: 0.4;
  margin-bottom: 4px;
}
.room-welcome-text {
  font-size: 15px;
  color: color-mix(in srgb, var(--color-room, #4B35C2) 45%, var(--color-text-muted, #999));
  margin: 0 0 12px;
}
.room-welcome-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 480px;
  min-height: 36px;
  transition: opacity 0.25s ease;
}
.room-welcome-chips.room-chips-fade-out {
  opacity: 0;
}
.room-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  background: color-mix(in srgb, var(--color-room, #4B35C2) 8%, transparent);
  border: none;
  color: color-mix(in srgb, var(--color-room, #4B35C2) 80%, var(--color-text-primary, #1a1a1a));
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
  line-height: 1.4;
  text-align: left;
}
.room-chip .chip-label {
  flex: 1;
  min-width: 0;
}
.room-chip:hover {
  background: color-mix(in srgb, var(--color-room, #4B35C2) 15%, transparent);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--color-room, #4B35C2) 12%, transparent);
}
.room-chip.chip-enter {
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  animation: roomChipReveal 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes roomChipReveal {
  from { opacity: 0; transform: translateY(4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.room-chip.skeleton {
  background: linear-gradient(90deg, color-mix(in srgb, var(--color-room, #4B35C2) 6%, transparent) 25%, color-mix(in srgb, var(--color-room, #4B35C2) 12%, transparent) 50%, color-mix(in srgb, var(--color-room, #4B35C2) 6%, transparent) 75%);
  background-size: 200% 100%;
  animation: roomChipShimmer 2.8s ease-in-out infinite;
  border: none;
  color: transparent;
  min-width: 80px;
  cursor: default;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.room-chip.skeleton.fade-out {
  opacity: 0;
  transform: scale(0.92);
}
@keyframes roomChipShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.room-chip-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.35;
}
.room-chip:hover .room-chip-icon { opacity: 0.8; }

/* ── Fork/Join icon animation ── */
.fj-icon-animated { color: #555; }
.fj-icon-animated svg { overflow: visible; }
.fj-icon-animated .fj-trunk { stroke-dasharray: 4; stroke-dashoffset: 4; animation: fjDraw 0.4s 0.1s ease forwards; }
.fj-icon-animated .fj-branch-left { stroke-dasharray: 12; stroke-dashoffset: 12; animation: fjDraw 0.5s 0.3s ease forwards; }
.fj-icon-animated .fj-branch-right { stroke-dasharray: 12; stroke-dashoffset: 12; animation: fjDraw 0.5s 0.4s ease forwards; }
.fj-icon-animated .fj-node-root { opacity: 0; animation: fjNodePop 0.3s 0s ease forwards; }
.fj-icon-animated .fj-node-left { opacity: 0; animation: fjNodePop 0.3s 0.7s ease forwards; }
.fj-icon-animated .fj-node-right { opacity: 0; animation: fjNodePop 0.3s 0.8s ease forwards; }
.fj-icon-animated .fj-stem-left { stroke-dasharray: 2; stroke-dashoffset: 2; animation: fjDraw 0.2s 0.6s ease forwards; }
.fj-icon-animated .fj-stem-right { stroke-dasharray: 2; stroke-dashoffset: 2; animation: fjDraw 0.2s 0.7s ease forwards; }
.fork-join-card:not(.complete):not(.warning) .fj-node-left,
.fork-join-card:not(.complete):not(.warning) .fj-node-right {
  animation: fjNodePop 0.3s 0.7s ease forwards, fjNodePulse 1.8s 1s ease-in-out infinite;
}
@keyframes fjDraw { to { stroke-dashoffset: 0; } }
@keyframes fjNodePop { to { opacity: 1; } }
@keyframes fjNodePulse {
  0%, 100% { r: 2; opacity: 1; }
  50% { r: 2.8; opacity: 0.7; }
}

/* ── Fork/Join parallel tasks ── */
.fork-join-card .fj-tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.fj-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #555;
  background: rgba(0,0,0,0.025);
  transition: background 0.3s ease;
}
.fj-task.complete { background: rgba(34,139,34,0.06); }
.fj-task.error { background: rgba(220,38,38,0.06); }
.fj-task-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.5; }
.fj-task-icon svg { width: 14px; height: 14px; }
.fj-task-label { flex: 1; }
.fj-task-target { opacity: 0.6; font-style: italic; }
.fj-task-status { flex-shrink: 0; font-size: 11px; }
.fj-task-status .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bbb;
  animation: pulse 1.5s ease-in-out infinite;
}
.fj-task-status .check { color: #228B22; font-weight: 600; }
.fj-task-status .error-x { color: #dc2626; font-weight: 600; }
.fj-task.complete .fj-task-icon { opacity: 0.7; }
.fj-task.complete .fj-task-label { color: #333; }

/* ── Reply chips (after assistant messages) ── */
.room-reply-chips {
  padding: 6px 24px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Sidebar: new-conv row with room button ── */
.nav-new-row {
  display: flex;
  gap: 3px;
  margin: 15px 0 -5px;
  width: 100%;
  position: relative;
}
.nav-new-row .nav-item-new-conv {
  margin: 0;
  width: auto;
  flex: 1;
}
.nav-item-new-room {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(139,115,85,0.08);
  color: #a08b6e;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s ease;
}
.nav-item-new-room:hover { background: rgba(139,115,85,0.13); color: #8b7355; transform: scale(1.015); }
.nav-item-new-room:active { transform: scale(0.97); }
.nav-item-new-room svg { opacity: 0.7; }
.nav-new-more-plus {
  position: absolute;
  top: -4px;
  right: -5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #a08b6e;
  opacity: 0.8;
}
.nav-item-new-room { position: relative; }
.nav-room-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  transform: scale(0.4) translateY(-4px);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  white-space: nowrap;
  font-size: 12px;
  color: #555;
  pointer-events: none;
  opacity: 0;
  z-index: var(--z-dropdown, 100);
}
.nav-item-new-room:hover .nav-room-tooltip {
  animation: room-tooltip-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes room-tooltip-pop {
  0% { opacity: 0; transform: scale(0.4) translateY(-4px); }
  60% { opacity: 1; transform: scale(1.03) translateY(0); }
  80% { transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Sidebar: room list items ── */
#sidebar-rooms-header {
  padding: 14px 14px 6px;
}
#sidebar-rooms-header h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  margin: 0;
}
#room-list {
  padding: 0 8px 4px;
}
.room-item {
  display: flex;
  align-items: center;
  border-radius: 6px;
  font-size: 13px;
  color: #57534e;
  cursor: pointer;
  transition: background 0.12s;
}
.room-item:hover { background: rgba(0,0,0,0.04); }
.room-item.active { background: rgba(75,53,194,0.08); font-weight: 500; }
.room-item .conv-link {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  padding: 5px 8px;
}
.room-item-hash {
  flex-shrink: 0;
  color: var(--color-room, #4B35C2);
  opacity: 0.5;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.room-item.active .room-item-hash { opacity: 0.8; }
.room-member-badge {
  flex-shrink: 0;
  font-size: 10px;
  background: rgba(75,53,194,0.1);
  color: var(--color-room, #4B35C2);
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 600;
}

/* ── Invite modal ── */
.room-invite-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: var(--z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
}
.room-invite-modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 360px;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: secureCardAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.room-invite-modal h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}
.room-invite-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
  outline: none;
  box-sizing: border-box;
}
.room-invite-search:focus { border-color: var(--color-room, #4B35C2); }
.room-invite-list {
  max-height: 300px;
  overflow-y: auto;
}
.room-invite-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.room-invite-item:hover { background: rgba(0,0,0,0.03); }
.room-invite-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.room-invite-item-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.room-invite-item-info { flex: 1; min-width: 0; }
.room-invite-item-name { font-size: 14px; font-weight: 500; display: block; }
.room-invite-item-email { font-size: 12px; color: #a8a29e; display: block; }
.room-invite-item-action {
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
}
.room-invite-item-action.invite {
  background: var(--color-room, #4B35C2);
  color: white;
}
.room-invite-item-action.invited {
  background: #e7e5e4;
  color: #a8a29e;
  cursor: default;
}
.room-invite-close {
  width: 100%;
  padding: 8px;
  margin-top: 12px;
  background: rgba(0,0,0,0.04);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.room-invite-close:hover { background: rgba(0,0,0,0.08); }

/* ── Room invite animation (sidebar) ── */
@keyframes roomInvitePop {
  0% { transform: scale(0.9); opacity: 0; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
.room-item-enter {
  animation: roomInvitePop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Create room modal ── */
.room-create-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: var(--z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
}
.room-create-modal-backdrop[hidden] { display: none; }
.room-create-modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: secureCardAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.room-create-modal h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

/* Modal tabs */
.room-modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #e7e5e4;
}
.room-modal-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #78716c;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.room-modal-tab:hover { color: #1c1917; }
.room-modal-tab.active {
  color: var(--color-room, #4B35C2);
  border-bottom-color: var(--color-room, #4B35C2);
}

/* Browse rooms */
.browse-rooms-list {
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
}
.browse-rooms-loading,
.browse-rooms-empty {
  padding: 32px 0;
  text-align: center;
  color: #a8a29e;
  font-size: 14px;
}
.browse-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f4;
}
.browse-room-item:last-child { border-bottom: none; }
.browse-room-info { display: flex; flex-direction: column; gap: 2px; }
.browse-room-hash {
  color: var(--color-room, #4B35C2);
  font-weight: 700;
  margin-right: 4px;
}
.browse-room-name {
  font-size: 14px;
  font-weight: 500;
  color: #1c1917;
}
.browse-room-meta {
  font-size: 12px;
  color: #a8a29e;
}
.browse-room-join {
  padding: 5px 14px;
  border: 1px solid var(--color-room, #4B35C2);
  border-radius: 6px;
  background: none;
  color: var(--color-room, #4B35C2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.browse-room-join:hover {
  background: var(--color-room, #4B35C2);
  color: white;
}

/* Sidebar browse rooms button */
.sidebar-browse-rooms {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border: 1px dashed #d6d3d1;
  border-radius: 8px;
  background: none;
  color: #78716c;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.sidebar-browse-rooms:hover {
  border-color: var(--color-room, #4B35C2);
  color: var(--color-room, #4B35C2);
}

/* Room visibility toggle */
.room-create-visibility {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #44403c;
  cursor: pointer;
  padding: 8px 0;
  flex-wrap: wrap;
}
.room-create-visibility input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-room, #4B35C2);
  cursor: pointer;
}
.room-lock-icon {
  color: #78716c;
}
.room-create-visibility-hint {
  flex-basis: 100%;
  font-size: 12px;
  color: #a8a29e;
  margin-left: 22px;
}
.room-create-slug-row {
  display: flex;
  align-items: center;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 0 12px;
  transition: border-color 0.15s;
}
.room-create-slug-row:focus-within {
  border-color: var(--color-room, #4B35C2);
}
.room-create-hash {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-room, #4B35C2);
  opacity: 0.5;
  margin-right: 2px;
  user-select: none;
}
.room-create-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 0;
  font-size: 15px;
  font-family: inherit;
  background: transparent;
}
.room-create-input::placeholder {
  color: #c4c0bc;
}
.room-create-input.auto-suggested {
  color: #78716c;
  font-style: italic;
}
.room-create-hint {
  font-size: 12px;
  color: #a8a29e;
  margin: 8px 0 0;
}
.room-create-error {
  font-size: 12px;
  color: var(--color-danger, #dc2626);
  margin: 6px 0 0;
}
.room-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.room-create-cancel {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: rgba(0,0,0,0.04);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.room-create-cancel:hover { background: rgba(0,0,0,0.08); }
.room-create-submit {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
}
.room-create-submit:hover { background: var(--color-room-hover, #3d328a); }
.room-create-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── Create room: purpose + suggestion ── */
.room-create-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #1c1917);
  margin-bottom: 6px;
}
.room-create-label-small {
  font-size: 12px;
  color: var(--color-text-muted, #79716b);
}
.room-create-purpose {
  width: 100%;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.room-create-purpose::placeholder {
  color: #c4c0bc;
}
.room-create-purpose:focus {
  border-color: var(--color-room, #4B35C2);
}
.room-create-suggestions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  min-height: 98px;
  animation: roomSuggestionAppear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.room-create-suggestion {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: rgba(75,53,194,0.04);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s;
}
.room-create-suggestion:hover {
  background: rgba(75,53,194,0.08);
}
.room-create-suggestion.active {
  background: rgba(75,53,194,0.08);
}
.room-create-suggestion-hash {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-room, #4B35C2);
  opacity: 0.4;
}
.room-create-suggestion-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-room, #4B35C2);
  flex: 1;
}
.room-create-suggestion-use {
  display: none;
}
.room-suggestion-haiku .room-create-suggestion-name::after {
  content: "Suggested";
  font-size: 9px;
  font-weight: 600;
  color: rgba(75,53,194,0.5);
  background: rgba(75,53,194,0.08);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.room-create-divider {
  height: 1px;
  background: #e7e5e4;
  margin: 14px 0 12px;
}
/* ── Create room: member picker ── */
.room-create-members {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 6px 8px;
  min-height: 36px;
  cursor: text;
  transition: border-color 0.15s;
  position: relative;
}
.room-create-members:has(.room-create-member-chip) {
  padding: 4px 6px;
}
.room-create-members:focus-within {
  border-color: var(--color-room, #4B35C2);
}
.room-create-members-selected {
  display: contents;
}
.room-create-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 2px;
  background: rgba(75,53,194,0.08);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-room, #4B35C2);
  white-space: nowrap;
  animation: roomSuggestionAppear 0.15s ease-out;
}
.room-create-member-chip img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}
.room-create-member-chip-fallback {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.room-create-member-chip-remove {
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  color: rgba(75,53,194,0.4);
  font-size: 14px;
  line-height: 1;
  transition: color 0.12s;
}
.room-create-member-chip-remove:hover { color: var(--color-room, #4B35C2); }
.room-create-member-search {
  flex: 1;
  min-width: 80px;
  border: none;
  outline: none;
  padding: 4px 0;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
}
.room-create-member-search::placeholder { color: #c4c0bc; }
.room-create-member-results {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.15s ease;
}
.room-create-member-results.open {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  margin-top: 4px;
}
.room-create-member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.1s;
}
.room-create-member-item:hover { background: rgba(75,53,194,0.04); }
.room-create-member-item img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.room-create-member-item-fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.room-create-member-item-info {
  flex: 1;
  min-width: 0;
}
.room-create-member-item-name {
  font-size: 13px;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-create-member-item-email {
  font-size: 11px;
  color: #a8a29e;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-create-member-results-empty {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  color: #a8a29e;
}

@keyframes roomSuggestionAppear {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Mention popover ── */
.mention-popover {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  padding: 4px;
  z-index: var(--z-dropdown, 100);
  max-height: 200px;
  overflow-y: auto;
  animation: mentionPopoverIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.mention-popover-comment {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 4px;
}
@keyframes mentionPopoverIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.mention-popover-list {
  display: flex;
  flex-direction: column;
}
.mention-popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mention-popover-item:hover,
.mention-popover-item.active {
  background: rgba(75,53,194,0.08);
}
.mention-popover-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.mention-popover-avatar-fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mention-popover-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #1c1917);
}

/* ── Mention tags in messages ── */
.mention-tag {
  color: var(--color-room, #4B35C2);
  font-weight: 600;
  background: rgba(75,53,194,0.08);
  padding: 1px 4px;
  border-radius: 4px;
  cursor: pointer;
}
.mention-tag:hover {
  background: rgba(75,53,194,0.15);
}

/* ── Mention hover card ── */
.mention-hover-card {
  position: fixed;
  z-index: var(--z-dropdown, 100);
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  min-width: 180px;
}
.mention-hover-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.mention-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.mention-card-avatar-pine {
  background: #144629;
  padding: 6px;
  border-radius: 50%;
}
.mention-card-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mention-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mention-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mention-card-role {
  font-size: 12px;
  color: var(--color-text-secondary, #78716c);
}

/* ── Mentioned message highlight ── */
.room-message.mentioned {
  background: rgba(75,53,194,0.04);
  border-left: 3px solid var(--color-room, #4B35C2);
  margin-left: -3px;
}

/* ── Mentioned comment highlight (attention-grabbing) ── */
.room-comment.mention-highlight {
  background: rgba(75,53,194,0.08);
  border-left: 3px solid var(--color-room, #4B35C2);
  border-radius: 0 6px 6px 0;
  padding-left: 10px;
  margin: 2px 0;
  animation: mentionPulse 2s ease-in-out 1;
}
@keyframes mentionPulse {
  0% { background: rgba(75,53,194,0.2); }
  50% { background: rgba(75,53,194,0.1); }
  100% { background: rgba(75,53,194,0.08); }
}

/* ── Sidebar mention dot ── */
.room-mention-dot {
  flex-shrink: 0;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--color-room, #4B35C2);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: auto;
  line-height: 1;
}
.room-mention-dot.bump {
  animation: mentionBump 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes mentionBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.room-item.has-mentions .conv-title {
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
}
.room-item.has-mentions .room-item-hash {
  opacity: 0.9;
}

/* ── Input container: relative for popover positioning ── */
.chat-wrapper[data-controller="room"] #input-container {
  position: relative;
  overflow: visible;
}

/* ── Mention highlight mirror (sits behind textarea) ── */
.mention-input-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}
.mention-input-wrap textarea {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}
.mention-mirror {
  position: absolute;
  inset: 0;
  padding: 6px 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
  pointer-events: none;
  color: transparent;
  margin-bottom: 2px;
}
.mention-mirror .mention-hl {
  background: rgba(75,53,194,0.15);
  border-radius: 3px;
  color: transparent;
}

/* ── Waiting for response indicator ── */
.room-waiting-indicator {
  animation: roomFadeSlideIn 0.25s ease-out;
}
.room-waiting-indicator .room-msg-body {
  padding: 4px 0;
}
.room-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
}
.room-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-brand);
  animation: typingBounce 1.4s ease-in-out infinite;
}
.room-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.room-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
.room-waiting-slow {
  color: var(--color-text-muted, #79716b);
  font-size: 13px;
  font-style: italic;
}
@keyframes roomFadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Dark theme overrides ── */
[data-theme="wistful_juniper"],
[data-theme="deep_current"] {
  /* Message body text */
  .room-msg-body .content { color: var(--color-text-primary); }
  .room-msg-time { color: var(--color-text-muted); }
  .room-msg-name:hover { background: var(--color-hover); }

  /* Per-user speaker color: brighten so dark palette entries stay legible on dark surface */
  .room-msg-name { color: color-mix(in srgb, var(--user-color) 70%, white); }
  .room-msg-avatar-fallback { background: color-mix(in srgb, var(--user-color) 70%, white); }
  .room-msg-avatar { box-shadow: 0 0 0 2px color-mix(in srgb, var(--user-color) 70%, white); }

  /* Comments and reactions */
  .room-comment-toggle { color: var(--color-text-muted); }
  .room-comment-toggle:hover { background: var(--color-hover); color: var(--color-text-secondary); }
  .room-comment-text { color: var(--color-text-secondary); }
  .room-comment-time { color: var(--color-text-muted); }

  /* Borders — stone palette → theme border */
  .room-comment-input-wrap,
  .room-invite-input,
  .room-search-input { border-color: var(--color-border); }

  /* Room intro banner — legible on dark backgrounds */
  .room-intro-banner {
    background: color-mix(in srgb, var(--color-room) 8%, transparent);
    border-color: color-mix(in srgb, var(--color-room) 18%, transparent);
  }
  .room-intro-title { color: var(--color-room); }
  .room-intro-label { color: color-mix(in srgb, var(--color-room) 70%, var(--color-text-muted)); }
  .room-intro-value { color: color-mix(in srgb, var(--color-room) 20%, var(--color-text-secondary)); }
  .room-intro-dismiss { color: var(--color-text-muted); }
  .room-intro-dismiss:hover { color: var(--color-text-secondary); }
  .room-welcome-text { color: color-mix(in srgb, var(--color-room) 50%, var(--color-text-muted)); }
  .room-invite-item-email { color: var(--color-text-muted); }

  /* Avatar overflow badges */
  .room-msg-avatar-overflow,
  .room-item-av-overflow { background: var(--color-hover); color: var(--color-text-muted); }

  /* Neutral backgrounds */
  .room-title-avatars .room-avatar { border-color: var(--color-surface); }

  /* Mention hover card */
  .mention-hover-card { background: var(--color-card); }
  .mention-card-name { color: var(--color-text-primary); }
  .mention-card-role { color: var(--color-text-muted); }

  /* Mention popover */
  .mention-popover { background: var(--color-card); }
  .mention-popover-item:hover,
  .mention-popover-item.active { background: var(--color-hover); }
  .mention-popover-name { color: var(--color-text-primary); }

  /* Room header */
  .room-header { border-color: var(--color-border); }

  /* Room title menu (3-column flyover) */
  .room-title-menu {
    background: var(--color-card);
    box-shadow: 0 0 0 1px var(--color-border), 0 8px 24px rgba(0,0,0,0.3);
  }
  .rm-col + .rm-col { border-color: var(--color-border); }
  .rm-col-label { color: var(--color-text-muted); }
  .rm-col-count { color: var(--color-text-muted); background: var(--color-hover); }
  .rm-rename-input input {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text-primary);
  }

  /* Context column text */
  .rm-purpose-empty { color: var(--color-text-muted); }
  .rm-stat-label { color: var(--color-text-muted); }
  .rm-stat-value { color: var(--color-text-primary); }

  /* Members column */
  .rm-member-name { color: var(--color-text-primary); }
  .rm-member-role { color: var(--color-text-muted); }
  .rm-invite-btn { color: var(--color-text-secondary); }
  .rm-invite-btn:hover { background: var(--color-hover); }

  /* Integrations column */
  .rm-integration-btn {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text-primary);
  }
  .rm-integration-btn:hover { background: var(--color-hover); }

  /* Integration empty state + chips */
  .rm-int-empty svg { color: var(--color-text-muted); }
  .rm-int-empty > span:first-of-type { color: var(--color-text-secondary); }
  .rm-int-hint { color: var(--color-text-muted); }
  .rm-integrations-loading { color: var(--color-text-muted); }
  .rm-int-chip {
    background: var(--color-card);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
  }
  .rm-int-chip:hover {
    background: var(--color-hover);
    border-color: var(--color-room);
    color: var(--color-text-primary);
  }
  .rm-int-chip-other { color: var(--color-text-muted); }
  .rm-int-item:hover { background: var(--color-hover); }
  .rm-int-icon { background: var(--color-hover); }
  .rm-int-name { color: var(--color-text-primary); }
  .rm-int-email { color: var(--color-text-muted); }
  .rm-int-meta { color: var(--color-text-muted); }

  /* Context column sub-text */
  .rm-purpose-text { color: var(--color-text-secondary); }
  .rm-purpose-editable:hover { background: var(--color-hover); }
  .rm-meta-label { color: var(--color-text-muted); }
  .rm-meta-value { color: var(--color-text-secondary); }
  .rm-usage-toggle { color: var(--color-text-secondary); }
  .rm-usage-toggle:hover { background: var(--color-hover); color: var(--color-text-primary); }
  .rm-usage-loading { color: var(--color-text-muted); }
  .rm-usage-row { color: var(--color-text-secondary); }
  .rm-usage-value { color: var(--color-text-primary); }
  .rm-usage-total { color: var(--color-text-primary); border-top-color: var(--color-border); }
  .rm-usage-empty { color: var(--color-text-muted); }

  /* Room flyover/panel (fallback) */
  .room-flyover { background: var(--color-card); border-color: var(--color-border); }
  .room-flyover-section-title { color: var(--color-text-muted); }

  /* Room sidebar — brighter text and hashes in dark mode */
  .room-item { color: var(--color-text-primary); }
  .room-item-hash { opacity: 0.8; }
  .room-title-hash { opacity: 0.8; }
  .room-item-av-overflow { background: var(--color-hover); color: var(--color-text-muted); }

  /* Translation in dark mode */
  .room-translate-btn { color: var(--color-text-muted); }
  .room-translate-btn:hover { color: var(--color-text-primary); background: var(--color-hover); }
  .room-translated-label { color: var(--color-text-muted); }

  /* ── Suggestion chips — room-tinted for dark backgrounds ── */
  .room-chip {
    background: color-mix(in srgb, var(--color-room) 12%, transparent);
    color: var(--color-room);
  }
  .room-chip:hover {
    background: color-mix(in srgb, var(--color-room) 20%, transparent);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--color-room) 15%, transparent);
  }
  .room-chip.skeleton {
    background: linear-gradient(90deg, color-mix(in srgb, var(--color-room) 8%, transparent) 25%, color-mix(in srgb, var(--color-room) 15%, transparent) 50%, color-mix(in srgb, var(--color-room) 8%, transparent) 75%);
    background-size: 200% 100%;
  }

  /* ── Invite modal ── */
  .room-invite-modal {
    background: var(--color-card);
    color: var(--color-text-primary);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  }
  .room-invite-search {
    background: var(--color-input-bg);
    border-color: var(--color-border);
    color: var(--color-text-primary);
  }
  .room-invite-item:hover { background: var(--color-hover); }
  .room-invite-item-name { color: var(--color-text-primary); }
  .room-invite-item-email { color: var(--color-text-muted); }
  .room-invite-item-action.invited {
    background: var(--color-hover);
    color: var(--color-text-muted);
  }
  .room-invite-close {
    background: var(--color-hover);
    color: var(--color-text-secondary);
  }
  .room-invite-close:hover { background: var(--color-active); }

  /* ── Create room modal ── */
  .room-create-modal {
    background: var(--color-card);
    color: var(--color-text-primary);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  }
  .room-modal-tabs { border-color: var(--color-border); }
  .room-modal-tab { color: var(--color-text-muted); }
  .room-modal-tab:hover { color: var(--color-text-primary); }
  .room-create-purpose,
  .room-create-slug-row,
  .room-create-members,
  .room-create-member-results.open { border-color: var(--color-border); }
  .room-create-purpose,
  .room-create-input,
  .room-create-member-search {
    color: var(--color-text-primary);
  }
  .room-create-purpose { background: var(--color-input-bg); }
  .room-create-purpose::placeholder,
  .room-create-input::placeholder,
  .room-create-member-search::placeholder { color: var(--color-text-muted); }
  .room-create-hint,
  .room-create-visibility-hint { color: var(--color-text-muted); }
  .room-create-visibility { color: var(--color-text-secondary); }
  .room-lock-icon { color: var(--color-text-muted); }
  .room-create-divider { background: var(--color-border); }
  .room-create-cancel {
    background: var(--color-hover);
    color: var(--color-text-secondary);
  }
  .room-create-cancel:hover { background: var(--color-active); }
  .room-create-suggestion { background: rgba(255,255,255,0.05); }
  .room-create-suggestion:hover,
  .room-create-suggestion.active { background: rgba(255,255,255,0.08); }
  .room-create-member-item:hover { background: var(--color-hover); }
  .room-create-member-item-name { color: var(--color-text-primary); }
  .room-create-member-results.open { background: var(--color-card); }

  /* Browse rooms (inside create modal) */
  .browse-rooms-loading,
  .browse-rooms-empty { color: var(--color-text-muted); }
  .browse-room-item { border-color: var(--color-border); }
  .browse-room-name { color: var(--color-text-primary); }
  .browse-room-meta { color: var(--color-text-muted); }

  /* ── Tooltip ── */
  .nav-room-tooltip {
    background: var(--color-card);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
  }

  /* ── Sidebar browse rooms button ── */
  .sidebar-browse-rooms {
    border-color: var(--color-border);
    color: var(--color-text-muted);
  }
  .sidebar-browse-rooms:hover {
    border-color: var(--color-room);
    color: var(--color-room);
  }

  /* ── Pinned messages — dark mode ── */
  .room-pins-bar {
    background: var(--color-surface);
    border-color: var(--color-border);
  }
  .room-pins-header {
    color: var(--color-text-muted);
  }
  .room-pin-card {
    background: var(--color-card);
    border-color: var(--color-border);
  }
  .room-pin-card:hover {
    background: var(--color-hover);
  }
  .room-pin-name {
    color: var(--color-text-primary);
  }
  .room-pin-time {
    color: var(--color-text-muted);
  }
  .room-pin-content {
    color: var(--color-text-secondary);
  }
  .room-pin-unpin {
    color: var(--color-text-muted);
  }
  .room-pin-unpin:hover {
    color: #ef4444;
  }
  .room-pin-btn {
    color: var(--color-text-muted);
  }
  .room-pin-btn:hover {
    color: var(--color-room);
  }
  .room-pin-btn.pinned {
    color: var(--color-room);
  }
  .pin-dot {
    background: var(--color-room);
  }

  /* ── File upload — dark mode ── */
  .room-file-upload-btn {
    color: var(--color-text-muted);
  }
  .room-file-upload-btn:hover {
    background: var(--color-hover);
    color: var(--color-text-primary);
  }
  .room-file-badges {
    background: transparent;
  }
  .room-file-badge {
    background: var(--color-card);
    border-color: var(--color-border);
    color: var(--color-text-primary);
  }
  .room-file-badge.error {
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
  }
  .room-file-badge-status {
    color: var(--color-text-muted);
  }
  .room-file-badge.ready .room-file-badge-status {
    color: #4ade80;
  }
  .room-file-badge-remove {
    color: var(--color-text-muted);
  }
  .room-file-badge-remove:hover {
    color: #ef4444;
  }
  .room-file-badge .status-typing span {
    background: var(--color-text-muted);
  }
}

/* ── Message translation ── */
.room-translate-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-left: 44px;
}
.room-message.consecutive .room-translate-bar {
  padding-left: 44px;
}
.room-translate-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: none;
  border-radius: 4px;
  background: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted, #999);
  cursor: pointer;
  transition: color 0.1s, background 0.1s;
}
.room-translate-btn:hover {
  color: var(--color-text-secondary, #666);
  background: var(--color-hover, rgba(0,0,0,0.04));
}
.room-translate-btn svg { flex-shrink: 0; }

.room-translated-label {
  font-size: 11px;
  color: var(--color-text-muted, #999);
  font-style: italic;
}

/* Shimmer animation on message content during translation */
@keyframes room-translate-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.room-msg-body .content.translating {
  position: relative;
}
.room-msg-body .content.translating::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(75,53,194,0.06) 40%,
    rgba(75,53,194,0.12) 50%,
    rgba(75,53,194,0.06) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: room-translate-shimmer 1.2s ease-in-out infinite;
  pointer-events: none;
}

/* ── Mobile: room flyover stacks vertically ── */
@media (max-width: 768px) {
  .room-title-menu {
    left: 8px;
    right: 8px;
    transform: translateY(-8px) scale(0.97);
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .room-title-menu.open {
    transform: translateY(0) scale(1);
  }
  .rm-columns {
    flex-direction: column;
    min-width: 0;
  }
  .rm-col + .rm-col {
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.06);
  }
}

/* ── Pinned messages bar ── */
.room-pins-bar {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: var(--color-surface, #fff);
  padding: 0 16px;
}
.room-pins-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  color: var(--color-text-secondary, #57534e);
  font-size: 12px;
  font-weight: 600;
  cursor: default;
  letter-spacing: 0.01em;
}
.room-pins-header svg { color: var(--color-warning, #d97706); opacity: 0.9; }
.room-pins-count { flex: 1; }

/* Pinned in-flow messages: subtle left accent + background tint.
   Use negative margin-left so the 3px border sits in the gutter without
   eating into the 58px avatar column (otherwise the absolute-positioned
   avatar overlaps the name). Mirrors the .mentioned pattern above. */
.room-message.pinned {
  background: color-mix(in srgb, var(--color-warning, #d97706) 4%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--color-warning, #d97706) 70%, transparent);
  margin-left: -3px;
  position: relative;
}
.room-message.pinned .room-msg-header::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 2px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 17v5'/><path d='M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z'/></svg>");
  vertical-align: middle;
  opacity: 0.85;
}
.room-pins-toggle {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
}
.room-pins-chevron {
  transition: transform 0.2s;
}
.room-pins-chevron.expanded {
  transform: rotate(180deg);
}
.room-pins-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
}
.room-pin-card {
  background: var(--color-surface-raised, #fafaf9);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 8px 12px;
  position: relative;
  cursor: pointer;
  transition: opacity 0.2s, background 0.12s;
}
.room-pin-card:hover {
  background: var(--color-hover, rgba(0,0,0,0.02));
}
.room-pin-card.refreshing {
  opacity: 0.7;
}

/* Pin card header — matches message header style */
.room-pin-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.room-pin-avatar,
.room-pin-avatar-fallback {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}
.room-pin-avatar { object-fit: cover; }
.room-pin-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-room, #4B35C2);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
.room-pin-avatar-pine {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.room-pin-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
}
.room-pin-time {
  font-size: 11px;
  color: var(--color-text-muted, #79716b);
}
.room-pin-updated {
  font-size: 11px;
  color: var(--color-text-muted, #79716b);
  opacity: 0.7;
}
.room-pin-unpin {
  margin-left: auto;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--color-text-muted, #79716b);
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
}
.room-pin-card:hover .room-pin-unpin { opacity: 0.6; }
.room-pin-unpin:hover { opacity: 1 !important; color: var(--color-danger, #dc2626); }

/* Pin content — truncated to 2 lines */
.room-pin-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary, #44403c);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-pin-content p { margin: 0; display: inline; }
.room-pin-content p + p::before { content: " "; }
.room-pin-content pre,
.room-pin-content ul,
.room-pin-content ol,
.room-pin-content h1,
.room-pin-content h2,
.room-pin-content h3 { display: inline; font-size: inherit; font-weight: inherit; margin: 0; padding: 0; }
.room-pin-content li { display: inline; }
.room-pin-content li::before { content: " · "; }
.room-pin-content code { font-size: 12px; }

/* Scroll-to highlight animation */
@keyframes pin-highlight-flash {
  0% { background: var(--color-room, #4B35C2); box-shadow: 0 0 0 4px rgba(75,53,194,0.15); }
  100% { background: transparent; box-shadow: none; }
}
.room-message.pin-highlight {
  animation: pin-highlight-flash 1.5s ease-out;
  border-radius: 8px;
}

/* Pin refreshing dots animation */
.room-pin-refreshing {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.pin-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-room, #4B35C2);
  opacity: 0.4;
  animation: pin-dot-pulse 1.4s infinite ease-in-out;
}
.pin-dot:nth-child(2) { animation-delay: 0.2s; }
.pin-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pin-dot-pulse {
  0%, 80%, 100% { opacity: 0.4; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ── Pin button on messages ── */
.room-pin-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-text-muted, #79716b);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  display: flex;
  align-items: center;
}
.room-message:hover .room-pin-btn { opacity: 0.5; }
.room-pin-btn:hover { opacity: 1 !important; color: var(--color-room, #4B35C2); }
.room-pin-btn.pinned {
  opacity: 0.8;
  color: var(--color-room, #4B35C2);
}
.room-message:hover .room-pin-btn.pinned { opacity: 1; }

/* ── File upload ── */
.room-file-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--color-text-muted, #79716b);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.room-file-upload-btn:hover {
  background: rgba(0,0,0,0.04);
  color: var(--color-text-primary, #1c1917);
}

.room-file-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}
.room-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface-raised, #fafaf9);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--color-text-primary, #1c1917);
}
.room-file-badge.error {
  border-color: rgba(220,38,38,0.2);
  color: var(--color-danger, #dc2626);
}
.room-file-badge-name {
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-file-badge-status {
  color: var(--color-text-muted, #79716b);
  font-size: 11px;
}
.room-file-badge.ready .room-file-badge-status {
  color: var(--color-success, #16a34a);
}
.room-file-badge-remove {
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-muted, #79716b);
  line-height: 1;
}
.room-file-badge-remove:hover { color: var(--color-danger, #dc2626); }

/* Typing dots inside badge */
.room-file-badge .status-typing {
  display: inline-flex;
  gap: 2px;
}
.room-file-badge .status-typing span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-text-muted, #79716b);
  animation: typing-dots 1.4s infinite ease-in-out;
}
.room-file-badge .status-typing span:nth-child(2) { animation-delay: 0.2s; }
.room-file-badge .status-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Attachment download badges on messages */
.room-msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.room-msg-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: color-mix(in srgb, var(--color-text-primary, #1c1917) 4%, transparent);
  border: 1px solid var(--color-border, #e7e5e4);
  border-radius: 8px;
  color: var(--color-text-secondary, #57534e);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

.room-msg-attachment:hover {
  background: color-mix(in srgb, var(--color-text-primary, #1c1917) 6%, transparent);
  border-color: color-mix(in srgb, var(--color-text-primary, #1c1917) 18%, transparent);
  color: var(--color-text-primary, #1c1917);
}

.room-msg-attachment svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.room-msg-attachment:hover svg {
  opacity: 1;
}

.room-msg-attachment-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.room-msg-attachment-size {
  opacity: 0.5;
  font-size: 11px;
  white-space: nowrap;
}
/* ── Thread pane (slides in from right) ── */
.room-thread-pane {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(560px, 100vw);
  background: var(--color-surface, #fff);
  border-left: 1px solid var(--color-border, #e7e5e4);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.06);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0s linear 0.22s;
}
.room-thread-pane.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0s linear 0s;
}
/* When the thread pane is open, shrink chat-main so it isn't obscured.
   Matches how the key-points rail pushes the chat via margin-right. */
.chat-wrapper:has(.room-thread-pane.open) .chat-main {
  margin-right: min(560px, 100vw);
  transition: margin-right 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-main { transition: margin-right 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
.room-thread-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border, #e7e5e4);
}
.room-thread-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}
.room-thread-count {
  font-size: 12px;
  color: var(--color-text-muted, #a8a29e);
}
.room-thread-close {
  background: transparent;
  border: 0;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-muted, #a8a29e);
}
.room-thread-close:hover { background: var(--color-hover, rgba(0,0,0,0.04)); }
.room-thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
/* Thread-pane messages reuse the main Slack-style avatar column. Tight
   vertical rhythm: replies only need minimal top/bottom padding. */
.room-thread-body .room-message {
  padding-left: 36px;
  padding-right: 16px;
}
.room-thread-body .room-thread-root {
  padding-top: 0;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--color-border, #e7e5e4);
}
.room-thread-body .room-thread-reply {
  padding-top: 2px;
  padding-bottom: 2px;
}
.room-thread-body .room-message:not(.consecutive) {
  padding-top: 4px;
}
.room-thread-body .room-thread-reply .room-msg-header { margin-bottom: 0; }
.room-thread-body .room-msg-avatar,
.room-thread-body .room-msg-avatar-fallback,
.room-thread-body .room-msg-avatar-pine {
  left: 0;
  top: 4px;
}
.room-thread-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border, #e7e5e4);
}
.room-thread-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border, #e7e5e4);
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-card, #fff);
  color: var(--color-text-primary, #1c1917);
}
.room-thread-input:focus {
  outline: none;
  border-color: var(--color-room, #4b35c2);
}
.room-thread-submit {
  padding: 6px 14px;
  background: var(--color-room, #4b35c2);
  color: white;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.room-thread-submit:hover { filter: brightness(1.1); }

@media (max-width: 640px) {
  .room-thread-pane { width: 100vw; }
}
/* ── Key points rail (persistent right column when viewport is wide) ── */
.room-keypoints-rail {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  border-left: 1px solid var(--color-border, #e7e5e4);
  background: var(--color-surface, #fff);
  overflow: hidden;
  display: none; /* hidden by default; enabled at >=1280px */
  transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.room-keypoints-rail.collapsed { width: 32px; }
.room-keypoints-rail .room-keypoints-panel {
  padding: 16px;
  height: 100%;
  overflow-y: auto;
  opacity: 1;
  transition: opacity 0.12s;
}
.room-keypoints-rail.collapsed .room-keypoints-panel {
  opacity: 0;
  pointer-events: none;
}
.room-keypoints-toggle {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 32px;
  background: none;
  border: none;
  border-right: 1px solid transparent;
  cursor: pointer;
  color: var(--color-text-muted, #a8a29e);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  transition: background 0.12s, color 0.12s;
  z-index: 2;
}
.room-keypoints-toggle:hover {
  background: color-mix(in srgb, var(--color-text-primary, #1c1917) 3%, transparent);
  color: var(--color-text-primary, #1c1917);
}
.room-keypoints-rail:not(.collapsed) .room-keypoints-toggle {
  width: 100%;
  height: 32px;
  flex-direction: row;
  justify-content: space-between;
  padding: 0 12px;
  border-right: none;
  border-bottom: 1px solid var(--color-border, #e7e5e4);
}
.room-keypoints-rail:not(.collapsed) .room-keypoints-panel {
  padding-top: 40px;
}
.room-keypoints-toggle-chevron {
  transition: transform 0.18s ease;
}
.room-keypoints-rail.collapsed .room-keypoints-toggle-chevron {
  transform: rotate(180deg);
}
.room-keypoints-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-muted, #a8a29e);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.room-keypoints-rail.collapsed .room-keypoints-toggle-label {
  display: inline-flex;
}
.room-keypoints-rail:not(.collapsed) .room-keypoints-toggle-label {
  writing-mode: horizontal-tb;
  transform: none;
  color: var(--color-text-primary, #1c1917);
  font-size: 12px;
}
.room-keypoints-toggle-label svg {
  flex-shrink: 0;
}
@media (min-width: 1280px) {
  .room-keypoints-rail { display: block; }
  .chat-main:has(+ .room-keypoints-rail) { margin-right: 280px; transition: margin-right 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
  .chat-main:has(+ .room-keypoints-rail.collapsed) { margin-right: 32px; }
}
.room-keypoints-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.room-keypoints-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
}
.room-keypoints-title svg {
  color: var(--color-text-muted, #a8a29e);
  flex-shrink: 0;
}
.room-keypoints-updated {
  font-size: 11px;
  color: var(--color-text-muted, #a8a29e);
}
.room-keypoints-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary, #44403c);
}
.room-keypoints-content p { margin: 0 0 6px; }
.room-keypoints-content ul { padding-left: 18px; margin: 0; }
.room-keypoints-content li { margin-bottom: 4px; }
.room-keypoints-empty {
  font-size: 12px;
  color: var(--color-text-muted, #a8a29e);
  margin: 0 0 8px;
  line-height: 1.45;
}
.room-keypoints-progress {
  font-size: 11px;
  color: var(--color-text-muted, #a8a29e);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.room-keypoints-pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted, #a8a29e);
}
.room-keypoints-pending-dots {
  display: inline-flex;
  gap: 3px;
}
.room-keypoints-pending-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: room-keypoints-pulse 1.2s ease-in-out infinite;
}
.room-keypoints-pending-dots span:nth-child(2) { animation-delay: 0.2s; }
.room-keypoints-pending-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes room-keypoints-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.3); }
}

/* Mention popover Pine affordance (#115 polish) */
.mention-popover-item .mention-popover-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-muted, #a8a29e);
  opacity: 0;
  transition: opacity 0.12s;
}
.mention-popover-item.active .mention-popover-hint,
.mention-popover-item:hover .mention-popover-hint {
  opacity: 1;
}
.mention-popover-item.is-pine .mention-popover-name::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--color-brand);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}


/* ── Share-with-room modal (room-scoped integration consent) ── */
.share-room-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: var(--z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-room-modal-backdrop[hidden] { display: none; }
.share-room-modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 460px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: secureCardAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.share-room-modal h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.share-room-modal-body {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #444;
}
.share-room-modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.share-room-modal-options form { margin: 0; }
.share-room-modal-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  background: #f7f7f5;
  border: 1px solid #e5e5e2;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  font-family: inherit;
  color: inherit;
}
.share-room-modal-option:hover { background: #efefea; border-color: #d4d4cf; }
.share-room-modal-option strong {
  font-size: 13px;
  font-weight: 600;
}
.share-room-modal-option span {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}
.share-room-modal-footer {
  display: flex;
  justify-content: flex-end;
}
.share-room-modal-cancel {
  background: transparent;
  border: none;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  padding: 8px 12px;
  font-family: inherit;
}
.share-room-modal-cancel:hover { color: #222; }
