/* Taurust - Minimal RAM, native UI */
:root {
  /* Nauja žinutė – paieškos laukelis */
  --new-chat-search-min-height: 40px;
  --new-chat-search-padding: 8px 12px;
  --new-chat-tag-gap: 4px;
  --new-chat-input-padding-y: 6px;

  --header-row-height: 56px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-emoji: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  --bg: #1a1a1e;
  --bg-side: #222226;
  --bg-panel: #222226;
  --bg-input: #2a2a2e;
  --bg-user-bar: #2a2a2e;
  --accent: #00c853;
  --text: #e0e0e0;
  --text-dim: #888;
  --border: #333;
  /* Įvesties „dėžė“ su priedais (Discord panašus vientisas paviršius) */
  --composer-surface: #383a40;
  /* Slankiklis – tie patys tonai kaip .messages-container / chate */
  --scrollbar-size: 8px;
  --scrollbar-thumb: #4a4a4f;
  --scrollbar-thumb-hover: #5a5a5f;
  --scrollbar-track: transparent;
  /* Chato įterptos nuotraukos: Discord artimi ribos (pilnas dydis – paspaudus peržiūroje) */
  --chat-inline-image-max-width: 550px;
  --chat-inline-image-max-height: min(300px, 42vh);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font), var(--font-emoji);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/*
 * Tekstą žymėti / kopijuoti galima tik chate ir su juo susijusiuose languose:
 * – įvesties laukuose (input, textarea, select, contenteditable);
 * – žinutės tekstas / antraštė / priedų nuorodos;
 * – įterptas tekstas (.message-text-attach-pre), DM skambučių eilutės;
 * – teksto failo peržiūros modalas (iš priedo žinutėje).
 * Kita sąsaja: be žymėjimo (serverių sąrašas, nustatymai ir pan.).
 */
input,
textarea,
select,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
}

.message:not(.welcome-msg) .message-text,
.message:not(.welcome-msg) .message-header,
.message .message-file-link,
.message .message-file-fallback {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
}

.message:not(.welcome-msg) .message-text-attach-pre,
.message:not(.welcome-msg) .message-text-attach-name,
.message:not(.welcome-msg) .message-text-attach-meta,
.message:not(.welcome-msg) .message-pdf-attach-name,
.message.message-call-log .dm-call-log-label,
.message.message-call-log .dm-call-log-time-tail,
.message.message-dm-sys-log .dm-sys-log-text,
#text-file-preview-modal .text-file-preview-body,
#text-file-preview-modal .text-file-preview-title,
#pdf-file-preview-modal .text-file-preview-title {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
}

.message .message-actions,
.message .message-action-btn,
.message .message-reactions,
.message .message-reaction,
.message .message-reaction-add,
.message .message-avatar,
.message .message-time-placeholder,
.message .message-time-placeholder .message-time-hover,
.message .message-edit-hint,
.message .message-edit-hint-escape,
.message .message-edit-hint-enter,
.message .message-edit-hint-key,
.message .message-edit-emoji-btn {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
}

.message.welcome-msg,
.message.welcome-msg * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
}

a {
  cursor: pointer;
}
button:not(:disabled) {
  cursor: pointer;
}
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input:not([type]),
textarea {
  cursor: text;
}

/* Bendras vertikalus / horizontalus slankiklis (Chromium WebView / Tauri) – kaip chate */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}
*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}
*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.titlebar {
  position: relative;
  /* Virš drag-drop (9999), toast (10000), kad visada veiktų minimize/maximize/close */
  z-index: 13000;
  height: 32px;
  background: var(--bg-side);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 4px 0 62px;
  user-select: none;
  flex-shrink: 0;
}

/* Viso pločio vilko zona po antraštėmis – kad centras liktų lango viduryje, ne „lanksčio“ plotyje */
.titlebar-drag-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: grab;
  -webkit-app-region: drag;
  app-region: drag;
}

.titlebar-drag-bg:active {
  cursor: grabbing;
}

/* Tekstas ne drag – tik tuščia titlebar vieta (įprasta OS elgsena be „tempimo už pavadinimo“) */
.titlebar-app-name {
  position: relative;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  pointer-events: auto;
  z-index: 2;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

/* Tas pats wordmark kaip auth / www puslapyje: Segoe UI Black italic, T + RUST baltai, au žaliai */
.titlebar-brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: "Segoe UI Black", "Segoe UI", system-ui, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.titlebar-brand-wordmark .auth-brand-t,
.titlebar-brand-wordmark .auth-brand-rust {
  color: #fff;
}

.titlebar-brand-wordmark .auth-brand-au {
  color: var(--accent);
}

/* Centras visada tikroje titlebar juostos horizontalėje (50% nuo .titlebar), nepriklausomai nuo dešinės (atnaujinimų teksto) pločio */
.titlebar-server-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  max-width: min(480px, calc(100% - 200px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

.titlebar-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
  z-index: 2;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

.titlebar-update-status {
  font-size: 0.7rem;
  color: var(--accent);
  margin-right: 6px;
  white-space: nowrap;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

.titlebar-update-status:empty {
  display: none;
}

.titlebar-update {
  width: 28px;
  height: 24px;
  margin-right: 4px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

.titlebar-update:hover {
  background: var(--bg-input);
}

.titlebar-update-icon-download {
  display: none;
  font-size: 18px;
}

.titlebar-update.has-update .titlebar-update-icon-refresh {
  display: none;
}

.titlebar-update.has-update .titlebar-update-icon-download {
  display: inline-block;
  color: var(--accent);
}

.titlebar-update.has-update {
  color: var(--accent);
}

.titlebar-update.checking {
  opacity: 0.6;
}

.titlebar-btn {
  width: 46px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: "Segoe MDL2 Assets", "Segoe UI Symbol", sans-serif;
  font-size: 12px;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

.titlebar-minimize::before {
  content: "\E921";
}

.titlebar-maximize::before {
  content: "\E922";
}

.titlebar-close::before {
  content: "\E8BB";
}

/* Bendras X uždarymo mygtukas – visur tas pats stilius */
.app-close {
  font-family: "Segoe MDL2 Assets", "Segoe UI Symbol", sans-serif;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-close::before {
  content: "\E8BB";
}

.titlebar-btn:hover {
  background: var(--bg-input);
  color: var(--text);
}

.titlebar-close:hover {
  background: #c42b1c;
  color: #fff;
}

/* Prisijungimo / registracijos ekrane – be programėlės vardo ir „Tikrinti atnaujinimus“ */
body:has(#auth-overlay:not(.hidden)) .titlebar-app-name,
body:has(#auth-overlay:not(.hidden)) .titlebar-update,
body:has(#auth-overlay:not(.hidden)) .titlebar-update-status {
  display: none !important;
}

.app {
  display: flex;
  flex: 1;
  min-height: 0;
  --sidebar-width: 370px;
}

/* Tempiant šoną / skambučio zoną – iframe hit-testai WebView’e dažnai brangūs. */
body.gs-layout-resizing .chat-link-embed-iframe {
  pointer-events: none;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-width: 0;
  width: var(--sidebar-width, 370px);
}

.sidebar-resize-handle {
  width: 6px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.resizing {
  background: var(--accent);
  opacity: 0.4;
}

.sidebar-bottom {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Serveriai (Discord stilius) */
.servers-bar {
  width: 60px;
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  flex-shrink: 0;
}

.logo-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.logo-box .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.logo-box.logo-box-avatar {
  background: transparent;
}

.server-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.server-item {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.server-item:hover {
  background: var(--accent);
  color: #fff;
}

.server-item.active {
  background: var(--accent);
  color: #fff;
}

.server-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.add-server-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-input);
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.add-server-btn:hover {
  background: var(--accent);
  color: #fff;
}

.join-server-btn { font-size: 1.2rem; }

/* Kanalų sidebar – išlyginta su vartotojo juosta iš dešinės */
.channels-bar {
  flex: 1;
  min-width: 0;
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.channels-bar .sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  box-sizing: border-box;
}

.sidebar-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  position: relative;
}

.channels-bar .sidebar-header h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Draugai: žalias apskritimas – prisijungusių draugų skaičius */
.friends-active-count-btn {
  flex-shrink: 0;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: none;
  border-radius: 999px;
  background: #15803d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  transition: background 0.15s, transform 0.1s;
}

.friends-active-count-btn:hover {
  background: #16a34a;
}

.friends-active-count-btn:active {
  transform: scale(0.96);
}

.friends-active-count-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Filtras „tik prisijungę“ – įjungta būsena */
.friends-active-count-btn.friends-active-count-btn--active {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}

.friends-active-count-btn.friends-active-count-btn--active:hover {
  background: #4ade80;
}

.header-add-friends-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-add-friends-btn:hover {
  background: var(--bg-input);
}

.header-add-friends-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(0.8);
}

.header-add-friends-img.material-icons {
  filter: none;
  font-size: 18px;
  line-height: 18px;
  color: rgba(255, 255, 255, 0.78);
}

.header-add-friends-btn:hover .header-add-friends-img {
  filter: brightness(0) invert(1);
}

.header-add-friends-btn:hover .header-add-friends-img.material-icons {
  filter: none;
  color: #fff;
}

.add-friend-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--text-dim);
  font-weight: 600;
}

.add-friend-btn .add-friend-btn-icon,
.add-friend-btn .material-icons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-friend-btn:hover {
  background: var(--bg-input);
  color: var(--accent);
}

.channel-type-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin: 12px 0 4px 0;
}

.channel-group.hidden { display: none; }

.friends-nav,
.chats-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  min-height: 0;
}

.friends-nav .friends-pending-section,
.chats-nav .chats-pending-placeholder {
  margin-bottom: 12px;
  min-height: 0;
  flex-shrink: 0;
}

.chats-nav .chats-pending-placeholder:empty {
  display: block;
}

.friends-list,
.chats-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  position: relative;
}

.chat-item-upload-bar-track {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: transparent;
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.chat-item-upload-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-success, #43b581);
  border-radius: 999px;
  transition: width 120ms ease-out;
  box-shadow: 0 0 4px rgba(67, 181, 129, 0.55);
}

.chat-item-upload-bar-track--indeterminate .chat-item-upload-bar-fill {
  width: 35%;
  animation: chat-item-upload-indeterminate 1.2s linear infinite;
}

@keyframes chat-item-upload-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(286%); }
}

.chat-item:hover {
  background: var(--bg-input);
}

.chat-item-clear-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: auto;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.chat-item:hover .chat-item-clear-btn {
  opacity: 0.7;
}

.chat-item:hover .chat-item-clear-btn:hover {
  opacity: 1;
  color: var(--text);
}

.chat-item-clear-btn .material-icons {
  font-size: 18px;
}

.chat-item.active {
  background: var(--bg-input);
  color: var(--accent);
}

.channel.voice-channel::before,
.channel.text-channel::before { content: none; }

.channel.voice-channel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.voice-channel-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.voice-channel-presence {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 2px 0 4px 22px;
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text-dim);
  max-height: 4.5em;
  overflow: hidden;
}

.voice-channel-presence-user {
  opacity: 0.92;
  white-space: nowrap;
}

.voice-channel-presence-user:not(:last-child)::after {
  content: '·';
  margin-left: 6px;
  opacity: 0.5;
}

.voice-presence-you {
  opacity: 0.75;
  font-weight: 500;
}

.voice-channel-title {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-icon { font-size: 1.5rem; }

.voice-status-text {
  margin-top: 12px;
  color: var(--accent);
  font-weight: 500;
}

.sidebar-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-side);
}

.sidebar-toolbar-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.sidebar-toolbar-btn .material-icons {
  font-size: 24px;
}

.sidebar-toolbar-btn:hover {
  background: var(--bg-input);
  color: var(--text);
}

.sidebar-toolbar-btn.active {
  background: var(--bg-input);
  color: var(--accent);
}

/* Boost+ – „loot“ stiliaus akcentas (ne tas pats kaip žalias Chat active) */
.sidebar-toolbar-btn-boost {
  flex-shrink: 0;
  width: auto;
  min-width: 32px;
  padding: 0 8px 0 6px;
  gap: 5px;
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.14), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.12);
}

.sidebar-toolbar-boost-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
  color: #fbbf24;
}

.sidebar-toolbar-btn-boost.active .sidebar-toolbar-boost-label {
  color: #fde68a;
}

.sidebar-toolbar-btn-boost:hover {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.26), rgba(245, 158, 11, 0.2));
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.18);
  color: inherit;
}

.sidebar-toolbar-btn-boost .boost-plus-ico {
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.sidebar-toolbar-btn-boost.sidebar-toolbar-btn--boost-member {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow:
    0 0 16px rgba(34, 197, 94, 0.2),
    inset 0 0 12px rgba(34, 197, 94, 0.08);
}

.sidebar-toolbar-btn-badge {
  position: relative;
}

.sidebar-toolbar-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e53935;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toolbar-badge.hidden {
  display: none;
}

.sidebar-header {
  padding: 14px 18px 14px 14px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.tagline {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.update-badge {
  margin-top: 8px;
  width: 100%;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
}

.update-badge:hover {
  opacity: 0.9;
}

.update-badge.hidden { display: none; }

.update-arrow { font-size: 0.9rem; }

.user-bar {
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-user-bar);
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  min-height: var(--header-row-height);
  box-sizing: border-box;
}
/* Vardo lentelė user-bar'e – kai vartotojas pasirenka nameplate spalvą,
   ją uždedam kaip gradient'ą virš įprasto fono (kairėje – sodri spalva,
   dešinėje – išnyksta į bg-user-bar, kad mygtukų ikonos liktų aiškios). */
.user-bar.has-nameplate {
  background:
    linear-gradient(
      90deg,
      var(--gs-user-nameplate-color, transparent) 0%,
      color-mix(in srgb, var(--gs-user-nameplate-color, transparent) 55%, transparent) 45%,
      transparent 80%
    ),
    var(--bg-user-bar);
}

.user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.user-bar-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--bg-user-bar, #2a2a2e);
  box-sizing: border-box;
}
.user-bar-status-dot.status-online { background: #22c55e; }
.user-bar-status-dot.status-offline { background: #6b7280; }

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.user-bar-name-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

#nickname-input {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  padding: 0 6px;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: default;
  user-select: none;
  pointer-events: none;
}

.user-bar-username {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0 6px;
  line-height: 1.2;
  min-height: 1em;
}

.user-bar-username:empty {
  display: none;
}

#nickname-input:hover,
#nickname-input:focus {
  outline: none;
  background: transparent;
}

#nickname-input::placeholder { color: var(--text-dim); }

/* Gap tarp pagrindinių ikonų: friends | mic+dots | headset+dots | settings.
   Taškai neskaičiuojami – jie priklauso mic/ausinėms. */
.user-bar-icons {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.user-bar-icon-group {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Taškai – CSS (be PNG), kompaktiški, arčiau savo ikonų.
   margin-left: -8px – pritraukia prie mic/ausinių, margin-right: -16px – lygina tarpus su friends↔mic. */
.user-bar-icon-dots {
  width: 16px;
  height: 20px;
  padding: 0;
  margin-left: -8px;
  margin-right: -16px;
  color: var(--text-dim);
}

.user-bar-icon-dots:hover {
  color: var(--text);
}

/* Tik mic taškai – arčiau mikrofono */
#user-bar-mic-dots {
  margin-left: -12px;
}

/* 3 vertikalūs taškai – box-shadow vietoj 3 elementų */
.dots-three {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -4px 0 currentColor, 0 4px 0 currentColor;
}

.user-bar-icon {
  width: 26px;
  height: 26px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.user-bar-icon:hover {
  background: var(--bg-input);
  color: var(--text);
}

.user-bar-icon-badge {
  position: relative;
}

.user-bar-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e53935;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-bar-badge.hidden {
  display: none;
}

.user-bar-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(0.8);
}

.user-bar-icon-img.material-icons {
  filter: none;
  font-size: 18px;
  line-height: 18px;
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-bar-icon:hover .user-bar-icon-img {
  filter: brightness(0) invert(1);
}

.user-bar-icon:hover .user-bar-icon-img.material-icons {
  filter: none;
  color: #fff;
}

/* Raudona įstriža linija kai muted */
.user-bar-icon.muted {
  position: relative;
}

.user-bar-icon.muted::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 2px;
  background: #e53935;
  transform: rotate(-45deg);
  pointer-events: none;
}

.channels {
  flex: 1;
  padding: 12px 18px 12px 12px;
  overflow-y: auto;
}

.channels-title {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.channel {
  list-style: none;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-dim);
}

.channel:hover {
  background: var(--bg-input);
  color: var(--text);
}

/* Tik pasirinktas kanalas – žalia juostelė */
#channels-nav li.channel.channel-selected {
  background: var(--bg-input);
  color: var(--accent);
  border-left: 3px solid var(--accent);
}

.add-channel-btn {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
}

.add-channel-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Chat */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-row-height);
  box-sizing: border-box;
  overflow: visible;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.chat-header-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.chat-header-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-main, #1e1e1e);
  box-sizing: border-box;
}
.chat-header-status-dot.hidden { display: none; }
.chat-header-status-dot.status-online { background: #22c55e; }
.chat-header-status-dot.status-offline { background: #6b7280; }

.chat-header-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-avatar.header-avatar-group { cursor: pointer; }
.chat-header-avatar.hidden {
  display: none;
}

.chat-header-channel-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  min-width: 0;
  gap: 1px;
}
.chat-header-channel {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  flex: 1;
  min-width: 0;
  width: 100%;
}
.chat-header-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.chat-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  overflow: visible;
}

.online-count {
  font-size: 0.75rem;
  color: var(--accent);
}

.dm-call-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dm-call-icons.hidden { display: none !important; }
.server-members-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.server-members-toggle-wrap.hidden { display: none !important; }
.dm-call-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.dm-call-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}
.dm-call-btn.active {
  color: var(--accent);
}
.dm-call-btn svg {
  flex-shrink: 0;
}
/* DM antraštė: SVG glifas – mygtukų 36×36 remeliai nepakitę */
#dm-call-icons .dm-call-btn > svg,
#dm-call-icons .dm-call-btn .dm-toggle-icon svg {
  width: 26px;
  height: 26px;
}
/* Serverio / grupės dešinė juosta: Material „right_panel_open“ / „right_panel_close“ */
#server-members-toggle-wrap .dm-call-btn .gs-right-panel-toggle-glyph,
#dm-call-icons .dm-call-btn .gs-right-panel-toggle-glyph {
  font-size: 26px;
  line-height: 26px;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}
.dm-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.dm-chat-search-wrap {
  position: relative;
  z-index: 120;
  min-width: 180px;
  max-width: 280px;
}
.dm-chat-search-wrap.hidden { display: none !important; }
.dm-chat-search-field {
  position: relative;
  width: 100%;
}
.dm-chat-search-field--has-value .dm-chat-search-input {
  padding-right: 34px;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dm-chat-search-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #b5bac1;
  cursor: pointer;
}
.dm-chat-search-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f2f3f5;
}
.dm-chat-search-clear.hidden {
  display: none !important;
}
.dm-chat-search-clear .material-icons {
  font-size: 18px;
  line-height: 1;
}
.dm-chat-search-filters-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  width: max(100%, 288px);
  max-width: min(360px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px 10px;
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  z-index: 121;
}
.dm-chat-search-filters-panel.hidden {
  display: none !important;
}
.dm-chat-search-filters-title {
  margin: 0;
  padding: 0 4px 2px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f2f3f5;
}
.dm-chat-search-filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dm-chat-search-filter-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 8px;
  text-align: left;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  box-sizing: border-box;
  transition: background 0.12s ease;
}
.dm-chat-search-filter-row:hover {
  background: rgba(255, 255, 255, 0.06);
}
.dm-chat-search-filter-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.dm-chat-search-filter-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  font-size: 22px !important;
  line-height: 22px !important;
  color: #b5bac1;
}
/* Tik „Filtras pagal datą“ eilutė – didesnis kalendorius, eilutės plotis / padding nepakitę. */
.dm-chat-search-filter-row[data-chat-search-open-date] .dm-chat-search-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 30px !important;
  line-height: 30px !important;
}
.dm-chat-search-filter-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.dm-chat-search-filter-primary {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f2f3f5;
  line-height: 1.25;
}

.dm-chat-search-from-panel,
.dm-chat-search-has-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  width: max(100%, 288px);
  max-width: min(360px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 8px 10px;
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  z-index: 122;
  max-height: min(420px, 70vh);
}
.dm-chat-search-from-panel.hidden,
.dm-chat-search-has-panel.hidden {
  display: none !important;
}
.dm-chat-search-from-panel-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}
.dm-chat-search-from-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #dbdee1;
  cursor: pointer;
}
.dm-chat-search-from-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.dm-chat-search-from-back .material-icons {
  font-size: 20px;
}
.dm-chat-search-from-heading {
  margin: 0;
  flex: 1;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #949ba4;
}
.dm-chat-search-from-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(320px, 55vh);
  overflow-y: auto;
  padding: 2px 0 0;
}
.dm-chat-search-from-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 8px;
  text-align: left;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  box-sizing: border-box;
  transition: background 0.12s ease;
}
.dm-chat-search-from-row:hover {
  background: rgba(255, 255, 255, 0.08);
}
.dm-chat-search-from-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.dm-chat-search-from-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  font-size: 0.875rem;
}
.dm-chat-search-from-loading,
.dm-chat-search-from-empty {
  margin: 0;
  padding: 10px 8px;
  font-size: 0.8125rem;
  color: #949ba4;
  text-align: center;
}

.dm-chat-search-has-type-row .dm-chat-search-filter-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.dm-chat-search-has-type-ico {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  color: #949ba4;
}

.dm-chat-search-date-panel.dm-chat-search-from-panel {
  max-height: min(480px, 78vh);
  color-scheme: dark;
}
.dm-chat-search-date-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 2px;
  min-width: 0;
}
.dm-chat-search-date-modes {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dm-chat-search-date-mode-opt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 2px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #dbdee1;
  border-radius: 6px;
}
.dm-chat-search-date-mode-opt:hover {
  background: rgba(255, 255, 255, 0.06);
}
.dm-chat-search-date-mode-opt input {
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--accent, #00c853);
}
.dm-chat-search-date-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dm-chat-search-date-field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dm-chat-search-date-field-caption {
  font-size: 0.72rem;
  font-weight: 600;
  color: #949ba4;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dm-chat-search-date-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1e1f22;
  color: #f2f3f5;
  font-size: 0.875rem;
  font-family: inherit;
}
.dm-chat-search-date-input:focus {
  outline: 2px solid var(--accent, #00c853);
  outline-offset: 0;
  border-color: rgba(255, 255, 255, 0.2);
}
.dm-chat-search-date-apply {
  margin-top: 4px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  background: var(--accent, #00c853);
  color: #111;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.dm-chat-search-date-apply:hover {
  filter: brightness(1.06);
}
.dm-chat-search-date-apply:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.dm-chat-search-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-family: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}
.dm-chat-search-input::placeholder { color: var(--text-dim); }
.chat-search-hidden { display: none !important; }
.dm-chat-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
}

.voice-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.voice-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.voice-btn.hidden { display: none; }

.voice-status {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.chat-main-row {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.user-card-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-side, #1a1a1e);
  border-left: 1px solid var(--border, rgba(255,255,255,0.06));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.user-card-sidebar.hidden { display: none !important; }

.group-members-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-side, #1a1a1e);
  border-left: 1px solid var(--border, rgba(255,255,255,0.06));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.group-members-sidebar.hidden { display: none !important; }

.chat-search-results-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-side, #1a1a1e);
  border-left: 1px solid var(--border, rgba(255,255,255,0.06));
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.chat-search-results-sidebar.hidden {
  display: none !important;
}
.chat-search-results-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  flex-shrink: 0;
}
.chat-search-results-header-text {
  min-width: 0;
  flex: 1;
}
.chat-search-results-count {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #f2f3f5);
  line-height: 1.25;
}
.chat-search-results-query {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--text-dim, #949ba4);
  word-break: break-word;
  line-height: 1.3;
}
.chat-search-results-query.hidden {
  display: none !important;
}
.chat-search-results-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Eilutė: veidrodis = visa plotis; „Peršokti“ – sluoksnis viršuje, matomas užvedus / fokusui. */
.chat-search-result-row {
  position: relative;
  padding: 6px 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-search-result-mirror-host {
  width: 100%;
  min-width: 0;
}
/* Neišplėsti į „-16px“ kaip pagrindiniame pokalbio konteineryje. */
.chat-search-result-mirror-host .chat-search-result-mirror-message.message {
  margin-left: 0;
  margin-right: 0;
  padding-left: 4px;
  padding-right: 4px;
  margin-top: 2px;
  margin-bottom: 0;
  max-width: 100%;
}
.chat-search-result-mirror-host .chat-search-result-mirror-message.message .message-content {
  min-width: 0;
}
/* Šiek tiek kompaktiškiau nei pilnas kairysis stulpelis, bet tas pats išdėstymas. */
.chat-search-result-mirror-host .message-author {
  font-size: 0.94rem;
}
.chat-search-result-mirror-host .message-header {
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 2px;
}
.chat-search-result-mirror-host .message-header .message-time {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.68rem;
  line-height: 1.25;
  white-space: normal;
}
.chat-search-result-mirror-host .message-text {
  font-size: 0.9rem;
}
.chat-search-result-mirror-host .dm-call-log-row {
  font-size: 0.88rem;
}
/* Tik video – fiksuotas aukštas; garsas turi savo išdėstymą (žr. .message-audio-only žemiau). */
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) {
  width: 100%;
  max-width: 100%;
  height: clamp(100px, 20vh, 200px);
  max-height: min(32vh, 240px);
}
/* Paieškos šonas: video valdymas vienoje eilutėje (kaip MP3) – play, sutrumpinta seek, laikas. */
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) .message-video-bar {
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 5px;
  padding: 6px 6px 8px;
}
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) .message-video-seek-wrap {
  order: 1;
  flex: 1 1 36px;
  min-width: 32px;
  max-width: 100%;
}
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) .message-video-seek {
  flex: 1 1 auto;
}
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) .message-video-time {
  order: 2;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.62rem;
  white-space: nowrap;
}
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) .message-video-vol-stack {
  order: 3;
  padding: 4px 4px 2px;
  margin: -4px -4px -2px;
}
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) .message-video-fs {
  order: 4;
}
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) .message-video-btn {
  width: 28px;
  height: 28px;
}
.chat-search-result-mirror-host .message-video-wrap:not(.message-audio-only) .message-video-btn .material-symbols-outlined {
  font-size: 22px;
}
.chat-search-result-mirror-host .message-video-wrap.message-audio-only {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  min-height: 132px !important;
  display: block !important;
}
.chat-search-result-mirror-host .message-video-wrap.message-audio-only .message-audio-head {
  min-width: 0;
}
.chat-search-result-mirror-host .message-video-wrap.message-audio-only .message-audio-icon-wrap {
  width: 44px;
  height: 44px;
}
.chat-search-result-mirror-host .message-video-wrap.message-audio-only .message-audio-file-icon {
  font-size: 28px;
}
.chat-search-result-mirror-host .message-video-wrap.message-audio-only .message-audio-title {
  font-size: 0.82rem;
}

