/* sequrechat.css — SequreChat brand styles */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --sc-teal:        #1D9E75;
  --sc-teal-light:  #E1F5EE;
  --sc-teal-mid:    #5DCAA5;
  --sc-teal-dark:   #0F6E56;
  --sc-teal-deep:   #085041;
  --sc-purple-light:#CECBF6;
  --sc-purple-dark: #3C3489;
  --sc-gray-light:  #D3D1C7;
  --sc-gray-dark:   #444441;
  --sc-border:      rgba(0,0,0,0.08);
  --sc-bg:          #f5f5f3;
  --sc-surface:     #ffffff;
  --sc-surface-2:   #f0f0ee;
  --sc-text:        #1a1a18;
  --sc-text-muted:  #6b6b68;
  --sc-text-hint:   #9a9a96;
  --sc-radius-sm:   8px;
  --sc-radius-md:   12px;
  --sc-radius-lg:   16px;
  --sc-font:        'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sc-shadow:      0 1px 3px rgba(0,0,0,0.08);
}

/* ── Dark mode — system default (overridden by data-theme) ─── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sc-bg:        #111110;
    --sc-surface:   #1c1c1a;
    --sc-surface-2: #252523;
    --sc-border:    rgba(255,255,255,0.08);
    --sc-text:      #f0f0ee;
    --sc-text-muted:#9a9a96;
    --sc-text-hint: #6b6b68;
  }
}

/* ── Explicit dark mode (user toggled) ──────────────────────── */
[data-theme="dark"] {
  --sc-bg:        #111110;
  --sc-surface:   #1c1c1a;
  --sc-surface-2: #252523;
  --sc-border:    rgba(255,255,255,0.08);
  --sc-text:      #f0f0ee;
  --sc-text-muted:#9a9a96;
  --sc-text-hint: #6b6b68;
}

/* ── Explicit light mode (user toggled) ─────────────────────── */
[data-theme="light"] {
  --sc-bg:        #f5f5f3;
  --sc-surface:   #ffffff;
  --sc-surface-2: #f0f0ee;
  --sc-border:    rgba(0,0,0,0.08);
  --sc-text:      #1a1a18;
  --sc-text-muted:#6b6b68;
  --sc-text-hint: #9a9a96;
}

html, body {
  margin: 0; padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--sc-font);
  background: var(--sc-bg);
  color: var(--sc-text);
  -webkit-font-smoothing: antialiased;
}

/* ── Login page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--sc-bg);
}

.login-card {
  background: var(--sc-surface);
  border: 0.5px solid var(--sc-border);
  border-radius: var(--sc-radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--sc-shadow);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--sc-teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.login-logo-icon svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: white; stroke-width: 1.8; }
.login-app-name { font-size: 1.2rem; font-weight: 500; color: var(--sc-text); margin: 0; }
.login-tagline  { font-size: 0.8rem; color: var(--sc-text-muted); margin: 0.2rem 0 0; }

.login-user-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.user-btn {
  border: 0.5px solid var(--sc-border);
  border-radius: var(--sc-radius-md);
  background: var(--sc-surface-2);
  padding: 1rem 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  font-family: var(--sc-font);
}
.user-btn:hover { border-color: var(--sc-teal-mid); background: var(--sc-teal-light); }
.user-btn.selected {
  border-color: var(--sc-teal);
  background: var(--sc-teal-light);
  border-width: 1.5px;
}

.user-btn-avatar {
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.user-btn-name { font-size: 0.8125rem; font-weight: 500; color: var(--sc-text); margin: 0; }

.sc-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sc-text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sc-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 0.5px solid var(--sc-border);
  border-radius: var(--sc-radius-sm);
  background: var(--sc-surface-2);
  color: var(--sc-text);
  font-family: var(--sc-font);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.sc-input:focus { border-color: var(--sc-teal); }
.sc-input-wrap { position: relative; }
.sc-input-wrap .sc-input { padding-right: 2.5rem; }
.sc-eye-btn {
  position: absolute; right: 0.6rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--sc-text-muted); padding: 0; line-height: 1;
}

.sc-form-group { margin-bottom: 1rem; }

.sc-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: var(--sc-radius-sm);
  background: var(--sc-teal);
  color: white;
  font-family: var(--sc-font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.sc-btn:hover   { opacity: 0.9; }
.sc-btn:active  { opacity: 0.8; }
.sc-btn:disabled{ opacity: 0.5; cursor: not-allowed; }

.sc-alert {
  padding: 0.6rem 0.85rem;
  border-radius: var(--sc-radius-sm);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}
.sc-alert-danger  { background: #fde8e8; color: #7b1d1d; border: 0.5px solid #f5c6c6; }
.sc-alert-success { background: var(--sc-teal-light); color: var(--sc-teal-dark); border: 0.5px solid var(--sc-teal-mid); }

.enc-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  color: var(--sc-text-hint);
  justify-content: center;
  margin-top: 1.25rem;
}
.enc-note svg { width: 0.75rem; height: 0.75rem; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

/* ── Chat layout ────────────────────────────────────────────── */
.chat-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--sc-surface);
  overflow: hidden;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  margin: 0 auto;
}

