/* Secret Chat — soft "wellness" theme (mint green, rounded cards, soft shadows),
   dark + light. Hand-written CSS, no framework (NFR-01, NFR-03: tiny payload).
   Note: the --blue token is the PRIMARY accent (now green) — kept as a name so
   existing rules cascade without churn. */

:root {
  --radius-lg: 26px;
  --radius: 20px;
  --radius-sm: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Thai", "Sukhumvit Set", sans-serif;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0e1613;
  --bg-elev: #16211b;
  --bg-elev-2: #1f2c24;
  --panel: #131d17;
  --border: #29382f;
  --text: #e8f1eb;
  --text-dim: #93a89c;
  --text-faint: #62756a;
  --blue: #54cf94;        /* primary accent (green) */
  --blue-soft: #6cdaa4;
  --grad: linear-gradient(135deg, #23624191 0%, #18402c 100%);
  --hero-text: #ecf8f0;
  --bubble-me: #2f7d57;
  --bubble-me-text: #eafff3;
  --bubble-other: #1d2a23;
  --danger: #ef7a78;
  --ok: #5fd49b;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.30);
  --accent-mint: #1f3a2c; --accent-blue: #1b3340; --accent-peach: #3a2a24; --accent-yellow: #393522; --accent-purple: #2b2740;
}

[data-theme="light"] {
  --bg: #eaf5ec;
  --bg-elev: #ffffff;
  --bg-elev-2: #f1f8f3;
  --panel: #ffffff;
  --border: #e4eee6;
  --text: #22312a;
  --text-dim: #6a7d72;
  --text-faint: #9aaaa0;
  --blue: #45c089;        /* primary accent (green) */
  --blue-soft: #34a675;
  --grad: linear-gradient(135deg, #a3e2ad 0%, #63c98f 100%);
  --hero-text: #163c27;
  --bubble-me: #45c089;
  --bubble-me-text: #ffffff;
  --bubble-other: #eef5f0;
  --danger: #e8615f;
  --ok: #2fae73;
  --shadow: 0 14px 32px rgba(56, 130, 96, 0.16);
  --shadow-sm: 0 4px 16px rgba(56, 130, 96, 0.10);
  --accent-mint: #d9f2e2; --accent-blue: #dbedf8; --accent-peach: #fde3d7; --accent-yellow: #fdf3cf; --accent-purple: #e9e3f8;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
.app { height: 100dvh; display: flex; flex-direction: column; }
/* Soft decorative wash, like the reference's airy background. */
[data-theme="light"] body { background:
  radial-gradient(120% 60% at 100% 0%, #d8f0dd 0%, transparent 55%),
  radial-gradient(90% 50% at 0% 100%, #e3f3e6 0%, transparent 50%), var(--bg); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
a { color: var(--blue-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--blue); color: #fff; border-radius: 999px;
  padding: 13px 20px; font-size: 15px; font-weight: 700; letter-spacing: 0.2px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--blue) 36%, transparent);
  transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 8px 22px color-mix(in srgb, var(--blue) 44%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--bg-elev-2); color: var(--text); box-shadow: none; }
.btn.ghost:hover { background: var(--border); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: none; border: 1.5px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.block { width: 100%; }
.btn.icon { padding: 9px; border-radius: 50%; width: 42px; height: 42px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.input {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 15px; outline: none;
  transition: border-color var(--transition);
}
.input { background: var(--bg-elev-2); border-color: transparent; }
.input:focus { border-color: var(--blue); background: var(--bg-elev); }

/* ---- Centered card screens (auth) ---- */
.center { flex: 1; display: grid; place-items: center; padding: 22px; }
.card {
  width: 100%; max-width: 400px; background: var(--panel);
  border: none; border-radius: var(--radius-lg);
  padding: 30px 26px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.brand .logo { font-size: 26px; width: 38px; height: 38px; display: block; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--blue) 40%, transparent)); }
.brand h1 { font-size: 21px; margin: 0; letter-spacing: -0.3px; }
.subtitle { color: var(--text-dim); font-size: 13.5px; margin: 6px 0 20px; line-height: 1.5; }

.tabs { display: flex; background: var(--bg-elev-2); border-radius: 999px; padding: 5px; margin-bottom: 20px; }
.tabs button { flex: 1; padding: 10px; border-radius: 999px; font-weight: 700; color: var(--text-dim); transition: var(--transition); }
.tabs button.active { background: var(--blue); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--blue) 35%, transparent); }

.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 2px 0 12px; }

/* avatar picker */
.avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatar-opt {
  aspect-ratio: 1; border-radius: 50%; font-size: 26px; display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--border); transition: var(--transition);
}
.avatar-opt.sel { border-color: var(--blue); transform: scale(1.05); }