.chat-search-result-jump {
  position: absolute;
  top: 6px;
  right: 4px;
  z-index: 8;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(32, 34, 37, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text, #e8eaed);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, background 0.12s ease;
}
.chat-search-result-jump:hover {
  background: rgba(48, 50, 54, 0.96);
}
@media (hover: hover) and (pointer: fine) {
  /* Be `focus-within`: paspaudus „Pereiti“ mygtukas išlaiko fokusą → eilutė lieka „užfiksuota“ ir mygtukas nedingsta kitoms eilutėms užvedus. */
  .chat-search-result-row:hover .chat-search-result-jump,
  .chat-search-result-jump:focus-visible {
    opacity: 1;
    pointer-events: auto;
  }
}
@media (hover: none), (pointer: coarse) {
  .chat-search-result-jump {
    opacity: 1;
    pointer-events: auto;
  }
}
.chat-search-results-truncated {
  margin: 8px 4px 0;
  font-size: 0.72rem;
  color: var(--text-dim, #949ba4);
  text-align: center;
}
.chat-search-results-footer {
  flex-shrink: 0;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  background: var(--bg-side, #1a1a1e);
}
.chat-search-results-footer.hidden {
  display: none !important;
}
.chat-search-results-range {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--text-dim, #949ba4);
  text-align: center;
  line-height: 1.35;
}
.chat-search-results-pager {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  max-width: 100%;
}
.chat-search-results-pager-nav {
  flex-shrink: 0;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim, #dbdee1);
  border: none;
  cursor: pointer;
  line-height: 1.2;
}
.chat-search-results-pager-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text, #fff);
}
.chat-search-results-pager-nav:disabled {
  opacity: 0.32;
  cursor: default;
}
.chat-search-results-pager-pages {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 4px;
  min-width: 0;
  max-width: 100%;
}
.chat-search-results-page-num {
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-dim, #b5bac1);
  cursor: pointer;
  line-height: 1;
}
.chat-search-results-page-num:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text, #fff);
}
.chat-search-results-page-num--current {
  background: rgba(88, 101, 242, 0.35);
  color: #fff;
  cursor: default;
}
.chat-search-results-page-num--current:hover {
  background: rgba(88, 101, 242, 0.42);
}
.chat-search-results-pager-ellipsis {
  padding: 0 2px;
  font-size: 0.75rem;
  color: var(--text-dim, #6d7278);
  user-select: none;
}
.message.chat-search-jump-highlight {
  animation: chat-search-jump-flash 5.5s ease-out;
}
/* DM Virtuoso: apačioje plaukiojanti juosta – scrollIntoView / snap neįkišą žinutės po ja */
.friend-chat-panel[data-virtuoso='1'] .message.chat-search-jump-highlight {
  scroll-margin-bottom: 88px;
}
@keyframes chat-search-jump-flash {
  0% {
    background: rgba(0, 200, 83, 0.35);
    box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.45);
  }
  22% {
    background: rgba(0, 200, 83, 0.28);
    box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.35);
  }
  45% {
    background: rgba(0, 200, 83, 0.18);
    box-shadow: 0 0 0 1px rgba(0, 200, 83, 0.22);
  }
  72% {
    background: rgba(0, 200, 83, 0.08);
    box-shadow: none;
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}
.group-members-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.group-members-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.group-members-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}
.group-members-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.group-members-list .group-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}
.group-members-list .group-member-item:hover { background: var(--bg-input); }
.group-member-avatar-wrap {
  position: relative;
  display: inline-flex;
  overflow: visible;
}
.group-creator-crown {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(calc(-50% - 12px)) rotate(-35deg);
  z-index: 2;
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  pointer-events: none;
}
.user-card-actions {
  position: absolute;
  top: 4px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.user-card-action-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.user-card-action-btn:hover {
  background: rgba(255,255,255,0.15);
  color: var(--accent, #5865f2);
}
.user-card-action-btn svg {
  width: 22px;
  height: 22px;
}
.user-card-action-btn.status-friend {
  color: var(--accent, #5865f2);
}
.user-card-action-btn.status-pending {
  color: var(--text-dim);
  cursor: default;
}
.user-card-action-btn.status-pending:hover {
  background: rgba(0,0,0,0.4);
  color: var(--text-dim);
}
.user-card-action-btn.status-pending-received {
  color: var(--accent, #5865f2);
  cursor: pointer;
}

.user-card-friend-wrap {
  position: relative;
}
.user-card-remove-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-side, #2c2c33);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.user-card-remove-popover:hover {
  background: rgba(255,255,255,0.1);
}
.user-card-remove-popover.hidden { display: none !important; }

.user-card-banner {
  height: 80px;
  background: linear-gradient(135deg, #2c2c33 0%, #1e1e23 100%);
  flex-shrink: 0;
}

.user-card-body {
  padding: 0 16px 16px;
  margin-top: -72px;
  position: relative;
}

.user-card-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-top: 32px;
  margin-bottom: 16px;
}
.user-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--bg-side, #1a1a1e);
  background: var(--accent);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 2rem;
  box-sizing: border-box;
}
.user-card-status {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid var(--bg-side, #1a1a1e);
  box-sizing: border-box;
}
.user-card-status.status-online { background: #22c55e; }
.user-card-status.status-offline { background: #6b7280; }
.user-card-status.hidden { display: none !important; }

.user-card-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.user-card-username {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0 0 16px;
}

.user-card-mutual-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 6px;
}
.user-card-mutual-row:last-of-type { margin-bottom: 0; }
.user-card-mutual-row:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.user-card-mutual-row:hover .user-card-mutual-chevron {
  color: var(--text);
}
.user-card-mutual-label { flex: 1; }
.user-card-mutual-count {
  margin-right: 8px;
  color: var(--text-dim);
}
.user-card-mutual-chevron {
  font-size: 1.1rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}
.user-card-mutual-row.expanded .user-card-mutual-chevron {
  transform: rotate(90deg);
}
.user-card-mutual-dropdown {
  max-height: 160px;
  overflow-y: auto;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  margin-bottom: 6px;
  padding: 6px 0;
}
.user-card-mutual-dropdown.hidden { display: none !important; }
.user-card-mutual-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.9rem;
}
.user-card-mutual-dropdown-item[data-server-id] {
  cursor: pointer;
  color: var(--text-dim);
}
.user-card-mutual-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.user-card-mutual-dropdown .mutual-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 600;
}
.user-card-mutual-dropdown .mutual-server-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
}

.text-channel-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.messages-container {
  flex: 1;
  min-height: 0;
  position: relative;
  width: 100%;
  padding: 16px;
  padding-bottom: 12px;
  overflow-y: auto;
  /* Be H slankiklio: tik overflow-y:auto „įjungia“ ir overflow-x:auto – ilgos eilutės keldavo juostą virš įvesties */
  overflow-x: hidden;
}

.messages { display: flex; flex-direction: column; gap: 0; }

.message {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  align-items: flex-start;
  margin-left: -16px;
  margin-right: -16px;
  padding: 1px 16px;
  border-radius: 4px;
  transition: background 0.1s;
  flex-shrink: 0;
  overflow: visible;
}
.message:hover,
.message.message-menu-open {
  background: rgba(255, 255, 255, 0.04);
}

/* Žinutė, į kurią dabar rašomas atsakymas (reply juosta) – permatomas žalias fonas */
.message.message-reply-target {
  background: rgba(34, 197, 94, 0.22);
}
.message.message-reply-target:hover,
.message.message-reply-target.message-menu-open {
  background: rgba(34, 197, 94, 0.32);
}

/* Po paspaudimo ant citatos – žalia lieka, kol paspaudžiama už šios žinutės ribų */
.message.message-reply-jump-active {
  background: rgba(34, 197, 94, 0.28);
}
.message.message-reply-jump-active:hover,
.message.message-reply-jump-active.message-menu-open {
  background: rgba(34, 197, 94, 0.36);
}

/* Atsakymas: citata virš autoriaus – kaip Discord (2-oji ref. nuotrauka) */
.message.message-has-reply-snippet:not(.message-continuation) > .message-avatar,
.message.message-has-reply-snippet:not(.message-continuation) > .message-time-placeholder {
  /* Didelis avataras sutampa su autoriaus eilute, ne su citatos bloku */
  margin-top: 2.5rem;
}
.message.message-has-reply-snippet.message-continuation > .message-avatar,
.message.message-has-reply-snippet.message-continuation > .message-time-placeholder {
  margin-top: 0;
}
.message .message-reply-snippet {
  position: relative;
  margin: 0 0 6px;
  padding: 7px 14px 7px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid rgba(34, 197, 94, 0.75);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--text-dim);
  overflow: visible;
}
/* Jungtis: H ties tikru citatos vertikaliam centrui (50%); V nuo ten iki avataro viršaus (2.5rem − pusė citatos). */
.message .message-reply-snippet-tether {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 4;
}
/* Nuo vertikalės dešiniojo krašto iki citatos – be „snapo“ kairėn (buvo -40…-34 → T forma). */
.message .message-reply-snippet-tether-h {
  position: absolute;
  top: 50%;
  left: calc(-34px + 1.125px);
  width: calc(34px - 1.125px);
  height: 2.25px;
  transform: translateY(-50%);
  background: rgba(34, 197, 94, 0.9);
  border-radius: 0 2px 2px 0;
}
/* 3 + 12 + 10 + 21 = 34px nuo padding krašto iki 42px avataro centro */
.message .message-reply-snippet-tether-v {
  position: absolute;
  top: calc(50% - 1.125px);
  left: -34px;
  width: 2.25px;
  transform: translateX(-50%);
  height: max(3px, calc(2.5rem - 50% + 1.125px + 1px));
  background: rgba(34, 197, 94, 0.9);
  border-radius: 2px;
}
.message.message-continuation .message-reply-snippet-tether {
  display: none;
}
.message .message-reply-snippet-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.message .message-reply-snippet-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(34, 197, 94, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}
.message .message-reply-snippet-avatar-img {
  background-color: #1a1d21;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background-size: cover;
  background-position: center;
  color: transparent;
}
.message .message-reply-snippet-main {
  min-width: 0;
}
.message .message-reply-snippet--clickable {
  cursor: pointer;
}
.message .message-reply-snippet--clickable:hover {
  background: rgba(255, 255, 255, 0.09);
}
.message .message-reply-ref-author {
  font-weight: 600;
  color: var(--text);
}
.message .message-reply-ref-snippet {
  color: var(--text-dim);
  word-break: break-word;
}
.message .message-reply-ref-snippet-line {
  display: inline;
}
.message .message-reply-snippet-attach-ico {
  font-size: 1.26rem;
  width: 1.26rem;
  height: 1.26rem;
  line-height: 1;
  vertical-align: -0.2em;
  margin-inline-start: 4px;
  color: #fff;
  opacity: 0.95;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

/* Visos citatos juostoje (emoji + „video“ ir kt. Material ikonos) – šiek tiek didesnės, baltos. */
.message-reply-snippet .chat-emoji--inline {
  display: inline-block;
  font-size: 1.48em;
  line-height: 1;
  padding-block: 0.05em;
  vertical-align: -0.14em;
  font-family: var(--font-emoji);
  box-sizing: border-box;
  color: #fff;
}
.message-reply-snippet .chat-emoji:not(.chat-emoji--inline) {
  display: inline-block;
  font-size: 2.02em;
  line-height: 1;
  padding-block: 0.06em;
  vertical-align: middle;
  font-family: var(--font-emoji);
  box-sizing: border-box;
  color: #fff;
}

.chat-reply-bar-meta .message-reply-bar-attach-ico {
  font-size: 1.28rem;
  width: 1.28rem;
  height: 1.28rem;
  line-height: 1;
  vertical-align: -0.18em;
  margin-inline-start: 4px;
  color: #fff;
  opacity: 0.95;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}
.chat-reply-bar-meta .chat-emoji--inline {
  display: inline-block;
  font-size: 1.46em;
  line-height: 1;
  padding-block: 0.04em;
  vertical-align: -0.12em;
  font-family: var(--font-emoji);
  box-sizing: border-box;
  color: #fff;
}
.chat-reply-bar-meta .chat-emoji:not(.chat-emoji--inline) {
  display: inline-block;
  font-size: 1.92em;
  line-height: 1;
  vertical-align: middle;
  font-family: var(--font-emoji);
  box-sizing: border-box;
  color: #fff;
}

.message:first-child { margin-top: 0; }
/* Tęsinys – tos pačios grupės žinutės, bet ne „prilipusios“ */
.message.message-continuation { margin-top: 6px; }

.message-date-separator + .message { margin-top: 14px; }
.message-date-separator + .message.message-continuation { margin-top: 8px; }

/* Skambučių / sistemos eilutės iš eilės – kaip „continuation“ (nėra message-continuation klasės), kitaip kiekviena gauna pilną 16px */
.message.message-call-log + .message.message-call-log,
.message.message-dm-sys-log + .message.message-dm-sys-log,
.message.message-call-log + .message.message-dm-sys-log,
.message.message-dm-sys-log + .message.message-call-log {
  margin-top: 6px;
}

.message-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
  margin: 8px 0;
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.message-date-separator::before,
.message-date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.message-avatar.message-avatar-img {
  color: transparent;
  text-indent: -9999px;
  background-size: cover;
  background-position: center;
}

.message-content { flex: 1; min-width: 0; position: relative; overflow: visible; }

/* Persiųsta – tarp autoriaus ir teksto (ta pati „reply“ ikona veidrodžiu kaip persiuntimas) */
.message-forwarded-badge {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 2px 0 6px 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  user-select: none;
}
.message-forwarded-badge-label {
  font-style: italic;
}
.message-forwarded-badge-icon.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: 1rem;
  line-height: 1;
  transform: scaleX(-1);
  color: inherit;
}

/* Continuation: no avatar, time on hover – laikas ir žinutė vienoje eilutėje */
.message-time-placeholder {
  width: 42px;
  min-height: 21px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.message-time-placeholder .message-time-hover {
  opacity: 0;
  transition: opacity 0.15s;
}
.message:hover .message-time-placeholder .message-time-hover {
  opacity: 1;
}

/* Message actions – visible on hover (šiek tiek aukščiau už teksto eilutę) */
.message-actions {
  position: absolute;
  top: -16px;
  right: 0;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  overflow: visible;
}
.message:hover .message-actions {
  opacity: 1;
}
/* Kontekstinis meniu atidarytas – pelė ant meniu, ne ant žinutės; hover dingsta be šios klasės. */
.message.message-menu-open .message-actions {
  opacity: 1;
}
.message.message-editing .message-actions {
  display: none;
}
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  min-height: 0;
  align-items: center;
}
.message-reactions:empty {
  display: none;
}

/*
 * DM + react-virtuoso: reakcijų juosta – sklandus aukštis (CSS), o ne staigus JS autoscroll kiekvienam RO kadre.
 * Tuščias slotas lieka DOM (žr. getMessageActionsHtml) – čia :empty ne display:none, o max-height:0.
 * Per animaciją MsgRow `row-height-delta` blokuojami per `__gamespeakVirtuosoSuppressRowResizeUntil`
 * (žr. `armVirtuosoReactionLayoutAnim`); apačią laiko Virtuoso `alignToBottom` vienas, be konkurencijos.
 */
.friend-chat-panel[data-virtuoso='1'] .message-reactions:empty {
  display: flex;
}
.friend-chat-panel[data-virtuoso='1'] .message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 0;
  box-sizing: border-box;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition:
    max-height 0.2s ease-in-out,
    opacity 0.2s ease-in-out,
    margin-top 0.2s ease-in-out;
}
.friend-chat-panel[data-virtuoso='1'] .message-reactions:not(:empty) {
  max-height: 200px;
  opacity: 1;
  margin-top: 6px;
  overflow: visible;
}
@media (prefers-reduced-motion: reduce) {
  .friend-chat-panel[data-virtuoso='1'] .message-reactions {
    transition: none;
  }
}

.message-reaction {
  font-family: var(--font-emoji);
  font-size: 1rem;
  padding: 4px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
}
.message-reaction:hover {
  background: rgba(255,255,255,0.08);
}
.message-reaction-emoji {
  font-size: 1.1rem;
}
.message-reaction-count {
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.message-reaction-mine {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}
.message-reaction-mine .message-reaction-count {
  color: var(--accent);
}
.message-reaction-add {
  padding: 4px 6px;
  opacity: 0.7;
}
.message-reaction-add:hover {
  opacity: 1;
}
/* Reakcijos hover: kas paliko (vienas bendras tooltip ant body) */
.message-reaction-tooltip {
  position: fixed;
  z-index: 11000;
  max-width: min(280px, calc(100vw - 16px));
  max-height: min(240px, 45vh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-elevated, var(--bg-input));
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-size: 0.85rem;
  line-height: 1.4;
  pointer-events: auto;
  color: var(--text);
}
.message-reaction-tooltip[hidden] {
  display: none !important;
  pointer-events: none;
}
.message-reaction-tooltip-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.message-reaction-tooltip-list li {
  padding: 2px 0;
  word-break: break-word;
}
.message-action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 5px;
  /* šiek tiek šviesesnis už bg-input, ne baltas */
  background: color-mix(in srgb, #ffffff 14%, var(--bg-input));
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    color 0.15s ease,
    box-shadow 0.2s ease;
}
.message-action-btn:hover {
  background: color-mix(in srgb, #ffffff 20%, var(--bg-input));
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.message-action-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}
.message-action-btn .message-action-btn-icon.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-size: 21px;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 0 transparent);
  transition:
    color 0.18s ease,
    transform 0.24s cubic-bezier(0.34, 1.35, 0.64, 1),
    filter 0.24s ease;
}
.message-action-btn .message-action-btn-icon.material-symbols-outlined:not(.message-action-icon-forward) {
  transform: translateY(0);
}
/* Be scale: švelnus „pakilimas“ + akcentinis švytėjimas aplink ikoną */
.message-action-btn:hover .message-action-btn-icon.material-symbols-outlined:not(.message-action-icon-forward),
.message-action-btn:focus-visible .message-action-btn-icon.material-symbols-outlined:not(.message-action-icon-forward) {
  transform: translateY(-3px);
  filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--accent) 55%, transparent))
    drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 35%, transparent));
}
/* Persiuntimas: ta pati „reply“ forma, tik veidrodžiai (ne `forward` su dviguba galvute). */
.message-action-btn .message-action-icon-forward {
  transform: scaleX(-1);
}
.message-action-btn:hover .message-action-icon-forward,
.message-action-btn:focus-visible .message-action-icon-forward {
  transform: scaleX(-1) translateY(-3px);
  filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--accent) 55%, transparent))
    drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 35%, transparent));
}

/* Custom patarimai – fixed + --gs-tip-* iš message-action-tip-position.js (neužlinda ant mygtukų) */
.message-action-btn[data-gs-tip] {
  position: relative;
  overflow: visible;
}
.message-action-btn[data-gs-tip]::after {
  content: attr(data-gs-tip);
  position: fixed;
  left: var(--gs-tip-x, -99999px);
  top: var(--gs-tip-y, -99999px);
  transform: translate(-50%, -100%);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  background: var(--bg-elevated, var(--bg-input));
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, visibility 0.14s ease;
  z-index: 12050;
}
.message-action-btn[data-gs-tip].gs-tip-below::after {
  transform: translate(-50%, 0);
}
.message-action-btn[data-gs-tip]:hover::after,
.message-action-btn[data-gs-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* Atsakymo juosta virš kompozitoriaus (DM / kanalas) */
.chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 0 0 6px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-dim);
  font-size: 0.85rem;
}
.chat-reply-bar.hidden {
  display: none !important;
}
.chat-reply-bar-icon.material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  color: var(--accent);
  flex-shrink: 0;
}
.chat-reply-bar-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.chat-reply-bar-label {
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
}
.chat-reply-bar-meta {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-reply-bar-meta strong {
  font-weight: 600;
  color: var(--text);
}
.chat-reply-bar-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-reply-bar-close:hover {
  background: var(--border);
  color: var(--text);
}
.chat-reply-bar-close .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.message-author { font-weight: 600; color: var(--text); font-size: 17px; }

.message-time { font-size: 0.65rem; color: var(--text-dim); }

.message-text {
  font-size: 16px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.message-text .message-edited-indicator {
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.85em;
  font-weight: 400;
  white-space: nowrap;
}
.message-translation {
  margin-top: 6px;
  padding: 8px 10px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}
.message-translation-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.message-translation .message-translation-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}
.message-translation .message-translation-label-text {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}
/* auto_awesome – oficialus Material Symbols glifas (Apache-2.0, tas pats šriftas kaip UI). */
.message-translation .message-translation-label-icon {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  background: linear-gradient(125deg, #42a5f5 0%, #7e57c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}
.message-translation .message-translation-text {
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
  user-select: text;
  cursor: text;
}
.message-text .chat-link {
  color: var(--accent);
  text-decoration: none;
}
.message-text .chat-link:hover {
  text-decoration: underline;
}

/* Nuorodos: YouTube/Vimeo embed + OG kortelė */
.chat-link-embeds {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  max-width: min(520px, 100%);
}
.chat-link-embed {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated, rgba(0, 0, 0, 0.25));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
.chat-link-embed--video.chat-link-embed--pending {
  min-height: 120px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0,
    rgba(255, 255, 255, 0.03) 12px,
    transparent 12px,
    transparent 24px
  );
}
.chat-link-embed-iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.chat-link-embed-launch {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: #0d0d0d;
  border-radius: inherit;
  overflow: hidden;
  color: #fff;
}
.chat-link-embed-launch:focus-visible {
  outline: 2px solid var(--accent, #5865f2);
  outline-offset: 2px;
}
.chat-link-embed-launch-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-link-embed-launch-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.15));
  pointer-events: none;
}
.chat-link-embed-launch-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  padding-left: 4px;
  line-height: 1;
  pointer-events: none;
  box-sizing: border-box;
}

/* YouTube: tekstas virš miniatiūros (kaip Discord), ne overlay apačioje */
.chat-link-embed-yt-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}
.chat-link-embed-yt-player-wrap {
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  background: #000;
}
.chat-link-embed-yt-poster {
  cursor: default;
  flex: 0 0 auto;
}
.chat-link-embed-yt-poster .chat-link-embed-launch-thumb {
  pointer-events: none;
}
.chat-link-embed-yt-poster .chat-link-embed-launch-shade {
  /* Tekstas ne ant vaizdo – švelnesnis užtemdymas */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.08));
}
.chat-link-embed-yt-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  padding-left: 4px;
  line-height: 1;
  box-sizing: border-box;
  cursor: pointer;
  pointer-events: auto;
  color: #fff;
}
.chat-link-embed-yt-play-btn:hover {
  background: rgba(220, 38, 38, 0.85);
  border-color: #fff;
}
.chat-link-embed-launch--vimeo .chat-link-embed-launch-label {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
.chat-link-embed-launch--vimeo {
  background: linear-gradient(160deg, #1ab7ea 0%, #162221 55%);
}

.chat-link-embed-yt-meta {
  flex: 0 0 auto;
  position: relative;
  padding: 10px 12px 8px;
  text-align: left;
  pointer-events: auto;
  z-index: 1;
}
.chat-link-embed-yt-provider {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim, #9aa0a6);
  margin-bottom: 4px;
}
.chat-link-embed-yt-channel {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary, #f2f3f5);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-link-embed-yt-channel:hover {
  text-decoration: underline;
}
.chat-link-embed-yt-title {
  display: -webkit-box;
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  color: #5b9eff;
  text-decoration: none;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-link-embed-yt-title:hover {
  text-decoration: underline;
}
.chat-link-embed--unfurl.chat-link-embed--pending {
  min-height: 56px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-dim, #888);
}
.chat-link-embed-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  color: inherit;
  min-height: 72px;
}
.chat-link-embed-card-thumb {
  flex: 0 0 120px;
  max-width: 40%;
  background: rgba(0, 0, 0, 0.35);
  min-height: 88px;
}
.chat-link-embed-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-link-embed-card-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-link-embed-card-site {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text-primary, #f2f3f5);
}
.chat-link-embed-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  word-break: break-word;
  color: var(--accent, #00c853);
  text-decoration: none;
  cursor: pointer;
}
.chat-link-embed-card-title:hover {
  text-decoration: underline;
  filter: brightness(1.08);
}
.chat-link-embed-card-desc {
  font-size: 0.82rem;
  color: var(--text-primary, #f2f3f5);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-link-embed-fallback {
  display: block;
  padding: 10px 12px;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--accent);
}

/* Išorinė nuoroda: saugumo modalas (#external-link-confirm-modal) */
.modal-external-link .modal-external-link-lead {
  margin: 8px 20px 0;
  padding: 0;
  line-height: 1.45;
}
.modal-external-link .external-link-url-caption {
  margin: 12px 20px 4px;
  padding: 0;
}
.external-link-url-box {
  margin: 0 20px 4px;
  padding: 10px 12px;
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--text);
  background: var(--bg-input, #2a2a2e);
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  user-select: text;
  -webkit-user-select: text;
  max-height: 120px;
  overflow-y: auto;
}
label.external-link-trust-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  /* Tas pats horizontalus įtraukimas kaip „Adresas“ ir URL dėžė (.modal padding + 20px) */
  margin: 12px 20px 8px;
  padding: 0;
  color: var(--text);
  cursor: pointer;
}
/* .modal input { width:100% } kitaip ištempia checkboxą per visą modalą – tekstas lieka 0 px pločio */
.modal-external-link label.external-link-trust-row input[type='checkbox'].gs-checkbox {
  width: 18px;
  max-width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 2px 0 0 0;
  margin-bottom: 0;
  padding: 0;
  flex: 0 0 18px;
}
.external-link-trust-text {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: inherit;
  user-select: none;
  overflow-wrap: break-word;
  word-break: normal;
}

/* Tik emoji žinutė – dideli; su tekstu – .chat-emoji--inline (žemiau). */
.message-text .chat-emoji:not(.chat-emoji--inline) {
  /* Dideli emoji: Noto/Segoe glifo „uodegos“ dažnai piešiamos už metrikų ribų —
     inline dėžė lieka žema, hover fonas / eilutė vizualiai „kirpia“ apačią. */
  display: inline-block;
  font-size: 2.85em;
  line-height: 1;
  padding-block: 0.18em;
  vertical-align: middle;
  font-family: var(--font-emoji);
  box-sizing: border-box;
}
.message-text .chat-emoji--inline {
  display: inline-block;
  font-size: 1.22em;
  line-height: 1;
  padding-block: 0.04em;
  vertical-align: -0.12em;
  font-family: var(--font-emoji);
  box-sizing: border-box;
}

.dm-message-body-slot .message-text {
  margin: 0;
}

.message-text strong {
  font-weight: 700;
}
.message-text em {
  font-style: italic;
}
.message-text strong em,
.message-text em strong {
  font-style: italic;
  font-weight: 700;
}

/* Teksto spoileris: ||žodis|| – matoma po paspaudimo pokalbyje */
.chat-spoiler {
  display: inline;
  border-radius: 4px;
  cursor: pointer;
  padding: 0 3px;
  background: rgba(0, 0, 0, 0.32);
  outline: none;
}
.chat-spoiler:not(.is-revealed) {
  user-select: none;
}
.chat-spoiler:not(.is-revealed) .chat-spoiler-inner {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}
.chat-spoiler.is-revealed {
  cursor: default;
  background: transparent;
  padding: 0;
}
.chat-spoiler.is-revealed .chat-spoiler-inner {
  filter: none;
  pointer-events: auto;
  user-select: text;
}

/* Žinutės laukas: pažymėjus žodį – plūduriuojanti juosta su rodykle į pažymėjimą */
.composer-format-pop {
  position: fixed;
  z-index: 12500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0 0 9px;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}
.composer-format-pop.hidden {
  display: none !important;
}
.composer-format-pop-surface {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 7px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
}
/* Rodyklė žemyn – centras sutampa su translate(-50%, …) inkaru virš pažymėto teksto */
.composer-format-pop-arrow {
  width: 12px;
  height: 12px;
  margin-top: -7px;
  margin-bottom: 0;
  background: var(--bg-input);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
  flex-shrink: 0;
  z-index: 1;
  pointer-events: none;
}
.composer-format-pop-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 7px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Tik raidė „I“ pasvirusi – mygtuko fonas lieka stačiakampis */
.composer-format-pop-btn--italic {
  font-style: normal;
  font-family: inherit;
}
.composer-format-pop-italic-char {
  display: inline-block;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  transform: skewX(-6deg);
}
.composer-format-pop-btn--icon {
  min-width: 36px;
  padding: 0 6px;
}
.composer-format-pop-ico {
  font-size: 20px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24;
}
.composer-format-pop-btn:hover {
  background: var(--accent);
  color: #fff;
}
.composer-format-pop-btn:hover .composer-format-pop-ico {
  color: #fff;
}

/* Skambučių / sistemos žinutės: tekstas centre prie ikonos (align-items: center).
   message-content – relative, kaip kitos žinutės (veiksmų juosta tame pačiame teksto stulpelyje). */
.message.message-call-log,
.message.message-dm-sys-log {
  align-items: center;
  position: relative;
}

/* Tik veiksmų juosta: kaip bendra top:-16px, + kompensacija dėl align-items:center. */
.message.message-call-log .message-actions,
.message.message-dm-sys-log .message-actions {
  top: calc(-16px - 16px);
}

.dm-sys-log-left {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.dm-sys-log-bot-icon.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 24px;
  line-height: 1;
  color: #fff;
}

.dm-sys-log-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 2px 0;
  font-size: 15px;
  line-height: 1.35;
}

.dm-sys-log-text {
  margin: 0;
  color: var(--text);
}

.dm-call-log-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 2px 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.35;
}

/* Vietoj avataro – ragelis (praleistas / įvykęs pokalbis) */
.dm-call-log-left {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.dm-call-log-left .dm-call-log-svg {
  width: 22px;
  height: 22px;
}

.dm-call-log-left.dm-call-log-missed .dm-call-log-svg {
  color: #f04747;
}

.dm-call-log-left.dm-call-log-busy .dm-call-log-svg {
  color: #9ca3af;
}

.dm-call-log-left.dm-call-log-answered .dm-call-log-svg,
.dm-call-log-left.dm-call-log-ringing .dm-call-log-svg {
  color: var(--accent);
}

.dm-call-log-label {
  min-width: 0;
  word-break: break-word;
}

.dm-call-log-time-tail {
  color: var(--text);
  flex-shrink: 0;
}

.dm-call-log-elapsed-wrap--hidden {
  display: none !important;
}

.dm-call-log-name {
  font-weight: 700;
}

.dm-call-log-active-hint {
  color: var(--accent);
  font-weight: 600;
}

/* In-line redagavimas (Discord stilius) */
.message-edit-wrap {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.message-edit-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px 4px 12px;
}
.message-edit-row:focus-within {
  border-color: var(--accent);
}
.message-edit-input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  max-height: min(45vh, 360px);
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  outline: none;
  overflow-x: hidden;
  box-sizing: border-box;
}
.message-edit-emoji-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.message-edit-emoji-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.message-edit-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.message-edit-hint-key.message-edit-hint-escape,
.message-edit-hint-key.message-edit-hint-enter {
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--accent);
  vertical-align: baseline;
  text-align: left;
}
.message-edit-hint-key.message-edit-hint-escape:hover,
.message-edit-hint-key.message-edit-hint-enter:hover,
.message-edit-hint-key.message-edit-hint-escape:focus-visible,
.message-edit-hint-key.message-edit-hint-enter:focus-visible {
  text-decoration: underline;
  filter: brightness(1.12);
  outline: none;
}