/* ── Chat header ─────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 0.5px solid var(--sc-border);
  background: var(--sc-surface);
  flex-shrink: 0;
}

.ch-avatar {
  width: 2.375rem; height: 2.375rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem; font-weight: 500;
  flex-shrink: 0;
}
.ch-info { flex: 1; min-width: 0; }
.ch-name { font-size: 0.875rem; font-weight: 500; color: var(--sc-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-status { font-size: 0.75rem; color: var(--sc-text-muted); margin: 0; display: flex; align-items: center; gap: 4px; }
.ch-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sc-teal); flex-shrink: 0; }

.enc-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--sc-teal-dark);
  background: var(--sc-teal-light);
  border: 0.5px solid var(--sc-teal-mid);
  border-radius: 20px;
  padding: 3px 9px;
  flex-shrink: 0;
  white-space: nowrap;
}
.enc-badge svg { width: 0.6875rem; height: 0.6875rem; stroke: currentColor; fill: none; stroke-width: 2.2; }

.ch-menu-btn {
  background: none; border: none; cursor: pointer;
  color: var(--sc-text-muted); padding: 0.25rem;
  border-radius: var(--sc-radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.ch-menu-btn:hover { background: var(--sc-surface-2); }
.ch-menu-btn svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ── Messages area ───────────────────────────────────────────── */
.messages-area {
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.date-divider {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--sc-text-hint);
  margin: 0.25rem 0;
  position: relative;
}
.date-divider span {
  background: var(--sc-surface);
  padding: 0 0.75rem;
  position: relative;
  z-index: 1;
}
.date-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 0.5px;
  background: var(--sc-border);
}

.msg-row { display: flex; flex-direction: column; gap: 2px; }
.msg-row.mine   { align-items: flex-end; }
.msg-row.theirs { align-items: flex-start; }

.msg-inner {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
}
.msg-row.mine .msg-inner { flex-direction: row-reverse; }

.msg-avatar {
  width: 1.625rem; height: 1.625rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.625rem; font-weight: 500;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.bubble {
  width: 55%;
  padding: 9px 13px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--sc-text);
  word-break: break-word;
  white-space: pre-wrap;
}
.bubble.theirs {
  background: var(--sc-surface-2);
  border: 0.5px solid var(--sc-border);
  border-radius: 16px 16px 16px 4px;
}
.bubble.mine {
  background: var(--sc-surface);
  border: 0.5px solid var(--sc-border);
  border-radius: 16px 16px 4px 16px;
}

.bubble.archived {
  opacity: 0.45;
  font-style: italic;
}

.msg-time {
  font-size: 0.625rem;
  color: var(--sc-text-hint);
  padding: 0 32px;
}