/* avatar bubble */
.avatar { border-radius: 50%; background: var(--bg-elev-2); display: grid; place-items: center; flex: none; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  padding-top: max(12px, env(safe-area-inset-top));
}
.topbar .title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; }
.topbar .sub { font-weight: 400; color: var(--text-dim); font-size: 12.5px; }
.spacer { flex: 1; }
/* Greeting hero (lobby) — soft green gradient header like the reference. */
.topbar.hero {
  background: var(--grad); border: none; color: var(--hero-text);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 18px 20px 22px; margin-bottom: 6px; box-shadow: var(--shadow-sm);
}
.topbar.hero .title { font-size: 20px; }
.topbar.hero .title, .topbar.hero .sub { color: var(--hero-text); }
.topbar.hero .sub { opacity: 0.8; }
.topbar.hero .tool-btn { color: var(--hero-text); }
.topbar.hero .tool-btn:hover { background: rgba(255,255,255,0.22); }
.topbar.hero .avatar { background: rgba(255,255,255,0.28); box-shadow: 0 0 0 3px rgba(255,255,255,0.18); }

/* ---- Lobby ---- */
.lobby { flex: 1; overflow-y: auto; padding: 18px 16px; max-width: 640px; width: 100%; margin: 0 auto; }
.section-title { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-faint); margin: 22px 4px 10px; font-weight: 700; }
.code-entry { display: flex; gap: 8px; justify-content: space-between; }
.code-box {
  width: 100%; aspect-ratio: 0.82; text-align: center; font-size: 26px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; background: var(--bg-elev);
  border: 2px solid transparent; border-radius: var(--radius-sm); color: var(--text); outline: none;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.code-box:focus { border-color: var(--blue); }
.room-list { display: flex; flex-direction: column; gap: 11px; }
.room-item {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: var(--bg-elev); border: none; border-radius: var(--radius);
  text-align: left; transition: var(--transition); box-shadow: var(--shadow-sm);
}
.room-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.room-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.room-item .label { font-weight: 600; flex: 1; }
.room-item .chev { color: var(--text-faint); }
/* Member/online counts + avatars, pushed to the right corner of the row. */
.room-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
.room-avatars { display: flex; }
.room-avatars .avatar.stack { width: 24px; height: 24px; font-size: 13px; margin-left: -7px; border: 2px solid var(--bg-elev); }
.room-avatars .avatar.stack:first-child { margin-left: 0; }
.room-avatars .avatar.on { box-shadow: 0 0 0 2px var(--ok); }
.room-meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.room-meta .on-dot { color: var(--ok); }
.unread-badge { background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; align-self: center; }
.empty { text-align: center; color: var(--text-faint); padding: 40px 20px; font-size: 14px; line-height: 1.6; }

/* ---- Chat ---- */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msg-scroll { flex: 1; overflow-y: auto; position: relative; padding: 14px 0; -webkit-overflow-scrolling: touch; }
.vlist { position: relative; width: 100%; }
.row { position: absolute; left: 0; right: 0; padding: 8px 16px; display: flex; gap: 10px; }
.row.me { flex-direction: row-reverse; }
.row .avatar { width: 34px; height: 34px; font-size: 18px; align-self: flex-end; margin-bottom: 18px; }
.row.me .avatar { display: none; }
.bubble-wrap { max-width: min(76%, 540px); display: flex; flex-direction: column; gap: 4px; }
.row.me .bubble-wrap { align-items: flex-end; }
.name { font-size: 12px; color: var(--text-dim); margin: 0 6px; font-weight: 600; }
.row.me .name { color: var(--blue-soft); }
.bubble {
  background: var(--bubble-other); color: var(--text); padding: 10px 14px;
  border-radius: 20px; border-bottom-left-radius: 7px; font-size: 15px; line-height: 1.45;
  word-break: break-word; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-sm);
}
.row.me .bubble { background: var(--bubble-me); color: var(--bubble-me-text); border-radius: 20px; border-bottom-right-radius: 7px; box-shadow: 0 4px 14px color-mix(in srgb, var(--blue) 28%, transparent); }
.time { font-size: 10.5px; color: var(--text-faint); margin: 0 6px; }
.bubble.sticker, .row.me .bubble.sticker { background: none; padding: 0; font-size: 58px; line-height: 1; border-radius: 0; }
.bubble.media { padding: 4px; }
.bubble img.media-img, .bubble video.media-vid {
  max-width: 100%; border-radius: 12px; display: block; max-height: 320px; cursor: pointer;
}
.bubble audio { display: block; }
.link-preview {
  margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg); max-width: 320px; text-decoration: none; color: inherit; display: block;
}
.link-preview img { width: 100%; max-height: 150px; object-fit: cover; display: block; }
.link-preview .lp-body { padding: 9px 11px; }
.link-preview .lp-title { font-weight: 600; font-size: 13.5px; }
.link-preview .lp-desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; max-height: 34px; overflow: hidden; }
.link-preview .lp-site { font-size: 11px; color: var(--text-faint); margin-top: 5px; }