/* Emoji palėtė – Discord stilius, Noto Color Emoji (OFL) */
.emoji-picker {
  font-family: var(--font-emoji);
  position: fixed;
  z-index: 2000;
  background: var(--bg-elevated, #2f3136);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 380px;
  max-height: 420px;
  display: none;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  overflow: hidden;
}
.emoji-picker.visible {
  display: flex;
}
.emoji-picker-tabs.hidden {
  display: none !important;
}
.emoji-picker-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.emoji-picker-tab {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
}
.emoji-picker-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.emoji-picker-tab.active {
  color: var(--text);
  background: rgba(255,255,255,0.1);
}
.emoji-picker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: visible;
  height: 56px;
}
.emoji-picker-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 44px;
}
.emoji-picker-search-wrap:focus-within {
  border-color: var(--accent);
}
.emoji-picker-search-icon { font-size: 1.2rem; color: var(--text-dim); }
.emoji-picker-search-icon.material-symbols-outlined { font-family: 'Material Symbols Outlined'; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.emoji-picker-search {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
.emoji-picker-skin-wrap {
  position: relative;
  flex-shrink: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.emoji-picker-skin-wrap.open {
  background: transparent;
  border: none;
  box-shadow: none;
  padding-bottom: 0;
}
.emoji-picker-skin-btn {
  position: relative;
  z-index: 11;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-picker-skin-btn:hover {
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
}
.emoji-picker-skin-menu {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px 8px;
  padding-top: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 10;
}
.emoji-picker-skin-wrap.open .emoji-picker-skin-menu {
  display: flex;
}
.emoji-picker-skin-menu span {
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-picker-skin-menu span:hover {
  background: rgba(255,255,255,0.1);
}
.emoji-picker-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.emoji-picker-sidebar {
  width: 44px;
  flex-shrink: 0;
  padding: 8px 4px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.emoji-picker-sidebar button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-emoji);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-picker-sidebar button:hover,
.emoji-picker-sidebar button.active {
  background: rgba(255,255,255,0.08);
}
.emoji-picker-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  min-width: 0;
}
.emoji-picker-content::-webkit-scrollbar { width: 8px; }
.emoji-picker-content::-webkit-scrollbar-track { background: transparent; }
.emoji-picker-content::-webkit-scrollbar-thumb {
  background: #4a4a4f;
  border-radius: 4px;
}
.emoji-picker-content::-webkit-scrollbar-thumb:hover {
  background: #5a5a5f;
}
.emoji-picker-content {
  scrollbar-width: thin;
  scrollbar-color: #4a4a4f transparent;
}
.emoji-picker-categories { display: block; }
.emoji-picker-search-results { display: none; }
.emoji-picker-content.search-mode .emoji-picker-categories,
.emoji-picker-content.search-mode .emoji-picker-frequent { display: none; }
.emoji-picker-content.search-mode .emoji-picker-search-results { display: block; }
.emoji-picker-frequent {
  margin-bottom: 12px;
}
.emoji-picker-frequent:empty {
  display: none;
}
.emoji-picker-frequent-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.emoji-picker-frequent-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}
.emoji-picker-frequent-grid span {
  font-family: var(--font-emoji);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  text-align: center;
  line-height: 1;
  min-width: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.emoji-picker-grid span {
  font-family: var(--font-emoji);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  text-align: center;
  line-height: 1;
  min-width: 0;
}
.emoji-picker-frequent-grid span:hover,
.emoji-picker-grid span:hover,
.emoji-picker-search-results span:hover {
  background: rgba(255,255,255,0.08);
}
.emoji-picker-category-section {
  margin-bottom: 16px;
}
.emoji-picker-category-section:last-child { margin-bottom: 0; }
.emoji-picker-category-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 12px 0 6px;
}
.emoji-picker-category-title:first-child {
  margin-top: 0;
}
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}
.emoji-picker-search-results {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}
.emoji-picker-search-results span {
  font-family: var(--font-emoji);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  text-align: center;
  line-height: 1;
  min-width: 0;
}

/* Tab content visibility */
.emoji-picker-tab-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.emoji-picker-tab-content.hidden {
  display: none !important;
}
.emoji-picker-skin-btn.hidden,
.emoji-picker-skin-wrap.hidden { display: none !important; }

/* GIF picker */
.gif-picker-powered {
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 4px 8px 8px;
  text-align: right;
}
.gif-picker-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 100px;
  gap: 8px;
  align-content: start;
}
.gif-picker-grid::-webkit-scrollbar { width: 8px; }
.gif-picker-grid::-webkit-scrollbar-track { background: transparent; }
.gif-picker-grid::-webkit-scrollbar-thumb { background: #4a4a4f; border-radius: 4px; }
.gif-picker-item {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-input);
  position: relative;
}
.gif-picker-item:hover {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.gif-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: top;
}
.gif-picker-item.gif-picker-category {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}
.gif-picker-item.gif-picker-category .gif-category-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}
.gif-picker-loading,
.gif-picker-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.gif-picker-loading.hidden,
.gif-picker-empty.hidden { display: none !important; }

/* Lipdukai empty state */
.stickers-picker-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.stickers-empty-icon { font-size: 3rem; }

.message-image {
  margin-top: 6px;
  max-width: min(100%, var(--chat-inline-image-max-width));
  max-height: var(--chat-inline-image-max-height);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  cursor: pointer;
}

.message-image:hover {
  opacity: 0.95;
}

/*
 * Pokalbio inline video: juosta overlay apačioje;
 * grojant – JS klasė message-video-ui-hidden (tik išblunka vietoje, kaip parsisiuntimo ikona).
 */
.message-video-wrap {
  margin-top: 6px;
  width: min(100%, 520px);
  max-width: 100%;
  /* Tas pats aukščio „lubos“ kaip nuotraukoms – chatas neina į begalybę */
  height: clamp(160px, 28vh, min(292px, var(--chat-inline-image-max-height)));
  max-height: min(40vh, var(--chat-inline-image-max-height));
  background: rgba(0, 0, 0, 0.42);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-sizing: border-box;
  position: relative;
}

.message-video-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #0a0a0b;
  border-radius: 8px;
  overflow: hidden;
}

/* Pirmas ekranas: tik centrinis play; po pirmojo paleidimo – visa juosta (žr. JS: šalina .message-video-awaiting-first-play). */
.message-video-center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  transition: background 0.15s ease, transform 0.12s ease;
  box-sizing: border-box;
}

.message-video-center-play:hover {
  background: rgba(0, 0, 0, 0.68);
  transform: translate(-50%, -50%) scale(1.04);
}

.message-video-center-play .material-symbols-outlined {
  font-size: 44px;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.message-video-center-play--hidden {
  display: none !important;
}

.message-video-wrap.message-video-awaiting-first-play .message-video-bar {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.chat-search-result-mirror-host .message-video-wrap.message-video-awaiting-first-play .message-video-bar {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.message-video-download {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #f2f3f5;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
  box-sizing: border-box;
}

.message-video-download:hover {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.message-video-download .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}

.message-video-stage .message-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: contain;
  background: #000;
  outline: none;
}

.message-video-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 10px 10px 12px;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-radius: 0;
  transition: opacity 0.22s ease;
  opacity: 1;
  pointer-events: auto;
}

.message-video-wrap.message-video-ui-hidden .message-video-bar {
  opacity: 0;
  pointer-events: none;
}

/* Tik video (ne MP3): parsisiuntimas – rodomas užvedus ant grotuvo, paslėptas ant valdymo juostos; juosta virš ikonos (garsas). */
.message-video-wrap:not(.message-audio-only) .message-video-bar {
  z-index: 6;
}

.message-video-wrap:not(.message-audio-only) .message-video-stage .message-video-download {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.message-video-wrap:not(.message-audio-only):hover .message-video-stage .message-video-download,
.message-video-wrap:not(.message-audio-only):focus-within .message-video-stage .message-video-download {
  opacity: 1;
  pointer-events: auto;
}
/* Galerijoje trynimas – sesuo viršuje dešinėje; užvedus ant jo .message-video-wrap nebėra :hover */
.message-image-gallery-cell:hover
  .message-video-wrap:not(.message-audio-only)
  .message-video-stage
  .message-video-download,
.message-image-gallery-cell:focus-within
  .message-video-wrap:not(.message-audio-only)
  .message-video-stage
  .message-video-download {
  opacity: 1;
  pointer-events: auto;
}
.message-video-wrap:not(.message-audio-only):hover:has(.message-video-bar:hover) .message-video-stage .message-video-download,
.message-video-wrap:not(.message-audio-only):focus-within:has(.message-video-bar:hover) .message-video-stage .message-video-download,
.message-video-wrap:not(.message-audio-only):focus-within:has(.message-video-bar:focus-within) .message-video-stage .message-video-download {
  opacity: 0;
  pointer-events: none;
}

.message-video-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #f2f3f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-video-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.message-video-btn .material-symbols-outlined {
  font-size: 27px;
  /* FILL 1 – užpildytos ikonos (play / pause / garsas / fullscreen), ne tik kontūras */
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.88));
}

.message-video-time {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: #f2f3f5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.65);
  min-width: 5.5em;
}

/* Laiko juosta: tik akcento spalva – be custom ::-webkit/::-moz (stabilesnis numatytas piešinys) */
.message-video-seek-wrap {
  position: relative;
  flex: 1 1 120px;
  min-width: 60px;
  display: flex;
  align-items: center;
  align-self: center;
}

.message-video-seek {
  width: 100%;
  min-width: 0;
  cursor: pointer;
  accent-color: var(--accent, #00c853);
}

/* Užvedus / tempiant – laikas virš slankiklio (JS: .message-video-seek-hint--visible) */
.message-video-seek-hint {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  transform: translateX(-50%);
  padding: 3px 7px;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: #f8f8f2;
  background: rgba(0, 0, 0, 0.88);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
  z-index: 8;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.08s ease;
}

.message-video-seek-hint.message-video-seek-hint--visible {
  opacity: 1;
  visibility: visible;
}

/* Garsas: ikona + vertikalus range; užvedus – JS klasė; be pseudo perdengimų */
.message-video-vol-stack {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  z-index: 4;
  /* platesnis nematomas hit testas – pelė nenutraukia hover tarp ikonos ir slankiklio */
  padding: 8px 6px 2px;
  margin: -8px -6px -2px;
}

.message-video-vol-pop {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 100px;
  padding: 4px 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0.14s ease;
  pointer-events: none;
}

.message-video-vol-rot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  transform: rotate(-90deg);
  transform-origin: center center;
}

.message-video-vol-stack:hover .message-video-vol-pop,
.message-video-vol-stack.message-video-vol-hover .message-video-vol-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.message-video-vol-pop .message-video-volume {
  display: block;
  width: 92px;
  height: 6px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: var(--accent, #00c853);
  flex-shrink: 0;
}

.message-video-wrap:fullscreen {
  max-height: none;
  height: 100vh;
  width: 100vw;
  border-radius: 0;
  /* Mažiau perpiešimo už pilno ekrano ribų (WebView / Tauri). */
  contain: layout paint;
}

.message-video-wrap:fullscreen .message-video-stage {
  flex: 1;
}

.message-video-wrap:fullscreen .message-video-bar {
  transition: none;
}

.message-video-wrap:fullscreen .message-video-stage .message-video {
  transform: translateZ(0);
}

/* Audio priedas: antraštė (MP3 + pavadinimas + parsisiuntimas) + ta pati valdymo juosta be pilno ekrano */
.message-video-wrap.message-audio-only {
  display: block;
  height: auto;
  max-height: none;
  min-height: 132px;
  padding-top: 0;
}

.message-video-wrap.message-audio-only .message-audio {
  position: absolute;
  left: -9999px;
  width: 4px;
  height: 4px;
  opacity: 0;
  pointer-events: none;
}

.message-audio-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 48px 10px 12px;
  min-height: 48px;
  box-sizing: border-box;
}

.message-audio-icon-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
}

.message-audio-file-icon {
  font-size: 34px;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 40;
  line-height: 1;
}

.message-audio-meta {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.message-audio-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent, #00c853);
  line-height: 1.35;
  word-break: break-word;
}

.message-audio-size {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 400;
  color: #949ba4;
  line-height: 1.3;
}

.message-audio-size--pending:empty {
  display: none;
}

/* Archyvai (zip, rar, …) žinutėje – kortelė kaip garsas, be grotuvo: ikona + pavadinimas + dydis */
.message-attach-archive-card {
  display: block;
  margin-top: 6px;
  width: 100%;
  max-width: min(100%, 520px);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  box-sizing: border-box;
}
.message-attach-archive-card-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 4px 8px 10px;
  min-height: 52px;
  box-sizing: border-box;
}
.message-attach-archive-card-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}
.message-attach-archive-card-ico-img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  pointer-events: none;
  border: 0;
}
.message-attach-archive-card-meta {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.message-attach-archive-card-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent, #00c853);
  line-height: 1.35;
  word-break: break-word;
}
.message-attach-archive-card-size {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 400;
  color: #949ba4;
  line-height: 1.3;
}
.message-attach-archive-card-size--pending:empty {
  display: none;
}
/* Parsisiuntimas + trynimas vienoje eilutėje dešinėje; rodoma užvedus ant kortelės */
.message-attach-archive-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-left: auto;
  padding-top: 0;
  /* Sulygiuoti su .txt / PDF overlay (top: 4px): head turi padding-top 6px → -2px čia ≈ 4px nuo kortelės vidaus. */
  margin-top: -2px;
  opacity: 0;
  /* Konteineris fiksuoja pelės zoną (kitaip pointer-events: none leidžia praeiti kiaurai ir kortelė praranda :hover). */
  pointer-events: auto;
  transition: opacity 0.15s ease;
}
.message-attach-archive-card:not(:hover):not(:focus-within) .message-attach-archive-card-actions a,
.message-attach-archive-card:not(:hover):not(:focus-within) .message-attach-archive-card-actions button {
  pointer-events: none;
}
.message-attach-archive-card:hover .message-attach-archive-card-actions,
.message-attach-archive-card:focus-within .message-attach-archive-card-actions {
  opacity: 1;
}
.message-attach-archive-card:hover .message-attach-archive-card-actions a,
.message-attach-archive-card:hover .message-attach-archive-card-actions button,
.message-attach-archive-card:focus-within .message-attach-archive-card-actions a,
.message-attach-archive-card:focus-within .message-attach-archive-card-actions button {
  pointer-events: auto;
}
@media (hover: none) {
  .message-attach-archive-card .message-attach-archive-card-actions {
    opacity: 1;
  }
  .message-attach-archive-card .message-attach-archive-card-actions a,
  .message-attach-archive-card .message-attach-archive-card-actions button {
    pointer-events: auto;
  }
}
.message-attach-archive-card-actions .message-video-download.message-attach-archive-card-dl {
  position: static;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  flex-shrink: 0;
}
.message-attach-archive-card-actions .message-attach-archive-card-dl:hover {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}
.message-attach-archive-card .message-image-gallery-delete-btn {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: none;
}
.message-image-gallery[data-gallery-own-editable='1'] .message-attach-archive-card .message-image-gallery-delete-btn {
  display: inline-flex;
}

.message-text-attach-actions .message-image-gallery-delete-btn,
.message-pdf-attach-actions .message-image-gallery-delete-btn {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: none;
  z-index: auto;
}
.message-text-attach-actions--overlay .message-image-gallery-delete-btn,
.message-pdf-attach-actions--overlay .message-image-gallery-delete-btn {
  width: 36px;
  height: 36px;
}
.message-image-gallery[data-gallery-own-editable='1'] .message-text-attach-actions .message-image-gallery-delete-btn,
.message-image-gallery[data-gallery-own-editable='1'] .message-pdf-attach-actions .message-image-gallery-delete-btn {
  display: inline-flex;
}

.message-audio-head .message-video-download.message-audio-download-corner {
  position: absolute;
  top: 4px;
  right: 4px;
}

/* Parsisiuntimas: rodomas tik užvedus ant grotuvo kortelės; paslėptas užvedus ant valdymo juostos (garsas ir kt. neužsikerta). */
.message-video-wrap.message-audio-only .message-audio-head .message-video-download.message-audio-download-corner {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.message-video-wrap.message-audio-only:hover .message-audio-head .message-video-download.message-audio-download-corner,
.message-video-wrap.message-audio-only:focus-within .message-audio-head .message-video-download.message-audio-download-corner {
  opacity: 1;
  pointer-events: auto;
}
.message-image-gallery-cell:hover
  .message-video-wrap.message-audio-only
  .message-audio-head
  .message-video-download.message-audio-download-corner,
.message-image-gallery-cell:focus-within
  .message-video-wrap.message-audio-only
  .message-audio-head
  .message-video-download.message-audio-download-corner {
  opacity: 1;
  pointer-events: auto;
}
.message-video-wrap.message-audio-only:hover:has(.message-video-bar:hover)
  .message-audio-head
  .message-video-download.message-audio-download-corner,
.message-video-wrap.message-audio-only:focus-within:has(.message-video-bar:hover)
  .message-audio-head
  .message-video-download.message-audio-download-corner,
.message-video-wrap.message-audio-only:focus-within:has(.message-video-bar:focus-within)
  .message-audio-head
  .message-video-download.message-audio-download-corner {
  opacity: 0;
  pointer-events: none;
}

@media (hover: none) {
  .message-video-wrap:not(.message-audio-only) .message-video-stage .message-video-download {
    opacity: 1;
    pointer-events: auto;
  }
  .message-video-wrap.message-audio-only .message-audio-head .message-video-download.message-audio-download-corner {
    opacity: 1;
    pointer-events: auto;
  }
}

.message-video-wrap.message-audio-only .message-video-bar.message-audio-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* Virš parsisiuntimo (globalus .message-video-download turi z-index: 5), kad vertikalus garsas nebūtų po ikona. */
  z-index: 6;
  align-items: center;
  flex-wrap: nowrap;
  padding-top: 8px;
  padding-bottom: 10px;
}
.message-video-wrap.message-audio-only .message-video-bar.message-audio-bar .message-video-seek {
  margin: 0;
  align-self: center;
  height: 32px;
  box-sizing: border-box;
}
.message-video-wrap.message-audio-only .message-video-bar.message-audio-bar .message-video-time {
  display: flex;
  align-items: center;
  height: 32px;
  margin: 0;
  line-height: 1.2;
}
.message-video-wrap.message-audio-only .message-video-bar.message-audio-bar .message-video-vol-stack {
  padding: 0 4px;
  margin: 0 -4px;
  align-self: center;
}

/* Muzikos grotuve juosta visada matoma – net jei klasė būtų likusi iš kodo */
.message-video-wrap.message-audio-only.message-video-ui-hidden .message-video-bar {
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.message-file-link {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--accent, #00c853);
  text-decoration: none;
}

.message-file-link:hover {
  background: rgba(255,255,255,0.12);
}

.message-file-link-below {
  margin-top: 8px;
}

/* Teksto priedas žinutėje (Discord stilius) */
.message-text-attach {
  margin-top: 8px;
  max-width: min(100%, 560px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  overflow-anchor: none;
}

/* Išskleidus plotis lieka toks pat kaip suskleistai (tik aukštis didėja). */

/* Numatyta: tik kelios eilutės, be slankiklio (Discord „peek“). Išskleidus – .message-text-attach-expanded */
.message-text-attach-body {
  position: relative;
  overflow: hidden;
  transition: max-height 0.22s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .message-text-attach-body {
    transition: none;
  }
}

.message-text-attach:not(.message-text-attach-expanded) .message-text-attach-body {
  max-height: 84px;
}

.message-text-attach.message-text-attach-expanded .message-text-attach-body {
  max-height: min(44vh, 380px);
  overflow-x: hidden;
  overflow-y: auto;
}

.message-text-attach-pre {
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.4;
  /* Aiškus monospaced stack (ne ui-monospace – WebView gali parinkti „platų“ šriftą) */
  font-family: Consolas, 'Courier New', Courier, monospace;
  letter-spacing: normal;
  word-spacing: normal;
  font-kerning: none;
  color: var(--text, #dcddde);
  background: transparent;
}

.message-text-attach-body:has(.message-text-attach-actions--overlay) .message-text-attach-pre {
  padding-right: 100px;
}

.message-text-attach-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 5px 8px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.message-text-attach-collapse {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim, #b5bac1);
  cursor: pointer;
}

.message-text-attach-collapse:hover {
  background: rgba(255, 255, 255, 0.1);
}

.message-text-attach-collapse .message-attach-collapse-ico {
  font-size: 20px;
  line-height: 1;
}

.message-text-attach-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.message-text-attach-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #f2f3f5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.message-text-attach-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  flex-shrink: 0;
  padding: 0;
}

.message-text-attach-actions--overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 6;
  pointer-events: auto;
}

.message-text-attach-actions--overlay .message-text-attach-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #f2f3f5;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.message-text-attach:hover .message-text-attach-actions--overlay .message-text-attach-dl,
.message-text-attach:focus-within .message-text-attach-actions--overlay .message-text-attach-dl {
  opacity: 1;
  pointer-events: auto;
}

.message-text-attach-actions--overlay .message-text-attach-dl:hover {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.message-text-attach-actions--overlay .message-text-attach-dl .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}

@media (hover: none) {
  .message-text-attach .message-text-attach-actions--overlay .message-text-attach-dl {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Teksto failo modalas */
#text-file-preview-modal.modal-overlay {
  z-index: 12000;
  padding: 16px;
}

.text-file-preview-chrome {
  display: flex;
  flex-direction: column;
  width: min(96vw, 1040px);
  height: min(94vh, 900px);
  max-height: 94vh;
  border-radius: 10px;
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.text-file-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #2b2d31;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.text-file-preview-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f2f3f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-file-preview-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.text-file-preview-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  color: var(--accent, #00c853);
  text-decoration: none;
  flex-shrink: 0;
}

.text-file-preview-dl:hover {
  text-decoration: none;
  background: rgba(0, 200, 83, 0.14);
  color: #4caf50;
}

.text-file-preview-dl .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}

#text-file-preview-modal .image-preview-close {
  position: static;
  width: 32px;
  height: 32px;
}

.text-file-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  max-height: none;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
  font-family: Consolas, 'Courier New', Courier, monospace;
  letter-spacing: normal;
  word-spacing: normal;
  font-kerning: none;
  color: #dbdee1;
  background: #1e1f22;
}

.staged-text-doc-svg,
.staged-discord-doc-svg {
  display: block;
  margin: auto;
  max-width: min(94%, 176px);
  height: auto;
}

.staged-attach-thumb-wrap.staged-attach-video-preview .staged-attach-video-frame,
.staged-attach-thumb-wrap.staged-attach-video-preview .staged-attach-video-live-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.staged-attach-thumb-wrap.staged-attach-audio-cover-wrap .staged-attach-audio-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.staged-attach-video-live-preview {
  pointer-events: none;
  background: #0a0a0c;
}

.staged-attach-video-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
}

.staged-attach-video-play-badge .material-symbols-outlined {
  font-size: clamp(2.5rem, 10vw, 3.75rem);
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
  line-height: 1;
}

.staged-attach-thumb-wrap .staged-attach-type-icon {
  font-size: clamp(3.25rem, 11vw, 4.75rem);
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48;
  color: rgba(165, 180, 252, 0.95);
  user-select: none;
  pointer-events: none;
}

.staged-attach-nonimg--audio .staged-attach-type-icon {
  color: #c4b5fd;
}

.staged-attach-nonimg--video .staged-attach-type-icon {
  color: #93c5fd;
}

.staged-attach-video-fallback-icon {
  font-size: clamp(3.5rem, 14vw, 5.25rem);
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48;
  color: #7dd3fc;
  opacity: 0.95;
  user-select: none;
  pointer-events: none;
}

.staged-attach-nonimg--pdf .staged-attach-type-icon {
  color: #f87171;
}

.message-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.message-file-link-icon {
  flex-shrink: 0;
  font-size: 1.35rem;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  opacity: 0.9;
}

.message-file-link-text {
  min-width: 0;
  word-break: break-word;
}

/* PDF priedas žinutėje – iframe „peek“, kaip tekstas; didinimas – modale */
.message-pdf-attach {
  margin-top: 8px;
  max-width: min(100%, 560px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  overflow-anchor: none;
}

.message-pdf-attach-body {
  position: relative;
  overflow: hidden;
  transition: max-height 0.22s ease-out;
  background: #1e1f22;
}

@media (prefers-reduced-motion: reduce) {
  .message-pdf-attach-body {
    transition: none;
  }
}

.message-pdf-attach:not(.message-pdf-attach-expanded) .message-pdf-attach-body {
  max-height: 200px;
}

.message-pdf-attach.message-pdf-attach-expanded .message-pdf-attach-body {
  max-height: min(44vh, 400px);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Slankiklis piešiamas iframe viduje – iškerpame dešinį kraštą (be „juodos juostos“ overlay). */
.message-pdf-attach-iframe-clip {
  display: block;
  width: 100%;
  overflow: hidden;
}

.message-pdf-attach:not(.message-pdf-attach-expanded) .message-pdf-attach-iframe-clip {
  height: 200px;
}

.message-pdf-attach.message-pdf-attach-expanded .message-pdf-attach-iframe-clip {
  overflow: visible;
}

.message-pdf-attach-iframe {
  display: block;
  border: 0;
  background: #2b2d31;
}

.message-pdf-attach:not(.message-pdf-attach-expanded) .message-pdf-attach-iframe {
  height: 200px;
  width: calc(100% + 28px);
  max-width: none;
  margin-right: -28px;
  /* Ratukas slenka pokalbį, ne PDF vidų */
  pointer-events: none;
}

.message-pdf-attach.message-pdf-attach-expanded .message-pdf-attach-iframe {
  width: 100%;
  max-width: 100%;
  margin-right: 0;
  height: min(44vh, 400px);
  pointer-events: auto;
}

.message-pdf-attach-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 5px 8px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.message-pdf-attach-bar .message-pdf-attach-expand--bar,
.message-text-attach-bar .message-text-attach-expand--bar {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim, #b5bac1);
  cursor: pointer;
  box-sizing: border-box;
}

.message-pdf-attach-bar .message-pdf-attach-expand--bar:hover,
.message-text-attach-bar .message-text-attach-expand--bar:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.message-pdf-attach-bar .message-pdf-attach-expand--bar .material-symbols-outlined,
.message-text-attach-bar .message-text-attach-expand--bar .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.message-pdf-attach-collapse {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim, #b5bac1);
  cursor: pointer;
}

.message-pdf-attach-collapse:hover {
  background: rgba(255, 255, 255, 0.1);
}

.message-pdf-attach-collapse .message-attach-collapse-ico {
  font-size: 20px;
  line-height: 1;
}

/* Suskleista: į dešinę (link failo vardo). Išskleista: į viršų (suskleisti). */
.message-text-attach-expanded .message-text-attach-collapse .message-attach-collapse-ico-more,
.message-pdf-attach-expanded .message-pdf-attach-collapse .message-attach-collapse-ico-more {
  display: none;
}

.message-text-attach:not(.message-text-attach-expanded) .message-text-attach-collapse .message-attach-collapse-ico-less,
.message-pdf-attach:not(.message-pdf-attach-expanded) .message-pdf-attach-collapse .message-attach-collapse-ico-less {
  display: none;
}

.message-pdf-attach-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.message-pdf-attach-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #f2f3f5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.message-pdf-attach-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  flex-shrink: 0;
  padding: 0;
}

.message-pdf-attach-actions--overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 6;
  pointer-events: auto;
}

.message-pdf-attach-actions--overlay .message-pdf-attach-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #f2f3f5;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.message-pdf-attach:hover .message-pdf-attach-actions--overlay .message-pdf-attach-dl,
.message-pdf-attach:focus-within .message-pdf-attach-actions--overlay .message-pdf-attach-dl {
  opacity: 1;
  pointer-events: auto;
}

.message-pdf-attach-actions--overlay .message-pdf-attach-dl:hover {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.message-pdf-attach-actions--overlay .message-pdf-attach-dl .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}

@media (hover: none) {
  .message-pdf-attach .message-pdf-attach-actions--overlay .message-pdf-attach-dl {
    opacity: 1;
    pointer-events: auto;
  }
}

/* PDF modalas */
#pdf-file-preview-modal.modal-overlay {
  z-index: 12000;
  padding: 16px;
}

.pdf-file-preview-chrome {
  display: flex;
  flex-direction: column;
  width: min(96vw, 1040px);
  height: min(94vh, 900px);
  max-height: 94vh;
  border-radius: 10px;
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  position: relative;
  isolation: isolate;
}

.pdf-file-preview-frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #121314;
  overflow: hidden;
}

/* Ne „position: absolute“ – WebView2/Chromium PDF paieškos juosta kitaip lipa prie lango kampo, ne prie iframe. */
.pdf-file-preview-frame {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border: 0;
  border-radius: 0 0 10px 10px;
}

#pdf-file-preview-modal .image-preview-close {
  position: static;
  width: 32px;
  height: 32px;
}

.message-file-fallback {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  max-width: 200px;
}