/* Media bubbles */
.media-bubble {
  width: 55%;
  border-radius: 12px;
  overflow: hidden;
  border: 0.5px solid var(--sc-border);
  background: var(--sc-surface-2);
  cursor: pointer;
}
.media-bubble img,
.media-bubble video {
  width: 100%;
  display: block;
  max-height: 260px;
  object-fit: cover;
}
.media-file {
  width: 55%;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sc-surface-2);
  border: 0.5px solid var(--sc-border);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--sc-text);
}
.media-file svg { width: 1.125rem; height: 1.125rem; stroke: var(--sc-teal); fill: none; stroke-width: 1.8; flex-shrink: 0; }
.media-file-name { font-size: 0.8125rem; color: var(--sc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-file-size { font-size: 0.6875rem; color: var(--sc-text-muted); }

/* Decrypting spinner */
.msg-decrypting { font-size: 0.75rem; color: var(--sc-text-hint); padding: 9px 13px; }

/* Archive button (on hover) */
.msg-row:hover .msg-archive-btn { opacity: 1; }
.msg-archive-btn {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sc-text-hint);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.6875rem;
  transition: opacity 0.15s, color 0.15s;
  align-self: center;
  white-space: nowrap;
}
.msg-archive-btn:hover { color: var(--sc-text-muted); }

/* ── Input bar ───────────────────────────────────────────────── */
.input-bar {
  padding: 0.75rem 1rem;
  border-top: 0.5px solid var(--sc-border);
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--sc-surface);
  flex-shrink: 0;
  flex-grow: 0;
  position: relative;
  z-index: 10;
}

.attach-btn {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  border: 0.5px solid var(--sc-border);
  background: var(--sc-surface-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--sc-text-muted);
  flex-shrink: 0;
  transition: background 0.15s;
}
.attach-btn:hover { background: var(--sc-surface-2); border-color: var(--sc-teal-mid); color: var(--sc-teal); }
.attach-btn svg { width: 1.125rem; height: 1.125rem; stroke: currentColor; fill: none; stroke-width: 1.8; }

.chat-input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border-radius: 20px;
  border: 0.5px solid var(--sc-border);
  background: var(--sc-surface-2);
  color: var(--sc-text);
  font-family: var(--sc-font);
  font-size: 0.875rem;
  outline: none;
  resize: none;
  min-height: 2.25rem;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color 0.15s;
  overflow-y: auto;
}
.chat-input:focus { border-color: var(--sc-teal); }