/* composer */
.composer { background: transparent; padding: 8px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.composer-row { display: flex; align-items: flex-end; gap: 6px; background: var(--panel); border-radius: 26px; padding: 5px 6px; box-shadow: var(--shadow); }
.tool-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: var(--text-dim); flex: none; transition: var(--transition); }
.tool-btn:hover { background: var(--bg-elev-2); color: var(--text); }
.tool-btn.rec { color: var(--danger); animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.msg-input {
  flex: 1; resize: none; max-height: 120px; min-height: 40px; padding: 10px 8px;
  background: transparent; border: none; border-radius: 20px;
  color: var(--text); font-size: 15px; outline: none; line-height: 1.4;
}
.msg-input:focus { border: none; }

/* emoji / sticker panel */
.picker { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; max-height: 210px; overflow-y: auto; }
.picker-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.picker-grid.stickers { grid-template-columns: repeat(5, 1fr); }
.picker-grid button { aspect-ratio: 1; border-radius: 8px; font-size: 22px; display: grid; place-items: center; }
.picker-grid.stickers button { font-size: 38px; }
.picker-grid button:hover { background: var(--bg-elev-2); }
.picker-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.picker-tabs button { padding: 5px 12px; border-radius: 7px; font-size: 13px; color: var(--text-dim); }
.picker-tabs button.active { background: var(--bg-elev-2); color: var(--text); }

/* ---- Call banner (group call in progress) ---- */
.call-banner { display: flex; align-items: center; gap: 12px; margin: 8px 12px 0; padding: 10px 14px; background: var(--accent-mint); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.call-banner .cb-pulse { font-size: 20px; animation: pulse 1.2s infinite; }
.call-banner .cb-text { flex: 1; min-width: 0; }
.call-banner .cb-text b { font-size: 13.5px; color: var(--ok); }
.call-banner .cb-parts { display: flex; gap: 3px; margin-top: 4px; }
.call-banner .cb-parts .avatar { border: 2px solid var(--bg-elev); }
.call-banner .btn { padding: 8px 18px; font-size: 13px; }

/* ---- Member list ---- */
.member-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; margin: 6px 0 4px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; }
.member-row:hover { background: var(--bg-elev-2); }
.member-row .m-av { position: relative; flex: none; }
.member-row .status-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); }
.member-row .status-dot.on { background: var(--ok); }
.member-row .status-dot.off { background: var(--text-faint); }
.member-row .m-info { flex: 1; min-width: 0; }
.member-row .m-name { font-weight: 600; font-size: 14.5px; }
.member-row .m-status { font-size: 12px; color: var(--text-dim); }
.member-row .m-actions { display: flex; gap: 6px; }
.mini { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--bg-elev-2); color: var(--text-dim); transition: var(--transition); }
.mini:hover { background: var(--border); color: var(--text); }
.mini.danger { color: var(--danger); }
.banned-section { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--border); }