.message-file-fallback span {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Nuotraukos peržiūros modalas – display valdo .modal-overlay.visible */
#image-preview-modal {
  padding: 0;
  overflow: hidden;
  background: #000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
.image-preview-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}
/* Kelių nuotraukų galerija pilnoje peržiūroje */
.image-preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1003;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, opacity 0.15s ease;
}
.image-preview-nav:hover:not(:disabled) {
  background: rgba(40, 40, 40, 0.85);
}
.image-preview-nav:disabled {
  opacity: 0.28;
  cursor: default;
}
.image-preview-nav .material-symbols-outlined {
  font-size: 32px;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
.image-preview-nav--prev {
  left: 12px;
}
.image-preview-nav--next {
  right: 12px;
}
.image-preview-thumbs {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 1003;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: min(92vw, 720px);
  padding: 8px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 10px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.image-preview-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.75;
  transition: border-color 0.12s ease, opacity 0.12s ease;
}
.image-preview-thumb:hover {
  opacity: 1;
}
.image-preview-thumb.is-active {
  border-color: var(--accent, #5865f2);
  opacity: 1;
}
.image-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
#image-preview-modal.image-preview-modal--draft .image-preview-nav,
#image-preview-modal.image-preview-modal--draft .image-preview-thumbs {
  display: none !important;
}
.image-preview-container {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 90vw;
  max-height: 90vh;
  cursor: zoom-in;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview-container.zoomed {
  transform-origin: center center;
}
.image-preview-container.zoomed.draggable {
  cursor: zoom-out;
}
.image-preview-container.zoomed.draggable:active {
  cursor: grabbing;
}
.image-preview-container.zoomed:not(.draggable) {
  cursor: zoom-out;
}
.image-preview-img {
  max-width: 90vw;
  max-height: 90vh;
  display: block;
  cursor: zoom-in;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.image-preview-container.zoomed.draggable .image-preview-img {
  cursor: zoom-out;
}
.image-preview-container.zoomed.draggable:active .image-preview-img {
  cursor: grabbing;
}
.image-preview-container.zoomed:not(.draggable) .image-preview-img {
  cursor: zoom-out;
}
.image-preview-toolbar {
  position: fixed;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 1001;
}
.image-preview-toolbar-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview-toolbar-btn:hover {
  background: var(--bg-input);
}
/* Peržiūra iš kompozitoriaus (dar ne išsiųsta) – tik zoom; share/download ir kt. – tik iš pokalbio */
#image-preview-modal.image-preview-modal--draft #image-preview-share,
#image-preview-modal.image-preview-modal--draft #image-preview-download,
#image-preview-modal.image-preview-modal--draft #image-preview-open-new,
#image-preview-modal.image-preview-modal--draft #image-preview-menu-btn {
  display: none !important;
}
#image-preview-modal.image-preview-modal--draft .image-preview-menu {
  display: none !important;
}
.image-preview-toolbar-btn .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
.image-preview-icon-zoom .image-preview-icon-zoom-out {
  display: none;
}
.image-preview-icon-zoom.zoomed .image-preview-icon-zoom-in {
  display: none;
}
.image-preview-icon-zoom.zoomed .image-preview-icon-zoom-out {
  display: inline-block;
}
#image-preview-close.app-close::before {
  display: none;
  content: "";
}
#image-preview-close .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
.image-preview-menu {
  position: fixed;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 220px;
  z-index: 1002;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.image-preview-menu.visible {
  display: block;
}
.image-preview-menu-item {
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.image-preview-menu-item:hover {
  background: var(--bg-input);
}
.image-preview-close {
  position: fixed;
  top: 44px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  z-index: 1001;
}
.image-preview-close:hover {
  background: var(--bg-input);
}

/* Drag & drop overlay – per visą programą, Discord stilius */
.drop-overlay-full {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  border: 4px dashed var(--accent);
}
.drop-overlay-full.hidden { display: none !important; }
.drop-overlay-content {
  text-align: center;
  padding: 24px;
  max-width: min(480px, 94vw);
  margin: 0 auto;
  box-sizing: border-box;
}
.drop-overlay-icons {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.9;
}
.drop-overlay-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.drop-overlay-hint {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.drop-overlay-shift {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.drop-overlay-shift kbd {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}


.message-form {
  flex-shrink: 0;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(to top, var(--bg) 0%, rgba(26, 26, 30, 0.98) 40%, rgba(26, 26, 30, 0.75) 70%, rgba(26, 26, 30, 0.35) 90%, transparent 100%);
}
.message-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
/* Kompozitorius: be išorinio šviesesnio rėmo be priedų; pilkesnis blokas tik virš priedų kortelių */
.message-composer-integrated {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.message-composer-integrated:focus-within {
  outline: none;
  box-shadow: none;
  border: none;
}
.message-composer-integrated .message-form-row {
  width: 100%;
  min-width: 0;
}
/* Priedai matomi – tik šis blokas su --composer-surface (ne visas kompozitoriaus plotis) */
#message-form-staged:not(.hidden),
#friends-chat-staged:not(.hidden) {
  background: var(--composer-surface);
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 10px;
  padding: 8px 10px 10px;
  margin: 0 0 8px 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  border-bottom: none !important;
}
/* Teksto juosta – kaip seniau: pilnas plotis, tamsus fonas */
.message-composer-integrated .message-input-wrap {
  background: var(--bg-input);
  border: none;
  border-radius: 8px;
  padding: 8px 8px 8px 6px;
  width: 100%;
  box-sizing: border-box;
}
.message-composer-integrated .message-input-wrap:focus-within {
  border: none;
  box-shadow: none;
  outline: none;
}
.message-form-staged {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.message-form-staged.hidden { display: none !important; }
.staged-strip-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0 0 8px;
  padding: 0 2px;
}
/* Staged priedai: eilė iš kairės į dešinę, keliauja į naują eilutę kai netelpa */
.staged-cards-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: visible;
  padding-bottom: 4px;
  min-width: 0;
}
.staged-attach-card {
  position: relative;
  flex: 0 0 auto;
  width: min(240px, 72vw);
  max-width: min(280px, 100%);
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.staged-attach-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 8;
  display: flex;
  gap: 2px;
  padding: 3px 5px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  backdrop-filter: blur(4px);
}
.staged-tb-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.staged-tb-btn .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.staged-tb-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.staged-tb-remove-btn {
  color: #f04747;
}
.staged-tb-remove-btn:hover {
  color: #ff6b6b;
}
/* Vienodas preview aukštis: nuotrauka, video, failas – failo vardas overlay apačioje */
.staged-attach-thumb-wrap {
  position: relative;
  width: 100%;
  height: 176px;
  min-height: 176px;
  max-height: 176px;
  flex: 0 0 176px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.staged-attach-file-emoji {
  font-size: 44px;
  opacity: 0.7;
}
.staged-attach-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.staged-attach-thumb-wrap.is-spoiler:not(.revealed) > *:not(.staged-attach-filename):not(.staged-spoiler-chip) {
  filter: blur(22px) brightness(0.45);
}
.staged-attach-thumb-wrap.is-spoiler:not(.revealed) > .staged-attach-thumb {
  transform: scale(1.08);
}
.staged-attach-thumb-wrap.is-spoiler.revealed > *:not(.staged-attach-filename):not(.staged-spoiler-chip) {
  filter: none !important;
  transform: none !important;
}
.staged-attach-thumb-wrap.is-spoiler.revealed .staged-spoiler-chip {
  display: none !important;
}
.staged-spoiler-chip {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 14px 16px;
  border: none;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: clamp(0.8rem, 2.1vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.staged-spoiler-chip:hover {
  background: rgba(0, 0, 0, 0.93);
}
.staged-attach-thumb-wrap > .staged-attach-filename {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  margin: 0;
  padding: 5px 8px 6px;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 45%, transparent 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 0 0 9px 9px;
  pointer-events: none;
}

/* Modal: priedo redagavimas */
.modal.modal-attachment-edit {
  max-width: 480px;
  width: min(480px, 94vw);
  box-sizing: border-box;
  text-align: left;
}
.modal-attachment-edit h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.attachment-edit-annotate-hint {
  margin: 0 0 8px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-dim);
}
.attachment-edit-preview-wrap {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 14px;
  max-height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.attachment-edit-preview-wrap img {
  max-height: 120px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0;
  object-fit: contain;
}
.attachment-edit-preview-wrap img.attachment-edit-preview-clickable {
  cursor: zoom-in;
}
.attachment-edit-preview-wrap video.attachment-edit-video-live {
  max-height: 120px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0;
  object-fit: contain;
  background: #0a0a0c;
}
.attachment-edit-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.attachment-edit-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
/* Produkto checkbox (tamsi tema, ne OS baltas kvadratas). HTML: class="gs-checkbox" – žr. .cursor/rules/checkbox-themed-ui.mdc */
input[type='checkbox'].gs-checkbox {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 2px 0 0 0;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  box-sizing: border-box;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
/* Tik nepažymėtiems – `background` trumpinys kitaip nuimtų `:checked` SVG varnelę užvedus pele */
input[type='checkbox'].gs-checkbox:hover:not(:disabled):not(:checked) {
  border-color: var(--text-dim);
  background-color: var(--bg-side);
  background-image: none;
}
input[type='checkbox'].gs-checkbox:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath stroke='%230a0a0c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}
input[type='checkbox'].gs-checkbox:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type='checkbox'].gs-checkbox:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.attachment-edit-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 16px;
  cursor: pointer;
  text-align: left;
}
.attachment-edit-check-text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
  text-align: left;
}
.attachment-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
}
.attachment-edit-actions .btn-cancel,
.attachment-edit-actions .btn-confirm {
  flex: 1;
}
.attachment-edit-actions .btn-confirm:hover {
  filter: brightness(1.08);
}
.attachment-edit-actions .btn-confirm:active {
  filter: brightness(0.95);
}
.modal-attachment-edit .modal-close-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 6px;
}
.modal-attachment-edit .modal-close-x--material {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-attachment-edit .modal-close-x--material::before {
  display: none !important;
  content: none !important;
}
.modal-attachment-edit .modal-close-x--material .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.modal-attachment-edit .modal-close-x:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.modal-attachment-edit {
  position: relative;
}

/* Modal: nuotraukos piešimas prieš siuntimą */
#staged-image-annotate-modal.modal-overlay {
  z-index: 4500;
  align-items: stretch;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.88);
}
.staged-image-annotate-panel {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: calc(100vh - 24px);
  margin: auto;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-sizing: border-box;
  overflow: hidden;
}
.staged-image-annotate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--border);
}
.staged-image-annotate-top h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}
.staged-annotate-close-btn.app-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.staged-annotate-close-btn.app-close::before {
  display: none;
  content: '';
}
.staged-annotate-close-btn .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.staged-annotate-close-btn:hover {
  background: var(--bg-input);
}
.staged-image-annotate-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.staged-annotate-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.staged-annotate-tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  /* spalvą nustato JS pagal pasirinktą šepetėlio spalvą */
  color: var(--text);
  pointer-events: none;
}
.staged-annotate-tool-icon .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.staged-annotate-tb-btn {
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.staged-annotate-tb-btn .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.staged-annotate-tb-btn:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
}
.staged-annotate-tb-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.staged-annotate-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.staged-annotate-swatch {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
}
.staged-annotate-swatch::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: var(--sw, #888);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.staged-annotate-swatch[data-annotate-color='#ffffff']::after {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}
.staged-annotate-swatch:hover {
  border-color: var(--text-dim);
  background: var(--bg-side);
}
.staged-annotate-swatch.active {
  border-color: var(--sw);
  box-shadow: 0 0 0 1px var(--sw);
}
/* Balta / juoda – papildomas kontūras, kad rėmelis būtų matomas ant tamsaus fono */
.staged-annotate-swatch[data-annotate-color='#ffffff'].active {
  box-shadow: 0 0 0 1px var(--sw), 0 0 0 3px rgba(0, 0, 0, 0.5);
}
.staged-annotate-swatch[data-annotate-color='#000000'].active {
  box-shadow: 0 0 0 1px var(--sw), 0 0 0 3px rgba(255, 255, 255, 0.2);
}
.staged-annotate-swatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.staged-annotate-brush-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: auto;
  min-width: 0;
}
/* --slider-percent nustato JS (min–max → %) – žalia „užpildyta“ dalis kaip garsumo slankiklis */
.staged-annotate-brush-slider {
  width: min(160px, 40vw);
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--slider-percent, 0%),
    var(--bg-input) var(--slider-percent, 0%),
    var(--bg-input) 100%
  );
  border-radius: 3px;
  outline: none;
}
.staged-annotate-brush-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: transparent;
}
.staged-annotate-brush-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-side);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}
.staged-annotate-brush-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.staged-annotate-brush-slider::-moz-range-progress {
  height: 6px;
  border-radius: 3px 0 0 3px;
  background: var(--accent);
}
.staged-annotate-brush-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-side);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}
.staged-image-annotate-canvas-wrap {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #050508;
}
.staged-annotate-canvas-stack {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}
.staged-annotate-text-input {
  display: none;
  position: absolute;
  z-index: 3;
  margin: 0;
  padding: 2px 4px;
  min-width: 2.5em;
  min-height: 1.2em;
  max-height: 140px;
  overflow: auto;
  resize: none;
  box-sizing: border-box;
  font-weight: 600;
  font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.25;
  color: inherit;
  background: rgba(8, 8, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  outline: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.staged-annotate-text-input.is-active {
  display: block;
}
.staged-annotate-text-input:focus {
  border-color: var(--accent, #22c55e);
  box-shadow: 0 0 0 1px var(--accent, #22c55e), 0 2px 12px rgba(0, 0, 0, 0.45);
}
#staged-annotate-canvas {
  display: block;
  max-width: 100%;
  touch-action: none;
  cursor: crosshair;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}
.staged-image-annotate-footer {
  flex-shrink: 0;
  padding: 12px 14px 14px !important;
  margin: 0 !important;
  border-top: 1px solid var(--border);
}

/* Išsiųstos žinutės: spoiler */
.message-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-top: 6px;
  border-radius: 8px;
  overflow: hidden;
}
.message-image-wrap.message-image-spoiler:not(.revealed) .message-image {
  filter: blur(24px) brightness(0.5);
  transform: scale(1.05);
}
.message-image-spoiler-reveal {
  position: absolute;
  inset: 0;
  margin: auto;
  height: 32px;
  width: max-content;
  max-width: 92%;
  padding: 0 14px;
  border: none;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 1;
}
.message-image-wrap.revealed .message-image-spoiler-reveal {
  display: none;
}
.message-image-wrap.revealed .message-image {
  filter: none;
  transform: none;
}

/* Kelių nuotraukų galerija vienoje žinutėje */
.message-image-gallery {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  max-width: 520px;
  width: 100%;
}
/* Mišrūs failai (pdf, zip, video, …) – ne tinklelis, o sąrašas: vienas priedas = viena eilutė */
.message-image-gallery.message-image-gallery--attachments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.message-image-gallery.message-image-gallery--attachments-list .message-image-gallery-cell {
  width: 100%;
  max-width: 100%;
}
.message-image-gallery-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
}
.message-image-gallery-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(25, 25, 28, 0.72);
  color: #f04747;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.message-image-gallery[data-gallery-own-editable='1'] .message-image-gallery-delete-btn {
  display: inline-flex;
}
/* Video / garsas: parsisiuntimas ~4px nuo stage + wrap margin; trynimas ant cell – ta pati eilutė (36×36), trynimas kairėn nuo parsisiuntimo. */
.message-image-gallery[data-gallery-own-editable='1']
  .message-image-gallery-cell:has(.message-video-wrap a.message-video-download)
  > .message-image-gallery-delete-btn {
  right: 46px;
  top: 10px;
  width: 36px;
  height: 36px;
}
.message-image-gallery[data-gallery-own-editable='1'] .message-image-gallery-cell:hover .message-image-gallery-delete-btn,
.message-image-gallery[data-gallery-own-editable='1'] .message-image-gallery-cell:focus-within .message-image-gallery-delete-btn {
  opacity: 1;
  pointer-events: auto;
}
/* Video / audio grotuvas: trinti kartu su parsisiuntimu – paslėpti užvedus ant grojimo juostos */
.message-image-gallery[data-gallery-own-editable='1']
  .message-image-gallery-cell:has(.message-video-wrap):hover:has(.message-video-bar:hover)
  .message-image-gallery-delete-btn,
.message-image-gallery[data-gallery-own-editable='1']
  .message-image-gallery-cell:has(.message-video-wrap):focus-within:has(.message-video-bar:hover)
  .message-image-gallery-delete-btn,
.message-image-gallery[data-gallery-own-editable='1']
  .message-image-gallery-cell:has(.message-video-wrap):focus-within:has(.message-video-bar:focus-within)
  .message-image-gallery-delete-btn {
  opacity: 0;
  pointer-events: none;
}
.message-image-gallery-delete-btn:hover {
  background: rgba(240, 71, 71, 0.95);
  color: #fff;
}
.message-image-gallery-delete-btn .material-symbols-outlined {
  font-size: 19px;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.message-image-gallery-cell .message-image-wrap {
  margin-top: 0;
  width: 100%;
  display: block;
}
.message-image-gallery-cell .message-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-height: 280px;
}
.message-image-gallery--2 {
  grid-template-columns: 1fr 1fr;
}
.message-image-gallery--3 {
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.message-image-gallery--3 .message-image-gallery-cell:nth-child(1) {
  grid-row: 1 / span 2;
}
.message-image-gallery--3 .message-image-gallery-cell:nth-child(1) .message-image {
  max-height: 360px;
}
.message-image-gallery--3 .message-image-gallery-cell:nth-child(n + 2) .message-image {
  max-height: 172px;
}
.message-image-gallery--4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.message-image-gallery--4 .message-image-gallery-cell .message-image {
  max-height: 200px;
}
.message-image-gallery--many {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.message-image-gallery--many .message-image-gallery-cell .message-image {
  max-height: 160px;
}

/* + mygtukas – Discord stilius, viduje įvesties juostoje */
.message-input-wrap .attach-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 300;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.message-input-wrap .attach-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.attach-plus {
  line-height: 0;
  display: block;
  transform: translateY(-0.06em);
}

/* Įvesties juosta su emoji ir siuntimo ikona viduje */
.message-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 8px 8px 6px;
  min-width: 0;
  position: relative;
}
/* Viena eilutė – kaip anksčiau (ikonos centre); kelios eilutės – ikonos viršuje (Discord) */
.message-input-wrap.message-input-wrap--multiline {
  align-items: flex-start;
}
.message-input-wrap--multiline .message-composer-textarea {
  padding-bottom: 1.45rem;
}
.message-input-wrap:focus-within {
  border-color: var(--accent);
}

.composer-char-remaining {
  display: none;
  position: absolute;
  right: 10px;
  bottom: 7px;
  z-index: 2;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--text-dim);
  pointer-events: none;
  user-select: none;
  max-width: 42%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-input-wrap.message-input-wrap--multiline .composer-char-remaining {
  display: block;
}
.composer-char-remaining.composer-char-remaining-warn {
  color: #fbbf24;
}
.composer-char-remaining.composer-char-remaining-limit {
  color: #fb923c;
  font-weight: 600;
}

#message-input.message-composer-textarea,
#friends-chat-input.message-composer-textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: none;
  border: none;
  padding: 10px 4px;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.35;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#message-input.message-composer-textarea:focus,
#friends-chat-input.message-composer-textarea:focus {
  outline: none;
}

#message-input.message-composer-textarea::placeholder,
#friends-chat-input.message-composer-textarea::placeholder {
  color: var(--text-dim);
}

.input-bar-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.input-bar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.send-icon-btn { color: var(--text); }
.send-icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.send-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: inherit;
}
.send-icon svg {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

@keyframes composer-emoji-wiggle-once {
  0% {
    transform: scale(1) rotate(0deg);
  }
  14% {
    transform: scale(1.22) rotate(-12deg);
  }
  32% {
    transform: scale(1.26) rotate(11deg);
  }
  50% {
    transform: scale(1.18) rotate(-8deg);
  }
  68% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* GIF ir lipdukai – balta „filled“ ikona; hover – didėja ir sukasi (kaip emoji); be title – tik aria */
.message-input-wrap .gif-btn,
.message-input-wrap .sticker-btn {
  color: #fff;
}
.message-input-wrap .gif-btn:hover,
.message-input-wrap .sticker-btn:hover {
  color: #fff;
}
.message-input-wrap .gif-btn .gif-btn-icon.material-symbols-outlined,
.message-input-wrap .sticker-btn .sticker-btn-icon.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-size: 22px;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  font-feature-settings: 'liga' 1;
  -webkit-font-smoothing: antialiased;
  color: #fff;
  display: inline-block;
  transform-origin: 50% 55%;
}
.message-input-wrap .gif-btn:hover .gif-btn-icon.material-symbols-outlined,
.message-input-wrap .gif-btn:focus-visible .gif-btn-icon.material-symbols-outlined,
.message-input-wrap .sticker-btn:hover .sticker-btn-icon.material-symbols-outlined,
.message-input-wrap .sticker-btn:focus-visible .sticker-btn-icon.material-symbols-outlined {
  animation: composer-emoji-wiggle-once 1s ease-in-out forwards;
}

/* Tik pats emoji juda ~1 s; mygtuko dėžutė ir juosta lieka vietoje */
.message-input-wrap .emoji-btn {
  overflow: visible;
}
.message-input-wrap .emoji-btn-char {
  display: inline-block;
  transform-origin: 50% 55%;
  line-height: 1;
}
.message-input-wrap .emoji-btn:hover .emoji-btn-char {
  animation: composer-emoji-wiggle-once 1s ease-in-out forwards;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.visible { display: flex; }

/* Žinutės trynimas – virš kontekstinio meniu (z-index 2000) */
#delete-message-modal.modal-overlay {
  z-index: 3200;
}

#translator-privacy-modal.modal-overlay {
  z-index: 3200;
}

.modal-translator-privacy .translator-privacy-body {
  margin: 0 0 12px 0;
  line-height: 1.45;
}

.translator-privacy-dont-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.translator-privacy-dont-row input.gs-checkbox {
  margin-top: 3px;
  flex-shrink: 0;
}

/* AI vertimo privatumas – modulio pavadinimas kaip kitur (var(--accent)); turinys, žyma, mygtukai, uždarymas – baltas. */
.modal.modal-confirm-dialog.modal-translator-privacy .translator-privacy-body,
.modal.modal-confirm-dialog.modal-translator-privacy .translator-privacy-dont-row,
.modal.modal-confirm-dialog.modal-translator-privacy .translator-privacy-dont-row span {
  color: #fff;
}
#translator-privacy-modal .modal-translator-privacy .modal-close {
  color: #fff;
}
#translator-privacy-modal .modal-translator-privacy .modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.modal.modal-confirm-dialog.modal-translator-privacy .modal-actions .btn-cancel {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}
.modal.modal-confirm-dialog.modal-translator-privacy .modal-actions .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}
.modal.modal-confirm-dialog.modal-translator-privacy .modal-actions .btn-confirm {
  color: #fff;
}
.modal.modal-confirm-dialog.modal-translator-privacy .modal-actions .btn-confirm:hover {
  filter: brightness(1.08);
  color: #fff;
}

.modal-confirm-dialog .modal-actions .btn-confirm {
  flex: 1;
  min-width: 120px;
  max-width: 160px;
  font-size: 0.95rem;
}

/*
 * Standartiniai patvirtinimo dialogai (žinutės trynimas, draugo šalinimas, …).
 * Nauji panašūs modalai: class="modal modal-confirm-dialog" + modal-confirm-dialog-header + modal-actions (btn-cancel + btn-remove-friend).
 */
.modal.modal-confirm-dialog {
  max-width: 480px;
  width: min(480px, 94vw);
  font-size: 14px;
  box-sizing: border-box;
}

.modal-confirm-dialog-header {
  position: relative;
  margin-bottom: 12px;
}

.modal.modal-confirm-dialog .modal-confirm-dialog-header h3 {
  margin: 0 0 0 0;
  padding: 0 36px;
  text-align: center;
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 600;
}

.modal-confirm-dialog-header .modal-close {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.modal-confirm-dialog .modal-actions {
  justify-content: center;
  gap: 12px;
}

.modal-confirm-dialog .modal-actions .btn-cancel,
.modal-confirm-dialog .modal-actions .btn-remove-friend {
  flex: 1;
  min-width: 120px;
  max-width: 160px;
  font-size: 0.95rem;
}

#delete-image-modal .modal-hint {
  color: #f2f3f5;
  margin: 16px 0 32px 0;
}

.modal-delete-message {
  display: flex;
  flex-direction: column;
  max-height: min(85vh, 640px);
}

.modal-delete-message-lead {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.delete-message-preview-scroll {
  --delete-preview-media-max-h: min(260px, 38vh);
  flex: 1;
  min-height: 72px;
  max-height: min(360px, 45vh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.delete-message-preview {
  pointer-events: none;
  max-width: 100%;
  min-width: 0;
}

.delete-message-preview .message.delete-message-preview-msg {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

.delete-message-preview .message-content {
  max-width: 100%;
  min-width: 0;
}

/* Nuotraukos / spoiler – proporcingai tilptų be vertikalaus slankiklio dėl didelio aukščio */
.delete-message-preview .message-image {
  max-width: 100% !important;
  max-height: var(--delete-preview-media-max-h, min(260px, 38vh)) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  margin-top: 4px;
}

.delete-message-preview .message-image-wrap {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.delete-message-preview .message-image-wrap .message-image {
  margin-top: 0;
}

/*
 * Video trynimo peržiūroje: tas pats grotuvas kaip chate, tik sumažintas (zoom / transform),
 * be atskirų height perrašymų – kitaip išsibarsto valdikliai ant video.
 */
.delete-message-preview-video-scale {
  width: 100%;
  max-width: 100%;
  max-height: min(280px, 40vh);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 4px;
  box-sizing: border-box;
}

.delete-message-preview-video-scale .message-video-wrap:not(.message-audio-only) {
  margin-top: 0;
  flex-shrink: 0;
  transform: scale(0.76);
  transform-origin: top center;
}

/* Chromium / WebView2: zoom sumažina ir išdėstymo dėžę – valdikliai lieka vienoje juostoje */
@supports (zoom: 1) {
  .delete-message-preview-video-scale .message-video-wrap:not(.message-audio-only) {
    transform: none;
    zoom: 0.76;
  }
}

/* Audio: kaip chate – min aukštas ir auto aukštis, kad absoliuti juosta neužliptų ant antraštės */
.delete-message-preview .message-video-wrap.message-audio-only {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  min-height: 132px !important;
  margin-top: 4px;
  display: block !important;
}
.delete-message-preview .message-video-wrap.message-audio-only .message-audio-head {
  min-width: 0;
}
.delete-message-preview .message-video-wrap.message-audio-only .message-audio-title {
  font-size: 0.82rem;
}
.delete-message-preview .message-video-wrap.message-audio-only .message-audio-icon-wrap {
  width: 44px;
  height: 44px;
}
.delete-message-preview .message-video-wrap.message-audio-only .message-audio-file-icon {
  font-size: 28px;
}

.delete-message-preview .message-pdf-attach,
.delete-message-preview .message-text-attach {
  max-width: 100%;
  box-sizing: border-box;
}

.delete-message-preview .message-text-attach-body {
  max-height: var(--delete-preview-media-max-h, min(260px, 38vh));
  overflow: auto;
}

.delete-message-preview .message-pdf-attach-body {
  max-height: var(--delete-preview-media-max-h, min(260px, 38vh));
  overflow: hidden;
}

.delete-message-preview .message-pdf-attach-iframe-clip {
  max-height: var(--delete-preview-media-max-h, min(260px, 38vh));
  overflow: hidden;
}

.delete-message-preview .message-pdf-attach-iframe {
  height: min(260px, 38vh);
  width: calc(100% + 28px);
  max-width: none;
  margin-right: -28px;
  pointer-events: none;
}

.delete-message-preview .message-text-attach-pre {
  max-height: none;
}

/* Pranešti apie žinutę – pirmas žingsnis (kategorijos) */
.modal.modal-report-message {
  width: min(480px, 94vw);
  max-width: 480px;
  box-sizing: border-box;
  padding: 0 0 16px 0;
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.modal-report-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  padding: 16px 20px 14px 20px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.modal-report-message-header h3 {
  margin: 0;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-align: left;
}
.modal-report-message-lead {
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.modal-report-preview-label {
  margin: 0 20px 8px 20px;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
}
.report-message-preview-scroll {
  margin: 0 20px 14px 20px;
  max-height: min(220px, 32vh);
}
.modal-report-categories {
  list-style: none;
  margin: 0;
  padding: 0 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.modal-report-categories li {
  margin: 0;
  padding: 0;
}
.modal-report-cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px 0;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.modal-report-cat-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
}
.modal-report-cat-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.modal-report-cat-chevron {
  flex-shrink: 0;
  font-size: 1.35rem;
  width: 1.35rem;
  height: 1.35rem;
  opacity: 0.65;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.modal-delete-message-tip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 16px 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.modal-delete-message-tip kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.78rem;
  font-family: inherit;
}

.modal-delete-tip-label {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.modal-delete-tip-body {
  width: 100%;
  max-width: 100%;
}

/* Virš nuotraukų peržiūros (.modal-overlay taip pat z-index 1000) ir drag-drop overlay */
#settings-modal.modal-overlay {
  z-index: 12000;
}

/* Virš auth ekrano – sėkmės žingsnis po „Pamiršai slaptažodį?“ */
#forgot-password-sent-modal.modal-overlay {
  z-index: 5600;
}

/* Dydis ir išdėstymas – žr. .modal.modal-forgot-sent po bazės .modal */

.modal-forgot-sent {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  box-sizing: border-box;
}

.modal-forgot-sent-header {
  flex-shrink: 0;
  padding: 0 40px 0 0;
}

.modal-forgot-sent-header .modal-close {
  position: absolute;
  top: 6px;
  right: 4px;
}

.modal-forgot-sent-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  overflow: visible;
  word-wrap: break-word;
}

.modal-forgot-sent h3.modal-forgot-sent-title {
  color: var(--text);
  text-align: left;
  margin-bottom: 0;
}

.modal-forgot-sent-body {
  flex: 1;
  margin: 12px 0 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-dim);
}

/* .modal-hint turi margin-top: -8px – čia ne traukti prie antraštės */
.modal-forgot-sent .modal-hint.modal-forgot-sent-body {
  margin: 20px 0 0 0;
}

.btn-forgot-sent-ok {
  display: block;
  width: 100%;
  flex-shrink: 0;
  margin-top: auto;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
}

.btn-forgot-sent-ok:hover {
  filter: brightness(1.1);
}

.btn-forgot-sent-ok:active {
  filter: brightness(0.95);
}

#avatar-edit-modal.visible {
  /* Virš serverio nustatymų (12100) ir DM/serverio modalų – kad redaktorius
     iškilęs „ant viršaus", o ne dingęs už nustatymų lango. */
  z-index: 12200;
}

/* Nustatymų modalas – Discord-stilius, dydis fiksuotas (be rankinio resize) */
.settings-modal {
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: min(1280px, 96vw);
  max-width: min(1280px, 96vw);
  height: min(880px, 94vh);
  min-width: 360px;
  min-height: 280px;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  position: relative;
  resize: none;
}

.settings-header-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.settings-header-left {
  width: 270px;
  flex-shrink: 0;
  padding: 14px 12px 14px 12px;
  border-right: 1px solid var(--border);
}

.settings-panel-title {
  flex: 1;
  padding: 14px 50px 14px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.settings-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
  margin: 0;
  border: none;
}

.settings-body-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.settings-sidebar {
  width: 270px;
  padding: 16px 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.settings-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-item {
  background: none;
  border: none;
  padding: 10px 12px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-nav-item .material-icons,
.settings-nav-item .settings-nav-item-ico.material-symbols-outlined {
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
  font-size: 1.35rem;
  line-height: 1;
  opacity: 0.92;
}
.settings-nav-item .settings-nav-item-ico.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  color: currentColor;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
}
.settings-nav-item.active .settings-nav-item-ico.material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.settings-nav-item:hover {
  background: var(--bg-input);
  color: var(--text);
}

.settings-nav-item.active {
  background: var(--bg-input);
  color: var(--accent);
  font-weight: 500;
}

.settings-nav-bottom {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-logout {
  color: #e53935;
}

.settings-logout:hover {
  background: rgba(229, 57, 53, 0.15);
  color: #ff6b6b;
}

.settings-logout.hidden { display: none; }

.settings-content {
  flex: 1 1 0;
  min-width: 0;
  padding: 16px 32px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: flex;
  flex-direction: column;
}

.settings-panel h2 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 12px;
}
.settings-panel.active h2:first-child {
  display: none;
}

.settings-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}
.settings-noise-suppression-row {
  margin-top: 12px;
}
.settings-noise-suppression-hint {
  margin-top: 6px;
}
.settings-panel-hint {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.settings-licenses-content {
  margin-top: 16px;
}
.settings-licenses-content h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin: 16px 0 8px 0;
}
.settings-licenses-content h3:first-child { margin-top: 0; }
.settings-licenses-content p {
  margin: 6px 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.settings-licenses-content a {
  color: var(--accent);
  text-decoration: none;
}
.settings-licenses-content a:hover {
  text-decoration: underline;
}
#settings-panel-licenses.active {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
#settings-panel-licenses .settings-licenses-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.settings-licenses-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
}
.settings-licenses-scroll::-webkit-scrollbar { width: 6px; }
.settings-licenses-scroll::-webkit-scrollbar-thumb { background: #4a4a4f; border-radius: 3px; }
.settings-licenses-footer {
  margin-top: 20px !important;
  font-size: 0.8rem !important;
  color: var(--text-dim) !important;
}
.settings-licenses-content code {
  font-size: 0.85em;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.settings-display-name-row {
  margin-top: 20px;
}

.settings-display-name-row label,
.settings-avatar-row label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: normal;
  margin-bottom: 8px;
}

.settings-display-name-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.settings-display-name-input-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.settings-display-name-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-avatar-row {
  margin-top: 24px;
}

.settings-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.settings-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.settings-avatar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

.settings-close:hover {
  background: var(--bg-input);
  color: var(--text);
}

/* Avatar redagavimo modalas */
#avatar-edit-modal .avatar-edit-modal {
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  width: min(480px, 94vw);
  max-width: 480px;
  box-sizing: border-box;
  position: relative;
}

.avatar-edit-title {
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: var(--accent);
}

.avatar-edit-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

.avatar-edit-close:hover {
  background: var(--bg-input);
  color: var(--text);
}

.avatar-edit-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.avatar-edit-preview {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-input);
  position: relative;
  border: 2px solid var(--border);
  user-select: none;
}

.avatar-edit-preview img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  display: block;
  max-width: none;
  pointer-events: none;
}

.avatar-edit-img-hidden {
  opacity: 0;
  position: absolute;
  z-index: -1;
}

#avatar-edit-canvas {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.avatar-edit-drag-layer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  cursor: grab;
  z-index: 1;
  -webkit-user-select: none;
  user-select: none;
}

