/* ===== Composer extras: + button, options menu, image attachment tray, image viewer ===== */
/* Split out of chat.css to keep that file focused (and under its size budget). */

/* ANSI (.ans) attachment card in chat + its floating viewer window. */
.ansi-card { display: flex; align-items: stretch; margin: 6px 0; height: 48px; width: fit-content; max-width: min(340px, 100%); cursor: pointer;
  text-align: left; border: 1px solid rgba(127,200,240,.4); border-radius: 8px; overflow: hidden; background: #0e1420;
  transition: border-color .14s ease, box-shadow .14s ease; }
.ansi-card.ansi-stub { cursor: default; } .ansi-card.is-error { border-color: rgba(214,75,75,.5); }
.ansi-card:not(.ansi-stub):hover { border-color: rgba(127,200,240,.75); box-shadow: 0 0 8px rgba(127,200,240,.3); }   /* blue glow, like the YouTube card */
.an-ico { flex: none; width: 48px; height: 100%; display: grid; place-items: center; color: #9fd0f0; background: #0b0f17; }
.an-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 3px 10px; }
.an-title { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .12em; color: #7fc8f0; }
.an-name { font-family: var(--font-mono); font-size: 11px; color: #cfe6f5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ansi-pop { position: fixed; z-index: 41000; background: #05070c; border: 1px solid #26313f; border-radius: 8px; box-shadow: 0 0 18px 3px rgba(0,0,0,.8); display: flex; flex-direction: column; overflow: hidden; transition: opacity .18s ease; }
.ansi-pop .ip-ico { display: inline-flex; }   /* header icon + actions reuse the image-popup styles (.ip-bar/.ip-act/.ip-close/.ip-grip) */
.ap-body { overflow-x: hidden; overflow-y: auto; background: #000; }
.ap-credit { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: linear-gradient(#0a1420, #060c14); border-top: 1px solid #1e2a3a; font-size: 12px; color: #8aa; white-space: nowrap; overflow: hidden; } .ap-credit .apc-title { color: #dfe6f2; font-weight: 600; overflow: hidden; text-overflow: ellipsis; } .ap-credit .apc-meta { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ap-canvas { display: block; image-rendering: pixelated; }   /* CSS-scaled on resize — keep block art crisp */
.ap-err { padding: 24px; text-align: center; color: #d68f8f; font-family: var(--font-mono); font-size: 13px; }
/* TXT + PDF cards reuse .ansi-card; accent + glow differ (txt=teal, pdf=doc-red). TXT viewer = mono text; PDF = stacked pages. */
.txt-card { border-color: rgba(120,206,180,.4); } .txt-card .an-title { color: #79cfaf; } .txt-card .an-ico { color: #9fe0c8; } .txt-card:not(.ansi-stub):hover { border-color: rgba(120,206,180,.75); box-shadow: 0 0 8px rgba(120,206,180,.3); }
.pdf-card { border-color: rgba(224,110,90,.4); } .pdf-card .an-title { color: #e0866a; } .pdf-card .an-ico { color: #f0a68e; } .pdf-card:not(.ansi-stub):hover { border-color: rgba(224,110,90,.75); box-shadow: 0 0 8px rgba(224,110,90,.3); }
.tx-pre { margin: 0; padding: 16px 18px; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; color: #cfe0ee; white-space: pre-wrap; overflow-wrap: anywhere; }
.pdf-body { padding: 12px 0; } .pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 12px; }
.pdf-page { width: 100%; max-width: 900px; height: auto; display: block; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.pdf-loading, .pdf-more { text-align: center; color: #9db0c4; font-family: var(--font-mono); letter-spacing: .05em; }
.pdf-loading { padding: 40px; font-size: 12px; } .pdf-more { padding: 10px 0 4px; font-size: 10px; color: #8ea3ba; }
/* "JOIN MY CREW" card — a pasted crew link in chat (mirrors the game-invite card, muted green). */
.crew-invite { display: flex; align-items: center; gap: 10px; margin: 3px 0; max-width: 340px; cursor: pointer; padding: 9px 11px; background: #0e1712; border: 1px solid #23402f; border-left: 3px solid #3aa66a; }
.crew-invite[data-state="gone"] { opacity: .6; cursor: default; filter: grayscale(.5); }
.crew-invite:not([data-state="gone"]):hover { border-color: rgba(76,196,135,.8); box-shadow: 0 0 8px rgba(76,196,135,.32); }   /* green glow, like the YouTube card */
.ci-av { width: 30px; height: 30px; flex: none; border-radius: 5px; display: grid; place-items: center; background: rgba(58,166,106,.16) center/cover; border: 1px solid rgba(58,166,106,.4); color: #7fddaa; font-family: var(--font-mono); font-size: 13px; font-weight: 700; overflow: hidden; }
.ci-av.has-image { border-color: rgba(58,166,106,.55); }
.ci-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ci-title { font-family: "Barlow Condensed", "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 16px; line-height: 1.05; letter-spacing: .06em; color: #cdeedc; }
.ci-name { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #7fddaa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-action { flex: none; display: flex; }
.ci-join { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px; box-sizing: border-box; cursor: pointer; appearance: none; -webkit-appearance: none; color: #06120b; background: linear-gradient(180deg, #4cc487, #2f9b64); border: 1px solid #63d69a; box-shadow: 0 0 16px rgba(58,166,106,.32); transition: filter .16s ease; }
.ci-join:hover { filter: brightness(1.08); }
.ci-join i { font-size: 12px; } .ci-join span { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .15em; }

.chat-input.has-attach .chat-input-field { border-color: #2b3d52; }   /* same as the field's focus border, not bright blue */

/* Inline tool bar below the text row — one-click feature icons (replaces the old + menu).
   Hidden for guests (their composer is a SIGN UP bar). */
.is-guest .cmp-toolbar, .is-guest .cmp-tray { display: none; }
/* Tool bar is its OWN row forming the bottom half of the input box (field on top, icons below). It's
   a normal flow element, not overlaid, so the field's scrollbar/text can never reach the icons. */
.cmp-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 1px 14px 7px; background: var(--panel-field); border: 1px solid var(--panel-line); border-top: none; border-radius: 0 0 5px 5px; }
/* Keep the two halves' shared border one colour on focus / attach / reply (so it reads as one box). */
.chat-input:focus-within .chat-input-field, .chat-input:focus-within .cmp-toolbar, .chat-input.has-attach .cmp-toolbar, .chat-input.has-reply .cmp-toolbar { border-color: #2b3d52; }
.cmp-tools-left, .cmp-tools-right { display: flex; align-items: center; gap: 11px; }
.chat-panel.ddial .cmp-tool[data-act="effect"] { display: none; }   /* DDial-linked chats/DMs: no text-effect tool (remote terminals can't render it) */
.chat-panel.panel-dm .cmp-tool[data-act="commands"] { display: none; }   /* DM panels (friend + link): no chat-commands tool */
.cmp-tool {
  flex: none; padding: 0; border: none; background: none; cursor: pointer; line-height: 1;
  color: var(--ink-dim); font-size: 12px; transition: color .14s ease, border-color .14s ease;
}
.cmp-tool:hover { color: var(--ink); }               /* just brighten — no box */
.cmp-tool.is-soon { cursor: default; }
.cmp-tool.is-soon:hover { color: var(--ink-dim); }   /* soon items don't brighten */
/* Send — a plain icon like the rest (same dim colour, brighten on hover), slightly larger. */
.cmp-send { font-size: 16px; }
/* Effect tool lit when an effect is armed. */
.cmp-tool.on { color: var(--accent); }

/* Text-effect picker — a small popup above the tool bar, styled like the other composer popups. */
.cmp-fxmenu {
  position: absolute; left: 30px; bottom: 46px; z-index: 8; min-width: 120px; padding: 5px;
  background: #10161f; border: 1px solid #26313f; border-radius: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 1px;
}
.cmp-fxmenu[hidden] { display: none; }
.cmp-fx {
  text-align: left; background: none; border: none; cursor: pointer; padding: 6px 9px; border-radius: 5px;
  color: var(--ink); font-family: var(--font-ui); font-size: 12.5px;
}
.cmp-fx:hover { background: #18222f; }
.cmp-fx.sel { color: var(--accent); }
.cmp-fx.sel::after { content: "✓"; float: right; }

/* Commands help panel — a reference card for the 3 chat commands, opens above the composer. Fades. */
.cmp-cmdmenu {
  position: absolute; left: 12px; right: 12px; bottom: 46px; z-index: 9; padding: 12px 14px 13px;
  background: #10161f; border: 1px solid #26313f; border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.cmp-cmdmenu.show { opacity: 1; visibility: visible; transform: none; }
.cmp-cmd-x { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; display: grid; place-items: center;
  background: none; border: none; cursor: pointer; color: #7f93a8; font-size: 12px; border-radius: 5px; transition: color .12s, background .12s; }
.cmp-cmd-x:hover { color: #cfe6f5; background: #18222f; }
.cmp-cmd-head { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .16em; color: #7f93a8; margin-bottom: 8px; }
.cmp-cmd { padding: 6px 0; border-top: 1px solid #1b2532; }
.cmp-cmd:first-of-type { border-top: none; }
.cmp-cmd-top { display: flex; align-items: baseline; gap: 8px; }
.cmp-cmd-top code { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent); background: #0b1119; border: 1px solid #22303f; border-radius: 4px; padding: 1px 6px; }
.cmp-cmd-top span { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--ink); }
.cmp-cmd p { margin: 4px 0 3px; font-family: var(--font-ui); font-size: 12px; color: #9fb0c2; line-height: 1.35; }
.cmp-cmd em { font-family: var(--font-mono); font-size: 11.5px; color: #6f8398; font-style: normal; }
.panel-purple .cmp-cmd-top code, .gamechat-panel .cmp-cmd-top code { color: #c3a6f0; border-color: #3a2e5e; }

/* Emoji picker — opens FULLY above the composer (so the message stays visible): category tabs + close,
   then a scrollable grid of sections. */
.emoji-pop {
  position: absolute; left: 12px; bottom: calc(100% + 6px); z-index: 9; width: 342px;
  background: #10161f; border: 1px solid #26313f; border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.55);
  display: flex; flex-direction: column; overflow: hidden;
}
.emoji-pop[hidden] { display: none; }
.emoji-head {
  display: flex; align-items: center; gap: 2px; padding: 4px 5px;
  border-bottom: 1px solid #1e2836; background: #0c1119;
}
.emoji-cats { display: flex; gap: 1px; flex: 1; min-width: 0; justify-content: space-between; }
.emoji-cat {
  flex: none; background: none; border: none; cursor: pointer; padding: 3px 4px; border-radius: 6px;
  font-size: 15px; line-height: 1; filter: grayscale(.4); opacity: .7;
}
.emoji-cat:hover { background: #18222f; opacity: 1; filter: none; }
.emoji-cat.on { background: #16202c; opacity: 1; filter: none; box-shadow: inset 0 -2px 0 var(--accent); }
.emoji-close {
  flex: none; margin-left: 2px; background: none; border: none; cursor: pointer; color: var(--ink-dim);
  width: 22px; height: 22px; border-radius: 6px; font-size: 13px;
}
.emoji-close:hover { color: #ff6b6b; background: #18222f; }
.emoji-scroll { max-height: 236px; overflow-y: auto; padding: 0; }
.emoji-sec-h {
  position: sticky; top: 0; z-index: 1; padding: 7px 8px 4px; background: #10161f;
  font-family: var(--font-ui); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  display: flex; align-items: baseline; gap: 7px; white-space: nowrap; overflow: hidden;
}
.emoji-sec-name { color: var(--ink-dim); flex: none; }
.emoji-sec-desc { color: var(--accent); letter-spacing: .04em; text-transform: none; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; padding: 0 6px 6px; }
.emoji-g {
  background: none; border: none; cursor: pointer; padding: 3px 0; border-radius: 6px;
  font-size: 19px; line-height: 1.25; transition: background .1s, transform .1s;
}
.emoji-g:hover { background: #1b2735; transform: scale(1.15); }
.emoji-empty { grid-column: 1 / -1; padding: 4px 2px 8px; color: var(--ink-dim); font-family: var(--font-ui); font-size: 11.5px; }

/* topbar live-mic indicator (left of the username) + hover dropdown of every destination my mic is on. */
.tb-mic { position: relative; display: flex; align-items: center; margin-right: -12px; }   /* pull snug to the username */
.tb-mic-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border: none; border-radius: 6px; background: transparent; cursor: pointer; color: #ff5b6e; font-size: 13px; }
.tb-mic-btn i { animation: cmpMicPulse 1.1s ease-in-out infinite; }
.tb-mic-btn:hover { background: rgba(255,91,110,.14); }
/* menu sits flush under the icon (no gap) + a transparent top spacer so the hover path stays continuous */
.tb-mic-menu { position: absolute; top: 100%; right: 0; min-width: 200px; z-index: 9000;
  background: #0d1420; border: 1px solid #24384a; border-radius: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.6);
  padding: 7px; margin-top: 6px; display: none; }
.tb-mic-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* bridges the visual gap for hover */
.tb-mic:hover .tb-mic-menu { display: block; }   /* hover the icon (or menu) to reveal + interact */
.tb-mic-all { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #a8455f; border-radius: 6px; cursor: pointer;
  background: transparent; color: #e0788a; font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 700; letter-spacing: .08em; transition: background .12s, color .12s; }
.tb-mic-all:hover { background: linear-gradient(180deg, #c0455f, #8f3147); border-color: #d06a80; color: #fff; }
.tb-mic-rows { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; max-height: 46vh; overflow-y: auto; }
.tb-mic-row { display: flex; align-items: center; gap: 10px; padding: 5px 7px; border-radius: 6px; }
.tb-mic-row:hover { background: rgba(87,182,232,.08); }
.tb-mic-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-ui); font-size: 12px; color: #cbd8e6; }
.tb-mic-stop { flex: none; padding: 3px 9px; border: 1px solid rgba(224,120,138,.4); border-radius: 5px; cursor: pointer;
  background: rgba(224,120,138,.12); color: #e0788a; font-family: var(--font-mono, monospace); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.tb-mic-stop:hover { background: #a8455f; border-color: #a8455f; color: #fff; }

/* live-mic indicators — roster card (rr-mic) + DM header (dm-mic). Green = audible, red-slash = muted. */
.rr-mic, .dm-mic { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: #4bbf7a; font-size: 11px; }
.rr-mic:hover, .dm-mic:hover { background: rgba(75,191,122,.16); }
.rr-mic.muted, .dm-mic.muted { color: #e0788a; }
.rr-mic.muted:hover, .dm-mic.muted:hover { background: rgba(224,120,138,.16); }
.rr-mic:not(.muted) i, .dm-mic:not(.muted) i { animation: micLivePulse 1.3s ease-in-out infinite; }
@keyframes micLivePulse { 0%,100% { text-shadow: 0 0 5px rgba(75,191,122,.7); } 50% { text-shadow: 0 0 1px rgba(75,191,122,.2); } }
.dm-mic { margin-left: 4px; vertical-align: middle; }

/* Live-mic stream button — glows red + pulses while streaming. */
.cmp-tool.cmp-mic.on { color: #ff5b6e; }
.cmp-tool.cmp-mic.on i { animation: cmpMicPulse 1.1s ease-in-out infinite; }
@keyframes cmpMicPulse { 0%,100% { opacity: 1; text-shadow: 0 0 6px rgba(255,91,110,.7); } 50% { opacity: .55; text-shadow: 0 0 2px rgba(255,91,110,.3); } }

/* Purple theme — inside a game / game-chat panel both composer popups ride the purple frame. */
.panel-purple .cmp-fxmenu, .gamechat-panel .cmp-fxmenu,
.panel-purple .emoji-pop, .gamechat-panel .emoji-pop { background: #171130; border-color: #4a3a7a; }
.panel-purple .cmp-fx:hover, .gamechat-panel .cmp-fx:hover { background: #241a44; }
.panel-purple .cmp-fx.sel, .gamechat-panel .cmp-fx.sel { color: #c3a6f0; }
.panel-purple .emoji-head, .gamechat-panel .emoji-head { background: #120d28; border-bottom-color: #2a2350; }
.panel-purple .emoji-cat:hover, .gamechat-panel .emoji-cat:hover { background: #241a44; }
.panel-purple .emoji-cat.on, .gamechat-panel .emoji-cat.on { background: #1d1640; box-shadow: inset 0 -2px 0 #a678f0; }
.panel-purple .emoji-sec-h, .gamechat-panel .emoji-sec-h { background: #171130; }   /* sticky header must match popup bg */
.panel-purple .emoji-sec-desc, .gamechat-panel .emoji-sec-desc { color: #c3a6f0; }
.panel-purple .emoji-g:hover, .gamechat-panel .emoji-g:hover { background: #2a1f4e; }

/* ===== text-effect character animations (per-char, staggered) — ported 1:1 from PSD/Text Effects.html ===== */
.tfx-w { display: inline-block; white-space: nowrap; }
.tfx-c { display: inline-block; will-change: transform, opacity, filter; }
.tfx-ghost { pointer-events: none; will-change: transform, opacity; }
@keyframes tfx-ec { from { opacity:0; transform:translateY(-.55em); filter:blur(4px); } to { opacity:1; transform:translateY(0); filter:blur(0); } }
@keyframes tfx-ew { 0% { opacity:0; transform:translateY(-2.6em); } 38% { opacity:1; transform:translateY(.62em); } 66% { transform:translateY(-.42em); } 85% { transform:translateY(.14em); } 100% { opacity:1; transform:translateY(0); } }
@keyframes tfx-ep { from { opacity:0; transform:scale(2.7) rotate(-182deg); filter:blur(7px); } 70% { opacity:1; } to { opacity:1; transform:scale(1) rotate(0deg); filter:blur(0); } }
@keyframes tfx-eo { from { opacity:0; transform:scale(.35); color:#71bdd1; text-shadow:0 0 12px rgba(113,189,209,.85); } 60% { opacity:1; transform:scale(1.14); color:#71bdd1; } to { opacity:1; transform:scale(1); color:#cbd6e6; text-shadow:none; } }
@keyframes tfx-mrain { 0% { transform:translate(-50%,-4.2em); opacity:0; color:#1c5f3e; text-shadow:none; } 14% { opacity:1; color:#2f8f5c; } 55% { color:#4bbf7a; text-shadow:0 0 7px rgba(75,191,122,.4); } 88% { color:#b6f5cf; text-shadow:0 0 12px rgba(160,245,200,.8); } 100% { transform:translate(-50%,0); opacity:1; color:#e8fff1; text-shadow:0 0 16px rgba(200,255,225,.95); } }
@keyframes tfx-apulse { 0% { opacity:.5; color:#7c5f21; transform:translateX(-50%) scaleY(.9); } 50% { opacity:1; color:#e2b455; transform:translateX(-50%) scaleY(1.08); } 100% { opacity:.62; color:#a37c2b; transform:translateX(-50%) scaleY(.96); } }
@keyframes tfx-em { 0% { color:#e8fff1; text-shadow:0 0 16px rgba(200,255,225,.95); } 45% { color:#4bbf7a; text-shadow:0 0 9px rgba(75,191,122,.55); } 100% { color:#cbd6e6; text-shadow:none; } }
@keyframes tfx-ea { 0% { color:#f2d494; text-shadow:0 0 10px rgba(211,160,60,.6); transform:scaleY(1.14); opacity:.55; } 40% { color:#e2b455; } 100% { color:#cbd6e6; text-shadow:none; transform:scaleY(1); opacity:1; } }

/* Attachment tray — becomes the TOP of the composer box and merges into the field below, so the
   attached images look contained inside the composer rather than floating in a strip above it. */
/* "Replying to…" bar at the top of the composer (armed by the Reply hover action). */
/* Connected segment at the TOP of the input box (same treatment as the attachment tray): field bg,
   side + top border, no bottom border, rounded top. Attachments (if any) sit below it. */
.cmp-reply {
  display: flex; align-items: center; gap: 7px; padding: 5px 10px;
  background: var(--panel-field); border: 1px solid #2b3d52; border-bottom: none; border-radius: 5px 5px 0 0;
  box-shadow: inset 2px 0 0 var(--accent);   /* accent cue on the left */
}
.cmp-reply[hidden] { display: none; }
/* When replying, the field (and the tray, when present) connect below the reply bar. */
.chat-input.has-reply .chat-input-field { border-color: #2b3d52; border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; }
.chat-input.has-reply.has-attach .cmp-tray { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; }
.cmp-reply-ico { flex: none; color: var(--accent); font-size: 11px; }
.cmp-reply-av { flex: none; width: 20px; height: 20px; border-radius: 5px; background: #16202c center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 10px; font-weight: 700; } .view-inline .cmp-reply-av { display: none; }   /* compact/minimal: no profile icon in the composer reply bar */
.cmp-reply-lock { flex: none; color: #ff4d4d; font-size: 10px; text-shadow: 0 0 5px rgba(255,77,77,.6); }
.cmp-reply-body { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.cmp-reply-name { flex: none; font-size: 11px; font-weight: 600; color: var(--ink); }
.cmp-reply-txt { flex: 1; min-width: 0; font-size: 11.5px; font-style: italic; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-reply-x { flex: none; background: none; border: none; color: var(--ink-dim); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.cmp-reply-x:hover { color: #ff6b6b; }

/* "RE:" reply quote under a message — a mini message: avatar + name + time, then the original text
   (single-line + ellipsis by default; click to expand). */
.msg-re {
  position: relative; display: flex; flex-direction: column; gap: 5px; margin: 4px 0 8px; max-width: 440px;
  padding: 4px 22px 4px 10px; background: rgba(255,255,255,.02);   /* left pad clears the bar; right pad the arrow */
  border-radius: 0 6px 6px 0; transition: background .12s ease;
}
.msg-re-top { display: flex; align-items: flex-start; gap: 7px; }
.msg-re.has-more { cursor: pointer; }                     /* only clickable when there's more to reveal */
.msg-re.has-more:hover { background: rgba(255,255,255,.06); }
/* colour bar as a pseudo-element so it can dim (border-color can't carry opacity) */
.msg-re::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--re-bar, var(--accent));
  opacity: .45; transition: opacity .12s ease; }
.msg:not(.inline) .msg-re { margin-left: 33px; }   /* align under the descriptive body */
/* Bar + name + avatar rest dimmed; brighten when hovering the message row OR the reply card. */
.msg-re-av, .msg-re-name { opacity: .55; transition: opacity .12s ease; }
.msg:hover .msg-re::before, .msg-re:hover::before { opacity: 1; }
.msg:hover .msg-re-av, .msg:hover .msg-re-name, .msg-re:hover .msg-re-av, .msg-re:hover .msg-re-name { opacity: 1; }
/* Down/up arrow, shown only when the quote overflows; brightens on hover. */
.msg-re-arw { display: none; position: absolute; right: 7px; bottom: 5px; font-size: 9px; color: #5c6b7d; transition: color .12s ease; }
.msg-re.has-more .msg-re-arw { display: block; }
.msg-re:hover .msg-re-arw { color: var(--ink); }

/* "reply to you" marker — a small colour dot in the left gutter, shown only on the recipient's client. */
.msg-reply-mark { position: absolute; left: 5px; top: 8px; width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 5px currentColor; }
/* "you were mentioned" marker — a small colour dot in the left gutter, shown only on the mentioned
   user's client, coloured with the sender's name colour. Sits below the reply dot if both appear. */
.msg-mention-mark { position: absolute; left: 5px; top: 8px; width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 5px currentColor; }
.msg-reply-mark ~ .msg-mention-mark { top: 20px; }
/* @mention inside a message — the mentioned user's colour, on a faint tint of it. */
.mention { font-weight: 700; background: color-mix(in srgb, currentColor 15%, transparent); border-radius: 4px; padding: 0 3px; }
/* @mention ghost/hint in the composer (mirrors the /p ghost + station styling). */
.ceo-at { font-weight: 700; color: var(--neon-cyan); }
.msg-re-av { flex: none; width: 22px; height: 22px; border-radius: 5px; background: #0e1420 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.msg.inline .msg-re-av { display: none; }   /* compact/minimal: no profile icon on reply quotes */ .msg-re-main { flex: 1; min-width: 0; }
.msg-re-head { display: flex; align-items: baseline; gap: 6px; }
.msg-re-name { font-size: 11px; font-weight: 600; white-space: nowrap; }
.msg-re-time { margin-left: auto; font-size: 9.5px; color: #5c6b7d; font-family: var(--font-mono); }   /* pushed to the right */
.msg-re-t {
  font-size: 11.5px; font-style: italic; color: var(--ink-dim); transition: color .12s ease;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;   /* up to three lines */
}
.msg:hover .msg-re-t, .msg-re:hover .msg-re-t { color: var(--ink); }   /* brighten the quote text on hover */
.msg-re.expanded .msg-re-t { -webkit-line-clamp: unset; overflow: visible; }
/* media inside the RE card: the real clickable cards/tiles from the original message, stacked. */
/* Media is hidden by default. In the collapsed "preview" state (no text / one line) the FIRST ROW is
   shown and the rest clipped; expanding reveals everything. */
.msg-re-media { display: none; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 0; }
.msg-re.re-mprev .msg-re-media { display: flex; max-height: 56px; overflow: hidden; }   /* fits a full 48px card (+ its border) — no bottom clip on a single YouTube/link card */
.msg-re.expanded .msg-re-media { display: flex; max-height: none; overflow: visible; }
/* Reset the top-level descriptive indent/margins so RE media aligns to the card, not doubly indented. */
.msg-re-media .msg-atts { margin: 0; }
.msg-re-media .msg-links { margin: 0; } .msg-re-media .msg-links .lk-card, .msg-re-media .msg-links .yt-card, .msg-re-media .msg-links .ansi-card { margin: 0; }   /* cards flush in a reply — no 6px top margin pushing them past the preview clip */
.msg-re-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--ink-dim);
  background: rgba(255,255,255,.05); border: 1px solid #2a3546; border-radius: 5px; padding: 2px 7px; font-style: normal; }
.msg-re-chip i { font-size: 9px; opacity: .85; }

.cmp-tray { padding: 2px 0 8px; }
.cmp-tray[hidden] { display: none; }
.chat-input.has-attach .cmp-tray {
  background: var(--panel-field); border: 1px solid #2b3d52; border-bottom: none;
  border-radius: 5px 5px 0 0; padding: 8px 10px 8px;
}
.chat-input.has-attach .chat-input-field { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; }
.cmp-meta { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; }
.cmp-count { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; color: var(--ink-dim); text-transform: uppercase; }
.cmp-clear { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; color: var(--accent); cursor: pointer; }
.cmp-clear:hover { filter: brightness(1.2); }
.cmp-tray.flash .cmp-count { animation: cmpFlash .6s ease; }
@keyframes cmpFlash { 0%,100% { color: var(--ink-dim); } 30% { color: #f0a08e; } }
.cmp-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
/* Long link/video cards staged BELOW the image thumbnails. */
.cmp-cards { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.cmp-cards:not(:empty) { margin-top: 5px; }
/* Preview only — link/video cards aren't clickable in the tray (no open-in-tab / video popup while
   composing). Voice cards ARE interactive so you can listen to your clip before posting. */
.cmp-cards .cmp-staged { position: relative; margin: 0; pointer-events: none; max-width: 100%; }
.cmp-cards .cmp-staged.vc-card { pointer-events: auto; }
/* Same ✕ as the image thumbnails, anchored to the CARD's own top-right corner. */
.cmp-staged .cmp-cardx { top: 4px; right: 4px; z-index: 3; pointer-events: auto; }
.cmp-thumbs::-webkit-scrollbar { height: 6px; }
.cmp-thumbs::-webkit-scrollbar-thumb { background: #2b3d52; border-radius: 3px; }
.cmp-thumb {
  position: relative; flex: none; width: 58px; height: 58px; border-radius: 6px; overflow: hidden;
  background: #0e1420; border: 1px solid var(--panel-line);
}
.cmp-timg { width: 100%; height: 100%; background-size: cover; background-position: center; cursor: zoom-in; }   /* click to preview full-size */
.cmp-x {
  position: absolute; top: 2px; right: 2px; width: 17px; height: 17px; border-radius: 4px; border: none; cursor: pointer;
  background: rgba(6,10,16,.72); color: #dbe9f6; font-size: 13px; line-height: 15px; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.cmp-x:hover { background: #d23b3b; color: #fff; }   /* matches My Gallery's delete hover */
.cmp-thumb.is-up .cmp-timg { filter: brightness(.5) saturate(.7); }
/* Staged card thumbnails (album / YouTube): coloured ring + a corner badge so they read as a
   collection / video, not a plain photo. */
.cmp-thumb-album { border-color: rgba(209,95,214,.6); }
.cmp-thumb-youtube { border-color: rgba(224,83,63,.6); }
.cmp-thumb-album .cmp-timg, .cmp-thumb-youtube .cmp-timg { display: flex; align-items: center; justify-content: center; font-size: 18px; }
.cmp-thumb-album .cmp-timg { color: #d15fd6; }
.cmp-thumb-youtube .cmp-timg { color: #e0533f; }
.cmp-card-badge { position: absolute; left: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 4px;
  background: rgba(6,10,16,.78); font-size: 9px; display: flex; align-items: center; justify-content: center; }
.cmp-card-badge.album { color: #d15fd6; }
.cmp-card-badge.youtube { color: #e0533f; }
.cmp-prog { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.cmp-pct { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cmp-bar { width: 78%; height: 4px; border-radius: 3px; background: rgba(6,10,16,.7); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.cmp-bar-fill { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .12s linear; }
.cmp-thumb.is-error { border-color: #7a3b34; background: rgba(212,90,74,.12); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.cmp-terr { color: #f0a08e; font-size: 15px; }
.cmp-eacts { display: flex; gap: 4px; }
.cmp-retry, .cmp-rm { background: none; border: none; cursor: pointer; font-family: var(--font-mono); font-size: 8px; letter-spacing: .06em; padding: 0; }
.cmp-retry { color: #7fc8f0; } .cmp-rm { color: #9aa7b6; }
.cmp-retry:hover { color: #b9dcf5; } .cmp-rm:hover { color: #d8e2ee; }
.cmp-etip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: #1a1010; color: #f0c0b6; border: 1px solid #7a3b34; border-radius: 5px;
  padding: 4px 7px; font-size: 10px; opacity: 0; pointer-events: none; transition: opacity .14s ease; z-index: 5;
}
.cmp-thumb.is-error:hover .cmp-etip { opacity: 1; }
.cmp-add {
  flex: none; width: 58px; height: 58px; border-radius: 6px; cursor: pointer;
  background: none; border: 1px dashed #33465e; color: #5c6f84; font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: color .14s ease, border-color .14s ease;
}
.cmp-add:hover { color: var(--accent); border-color: var(--accent); }

/* Drag-over-composer drop target */
.chat-input { position: relative; }
.chat-input.drag-over .chat-input-field { opacity: .35; }
.cmp-drop {
  position: absolute; inset: 4px 16px; z-index: 6; border: 1.5px dashed var(--accent); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, rgba(10,15,22,.86));
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.cmp-drop[hidden] { display: none; }
.cmp-drop-in i { font-size: 20px; color: var(--accent); }
.cmp-drop-t { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; color: var(--ink); margin-top: 6px; }
.cmp-drop-s { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; color: var(--ink-dim); margin-top: 3px; }

/* ===== Image attachments in messages — small square icons (2× the 24px chat avatar) ===== */
.msg-atts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; margin-top: 6px; max-width: 440px; }
.msg:not(.inline) .msg-atts { margin-left: 33px; }
.msg-att {
  flex: none; width: 48px; height: 48px; padding: 0; overflow: hidden; cursor: pointer; line-height: 0;
  border: 1px solid var(--panel-line); border-radius: 6px; background: #0e1420;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.msg-att img { display: block; width: 100%; height: 100%; object-fit: cover; }
.msg-att:hover { border-color: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 30%, transparent); }
/* broken/unreachable image → muted broken-link icon, not the browser's default glyph */
.msg-att.att-broken { display: flex; align-items: center; justify-content: center; line-height: 1; cursor: default;
  color: #5a6678; background: #0b1018; border-style: dashed; border-color: #2a3646; }
.msg-att.att-broken i { font-size: 16px; }
.msg-att.att-broken:hover { border-color: #2a3646; box-shadow: none; }
.dm-msg.mine .msg-atts { align-self: flex-end; justify-content: flex-end; }

/* Image viewer — a floating, draggable, resizable window (not a modal). Auto-sizes to the image and
   never scrolls; the image scales to fit (object-fit: contain). */
.img-pop {
  position: fixed; z-index: 40000; opacity: 1; transition: opacity .2s ease;   /* fade in on open / out on close */
  display: flex; flex-direction: column;
  background: #0d141e; border: 1px solid #2b3d52; border-radius: 9px; overflow: hidden;
  box-shadow: 0 0 18px 3px rgba(0,0,0,.8);   /* tight, dark, even on all four sides */
}
.img-pop[hidden] { display: none; }
/* Only while cycling images: the frame glides to the next image's size. */
.img-pop.resizing { transition: width .22s ease, height .22s ease, left .22s ease, top .22s ease; }
/* Transient "Saved to My Gallery" confirmation, centred over the image, fades out. */
.ip-toast {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 7px 14px; border-radius: 999px; pointer-events: none; z-index: 5;
  background: rgba(8,12,18,.9); border: 1px solid #2b3d52; color: var(--ink);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  opacity: 0; transition: opacity .35s ease;
}
.ip-toast.in { opacity: 1; }
.ip-toast.out { opacity: 0; }
.ip-bar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: default; user-select: none;
  background: #131c2b; border-bottom: 1px solid #223247;
}
.ip-ico { flex: none; color: var(--accent); font-size: 13px; cursor: move; }
.ip-title { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: move; }
.ip-title b { font-weight: 700; }
.ip-count { flex: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--ink-dim);
  padding: 2px 7px; border: 1px solid #223247; border-radius: 999px; }
.ip-count:empty { display: none; }
.img-pop.ip-narrow .ip-count { display: none; }   /* too narrow for the counter — title truncates, icons stay */
/* Header icon cluster — same treatment as panel headers: borderless, colour-shift on hover
   (actions → ink, close → red-orange), no background box. This cluster is NOT a drag zone. */
.ip-actions { flex: none; display: flex; align-items: center; gap: 8px; cursor: default; }
.ip-act, .ip-close {
  flex: none; background: none; border: none; cursor: pointer; padding: 0 1px; line-height: 1;
  color: var(--ink-dim); transition: color .15s ease;
  display: flex; align-items: center; justify-content: center;
}
.ip-act { font-size: 13px; }
.ip-close { font-size: 15px; }                 /* matches the panel close button */
.ip-act:hover { color: var(--ink); }
.ip-act.done { color: #4bbf7a; }
.ip-close:hover { color: #e0653c; }
.ip-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #06090e; overflow: hidden; padding: 1px; }
.ip-img { display: block; max-width: 100%; max-height: 100%; object-fit: contain;
  border-bottom-left-radius: 7px; border-bottom-right-radius: 7px;   /* match the frame's bottom corners */
  transition: transform .22s ease, opacity .22s ease; }
.img-pop.ip-multi .ip-img { cursor: pointer; }   /* click the image to advance the gallery */
.ip-img.out { transform: translateX(-100%); opacity: 0; }              /* current slides out to the left */
.ip-img.pre { transform: translateX(100%); opacity: 0; transition: none; }  /* next starts off the right edge */
/* Resize grip: a "folded corner" — a solid dark chip clipped to a bottom-right triangle with a cluster
   of light dots on top, so it stays visible over ANY image or background. Standard for all resizable
   popups (neutral tone → reads the same on every popup colour). */
.ip-grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; z-index: 4; cursor: nwse-resize; background-color: rgba(12, 14, 22, .9); background-image: radial-gradient(#c9d2de 1.1px, transparent 1.6px); background-size: 4px 4px; background-position: right bottom; clip-path: polygon(100% 0, 100% 100%, 0 100%); border-bottom-right-radius: 9px; opacity: .92; }
.ip-grip:hover { opacity: 1; background-image: radial-gradient(#eef3f9 1.1px, transparent 1.6px); }

/* ===== Chat panel message filter bar (below the header): @mentions / /p private / by-user =====
   Collapsed by default; slides down when there's something to show (counts / active filter) OR while the
   panel is hovered/focused. Not shown on DM panels (doesn't apply there). */
/* The bar + search live in an absolute overlay that DROPS DOWN over the top of the message list —
   it covers the history as it slides in rather than pushing the scrollbar + messages down. Anchored
   just below the 34px panel header. pointer-events pass through where the (collapsed) bars aren't. */
.chat-filter-wrap { position: absolute; top: 34px; left: 0; right: 0; z-index: 6; pointer-events: none; }
.chat-filter-wrap > * { pointer-events: auto; }
.chat-filter { flex: none; display: flex; align-items: center; gap: 6px; overflow: hidden; opacity: 0;
  max-height: 0; padding: 0 8px; background: #0c131e; border-bottom: 1px solid transparent;
  transition: max-height .2s ease, opacity .18s ease, padding .2s ease, border-color .2s ease; }
.chat-filter.cf-has, .chat-filter.cf-on, .chat-filter.cf-finding, .chat-panel:hover .chat-filter, .chat-panel.focused .chat-filter {
  max-height: 40px; opacity: 1; padding: 5px 8px; border-bottom-color: #172234; }
.chat-panel.panel-dm .chat-filter { display: none; }
.cf-chip { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  background: transparent; border: 1px solid #223247; color: #8397ab; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; line-height: 1.4; }
.cf-chip:hover { border-color: #33475f; color: #b8c8dc; }
.cf-chip .cf-n { font-weight: 700; }
.cf-at { border-color: #2b4f6b; color: #7fc8f0; }
.cf-at.active { background: var(--accent); border-color: var(--accent); color: #0a1016; }
.cf-pm { border-color: #7d5555; color: #e08a8a; }
.cf-pm.active { background: #b85757; border-color: #b85757; color: #1c0d0d; }
.cf-at.cf-dim, .cf-pm.cf-dim { background: transparent; border-color: #2b3444; color: #78828f; }   /* nothing new/unseen → gray (seen), still clickable. Gray wins over the active fill. */
.cf-at.active.cf-dim { border-color: #2b4f6b; }   /* seen but this filter is active → faint themed border hint */
.cf-pm.active.cf-dim { border-color: #7d5555; }
.cf-user { border-color: #33475f; color: #cbd8e6; }
.cf-user .cf-x { font-size: 9px; opacity: .7; margin-left: 1px; }
.cf-user.active { background: #1b2838; }
.cf-filter { margin-left: auto; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center;
  background: none; border: none; padding: 0; color: #7f93a8; font-size: 12px; transition: color .12s ease; }
.cf-filter:hover { color: #cfe6f5; }
.chat-filter.cf-on .cf-filter { color: #9fd0f0; }
.cf-find { cursor: pointer; width: 20px; height: 22px; margin-left: -4px; display: grid; place-items: center; background: none; border: none; padding: 0; color: #7f93a8; font-size: 12px; outline: none; transition: color .12s ease; }
.cf-find:hover, .chat-filter.cf-search .cf-find, .chat-filter.cf-finding .cf-find { color: #cfe6f5; }
/* Dropdown search row, below the filter bar. */
.chat-search { flex: none; display: flex; align-items: center; gap: 6px; overflow: hidden; max-height: 0; opacity: 0; padding: 0 8px;
  background: #0c131e; border-bottom: 1px solid transparent; transition: max-height .2s ease, opacity .18s ease, padding .2s ease, border-color .2s ease; }
.chat-search.open { max-height: 40px; opacity: 1; padding: 6px 8px; border-bottom-color: #172234; }
.chat-search .cf-find-in { flex: 1; min-width: 0; height: 26px; padding: 0 10px; background: #080d15; border: 1px solid #22304a; border-radius: 4px; color: #dbe6f2; font-family: var(--font-ui); font-size: 12.5px; outline: none; }
.chat-search .cf-find-in:focus { border-color: var(--accent); }
.cf-find-x { flex: none; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; background: none; border: none; padding: 0; color: #7f93a8; font-size: 12px; outline: none; }
.cf-find-x:hover { color: #cfe6f5; }
mark.cf-hl { background: #e6b84a; color: #201607; border-radius: 2px; padding: 0 1px; }
.msg.filtered-out { display: none !important; }

/* Chat panel header "⋮" menu button + its dropdown. */
.panel-menu { background: none; border: none; cursor: pointer; color: var(--ink-dim); font-size: 13px; padding: 0 2px; line-height: 1; transition: color .15s ease; }
.panel-menu:hover { color: var(--ink); }
.panel-menu-pop { position: fixed; z-index: 41000; min-width: 190px; background: #0d141e; border: 1px solid #2b3d52; border-radius: 8px; box-shadow: 0 0 18px 3px rgba(0,0,0,.7); padding: 5px; }
.pm-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; padding: 9px 11px; border-radius: 5px; background: transparent; border: none; color: #cbd8e6; font-family: var(--font-ui); font-size: 13px; }
.pm-item:hover { background: #16233a; color: #eaf2fb; }
.pm-item i { color: #8397ab; font-size: 12px; width: 14px; text-align: center; }
.pm-hd { padding: 6px 11px 3px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: #6a7688; }
.pm-sep { height: 1px; margin: 5px 6px; background: rgba(255,255,255,.06); }
.pm-check { color: #7fc8f0; }             /* ✓ on the active view / baud rate */
.pm-check.pm-off { visibility: hidden; }  /* keep the row aligned when not active */
.pm-clear:hover i { color: #e0653c; }
/* user picker popover */
.cf-pop { position: fixed; z-index: 41000; width: 210px; max-height: 280px; display: flex; flex-direction: column; overflow: hidden;
  background: #0d141e; border: 1px solid #2b3d52; border-radius: 8px; box-shadow: 0 0 18px 3px rgba(0,0,0,.7); }
.cf-search { margin: 8px; padding: 7px 9px; background: #080d15; border: 1px solid #22304a; border-radius: 5px; color: #dbe6f2; font-family: var(--font-ui); font-size: 13px; }
.cf-search:focus { outline: none; border-color: var(--accent); }
.cf-list { overflow-y: auto; padding: 0 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.cf-u { cursor: pointer; text-align: left; padding: 7px 9px; border-radius: 5px; background: transparent; border: none; color: #cbd8e6; font-family: var(--font-ui); font-size: 13px; }
.cf-u:hover { background: #16233a; color: #eaf2fb; }
.cf-empty { padding: 8px 9px; color: #5f7189; font-family: var(--font-mono); font-size: 11px; }

/* A chat panel lit up as a drop target while dragging an image over it: dashed blue outline + label. */
.chat-panel.img-drop::after {
  content: "DROP TO ATTACH"; position: absolute; inset: 6px; z-index: 30; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, rgba(9,13,20,.55));
  display: grid; place-content: center;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; color: var(--ink);
}

/* Rail icon lit up when an image is dragged over it (drawer closed → drop to save). */
.rail-btn.drag-hot { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

/* "Image saved" toast by the rail icon — above image popups (z 40000+); ensure the icon is visible. */
.gl-toasts { z-index: 60001; }
.gl-toasts .ft-av i { font-size: 15px; }

/* ===== YouTube link card + embed popup ===== */
.yt-card {
  display: flex; align-items: stretch; gap: 0; margin: 6px 0; height: 48px; width: fit-content; max-width: min(340px, 100%); padding: 0; cursor: pointer;
  text-align: left; border: 1px solid rgba(224,83,63,.4); border-radius: 8px; overflow: hidden; background: #0e1420;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.yt-card:hover { border-color: rgba(224,83,63,.75); box-shadow: 0 0 8px rgba(224,83,63,.3); }
.yt-thumb { position: relative; flex: none; width: 85px; height: 100%; background: #000 center/cover no-repeat; }   /* fills the card height (flush, no gap) */
.yt-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.yt-pill { width: 30px; height: 20px; border-radius: 5px; background: rgba(224,45,45,.94); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.yt-pill i { color: #fff; font-size: 9px; margin-left: 1px; }
.yt-card:hover .yt-pill { background: #e0533f; }
.yt-body { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 3px 10px; min-width: 0; }
.yt-src { display: flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .07em; color: #e0533f; }
.yt-title { font-size: 11px; line-height: 1.2; color: var(--ink-dim); transition: color .14s ease;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }   /* up to two lines */
.yt-card:hover .yt-title { color: var(--ink); }

/* Direct video (.mp4) card — same shape as the YouTube card, but a cyan "MP4 MOVIE" identity. */
.vid-card { border-color: rgba(87,182,232,.4); }
.vid-card:hover { border-color: rgba(87,182,232,.75); box-shadow: 0 0 8px rgba(87,182,232,.3); }
.vid-thumb { background: radial-gradient(120% 140% at 30% 20%, #1b2b3d, #0a0f18); }
.vid-card .yt-pill { background: rgba(87,182,232,.95); }
.vid-card:hover .yt-pill { background: #57b6e8; }
.vid-src { color: #7fc8f0; }

/* Plain-URL link card — same footprint as the YouTube card: site image + title, opens in a new tab. */
.lk-card {
  display: flex; align-items: stretch; margin: 6px 0; height: 48px; width: fit-content; max-width: min(340px, 100%);
  border: 1px solid rgba(87,182,232,.4); border-radius: 8px; overflow: hidden; background: #0e1420;
  text-decoration: none; cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease;
}
.lk-card:hover { border-color: rgba(87,182,232,.75); box-shadow: 0 0 8px rgba(87,182,232,.3); }
.lk-thumb { flex: none; width: 48px; height: 100%; background: #0b0f17 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #5c6f84; }
.lk-thumb i { font-size: 15px; }
.lk-thumb.has-image { color: transparent; }
.lk-body { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 3px 10px; min-width: 0; }
.lk-src { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .07em; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-title { font-size: 11px; line-height: 1.2; color: var(--ink-dim); transition: color .14s ease;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lk-card:hover .lk-title { color: var(--ink); }

/* Floating, draggable embed popup — same visual language as the image viewer. */
.yt-pop {
  position: fixed; z-index: 41000; opacity: 1; transition: opacity .18s ease;
  display: flex; flex-direction: column;
  background: #0d141e; border: 1px solid #2b3d52; border-radius: 9px; overflow: hidden;
  box-shadow: 0 0 18px 3px rgba(0,0,0,.8);
}
.yt-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: move; user-select: none; background: #131c2b; border-bottom: 1px solid #223247; }
.yt-ico { flex: none; color: #e0533f; font-size: 14px; }
.yt-pop-title { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-act, .yt-close { flex: none; background: none; border: none; cursor: pointer; color: var(--ink-dim); padding: 0 1px; line-height: 1; transition: color .15s ease; }
.yt-act { font-size: 13px; } .yt-close { font-size: 15px; }
.yt-act:hover { color: var(--ink); } .yt-act.done { color: #4bbf7a; }
.yt-close:hover { color: #e0653c; }
.yt-frame { position: relative; flex: 1; min-height: 0; background: #06090e; overflow: hidden; padding: 0 1px 1px; }   /* 1px gap around the video (top edge = the bar's 1px divider) */
.yt-frame iframe { display: block; width: 100%; height: 100%; border: 0; border-bottom-left-radius: 7px; border-bottom-right-radius: 7px; }
.yt-frame .vid-el { display: block; width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; border-bottom-left-radius: 7px; border-bottom-right-radius: 7px; cursor: pointer; }

/* Themed video controls (replaces the browser's default white/oversized bar) */
.vid-ctl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px;
  padding: 9px 13px 10px; box-sizing: border-box; font-family: var(--font-mono);
  background: linear-gradient(to top, rgba(5,8,14,.9) 30%, rgba(5,8,14,0)); }
.vid-ctl button { background: none; border: none; color: #cfe0f2; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; transition: color .12s ease; }
.vid-ctl button:hover { color: var(--accent); }
.vid-cur, .vid-dur { font-size: 10px; color: #9db0c4; min-width: 30px; text-align: center; }
.vid-seek { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: #2a3646; cursor: pointer; }
.vid-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent); cursor: pointer; }
.vid-seek::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: var(--accent); }
.yt-grip {
  position: absolute; right: 0; bottom: 0; width: 20px; height: 20px; z-index: 4; cursor: nwse-resize;
  background: repeating-linear-gradient(135deg, var(--accent) 0 1.5px, transparent 1.5px 4px);
  clip-path: polygon(100% 0, 100% 100%, 0 100%); opacity: .7; border-bottom-right-radius: 9px;
}
.yt-grip:hover { opacity: 1; }

/* ===== My Media drawer (saved videos) ===== */
.rail-drawer-media.md-drop::after {
  content: "DROP TO SAVE"; position: absolute; inset: 6px; z-index: 5; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, rgba(9,13,20,.5));
  display: grid; place-content: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; color: var(--ink);
}
.md-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.md-empty { padding: 24px 8px; text-align: center; color: var(--ink-dim); font-size: 12.5px; line-height: 1.6; }
.md-card {
  position: relative; display: flex; align-items: stretch; cursor: pointer; overflow: hidden;
  border: 1px solid var(--panel-line); border-radius: 8px; background: #0e1420;
  transition: border-color .14s ease, opacity .2s ease, transform .2s ease;
}
.md-card.md-in, .md-card.md-out { opacity: 0; transform: translateY(-4px); }
.md-card:hover { border-color: #e0533f; }
.md-thumb { position: relative; flex: none; width: 96px; height: 54px; background: #000 center/cover no-repeat; }
/* Length badge at the top-right of the CARD; hidden on hover so the remove (×) button can take the spot. */
.md-dur { position: absolute; top: 4px; right: 4px; padding: 1px 5px; border-radius: 3px; background: rgba(0,0,0,.82); color: #fff; font-family: var(--font-mono); font-size: 10px; line-height: 1.4; letter-spacing: .02em; transition: opacity .14s ease; }
.md-dur[hidden] { display: none; }
.md-card:hover .md-dur { opacity: 0; }
.md-body { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 26px 5px 10px; min-width: 0; }
.md-src { display: flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: #e0533f; }
.md-title { font-size: 12px; line-height: 1.25; color: var(--ink-dim); max-height: 30px; overflow: hidden; transition: color .14s ease; }
.md-card:hover .md-title { color: var(--ink); }
.md-x {
  position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 4px; border: none; cursor: pointer;
  background: rgba(6,10,16,.72); color: #dbe9f6; font-size: 13px; line-height: 16px; padding: 0;
  opacity: 0; transition: opacity .14s ease, background .14s ease; display: flex; align-items: center; justify-content: center;
}
.md-card:hover .md-x { opacity: 1; }
.md-x:hover { background: #d23b3b; color: #fff; }

/* ===== My Gallery drawer ===== */
/* Left-edge pull tab to resize the drawer width. */
.rail-drawer-gallery { position: absolute; }
.gl-resize { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; z-index: 6; cursor: ew-resize; }
.gl-resize::before { content: ""; position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 64px; border-radius: 3px; background: #2b3d52; transition: background .15s ease; }
.gl-resize:hover::before { background: var(--accent); }
/* Upload button in the gallery header — borderless, colour-shift like panel header icons. */
.rd-icon {
  flex: none; cursor: pointer; margin-left: auto; padding: 0 1px; line-height: 1;
  background: none; border: none; color: var(--ink-dim); font-size: 13px;
  display: flex; align-items: center; justify-content: center; transition: color .15s ease;
}
.rd-icon:hover { color: var(--ink); }
.rd-head .rd-icon + .rd-close { margin-left: 2px; }
.gl-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gl-grid {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: 84px; gap: 8px; align-content: start;
}
.gl-empty { grid-column: 1 / -1; padding: 24px 8px; text-align: center; color: var(--ink-dim); font-size: 12.5px; line-height: 1.6; }
/* Always-present upload/drop tile (top-left), same footprint as a thumbnail. */
.gl-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  border: 1px dashed #33465e; border-radius: 7px; background: none; color: #5c6f84;
  transition: color .14s ease, border-color .14s ease;
}
.gl-add:hover { color: var(--accent); border-color: var(--accent); }
.gl-add i { font-size: 18px; }
.gl-add span { font-family: var(--font-mono); font-size: 8px; letter-spacing: .04em; text-align: center; line-height: 1.35; }
.gl-tile {
  position: relative; border-radius: 7px; overflow: hidden; cursor: grab;
  border: 1px solid var(--panel-line); background: #0e1420;
  transition: opacity .2s ease, transform .2s ease;   /* fade in on add / out on delete */
}
.gl-tile.gl-in, .gl-tile.gl-out { opacity: 0; transform: scale(.85); }
.gl-tile { transition: opacity .2s ease, transform .2s ease, border-color .14s ease, box-shadow .14s ease; }
.gl-tile:hover { border-color: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb, 87,182,232), .55), inset 0 0 0 1px rgba(var(--accent-rgb, 87,182,232), .5); }
/* Drop-to-save target when dragging an image over the open gallery drawer. */
.rail-drawer-gallery.gl-drop::after {
  content: "DROP TO SAVE"; position: absolute; inset: 6px; z-index: 5; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, rgba(9,13,20,.5));
  display: grid; place-content: center;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; color: var(--ink);
}
.gl-tile:active { cursor: grabbing; }
.gl-tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.gl-x {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 4px; border: none; cursor: pointer;
  background: rgba(6,10,16,.72); color: #dbe9f6; font-size: 13px; line-height: 16px; padding: 0;
  opacity: 0; transition: opacity .14s ease, background .14s ease;
  display: flex; align-items: center; justify-content: center;
}
.gl-tile:hover .gl-x { opacity: 1; }
.gl-x:hover { background: #d23b3b; color: #fff; }

/* ===== My Albums (own scroll list at the bottom of the gallery drawer; capped at 1/3 height) ===== */
.gl-albums { flex: 0 0 auto; min-height: 0; max-height: 33%; display: flex; flex-direction: column; border-top: 1px solid var(--panel-line); }
.gl-sec-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px 2px; margin: 0;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #8fcdf0; }
.gl-sec-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(87,182,232,.4), transparent); }
/* Cards tile (capped width) rather than spanning the full drawer width. */
.al-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 12px 12px; align-content: start;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); gap: 8px; }
/* "New Album" affordance — dashed, like the gallery upload tile but a full-width row */
.al-add { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 12px;
  border: 1px dashed #33465e; border-radius: 8px; background: none; color: #5c6f84; transition: color .14s ease, border-color .14s ease; }
.al-add:hover { color: var(--accent); border-color: var(--accent); }
.al-add-ico { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-size: 14px; }
.al-add-tx { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; }
/* Album card — cover left, title + count + privacy right, hover actions */
.al-card { position: relative; display: flex; align-items: stretch; cursor: pointer; overflow: hidden;
  border: 1px solid var(--panel-line); border-radius: 8px; background: #0e1420;
  transition: border-color .14s ease, opacity .18s ease, transform .18s ease, box-shadow .14s ease; }
.al-card.al-out { opacity: 0; transform: translateY(-4px); }
.al-card:hover { border-color: var(--accent); box-shadow: 0 0 10px rgba(87,182,232,.35); }
.al-cover { position: relative; flex: none; width: 62px; height: 62px; background: #000 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: #44566b; font-size: 18px; }
.al-body { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 30px 6px 10px; min-width: 0; }
.al-title { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-meta { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; color: var(--ink-dim); }
.al-vis { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .06em; color: #7f8ea0; margin-top: 1px; }
.al-vis.pub { color: #4bbf7a; }
.al-acts { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; opacity: 0; transition: opacity .14s ease; }
.al-card:hover .al-acts { opacity: 1; }
.al-btn { width: 18px; height: 18px; border: none; border-radius: 4px; cursor: pointer; padding: 0;
  background: rgba(6,10,16,.72); color: #dbe9f6; font-size: 10px; display: flex; align-items: center; justify-content: center; transition: background .14s ease, color .14s ease; }
.al-edit:hover { background: var(--accent); color: #04121c; }
.al-del:hover { background: #d23b3b; color: #fff; }

/* URLs are pulled out of the message text and their cards stacked here at the bottom, one per line. */
.msg-links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 5px; }
.dm-msg.mine .msg-links { align-items: flex-end; }

/* ===== album chip in chat (a shared album) — accent tracks the SENDER's username colour (--msg-color) ===== */
.al-chip { --al: var(--msg-color, #d15fd6); display: inline-flex; align-items: stretch; vertical-align: bottom; max-width: min(340px, 100%); min-height: 50px;
  border: 1px solid color-mix(in srgb, var(--al) 40%, transparent); border-radius: 8px; overflow: hidden; background: #0e1420; cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease; margin: 2px 0; }
.al-chip:hover { border-color: color-mix(in srgb, var(--al) 65%, transparent); box-shadow: 0 0 8px color-mix(in srgb, var(--al) 28%, transparent); }
.al-chip-cover { flex: none; width: 50px; align-self: stretch; background: #000 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--al); font-size: 15px; }
.al-chip-body { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 5px 10px; min-width: 0; }
.al-chip-src { font-family: var(--font-mono); font-size: 8.5px; line-height: 1.2; letter-spacing: .07em; color: var(--al); display: flex; align-items: center; gap: 4px; }
.al-chip-title { font-size: 12px; line-height: 1.2; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* When an album chip sits inline with image tiles, match their exact 48px height + top/bottom edges. */
.msg-atts .al-chip { min-height: 0; height: 48px; margin: 0; }
.msg-atts .al-chip-cover { width: 48px; }
.msg-atts .al-chip-body { padding: 4px 10px; }
/* YouTube + link cards are already 48px tall; drop their margin so they line up with the tiles too. */
.msg-atts .yt-card, .msg-atts .lk-card, .msg-atts .ansi-card { margin: 0; }
.al-chip-meta { font-family: var(--font-mono); font-size: 9px; line-height: 1.2; letter-spacing: .05em; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== image-viewer filmstrip (thumbnails at the top, multi-image only) ===== */
.ip-strip { flex: none; display: flex; gap: 4px; padding: 5px 6px; overflow-x: auto; overflow-y: hidden;
  background: #0d1521; border-bottom: 1px solid #223247;
  scrollbar-width: none; }                                   /* darker shade of the header blue; no scrollbar */
.ip-strip::-webkit-scrollbar { display: none; }
.ip-thumb { flex: none; width: 46px; height: 34px; padding: 0; border-radius: 4px; border: 1px solid transparent;
  background: #000 center/cover no-repeat; cursor: pointer; opacity: .55; transition: opacity .12s ease, border-color .12s ease, box-shadow .12s ease; }
.ip-thumb:hover { opacity: .9; border-color: rgba(87,182,232,.5); }   /* dimmer blue than the active outline */
.ip-thumb.active { opacity: 1; border-color: var(--accent); box-shadow: 0 0 6px rgba(87,182,232,.55); }

/* ===== album caption overlay in the image viewer (collapsible so long text doesn't hide the pic) ===== */
.ip-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px 8px; z-index: 3; pointer-events: none;
  background: linear-gradient(to top, rgba(4,7,12,.82), rgba(4,7,12,.4) 62%, rgba(4,7,12,0));
  transition: background .45s ease; }
.ip-cap:not([hidden]) { pointer-events: auto; }
.ip-cap.expanded { background: linear-gradient(to top, rgba(4,7,12,.9), rgba(4,7,12,.55) 55%, rgba(4,7,12,.12) 90%, rgba(4,7,12,0)); }
.ip-cap-tx { color: #eaf2fb; font-size: 12.5px; line-height: 1.45; overflow: hidden;
  max-height: 40px; transition: max-height .45s cubic-bezier(.22,.61,.36,1); }   /* JS sets max-height; this eases it */
.ip-cap-tog { margin-top: 4px; background: none; border: none; cursor: pointer; padding: 0;
  color: #8fcdf0; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.ip-cap-tog:hover { color: #cdeafc; }

/* ===== album builder popup ===== */
.album-modal { position: fixed; inset: 0; z-index: 60000; display: flex; align-items: center; justify-content: center;
  background: rgba(3,6,11,.6); opacity: 0; transition: opacity .18s ease; }
.album-modal.show { opacity: 1; }
.am-card { width: min(760px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--panel-bg, #0c121c); border: 1px solid var(--panel-line); border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6); transform: translateY(8px); transition: transform .18s ease; }
.album-modal.show .am-card { transform: none; }
.am-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--panel-line); }
.am-ico { color: var(--accent); }
.am-h-tx { flex: 1; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .12em; color: #e4eef8; }
.am-close { background: none; border: none; color: var(--ink-dim); font-size: 15px; cursor: pointer; transition: color .14s ease; }
.am-close:hover { color: #e0653c; }
.am-toprow { display: flex; gap: 10px; padding: 12px 14px; }
.am-title { flex: 1; min-width: 0; background: #0a0f18; border: 1px solid var(--panel-line); border-radius: 7px;
  color: var(--ink); font-size: 13px; padding: 8px 10px; outline: none; }
.am-title:focus { border-color: var(--accent); }
.am-seg { display: flex; flex: none; border: 1px solid var(--panel-line); border-radius: 7px; overflow: hidden; }
.am-seg-b { background: #0a0f18; border: none; color: var(--ink-dim); cursor: pointer; font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .06em; padding: 0 12px; display: flex; align-items: center; gap: 5px; transition: background .14s ease, color .14s ease; }
.am-seg-b + .am-seg-b { border-left: 1px solid var(--panel-line); }
.am-seg-b.on { background: rgba(87,182,232,.18); color: #cdeafc; }
.am-cols { display: flex; gap: 20px; padding: 4px 14px 0; min-height: 0; flex: 1; }
.am-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.am-sel { border-left: 1px solid var(--panel-line); padding-left: 20px; }   /* divider + breathing space */
.am-pane-h { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; color: #8fa2b6; margin-bottom: 6px; }
.am-pick-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); grid-auto-rows: 66px; gap: 6px; align-content: start; padding-bottom: 8px; }
.am-pick-t { position: relative; padding: 0; border: 1px solid var(--panel-line); border-radius: 6px; overflow: hidden; cursor: pointer; background: #0e1420;
  transition: border-color .12s ease, box-shadow .12s ease; }
.am-pick-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.am-pick-t:hover { border-color: rgba(87,182,232,.7); box-shadow: 0 0 8px rgba(87,182,232,.35); }
.am-pick-t .am-check { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(4,7,12,.22); color: #4bbf7a; font-size: 22px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.am-pick-t.on { border-color: #4bbf7a; box-shadow: 0 0 8px rgba(75,191,122,.5); }
.am-pick-t.on .am-check { display: flex; }
.am-sel-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.am-sel-row { display: flex; gap: 8px; align-items: flex-start; }
.am-sel-th { position: relative; flex: none; width: 54px; height: 54px; border-radius: 6px; background: #000 center/cover no-repeat; cursor: grab; transition: box-shadow .12s ease; touch-action: none; }
.am-sel-th:hover { box-shadow: inset 0 0 0 2px var(--accent); }   /* hover cue: this is a drag handle */
.am-sel-th:active { cursor: grabbing; }
.am-sel-row { transition: transform .16s ease; }                 /* siblings glide to open a gap */
.am-sel-row.am-lift { transition: none; position: relative; z-index: 5; border-radius: 6px; box-shadow: 0 10px 22px rgba(0,0,0,.55); }
.am-cover-badge { position: absolute; left: 2px; bottom: 2px; font-family: var(--font-mono); font-size: 7px; letter-spacing: .06em;
  background: var(--accent); color: #04121c; padding: 1px 4px; border-radius: 3px; }
.am-cap { flex: 1; min-width: 0; resize: none; background: #0a0f18; border: 1px solid var(--panel-line); border-radius: 6px;
  color: var(--ink); font-size: 11.5px; line-height: 1.35; padding: 6px 8px; outline: none; font-family: inherit; }
.am-cap:focus { border-color: var(--accent); }
.am-row-acts { display: flex; flex-direction: column; gap: 4px; flex: none; }
.am-rb { width: 22px; height: 22px; border: 1px solid var(--panel-line); border-radius: 5px; background: #0a0f18; color: var(--ink-dim); cursor: pointer; font-size: 10px; transition: color .14s ease, border-color .14s ease; }
.am-mkcover:hover { color: #e6c34a; border-color: #e6c34a; }
.am-rm:hover { color: #fff; border-color: #d23b3b; background: #d23b3b; }
.am-empty { color: var(--ink-dim); font-size: 12px; padding: 18px 6px; text-align: center; }
.am-foot { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--panel-line); margin-top: 12px; }
.am-hint { flex: 1; font-size: 11px; color: var(--ink-dim); }
.am-hint.err { color: #e0653c; }
.am-foot-b { display: flex; gap: 8px; flex: none; }
.am-cancel, .am-save { border-radius: 7px; padding: 8px 16px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; cursor: pointer; border: 1px solid var(--panel-line); }
.am-cancel { background: #0a0f18; color: var(--ink-dim); }
.am-cancel:hover { color: var(--ink); }
.am-save { background: linear-gradient(180deg, #57b6e8, #2f8fc9); border-color: #6cc3ef; color: #04121c; font-weight: 700; }
.am-save:hover { filter: brightness(1.08); }
.am-save:disabled { opacity: .5; cursor: default; }

/* ===== public albums on the mini-profile ===== */
.mp-albums-sec { padding: 2px 13px 10px; }   /* align with the RECENT section */
.mp-albums-sec .mp-h { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; color: #5c6b7d; margin-bottom: 6px; }
.mp-albums-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mp-album { position: relative; width: 44px; height: 44px; padding: 0; border: 1px solid var(--panel-line); border-radius: 6px;
  overflow: hidden; cursor: pointer; background: #0e1420; }
.mp-album:hover { border-color: var(--accent); }
.mp-album-cov { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #000 center/cover no-repeat; color: #44566b; font-size: 13px; }
.mp-album-n { position: absolute; right: 2px; bottom: 1px; font-family: var(--font-mono); font-size: 8px; color: #eaf2fb;
  background: rgba(4,7,12,.7); padding: 0 3px; border-radius: 3px; }

/* ===== voice: recording bar (inside the composer while recording) ===== */
.cmp-tool.on { color: #ff5a5a; }
/* The recording bar sits INSIDE the input box, connected to the top of the field (same treatment as
   the attachment tray): field bg, side + top border, no bottom border, rounded top corners. */
.cmp-rec {
  display: flex; align-items: center; gap: 7px; padding: 4px 10px;
  background: var(--panel-field); border: 1px solid #2b3d52; border-bottom: none; border-radius: 5px 5px 0 0;
}
.chat-input.cmp-recording .chat-input-field { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; }
.cmp-rec-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 6px #ff5a5a; animation: cmp-rec-pulse 1s ease-in-out infinite; }
@keyframes cmp-rec-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.cmp-rec-time { flex: none; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink); min-width: 28px; }
.cmp-rec-meter { flex: 1; height: 4px; background: #1a2432; border-radius: 3px; overflow: hidden; }
.cmp-rec-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #57b6e8, #7fd0ff); transition: width .06s linear; }
.cmp-rec-cancel { flex: none; font-family: var(--font-ui); font-size: 10.5px; padding: 2px 6px; background: none; border: none; color: var(--ink-dim); cursor: pointer; }
.cmp-rec-cancel:hover { color: var(--ink); }
/* Stop — a plain square icon button (flat, matches the app), not a gradient pill. */
.cmp-rec-stop {
  flex: none; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: #17202c; border: 1px solid #33445a; border-radius: 3px; color: #ff5a5a; font-size: 9px;
}
.cmp-rec-stop:hover { background: #1d2836; border-color: #46596f; }

/* ===== voice card (tray preview + in messages) ===== */
.vc-card {
  --vc-accent: #57b6e8; --vc-dim: rgba(150,170,190,.32);
  display: flex; align-items: center; gap: 8px; padding: 3px 9px; box-sizing: border-box;
  width: 250px; max-width: 100%; height: 34px; background: #0e1622; border: 1px solid #24313f; border-radius: 8px;
}
.vc-card:hover { border-color: color-mix(in srgb, var(--vc-accent) 55%, #24313f); box-shadow: 0 0 0 1px color-mix(in srgb, var(--vc-accent) 22%, transparent); }
.vc-play {
  flex: none; width: 18px; height: 26px; cursor: pointer; border: none; background: none;
  color: var(--vc-accent); font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.vc-play:hover { filter: brightness(1.25); }
/* In chat, the play/pause sits dim in its resting state and brightens when you hover the card. */
.msg-voice .vc-play { color: var(--ink-dim); }
.msg-voice:hover .vc-play, .msg-voice.playing .vc-play { color: var(--vc-accent); }
.vc-wave { flex: 1; height: 24px; min-width: 60px; cursor: pointer; }
.vc-time { flex: none; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-dim); min-width: 30px; text-align: right; }
.vc-stub { color: var(--ink-dim); font-size: 12px; gap: 8px; }
.vc-stub i { color: var(--vc-accent); }
.vc-stub.is-error { color: #ff9a9a; } .vc-stub.is-error i { color: #ff9a9a; }
.msg-voice { flex-basis: 100%; }   /* voice message takes its own line within the attachments row */
.cmp-staged.vc-card { position: relative; }
/* purple theme inside game / game-chat panels */
.panel-purple .vc-card, .gamechat-panel .vc-card { --vc-accent: #a678f0; background: #171130; border-color: #33285e; }