.settings-actions { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 16px; }
.settings-actions .btn { justify-content: flex-start; }

/* ---- PIN lock ---- */
.pin-lock { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px;
  background: var(--bg); }
.pin-lock .pin-box { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 14px; }
.pin-lock .pin-box h3 { margin: 0; }

/* voice call bar */
.callbar { background: var(--accent-mint); border-radius: var(--radius); margin: 8px 12px 0; padding: 9px 14px; display: flex; align-items: center; gap: 10px; }
.call-peers { display: flex; gap: 7px; flex: 1; flex-wrap: wrap; }
.call-peer { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 4px 11px 4px 5px; font-size: 12.5px; }
.call-peer .avatar { width: 24px; height: 24px; font-size: 13px; }
.call-peer.speaking { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(95,192,138,0.25); }

/* ---- Modal ---- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade 160ms; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border: none; border-radius: var(--radius-lg); padding: 26px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { color: var(--text-dim); font-size: 14px; margin: 0 0 18px; line-height: 1.5; }
.code-display { font-size: 34px; font-weight: 800; letter-spacing: 8px; text-align: center; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* image lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: grid; place-items: center; z-index: 60; padding: 20px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; pointer-events: none; }
.toast .t { background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border); padding: 11px 18px; border-radius: 30px; font-size: 14px; box-shadow: var(--shadow); animation: rise 200ms; }
.toast .t.err { border-color: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.hint { font-size: 12px; color: var(--text-faint); text-align: center; margin-top: 14px; line-height: 1.6; }

@media (min-width: 720px) {
  .chat, .composer-inner { max-width: 820px; width: 100%; margin: 0 auto; }
  .composer { width: 100%; }
}

/* ---- Presence (who's in the room) ---- */
.people { display: flex; align-items: center; gap: 0; margin-right: 4px; }
.people .avatar.stack { width: 28px; height: 28px; font-size: 15px; border: 2px solid var(--panel); margin-left: -8px; }
.people .avatar.stack:first-child { margin-left: 0; }
.people .more { font-size: 12px; color: var(--text-dim); margin-left: 4px; font-weight: 600; }
.people .count { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); background: var(--bg-elev-2); border-radius: 20px; padding: 3px 9px; }
.people .count::before { content: '👥'; font-size: 12px; }

/* ---- Read receipts ---- */
.seen-bar { display: flex; align-items: center; gap: 4px; padding: 0 18px 6px; min-height: 0; justify-content: flex-end; }
.seen-bar:empty { display: none; }
.seen-bar .seen-label { font-size: 11px; color: var(--text-faint); margin-right: 3px; }
.seen-bar .avatar { width: 18px; height: 18px; font-size: 10px; border: 1px solid var(--border); }

/* ---- Delete affordance ---- */
.row { align-items: center; }
.msg-del { opacity: 0; align-self: center; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; color: var(--text-faint); transition: var(--transition); flex: none; }
.row:hover .msg-del { opacity: 0.7; }
.msg-del:hover { opacity: 1 !important; background: var(--bg-elev-2); color: var(--danger); }
@media (hover: none) { .msg-del { display: none; } } /* mobile uses long-press */

/* ---- Stickers (image / GIF) ---- */
.sticker-img { max-width: 150px; max-height: 150px; display: block; }
.picker-grid .sticker-cell { padding: 4px; aspect-ratio: 1; }
.picker-grid .sticker-cell img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.picker-grid .sticker-add { aspect-ratio: 1; border: 2px dashed var(--border); border-radius: 10px; font-size: 26px; color: var(--text-dim); }
.picker-grid .sticker-add:hover { border-color: var(--blue); color: var(--blue); }
.picker-hint { grid-column: 1 / -1; font-size: 12px; color: var(--text-faint); padding: 10px; text-align: center; line-height: 1.5; }