/* ===== Squircle variantas (Discord-stiliaus serverio piktograma) =====
   Naudojamas kai redaktorius atidarytas su `context: 'server'` (`shape: 'squircle'`).
   Spindulys ~22% nuo 240px = 52px – proporcingas Discord piktogramos formai. */
.avatar-edit-preview[data-shape="squircle"] {
  border-radius: 52px;
}
.avatar-edit-preview[data-shape="squircle"] #avatar-edit-canvas,
.avatar-edit-preview[data-shape="squircle"] .avatar-edit-drag-layer {
  border-radius: 52px;
}

.avatar-edit-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar-edit-zoom {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-edit-zoom-icon {
  color: var(--text-dim);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Kai naudojama Material Symbol (photo_size_select_*) – fiksuotas ikonos dydis */
.avatar-edit-zoom-icon.material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}

.avatar-edit-zoom input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-input);
  border-radius: 3px;
}

.avatar-edit-zoom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.avatar-edit-rotate {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

.avatar-edit-rotate:hover {
  background: var(--border);
}

.avatar-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal {
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  width: min(480px, 94vw);
  max-width: 480px;
  box-sizing: border-box;
}

/* „Nuoroda išsiųsta“ – tas pats standartinis modalų plotis kaip kiti overlay dialogai */
.modal.modal-forgot-sent {
  max-width: 480px;
  width: min(480px, 94vw);
  padding: 32px;
  border-radius: 8px;
  box-sizing: border-box;
}

.modal h3 {
  margin-bottom: 12px;
  font-size: 1rem;
  color: var(--accent);
  text-align: center;
}
#update-modal .modal h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}
#update-info {
  text-align: center;
  color: var(--text-dim);
  line-height: 1.5;
  white-space: pre-line;
}

.modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
}

.modal input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.modal textarea:focus {
  outline: none;
  border-color: var(--accent);
}

#join-server-modal .modal-hint,
#nickname-modal .modal-hint {
  color: var(--text-dim);
}

/* DM failo limito modalas – VIP arba serverinis siuntimas */
.modal-dm-file-limit {
  max-width: 480px;
  width: min(480px, 94vw);
  box-sizing: border-box;
}
.dm-file-limit-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.dm-file-limit-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dm-file-limit-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 200, 83, 0.08);
}
.dm-file-limit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.dm-file-limit-icon {
  font-size: 1.4rem;
}
.dm-file-limit-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.dm-file-limit-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Invite modal – pakviesti į serverį */
.modal-invite {
  max-width: 480px;
  width: min(480px, 94vw);
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.modal-invite-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-invite-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
  text-align: center;
}
.modal-invite-header .modal-close {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}

.modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--bg-input);
  color: var(--text);
}

.modal-invite-search {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

/* „Pridėti draugą“: ne globalus .modal-hint neigiamas margin – kitaip hint tekstą perbrėžia header border */
#add-friend-modal .add-friend-modal-hint {
  margin: 12px 20px 12px 20px;
  line-height: 1.45;
  color: #fff;
}

.invite-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
}
.invite-search-wrap:focus-within {
  border-color: var(--accent);
}
.invite-search-icon {
  font-size: 1.2rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
.invite-search-icon.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.invite-search-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  margin: 0;
  padding: 0;
}

.modal-invite-list {
  /* Auto aukštis pagal turinį – kuo mažiau draugų, tuo trumpesnis modalas.
     Vienos eilutės aukštis ~62 px (avatar 40 + padding 10+10+border 1).
     Riba: 10 draugų (~620 px), bet ne daugiau nei tilpa ekrane (palikt
     vietos header + paieškai + nuorodos blokui apačioje – ~300 px).
     11-as draugas įjungia vidinį scroll'ą. */
  max-height: min(620px, calc(100vh - 300px));
  overflow-y: auto;
  padding: 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: #4a4a4f transparent;
}
.modal-invite-list::-webkit-scrollbar { width: 8px; }
.modal-invite-list::-webkit-scrollbar-track { background: transparent; }
.modal-invite-list::-webkit-scrollbar-thumb {
  background: #4a4a4f;
  border-radius: 4px;
}
.modal-invite-list::-webkit-scrollbar-thumb:hover {
  background: #5a5a5f;
}

.invite-no-friends {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px 0;
}

.invite-friend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.invite-friend-item:last-child {
  border-bottom: none;
}

.new-chat-friend-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.new-chat-friend-item:last-child { border-bottom: none; }
.new-chat-friend-item:hover {
  background: var(--bg-input);
}
.new-chat-friend-item.selected { background: var(--bg-input); }
.new-chat-friend-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
}
.new-chat-friend-item.selected .new-chat-friend-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.new-chat-friend-checkbox .material-icons { font-size: 14px; }

.modal-new-chat .modal-invite-header { margin-bottom: 4px; }
#edit-group-modal .new-chat-group-section { border-top: none; }
#edit-group-modal .modal-hint {
  padding: 8px 20px 8px 20px;
  margin: 0;
}
#new-chat-subtitle {
  color: var(--text-dim);
  padding: 0 20px;
  margin: 8px 0 12px 0;
}
/* Paieškos laukelis – visas turinys centruojamas, auga aukštis kai tag'ai pereina į naują eilutę */
.new-chat-search-wrap {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--new-chat-tag-gap);
  padding: var(--new-chat-search-padding);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 0 20px 12px;
  min-height: var(--new-chat-search-min-height);
  box-sizing: border-box;
}
.new-chat-search-wrap:focus-within { border-color: var(--accent); outline: none; }
.new-chat-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: var(--new-chat-tag-gap);
  flex: 0 1 auto;
  min-width: 0;
  align-self: stretch;
}
.new-chat-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}
.new-chat-tag-remove {
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.8;
  display: flex;
  align-items: center;
}
.new-chat-tag-remove:hover { opacity: 1; }
.new-chat-search-wrap input {
  flex: 1;
  min-width: 80px;
  align-self: stretch;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.4;
  outline: none;
  text-align: left;
  padding: var(--new-chat-input-padding-y) 0 var(--new-chat-input-padding-y) 4px;
  box-sizing: border-box;
}
.new-chat-search-wrap input::placeholder {
  text-align: left;
  direction: ltr;
}
.new-chat-search-wrap:has(.new-chat-tags-wrap:not(:empty)) input::placeholder { opacity: 0; }
.new-chat-friends-list {
  max-height: 180px;
  margin: 0 0 0 0;
  padding: 0 20px 12px;
}
.new-chat-friend-item {
  margin: 0 -20px;
  padding: 10px 20px;
}
.new-chat-group-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.new-chat-group-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.new-chat-group-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.new-chat-group-avatar .new-chat-group-icon { font-size: 32px; }
.new-chat-avatar-edit-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.new-chat-avatar-edit-btn .material-symbols-outlined { font-size: 16px; }
.new-chat-avatar-edit-btn:hover { filter: brightness(1.1); }

.group-avatar {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  width: 40px;
  height: 40px;
}

/**
 * Kai grupės avatare rodomas narių „stack" (vartotojas neuždėjo grupės paveikslėlio),
 * pašalinam paveldėtą žalią `var(--accent)` foną iš `.friend-avatar` – stack'ai
 * patys turi savo apvalų rėmelį ir foną.
 */
.friend-avatar.group-avatar:has(.group-avatar-stack),
.chat-header-avatar.header-avatar-group:has(.group-avatar-stack) {
  background: transparent !important;
}

/**
 * Sidebar grupės kortelė (Discord stilius):
 *   1-a eilutė – `friend-name` (truncate su elipsi jei netelpa).
 *   2-a eilutė – `friend-meta.group-member-count` („X nariai").
 *
 * `friend-name` taisyklę darom **bendrą** visiem `chat-item` (ne tik grupėm) –
 * ilgi DM vartotojų vardai irgi turi būti truncate'inami (atrodo tvarkingai
 * siauram sidebar'ui). `min-width:0` jau yra ant `.friend-info` (žr. styles.css).
 */
.chat-item .friend-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.chat-item .friend-meta.group-member-count {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/**
 * Grupės avataras be vartotojo paveikslėlio – narių avatarai sudėlioti Discord
 * stiliumi: max 2 mini avatarai diagonalėje (TL + BR). Naudojama su
 * `buildGroupStackAvatarHtml(group, { size, max })`.
 *
 * Layout pagal narių kiekį (`:nth-last-child` selektoriai – be JS modifier klasių):
 *   - 1 narys → centre.
 *   - 2 nariai → diagonalė: viršus-kairė + apačia-dešinė (Discord stilius).
 *
 * `box-sizing: border-box` – `--gs-stack-size` aprašo TOTAL dydį (su border'iu).
 */
.group-avatar-stack {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}
.group-avatar-stack-item {
  position: absolute;
  width: var(--gs-stack-size, 22px);
  height: var(--gs-stack-size, 22px);
  border-radius: 50%;
  background: var(--bg-input);
  background-size: cover;
  background-position: center;
  border: 2px solid var(--bg-secondary, var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--gs-stack-font, 11px);
  font-weight: 600;
  color: var(--text);
  box-sizing: border-box;
}

/* 1 narys – centre */
.group-avatar-stack-item:first-child:last-child {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 2 nariai – diagonalė (TL + BR), kaip Discord */
.group-avatar-stack-item:first-child:nth-last-child(2) {
  top: 0;
  left: 0;
}
.group-avatar-stack-item:first-child:nth-last-child(2) ~ .group-avatar-stack-item {
  bottom: 0;
  right: 0;
}

.new-chat-group-name-wrap {
  flex: 1;
  min-width: 0;
}
.new-chat-group-name-wrap label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.new-chat-group-name-wrap input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
}
.new-chat-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.invite-friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.invite-friend-info {
  flex: 1;
  min-width: 0;
}

.invite-friend-name {
  font-weight: 600;
  color: var(--text);
}

.invite-friend-handle,
.invite-friend-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: block;
}

.btn-add-friend {
  padding: 6px 12px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-add-friend:hover {
  filter: brightness(1.1);
}

.invite-friend-btn {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}

.invite-friend-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.modal-invite-link {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.invite-link-label {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.invite-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

/* ==== Pakvietimo nuorodos NUSTATYMŲ modalas (Discord stilius) ====
   Atskiras modalas, atveriamas iš „Redaguoti pakvietimo nuorodą".
   Naudojami du dropdown'ai („Baigsis po", „Maks. panaudojimų") ir vienas
   pjūklinis toggle („Suteikti laikiną narystę"). Mygtukai: Atšaukti +
   pirminis (akcento spalvos) „Sukurti naują nuorodą".
   Z-index 12100 – aukščiau invite-server-modal (12000-iai), kad atsidarytų virš jo. */
#invite-edit-modal { z-index: 12100; }
.modal-invite-edit {
  max-width: 480px;
  width: min(480px, 94vw);
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.invite-edit-header {
  position: relative;
  padding: 18px 20px 14px 20px;
  border-bottom: 1px solid var(--border);
}
.invite-edit-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
  font-weight: 600;
}
.invite-edit-header .modal-close {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
}
.invite-edit-body {
  padding: 18px 20px 8px 20px;
}
.invite-edit-label {
  display: block;
  margin: 14px 0 6px 0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
}
.invite-edit-label:first-child { margin-top: 0; }

/* Dropdown'as: vidinis <select> + pseudo-rodyklė. */
.invite-edit-select-wrap {
  position: relative;
  margin-bottom: 6px;
}
.invite-edit-select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  outline: none;
}
.invite-edit-select:focus {
  border-color: var(--accent);
}
.invite-edit-select-arrow {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-dim);
  font-size: 22px;
}

/* Toggle: kvadratinis su slankiojančiu apskritimu (Discord-like). */
.invite-edit-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 8px 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.invite-edit-toggle-text { flex: 1; min-width: 0; }
.invite-edit-toggle-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.invite-edit-toggle-desc {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.4;
}
.invite-edit-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}
.invite-edit-toggle input { opacity: 0; width: 0; height: 0; }
.invite-edit-toggle-slider {
  position: absolute;
  inset: 0;
  background: #4a4a4f;
  border-radius: 999px;
  transition: background 0.15s ease;
  cursor: pointer;
}
.invite-edit-toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.invite-edit-toggle input:checked + .invite-edit-toggle-slider { background: var(--accent); }
.invite-edit-toggle input:checked + .invite-edit-toggle-slider::before { transform: translateX(20px); }