.send-btn {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  border: none;
  background: var(--sc-teal);
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.send-btn:hover  { opacity: 0.88; }
.send-btn:active { opacity: 0.75; }
.send-btn svg { width: 1rem; height: 1rem; stroke: white; fill: none; stroke-width: 2; }

/* Upload progress bar */
.upload-bar {
  padding: 0.4rem 1rem;
  background: var(--sc-teal-light);
  border-top: 0.5px solid var(--sc-teal-mid);
  font-size: 0.75rem;
  color: var(--sc-teal-dark);
  display: none;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.upload-bar.active { display: flex; }
.upload-bar-track {
  flex: 1;
  height: 3px;
  background: var(--sc-teal-mid);
  border-radius: 2px;
  overflow: hidden;
}
.upload-bar-fill {
  height: 100%;
  background: var(--sc-teal-dark);
  transition: width 0.2s;
  width: 0%;
}

/* Archive filter bar */
.filter-bar {
  padding: 0.4rem 1rem;
  border-bottom: 0.5px solid var(--sc-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--sc-surface-2);
  flex-shrink: 0;
}
.filter-btn {
  font-size: 0.75rem;
  font-family: var(--sc-font);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 0.5px solid var(--sc-border);
  background: var(--sc-surface);
  color: var(--sc-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn.active {
  background: var(--sc-teal-light);
  border-color: var(--sc-teal-mid);
  color: var(--sc-teal-dark);
}

/* ── Dropdown menu ───────────────────────────────────────────── */
.sc-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--sc-surface);
  border: 0.5px solid var(--sc-border);
  border-radius: var(--sc-radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
  white-space: nowrap;
}
.sc-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.8125rem;
  color: var(--sc-text);
  cursor: pointer;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--sc-font);
  text-align: left;
}
.sc-dropdown-item:hover { background: var(--sc-surface-2); }
.sc-dropdown-item svg { width: 0.9375rem; height: 0.9375rem; stroke: currentColor; fill: none; stroke-width: 1.8; }
.sc-dropdown-item.danger { color: #c81e1e; }
.sc-dropdown-sep { height: 0.5px; background: var(--sc-border); margin: 0.25rem 0; }
.ch-menu-wrap { position: relative; }

/* ── Passphrase modal ────────────────────────────────────────── */
.sc-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.sc-modal {
  background: var(--sc-surface);
  border: 0.5px solid var(--sc-border);
  border-radius: var(--sc-radius-lg);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 360px;
}
.sc-modal h2 { font-size: 1rem; font-weight: 500; margin: 0 0 0.4rem; color: var(--sc-text); }
.sc-modal p  { font-size: 0.8125rem; color: var(--sc-text-muted); margin: 0 0 1.25rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .bubble, .media-bubble, .media-file { width: 78%; }
  .enc-badge span { display: none; }
  .chat-layout { max-width: 100%; }
  .login-card { padding: 2rem 1.25rem; }
}

/* ── Spinner ─────────────────────────────────────────────────── */
.sc-spinner {
  width: 1rem; height: 1rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* scrollbar */
.messages-area::-webkit-scrollbar { width: 4px; }
.messages-area::-webkit-scrollbar-thumb { background: var(--sc-border); border-radius: 2px; }

/* ── Emoji picker ────────────────────────────────────────────── */
.emoji-cat-btn {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.1s;
}
.emoji-cat-btn:hover  { background: var(--sc-surface-2); }
.emoji-cat-btn.active { background: var(--sc-teal-light); }

.emoji-item {
  background: none;
  border: none;
  font-size: 1.875rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.1s;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-item:hover { background: var(--sc-surface-2); transform: scale(1.2); }

/* ── Avatar upload modal preview ────────────────────────────── */
#ch-avatar-wrap { cursor: pointer; }
#ch-avatar-wrap:hover .ch-avatar { opacity: 0.8; }

/* ── Emoji-only messages ─────────────────────────────────────── */
.bubble-emoji {
  font-size: 3.75rem !important;
  line-height: 1.15 !important;
  background: transparent !important;
  border-color: transparent !important;
  padding: 4px 8px !important;
}

/* ── Right-justify "mine" bubble text ───────────────────────── */
.bubble.mine {
  text-align: right;
}

/* ── Dual-user presence header ───────────────────────────────── */

/* Header: single row — users left, enc badge centre, menu right */
.chat-header {
  flex-direction: row;
  align-items: center;
  padding: 0.6rem 1rem;
  gap: 0.5rem;
}

/* Both user slots grouped together on the left */
.ch-users {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.ch-user-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ch-user-av-wrap {
  position: relative;
  display: inline-flex;
}

.presence-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 0.5625rem;
  height: 0.5625rem;
  border-radius: 50%;
  border: 2px solid var(--sc-surface);
  background: #c0bfbc;
  transition: background 0.3s;
}
.presence-dot.online  { background: var(--sc-teal); }
.presence-dot.offline { background: #c0bfbc; }

.ch-user-name {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--sc-text-muted);
  white-space: nowrap;
}

/* Centre info (enc badge) takes remaining space */
.ch-info {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* ── Right controls (zoom + menu) ───────────────────────────── */
.ch-right-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.ch-right-controls .ch-menu-wrap {
  position: relative;
}

/* Disabled zoom button */
.ch-menu-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Zoom affects root font-size; everything using rem/em scales automatically */
html { font-size: 1rem; }

/* -- Jump to latest button ---------------------------------------- */
.jump-latest-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.9rem;
  background: var(--sc-teal);
  color: white;
  border: none;
  border-radius: 20px;
  font-family: var(--sc-font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  white-space: nowrap;
  transition: opacity 0.15s;
}
.jump-latest-btn:hover { opacity: 0.88; }
.jump-latest-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: white;
}

/* ── Context menu ────────────────────────────────────────────── */
.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  color: var(--sc-text);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: var(--sc-font);
  text-align: left;
  transition: background 0.1s;
}
.ctx-menu-item:hover { background: var(--sc-surface-2); }

.quick-react-btn {
  background: none;
  border: none;
  font-size: 1.375rem;
  cursor: pointer;
  padding: 3px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.1s, transform 0.1s;
}
.quick-react-btn:hover { background: var(--sc-surface-2); transform: scale(1.2); }

/* ── Reaction pills ──────────────────────────────────────────── */
.reaction-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 2rem 0 2rem;
}
.reaction-pills.mine { justify-content: flex-end; padding: 2px 2rem 0 2rem; }

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 20px;
  border: 0.5px solid var(--sc-border);
  background: var(--sc-surface-2);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.1s;
  font-family: var(--sc-font);
}
.reaction-pill span { font-size: 0.75rem; color: var(--sc-text-muted); }
.reaction-pill.mine { background: var(--sc-teal-light); border-color: var(--sc-teal-mid); }
.reaction-pill:hover { background: var(--sc-surface); }

/* ── Reply quote ─────────────────────────────────────────────── */
.reply-quote {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 5px 8px;
  margin-bottom: 6px;
  border-left: 2.5px solid var(--sc-teal);
  background: rgba(0,0,0,0.04);
  border-radius: 0 6px 6px 0;
  font-size: 0.75rem;
  color: var(--sc-text-muted);
  line-height: 1.4;
}
[data-theme="dark"] .reply-quote { background: rgba(255,255,255,0.05); }
.reply-quote svg { margin-top: 2px; stroke: var(--sc-teal); }

/* ── Bubble action button ────────────────────────────────────── */
.bubble-action-btn {
  opacity: 0;
  background: var(--sc-surface);
  border: 0.5px solid var(--sc-border);
  border-radius: 50%;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  transition: opacity 0.15s, background 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  padding: 0;
  color: var(--sc-text-muted);
}
.bubble-action-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  stroke: currentColor;
  fill: none;
}
.bubble-action-btn:hover {
  background: var(--sc-surface-2);
  color: var(--sc-text);
}