/* ---- Privacy: block image/video saving & dragging ---- */
.bubble img, .bubble video, .sticker-img, .lightbox img {
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
/* Blur everything when the tab/app loses focus (anti screen-capture, best-effort) */
body.privacy-hidden .app { filter: blur(22px); }
body.privacy-hidden::after {
  content: '🔒'; position: fixed; inset: 0; display: grid; place-items: center;
  font-size: 40px; background: var(--bg); z-index: 90;
}

/* ---- Day separators ---- */
.day-sep { position: absolute; left: 0; right: 0; display: flex; justify-content: center; padding: 10px 0; }
.day-sep span { font-size: 11.5px; color: var(--text-faint); background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-weight: 600; }

/* ---- Reply quote ---- */
.reply-quote { border-left: 3px solid var(--blue); background: var(--bg-elev); border-radius: 6px; padding: 5px 9px; max-width: 100%; display: flex; flex-direction: column; gap: 1px; }
.reply-quote .rq-name { font-size: 11.5px; font-weight: 700; color: var(--blue-soft); }
.reply-quote .rq-text { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.row.me .reply-quote { align-self: stretch; }

/* ---- Reactions ---- */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 1px; }
.row.me .reactions { justify-content: flex-end; }
.reaction { font-size: 12px; background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; line-height: 1.5; transition: var(--transition); }
.reaction.mine { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 18%, var(--bg-elev-2)); }
.reaction:hover { border-color: var(--blue); }
.edited { font-size: 11px; color: var(--text-faint); }

/* ---- Message action trigger + menu ---- */
.msg-act { opacity: 0; align-self: center; width: 28px; height: 28px; border-radius: 50%; font-size: 16px; color: var(--text-faint); flex: none; transition: var(--transition); }
.row:hover .msg-act { opacity: 0.7; }
.msg-act:hover { opacity: 1 !important; background: var(--bg-elev-2); color: var(--text); }
@media (hover: none) { .msg-act { display: none; } }
.action-menu { position: fixed; z-index: 70; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 180px; animation: fade 120ms; }
.action-menu .react-row { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.action-menu .react-row button { font-size: 22px; width: 36px; height: 36px; border-radius: 9px; }
.action-menu .react-row button:hover { background: var(--bg-elev-2); transform: scale(1.15); }
.am-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--text); }
.am-item:hover { background: var(--bg-elev-2); }
.am-item.danger { color: var(--danger); }

/* ---- Typing indicator ---- */
.typing-bar { display: flex; align-items: center; gap: 7px; padding: 0 18px; min-height: 0; font-size: 12.5px; color: var(--text-dim); }
.typing-bar:empty { display: none; }
.typing-bar .dots { letter-spacing: 1px; animation: pulse 1.1s infinite; color: var(--blue-soft); }

/* ---- Composer reply/edit bar ---- */
.composer-bar { align-items: center; gap: 10px; padding: 8px 14px; background: var(--bg-elev); border-top: 1px solid var(--border); }
.composer-bar .cb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.composer-bar .cb-info b { font-size: 12px; color: var(--blue-soft); }
.composer-bar .cb-info span { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-bar .cb-x { width: 30px; height: 30px; border-radius: 50%; color: var(--text-dim); font-size: 14px; }
.composer-bar .cb-x:hover { background: var(--bg-elev-2); }

/* ---- GIF search ---- */
.picker-extra { margin-bottom: 8px; }
.picker-extra:empty { display: none; }
.gif-search { width: 100%; }

/* ---- Misc ---- */
.linklike { background: none; color: var(--blue-soft); font-size: 13px; text-align: left; padding: 2px 0; margin-top: -8px; }
.linklike:hover { text-decoration: underline; }
.code-display.sm { font-size: 22px; letter-spacing: 3px; padding: 14px; }
select.input { appearance: none; cursor: pointer; }