/* Footer: Atšaukti (pilkas) + pirminis (akcento spalvos) mygtukas. */
.invite-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
}
.invite-edit-footer .btn-cancel,
.invite-edit-footer .btn-primary {
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
}
.invite-edit-footer .btn-cancel {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.invite-edit-footer .btn-cancel:hover { background: rgba(255, 255, 255, 0.05); }
.invite-edit-footer .btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.invite-edit-footer .btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.invite-edit-footer .btn-primary:disabled { opacity: 0.6; cursor: default; }


.invite-link-row input {
  flex: 1;
  margin: 0;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
/* „Kopijuoti" feedback: trumpas žalias pažymėjimas (1.2 s),
   kad vartotojas vizualiai matytų, jog adresas atsidūrė iškarpinėje. */
.invite-link-row input.invite-link-input--copied {
  background: rgba(43, 191, 99, 0.18);
  border-color: var(--accent);
  color: #d6ffe2;
}

.btn-copy {
  padding: 8px 14px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-copy:hover {
  filter: brightness(1.1);
}

.invite-link-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0 0 4px 0;
}

.invite-link-edit-wrap {
  margin: 0;
  font-size: 0.75rem;
}

.invite-link-hint a,
.invite-link-edit-wrap a {
  color: var(--accent);
  text-decoration: none;
}

.invite-link-hint a:hover,
.invite-link-edit-wrap a:hover {
  text-decoration: underline;
}

/* Share modal – persiųsti gavėjui */
.modal-share {
  max-width: 480px;
  width: min(480px, 94vw);
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.modal-share-header {
  position: relative;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-share-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}
.modal-share-header .modal-close {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
}
.modal-share-sub {
  margin: 0;
  padding: 8px 20px 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.modal-share-search {
  padding: 0 20px 12px;
}
.modal-share-search-wrap.invite-search-wrap {
  width: 100%;
  box-sizing: border-box;
}
.share-preview-type-icon.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 1.25rem;
  color: var(--text-dim);
  flex-shrink: 0;
  line-height: 1;
}
.share-recipients-block.hidden {
  display: none;
}
.modal-share-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 0 20px 12px;
}
.share-no-recipients {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px 0;
}
.share-no-recipients.hidden {
  display: none;
}
.share-recipient-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.share-recipient-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 10px 4px 4px;
  margin: 0;
}
.share-recipient-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.share-recipient-row:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}
.share-recipient-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  overflow: hidden;
}
.share-recipient-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.share-recipient-row-main {
  flex: 1;
  min-width: 0;
}
.share-recipient-row-name {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-recipient-row-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Persiuntimo modalas – tas pats gs-checkbox kaip visur (.cursor/rules/checkbox-themed-ui.mdc) */
.share-recipient-row input.gs-checkbox.share-recipient-row-check {
  flex-shrink: 0;
  margin: 0;
}
.modal-share-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}
.modal-share-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.share-preview-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  margin-left: auto;
}
.share-preview-thumb:not([src]),
.share-preview-thumb[src=""] {
  display: none;
}
.modal-share-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.modal-share-input-row input {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
}
.modal-share-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.btn-share-send {
  padding: 10px 16px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-share-send:hover {
  opacity: 0.9;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-cancel, .btn-confirm {
  padding: 8px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-cancel:enabled:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.btn-confirm {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
  transition: filter 0.15s ease;
}
.btn-confirm:enabled:hover {
  filter: brightness(1.08);
}
.btn-confirm:enabled:active {
  filter: brightness(0.95);
}

.btn-remove-friend {
  padding: 8px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #ed4245;
  border: none;
  color: #fff;
}
.btn-remove-friend:hover {
  background: #c03537;
}

.modal-remove-friend-body {
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.modal-remove-friend-body strong {
  color: var(--text);
}

.update-modal .update-version {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.update-notes {
  max-height: 200px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-input);
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.update-progress {
  margin-bottom: 16px;
}

.update-progress.hidden { display: none; }

.progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-dim);
  padding: 40px;
  text-align: center;
}

.friends-list-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.boost-plus-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 32px;
  background: var(--bg-main, #0f0f12);
}

.boost-plus-inner {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.boost-plus-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 0 0 16px;
}

.boost-plus-tier-card {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
  background: var(--bg-input, #25252c);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.boost-plus-tier-card:hover {
  border-color: rgba(0, 200, 83, 0.45);
}

.boost-plus-tier-card--featured {
  border-color: rgba(0, 200, 83, 0.55);
  background: linear-gradient(180deg, rgba(0, 200, 83, 0.08), var(--bg-input, #25252c));
}

.boost-plus-tier-head {
  margin-bottom: 12px;
}

.boost-plus-tier-name {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text, #f4f4f5);
}

.boost-plus-tier-price {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-dim, #a1a1aa);
}

.boost-plus-tier-price-amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent, #00c853);
  margin-right: 4px;
}

.boost-plus-tier-features {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

.boost-plus-tier-features li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}

.boost-plus-tier-features li:last-child {
  border-bottom: none;
}

.boost-plus-tier-feature-label {
  color: var(--text-dim, #a1a1aa);
}

.boost-plus-tier-feature-value {
  color: var(--text, #f4f4f5);
  font-weight: 600;
}

.boost-plus-cta-btn--secondary {
  background: transparent;
  border: 1px solid var(--accent, #00c853);
  color: var(--accent, #00c853);
}

.boost-plus-cta-btn--secondary:hover {
  background: rgba(0, 200, 83, 0.12);
  filter: none;
}

.boost-plus-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text, #f4f4f5);
}

.boost-plus-lead {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-dim, #a1a1aa);
}

.boost-plus-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0 0 16px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  overflow: hidden;
}

.boost-plus-table thead {
  background: var(--bg-input, #25252c);
}

.boost-plus-table th,
.boost-plus-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.boost-plus-table tbody tr:last-child td {
  border-bottom: none;
}

.boost-plus-table th {
  font-weight: 600;
  color: var(--text-dim, #a1a1aa);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.boost-plus-table td {
  color: var(--text, #f4f4f5);
}

.boost-plus-table td:last-child {
  font-weight: 600;
  color: var(--accent, #00c853);
}

.boost-plus-free-note {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-dim, #888);
}

.boost-plus-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent, #00c853);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.boost-plus-cta-btn:hover {
  filter: brightness(1.08);
}

.boost-plus-cta-btn:active {
  transform: translateY(1px);
}

#boost-plus-dashboard {
  margin-top: 4px;
}

.boost-plus-dash-intro {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--text-dim, #a1a1aa);
  line-height: 1.45;
}

.boost-plus-storage-bar-wrap {
  margin-bottom: 20px;
}

.boost-plus-storage-bar {
  height: 10px;
  border-radius: 6px;
  background: var(--bg-input, #25252c);
  overflow: hidden;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.boost-plus-storage-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent, #00c853), #22c55e);
  transition: width 0.25s ease;
}

.boost-plus-storage-caption {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim, #888);
}

.boost-plus-files-heading {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #f4f4f5);
}

.boost-plus-file-empty {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-dim, #888);
}

.boost-plus-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.boost-plus-file-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-input, #1e1e24);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  min-height: 0;
}

.boost-plus-file-ico {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-side, #2a2a30);
  color: var(--text-dim, #a1a1aa);
}

.boost-plus-file-ico .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}

.boost-plus-file-main {
  flex: 1;
  min-width: 0;
}

.boost-plus-file-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text, #f4f4f5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.boost-plus-file-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--text-dim, #888);
  line-height: 1.35;
}

.boost-plus-file-meta {
  color: var(--text-dim, #888);
}

.boost-plus-file-placements {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.boost-plus-placement-link {
  display: inline-flex;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--accent, #00e676);
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(0, 200, 83, 0.35);
  border-radius: 6px;
  cursor: pointer;
  max-width: 100%;
  text-align: left;
}

.boost-plus-placement-link--compact {
  padding: 2px 8px;
  font-size: 0.72rem;
  border-radius: 4px;
}

.boost-plus-placement-link:hover {
  filter: brightness(1.1);
}

.boost-plus-file-actions {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
}

.boost-plus-file-btn {
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text, #e4e4e7);
  background: var(--bg-side, #2a2a30);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .boost-plus-file-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .boost-plus-file-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
}

.boost-plus-file-btn:hover {
  background: var(--bg-input, #333);
}

.boost-plus-file-btn-danger {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}

.boost-plus-file-btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.boost-plus-dash-footnote {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim, #666);
  line-height: 1.4;
}

.friends-select-hint {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  padding: 24px;
}

.friends-select-hint.hidden {
  display: none;
}

.friends-pending-section {
  margin-bottom: 16px;
}

.friends-pending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg-input);
}

.friends-pending-item .friend-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
}

.friends-pending-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.friends-pending-actions button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.friends-pending-accept {
  background: var(--accent);
  color: #fff;
}

.friends-pending-reject {
  background: #e53935;
  color: #fff;
}

.friends-section-title {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 12px 0 8px 0;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.friends-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.friends-chat-area.hidden {
  display: none !important;
}

/* DM skambutis: juoda zona tarp header ir chato – chatas lieka matomas žemiau */
.friends-chat-below-call {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.dm-call-stage-stack {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
}
.dm-call-stage-stack.hidden {
  display: none !important;
}
.dm-call-stage-outer {
  height: var(--dm-call-stage-h, 280px);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* Grupės kalbėjimo žiedas (box-shadow) eina už avataro – šiek tiek oro, kad neiškirptų viršuje/apačioje. */
.dm-call-stage-outer:has(.dm-call-stage-group-call) {
  padding-top: 10px;
  padding-bottom: 6px;
  box-sizing: border-box;
}
.dm-call-chat-resize-handle {
  height: 6px;
  flex-shrink: 0;
  cursor: ns-resize;
  background: transparent;
  transition: background 0.15s;
}
.dm-call-chat-resize-handle:hover,
.dm-call-chat-resize-handle.resizing {
  background: var(--accent);
  opacity: 0.45;
}
/* Header: ragelis/kamera tik scenoje – čia paslėpti */
body.dm-call-stage-active #dm-voice-call-btn,
body.dm-call-stage-active #dm-video-call-btn {
  display: none !important;
}
/* Skambučio metu: antraštė ir scena – tas pats #000 (be atskiros pilkos juostos) */
body.dm-call-stage-active .chat-header {
  background: #000;
  border-bottom-color: transparent;
  padding-top: 4px;
  padding-bottom: 6px;
}
body.dm-call-stage-active .chat-header-status-dot {
  border-color: #000;
}
body.dm-call-stage-active .dm-call-stage-outer {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
body.dm-call-stage-active .dm-call-video-canvas:has(.dm-call-voice-only-tile) {
  gap: 0;
  padding: 0;
}
body.dm-call-stage-active .dm-call-stage.dm-call-stage-outgoing-pulse .dm-call-video-canvas:has(.dm-call-voice-only-tile) {
  gap: 6px;
  padding: 6px;
}
/* Flex: forma apačioje – priedų juosta auga, žinutės lieka virš jos (ne už sluoksniu) */
.friends-chat-messages {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 16px;
  padding-bottom: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Vienas slankiklis: react-virtuoso viduje – ne dvigubas su #friends-chat-messages (pelei „atsiliepiantis“ slankiklis). */
.friends-chat-messages:has(.friend-chat-panel[data-virtuoso='1']) {
  overflow-y: hidden;
  /* Be dešinio padding – slankiklis prie panelės krašto (ne tuščia juosta tarp jo ir rėmelio). */
  padding-left: 16px;
  padding-right: 0;
  padding-top: 16px;
  /* Kuo mažesnis tarpas iki rašymo lauko (footer spacer + šitas padding). */
  padding-bottom: 2px;
}

.group-chat-landing {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
  flex-direction: column;
}
.group-chat-landing.hidden { display: none !important; }

/* Grupės sveikinimas žinučių srities pradžioje – slenka kartu su žinutėmis */
.group-welcome-in-messages {
  flex-shrink: 0;
  padding: 24px 16px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.group-welcome-in-messages .group-landing-content {
  width: 100%;
}

.group-landing-content {
  text-align: center;
  max-width: 400px;
}
/**
 * Grupės welcome avataras – tas pats Discord stilius kaip sidebar kortelėje
 * (`buildGroupStackAvatarHtml` su `.group-avatar-stack`), tik didesnis: 80×80
 * konteineris su 50px mini avatarais trikampyje (max 3).
 *
 * `position: relative` – `.group-avatar-stack-item` (absolute) pozicionuojasi
 * šio konteinerio atžvilgiu. Jei vartotojas uždėjo grupės paveikslėlį,
 * `background-image` ant pačio `.group-landing-avatars` rodo jį tiesiogiai
 * (helper'is grąžina tuščią string).
 */
.group-landing-avatars {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  color: var(--text-dim);
}
.group-landing-avatars .material-icons {
  position: absolute;
  inset: 0;
  font-size: 96px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
}
.group-landing-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.group-landing-members {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.group-landing-welcome {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.5;
}
.group-landing-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.group-landing-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.group-landing-btn-invite {
  background: var(--accent);
  color: #fff;
}
.group-landing-btn-invite:hover { filter: brightness(1.1); }
.group-landing-btn-edit {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.group-landing-btn-edit:hover { background: var(--border); }

/**
 * DM (1:1 draugo) sutiktuvių blokas – Discord stilius pokalbio pradžioje.
 * Discord rodo: didelis avataras viršuje, žemiau didelis display name, po juo
 * @username pilkesne spalva, ir paaiškinimas „Tai yra tavo asmeninių žinučių
 * su X istorijos pradžia.". Be jokių mygtukų – DM yra paprasčiau už grupes.
 *
 * Wrap'eris turi ir `.group-welcome-in-messages` (paveldi padding / layout),
 * ir `.dm-welcome-in-messages` (modifikatorius DM specifinėms taisyklėms).
 * Vietoj centro – kairinis layout (panašiai kaip Discord), kad tilptų
 * į siaurą chat sritį ir „kalbėtų" link composer'io.
 */
.dm-welcome-in-messages {
  justify-content: flex-start;
  padding: 32px 24px 16px;
}
.dm-welcome-in-messages .dm-landing-content {
  text-align: left;
  max-width: 100%;
  width: 100%;
}
.dm-landing-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-input);
  background-size: cover;
  background-position: center;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 2.2rem;
  font-weight: 600;
  position: relative; /* avatar decoration overlay */
}
.dm-landing-avatar.dm-landing-avatar-letter { background: var(--bg-input); }
.dm-landing-name {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.2;
}
.dm-landing-username {
  font-size: 1rem;
  color: var(--text-dim);
  margin: 0 0 14px;
}
.dm-landing-welcome {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
  max-width: 640px;
}
.dm-landing-welcome strong { color: var(--text); font-weight: 600; }

.edit-group-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.edit-group-member-item:hover { background: var(--bg-input); }
.edit-group-remove-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
}
.edit-group-remove-btn:hover { color: #e53935; }

.friend-chat-panel {
  display: none;
  flex-direction: column;
  overflow: visible;
  min-height: 100%;
}

/* react-virtuoso: tik matomas „langas“ piešiamas; likę eilutės – ne fiksuojamos layout */
.dm-virtuoso-mount,
.channel-virtuoso-mount {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Legacy `#messages` divas pilnai migruotas – Virtuoso užima jo vietą.
   Paliekam atributą `hidden` + klasę kaip dvigubą apsaugą. */
.messages.messages-legacy-hidden,
.messages.messages-legacy-hidden[hidden] {
  display: none !important;
}

/* Kanalo Virtuoso turi tilpti į `#messages-container` taip pat, kaip ir
   legacy `#messages` (flex column, scroll viduje). */
#messages-container {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* „Tu žiūri senesnius… / Peršokti į dabartį“ – virš žinučių, ne už kompozitoriaus */
.dm-virtuoso-list-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

/* Tarpas paskutinės žinutės apačioje – kad reakcijų eilutė, dideli emoji ar nuotraukos nepasislėptų po typing field. */
.dm-virtuoso-footer-spacer {
  height: 24px;
  flex-shrink: 0;
  pointer-events: none;
  box-sizing: border-box;
}

/* Grupės welcome blokas kaip pirmoji Virtuoso eilutė (Discord stilius). */
.dm-virtuoso-welcome-row {
  width: 100%;
  display: block;
}
.dm-jump-present-bar {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(35, 38, 44, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
  max-width: calc(100% - 20px);
}
.dm-jump-present-bar-text {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--text, #dcddde);
}
.dm-jump-present-btn.btn-confirm {
  flex-shrink: 0;
  padding: 7px 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}
/* Virtuoso vidinis slenkstis: numatytai `overflow: auto` – 1–2px perteklius rodė horizontalią juostą apačioje.
   Tas pats fix kanalo Virtuoso mount'ui (`.channel-virtuoso-mount`). */
.friends-chat-messages [data-virtuoso-scroller="true"],
.channel-virtuoso-mount [data-virtuoso-scroller="true"] {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  /* Virtuoso valdo scroll – naršyklės overflow-anchor su JS autoscroll/clamp duoda „dvigubą vairą“ ir trūkčiojimą. */
  overflow-anchor: none;
  /* Be transform – WebView’e kitaip slankiklis gali „kibti“ prie vilčio (GPU sluoksnis / inkarinimas). */
  /* Tarpas tarp žinučių ir slankiklio (ne „prilipęs“ prie burbulo). */
  padding-right: 12px;
  box-sizing: border-box;
}
.friends-chat-messages [data-viewport-type="element"],
.channel-virtuoso-mount [data-viewport-type="element"] {
  min-width: 0;
}
/* Ne `content-visibility: auto` – nukerpia veiksmų juostą (absoliutu, virš teksto) ir Material ikonas. */
.friends-chat-messages .friend-chat-panel .message,
.friend-chat-panel[data-virtuoso='1'] .message {
  content-visibility: visible;
  contain-intrinsic-size: unset;
  contain: layout;
}
/*
 * DM Virtuoso: viena inline nuotrauka / GIF – tie patys dydžiai kaip be Virtuoso (natūralus kraštinių santykis).
 * Fiksuotas 16:9 čia sulaužė mažas/dideles nuotraukas ir EXIF pasukimą (dėžė visada ta pati). Galerijos taisyklės žemiau.
 */
.friend-chat-panel[data-virtuoso='1'] img.message-image {
  display: block;
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: min(100%, var(--chat-inline-image-max-width));
  max-height: var(--chat-inline-image-max-height);
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
  image-orientation: from-image;
}
.friend-chat-panel[data-virtuoso='1'] .dm-message-body-slot .message-text {
  contain: layout;
}
.friend-chat-panel[data-virtuoso='1'] .chat-link-embeds {
  contain: layout;
}
.friend-chat-panel[data-virtuoso='1'] .chat-link-embed--unfurl.chat-link-embed--pending {
  min-height: 88px;
}
/* Mišri galerija (sąrašas) – nekeičiame elgesio */
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery:not(.message-image-gallery--attachments-list) {
  grid-auto-rows: minmax(140px, auto);
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--2 {
  grid-auto-rows: minmax(0, auto);
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--2 .message-image-gallery-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  background: rgba(255, 255, 255, 0.05);
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--3 {
  grid-template-rows: minmax(172px, auto) minmax(172px, auto);
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--3 .message-image-gallery-cell {
  position: relative;
  min-height: 0;
  background: rgba(255, 255, 255, 0.05);
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--4 {
  grid-template-rows: minmax(0, auto) minmax(0, auto);
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--4 .message-image-gallery-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  background: rgba(255, 255, 255, 0.05);
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--many {
  grid-auto-rows: minmax(0, auto);
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--many .message-image-gallery-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  background: rgba(255, 255, 255, 0.05);
}
/* Galerijos img užpildo ląstelę – dydis nuo tinklelio, ne nuo įkėlimo momento */
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--2 .message-image-gallery-cell > .message-image-wrap,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--3 .message-image-gallery-cell > .message-image-wrap,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--4 .message-image-gallery-cell > .message-image-wrap,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--many .message-image-gallery-cell > .message-image-wrap {
  position: absolute;
  inset: 0;
  margin: 0;
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--2 .message-image-gallery-cell > .message-image-wrap .message-image,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--3 .message-image-gallery-cell > .message-image-wrap .message-image,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--4 .message-image-gallery-cell > .message-image-wrap .message-image,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--many .message-image-gallery-cell > .message-image-wrap .message-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  aspect-ratio: unset;
  object-fit: cover;
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--2 .message-image-gallery-cell > .message-image,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--3 .message-image-gallery-cell > .message-image,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--4 .message-image-gallery-cell > .message-image,
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery--many .message-image-gallery-cell > .message-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  aspect-ratio: unset;
  object-fit: cover;
}
.friend-chat-panel[data-virtuoso='1'] .message-image-gallery-cell:has(.message-image--gif) {
  contain: paint;
  isolation: isolate;
}
/* Spacer viršuje – tik senajam DOM be Virtuoso (mažai žinučių – prie apačios). */
.friend-chat-panel::before {
  content: '';
  display: block;
  flex: 1 1 0;
  min-height: 0;
}
/* react-virtuoso: `alignToBottom` jau laiko juostą prie apačios – šis spacer užima ~pusę aukščio ir „kirpa“ chatą */
.friend-chat-panel[data-virtuoso='1']::before {
  display: none;
}

.friends-chat-form {
  flex-shrink: 0;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 16px 8px;
  background: transparent;
}

/*
 * DM + Virtuoso: kaip ankstesnis kompaktiškas variantas – jokio aukšto tamsaus gradiento virš lauko.
 * Tamsu tik pati įvedimo juosta (.message-input-wrap → --bg-input); „rašo…“ lieka ant chato fono.
 */
.friends-chat-form > .message-composer-integrated.friends-composer-integrated {
  padding-top: 0;
  margin: 0;
  background: transparent;
  border-radius: 0;
}

#friends-chat-area:has(.friend-chat-panel[data-virtuoso='1']) .friends-chat-form {
  gap: 2px;
  padding: 0 16px 4px;
  border-top: none;
  box-shadow: none;
}

/* DM „rašo…“: overlay (`bottom: 100%` nuo formos) – neišstumia žinučių, tarpas kaip be indikatoriaus */
.friends-chat-form #dm-typing-indicator {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 100%;
  width: auto;
  padding: 0 0 4px 0;
  margin: 0;
  z-index: 5;
  pointer-events: none;
  border: none;
  color: #fff;
}
/* Be dėžutės – šešėlis temos spalva (--bg, #1a1a1e), ne grynas juodas */
.friends-chat-form #dm-typing-indicator .dm-typing-text {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 2px;
  line-height: 1.35;
  max-width: 100%;
  padding: 0;
  margin: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
  box-sizing: border-box;
  /* Aura: platesnis šešėlis (tema --bg) + kontūras */
  text-shadow:
    0 0 110px color-mix(in srgb, var(--bg) 9%, transparent),
    0 0 88px color-mix(in srgb, var(--bg) 12%, transparent),
    0 0 68px color-mix(in srgb, var(--bg) 16%, transparent),
    0 0 52px color-mix(in srgb, var(--bg) 22%, transparent),
    0 0 40px color-mix(in srgb, var(--bg) 30%, transparent),
    0 0 30px color-mix(in srgb, var(--bg) 40%, transparent),
    0 0 20px color-mix(in srgb, var(--bg) 52%, transparent),
    0 0 12px color-mix(in srgb, var(--bg) 66%, transparent),
    0 0 7px var(--bg),
    0 2px 5px var(--bg),
    0 -2px 5px var(--bg),
    2px 0 5px var(--bg),
    -2px 0 5px var(--bg),
    2px 2px 4px var(--bg),
    -2px -2px 4px var(--bg),
    1px 1px 2px var(--bg),
    -1px -1px 2px var(--bg);
  filter:
    drop-shadow(0 0 26px color-mix(in srgb, var(--bg) 40%, transparent))
    drop-shadow(0 0 42px color-mix(in srgb, var(--bg) 26%, transparent))
    drop-shadow(0 0 62px color-mix(in srgb, var(--bg) 16%, transparent))
    drop-shadow(0 0 88px color-mix(in srgb, var(--bg) 10%, transparent));
}
.friends-chat-form #dm-typing-indicator .dm-typing-name {
  color: #fff;
  font-weight: 500;
}
#friends-chat-area:has(.friend-chat-panel[data-virtuoso='1']) .friends-chat-form #dm-typing-indicator {
  font-size: 0.85rem;
  line-height: 1.25;
  padding-bottom: 2px;
}

.friends-chat-staged {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.friends-chat-staged.hidden { display: none !important; }

.friends-chat-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.friends-chat-form .message-input-wrap { flex: 1; }

.dm-typing-indicator,
.channel-typing-indicator {
  padding: 4px 0 4px 0;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  background: transparent;
}

.dm-typing-indicator.hidden,
.channel-typing-indicator.hidden { display: none !important; }
.dm-typing-text,
.channel-typing-text {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 2px;
  line-height: 1.35;
  color: #fff;
}
.dm-typing-name,
.channel-typing-name {
  color: #fff;
  font-weight: 500;
}
.dm-typing-dots-anim,
.channel-typing-dots-anim {
  display: inline-flex;
  align-items: baseline;
  flex-shrink: 0;
  gap: 0;
  line-height: 1;
  letter-spacing: 0;
}
/* Bangos seka: kiekvienas taškas šviesėja paeiliui (ne visas „...“ mirgėjimas) */
.dm-typing-dot,
.channel-typing-dot {
  display: inline-block;
  font-size: 1.95em;
  line-height: 1;
  vertical-align: baseline;
  opacity: 0.32;
  animation: dm-typing-dot-wave 1.05s ease-in-out infinite;
}
.dm-typing-dot:nth-child(1),
.channel-typing-dot:nth-child(1) {
  animation-delay: 0ms;
}
.dm-typing-dot:nth-child(2),
.channel-typing-dot:nth-child(2) {
  animation-delay: 140ms;
}
.dm-typing-dot:nth-child(3),
.channel-typing-dot:nth-child(3) {
  animation-delay: 280ms;
}
@keyframes dm-typing-dot-wave {
  0%,
  100% {
    opacity: 0.28;
  }
  50% {
    opacity: 1;
  }
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}

.friend-item:hover {
  background: var(--bg-input);
}

.friend-item.selected {
  background: #3a3a3f;
}

.friend-item.friend-item-active-call,
.chat-item.friend-item-active-call {
  box-shadow: inset 3px 0 0 #22c55e;
}

.friend-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
}
.friend-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-side);
  box-sizing: border-box;
}
.friend-status-online {
  background: #22c55e;
}
.friend-status-offline {
  background: #6b7280;
}

.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-item-badge {
  background: #e53935;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

.friend-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
}

.friend-item-chat-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.friend-item-chat-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.friend-item-chat-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.friend-item-chat-icon.material-icons {
  font-size: 20px;
  line-height: 1;
}

.friend-item-more-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 0;
}

/* Atidarytas „⋯“ meniu – eilutė virš kaimynų, kad meniu nekristų po apačia */
.friend-item.friend-item-more-open {
  position: relative;
  z-index: 50;
}

.friend-item-more-btn {
  width: 30px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.friend-item-more-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.friend-item-more-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.friend-item-more-icon.material-icons {
  font-size: 22px;
  line-height: 1;
}

/* Absolute (ne fixed) – pririšta prie .friend-item-more-wrap, sutampa su „⋯“ dešinėje */
.friend-item-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  left: auto;
  z-index: 6000;
  min-width: 220px;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.friend-item-more-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.friend-item-more-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.friend-item-more-menu-item--danger {
  color: #f87171;
}

.friend-item-more-menu-item--danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.friend-name {
  font-weight: 600;
  color: var(--text);
  display: block;
}

.friend-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.friends-empty-hint {
  color: var(--text-dim);
  text-align: center;
  padding: 24px;
  font-size: 0.95rem;
}

.btn-retry {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-retry:hover {
  opacity: 0.9;
}

.voice-channel-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.voice-placeholder {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  color: var(--text-dim);
  padding: 24px;
  text-align: center;
}

.voice-placeholder .voice-hint {
  font-size: 0.85rem;
  margin-top: 8px;
}

/* „Prisijungti prie serverio" – švarus dialogas su pavyzdžiais ir „Atgal" link'u.
   HTML: `#join-server-modal`. Logika: `joinServerByInvite()` (`main.js`). */
.join-server-modal-card {
  width: min(480px, 94vw);
  position: relative;
  padding: 28px 28px 22px 28px;
}
.join-server-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}
.join-server-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.join-server-close .material-symbols-outlined { font-size: 20px; }

.join-server-title {
  margin: 0 0 8px 0;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.join-server-subtitle {
  margin: 0 0 20px 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.join-server-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.join-server-required {
  color: #ed4245;
  margin-left: 4px;
}
.join-server-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease;
  box-sizing: border-box;
  font-family: inherit;
}
.join-server-input:focus {
  border-color: var(--accent);
}
.join-server-examples {
  margin: 14px 0 18px 0;
}
.join-server-examples-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.join-server-example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.join-server-chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  white-space: nowrap;
}
.join-server-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.join-server-back {
  background: transparent;
  border: 0;
  padding: 8px 4px;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  border-radius: 4px;
  transition: text-decoration-color 120ms ease;
}
.join-server-back:hover { text-decoration: underline; }
.join-server-confirm {
  padding: 10px 20px;
  font-weight: 600;
}

/* „Sukurti / Prisijungti" pasirinkimo modalas – Discord stilius
   (didelės kortelės su ikona kairėje + pavadinimas + rodyklė dešinėje).
   HTML: `#server-choice-modal`. JS: `src/server-create-modal-ui.js`. */
.server-choice-modal {
  width: min(440px, 92vw);
  max-width: 440px;
}
.server-choice-hint {
  margin: 4px 0 18px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: center;
}
.server-choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.server-choice-card:hover {
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border-color: var(--accent);
  transform: translateY(-1px);
}
.server-choice-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.server-choice-card-icon {
  font-size: 28px !important;
  color: var(--accent);
  flex-shrink: 0;
}
.server-choice-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.server-choice-card-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.server-choice-card-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.3;
}
.server-choice-card-chevron {
  font-size: 22px !important;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* Sukurti serverį – piktogramos parinkimas. Vienas centrinis taikinys (squircle),
   spaudimas atidaro avataro redaktorių; atskiro „pasirinkti" mygtuko nereikia. */
.server-icon-picker {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.server-icon-preview {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: var(--bg-input);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 120ms ease, transform 120ms ease;
}

.server-icon-preview:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.server-icon-preview:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.server-icon-placeholder {
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1;
}

.server-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Atitinka tėvinio `.server-icon-preview` squircle – kad nuotrauka
     neišsikištų į kvadratinius kampus. */
  border-radius: inherit;
}

.btn-icon-pick {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
}

.btn-icon-pick:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.context-menu {
  position: fixed;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 160px;
  z-index: 2000;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.context-menu.visible {
  display: block;
}

.context-item {
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.context-item:hover {
  background: var(--bg-input);
}

.context-item-danger {
  color: #e57373;
}
.context-item-danger:hover {
  color: #ff8a80;
  background: rgba(229, 115, 115, 0.15);
}

.context-item-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}
.context-icon {
  font-size: 0.9rem;
  opacity: 0.9;
  width: 18px;
  text-align: center;
}

/* Žinutės kontekstinis meniu – Material Symbols su užpildymu (ne emoji / kontūrai). */
.message-context-menu .context-icon.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-size: 20px;
  line-height: 1;
  width: 22px;
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
  opacity: 1;
  color: inherit;
}
.message-context-menu .context-item-danger .context-icon.material-symbols-outlined {
  color: inherit;
}
.context-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Kompozitoriaus textarea: tik įklijavimas. */
.composer-context-menu {
  min-width: 200px;
}
.composer-context-menu .composer-ctx-paste-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.composer-ctx-kbd {
  font-size: 0.7rem;
  font-weight: 500;
  color: #fff;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-input);
  font-family: ui-monospace, monospace;
  flex-shrink: 0;
}

/* Audio popup – mikrofonas / ausinės */
.audio-popup {
  position: fixed;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 260px;
  max-width: 320px;
  z-index: 2000;
  display: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.audio-popup.visible { display: block; }
.audio-popup-section { margin-bottom: 8px; }
.audio-popup-section:last-of-type { margin-bottom: 0; }
.audio-popup-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.audio-popup-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}
.audio-popup-device-row:hover { border-color: var(--accent); }
.audio-popup-device-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}
.audio-popup-chevron { font-size: 1.2rem; color: var(--text-dim); }
.audio-popup-device-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-main);
}
.audio-popup-device-list.hidden { display: none !important; }
.audio-popup-device-list-inner { padding: 4px 0; }
.audio-popup-device-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
}
.audio-popup-device-item:hover { background: var(--bg-input); }
.audio-popup-device-item.selected { color: var(--accent); }
.audio-popup-device-item .radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  flex-shrink: 0;
}
.audio-popup-device-item.selected .radio-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--bg-side);
}
.audio-popup-device-item-info { flex: 1; min-width: 0; }
.audio-popup-device-item-name { font-weight: 500; }
.audio-popup-device-item-detail { font-size: 0.8rem; color: var(--text-dim); }
.audio-popup-sep {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}
.audio-popup-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--slider-percent, 100%), var(--bg-input) var(--slider-percent, 100%), var(--bg-input) 100%);
  border-radius: 3px;
  margin-top: 4px;
}
.audio-popup-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.audio-popup-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}
.audio-popup-voice-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
}
.audio-popup-voice-settings:hover { background: var(--bg-input); }
.audio-popup-gear {
  font-size: 1.1rem;
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.settings-voice-section { margin-bottom: 24px; }
.settings-voice-section label { display: block; font-weight: 500; margin-bottom: 6px; }
/* „Laiko formatas“ – antraštė šiek tiek didesnė nei kiti h3, aiškiai balta */
.settings-time-format-section > h3.settings-voice-subheading {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 12px 0 12px;
}
.settings-time-format-section .settings-time-format-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
}
/* .settings-voice-section label { display: block } kitaip sudėtų radiją ir tekstą į stulpelį */
.settings-time-format-section.settings-voice-section label.settings-time-format-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-height: 22px;
  margin-bottom: 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: #fff;
  font-weight: 500;
}
.settings-time-format-option > span {
  line-height: 1.35;
  flex: 1;
  display: flex;
  align-items: center;
  color: inherit;
}
.settings-time-format-radio {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  align-self: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  vertical-align: middle;
  box-sizing: border-box;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.settings-time-format-radio:hover:not(:disabled) {
  border-color: var(--text-dim);
}
.settings-time-format-radio:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.settings-time-format-radio:checked {
  border-color: var(--accent);
  background: var(--accent);
  /* vidinis „taškas“ sutampa su nustatymų panelės fonu (--bg-side) */
  box-shadow: inset 0 0 0 3px var(--bg-side);
}
.settings-time-format-radio:disabled {
  opacity: 0.5;
  cursor: default;
}
.settings-voice-volume-label { margin-top: 12px !important; }

.settings-mic-test-wrap { margin-top: 12px; }
.settings-mic-test-btn {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.settings-mic-test-btn:hover { background: var(--accent-hover, #4a5fd4); }
.settings-mic-test-btn.testing { background: #c0392b; }
.settings-mic-test-btn.testing:hover { background: #a93226; }
.settings-mic-test-meter {
  margin-top: 10px;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}
.settings-mic-test-meter.hidden { display: none !important; }
.settings-mic-test-meter-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.05s ease-out;
}

.settings-voice-subheading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--text-dim);
  margin: 20px 0 12px;
}
.settings-voice-subheading:first-of-type { margin-top: 8px; }

.settings-voice-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
  margin-bottom: 8px;
}
@media (max-width: 720px) {
  .settings-voice-2col { grid-template-columns: 1fr; }
}
.settings-voice-col label:first-child { margin-top: 0; }
.settings-voice-col .settings-select { margin-bottom: 0; }

.settings-voice-filters-block {
  margin-top: 16px;
  padding-top: 4px;
}
.settings-voice-filters-block .settings-panel-hint { margin-top: 4px; margin-bottom: 10px; font-size: 0.8rem; }
.settings-voice-filters-block .settings-echo-hint { margin-bottom: 0; }

.settings-mic-test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 18px;
}
.settings-mic-test-meter-inline {
  flex: 1;
  min-width: 180px;
  max-width: 100%;
  height: 72px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
}
.settings-mic-test-meter-inline.hidden { display: none !important; }
.settings-mic-test-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 100%;
  width: 100%;
}
.settings-mic-test-bar {
  flex: 1;
  min-width: 2px;
  max-width: 8px;
  height: 8%;
  min-height: 3px;
  background: linear-gradient(180deg, var(--accent-hover, #6b7af0), var(--accent));
  border-radius: 2px;
  transition: height 0.04s ease-out;
  opacity: 0.9;
}

.settings-camera-preview-wrap {
  margin-top: 8px;
  margin-bottom: 12px;
}
.settings-camera-preview-inner {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  background: #0d0d12;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-camera-preview-inner.effect-blur .settings-camera-video {
  filter: blur(18px) saturate(1.05);
  transform: scale(1.08);
}
.settings-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.settings-camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}
.settings-camera-placeholder.hidden { display: none !important; }
.settings-camera-placeholder-icon { font-size: 40px !important; opacity: 0.5; }
.settings-camera-test-btn {
  margin-top: 10px;
  padding: 10px 18px;
  background: #5865f2;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.settings-camera-test-btn:hover { background: #4752c4; }
.settings-camera-test-btn.testing { background: #c0392b; }
.settings-camera-test-btn.testing:hover { background: #a93226; }

.settings-camera-preview-always-row { margin-top: 12px; }
.settings-camera-always-hint { margin-top: 4px !important; margin-bottom: 14px !important; font-size: 0.8rem; }
.settings-video-device-label-block {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  margin-top: 4px;
}

.settings-camera-system-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 10px 0 0;
  padding: 0;
  background: none;
  border: none;
  color: #23a559;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.settings-camera-system-link:hover {
  color: #1e8e4c;
}
.settings-camera-system-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-video-bg-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.settings-video-bg-card {
  width: 100px;
  padding: 0 0 8px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--bg-input);
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.settings-video-bg-card:hover { background: var(--bg-secondary, #1a1a22); }
.settings-video-bg-card.selected {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.12);
}
.settings-video-bg-thumb {
  display: block;
  width: 100%;
  height: 64px;
  border-radius: 6px 6px 0 0;
  margin-bottom: 6px;
}
.settings-video-bg-none {
  background: repeating-linear-gradient(45deg, #2a2a32, #2a2a32 6px, #1e1e26 6px, #1e1e26 12px);
  position: relative;
}
.settings-video-bg-none::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 28px;
  height: 28px;
  border: 3px solid var(--text-dim);
  border-radius: 50%;
  box-sizing: border-box;
}
.settings-video-bg-blur {
  background: linear-gradient(135deg, #6b5ce7 0%, #a29bfe 40%, #fd79a8 100%);
  filter: blur(10px);
  transform: scale(1.15);
}
.settings-video-bg-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0 4px;
  line-height: 1.2;
}

.settings-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.lang-dropdown-wrap { position: relative; }
.translator-target-lang-wrap { width: 100%; margin-bottom: 4px; }

/* AI vertėjas: ta pati „auto_awesome“ gradientinė ikona kaip inline vertimo ženkliuke */
.settings-translator-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 14px;
  padding: 0;
  border: none;
  font: inherit;
  font-weight: 700;
}
.settings-translator-section-icon.material-symbols-outlined {
  display: inline-block;
  font-family: 'Material Symbols Outlined';
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(125deg, #42a5f5 0%, #7e57c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  flex-shrink: 0;
  user-select: none;
}
.settings-translator-section-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #f2f3f5);
  letter-spacing: normal;
  line-height: 1.25;
}

.settings-translator-lang-save-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.settings-translator-lang-save-row .translator-target-lang-wrap {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  width: auto;
}
.settings-translator-lang-save-row .btn-confirm {
  flex-shrink: 0;
  white-space: nowrap;
}
.lang-dropdown-trigger {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: inherit;
}
.lang-dropdown-trigger:hover { border-color: #444; }
.lang-dropdown-value { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.lang-dropdown-arrow {
  font-family: 'Material Symbols Outlined';
  font-size: 20px;
  color: var(--text-dim);
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.lang-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  overflow: hidden;
}
.lang-dropdown-list {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #4a4a4f transparent;
}
.lang-dropdown-list::-webkit-scrollbar { width: 8px; }
.lang-dropdown-list::-webkit-scrollbar-track { background: transparent; }
.lang-dropdown-list::-webkit-scrollbar-thumb {
  background: #4a4a4f;
  border-radius: 4px;
}
.lang-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: #5a5a5f;
}
.lang-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
  text-align: left;
}
.lang-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
}
.lang-dropdown-item.active {
  background: rgba(0,200,83,0.15);
  color: var(--accent);
}
.lang-dropdown-item-left { display: flex; align-items: center; gap: 8px; }
.lang-dropdown-item-flag { font-size: 1.2rem; line-height: 1; }
.lang-dropdown-item-name { }
.lang-dropdown-item-lang { color: var(--text-dim); font-size: 0.85rem; }
.settings-volume-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--slider-percent, 100%), var(--bg-input) var(--slider-percent, 100%), var(--bg-input) 100%);
  border-radius: 3px;
  margin-top: 4px;
}
.settings-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.settings-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.modal-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: -8px 0 8px 0;
}

/* Pranešimo modalas: be „traukimo“ į viršų – tekstas aiškiai žemiau header juostos */
.modal.modal-report-message .modal-hint.modal-report-message-lead {
  margin: 14px 20px 10px 20px;
  font-size: 0.9rem;
}
.modal.modal-report-message .modal-hint.modal-report-sub-hint {
  margin: 6px 20px 10px 20px;
  font-size: 0.85rem;
}
.report-message-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.report-message-step.hidden {
  display: none !important;
}
.modal-report-sub-toolbar {
  padding: 4px 20px 10px 20px;
}
.modal-report-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 0 0 0 -8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  font-family: inherit;
}
.modal-report-back-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.modal-report-back-ico {
  font-size: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.modal-report-sub-heading {
  margin: 0 20px 4px 20px;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.modal-report-sub-list {
  padding-bottom: 8px;
}
.modal.modal-report-message .modal-hint.modal-report-step3-hint {
  margin: 6px 20px 10px 20px;
  font-size: 0.85rem;
}
.modal.modal-report-message p.modal-hint.modal-report-disclaimer {
  margin: 12px 20px 0 20px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-dim);
}
.modal-report-confirm-summary-wrap {
  margin: 0 20px 12px 20px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  max-height: min(120px, 22vh);
  overflow: auto;
}
.modal-report-confirm-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-report-note-label {
  display: block;
  margin: 0 20px 6px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}
.modal-report-textarea-wrap {
  margin: 0 20px 6px 20px;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.modal-report-optional-note {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 72px;
  max-height: 140px;
  min-width: 0;
}
.modal.modal-report-message .modal-hint.modal-report-note-foot {
  margin: 0 20px 14px 20px;
  font-size: 0.75rem;
}
.modal-report-step3-actions {
  padding: 0 20px 4px 20px;
  display: flex;
  justify-content: stretch;
}
.modal-report-step3-actions .btn-confirm {
  width: 100%;
}

.channel-type-select {
  margin-bottom: 16px;
}

.channel-type-select label {
  display: block;
  padding: 8px 0;
  cursor: pointer;
}

.channel-type-select input {
  margin-right: 8px;
}

.hidden { display: none !important; }

/* Auth ekranas – Login / Register (Discord stilius) */
.auth-overlay {
  position: fixed;
  top: 32px;   /* Žemiau titlebar – kad galėtum judinti langą ir uždaryti */
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}
.auth-overlay-brand {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: baseline;
  font-family: "Segoe UI Black", "Segoe UI", system-ui, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  letter-spacing: 0.02em;
  line-height: 1;
}
.auth-brand-t,
.auth-brand-rust {
  color: var(--text);
}
.auth-brand-au {
  color: var(--accent);
}
.auth-overlay.hidden { display: none !important; }
.auth-box {
  position: relative;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
}
.auth-box-header {
  margin: -8px -8px 8px -8px;
  padding: 8px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}
/* Auth: žymėti tik įvesties laukuose – ne antraštės, etiketės, nuorodos apačioje */
.auth-sub,
.auth-field-label,
.auth-field-hint,
.auth-switch,
.auth-link {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}
.auth-form h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}
.auth-box-header .auth-sub {
  margin-bottom: 16px;
}
.auth-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.auth-form {
  color-scheme: dark;
}
.auth-form input,
.auth-form button,
.auth-form a.auth-link,
.auth-switch a {
  -webkit-app-region: no-drag;
  app-region: no-drag;
}
.auth-form label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  margin-top: 16px;
}
.auth-form label:first-of-type { margin-top: 0; }
.auth-form label.auth-field-label {
  font-size: 0.875rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}
.auth-form label.auth-field-label .auth-req {
  color: #ed4245;
  margin-left: 2px;
  font-weight: 600;
}
.auth-form label.auth-field-label-optional {
  color: var(--text);
}
.auth-form label.auth-field-label:first-of-type { margin-top: 0; }
.auth-field-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
  margin-bottom: 0;
}
.auth-form input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 1rem;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
}
/* Klaida: turi likti raudona net su :focus / autofill (kitaip laimi žalias --accent) */
.auth-form input.auth-input-error,
.auth-form input.auth-input-error:focus,
.auth-form input.auth-input-error:-webkit-autofill,
.auth-form input.auth-input-error:-webkit-autofill:hover,
.auth-form input.auth-input-error:-webkit-autofill:focus,
.auth-form input.auth-input-error:-webkit-autofill:active,
.auth-form input.auth-input-error:autofill,
.auth-form input.auth-input-error:autofill:focus {
  border-color: #ed4245 !important;
}
.auth-field-error-msg {
  font-size: 0.8rem;
  color: #ed4245;
  margin: 6px 0 0 0;
  line-height: 1.35;
  min-height: 0;
}
.auth-field-error-msg[hidden] {
  display: none !important;
}
/* Naršyklės autofill – kitaip langelis tampa baltas / šviesiai mėlynas (WebView). */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
  border: 1px solid var(--border);
  transition: background-color 99999s ease-out 0s;
}
.auth-form input:-webkit-autofill:focus {
  border-color: var(--accent);
}
.auth-form input:autofill,
.auth-form input:autofill:hover,
.auth-form input:autofill:focus {
  box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
  border: 1px solid var(--border);
}
.auth-form input:autofill:focus {
  border-color: var(--accent);
}