/* Show on row hover (desktop) */
.msg-row:hover .bubble-action-btn { opacity: 1; }

/* Always show on touch devices */
@media (hover: none) {
  .bubble-action-btn { opacity: 0.5; }
}

/* ── Read receipts ───────────────────────────────────────────── */
.read-receipt {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.read-receipt svg {
  width: 14px;
  height: 10px;
}

/* ── Avatar tooltip ──────────────────────────────────────────── */
#avatar-tooltip {
  pointer-events: none;
  transition: opacity 0.15s;
}

/* ── GIF picker ──────────────────────────────────────────────── */
#gif-grid img {
  min-height: 60px;
  background: var(--sc-surface-2);
  transition: opacity 0.15s;
}
#gif-grid img:hover { opacity: 0.85; }

/* ── Select mode ─────────────────────────────────────────────── */
.msg-checkbox-wrap {
  display: flex;
  align-items: center;
  padding: 0 0.4rem 0 0.25rem;
  flex-shrink: 0;
  order: -1;
}
.msg-checkbox-wrap.mine {
  order: 10;
  padding: 0 0.25rem 0 0.4rem;
}
.msg-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--sc-teal);
  flex-shrink: 0;
}

/* Make message rows clickable in select mode */
.select-mode .msg-row { cursor: pointer; }

/* ── Attach menu ─────────────────────────────────────────────── */
.attach-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--sc-text);
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--sc-font);
  text-align: left;
  transition: background 0.1s;
}
.attach-menu-item:hover { background: var(--sc-surface-2); }
.attach-menu-item svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke: var(--sc-teal);
  fill: none;
  flex-shrink: 0;
}