/* Autofill fono spalva visur (modalai, nustatymai, paieška) – ne tik .auth-form */
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not([type='button']):not([type='submit']):-webkit-autofill,
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not([type='button']):not([type='submit']):-webkit-autofill:hover,
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not([type='button']):not([type='submit']):-webkit-autofill:focus,
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not([type='button']):not([type='submit']):-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
  transition: background-color 99999s ease-out 0s;
}
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not([type='button']):not([type='submit']):autofill,
textarea:autofill {
  box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
}

.auth-link {
  display: block;
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 8px;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-btn {
  width: 100%;
  padding: 12px;
  margin-top: 24px;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}
.auth-btn:hover { filter: brightness(1.1); }
.auth-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  margin-top: 12px;
}
.auth-btn-secondary:hover { background: var(--bg-input); }
.auth-switch {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.auth-switch a { color: var(--accent); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-divider {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 20px 0 12px;
}
.auth-pairing-url {
  font-size: 0.9rem;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 16px;
}
.auth-pairing-code {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 8px;
  text-align: center;
  color: var(--accent);
  margin: 16px 0;
}
.auth-pairing-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* Toast pranešimai */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-side);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Interaktyvus pranešimas: parsiųstas priedas (Tauri → kelias + mygtukai) */
.toast.toast--rich {
  pointer-events: auto;
  max-width: min(420px, 94vw);
  padding: 14px 16px;
  text-align: left;
}
.toast-download-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toast-download-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.toast-download-file {
  font-size: 0.9rem;
  color: var(--accent, #00c853);
  font-weight: 600;
}
.toast-download-loc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.35;
  word-break: break-all;
  margin-top: 2px;
}
.toast-download-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.toast-dl-btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}
.toast-dl-btn:hover {
  background: rgba(0, 200, 83, 0.12);
  border-color: var(--accent, #00c853);
}

/* Voice channel – dalyviai kaip Discord */
.voice-participants {
  list-style: none;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  width: 100%;
  max-width: 320px;
  align-self: center;
}
.voice-participant {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  margin-bottom: 8px;
}
.voice-participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.voice-participant-speaking .voice-participant-avatar { box-shadow: 0 0 0 2px var(--accent); }

/* Balso valdikliai – apačioje kaip Discord */
.voice-controls-bar {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-side);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 60px;
}
.voice-status-text {
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.voice-no-mic-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 8px;
}
.voice-bar-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.voice-bar-btn:hover {
  background: var(--border);
  border-color: var(--text-dim);
}
.voice-bar-btn.hidden { display: none !important; }
.voice-bar-join {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.voice-bar-join:hover {
  filter: brightness(1.1);
}
.voice-bar-disconnect {
  background: #c62828;
  color: #fff;
  border-color: #c62828;
}
.voice-bar-disconnect:hover {
  background: #b71c1c;
  border-color: #b71c1c;
}

/* Slankiklis: globaliai * (žr. :root + body po :root) – tas pats kaip messages-container */

/* Call modal */
/* Call panel – sidebar apačioje (draugų/pokalbių/channel zona) – Discord „Prisijungta Prie Pokalbio“ */
.call-sidebar-panel {
  flex-shrink: 0;
  background: var(--bg-input);
  border-radius: 10px;
  margin: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.call-sidebar-panel.hidden { display: none !important; }
.call-sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.call-sidebar-connection {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #22c55e;
  flex-shrink: 0;
}
.call-sidebar-status-text {
  font-size: 0.8rem;
  color: #22c55e;
  font-weight: 500;
}
.call-sidebar-peer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.call-sidebar-name {
  font-size: 0.85rem;
  color: var(--text-dim);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.call-sidebar-mic {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.5;
  flex-shrink: 0;
  transition: background 0.2s, opacity 0.2s;
}
.call-sidebar-mic.active { background: #22c55e; opacity: 1; box-shadow: 0 0 4px rgba(34,197,94,0.6); }
.call-sidebar-mic.inactive { background: #ef4444; opacity: 0.9; }
.call-sidebar-mic.silent { background: var(--text-dim); opacity: 0.65; box-shadow: none; }
.call-sidebar-hangup {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #c62828;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.call-sidebar-hangup:hover { opacity: 0.9; }
.call-sidebar-hangup .material-symbols-outlined { font-size: 18px; }
.call-sidebar-buttons {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
}
.call-sidebar-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--bg-panel);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.call-sidebar-btn:hover:not(:disabled) { background: var(--border); color: var(--text); }
.call-sidebar-btn:disabled { opacity: 0.5; cursor: default; }
.call-sidebar-btn .material-symbols-outlined { font-size: 20px; }

.call-sidebar-ice {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.25;
}
.call-sidebar-ice.hidden { display: none !important; }

/* DM skambutis – scena (Discord stilius) */
.dm-call-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  background: #000;
  border-radius: 0;
}
.dm-call-stage.hidden { display: none !important; }
.dm-call-stage-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  min-height: 0;
  position: relative;
  background: #000;
}
.dm-call-video-layer {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  z-index: 1;
}
.dm-call-video-layer.hidden {
  display: none !important;
}
/* LiveKit SFU: 16:9 plytelės (kameros standartas); dviese – 50/50, centruota vertikaliai jei telpa. */
.dm-call-video-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  gap: 6px;
  padding: 6px;
  align-content: center;
  justify-content: stretch;
  align-items: center;
}
.dm-call-video-canvas--1 {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  justify-items: center;
}
.dm-call-video-canvas--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}
.dm-call-video-canvas--many {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  grid-auto-rows: auto;
  align-content: center;
}
.dm-call-video-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 100%;
  align-self: center;
  justify-self: center;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0a0c;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.08);
  transition:
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}
.dm-call-video-tile--speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dm-call-voice-only-tile.dm-call-video-tile {
  background: transparent;
  border: none;
  box-shadow: none;
}
.dm-call-voice-only-tile.dm-call-video-tile.dm-call-video-tile--speaking {
  border: none;
  box-shadow: none;
}
/* Išeinantis skambutis (Skambinama… / Jungiamasi…): dvi 16:9 plytelės */
.dm-call-stage.dm-call-stage-outgoing-pulse .dm-call-voice-only-tile.dm-call-video-tile {
  background: #0a0a0c;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.dm-call-stage.dm-call-stage-outgoing-pulse .dm-call-voice-only-tile.dm-call-video-tile.dm-call-video-tile--speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
/* Įeinantis kvietimas – tos pačios dvi plytelės + rėmeliai kaip išeinančiame (ne viena kolona). */
.dm-call-stage.dm-call-stage-incoming-invite .dm-call-voice-only-tile.dm-call-video-tile {
  background: #0a0a0c;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.dm-call-stage.dm-call-stage-incoming-invite .dm-call-voice-only-tile.dm-call-video-tile.dm-call-video-tile--speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dm-call-video-tile-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  z-index: 0;
}
.dm-call-video-tile:not(.dm-call-video-tile--has-video) .dm-call-video-tile-video {
  display: none;
}
.dm-call-video-tile-avatar {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dm-call-video-tile--has-video .dm-call-video-tile-avatar {
  display: none;
}
/* Senas HTML / dubliuotas `friend-avatar` viduje – rodyti tik vieną sluoksnį. */
.dm-call-video-tile-avatar-inner .friend-avatar {
  display: none !important;
}
/* Vienas dydis visoje DM skambučio scenoje (balsas / LiveKit be vaizdo) – ne „40% plytelės“ po prisijungimo. */
.dm-call-video-tile-avatar-inner.friend-avatar {
  box-sizing: border-box;
  width: min(88px, 24vmin);
  height: min(88px, 24vmin);
  min-width: 48px;
  min-height: 48px;
  max-width: min(88px, 24vmin);
  max-height: min(88px, 24vmin);
  font-size: clamp(1rem, 3.2vmin, 1.65rem);
  border-radius: 50%;
}
.dm-call-video-layer--canvas-mode .dm-stage-remote-video,
.dm-call-video-layer--canvas-mode .dm-stage-local-video {
  display: none !important;
}
.dm-stage-remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.dm-stage-local-video {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: min(140px, 30vmin);
  max-height: 28%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.dm-call-stage-video-active .dm-call-stage-main {
  justify-content: flex-end;
  padding-top: 0;
}
.dm-call-stage-video-active .dm-call-stage-peer-name,
.dm-call-stage-video-active .dm-call-stage-meta {
  position: relative;
  z-index: 2;
}
/* Nuotolinis be vaizdo, vietinis su kamera: sluoksnis be „video-active“ (avataras centre + PiP). */
.dm-call-stage-video-hybrid .dm-call-stage-main {
  justify-content: flex-end;
  padding-top: 0;
}
.dm-call-stage-video-hybrid .dm-call-stage-peer-name,
.dm-call-stage-video-hybrid .dm-call-stage-meta {
  position: relative;
  z-index: 2;
}
.dm-stage-remote-video-hidden {
  visibility: hidden !important;
  pointer-events: none;
}
.dm-call-remote-avatar-fill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  pointer-events: none;
}
.dm-call-remote-avatar-fill.hidden {
  display: none !important;
}
.dm-call-remote-avatar-fill .friend-avatar,
.dm-call-remote-avatar-fill > img,
.dm-call-remote-avatar-fill img {
  width: min(120px, 26vmin);
  height: min(120px, 26vmin);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
}
.dm-call-remote-avatar-fill img {
  display: block;
}
/* Kai pašnekovas išėjo iš SFU, bet tu dar kambaryje – tik tavo plytelė */
.dm-call-stage.dm-call-stage-remote-left-wait .dm-call-voice-only-tile[data-dm-voice-tile='peer'] {
  display: none !important;
}
/* Grupinis LiveKit: iki 10 dalyvių – tinklelis 5×2 */
.dm-call-stage.dm-call-stage-group-call .dm-call-stage-main {
  overflow: hidden;
  min-height: 0;
}
/* Tinklelis užpildo sceną tarp įrankių ir pavadinimo / būsenos. */
.dm-call-stage.dm-call-stage-group-call .dm-call-stage-group-peer-row:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
}
.dm-call-stage-group-peer-row {
  --dm-group-grid-cols: 5;
  --dm-group-peer-av: min(76px, 13.5vmin);
  --dm-group-peer-halo: 16px;
  display: grid;
  grid-template-columns: repeat(var(--dm-group-grid-cols), minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-content: center;
  justify-items: center;
  gap: clamp(6px, 1.4vw, 12px);
  row-gap: clamp(8px, 2vw, 14px);
  width: 100%;
  max-width: min(100%, 520px);
  margin: 4px auto 0;
  padding: 10px 10px 12px;
  box-sizing: border-box;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (max-width: 420px) {
  .dm-call-stage-group-peer-row {
    --dm-group-grid-cols: 3;
    --dm-group-peer-av: min(68px, 12vmin);
    --dm-group-peer-halo: 14px;
    max-width: 100%;
  }
}
.dm-call-stage-group-peer-row.hidden {
  display: none !important;
}
.dm-call-stage-group-peer-av-wrap {
  /* --dm-group-peer-av / --dm-group-peer-halo paveldi iš .dm-call-stage-group-peer-row */
  position: relative;
  box-sizing: border-box;
  width: calc(var(--dm-group-peer-av) + 2 * var(--dm-group-peer-halo));
  height: calc(var(--dm-group-peer-av) + 2 * var(--dm-group-peer-halo));
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  --dm-voice-level: 0;
}
.dm-call-stage-group-peer-voice-ring {
  position: absolute;
  top: calc(var(--dm-group-peer-halo) - 4px);
  left: calc(var(--dm-group-peer-halo) - 4px);
  right: calc(var(--dm-group-peer-halo) - 4px);
  bottom: calc(var(--dm-group-peer-halo) - 4px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 0.06s linear;
}
.dm-call-stage:not(.dm-call-stage-outgoing-pulse) .dm-call-stage-group-peer-voice-ring {
  box-shadow: 0 0 0 calc(var(--dm-voice-level, 0) * 14px) rgba(34, 197, 94, 0.88);
}
.dm-call-stage-group-peer-av {
  position: relative;
  z-index: 1;
  width: var(--dm-group-peer-av);
  height: var(--dm-group-peer-av);
  border-radius: 50%;
  background: var(--bg-input);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-weight: 600;
  font-size: clamp(1.1rem, 3.2vmin, 1.85rem);
  border: 2px solid rgba(255, 255, 255, 0.08);
}
.dm-call-stage-group-peer-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dm-call-stage-group-peer-more {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: min(100px, 22vmin);
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
}
/* 1:1 balso plytelės: tik avataras ant #000; žiedas tik aplink avatarą (ne visą „plytelę“) */
.dm-call-voice-only-tile .dm-call-voice-shell {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  --dm-voice-level: 0;
  box-sizing: border-box;
}
.dm-call-voice-avatar-ring-host {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dm-call-voice-avatar-ring-host .dm-call-voice-tile-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 0.06s linear;
}
.dm-call-voice-avatar-ring-host .friend-avatar {
  position: relative;
  z-index: 1;
}
.dm-call-voice-only-tile .dm-call-video-tile-avatar {
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  z-index: 1;
}
.dm-call-voice-only-tile .dm-call-video-tile-avatar-inner.friend-avatar {
  /* matmenys iš bendros .dm-call-video-tile-avatar-inner.friend-avatar taisyklės */
  border-radius: 50%;
}
/* Prisijungus: lengvas balsų indikatorius (ne iki ~14px×lygis – vizualiai „išpūsdavo“ avatarą). */
.dm-call-stage:not(.dm-call-stage-outgoing-pulse) .dm-call-voice-avatar-ring-host .dm-call-voice-tile-ring {
  box-shadow: 0 0 0 min(7px, calc(var(--dm-voice-level, 0) * 8px)) rgba(34, 197, 94, 0.65);
}
@keyframes dm-call-ring-pulse-calling {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.45);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(99, 102, 241, 0.12);
  }
}
/* Išeinantis skambutis: pulsas tik ant peer */
.dm-call-stage-outgoing-pulse #dm-call-voice-wrap-peer .dm-call-voice-tile-ring {
  animation: dm-call-ring-pulse-calling 1.45s ease-in-out infinite;
}
.dm-call-stage-incoming-invite #dm-call-voice-wrap-peer .dm-call-voice-tile-ring {
  animation: dm-call-ring-pulse-calling 1.45s ease-in-out infinite;
}
.dm-call-stage-peer-name {
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-align: center;
}
.dm-call-stage-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dm-call-stage-status {
  font-size: 0.88rem;
  color: #22c55e;
}
.dm-call-stage-route {
  font-size: 0.72rem;
  color: var(--text-dim);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-call-stage-route.hidden { display: none !important; }
.dm-call-stage-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px 14px;
  margin: 0 auto 8px;
  max-width: min(560px, 100%);
  background: transparent;
  border-radius: 0;
  border: none;
  position: relative;
}
/* Material Symbols – užpildytos piktogramos (Meet stilius) */
.gs-ms-fill,
.dm-call-tb-row .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.dm-call-tb-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.dm-call-tb-pill {
  display: flex;
  align-items: stretch;
  background: rgba(32, 33, 36, 0.92);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.dm-call-tb-pill--media {
  padding: 2px 4px;
  gap: 0;
}
.dm-call-tb-pill--center {
  padding: 2px;
}
.dm-call-tb-rtt {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.dm-call-tb-rtt--warn {
  color: #fbbf24;
}
.dm-call-tb-rtt--bad {
  color: #f87171;
}
.dm-call-tb-pill-divider {
  width: 1px;
  align-self: stretch;
  min-height: 28px;
  margin: 6px 2px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.dm-call-tb-split {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.dm-call-tb-mic-main {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px 0 0 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.dm-call-tb-mic-main:hover {
  background: rgba(255, 255, 255, 0.1);
}
.dm-call-tb-mic-main.call-bar-mic.active {
  background: rgba(34, 197, 94, 0.35);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.45);
}
.dm-call-tb-mic-main.call-bar-mic.inactive {
  background: rgba(239, 68, 68, 0.4);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}
.dm-call-tb-mic-main.call-bar-mic.silent {
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.85;
}
.dm-call-tb-mic-main.call-bar-mic.hidden {
  display: none !important;
}
.dm-call-tb-mic-main .material-symbols-outlined {
  font-size: 22px;
}
.dm-call-tb-chevron {
  width: 28px;
  height: 44px;
  border: none;
  border-radius: 0 999px 999px 0;
  margin-left: -2px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.dm-call-tb-chevron:hover {
  background: rgba(255, 255, 255, 0.12);
}
.dm-call-tb-chevron .material-symbols-outlined {
  font-size: 22px;
}
.dm-call-tb-device-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 220px;
  max-width: min(320px, 92vw);
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: rgba(42, 43, 48, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  z-index: 50;
}
.dm-call-tb-device-menu-empty {
  padding: 8px 12px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.dm-call-tb-device-item {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.88rem;
  cursor: pointer;
}
.dm-call-tb-device-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.dm-call-tb-cam-main.dm-call-tb-btn {
  border-radius: 999px 0 0 999px;
  width: 44px;
  height: 44px;
}
.dm-call-tb-cam-main.dm-call-tb-cam-active {
  background: rgba(34, 197, 94, 0.42) !important;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.5);
}
.dm-call-tb-center-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
}
.call-bar-mic.hidden {
  display: none !important;
}
.dm-call-tb-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.dm-call-tb-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}
.dm-call-tb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dm-call-tb-btn .material-symbols-outlined {
  font-size: 22px;
}
.dm-call-tb-spacer {
  flex: 1;
  min-width: 8px;
}
.dm-call-tb-hangup {
  width: 52px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: #e53935;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.dm-call-tb-hangup:hover {
  opacity: 0.92;
}
.dm-call-tb-hangup .material-symbols-outlined {
  font-size: 24px;
}
.dm-call-tb-util {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.dm-call-tb-util-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.dm-call-toolbar-normal,
.dm-call-toolbar-incoming {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.react-dm-call-toolbar-root {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.react-dm-call-toolbar-stage-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.dm-call-toolbar-incoming.hidden {
  display: none !important;
}
.dm-call-toolbar-rejoin {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.dm-call-toolbar-rejoin.hidden {
  display: none !important;
}
.dm-call-toolbar-normal.hidden {
  display: none !important;
}
.dm-call-tb-accept {
  width: 52px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: #15803d;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.dm-call-tb-accept:hover {
  opacity: 0.92;
}
.dm-call-tb-accept .material-symbols-outlined {
  font-size: 24px;
}
.dm-call-tb-accept-video {
  width: 52px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: #15803d;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.dm-call-tb-accept-video:hover:not(:disabled) {
  opacity: 0.92;
}
.dm-call-tb-accept-video .material-symbols-outlined {
  font-size: 24px;
}
/* Rejoin ekranas – viena plytelė (legacy); įeinantis kvietimas – dvi kaip išeinantis. */
.dm-call-stage.dm-call-stage-rejoin-prompt .dm-call-voice-only-tile[data-dm-voice-tile='local'] {
  display: none !important;
}
.dm-call-stage.dm-call-stage-rejoin-prompt .dm-call-video-canvas--2 {
  grid-template-columns: 1fr;
}
.dm-call-system-join {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.dm-call-system-join-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.dm-join-call-link,
.dm-ring-accept-call-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}
.dm-join-call-link:hover,
.dm-ring-accept-call-link:hover {
  color: var(--accent);
  filter: brightness(1.12);
  text-decoration: underline;
}

/* DM voice room (Discord-style) – prisijungimas prie to paties room po skambučio */
.dm-voice-room-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text);
}
.dm-voice-room-banner.hidden { display: none !important; }
.dm-voice-room-banner-text { flex: 1; color: var(--text-dim); }
.dm-voice-room-join-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: var(--accent, #5865f2);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}
.dm-voice-room-join-btn:hover { filter: brightness(1.08); }
.dm-voice-room-dismiss-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.1rem;
  line-height: 1;
}
.dm-voice-room-dismiss-btn:hover { background: var(--border); color: var(--text); }

/* Gaunamas skambutis – be blokuojančio overlay, tik centruota kortelė */
.call-modal {
  background: transparent;
  pointer-events: none;
  align-items: center;
  justify-content: center;
}
.call-modal.visible { display: flex !important; }
.call-modal.hidden { display: none !important; }
.call-modal-inner {
  pointer-events: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border-radius: 12px;
  padding: 24px;
  min-width: min(280px, 94vw);
  width: min(480px, 94vw);
  max-width: 480px;
  box-sizing: border-box;
}
.call-modal-inner.call-modal-incoming {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.call-modal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-input);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 32px;
  overflow: hidden;
  flex-shrink: 0;
}
.call-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.call-modal-peer {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.call-modal-title {
  display: block;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.call-modal-header { text-align: center; margin-bottom: 16px; position: relative; }
.call-mic-indicator {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.5;
  transition: background 0.2s, opacity 0.2s;
}
.call-mic-indicator.active {
  background: #22c55e;
  opacity: 1;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}
.call-mic-indicator.inactive {
  background: #ef4444;
  opacity: 0.8;
}
.call-modal-video-area {
  position: relative;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  min-height: 200px;
  max-height: min(50vh, 360px);
  background: #000;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}
.call-remote-video { width: 100%; height: 100%; object-fit: cover; }
.call-local-video {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--border);
}
.call-modal-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.call-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.call-btn .material-symbols-outlined { font-size: 28px; }
.call-btn-accept { background: var(--accent); color: #fff; }
.call-btn-accept-audio { background: var(--accent); color: #fff; }
.call-btn-reject { background: #c62828; color: #fff; }
.call-btn-end { background: #c62828; color: #fff; }
.call-btn-accept:hover, .call-btn-accept-audio:hover, .call-btn-reject:hover, .call-btn-end:hover { opacity: 0.9; }

/* Išeinantis skambutis – aiškesnis nei tik mini widget */
.call-modal-inner.call-modal-outgoing {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(34, 197, 94, 0.25);
  animation: call-outgoing-pulse 1.6s ease-in-out infinite;
}
@keyframes call-outgoing-pulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(34, 197, 94, 0.2); }
  50% { box-shadow: 0 8px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(34, 197, 94, 0.35); }
}
.call-modal-inner.call-modal-outgoing .call-modal-title {
  color: #22c55e;
  font-weight: 600;
}

/* Failo siuntimas – progresas kompozitoriuje (virš priedų / įvesties), ne fixed popup */
.upload-progress-overlay {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  max-width: min(420px, 94vw);
  pointer-events: none;
}
.upload-progress-overlay.upload-progress-overlay--composer {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  z-index: 4;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  flex-shrink: 0;
}
.upload-progress-overlay.hidden {
  display: none;
}
.upload-progress-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 44px 14px 16px;
  border-radius: 10px;
  background: var(--bg-elevated, #2a2d35);
  border: 1px solid var(--border, #3d4450);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.upload-progress-cancel {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim, #9aa0a6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.upload-progress-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #e8eaed);
}
.upload-progress-cancel .material-symbols-outlined {
  font-size: 20px;
}
.upload-progress-overlay--composer .upload-progress-card {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.upload-progress-icon {
  font-size: 32px;
  color: var(--accent, #00c853);
  flex-shrink: 0;
  line-height: 1;
}
.upload-progress-main {
  flex: 1;
  min-width: 0;
}
.upload-progress-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #e8eaed);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-progress-meta {
  font-size: 12px;
  color: var(--text-dim, #9aa0a6);
  margin-top: 2px;
}
.upload-progress-bar-wrap {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 10px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--accent, #00c853);
  transition: width 0.15s ease-out;
  position: relative;
  left: auto;
}
/* Siauras segmentas slenka (kaip „laukia tinklo“), ne visas plotis – kitaip atrodo kaip jau 100 %. */
.upload-progress-bar--indeterminate {
  position: absolute;
  left: 0;
  top: 0;
  width: 38% !important;
  max-width: 38%;
  transition: none;
  animation: upload-progress-indeterminate-slide 1.25s ease-in-out infinite;
  background: var(--accent, #00c853);
  box-shadow: 0 0 12px rgba(0, 200, 83, 0.35);
}
@keyframes upload-progress-indeterminate-slide {
  0% {
    left: 0;
  }
  50% {
    left: 62%;
  }
  100% {
    left: 0;
  }
}
.upload-progress-phase {
  font-size: 11px;
  color: var(--text-dim, #9aa0a6);
  margin-top: 6px;
}

/* ===== Pokalbio Gamespeak pakvietimo kortelė (chat-link-embeds gamespeak-invite) ===== */
.chat-gamespeak-invite-embed {
  width: 100%;
  max-width: 432px;
  margin-top: 6px;
}
.chat-gamespeak-invite-card {
  background: var(--bg-elevated, #2b2d31);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.chat-gamespeak-invite-banner {
  /* LOCKED – banner aukštis suderinta su avataro pozicija (žr. .chat-gamespeak-invite-icon). NEKEISTI. */
  height: 76px;
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.18), rgba(0, 200, 83, 0.04));
}
.chat-gamespeak-invite-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 6px 14px;
}
.chat-gamespeak-invite-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background-color: var(--accent, #00c853);
  background-size: cover;
  background-position: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  flex: 0 0 auto;
  /* Avataro pozicija (banner 76px + margin-top -82px) – patvirtinta savininko. NEKEISTI be aiškaus prašymo. */
  margin-top: -82px;
  border: 4px solid var(--bg-elevated, #2b2d31);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.chat-gamespeak-invite-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  /* Pavadinimo pozicija – `position: relative` + `top` (NE margin), kad NEPAVEIKTŲ flex/`align-items` skaičiavimo ir avataras liktų LOCKED vietoje. */
  position: relative;
  top: -8px;
}
.chat-gamespeak-invite-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-gamespeak-invite-meta {
  font-size: 13px;
  color: var(--text-dim, #b5bac1);
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-gamespeak-invite-stats {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.chat-gamespeak-invite-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.chat-gamespeak-invite-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.chat-gamespeak-invite-dot--online { background: #23a55a; }
.chat-gamespeak-invite-dot--total { background: #80848e; }
.chat-gamespeak-invite-created {
  color: var(--text-dim, #80848e);
  font-size: 12px;
}
.chat-gamespeak-invite-join {
  margin: 10px 14px 14px 14px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: var(--accent, #00c853);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.12s ease;
}
.chat-gamespeak-invite-join:hover:not(:disabled) {
  filter: brightness(1.08);
}
.chat-gamespeak-invite-join:disabled {
  opacity: 0.6;
  cursor: default;
}
.chat-gamespeak-invite-card--invalid .chat-gamespeak-invite-icon {
  background-color: var(--danger, #ed4245);
}
.chat-gamespeak-invite-card--invalid .chat-gamespeak-invite-name {
  color: var(--text-dim, #b5bac1);
}

/* ===== Serverio antraštės kontekstinis meniu (Discord stilius) =====
       Trigger – `#server-name-trigger` (h2 + chevron); meniu – `#server-context-menu`.
       Pasiekiama tik kai `setServerContextMenuEnabled(true)` (pasirinktas serveris). */
.sidebar-header-title-wrap { position: relative; }

.server-name-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  transition: background-color 120ms ease, color 120ms ease;
}
.server-name-trigger:hover:not(:disabled) {
  background-color: var(--bg-hover, rgba(255, 255, 255, 0.06));
}
.server-name-trigger:disabled,
.server-name-trigger.is-disabled {
  cursor: default;
  opacity: 1;
}
.server-name-trigger:disabled .server-name-chevron,
.server-name-trigger.is-disabled .server-name-chevron {
  display: none;
}
.server-name-trigger > #server-name {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-name-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 22px !important;
  line-height: 1;
  color: var(--text-dim, #888);
  transition: transform 150ms ease, color 120ms ease;
}
.server-name-trigger[aria-expanded='true'] .server-name-chevron {
  transform: rotate(-180deg);
  color: var(--text, #e0e0e0);
}
.server-name-trigger:hover:not(:disabled) .server-name-chevron {
  color: var(--text, #e0e0e0);
}

.server-name-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 8px;
  z-index: 90;
  background: var(--bg-elevated, var(--bg-input, #2a2a2e));
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.server-name-menu.hidden { display: none !important; }
.server-name-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text, #e0e0e0);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.server-name-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.server-name-menu-icon {
  font-size: 18px !important;
  flex: 0 0 auto;
  color: var(--text-dim, #888);
}
.server-name-menu-label { flex: 1 1 auto; min-width: 0; }
.server-name-menu-divider {
  height: 1px;
  background: var(--border, #333);
  margin: 4px 0;
}
.server-name-menu-item.is-danger { color: #ed4245; }
.server-name-menu-item.is-danger .server-name-menu-icon { color: #ed4245; }
.server-name-menu-item.is-danger:hover {
  background: rgba(237, 66, 69, 0.12);
}

/* ===== Serverio nustatymų modalas (Discord stilius – pilno ekrano dialogas
       su kairiuoju meniu ir ESC mygtuku dešinėje viršuje). HTML – `#server-settings-modal`.
       JS – `src/server-settings-modal-ui.js`. Backend – `GET/PATCH /api/servers/:id/profile`. */
#server-settings-modal.modal-overlay {
  z-index: 12100;
  background: rgba(0, 0, 0, 0.85);
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
#server-settings-modal.modal-overlay.visible { display: flex; }

.server-settings-modal {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.server-settings-sidebar {
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 60px 0 16px 0;
  overflow-y: auto;
}
.server-settings-side-name {
  padding: 0 18px 8px;
  margin: 0 0 6px 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.server-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.server-settings-nav-group {
  padding: 14px 18px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.server-settings-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 16px);
  margin: 0 8px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.server-settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.server-settings-nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.server-settings-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}
.server-settings-nav-item.is-danger {
  color: #ed4245;
}
.server-settings-nav-item.is-danger:hover {
  background: rgba(237, 66, 69, 0.12);
  color: #ed4245;
}
.server-settings-nav-trash {
  font-size: 18px !important;
  color: #ed4245;
}

.server-settings-content {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.server-settings-content-header {
  padding: 60px 60px 0 40px;
  flex: 0 0 auto;
}
.server-settings-content-title {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}
.server-settings-content-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 60px 40px 40px;
  max-width: 740px;
}

.server-settings-panel { display: none; }
.server-settings-panel.active { display: block; }
.server-settings-panel-desc {
  margin: 0 0 24px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-dim);
}
.server-settings-panel-empty {
  margin: 24px 0;
  font-size: 0.95rem;
  color: var(--text-dim);
  font-style: italic;
}

.server-settings-field {
  margin-bottom: 28px;
}
.server-settings-field-label {
  display: block;
  margin: 0 0 8px 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.server-settings-field-hint {
  margin: -4px 0 12px 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.server-settings-field-input,
.server-settings-field-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color 120ms ease;
}
.server-settings-field-input:focus,
.server-settings-field-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.server-settings-field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
.server-settings-field-counter {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: right;
}

.server-settings-icon-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.server-settings-icon-preview {
  width: 100px;
  height: 100px;
  /* Squircle (Discord stilius) – serveris ne apvalus, o kvadratas su apvaliais kampais.
     ~22% nuo dydžio = 22px – atitinka kitus serverio piktogramos elementus. */
  border-radius: 22px;
  background: var(--bg-input) center/cover no-repeat;
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.6rem;
  font-weight: 600;
  flex: 0 0 auto;
}
.server-settings-icon-preview.has-image { border-style: solid; }
.server-settings-icon-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.server-settings-icon-change,
.server-settings-icon-remove {
  font-size: 0.85rem;
  padding: 8px 16px;
}

/* Save toolbar – fiksuotas apačioje, kai yra neišsaugotų pakeitimų */
.server-settings-save-bar {
  position: absolute;
  left: 40px;
  right: 60px;
  bottom: 24px;
  background: #111214;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: server-settings-save-bar-in 180ms ease-out;
}
.server-settings-save-bar.hidden { display: none !important; }
.server-settings-save-text {
  font-size: 0.9rem;
  color: var(--text);
}
.server-settings-save-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
@keyframes server-settings-save-bar-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ESC – Discord stilius dešinėje viršuje. Nuo viršaus: 32px titlebar + 24px padding. */
.server-settings-close {
  position: absolute;
  top: 56px;
  right: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  z-index: 5;
  transition: color 120ms ease;
}
.server-settings-close:hover { color: var(--text); }
.server-settings-close-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
}
.server-settings-close-circle .material-symbols-outlined {
  font-size: 22px !important;
}
.server-settings-close-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Mažesni ekranai – sidebar siauresnė */
@media (max-width: 720px) {
  .server-settings-modal { grid-template-columns: 200px 1fr; }
  .server-settings-content-header { padding: 50px 60px 0 24px; }
  .server-settings-content-body { padding: 12px 24px 40px; }
  .server-settings-save-bar { left: 24px; right: 24px; }
}

/* ===== Vartotojo mini kortelė (popover) – iškyla paspaudus narį grupėje / DM
       NEKEISTI atsitiktinai – stiliai mirroruoja `.user-card-*` šoninėje juostoje
       (žr. _pre.css). Pakeitus, suderinti su index.html `#user-mini-card-popover`. */
.user-mini-card-popover {
  position: fixed;
  z-index: 2000;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--bg-side, #1a1a1e);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.user-mini-card-popover.hidden { display: none !important; }
.user-mini-card-banner {
  position: relative;
  height: 60px;
  background: linear-gradient(135deg, #2c2c33 0%, #1e1e23 100%);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.user-mini-card-actions {
  position: absolute;
  top: 8px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.user-mini-card-friend-wrap,
.user-mini-card-more-wrap {
  position: relative;
}
.user-mini-card-action-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.user-mini-card-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent, #00c853);
}
.user-mini-card-action-btn svg {
  width: 20px;
  height: 20px;
}
.user-mini-card-action-btn.status-friend { color: var(--accent, #00c853); }
.user-mini-card-action-btn.status-pending {
  color: var(--text-dim);
  cursor: default;
}
.user-mini-card-action-btn.status-pending:hover {
  background: rgba(0, 0, 0, 0.45);
  color: var(--text-dim);
}
.user-mini-card-action-btn.status-pending-received {
  color: var(--accent, #00c853);
  cursor: pointer;
}
.user-mini-card-friend-icon { display: inline-flex; }
.user-mini-card-friend-icon svg { width: 20px; height: 20px; }

.user-mini-card-remove-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-side, #2c2c33);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.user-mini-card-remove-popover:hover { background: rgba(255, 255, 255, 0.1); }
.user-mini-card-remove-popover.hidden { display: none !important; }

/* Daugiau meniu – flyout Į DEŠINĘ nuo popover'o (kad NEPRIDENGTŲ kortelės turinio).
   `more-wrap` šliejasi prie banner viršaus-dešinės; `left: calc(100% + 8px)` perkelia jį šalia. */
.user-mini-card-more-menu {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  min-width: 240px;
  background: var(--bg-elevated, #2b2d31);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-mini-card-more-menu.hidden { display: none !important; }
/* Submeniu „Pakviesti į serverį" iškrenta Į KAIRĘ – į dešinę jau yra atvertas pagrindinis meniu. */
.user-mini-card-more-submenu-wrap { position: relative; }
.user-mini-card-more-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
}
.user-mini-card-more-item:hover { background: rgba(255, 255, 255, 0.06); }
.user-mini-card-more-item.is-danger { color: #ed4245; }
.user-mini-card-more-item.is-danger:hover { background: rgba(237, 66, 69, 0.12); }
.user-mini-card-more-label { flex: 1; }
.user-mini-card-more-chevron { color: var(--text-dim); margin-left: 8px; }
.user-mini-card-more-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.user-mini-card-invite-submenu {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
  min-width: 200px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--bg-elevated, #2b2d31);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-height: 280px;
  overflow-y: auto;
  z-index: 120;
}
.user-mini-card-invite-submenu.hidden { display: none !important; }
.user-mini-card-invite-server-item {
  display: flex;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-size: 0.88rem;
}
.user-mini-card-invite-server-item:hover { background: rgba(255, 255, 255, 0.06); }
.user-mini-card-invite-server-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-mini-card-invite-empty {
  padding: 8px 10px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.user-mini-card-body {
  padding: 0 16px 16px;
  margin-top: -32px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.user-mini-card-avatar-wrap {
  position: relative;
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 12px;
}
.user-mini-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--bg-side, #1a1a1e);
  background: var(--accent, #00c853);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.7rem;
  box-sizing: border-box;
}
.user-mini-card-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid var(--bg-side, #1a1a1e);
  box-sizing: border-box;
}
.user-mini-card-status.status-online { background: #22c55e; }
.user-mini-card-status.status-offline { background: #6b7280; }
.user-mini-card-status.hidden { display: none !important; }
.user-mini-card-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
}
.user-mini-card-username {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.user-mini-card-about {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.35;
  margin: 0 0 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.user-mini-card-about.hidden { display: none; }
.user-mini-card-mutual-row {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 6px;
}
.user-mini-card-mutual-row:last-of-type { margin-bottom: 0; }
.user-mini-card-mutual-row:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.user-mini-card-mutual-row:hover .user-mini-card-mutual-chevron { color: var(--text); }
.user-mini-card-mutual-label { flex: 1; }
.user-mini-card-mutual-count { margin-right: 8px; color: var(--text-dim); }
.user-mini-card-mutual-chevron {
  font-size: 1.05rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}
.user-mini-card-mutual-row.expanded .user-mini-card-mutual-chevron {
  transform: rotate(90deg);
}
.user-mini-card-mutual-dropdown {
  max-height: 160px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin-bottom: 6px;
  padding: 6px 0;
}
.user-mini-card-mutual-dropdown.hidden { display: none !important; }
.user-mini-card-mutual-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--text);
}
.user-mini-card-mutual-dropdown-item[data-server-id] {
  cursor: pointer;
}
.user-mini-card-mutual-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.user-mini-card-mutual-dropdown .mutual-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent, #00c853);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 600;
}
.user-mini-card-mutual-empty {
  padding: 8px 12px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ===== Settings → Profiliai panelė =====
   JS: src/profiles-settings-ui.js
   HTML: #settings-panel-profiles index.html
   API: GET/PATCH /api/servers/:id/me */
.profiles-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 16px 0 18px 0;
}
.profiles-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 10px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.profiles-tab:hover { color: var(--text); }
.profiles-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.profiles-tab-panel { display: none; }
.profiles-tab-panel.active { display: flex; flex-direction: column; }

.profiles-main-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}
.profiles-main-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-input-soft, rgba(255, 255, 255, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.4rem;
  color: var(--text-dim);
  font-weight: 600;
}
.profiles-main-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profiles-main-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.profiles-main-handle {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.profiles-main-edit-btn {
  white-space: nowrap;
}

.profiles-server-picker-label {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  font-weight: 600;
  margin: 8px 0 8px 0;
}
.profiles-server-picker {
  position: relative;
  margin-bottom: 22px;
}

/* Custom „Discord-style" trigger – serverio ikona + vardas + chevron */
.profiles-server-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.profiles-server-trigger:hover { background: rgba(255,255,255,0.04); }
.profiles-server-trigger[aria-expanded="true"] {
  border-color: var(--accent);
}
.profiles-server-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.profiles-server-trigger-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.85rem;
}
.profiles-server-trigger-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profiles-server-icon-letter { line-height: 1; }
.profiles-server-trigger-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profiles-server-trigger-chevron {
  font-size: 22px;
  color: var(--text-dim);
  transition: transform 0.12s ease;
}
.profiles-server-trigger[aria-expanded="true"] .profiles-server-trigger-chevron {
  transform: rotate(180deg);
}

/* Dropdown'as su serverių sąrašu */
.profiles-server-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 6px;
  z-index: 30;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profiles-server-menu.hidden { display: none; }
.profiles-server-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.92rem;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.profiles-server-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.profiles-server-menu-item.is-selected {
  background: rgba(46, 204, 113, 0.18);
  color: var(--text);
}
.profiles-server-menu-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.85rem;
}
.profiles-server-menu-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profiles-server-menu-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profiles-server-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profiles-server-fields > label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-top: 6px;
}
.profiles-server-fields input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.12s ease;
}
.profiles-server-fields input[type="text"]:focus {
  border-color: var(--accent);
}
.profiles-server-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}
.profiles-server-status {
  margin: 8px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 1.2em;
}
.profiles-server-status[data-kind="ok"] { color: var(--accent); }
.profiles-server-status[data-kind="error"] { color: #ed4245; }
.profiles-server-empty {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ============================================================
   Profiliai – Discord-stiliaus 2-stulpelių grid (forma + peržiūra)
   Naudojama tiek pagrindinio profilio, tiek serverio profilio tab'uose.
   ============================================================ */
.profiles-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 32px;
  align-items: start;
  margin-top: 6px;
}
@media (max-width: 900px) {
  .profiles-grid { grid-template-columns: 1fr; }
}

.profiles-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.profiles-field-label {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  font-weight: 600;
  margin-top: 4px;
}
.profiles-text-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.12s ease;
}
.profiles-text-input:focus { border-color: var(--accent); }

/* @vartotojo vardas + kodas (read-only) viršuje su „Kopijuoti" mygtukais. */
.profiles-identity-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}
.profiles-identity-row .profiles-identity-field { display: flex; flex-direction: column; gap: 6px; }
.profiles-identity-hint { margin: 8px 0 0 0; }
.profiles-copy-input {
  position: relative;
  display: flex;
  align-items: stretch;
}
.profiles-copy-input .profiles-text-input {
  flex: 1 1 auto;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  cursor: text;
  user-select: all;
  color: var(--text);
}
.profiles-copy-input .profiles-text-input[readonly] {
  background: var(--bg-input);
  color: var(--text);
}
.profiles-copy-input .profiles-text-input[readonly]:focus {
  border-color: var(--accent);
  outline: none;
}
.profiles-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 1px solid transparent;
  color: var(--text-dim);
  width: 40px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.profiles-copy-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.profiles-copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.profiles-copy-btn .material-symbols-outlined { font-size: 20px; }
/* „Nukopijuota" feedback'as – mygtukas trumpam pažaliuoja (be toast). */
.profiles-copy-btn.copied {
  background: rgba(46, 204, 113, 0.18);
  color: #2ecc71;
  border-color: #2ecc71;
}
.profiles-copy-input:has(.profiles-copy-btn.copied) .profiles-text-input {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.10);
}
@media (max-width: 720px) {
  .profiles-identity-row { grid-template-columns: 1fr; }
}

.profiles-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0 6px 0;
}

.profiles-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.profiles-avatar-mini {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-input-soft, rgba(255,255,255,0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-dim);
  flex: 0 0 64px;
}
.profiles-avatar-mini img { width: 100%; height: 100%; object-fit: cover; }
.profiles-avatar-mini--letter { background: rgba(46,204,113,0.18); color: var(--text); }
.profiles-avatar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Reklamjuostės spalvos pasirinkėjas (kvadratas su pieštuko ikona; HTML
   `<input type="color">` paslėptas, bet sukelia native dialogą paspaudus) */
.profiles-banner-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.profiles-banner-swatch {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  overflow: hidden;
  background: #1f2937;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: box-shadow 0.12s ease;
}
.profiles-banner-swatch:hover {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 0 0 2px rgba(255,255,255,0.08);
}
.profiles-banner-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profiles-banner-swatch { padding: 0; }
.profiles-banner-swatch .material-symbols-outlined {
  font-size: 20px;
  pointer-events: none;
  color: #ffffff;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.profiles-banner-reset-btn { white-space: nowrap; }

/* „Pastarosios spalvos“ – iki 6, greitam pakartotiniam pasirinkimui (kaip Discord). */
.profiles-banner-recent {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profiles-banner-recent:empty { display: none; }
.profiles-banner-recent-cell {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.35);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.profiles-banner-recent-cell:hover {
  transform: scale(1.1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 0 0 1px rgba(255,255,255,0.18);
}
.profiles-banner-recent-cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tamsus custom color picker (atsidaro paspaudus reklamjuostės swatch'ą).
   Pakeičia native <input type="color">, kurio popup'as buvo šviesus / OS lygio. */
.color-picker-popover {
  position: fixed;
  z-index: 12300;
  width: 244px;
  padding: 12px;
  background: var(--bg-elev, #2b2d31);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
  -webkit-user-select: none;
}
.color-picker-popover.hidden { display: none; }
.color-picker-sv {
  display: block;
  width: 220px;
  height: 140px;
  border-radius: 6px;
  cursor: crosshair;
  border: 1px solid rgba(0, 0, 0, 0.4);
}
.color-picker-hue-wrap { padding: 2px 0; }
.color-picker-hue {
  display: block;
  width: 220px;
  height: 14px;
  border-radius: 7px;
  cursor: ew-resize;
  border: 1px solid rgba(0, 0, 0, 0.4);
}
.color-picker-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-picker-preview {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: #1f2937;
  flex: 0 0 auto;
}
.color-picker-hex {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.12s ease;
}
.color-picker-hex:focus { border-color: var(--accent); }
.color-picker-apply {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.12s ease;
}
.color-picker-apply:hover { filter: brightness(1.1); }
.color-picker-apply:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Aprašas */
.profiles-about-wrap { position: relative; }
.profiles-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px 26px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 90px;
  outline: none;
  transition: border-color 0.12s ease;
}
.profiles-textarea:focus { border-color: var(--accent); }
.profiles-about-counter {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
  pointer-events: none;
}

/* Peržiūros kortelė (Discord stilius: banner + avatar + body) */
.profiles-preview { min-width: 0; }
.profiles-preview-title {
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  font-weight: 600;
  margin: 4px 0 8px 0;
}
.profiles-preview-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}
.profiles-preview-banner {
  height: 70px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  transition: background 0.18s ease;
}
.profiles-preview-avatar-wrap {
  position: relative;
  height: 0;
  margin-left: 16px;
}
.profiles-preview-avatar {
  position: absolute;
  top: -38px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 4px solid var(--bg-input);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text);
  font-weight: 700;
  font-weight: 700;
  color: var(--text);
}
.profiles-preview-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profiles-preview-avatar--letter { background: var(--accent, #2ecc71); color: #fff; }

/* ============================================================
 * Avataro pasirinkimo modulis (Discord stiliaus „Vaizdo pasirinkimas")
 * ============================================================ */
/* Picker'is turi būti virš nustatymų modulio (12100) – kitaip dingsta po jais.
   Avataro redaktorius (12200) – dar virš picker'io, kad atsidaręs visą laiką matomas. */
#avatar-picker-modal.visible { z-index: 12150; }

.avatar-picker-modal {
  background: var(--bg-side, #1f2024);
  border: 1px solid var(--border, #2c2f33);
  border-radius: 12px;
  width: min(480px, 94vw);
  max-width: min(480px, 94vw);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.avatar-picker-modal .modal-confirm-dialog-header {
  padding: 14px 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft, rgba(255,255,255,0.06));
}
.avatar-picker-modal .modal-confirm-dialog-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.avatar-picker-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.avatar-picker-upload-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-input, #292b30);
  border: 1px dashed var(--border, #3a3d44);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 140px;
  height: 140px;
  align-self: center;
}
.avatar-picker-upload-card:hover {
  background: var(--bg-input-hover, #313338);
  border-color: var(--accent, #2ecc71);
}
.avatar-picker-upload-ico {
  font-size: 30px !important;
  color: var(--text-dim);
}
.avatar-picker-upload-card:hover .avatar-picker-upload-ico {
  color: var(--accent, #2ecc71);
}
.avatar-picker-upload-label {
  font-size: 0.95rem;
  font-weight: 600;
}
.avatar-picker-recent-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.avatar-picker-recent-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0 0 10px 0;
  line-height: 1.35;
}
.avatar-picker-recent-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.avatar-picker-recent-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--bg-input, #292b30);
  border: 1px solid var(--border, #3a3d44);
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  color: var(--text-dim);
}
.avatar-picker-recent-slot.is-empty { cursor: default; }
.avatar-picker-recent-slot.is-empty .material-symbols-outlined { font-size: 22px !important; opacity: 0.5; }
.avatar-picker-recent-slot.is-filled:hover { border-color: var(--accent, #2ecc71); }
.avatar-picker-recent-img {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}
.avatar-picker-recent-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-side, #1f2024);
  border: 1px solid var(--border, #3a3d44);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
}
.avatar-picker-recent-remove .material-symbols-outlined { font-size: 12px !important; }
.avatar-picker-recent-slot.is-filled:hover .avatar-picker-recent-remove { display: flex; }
.avatar-picker-recent-remove:hover { background: var(--danger, #ed4245); border-color: var(--danger, #ed4245); color: #fff; }
.profiles-preview-body {
  padding: 48px 16px 18px 16px;
}
.profiles-preview-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}
.profiles-preview-handle {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.profiles-preview-about {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Vardo lentelė (Discord nameplate) – spalvota juostelė kortelės apačioje
   su mažu apvaliu avataru ir display name. Spalva valdoma per nameplate
   color picker'į; jei nenustatyta – visas blokas paslėptas. */
.profiles-preview-nameplate-label {
  margin: 14px 0 6px 2px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}
.profiles-preview-nameplate {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--gs-nameplate-color, #5865f2) 0%,
    color-mix(in srgb, var(--gs-nameplate-color, #5865f2) 70%, #000 30%) 100%
  );
  min-height: 48px;
}
.profiles-preview-nameplate[hidden] { display: none; }
.profiles-preview-nameplate-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}
.profiles-preview-nameplate-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profiles-preview-nameplate-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Universalus nameplate „rėmelis" sąrašų eilutėms (DM draugai, new-chat,
   serverio nariai, žinučių autoriai). Bet kurį row'ą padaryk
   `position: relative;` ir uždėk `class="gs-has-nameplate"` + atribute
   `style="--gs-row-nameplate-color: #abcdef"` – tada gausis švelni
   gradient'inė juostelė kairėje, kuri neperdengs avataro/teksto. */
.gs-has-nameplate {
  position: relative;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--gs-row-nameplate-color, transparent) 55%, transparent) 0%,
      color-mix(in srgb, var(--gs-row-nameplate-color, transparent) 22%, transparent) 60%,
      transparent 100%
    );
}

/* Pasirinkta eilutė (DM `chats-list` arba „Draugai") – `.chat-item.active`
   ir `.friend-item.selected` kitur nustato vienos spalvos foną (`--bg-input`
   / `#3a3a3f`), kuris turi didesnį specifiškumą už `.gs-has-nameplate` ir
   užgožia gradient'ą. Sustipriname spalvą + uždedam šviesų overlay'ų
   pažymėjimo kontekstui ir naudojame `!important`, kad selected eilutė
   irgi rodytų vartotojo nameplate spalvą (taip pat veikia kortelei,
   į kurią dabar atvertas chat'as). */
.gs-has-nameplate.selected,
.gs-has-nameplate.active,
.chat-item.gs-has-nameplate.active,
.chat-item.gs-has-nameplate.selected,
.friend-item.gs-has-nameplate.selected {
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--gs-row-nameplate-color, transparent) 60%, transparent) 0%,
      color-mix(in srgb, var(--gs-row-nameplate-color, transparent) 26%, transparent) 55%,
      transparent 100%
    ),
    rgba(255, 255, 255, 0.06) !important;
}
/* Anksčiau buvo `::before` 3 px vertikali juostelė kairėje – savininkas
   paprašė ją pašalinti, paliekamas tik švelnus gradient'as. */

/* Vartotojo kortelės (`#user-card-sidebar`, `#user-mini-card-popover`)
   `@vartotojas` su mažu „kopijuoti" mygtuku šalia. Tiek `.user-card-username`,
   tiek `.user-mini-card-username` paryškinami, kad teksto / mygtuko grupė
   atrodytų kaip vienas elementas (Discord-like inline pill). */
.user-card-username,
.user-mini-card-username {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.gs-username-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-username-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim, #9ba1ad);
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}
.gs-username-copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary, #ffffff);
}
.gs-username-copy-btn:active { transform: scale(0.94); }
.gs-username-copy-btn .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}
.gs-username-copy-btn.copied {
  background: var(--accent, #5865f2);
  color: #ffffff;
}

/* Grupės / serverio narių dešinėje juostoje (`#group-members-list`)
   po display name nebereikia antros eilutės su „@vartotojas" – vardo
   lentelė yra pagrindinė identifikacija, antra eilutė tik užima erdvę.
   Taikoma tiek nariams su nameplate, tiek be jos. */
#group-members-list .invite-friend-meta,
#group-members-list .friend-meta {
  display: none !important;
}

/* Hover ant nameplate eilutės – paliekam pačią spalvą (paryškinam
   gradient'ą), pridedam švelnų balto overlay'ų, kad būtų matomas
   pelytės užvedimas, bet nameplate spalva neišnyktų į pilką
   `--bg-input` (kuris ateina iš bendro `.chat-item:hover`,
   `.group-member-item:hover`, `.new-chat-friend-item:hover` ir kt.).
   `!important` reikalingas, nes kitur tie selektoriai turi didesnį
   specifiškumą už `.gs-has-nameplate`. */
.gs-has-nameplate:hover {
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--gs-row-nameplate-color, transparent) 55%, transparent) 0%,
      color-mix(in srgb, var(--gs-row-nameplate-color, transparent) 24%, transparent) 55%,
      transparent 100%
    ),
    rgba(255, 255, 255, 0.05) !important;
}

/* Pagrindinio tab status */
#profiles-main-status {
  margin: 8px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 1.2em;
}
#profiles-main-status[data-kind="ok"] { color: var(--accent); }
#profiles-main-status[data-kind="error"] { color: #ed4245; }
#profiles-main-status[data-kind="saving"] { color: var(--text-dim); }

/* ============================================================
 * Profilio nuotraukos papuošalas (avatar decoration)
 *
 * Modulis `avatar-decoration-apply.js` deda `<img.gs-avatar-decoration>`
 * vidun bet kokio avataro elemento ir uždeda klasę `gs-has-decoration`
 * tėvui. Overlay šiek tiek didesnis už avataro dėžutę (Discord-stilius:
 * ~ +8 %), kad žiedas / karūna / liepsnos „apibrėžtų" avatarą, bet
 * neužimtų **daug daugiau** vietos nei pats avataras. Anksčiau buvo
 * +36 % (`inset: -18%`) – dekoracijos atrodė per didelės, ypač
 * sąrašuose ir mini-avataruose.
 * ============================================================ */
.gs-has-decoration { position: relative; }
.gs-avatar-decoration {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 2;
  display: block;
}

/* Settings → Profiliai → Pagrindinis profilis: papuošalų grid'as.
   Plytelės ~96px aukščio, 4 kolonos auto-fill, kad gražiai dėtųsi
   nepriklausomai nuo lango pločio. */
.profiles-decoration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin: 6px 0 4px 0;
}
.profiles-decoration-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 8px 6px;
  background: var(--bg-input, #1f2937);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-primary, #fff);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
  text-align: center;
  min-height: 96px;
}
.profiles-decoration-cell:hover {
  background: color-mix(in srgb, var(--bg-input, #1f2937) 85%, white 6%);
}
.profiles-decoration-cell.is-active {
  border-color: var(--accent, #5865f2);
  background: color-mix(in srgb, var(--accent, #5865f2) 16%, var(--bg-input, #1f2937) 84%);
}
.profiles-decoration-cell.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.profiles-decoration-cell.is-locked:hover { transform: none; }

.profiles-decoration-cell-preview {
  position: relative;
  width: 56px;
  height: 56px;
}
.profiles-decoration-cell-avatar {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.profiles-decoration-cell-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profiles-decoration-cell-overlay {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  pointer-events: none;
  display: block;
}
.profiles-decoration-cell-label {
  font-size: 0.72rem;
  line-height: 1.15;
  color: var(--text-dim, #9ba1ad);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.profiles-decoration-cell.is-active .profiles-decoration-cell-label {
  color: var(--text-primary, #fff);
}
.profiles-decoration-cell-lock {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  color: #fde68a;
}
.profiles-decoration-cell-lock .material-symbols-outlined {
  font-size: 14px;
}

/* „Be papuošalo" plytelė – paprasta perbraukto apskritimo ikona vietoje
   avataro+overlay'ų. Tas pats `is-active` stilius. */
.profiles-decoration-cell--none .profiles-decoration-none-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim, #9ba1ad);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}
.profiles-decoration-cell--none .profiles-decoration-none-mark .material-symbols-outlined {
  font-size: 28px;
}

/* GIF picker – kategorijų navigacijos antraštė (Discord stilius). Rodoma
 * kai vartotojas atvėrė konkrečią kategoriją – su „Atgal" mygtuku ir
 * kategorijos pavadinimu. Pradinis kategorijų rodinys (mėgstamiausi +
 * statinės kategorijos su preview) – be šios juostos. */
.gif-picker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 4px;
}
.gif-picker-header.hidden { display: none !important; }
.gif-picker-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}
.gif-picker-back:hover { background: rgba(255, 255, 255, 0.06); }
.gif-picker-back .material-icons { font-size: 18px; }
.gif-picker-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* Kategorijos plytelė kategorijų rodinyje – kvadratas su nedideliu GIF preview
 * fone ir ryškiu pavadinimu apačioje (Discord-stilius). Plytelė be preview
 * (`gif-picker-category--placeholder`) rodo neutralų gradient'ą su pavadinimu. */
.gif-picker-grid--categories {
  grid-auto-rows: 88px;
}
.gif-picker-cat-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.45), rgba(35, 39, 47, 0.65));
  border: none;
  padding: 0;
  display: block;
}
.gif-picker-cat-tile:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.gif-picker-cat-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85);
}
.gif-picker-cat-tile-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.gif-picker-cat-tile--favorites {
  background: linear-gradient(135deg, #f87171, #ec4899);
}
.gif-picker-cat-tile--trending {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* GIF kortelė turi mažą "favorite" ikoną viršuje dešinėje – paspaudus
 * pridedama į „Mėgstamiausi". */
.gif-picker-fav-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 2;
  padding: 0;
}
.gif-picker-item:hover .gif-picker-fav-btn { opacity: 1; }
.gif-picker-fav-btn .material-icons { font-size: 14px; }
.gif-picker-fav-btn.is-fav { color: #ef4444; opacity: 1; }

/* Naršyklės režimas (be Tauri) – paslėpti Tauri-only UI elementus.
 * `body.gamespeak-browser` klasė pridedama iš `src/browser-runtime.js`
 * (paleidžiama labai anksti `index.html`, jei `window.__TAURI__` nerastas).
 *
 * Tauri-specific elementai naršyklėje:
 *  - Custom titlebar valdikliai (minimize/maximize/close) – naršyklė turi savo lango chrome.
 *  - Atnaujinimų mygtukas – naršyklės versija atnaujinama F5/automatiškai per nginx.
 *  - Custom drag region – naršyklėje neveikia, tik užima vietą.
 */

body.gamespeak-browser .titlebar-update,
body.gamespeak-browser .titlebar-update-status,
body.gamespeak-browser .titlebar-minimize,
body.gamespeak-browser .titlebar-maximize,
body.gamespeak-browser .titlebar-close {
  display: none !important;
}

body.gamespeak-browser .titlebar-drag-bg {
  /* Drag region naršyklėje – neveikia, bet vizualiai gali likti
     (foninė juosta po brand'u). Paliekam matomą, tik išjungiam pointer events. */
  pointer-events: none;
}

/* Update modal pats nematomas (be `.visible`), tačiau jei dėl klaidos atsidarytų – paslėpiam. */
body.gamespeak-browser #update-modal {
  display: none !important;
}
