@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');/**
 * Auth Screen Styles
 */

.auth-screen {
  --auth-space-void: #02060d;
  --auth-space-deep: #050b14;
  --auth-space-panel: rgba(7, 13, 22, 0.88);
  --auth-space-panel-border: rgba(154, 170, 186, 0.16);
  --auth-space-panel-border-strong: rgba(91, 224, 214, 0.28);
  --auth-space-text: #f4f8fb;
  --auth-space-text-muted: rgba(186, 198, 207, 0.72);
  --auth-space-text-soft: rgba(162, 176, 186, 0.58);
  --auth-space-surface: rgba(255, 255, 255, 0.03);
  --auth-space-surface-strong: rgba(255, 255, 255, 0.06);
  --auth-space-accent-soft: rgba(91, 224, 214, 0.08);
  --auth-space-accent-border: rgba(91, 224, 214, 0.24);
  --auth-space-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #02050b;
  padding: 16px;
  overflow: hidden;
}

.auth-screen::before,
.auth-screen::after {
  display: none;
}

.auth-space-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-space-background__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-container {
  position: relative;
  z-index: 1;
  background: var(--auth-space-panel);
  border: 1px solid var(--auth-space-panel-border);
  border-radius: 24px;
  box-shadow: var(--auth-space-shadow);
  backdrop-filter: blur(20px);
  padding: 28px;
  max-width: 452px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.auth-container::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.auth-header {
  text-align: center;
  margin-bottom: 18px;
}

.auth-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.26));
}

.auth-header h1 {
  font-size: 30px;
  color: var(--auth-space-text);
  margin-bottom: 8px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.auth-subtitle {
  color: var(--auth-space-text-muted);
  font-size: 14px;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.5;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.auth-mode-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: var(--auth-space-surface);
  color: var(--auth-space-text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.auth-mode-button:hover:not(:disabled),
.auth-mode-button.is-active {
  transform: translateY(-1px);
  border-color: var(--auth-space-accent-border);
  background: var(--auth-space-accent-soft);
  color: var(--auth-space-text);
}

.auth-mode-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 0;
}

.auth-form-hint {
  color: var(--auth-space-text-soft);
  margin-top: -10px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.auth-form-hint-pending {
  color: var(--auth-space-text-muted);
}

.auth-form-hint.is-success {
  color: #7ce1a8;
}

.auth-form-hint.is-error {
  color: #ff9a9a;
}

.auth-form input {
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--auth-space-text);
  border-radius: 14px;
  font-size: 14px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.auth-form input::placeholder {
  color: rgba(184, 197, 206, 0.48);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--auth-space-panel-border-strong);
  background: var(--auth-space-surface-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}

.auth-form input:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.auth-qr-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-qr-text {
  margin: 0;
  color: var(--auth-space-text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-qr-actions .btn-secondary {
  flex: 1 1 180px;
}

.auth-qr-camera-shell {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #01040a;
  min-height: 220px;
}

.auth-qr-camera-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.auth-qr-camera-preview {
  filter: saturate(1.04) contrast(1.02);
}

.auth-qr-detection-frame {
  position: absolute;
  border: 3px solid rgba(91, 224, 214, 0.96);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(1, 4, 10, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 28px rgba(91, 224, 214, 0.32);
  pointer-events: none;
  animation: auth-qr-detection-pulse 0.9s ease-in-out infinite;
}

@keyframes auth-qr-detection-pulse {
  0% {
    transform: scale(0.985);
    box-shadow: 0 0 0 9999px rgba(1, 4, 10, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 18px rgba(91, 224, 214, 0.22);
  }

  50% {
    transform: scale(1);
    box-shadow: 0 0 0 9999px rgba(1, 4, 10, 0.12), 0 0 0 2px rgba(255, 255, 255, 0.12), 0 0 34px rgba(91, 224, 214, 0.42);
  }

  100% {
    transform: scale(0.985);
    box-shadow: 0 0 0 9999px rgba(1, 4, 10, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 18px rgba(91, 224, 214, 0.22);
  }
}

.auth-qr-form {
  gap: 10px;
}

.auth-qr-short-code-input {
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.18em;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-weight: 700;
}

.auth-qr-inline-status {
  margin-top: 0;
}

.auth-qr-meta {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.auth-qr-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--auth-space-text-soft);
  font-size: 13px;
}

.auth-qr-meta-row strong {
  color: var(--auth-space-text);
  font-weight: 600;
  text-align: right;
}

.auth-input-shell {
  position: relative;
}

.auth-input-shell input {
  width: 100%;
}

.auth-input-shell-password input {
  padding-right: 52px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(214, 223, 229, 0.78);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.auth-password-toggle:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--auth-space-text);
}

.auth-password-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-eye-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.auth-eye-icon.is-closed::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(-35deg);
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.btn-action {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: var(--auth-space-surface);
  color: var(--auth-space-text);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn-action-primary {
  border-color: rgba(91, 224, 214, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.btn-action:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--auth-space-accent-border);
  background: var(--auth-space-accent-soft);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

.btn-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-phantom {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--auth-space-text);
  border: 1px solid rgba(91, 224, 214, 0.18);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  margin-top: 8px;
}

.btn-phantom:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--auth-space-accent-border);
  background: var(--auth-space-accent-soft);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

.btn-phantom:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-divider {
  margin: 20px 0;
}

.btn-secondary {
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  color: var(--auth-space-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--auth-space-text);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.auth-info {
  margin-top: 28px;
  text-align: center;
}

.auth-info p {
  color: var(--auth-space-text-soft);
  font-size: 13px;
  margin: 8px 0;
}

.auth-status {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
}

.auth-status.info {
  background: rgba(255, 255, 255, 0.03);
  color: #c8d4dc;
}

.auth-status.success {
  background: rgba(34, 197, 94, 0.1);
  color: #b7f2ca;
}

.auth-status.error {
  background: rgba(239, 68, 68, 0.12);
  color: #ffb0b0;
}

.auth-warning {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  text-align: center;
}

.auth-warning p {
  margin: 0;
  color: var(--auth-space-text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-warning p + p {
  margin-top: 8px;
}

.auth-warning a {
  display: inline-block;
  color: #87e1d8;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-warning a:hover {
  color: #b4fff8;
}

@media (max-width: 480px) {
  .auth-container {
    padding: 24px 18px;
  }
  
  .auth-header h1 {
    font-size: 26px;
  }
  
  .auth-icon {
    width: 82px;
    height: 82px;
  }

  .auth-mode-switch {
    grid-template-columns: 1fr;
  }
}
/**
 * Avatar Component Styles
 * Универсальные стили для компонента Avatar
 */

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
}

.avatar:hover {
  transform: scale(1.05);
}

/* Размеры */
.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-md {
  width: 48px;
  height: 48px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
}

.avatar-xl {
  width: 96px;
  height: 96px;
}

/* Изображение */
.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback (буква) */
.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Размеры текста букв */
.avatar-sm .avatar-initial {
  font-size: 14px;
}

.avatar-md .avatar-initial {
  font-size: 20px;
}

.avatar-lg .avatar-initial {
  font-size: 28px;
}

.avatar-xl .avatar-initial {
  font-size: 40px;
}

/* Убираем hover эффект если не кликабельно */
.avatar:not([onclick]) {
  cursor: default;
  transform: none;
}

.avatar:not([onclick]):hover {
  transform: none;
}
/**
 * Global Search Styles
 */

.global-search {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.global-search--inline {
  position: relative;
  top: auto;
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0;
  border-bottom: none;
  background: transparent;
  overflow: visible;
}

.global-search .search-header {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 8px 12px;
  gap: 8px;
  transition: background 0.2s;
}

.global-search--inline .search-header {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 28, 38, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.global-search .search-header:focus-within {
  background: var(--hover-bg);
}

.global-search--inline .search-header:focus-within {
  background: rgba(22, 35, 47, 0.98);
  border-color: rgba(61, 199, 255, 0.32);
}

.global-search .search-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.global-search .search-header input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
}

.global-search--inline .search-header input {
  min-width: 0;
  font-size: 15px;
}

.global-search .search-header input::placeholder {
  color: var(--text-tertiary);
}

.global-search--inline .search-header input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.global-search .clear-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  border-radius: 50%;
  transition: background 0.2s;
}

.global-search .clear-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.global-search--inline .search-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: rgba(20, 29, 39, 0.98);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 10px;
  z-index: 30;
}

/* Tabs */
.global-search .search-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.global-search--inline .search-tabs {
  margin-top: 0;
}

.global-search .search-tabs::-webkit-scrollbar {
  display: none;
}

.global-search .search-tabs button {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.global-search .search-tabs button:hover {
  background: var(--hover-bg);
}

.global-search .search-tabs button.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Results Container */
.global-search .search-results {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  margin-top: 12px;
}

.global-search--inline .search-results {
  max-height: min(56vh, 520px);
}

.global-search .search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-tertiary);
}

.global-search .no-results {
  text-align: center;
  padding: 24px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* Message Results */
.message-results .result-group {
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}

.message-results .result-group:last-child {
  border-bottom: none;
}

.message-results .chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.message-results .chat-header:hover {
  background: var(--hover-bg);
}

.message-results .chat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.message-results .chat-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.message-results .message-count {
  font-size: 12px;
  color: var(--text-tertiary);
}

.messages-preview {
  margin-top: 8px;
}

.messages-preview .message-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.2s;
}

.messages-preview .message-item:hover {
  background: var(--hover-bg);
}

.messages-preview .message-content {
  flex: 1;
  display: flex;
  gap: 4px;
  font-size: 13px;
  overflow: hidden;
}

.messages-preview .sender {
  font-weight: 500;
  color: var(--primary-color);
  flex-shrink: 0;
}

.messages-preview .text {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-preview .text mark {
  background: var(--primary-color);
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
}

.messages-preview .date {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.messages-preview .show-more {
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--primary-color);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}

.messages-preview .show-more:hover {
  background: var(--hover-bg);
}

/* User/Group/Channel Results */
.user-results,
.group-results,
.channel-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-item,
.group-item,
.channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.user-item:hover,
.group-item:hover,
.channel-item:hover {
  background: var(--hover-bg);
}

.user-info,
.group-info,
.channel-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-info .name,
.group-info .name,
.channel-info .name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.user-info .username {
  font-size: 13px;
  color: var(--text-tertiary);
}

.group-info .members,
.channel-info .subscribers {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Spinner */
.spinner.small {
  width: 16px;
  height: 16px;
  border-width: 2px;
}
/* Confirm Dialog Styles */

.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.confirm-dialog {
  background: var(--bg-sidebar);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease-out;
}

.confirm-dialog h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.confirm-dialog p {
  margin: 0 0 24px 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-cancel,
.btn-confirm {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-cancel {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-cancel:hover {
  background: var(--hover-color);
}

.btn-confirm {
  background: var(--primary-color);
  color: white;
}

.btn-confirm:hover {
  background: var(--primary-hover);
}

.btn-confirm.danger {
  background: #ef4444;
}

.btn-confirm.danger:hover {
  background: #dc2626;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/**
 * Profile Edit Styles
 */

.profile-edit-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.profile-edit-container {
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  background: var(--bg-sidebar);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-edit-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-sidebar);
  position: sticky;
  top: 0;
  z-index: 10;
}

.profile-edit-header h2 {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-edit-header .btn-back {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.profile-edit-header .btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-save {
  padding: 8px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-save:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-edit-form {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
}

.profile-edit-form::-webkit-scrollbar {
  width: 6px;
}

.profile-edit-form::-webkit-scrollbar-track {
  background: transparent;
}

.profile-edit-form::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Avatar Upload */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.avatar-upload {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 3px solid var(--primary-color);
  transition: all 0.2s;
}

.avatar-upload:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(135, 116, 225, 0.3);
}

.avatar-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder-edit {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.avatar-placeholder-edit span {
  font-size: 40px;
}

.avatar-placeholder-edit p {
  font-size: 12px;
  color: white;
  font-weight: 600;
}

.btn-remove-avatar {
  margin-top: 12px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove-avatar:hover {
  background: var(--danger-color);
  color: white;
}

/* Form Fields */
.profile-field {
  margin-bottom: 20px;
}

.profile-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.profile-field input,
.profile-field textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-primary);
  transition: border-color 0.2s;
  font-family: inherit;
}

.profile-field input:focus,
.profile-field textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.profile-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-field input::placeholder,
.profile-field textarea::placeholder {
  color: var(--text-muted);
}

.profile-field textarea {
  resize: vertical;
  min-height: 80px;
}

.profile-field small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Error */
.profile-error {
  padding: 12px 16px;
  background: rgba(229, 57, 53, 0.1);
  border: 1px solid var(--danger-color);
  border-radius: 8px;
  color: var(--danger-color);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Info */
.profile-info {
  margin-top: 24px;
  padding: 12px 16px;
  background: rgba(135, 116, 225, 0.1);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
}

.profile-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .profile-edit-container {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .avatar-upload {
    width: 100px;
    height: 100px;
  }
}
/**
 * Toast Notification Styles
 */

.toast-layer {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}

.toast-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(7, 12, 20, 0.24) 0%, rgba(7, 12, 20, 0.08) 24%, rgba(7, 12, 20, 0) 62%);
  opacity: 1;
  transition: opacity 220ms ease;
}

.toast-layer.toast-layer-closing::before {
  opacity: 0;
}

.toast {
  --toast-accent: #34d399;
  --toast-border: rgba(52, 211, 153, 0.3);
  --toast-shadow: rgba(52, 211, 153, 0.1);
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 18px 20px 20px;
  border-radius: 14px;
  border: 1px solid var(--toast-border);
  background: linear-gradient(180deg, rgba(20, 28, 39, 0.96) 0%, rgba(11, 17, 27, 0.94) 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.02), 0 10px 28px var(--toast-shadow);
  backdrop-filter: blur(18px);
  opacity: 1;
  overflow: hidden;
  color: #f8fafc;
  transform-origin: center;
  animation: toastEnter 0.24s cubic-bezier(0.21, 1.02, 0.32, 1);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.toast.toast-closing {
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
}

@keyframes toastEnter {
  from {
    transform: translateY(16px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.toast-success {
  --toast-accent: #34d399;
  --toast-border: rgba(52, 211, 153, 0.34);
  --toast-shadow: rgba(52, 211, 153, 0.12);
}

.toast-error {
  --toast-accent: #fb7185;
  --toast-border: rgba(251, 113, 133, 0.34);
  --toast-shadow: rgba(251, 113, 133, 0.12);
}

.toast-info {
  --toast-accent: #60a5fa;
  --toast-border: rgba(96, 165, 250, 0.32);
  --toast-shadow: rgba(96, 165, 250, 0.12);
}

.toast-warning {
  --toast-accent: #f59e0b;
  --toast-border: rgba(245, 158, 11, 0.34);
  --toast-shadow: rgba(245, 158, 11, 0.12);
}

.toast-body {
  display: block;
  padding-bottom: 10px;
}

.toast-message {
  display: block;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--toast-accent);
  text-align: center;
}

.toast-progress {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 8px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.toast-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--toast-accent) 0%, rgba(255, 255, 255, 0.72) 100%);
  transform-origin: left center;
  animation: toastProgress var(--toast-duration) linear forwards;
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 640px) {
  .toast-layer {
    padding: 18px;
  }

  .toast {
    width: min(100%, 360px);
    padding: 16px 16px 18px;
    border-radius: 12px;
  }

  .toast-message {
    font-size: 16px;
  }

  .toast-progress {
    left: 16px;
    right: 16px;
    bottom: 8px;
  }
}
/**
 * Wallet Settings Styles
 */

/* Modal overlays с матовым стеклом */
.wallet-settings .modal-overlay,
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.wallet-settings .modal-content,
.modal-content {
  animation: slideUp 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
  /* Скрыть скроллбар */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.wallet-settings .modal-content::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  display: none;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.wallet-settings {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-primary);
}

.wallet-info-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px;
  margin: 16px;
  border-left: 4px solid var(--accent-color);
}

.wallet-info-card p {
  margin: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.wallets-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.wallet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 12px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.wallet-item.primary {
  border-color: var(--accent-color);
  background: var(--bg-hover);
}

.wallet-icon {
  font-size: 32px;
  min-width: 40px;
  text-align: center;
}

.wallet-info {
  flex: 1;
  min-width: 0;
}

.wallet-address {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', monospace;
}

.badge-primary {
  background: var(--accent-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.wallet-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.wallet-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-small:hover:not(:disabled) {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-small.btn-primary:hover:not(:disabled) {
  background: var(--accent-color);
}

.btn-small.btn-danger:hover:not(:disabled) {
  background: #dc3545;
}

.btn-add-wallet {
  margin: 16px;
  padding: 14px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-wallet:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-add-wallet:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.add-wallet-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  margin: 16px;
  border: 2px dashed var(--border-color);
}

.add-wallet-section h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--text-primary);
}

.wallet-connect-wrapper {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

.new-wallet-info {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
  text-align: center;
}

.new-wallet-info p {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text-primary);
}

.add-wallet-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.add-wallet-actions .btn-action {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.add-wallet-actions .btn-action:first-child {
  background: var(--accent-color);
  color: white;
}

.add-wallet-actions .btn-action:first-child:hover:not(:disabled) {
  background: var(--accent-hover);
}

.add-wallet-actions .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.add-wallet-actions .btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.wallet-limit-warning {
  background: #fff3cd;
  color: #856404;
  padding: 12px 16px;
  margin: 16px;
  border-radius: 8px;
  border-left: 4px solid #ffc107;
  font-size: 14px;
}

.wallet-status {
  padding: 12px 16px;
  margin: 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.wallet-status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.wallet-status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.loading,
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Dark theme adjustments */
[data-theme="dark"] .wallet-limit-warning {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

[data-theme="dark"] .wallet-status.success {
  background: rgba(40, 167, 69, 0.2);
  color: #5cb85c;
  border-color: rgba(40, 167, 69, 0.3);
}

[data-theme="dark"] .wallet-status.error {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .wallet-address {
    font-size: 13px;
  }
  
  .wallet-meta {
    font-size: 12px;
  }
  
  .btn-small {
    min-width: 32px;
    height: 32px;
    font-size: 16px;
  }
}
/**
 * Settings Menu Styles (Telegram-like)
 */

/* Icon container for settings items */
.settings-icon {
  width: 28px;
  height: 28px;
  background: rgba(135, 116, 225, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-icon .icon {
  width: 20px;
  height: 20px;
}

.settings-icon svg {
  width: 18px;
  height: 18px;
  color: var(--text-primary);
}

.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.settings-container {
  width: 420px;
  height: 100%;
  background: var(--bg-sidebar);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.settings-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.settings-panel::-webkit-scrollbar {
  width: 6px;
}

.settings-panel::-webkit-scrollbar-track {
  background: transparent;
}

.settings-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.settings-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Header */
.settings-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--bg-sidebar);
  z-index: 10;
}

.settings-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.btn-close,
.btn-back {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close:hover,
.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-back {
  font-size: 28px;
  font-weight: 300;
}

/* Profile Section */
.settings-profile {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  flex-shrink: 0;
  cursor: pointer;
}

.profile-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.profile-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.btn-edit-profile {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-edit-profile:hover {
  background: var(--primary-hover);
}

/* Settings List */
.settings-list {
  flex: 1;
  padding: 8px 0;
}

.settings-item {
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.settings-item:hover {
  background: var(--bg-hover);
}

.settings-item.danger-item:hover {
  background: rgba(229, 57, 53, 0.1);
}

.settings-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}

.settings-item-content {
  flex: 1;
  min-width: 0;
}

.settings-item-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.settings-item-title.danger {
  color: var(--danger-color);
}

.settings-item-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.settings-arrow {
  font-size: 24px;
  color: var(--text-muted);
  font-weight: 300;
}

/* Sections */
.settings-section {
  margin-top: 12px;
}

.section-title {
  padding: 12px 20px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-divider {
  height: 12px;
  background: transparent;
  border-bottom: 1px solid var(--border-color);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Footer */
.settings-footer {
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.settings-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0;
}

.settings-footer p:first-child {
  font-weight: 600;
  color: var(--text-secondary);
}

.settings-session-summary {
  margin: 16px 20px 0;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.settings-session-summary-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-session-summary-text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.settings-session-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.settings-action-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.settings-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.settings-action-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.settings-action-button.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.settings-action-button.primary {
  background: var(--primary-color);
  border-color: transparent;
  color: #ffffff;
}

.settings-action-button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.settings-action-button.danger {
  background: rgba(229, 57, 53, 0.16);
  border-color: rgba(229, 57, 53, 0.3);
  color: #ffb4b0;
}

.settings-inline-error {
  margin: 12px 20px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(229, 57, 53, 0.14);
  color: #ffb4b0;
  font-size: 13px;
}

.settings-empty-state {
  margin: 16px 20px 0;
  padding: 20px;
  border-radius: 16px;
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  text-align: center;
}

.settings-session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 24px;
}

.settings-session-card {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.settings-device-linking-card {
  margin: 16px 20px 0;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.settings-device-linking-qr-shell {
  width: 228px;
  height: 228px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-device-linking-short-code {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  color: var(--text-primary);
}

.settings-device-linking-countdown {
  font-size: 16px;
  font-weight: 700;
  color: #8ce2d9;
  letter-spacing: 0.04em;
}

.settings-device-linking-meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
}

.settings-device-linking-toolbar {
  padding: 0 20px;
}

.settings-device-linking-input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 14px;
}

.settings-device-linking-input::placeholder {
  color: var(--text-muted);
}

.settings-device-linking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-session-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.settings-session-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-session-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.settings-session-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.settings-session-badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-session-badge.current {
  background: rgba(38, 166, 154, 0.18);
  color: #8ce2d9;
}

.settings-session-badge.master {
  background: rgba(255, 193, 7, 0.16);
  color: #ffd666;
}

.settings-session-badge.limited {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.settings-session-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.settings-session-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-session-meta-item span {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-session-meta-item strong {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.settings-session-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.settings-approval-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.settings-approval-modal {
  width: min(520px, 100%);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  padding: 24px;
}

.settings-approval-modal__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-approval-modal__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ce2d9;
}

.settings-approval-modal__header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.settings-approval-modal__header p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-approval-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.settings-approval-modal__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-approval-modal__item span {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-approval-modal__item strong {
  font-size: 14px;
  color: var(--text-primary);
}

.settings-approval-modal__description {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.settings-approval-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* Responsive */
@media (max-width: 480px) {
  .settings-container {
    width: 100%;
  }

  .settings-session-meta {
    grid-template-columns: 1fr;
  }

  .settings-session-title-row {
    flex-direction: column;
  }

  .settings-session-badges {
    justify-content: flex-start;
  }

  .settings-approval-overlay {
    padding: 16px;
  }

  .settings-approval-modal {
    padding: 18px;
  }

  .settings-approval-modal__grid {
    grid-template-columns: 1fr;
  }

  .settings-approval-modal__actions {
    justify-content: stretch;
  }

  .settings-approval-modal__actions .settings-action-button {
    width: 100%;
  }
}

/* Backgrounds Grid */
.backgrounds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.background-option {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.background-option:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.background-option.active {
  border-color: var(--primary-color);
}

.background-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.background-color {
  width: 100%;
  height: 100%;
}

.background-default {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-chat);
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 19px,
      rgba(255,255,255,0.02) 19px,
      rgba(255,255,255,0.02) 20px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 19px,
      rgba(255,255,255,0.02) 19px,
      rgba(255,255,255,0.02) 20px
    );
}

.background-default span {
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px;
  text-align: center;
}

.background-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.background-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}

/**
 * Create Group/Channel Modal Styles
 */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-container {
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--bg-sidebar);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-header h2 {
  flex: 1;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-create {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-create:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-create:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-form {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-form::-webkit-scrollbar {
  width: 6px;
}

.modal-form::-webkit-scrollbar-track {
  background: transparent;
}

.modal-form::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Avatar Upload */
.avatar-upload-section {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.avatar-upload-label {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
  display: block;
}

.avatar-upload-label:hover {
  opacity: 0.8;
}

.avatar-upload-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder-upload {
  width: 100%;
  height: 100%;
  background: rgba(135, 116, 225, 0.1);
  border: 2px dashed rgba(135, 116, 225, 0.3);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
}

.avatar-placeholder-upload .icon-camera {
  width: 32px;
  height: 32px;
  background: rgba(135, 116, 225, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-placeholder-upload .icon-camera::before {
  content: '📷';
  font-size: 18px;
}

.avatar-placeholder-upload p {
  font-size: 12px;
  text-align: center;
  margin: 0;
  padding: 0 16px;
}

/* Form Fields */
.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.form-field small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: #ef4444;
  font-size: 14px;
  margin-bottom: 16px;
}

.form-info {
  background: rgba(135, 116, 225, 0.1);
  border: 1px solid rgba(135, 116, 225, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
}

.form-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Privacy Selector */
.privacy-selector {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.radio-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-primary);
  position: relative;
}

.radio-option:hover {
  border-color: var(--primary-color);
  background: rgba(135, 116, 225, 0.05);
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-option input[type="radio"]:checked + span::before {
  border-color: var(--primary-color);
  background: var(--primary-color);
}

.radio-option input[type="radio"]:checked + span::after {
  opacity: 1;
  transform: scale(1);
}

.radio-option input[type="radio"]:checked ~ * {
  color: var(--primary-color);
}

.radio-option span {
  position: relative;
  padding-left: 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.2s;
  user-select: none;
}

.radio-option span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-main);
  transition: all 0.2s;
}

.radio-option span::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  transition: all 0.2s;
}

.radio-option input[type="radio"]:checked ~ label {
  border-color: var(--primary-color);
  background: rgba(135, 116, 225, 0.1);
}

.privacy-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-primary);
}

.privacy-option:hover {
  border-color: var(--primary-color);
  background: rgba(135, 116, 225, 0.05);
}

.privacy-option.selected {
  border-color: var(--primary-color);
  background: rgba(135, 116, 225, 0.1);
}

.privacy-option input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--primary-color);
}

.privacy-option-content {
  flex: 1;
}

.privacy-option-content strong {
  display: block;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.privacy-option-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}
/**
 * Styles: EditContactLabelModal (v13.1)
 * Стили для модального окна редактирования меток контактов
 * - Раздельные блоки для custom_name и notes
 * - Отдельные кнопки сохранения/удаления для каждого поля
 * - Модалка подтверждения удаления
 * - Матовое стекло backdrop
 */

/* Modal Overlay с эффектом матового стекла */
.edit-contact-label-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.edit-contact-label-modal {
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  /* Скрыть скроллбар */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.edit-contact-label-modal::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.edit-contact-label-modal .modal-body {
  padding: 20px;
}

/* Contact Info */
.edit-contact-label-modal .contact-info {
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  text-align: center;
}

.edit-contact-label-modal .contact-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.edit-contact-label-modal .contact-username {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Form Sections (Independent blocks) */
.edit-contact-label-modal .form-section {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

/* Form Groups */
.edit-contact-label-modal .form-group {
  margin-bottom: 12px;
}

.edit-contact-label-modal .form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.edit-contact-label-modal .char-counter {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: normal;
}

.edit-contact-label-modal .char-counter.error {
  color: var(--color-danger);
  font-weight: 600;
}

/* Form Inputs */
.edit-contact-label-modal .form-input,
.edit-contact-label-modal .form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: border-color 0.2s;
}

.edit-contact-label-modal .form-input:focus,
.edit-contact-label-modal .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.edit-contact-label-modal .form-input.error,
.edit-contact-label-modal .form-textarea.error {
  border-color: var(--color-danger);
}

.edit-contact-label-modal .form-input:disabled,
.edit-contact-label-modal .form-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.edit-contact-label-modal .form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* Form Actions (Buttons for each section) */
.edit-contact-label-modal .form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.edit-contact-label-modal .form-actions .btn {
  flex: 1;
}

/* Validation Error */
.edit-contact-label-modal .validation-error {
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--bg-danger-light);
  border-left: 3px solid var(--color-danger);
  border-radius: 4px;
  font-size: 13px;
  color: var(--color-danger);
}

/* Hint Text */
.edit-contact-label-modal .hint-text {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-info-light);
  border-left: 3px solid var(--color-info);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Modal Footer */
.edit-contact-label-modal .modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.edit-contact-label-modal .footer-left,
.edit-contact-label-modal .footer-right {
  display: flex;
  gap: 10px;
}

/* Buttons */
.edit-contact-label-modal .btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.edit-contact-label-modal .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.edit-contact-label-modal .btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.edit-contact-label-modal .btn-primary {
  background: var(--color-primary);
  color: white;
}

.edit-contact-label-modal .btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.edit-contact-label-modal .btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.edit-contact-label-modal .btn-secondary:hover:not(:disabled) {
  background: var(--bg-tertiary);
}

.edit-contact-label-modal .btn-danger {
  background: var(--color-danger);
  color: white;
}

.edit-contact-label-modal .btn-danger:hover:not(:disabled) {
  background: var(--color-danger-dark);
}

/* Confirmation Modal */
.modal-confirm {
  max-width: 400px;
  width: 90%;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  /* Скрыть скроллбар */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-confirm::-webkit-scrollbar {
  display: none;
}

.modal-confirm h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-confirm p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-confirm .modal-actions {
  display: flex;
  gap: 10px;
}

.modal-confirm .modal-actions .btn {
  flex: 1;
}

/* Dark Theme */
[data-theme="dark"] .edit-contact-label-modal .form-input,
[data-theme="dark"] .edit-contact-label-modal .form-textarea {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .edit-contact-label-modal .form-section {
  background: var(--bg-tertiary);
}

/* Responsive */
@media (max-width: 600px) {
  .edit-contact-label-modal {
    width: 95%;
    max-width: none;
  }

  .edit-contact-label-modal .modal-footer {
    flex-direction: column;
    gap: 10px;
  }

  .edit-contact-label-modal .footer-left,
  .edit-contact-label-modal .footer-right {
    width: 100%;
  }

  .edit-contact-label-modal .form-actions {
    flex-direction: column;
  }

  .modal-confirm {
    width: 95%;
  }

  .modal-confirm .modal-actions {
    flex-direction: column;
  }
}
/* Contacts List Styles */

.contacts-list-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 100%;
  background: #1a1f2e;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 2000;
  animation: slideInLeft 0.3s ease-out;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.contacts-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.contacts-header .btn-back {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.contacts-header .btn-back:hover {
  background: var(--hover-bg);
}

.contacts-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.contacts-loading,
.contacts-error,
.contacts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.contacts-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.contacts-error button,
.contacts-empty button {
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.contacts-error button:hover,
.contacts-empty button:hover {
  opacity: 0.9;
}

.contacts-empty-hint {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

.contact-item:hover {
  background: var(--hover-bg);
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  cursor: pointer;
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.contact-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}

.contact-details {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.original-username {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-left: 6px;
  font-weight: 400;
}

.contact-bio {
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-notes {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-remove-contact {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  opacity: 0;
}

.btn-edit-label {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-small {
  width: 18px;
  height: 18px;
  filter: var(--icon-filter);
  transition: filter 0.2s;
}

.contact-item:hover .btn-remove-contact {
  opacity: 1;
}

.contact-item:hover .btn-edit-label {
  opacity: 1;
}

.btn-edit-label:hover {
  background: var(--hover-bg);
}

.btn-edit-label:hover .icon-small {
  filter: brightness(1.2);
}

.btn-remove-contact:hover {
  background: var(--danger-bg);
  color: var(--danger-color);
}

/* Scrollbar */
.contacts-list::-webkit-scrollbar {
  width: 6px;
}

.contacts-list::-webkit-scrollbar-track {
  background: transparent;
}

.contacts-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.contacts-list::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}
/* Attachment Card Styles */

.attachment-image {
  max-width: 400px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
}

.attachment-image:hover {
  opacity: 0.95;
}

.attachment-image img {
  width: 100%;
  height: auto;
  display: block;
}

.attachment-video {
  max-width: 500px;
  border-radius: 8px;
  overflow: hidden;
}

.attachment-video video {
  width: 100%;
  height: auto;
  display: block;
}

.attachment-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5f5f5;
  padding: 12px;
  border-radius: 8px;
  max-width: 400px;
}

.attachment-audio-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.attachment-audio-info {
  flex: 1;
  min-width: 0;
}

.attachment-audio-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-audio audio {
  width: 100%;
  height: 32px;
}

.attachment-document {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5f5f5;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  max-width: 400px;
}

.attachment-document:hover {
  background: #eeeeee;
}

.attachment-document-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.attachment-document-info {
  flex: 1;
  min-width: 0;
}

.attachment-document-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-document-size {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.attachment-document-download {
  font-size: 24px;
  flex-shrink: 0;
  opacity: 0.6;
}

.attachment-unavailable {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  max-width: 400px;
}

.attachment-unavailable-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #333);
  word-break: break-word;
}

.attachment-unavailable-text {
  font-size: 12px;
  color: #c62828;
}

.attachment-error {
  background: #ffebee;
  color: #c62828;
  padding: 20px;
  text-align: center;
  border-radius: 8px;
  font-size: 14px;
}

.attachment-error-text {
  color: #c62828;
  font-size: 12px;
}

.attachment-loading {
  background: #f5f5f5;
  padding: 40px;
  text-align: center;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.attachment-loading-text {
  color: #999;
  font-size: 12px;
  font-style: italic;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2196F3;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Lightbox для изображений */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-download {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.lightbox-download:hover {
  background: var(--primary-hover);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.emoji-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: text-bottom;
  user-select: none;
}

.emoji-icon-image,
.emoji-icon-fallback {
  display: block;
  width: 100%;
  height: 100%;
}

.emoji-inline {
  vertical-align: -0.18em;
}

.emoji-text__mentionLink {
  color: rgba(120, 214, 228, 0.92);
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  box-shadow: inset 0 -1px 0 rgba(120, 214, 228, 0.3);
  transition: color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.emoji-text__mentionLink:hover {
  color: #d8faff;
  background: rgba(120, 214, 228, 0.08);
  box-shadow: inset 0 -1px 0 rgba(120, 214, 228, 0.5);
}.message-reactions-wrap {
  position: relative;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-reactions-wrap.align-right {
  align-self: flex-end;
}

.message-reaction-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  pointer-events: none;
}

.message-reaction-dock.align-right {
  justify-content: flex-end;
}

.message-reaction-dock.align-left {
  justify-content: flex-start;
}

.message-reactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.message-reaction-dock .reaction-picker,
.message-reactions-wrap .reaction-picker {
  pointer-events: auto;
}

.reaction-bubble,
.message-reaction-add-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  color: #102033;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.message.other .reaction-bubble,
.message.other .message-reaction-add-button {
  background: rgba(216, 227, 238, 0.82);
  border-color: rgba(74, 102, 132, 0.18);
  color: #17314b;
}

.message.own .reaction-bubble,
.message.own .message-reaction-add-button {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.reaction-bubble:hover,
.message-reaction-add-button:hover {
  transform: translateY(-1px);
}

.reaction-bubble.own {
  background: #1d7df2;
  border-color: #1d7df2;
  color: #ffffff;
}

.reaction-bubble-count {
  font-weight: 600;
  min-width: 10px;
  text-align: center;
}

.reaction-bubble-emoji,
.message-reaction-add-icon {
  flex-shrink: 0;
}

.message-reaction-add-button {
  justify-content: center;
  min-width: 32px;
  padding: 4px 7px;
}

body[data-theme="dark"] .reaction-bubble,
body[data-theme="dark"] .message-reaction-add-button {
  background: rgba(18, 24, 38, 0.92);
  border-color: rgba(148, 163, 184, 0.2);
  color: #e5eefb;
}

body[data-theme="dark"] .reaction-bubble.own {
  background: #2a7fff;
  border-color: #2a7fff;
}

.channel-post-reaction-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}.reaction-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  z-index: 30;
  min-width: 220px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
}

.reaction-picker-left {
  left: 0;
}

.reaction-picker-right {
  right: 0;
}

.reaction-picker-title {
  font-size: 12px;
  font-weight: 600;
  color: #516074;
  margin-bottom: 10px;
}

.reaction-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.reaction-picker-item {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(226, 232, 240, 0.6);
  cursor: pointer;
  line-height: 1;
  transition: transform 0.15s ease, background-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reaction-picker-item:hover {
  transform: translateY(-1px) scale(1.04);
  background: rgba(191, 219, 254, 0.85);
}

body[data-theme="dark"] .reaction-picker {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.45);
}

body[data-theme="dark"] .reaction-picker-title {
  color: #c9d6e8;
}

body[data-theme="dark"] .reaction-picker-item {
  background: rgba(51, 65, 85, 0.85);
}

body[data-theme="dark"] .reaction-picker-item:hover {
  background: rgba(59, 130, 246, 0.3);
}

.reaction-picker-emoji {
  flex-shrink: 0;
}/**
 * VoiceMessage Styles
 */

.voice-message {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(330px, 72vw);
  min-width: 260px;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  --voice-bar-idle: rgba(104, 117, 138, 0.44);
  --voice-bar-active: rgba(86, 90, 210, 0.96);
  --voice-time-color: var(--text-secondary);
  --voice-speed-border: rgba(82, 94, 118, 0.34);
  --voice-speed-background: rgba(255, 255, 255, 0.42);
  --voice-speed-color: var(--text-primary);
  --voice-play-border: rgba(82, 94, 118, 0.48);
  --voice-play-background: rgba(255, 255, 255, 0.32);
  --voice-spinner-border: rgba(82, 94, 118, 0.2);
}

.voice-message:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.voice-message--revoked {
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.2);
  border-radius: 12px;
  padding: 8px 10px;
}

.voice-message-error {
  color: #f44336;
  font-size: 12px;
  margin-top: 4px;
}

.voice-message-play-button {
  width: 46px;
  height: 46px;
  min-width: 46px;
  background: var(--voice-play-background);
  border: 2px solid var(--voice-play-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  position: relative;
  padding: 0;
}

.voice-message-play-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.48);
  border-color: rgba(86, 90, 210, 0.48);
}

.voice-message-play-button:active {
  transform: scale(0.95);
}

.voice-message-play-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.play-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.voice-message-play-button .icon-dark {
  display: none;
}

body[data-theme="dark"] .voice-message-play-button .icon-light {
  display: none;
}

body[data-theme="dark"] .voice-message-play-button .icon-dark {
  display: block;
}

.voice-message-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--voice-spinner-border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.voice-message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.voice-message-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  cursor: pointer;
  user-select: none;
  padding: 0;
}

.voice-message-waveform .waveform-bar {
  flex: 1;
  background: var(--voice-bar-idle);
  border-radius: 999px;
  transition: background 0.2s ease, opacity 0.2s ease;
  min-height: 4px;
  animation: none !important;
  opacity: 1;
}

.voice-message-waveform .waveform-bar.active {
  background: var(--voice-bar-active);
  opacity: 1;
}

.voice-message-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voice-message-time {
  font-size: 13px;
  color: var(--voice-time-color);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.voice-message-speed {
  background: var(--voice-speed-background);
  border: 1px solid var(--voice-speed-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--voice-speed-color);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 42px;
}

.voice-message-speed:hover {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(86, 90, 210, 0.4);
}

.voice-message-speed:active {
  transform: scale(0.95);
}

.message.own .voice-message {
  --voice-bar-idle: rgba(255, 255, 255, 0.95);
  --voice-bar-active: rgba(44, 31, 90, 0.98);
  --voice-time-color: rgba(255, 255, 255, 0.9);
  --voice-speed-border: rgba(39, 27, 89, 0.72);
  --voice-speed-background: rgba(255, 255, 255, 0.14);
  --voice-speed-color: #23164d;
  --voice-play-border: rgba(39, 27, 89, 0.82);
  --voice-play-background: rgba(255, 255, 255, 0.1);
  --voice-spinner-border: rgba(39, 27, 89, 0.2);
}

.message.own .voice-message-play-button:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(39, 27, 89, 0.92);
}

.message.other .voice-message-play-button:hover {
  background: rgba(255, 255, 255, 0.44);
}

.message.own .voice-message-speed:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(39, 27, 89, 0.92);
}

.message.other .voice-message {
  --voice-bar-idle: rgba(99, 114, 142, 0.48);
  --voice-bar-active: rgba(78, 93, 214, 0.98);
  --voice-time-color: var(--text-secondary);
  --voice-speed-border: rgba(82, 94, 118, 0.3);
  --voice-speed-background: rgba(255, 255, 255, 0.42);
  --voice-speed-color: var(--text-primary);
  --voice-play-border: rgba(82, 94, 118, 0.46);
  --voice-play-background: rgba(255, 255, 255, 0.3);
  --voice-spinner-border: rgba(82, 94, 118, 0.18);
}

.message.own .voice-message-play-button .icon-light,
.message.own .voice-message-play-button .icon-dark {
  opacity: 0.9;
}

.message.other .voice-message-play-button .icon-light,
.message.other .voice-message-play-button .icon-dark {
  opacity: 0.82;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .voice-message {
    width: 100%;
    min-width: 0;
    gap: 10px;
  }

  .voice-message-play-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .play-icon {
    width: 20px;
    height: 20px;
  }

  .voice-message-waveform {
    height: 20px;
  }

  .voice-message-time {
    font-size: 12px;
  }

  .voice-message-speed {
    font-size: 11px;
    padding: 3px 8px;
    min-width: 38px;
  }
}
/**
 * VideoNoteMessage Styles
 * 
 * Компактный вид в списке сообщений + Fullscreen плеер
 * - Круглое видео (200x200 → 320x320)
 * - SVG прогресс-кольцо
 * - Управление громкостью
 */

/* Root контейнер - без фона */
.video-note-message {
  display: inline-block;
  background: transparent;
  padding: 0;
  margin: 0;
}

.video-note-message--revoked {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 200px;
  border-radius: 20px;
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.video-note-message__revoked {
  padding: 16px;
  text-align: center;
  color: #c62828;
  font-size: 14px;
  font-weight: 600;
}

/* Компактный вид (в списке сообщений) */
.video-note-message__compact {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-note-message__compact:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.video-note-message__thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-note-message__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Play Button Overlay (компактный вид) */
.video-note-message__play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  backdrop-filter: none;
}

.video-note-message__play-button {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.2s;
}

.video-note-message__play-button img {
  width: 40px;
  height: 40px;
  display: block;
  filter: invert(1) brightness(2);
}

.video-note-message__play-button:hover {
  transform: scale(1.1);
}

/* Duration Label */
.video-note-message__duration {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* Fullscreen Плеер */
.video-note-message__fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-note-message__fullscreen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Close Button */
.video-note-message__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
}

.video-note-message__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Video Container с прогресс-кольцом */
.video-note-message__fullscreen-video-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin-bottom: 20px;
}

.video-note-message__progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.video-note-message__fullscreen-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  z-index: 1;
}

/* Play/Pause Overlay (fullscreen) */
.video-note-message__fullscreen-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  backdrop-filter: none;
  cursor: pointer;
  z-index: 3;
}

.video-note-message__fullscreen-play-button {
  width: 60px;
  height: 60px;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.2s;
}

.video-note-message__fullscreen-play-button img {
  width: 60px;
  height: 60px;
  display: block;
  filter: invert(1) brightness(2);
}

.video-note-message__fullscreen-play-button:hover {
  transform: scale(1.1);
}

/* Timer */
.video-note-message__timer {
  color: white;
  font-size: 18px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Volume Control */
.video-note-message__volume {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 24px;
}

.video-note-message__volume-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-note-message__volume-icon img {
  width: 24px;
  height: 24px;
  display: block;
  filter: invert(1) brightness(2);
}

.video-note-message__volume-slider {
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.video-note-message__volume-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.video-note-message__volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.video-note-message__volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.video-note-message__volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .video-note-message__compact {
    width: 180px;
    height: 180px;
  }

  .video-note-message__play-button {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .video-note-message__fullscreen-video-container {
    width: 280px;
    height: 280px;
  }

  .video-note-message__fullscreen-video {
    width: 240px;
    height: 240px;
  }

  .video-note-message__fullscreen-play-overlay {
    width: 240px;
    height: 240px;
  }

  .video-note-message__fullscreen-play-button {
    width: 70px;
    height: 70px;
    font-size: 36px;
  }

  .video-note-message__timer {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .video-note-message__compact {
    width: 160px;
    height: 160px;
  }

  .video-note-message__fullscreen-video-container {
    width: 240px;
    height: 240px;
  }

  .video-note-message__fullscreen-video {
    width: 200px;
    height: 200px;
  }

  .video-note-message__fullscreen-play-overlay {
    width: 200px;
    height: 200px;
  }

  .video-note-message__volume-slider {
    width: 100px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .video-note-message__compact {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  .video-note-message__compact:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  }

  .video-note-message__fullscreen-overlay {
    background: rgba(0, 0, 0, 0.98);
  }
}
.date-separator {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
  padding: 0;
}

.date-separator span {
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  color: #8e8e93;
  font-weight: 500;
}
/* Message Search Styles */

.message-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.search-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.search-close-btn:hover {
  color: var(--text-primary);
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-sidebar);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary-color);
}

.search-loading {
  color: var(--text-muted);
  font-size: 14px;
}

.search-results-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.search-navigation {
  display: flex;
  gap: 4px;
}

.search-navigation button {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 12px;
  transition: all 0.2s;
}

.search-navigation button:hover {
  background: var(--hover-color);
}

.search-navigation button:active {
  transform: scale(0.95);
}

.search-no-results {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Highlighted message */
.message.highlighted {
  background: rgba(255, 215, 0, 0.2) !important;
  animation: highlight-pulse 0.5s ease-in-out;
}

@keyframes highlight-pulse {
  0%, 100% { 
    background: rgba(255, 215, 0, 0.2);
  }
  50% { 
    background: rgba(255, 215, 0, 0.4);
  }
}
/* Manage Members Modal Styles */

.manage-members-modal {
  width: 600px;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-content {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 70px);
}

.search-section {
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-loading {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.search-results {
  margin-top: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.user-item,
.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

.user-item:last-child,
.member-item:last-child {
  border-bottom: none;
}

.user-item:hover,
.member-item:hover {
  background: var(--hover-color);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.user-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-username {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-badge,
.member-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--primary-color);
  color: white;
  font-weight: 500;
}

.member-badge {
  background: var(--bg-primary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-add-member,
.btn-remove-member {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-add-member {
  background: var(--primary-color);
  color: white;
}

.btn-add-member:hover {
  background: var(--primary-hover);
}

.btn-remove-member {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
}

.btn-remove-member:hover {
  background: rgba(239, 68, 68, 0.1);
}

.members-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.members-list {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
/* Report Modal Styles */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.report-modal {
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  background: var(--bg-sidebar);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: visible;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea:focus {
  border-color: var(--primary-color);
}

.form-group textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error-message {
  padding: 12px 16px;
  background: rgba(229, 57, 53, 0.1);
  border: 1px solid var(--danger-color);
  border-radius: 8px;
  color: var(--danger-color);
  font-size: 14px;
  margin-bottom: 16px;
}

.report-target {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.report-target strong {
  color: var(--text-primary);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  position: relative;
}

.radio-label:hover {
  background: var(--bg-hover);
  border-color: var(--primary-color);
}

.radio-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.radio-label input[type="radio"]:hover {
  border-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked {
  border-color: var(--primary-color);
  background: var(--primary-color);
}

.radio-label input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.radio-label input[type="radio"]:checked ~ span {
  color: var(--primary-color);
  font-weight: 500;
}

.radio-label span {
  flex: 1;
  color: var(--text-primary);
  font-size: 14px;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-danger,
.btn-secondary {
  flex: 1;
  max-width: 200px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c62828;
  transform: translateY(-1px);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--primary-color);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Chat Info Panel Styles */

.chat-info-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  z-index: 50;
  animation: slideDown 0.3s ease-out;
  overflow-y: auto;
}

.chat-info-panel::-webkit-scrollbar {
  width: 0;
  display: none;
}


@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.chat-info-header-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-sidebar);
  min-height: 68px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-info-header-bar .btn-back {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  transition: background 0.2s;
}

.chat-info-header-bar .btn-back:hover {
  background: var(--hover-color);
}

.chat-info-header-bar h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.chat-info-content {
  flex: 1;
  padding: 20px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.chat-info-header {
  text-align: center;
  margin-bottom: 30px;
}

.chat-info-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}

.chat-info-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.chat-info-username {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.chat-info-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  max-width: 500px;
}

.chat-info-section:last-child {
  border-bottom: none;
}

.chat-info-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-info-section p {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.chat-info-links,
.chat-info-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-link-btn,
.settings-btn {
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.8;
}

.info-link-btn:hover,
.settings-btn:hover {
  background: var(--hover-color);
}

.info-link-btn:disabled,
.settings-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.info-link-btn:disabled:hover,
.settings-btn:disabled:hover {
  background: var(--bg-sidebar);
}

.settings-btn.danger {
  color: #ff4444;
}

.settings-btn.danger:hover {
  background: rgba(255, 68, 68, 0.1);
}

@media (max-width: 768px) {
  .chat-info-panel {
    width: 100%;
    left: 0;
  }
}
/* Invite Link Modal Styles */

.invite-link-modal {
  max-width: 500px;
  width: 90%;
  background: var(--bg-sidebar);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.invite-description {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.invite-link-container {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.invite-link-input {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-family: 'Monaco', 'Courier New', monospace;
  color: var(--primary-color);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.invite-link-input:focus {
  outline: none;
}

.invite-link-input:hover {
  color: var(--primary-hover);
}

.btn-copy,
.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-copy {
  background: var(--primary-color);
  color: white;
}

.btn-copy:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-share {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-share:hover {
  background: var(--bg-hover);
  border-color: var(--primary-color);
}

.invite-warning {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 8px;
  color: #ffc107;
  font-size: 13px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
/* Dynamic Header Button Styles */

.dynamic-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.dynamic-header-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--primary-color);
}

.dynamic-header-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.dynamic-header-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dynamic-header-btn.btn-primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.dynamic-header-btn.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-text {
  font-size: 13px;
}

.dynamic-header-btn .icon {
  width: 18px;
  height: 18px;
}

/* Responsive - hide text on small screens */
@media (max-width: 768px) {
  .dynamic-header-btn .btn-text {
    display: none;
  }

  .dynamic-header-btn {
    padding: 8px;
    min-width: 36px;
    justify-content: center;
  }
}
/* File Picker Zone Styles */

.file-picker-zone {
  display: flex;
  align-items: center;
  z-index: 10;
}

.file-picker-zone--overlay {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.file-picker-zone--inline {
  position: static;
  transform: none;
  justify-content: flex-start;
  margin-top: 12px;
}

.attach-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.attach-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.attach-button .icon-dark {
  display: none;
}

body[data-theme="dark"] .attach-button .icon-light {
  display: none;
}

body[data-theme="dark"] .attach-button .icon-dark {
  display: block;
}

.attach-button:hover {
  opacity: 1;
}

.attach-button img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(33, 150, 243, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.drag-overlay-content {
  text-align: center;
  color: white;
  pointer-events: none;
}

.drag-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 0.6s infinite;
}

.drag-text {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
}

.drag-hint {
  font-size: 16px;
  opacity: 0.9;
}

.file-picker-error {
  position: absolute;
  top: 100%;
  left: 0;
  background: #f44336;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  margin-top: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.file-picker-zone--inline .file-picker-error {
  position: static;
  margin-top: 0;
  margin-left: 10px;
  white-space: normal;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
/* File Preview List Styles */

.file-preview-list {
  background: transparent;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  animation: slideUp 0.3s;
  max-width: 100%;
  overflow: hidden;
}

.file-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: #666;
}

.upload-progress {
  font-weight: bold;
  color: #2196F3;
}

.file-preview-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  max-width: 100%;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.file-preview-item:hover {
  background: #fafafa;
}

.file-preview-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.file-preview-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: #e3f2fd;
  border-radius: 4px;
  flex-shrink: 0;
}

.file-preview-info {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.file-preview-remove {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.file-preview-remove:hover {
  opacity: 1;
  transform: scale(1.2);
}

.file-preview-uploading {
  font-size: 20px;
  flex-shrink: 0;
  animation: spin 1s linear infinite;
}

.upload-progress-bar {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2196F3, #1976D2);
  transition: width 0.3s;
  border-radius: 2px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Dark Theme Support */
body[data-theme="dark"] .file-preview-list {
  background: transparent;
}

body[data-theme="dark"] .file-preview-header {
  color: #aaa;
}

body[data-theme="dark"] .file-preview-item {
  background: rgba(31, 44, 58, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body[data-theme="dark"] .file-preview-item:hover {
  background: rgba(31, 44, 58, 0.5);
}

body[data-theme="dark"] .file-preview-name,
body[data-theme="dark"] .file-preview-size {
  color: #fff;
}
/**
 * Стили для ChannelPostCard
 * Широкий layout для постов канала
 */

.channel-post-card {
  background: var(--message-bg, #fff);
  border-radius: 12px;
  padding: 20px;
  margin: 0 auto 16px auto; /* Центрирование */
  max-width: 800px; /* Ограничение ширины */
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease, background-color 0.3s ease;
}

/* Темная тема - неоновая изумрудная рамка */
body.dark-theme .channel-post-card {
  background: #1e2832;
  color: #e8eaed !important;
  border: 1px solid #50c878;
  box-shadow: 0 0 10px rgba(80, 200, 120, 0.3),
              0 0 20px rgba(80, 200, 120, 0.15);
}

body.dark-theme .channel-post-card * {
  color: #e8eaed;
}

body.dark-theme .channel-post-card .post-text {
  color: #e8eaed !important;
}

.channel-post-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.dark-theme .channel-post-card:hover {
  box-shadow: 0 0 15px rgba(80, 200, 120, 0.4),
              0 0 30px rgba(80, 200, 120, 0.2);
}

/* Подсветка при скролле к посту - желтый фон на всю ширину */
.channel-post-card.highlighted {
  background: #fff9c4 !important;
}

body.dark-theme .channel-post-card.highlighted {
  background: rgba(255, 235, 59, 0.15) !important;
  border-color: #ffeb3b;
  box-shadow: 0 0 15px rgba(255, 235, 59, 0.3),
              0 0 30px rgba(255, 235, 59, 0.15);
}

/* Шапка поста */
.channel-post-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
}

.channel-post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 12px;
}

.channel-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-post-avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}

.channel-post-meta {
  flex: 1;
  min-width: 0;
}

.channel-post-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-post-date {
  font-size: 13px;
  color: #666;
}

/* Меню действий */
.channel-post-actions-wrapper {
  position: relative;
  margin-left: 8px;
}

.channel-post-actions-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 20px;
  color: #666;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.channel-post-actions-btn:hover {
  background: #f5f5f5;
}

.channel-post-actions-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #2d3748;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
  margin-top: 4px;
}

.dark .channel-post-actions-menu {
  background: #2d3748;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.channel-post-actions-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: none;
  border: none;
  font-size: 14px;
  color: #e8eaed;
  cursor: pointer;
  transition: background 0.15s ease;
}

.channel-post-actions-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.channel-post-actions-menu .action-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-post-actions-menu .action-icon img {
  width: 18px;
  height: 18px;
  display: block;
}

.channel-post-actions-menu .action-icon .icon-dark {
  display: none;
}

.dark .channel-post-actions-menu .action-icon .icon-light {
  display: none;
}

.dark .channel-post-actions-menu .action-icon .icon-dark {
  display: block;
}

.channel-post-action-danger {
  color: #f87171 !important;
}

.channel-post-action-danger:hover {
  background: rgba(248, 113, 113, 0.1) !important;
}

/* Тело поста */
.channel-post-body {
  margin-bottom: 12px;
}

.channel-post-body.has-reaction-dock {
  position: relative;
  padding-bottom: 52px;
}

.channel-post-text {
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 16px;
}

.channel-post-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.channel-post-reaction-dock {
  bottom: 0;
}

/* Футер */
.channel-post-footer {
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.channel-post-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #666;
}

/* Адаптивность */
@media (max-width: 768px) {
  .channel-post-card {
    padding: 16px;
    margin-bottom: 12px;
  }

  .channel-post-avatar {
    width: 40px;
    height: 40px;
  }

  .channel-post-title {
    font-size: 15px;
  }

  .channel-post-text {
    font-size: 14px;
  }

  .channel-post-attachments {
    grid-template-columns: 1fr;
  }
}
/**
 * PostComposer styles
 */

.post-composer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.post-composer-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

/* Темная тема */
body.dark-theme .post-composer-modal {
  background: #1e2832;
  color: #e8eaed;
}

body.dark-theme .post-composer-header {
  border-bottom-color: #2a3441;
}

body.dark-theme .post-composer-header h2 {
  color: #e8eaed;
}

body.dark-theme .post-composer-close {
  color: #aaa;
}

body.dark-theme .post-composer-close:hover:not(:disabled) {
  color: #e8eaed;
}

body.dark-theme .post-composer-textarea {
  background: #182533;
  border-color: #2a3441;
  color: #e8eaed;
}

body.dark-theme .post-composer-textarea::placeholder {
  color: #707579;
}

body.dark-theme .post-composer-textarea:focus {
  border-color: var(--primary-color);
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.post-composer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.post-composer-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.post-composer-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.post-composer-close:hover:not(:disabled) {
  color: #333;
}

.post-composer-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.post-composer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.post-composer-textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  transition: border-color 0.2s;
}

.post-composer-textarea:focus {
  outline: none;
  border-color: #2196F3;
}

.post-composer-textarea:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.post-composer-char-count {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  margin-bottom: 16px;
}

.post-composer-error {
  background-color: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
}

.post-composer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e0e0e0;
}

.post-composer-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.post-composer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.post-composer-btn-cancel {
  background-color: #f5f5f5;
  color: #666;
}

.post-composer-btn-cancel:hover:not(:disabled) {
  background-color: #e0e0e0;
}

.post-composer-btn-submit {
  background-color: #2196F3;
  color: white;
}

.post-composer-btn-submit:hover:not(:disabled) {
  background-color: #1976D2;
}

.post-composer-btn-submit:disabled {
  background-color: #90CAF9;
}

/* Mobile */
@media (max-width: 600px) {
  .post-composer-modal {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .post-composer-textarea {
    min-height: 120px;
  }
}
/* Edit Message Modal Styles */

.edit-message-modal {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.25s ease-out;
}

.edit-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #E0E0E0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.edit-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.edit-modal-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.edit-textarea {
  flex: 1;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #CCC;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #333;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
  line-height: 1.5;
}

.edit-textarea:focus {
  border-color: #2196F3;
}

.edit-modal-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666;
}

.char-counter {
  font-weight: 500;
}

.char-counter.warning {
  color: #FF9800;
}

.hint {
  color: #999;
  font-style: italic;
}

.edit-modal-error {
  padding: 10px 12px;
  background: #FFEBEE;
  border-left: 3px solid #F44336;
  border-radius: 4px;
  color: #C62828;
  font-size: 13px;
}

.edit-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #E0E0E0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .edit-message-modal {
    background: #2C2C2C;
  }

  .edit-modal-header,
  .edit-modal-footer {
    border-color: #444;
  }

  .edit-modal-header h2 {
    color: #E0E0E0;
  }

  .edit-textarea {
    background: #3C3C3C;
    border-color: #555;
    color: #E0E0E0;
  }

  .edit-textarea:focus {
    border-color: #2196F3;
  }

  .edit-modal-info {
    color: #AAA;
  }

  .hint {
    color: #777;
  }

  .edit-modal-error {
    background: #3C2020;
    border-left-color: #EF5350;
    color: #FFCDD2;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .edit-message-modal {
    width: 95%;
    max-height: 90vh;
  }

  .edit-modal-header,
  .edit-modal-body,
  .edit-modal-footer {
    padding: 16px 20px;
  }

  .edit-textarea {
    min-height: 120px;
  }
}
/* Pinned Message Banner Styles */

.pinned-message-banner {
  background: linear-gradient(90deg, #FFF9C4 0%, #FFF59D 100%);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #F9A825;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
  animation: pinBannerSlideIn 0.3s ease-out;
  min-height: 42px;
}

@keyframes pinBannerSlideIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pinned-message-banner:hover {
  background: linear-gradient(90deg, #FFF59D 0%, #FFEE58 100%);
}

.pinned-message-banner:active {
  background: linear-gradient(90deg, #FFEE58 0%, #FFD54F 100%);
}

.pinned-banner-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.pinned-banner-icon img {
  width: 16px;
  height: 16px;
  display: block;
}

.pinned-banner-icon .icon-dark {
  display: none;
}

/* Dark theme */
.dark .pinned-banner-icon .icon-light {
  display: none;
}

.dark .pinned-banner-icon .icon-dark {
  display: block;
}

.pinned-banner-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pinned-banner-label {
  font-size: 10px;
  font-weight: 600;
  color: #F57F17;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.pinned-banner-text {
  font-size: 13px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-banner-author {
  font-weight: 600;
  color: #F57F17;
}

.pinned-banner-close {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.pinned-banner-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

.pinned-banner-close:active {
  background: rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .pinned-message-banner {
    background: linear-gradient(90deg, #4A4A3A 0%, #5A5A4A 100%);
    border-bottom-color: #6A6A5A;
  }

  .pinned-message-banner:hover {
    background: linear-gradient(90deg, #5A5A4A 0%, #6A6A5A 100%);
  }

  .pinned-banner-label {
    color: #FFD54F;
  }

  .pinned-banner-text {
    color: #E0E0E0;
  }

  .pinned-banner-author {
    color: #FFD54F;
  }

  .pinned-banner-close {
    background: rgba(255, 255, 255, 0.1);
    color: #E0E0E0;
  }

  .pinned-banner-close:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}
/**
 * ChannelFeed styles
 */

/* Контейнер для всего feed + footer с кнопкой */
.channel-feed-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden; /* Предотвращаем скрол всего контейнера */
}

/* ============================================================================
   PULL-TO-REFRESH INDICATOR (Enterprise UI/UX)
   ============================================================================ */

/* Индикатор pull-to-refresh (показывается сверху) */
.pull-to-refresh-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

/* Контент индикатора (spinner + текст или стрелка + текст) */
.pull-to-refresh-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* Стрелка pull-to-refresh с плавной анимацией поворота */
.pull-to-refresh-arrow {
  font-size: 24px;
  line-height: 1;
  transition: transform 0.3s ease-out;
  color: #2196F3;
}

/* Переопределяем spinner для pull-to-refresh (меньший размер) */
.pull-to-refresh-content .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

/* ============================================================================
   FEED STYLES
   ============================================================================ */

.channel-feed {
  flex: 1;
  overflow-y: auto; /* Скрол только для постов */
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center; /* Центрирование постов */
  width: 100%; /* Полная ширина */
  /* Touch action для корректной работы pull-to-refresh */
  touch-action: pan-y;
  /* Отключаем нативный overscroll браузера */
  overscroll-behavior-y: contain;
}

/* Wrapper для корректного применения фона */
.channel-feed-wrapper {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Удалили .channel-post-wrapper т.к. теперь используем ChannelPostCard */

/* Empty state */
.channel-feed-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.channel-feed-empty-icon {
  font-size: 80px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.channel-feed-empty-text {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.channel-feed-empty-subtext {
  font-size: 15px;
  color: #999;
}

/* Loading */
.channel-feed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: #666;
  font-size: 14px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #e0e0e0;
  border-top-color: #2196F3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* End of feed */
.channel-feed-end {
  text-align: center;
  padding: 24px;
  color: #999;
  font-size: 14px;
}

/* Adapt Message component for channel posts */
.channel-post-wrapper .message {
  max-width: 100%;
  margin: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.channel-post-wrapper .message-content {
  width: 100%;
}

.channel-post-wrapper .message-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 768px) {
  .channel-feed {
    padding: 12px;
    gap: 12px;
  }
}
/* Message Context Menu Styles */

.message-context-menu {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
  min-width: 200px;
  z-index: 10000;
  animation: contextMenuFadeIn 0.15s ease-out;
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-menu-item {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #333;
  text-align: left;
  transition: background-color 0.15s;
}

.context-menu-item:hover {
  background-color: #E3F2FD;
}

.context-menu-item:active {
  background-color: #BBDEFB;
}

.context-menu-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.context-menu-icon img {
  width: 18px;
  height: 18px;
  display: block;
}

.context-menu-icon .icon-dark {
  display: none;
}

/* Dark theme */
.dark .context-menu-icon .icon-light {
  display: none;
}

.dark .context-menu-icon .icon-dark {
  display: block;
}

.context-menu-item-danger {
  color: #D32F2F;
}

.context-menu-item-danger:hover {
  background-color: #FFEBEE;
}

.context-menu-item-danger:active {
  background-color: #FFCDD2;
}

.context-menu-separator {
  height: 1px;
  background-color: #E0E0E0;
  margin: 4px 0;
}

/* Dark mode support (опционально) */
@media (prefers-color-scheme: dark) {
  .message-context-menu {
    background: #2C2C2C;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  .context-menu-item {
    color: #E0E0E0;
  }

  .context-menu-item:hover {
    background-color: #3C3C3C;
  }

  .context-menu-item:active {
    background-color: #4C4C4C;
  }

  .context-menu-item-danger {
    color: #EF5350;
  }

  .context-menu-item-danger:hover {
    background-color: #3C2020;
  }

  .context-menu-separator {
    background-color: #444;
  }
}

/* Batch context menu header */
.context-menu-header {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-color, #8A2BE2);
  background: rgba(138, 43, 226, 0.08);
  border-bottom: 1px solid rgba(138, 43, 226, 0.15);
  margin-bottom: 4px;
}

.batch-menu .context-menu-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Dark mode batch header */
@media (prefers-color-scheme: dark) {
  .context-menu-header {
    background: rgba(138, 43, 226, 0.15);
    color: #BB86FC;
  }
}

body[data-theme="dark"] .context-menu-header {
  background: rgba(138, 43, 226, 0.15);
  color: #BB86FC;
}
/**
 * Forward Modal Styles
 * Обновлено: 28 декабря 2025
 * Круглые чекбоксы как в ClearHistoryModal
 */

.forward-modal {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.modal-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #fff;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

/* Search */
.forward-modal-search {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.forward-search-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: all 0.2s;
}

.forward-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.forward-search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #2196F3;
}

/* Chat List */
.forward-modal-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  min-height: 200px;
  max-height: 400px;
}

.forward-modal-chat-list::-webkit-scrollbar {
  width: 6px;
}

.forward-modal-chat-list::-webkit-scrollbar-track {
  background: transparent;
}

.forward-modal-chat-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.forward-modal-chat-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Chat Option - Круглые чекбоксы как в ClearHistoryModal */
.forward-chat-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.forward-chat-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Круглый чекбокс */
.forward-chat-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.forward-chat-option input[type="checkbox"]:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.forward-chat-option input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  border-color: #2196F3;
}

/* Галочка в чекбоксе */
.forward-chat-option input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

/* Chat Content */
.forward-chat-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.forward-chat-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forward-chat-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.forward-chat-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.forward-chat-name {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-chat-type {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Empty & Loading States */
.forward-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

.forward-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #2196F3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.forward-loading p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin: 0;
}

/* Footer */
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary,
.btn-primary {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary:disabled,
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .forward-modal {
    width: 95%;
    max-height: 80vh;
  }

  .forward-modal-header {
    padding: 16px 20px;
  }

  .forward-modal-search {
    padding: 12px 20px;
  }

  .forward-chat-option {
    padding: 10px 20px;
  }

  .modal-footer {
    padding: 12px 20px;
  }
}
/* Reply Preview Styles */

.reply-preview-container {
  background: transparent;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: none;
  animation: replySlideIn 0.25s ease-out;
}

@keyframes replySlideIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.reply-preview-line {
  width: 3px;
  height: 48px;
  background: #2196F3;
  border-radius: 2px;
  flex-shrink: 0;
}

.reply-preview-content {
  flex: 1;
  min-width: 0;
}

.reply-preview-label {
  font-size: 11px;
  font-weight: 600;
  color: #2196F3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.reply-preview-sender {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.reply-preview-message {
  font-size: 13px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview-cancel {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.reply-preview-cancel:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

.reply-preview-cancel:active {
  background: rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .reply-preview-container {
    background: transparent;
    border-bottom-color: transparent;
  }

  .reply-preview-sender {
    color: #E0E0E0;
  }

  .reply-preview-message {
    color: #AAA;
  }

  .reply-preview-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #E0E0E0;
  }

  .reply-preview-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* Dark theme via data attribute */
body[data-theme="dark"] .reply-preview-container {
  background: transparent;
  border-bottom-color: transparent;
}

body[data-theme="dark"] .reply-preview-sender {
  color: #E0E0E0;
}

body[data-theme="dark"] .reply-preview-message {
  color: #AAA;
}

body[data-theme="dark"] .reply-preview-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #E0E0E0;
}

body[data-theme="dark"] .reply-preview-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .reply-preview-container {
    padding: 10px 12px;
  }

  .reply-preview-line {
    height: 40px;
  }
}
/**
 * VoiceRecorder Styles
 */

.voice-recorder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.voice-recorder-error {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  min-width: 280px;
  max-width: min(360px, calc(100vw - 32px));
  background: var(--bg-sidebar);
  color: var(--text-primary);
  border: 1px solid rgba(229, 57, 53, 0.35);
  padding: 12px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  z-index: 12;
}

.voice-recorder-error button {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-recorder-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.voice-recorder-button:hover {
  transform: translateY(-1px);
  border-color: rgba(135, 116, 225, 0.45);
}

.voice-recorder-button:active {
  transform: scale(0.95);
}

.voice-recorder-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.voice-recorder-button.recording {
  border-color: rgba(229, 57, 53, 0.45);
  box-shadow: 0 12px 26px rgba(229, 57, 53, 0.22);
}

.voice-recorder-button.locked {
  border-color: rgba(135, 116, 225, 0.55);
  box-shadow: 0 12px 26px rgba(135, 116, 225, 0.24);
}

.voice-recorder-button.sending {
  border-color: rgba(135, 116, 225, 0.55);
}

.voice-recorder-button-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    rgba(135, 116, 225, 0.22) 0%,
    rgba(135, 116, 225, 0) calc(var(--voice-lock-progress, 0) * 100%)
  );
  opacity: 0;
  transition: opacity 0.18s ease;
}

.voice-recorder-button.recording .voice-recorder-button-ring,
.voice-recorder-button.locked .voice-recorder-button-ring {
  opacity: 1;
}

.voice-recorder-icon {
  width: 24px;
  height: 24px;
  display: block;
  position: relative;
  z-index: 1;
}

.voice-recorder-button .icon-dark {
  display: none;
}

body[data-theme="dark"] .voice-recorder-button .icon-light {
  display: none;
}

body[data-theme="dark"] .voice-recorder-button .icon-dark {
  display: block;
}

.voice-recorder-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(340px, calc(100vw - 32px));
  padding: 14px 16px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(23, 33, 43, 0.98) 0%, rgba(14, 22, 33, 0.98) 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 11;
}

body[data-theme="light"] .voice-recorder-panel,
body[data-theme="light"] .voice-recorder-error {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 244, 245, 0.98) 100%);
  border-color: rgba(0, 0, 0, 0.08);
}

.voice-recorder-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.voice-recorder-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.voice-recorder-panel-status {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-recorder-timer {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.voice-recorder-waveform {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 42px;
  padding: 4px 0 2px;
}

.voice-recorder-waveform-bar {
  flex: 1;
  min-width: 4px;
  height: 16%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(135, 116, 225, 0.9) 0%, rgba(135, 116, 225, 0.35) 100%);
  transition: height 0.08s linear, opacity 0.18s ease, background 0.18s ease;
}

.voice-recorder-waveform--sending .voice-recorder-waveform-bar {
  opacity: 0.7;
}

.voice-recorder-panel-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-recorder-panel-hint--sending {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.voice-recorder-secondary-button {
  align-self: flex-start;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.voice-recorder-secondary-button:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(135, 116, 225, 0.45);
}

@media (max-width: 768px) {
  .voice-recorder-button {
    width: 48px;
    height: 48px;
  }

  .voice-recorder-panel,
  .voice-recorder-error {
    right: -8px;
    width: min(320px, calc(100vw - 24px));
  }

  .voice-recorder-timer {
    font-size: 24px;
  }
}
/**
 * VideoNoteRecorder Styles
 * 
 * Fullscreen модальное окно для записи видеокружков
 * - Черный фон (rgba(0,0,0,0.95))
 * - Круглый video preview (320x320)
 * - Hold-to-record кнопка с ripple эффектом
 * - Адаптивный дизайн (mobile-first)
 */

.video-note-recorder {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-note-recorder__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Header */
.video-note-recorder__header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  z-index: 10;
}

.video-note-recorder__close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.video-note-recorder__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.video-note-recorder__close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.video-note-recorder__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 18px;
  font-weight: 600;
}

/* Video Container (круглый) */
.video-note-recorder__video-container {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  margin-bottom: 40px;
}

.video-note-recorder__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Зеркалим для фронтальной камеры */
}

/* Controls (Flip Camera, Mic) */
.video-note-recorder__controls {
  position: absolute;
  top: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
}

.video-note-recorder__flip,
.video-note-recorder__mic {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
}

.video-note-recorder__flip img,
.video-note-recorder__mic img {
  width: 32px;
  height: 32px;
  display: block;
  filter: invert(1) brightness(2);
}

.video-note-recorder__flip:hover,
.video-note-recorder__mic:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.video-note-recorder__mic.muted {
  background: rgba(244, 67, 54, 0.8);
}

/* Recording UI */
.video-note-recorder__recording {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.video-note-recorder__timer {
  color: white;
  font-size: 32px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.video-note-recorder__hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
}

/* Progress Bar */
.video-note-recorder__progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.video-note-recorder__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.1s linear;
}

/* Preview Controls */
.video-note-recorder__preview-controls {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.video-note-recorder__retake,
.video-note-recorder__send {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-note-recorder__retake img,
.video-note-recorder__send img {
  width: 20px;
  height: 20px;
  display: block;
  filter: invert(1) brightness(2);
}

.video-note-recorder__retake {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.video-note-recorder__retake:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.video-note-recorder__send {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.video-note-recorder__send:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
}

.video-note-recorder__retake:disabled,
.video-note-recorder__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Record Button */
.video-note-recorder__button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.video-note-recorder__button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.8);
  background: rgba(244, 67, 54, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.video-note-recorder__button:hover {
  transform: scale(1.05);
  border-color: white;
  background: rgba(244, 67, 54, 1);
}

.video-note-recorder__button:active {
  transform: scale(0.95);
}

.video-note-recorder__button.recording {
  background: rgba(244, 67, 54, 1);
  animation: pulse 1.5s infinite;
}

.video-note-recorder__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.video-note-recorder__button-icon {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-note-recorder__button-icon img {
  width: 40px;
  height: 40px;
  display: block;
  filter: invert(1) brightness(2);
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(244, 67, 54, 0);
  }
}

/* Ripple Effect */
.video-note-recorder__button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.video-note-recorder__button:active::before {
  width: 100px;
  height: 100px;
}

/* Error */
.video-note-recorder__error {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(244, 67, 54, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  max-width: 80%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 20;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .video-note-recorder__video-container {
    width: 280px;
    height: 280px;
  }

  .video-note-recorder__timer {
    font-size: 28px;
  }

  .video-note-recorder__controls {
    top: 60px;
    right: 16px;
    gap: 12px;
  }

  .video-note-recorder__flip,
  .video-note-recorder__mic {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .video-note-recorder__preview-controls {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }

  .video-note-recorder__retake,
  .video-note-recorder__send {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .video-note-recorder__video-container {
    width: 240px;
    height: 240px;
  }

  .video-note-recorder__button {
    width: 70px;
    height: 70px;
  }

  .video-note-recorder__button-icon {
    font-size: 36px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .video-note-recorder__overlay {
    background: rgba(0, 0, 0, 0.98);
  }
}
/**
 * Selection Action Bar Styles
 * Ф.11 - Bottom bar для массовых действий
 */

.selection-action-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-sidebar);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-color);
}

.selection-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.selection-count {
  color: #2196F3;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.selection-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.select-toggle-btn {
  background: rgba(33, 150, 243, 0.1);
  border-color: rgba(33, 150, 243, 0.3);
  color: #2196F3;
}

.select-toggle-btn:hover:not(:disabled) {
  background: rgba(33, 150, 243, 0.2);
  border-color: rgba(33, 150, 243, 0.5);
}

.forward-btn {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  border: none;
}

.forward-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.delete-btn {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  border: none;
}

.delete-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .selection-action-bar {
    padding: 10px 12px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .selection-left {
    gap: 8px;
    flex: 1 1 100%;
  }

  .selection-count {
    font-size: 13px;
  }

  .action-btn {
    padding: 8px 10px;
    font-size: 13px;
  }

  .select-toggle-btn {
    padding: 6px 12px;
  }

  .selection-actions {
    gap: 6px;
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .btn-icon {
    width: 18px;
    height: 18px;
  }
}

/* Animation on mount */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.selection-action-bar {
  animation: slideUp 0.3s ease-out;
}
/**
 * Clear History Modal Styles
 * Ф.11 - Стили для модального окна очистки истории
 * Последнее обновление: 28 декабря 2025
 */

/* Добавлено 28.12.2025: Реализованы круглые чекбоксы с галочками для всех опций выбора */

.clear-history-modal {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Info banner - пояснение что удаляются только свои сообщения */
.info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  margin-bottom: 16px;
  color: #93c5fd;
  font-size: 14px;
}

.info-banner .info-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #fff;
}

.close-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section h3 {
  margin: 0;
  font-size: 16px;
  color: #fff;
  font-weight: 600;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s ease;
}

.radio-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.radio-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  transition: all 0.2s ease;
}

.radio-option input[type="radio"]:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.radio-option input[type="radio"]:checked {
  background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
  border-color: #9C27B0;
}

.radio-option input[type="radio"]:checked::after {
  content: '✓';
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  top: 0;
  left: 0;
}

.radio-option span {
  color: #fff;
  font-size: 14px;
}

.danger-option {
  color: #f44336 !important;
  font-weight: 600;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s ease;
}

.checkbox-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.checkbox-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  transition: all 0.2s ease;
}

.checkbox-option input[type="checkbox"]:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.checkbox-option input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
  border-color: #9C27B0;
}

.checkbox-option input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  top: 0;
  left: 0;
}

.checkbox-option > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.checkbox-option span {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.checkbox-option small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.4;
}

.danger-section {
  padding: 15px;
  border-radius: 8px;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.warning-text {
  color: #ff9800;
  font-size: 14px;
  margin: 10px 0;
}

.confirm-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  margin: 10px 0;
}

.confirm-hint strong {
  color: #2196F3;
}

.confirm-input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
  margin-top: 10px;
}

.confirm-input:focus {
  outline: none;
  border-color: #2196F3;
  background: rgba(255, 255, 255, 0.1);
}

.preview-section {
  padding: 15px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  margin: 0;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-secondary,
.btn-danger {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .clear-history-modal {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .section h3 {
    font-size: 15px;
  }

  .radio-option span,
  .checkbox-option span {
    font-size: 13px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .btn-secondary,
  .btn-danger {
    width: 100%;
  }
}/**
 * ChatWindow Component Styles
 * Additional styles for video note recorder button
 */

/* ENTERPRISE: Ф.0.2 - Chat header with contact label notes */
.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.chat-header-back {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-header-back:hover {
  background: rgba(255, 255, 255, 0.14);
}

.chat-header-notes {
  font-size: 13px;
  color: var(--text-secondary, #666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.video-note-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px;
}

.video-note-button img {
  width: 24px;
  height: 24px;
  display: block;
}

.video-note-button:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

.video-note-button:active {
  transform: scale(0.95);
}

.video-note-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .video-note-button img {
    content: url('/icons/dark/video-note.png');
  }
  
  .video-note-button:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* ENTERPRISE: Ф.2 - Typing Indicator in Header (Compact) */
.typing-indicator-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  animation: fadeIn 0.2s ease;
}

.typing-dots-small {
  display: flex;
  gap: 3px;
  align-items: center;
}

.typing-dots-small span {
  width: 4px;
  height: 4px;
  background: #666;
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots-small span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots-small span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots-small span:nth-child(3) {
  animation-delay: 0.4s;
}

.typing-text-small {
  font-size: 12px;
  color: #666;
  font-style: italic;
  white-space: nowrap;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Dark theme support for typing indicator */
@media (prefers-color-scheme: dark) {
  .typing-indicator-header {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .typing-dots-small span {
    background: #aaa;
  }
  
  .typing-text-small {
    color: #aaa;
  }
}

/* Ф.11 - Selection Mode Styles */
.message.selection-mode {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-left: 40px; /* Space for checkbox */
  transition: all 0.2s ease;
}

.message.selected {
  background: rgba(33, 150, 243, 0.15);
  /* Растягиваем выделение на всю ширину чата (как в Telegram) */
  margin-left: calc(var(--chat-side-padding) * -1);
  margin-right: calc(var(--chat-side-padding) * -1);
  padding-left: calc(var(--chat-side-padding) + 40px);
  padding-right: var(--chat-side-padding);
  border-left: 3px solid #2196F3;
}

@media (max-width: 480px) {
  .message.selected {
    margin-left: calc(var(--chat-side-padding) * -1);
    margin-right: calc(var(--chat-side-padding) * -1);
    padding-left: 50px;
    padding-right: var(--chat-side-padding);
  }
}

.message-checkbox {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.message-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #2196F3;
}

/* Selection mode: disable context menu */
.message.selection-mode .message-content {
  pointer-events: none;
}

.message.selection-mode .message-checkbox {
  pointer-events: all;
}

/* Animation for entering selection mode */
@keyframes checkboxSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.message-checkbox {
  animation: checkboxSlideIn 0.2s ease-out;
}

/* Forwarded Batch Grouping - визуализация пакетной пересылки */
.forwarded-batch {
  border-left: 3px solid var(--primary-color);
  padding-left: 12px;
  margin: 8px 0;
  background: rgba(138, 43, 226, 0.05);
  border-radius: 8px;
  position: relative;
  cursor: context-menu; /* Показывает что есть контекстное меню */
}

.forwarded-batch:hover {
  background: rgba(138, 43, 226, 0.08);
}

.batch-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  padding: 4px 8px;
  opacity: 0.7;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none; /* Предотвращает выделение текста при клике */
}

/* Dark theme adjustments for forwarded batch */
body[data-theme="dark"] .forwarded-batch {
  background: rgba(138, 43, 226, 0.15);
  border-left-color: var(--primary-hover);
}

body[data-theme="dark"] .forwarded-batch:hover {
  background: rgba(138, 43, 226, 0.2);
}

body[data-theme="dark"] .batch-label {
  color: var(--text-primary);
  opacity: 0.8;
}

/* Ф.12.3: Infinite scroll loading indicators */
.loading-older,
.loading-newer {
  text-align: center;
  padding: 12px;
  font-size: 14px;
  color: var(--text-secondary, #666);
  opacity: 0.8;
}

.loading-older {
  margin-bottom: 8px;
}

.loading-newer {
  margin-top: 8px;
}
/**
 * Global Styles для DUTG Messenger (Telegram-like Dark Theme)
 */

/* Dark Theme (Default) */
:root,
body[data-theme="dark"] {
  --primary-color: #8774e1;
  --primary-hover: #9688e8;
  --bg-main: #0e1621;
  --bg-sidebar: #17212b;
  --bg-chat: #0e1621;
  --bg-message-own: #8774e1;
  --bg-message-other: #182533;
  --bg-input: #182533;
  --bg-hover: #1f2c3a;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #707579;
  --border-color: #0f1824;
  --danger-color: #e53935;
  --success-color: #4caf50;
  --online-color: #4caf50;
  
  /* Message UI: SSOT для цветов и размеров */
  --message-bubble-max-width: 65%;
  --color-sender-name: #81D4FA;
  --color-reply-author: #81D4FA;
  --color-reply-author-other: #0288D1;
  --color-reply-line: #2196F3;
  --sidebar-width: 380px;
  --chat-side-padding: clamp(12px, 6vw, 220px);
}

/* Light Theme */
body[data-theme="light"] {
  --primary-color: #7c5cd7;
  --primary-hover: #6a4ec4;
  --bg-main: #ffffff;
  --bg-sidebar: #f4f4f5;
  --bg-chat: #ffffff;
  --bg-message-own: #7c5cd7;
  --bg-message-other: #f0f0f0;
  --bg-input: #f4f4f5;
  --bg-hover: #e8e8e9;
  --text-primary: #000000;
  --text-secondary: #555555;
  --text-muted: #999999;
  --border-color: #e0e0e0;
  --danger-color: #d32f2f;
  --success-color: #388e3c;
  --online-color: #388e3c;
  
  /* Message UI: SSOT для цветов и размеров */
  --message-bubble-max-width: 65%;
  --color-sender-name: #0288D1;
  --color-reply-author: #0288D1;
  --color-reply-author-other: #1565C0;
  --color-reply-line: #2196F3;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-main);
  color: var(--text-primary);
}

/* Loading Screen */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-main);
}

.loading-screen p {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.loading-retry-button {
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--primary-color);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.loading-retry-button:hover {
  background: rgba(135, 116, 225, 0.14);
  border-color: var(--primary-hover);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(135, 116, 225, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* App Container */
.app-container {
  display: flex;
  height: 100vh;
  max-width: 100%;
  background: var(--bg-main);
  overflow: hidden;
}

.sidebar-shell {
  width: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-shrink: 0;
}

.sidebar {
  width: calc(var(--sidebar-width) - 6px);
  min-width: 0;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
}

.sidebar-resizer {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.sidebar-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: transparent;
  transition: background 0.2s ease;
}

.sidebar-resizer:hover::after,
.sidebar-resizing .sidebar-resizer::after {
  background: rgba(135, 116, 225, 0.4);
}

.sidebar-resizing,
.sidebar-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  min-width: 0;
}

/* Chat List */
.chat-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  position: relative;
}

.chat-list-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 5;
}

.chat-list-header__top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-list-header__modes {
  min-width: 0;
  display: flex;
  overflow: hidden;
}

.btn-hamburger {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
  flex: 0 0 auto;
  margin-top: 0;
}

.btn-hamburger:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all 0.3s;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-align: center;
}

.user-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 20px;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  font-size: 24px;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-details h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.search-bar {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-actions {
  display: flex;
  gap: 8px;
}

.btn-new-chat {
  flex: 1;
  padding: 10px 14px;
  background: #22384b;
  color: white;
  border: 1px solid rgba(61, 199, 255, 0.28);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-new-chat:hover {
  background: #29465d;
  border-color: rgba(61, 199, 255, 0.44);
}

.btn-new-group,
.btn-new-channel {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  border: 1px solid rgba(61, 199, 255, 0.28);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s ease, border-color 0.2s ease;
  min-width: 44px;
}

.btn-new-group:hover,
.btn-new-channel:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(61, 199, 255, 0.44);
}

.search-bar input {
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  border-color: var(--primary-color);
}

.chats {
  flex: 1;
  overflow-y: auto;
}

.chats::-webkit-scrollbar {
  width: 6px;
}

.chats::-webkit-scrollbar-track {
  background: transparent;
}

.chats::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.chats::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

.chat-item {
  padding: 12px 15px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
  position: relative;
}

.chat-item:hover {
  background: var(--bg-hover);
}

.chat-item.active {
  background: var(--bg-hover);
  border-left: 3px solid var(--primary-color);
  padding-left: 12px;
}

.chat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
  cursor: pointer;
  margin-top: 4px;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding-right: 84px;
}

.chat-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  position: relative;
}

.chat-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-title-time {
  font-size: 11px;
  color: #8e8e93;
  flex-shrink: 0;
}

/* Ф.0.3 - Unread Badge */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary-color, #007aff);
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
}

.unread-badge.muted {
  background: #697586;
}

.chat-preview {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  gap: 4px;
}

.chat-preview-sender {
  font-weight: 600;
  color: var(--success-color);
  flex-shrink: 0;
}

.chat-preview-text {
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.chat-actions {
  position: absolute;
  top: 10px;
  right: 15px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.mute-toggle-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  white-space: nowrap;
}

.mute-toggle-btn.muted {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.mute-toggle-btn.muted:hover {
  background: rgba(76, 175, 80, 0.3);
  transform: translateY(-1px);
}

.mute-toggle-btn.unmuted {
  background: rgba(112, 117, 121, 0.2);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.mute-toggle-btn.unmuted:hover {
  background: rgba(112, 117, 121, 0.3);
  transform: translateY(-1px);
}

/* Ф.2.1 - Activity badges container (below mute button) */
.chat-activity {
  position: absolute;
  top: 34px;
  right: 15px;
  display: flex;
  align-items: center;
  z-index: 1;
}

.chat-create-menu-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.18);
  z-index: 12;
}

.chat-list-dock-shell {
  position: relative;
  z-index: 14;
}

.chat-list-dock {
  position: relative;
  z-index: 14;
  width: 100%;
  min-height: 42px;
  border: none;
  border-top: 1px solid var(--border-color);
  background: rgba(19, 29, 39, 0.96);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.chat-list-dock--compact {
  min-height: 40px;
}

.chat-list-dock:hover {
  background: rgba(25, 39, 52, 0.98);
}

.chat-create-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(61, 199, 255, 0.18);
  border-radius: 10px;
  background: rgba(18, 27, 38, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 13;
}

.chat-create-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-create-menu--compact {
  left: calc(100% + 12px);
  right: auto;
  width: 216px;
  transform: translateY(8px);
}

.chat-create-menu--compact.is-open {
  transform: translateY(0);
}

.chat-create-menu__item {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.chat-create-menu__item:hover {
  border-color: rgba(61, 199, 255, 0.32);
  background: rgba(31, 49, 65, 0.92);
}

.chat-create-search-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 10px);
  max-height: min(72vh, 560px);
  overflow: hidden;
  border: 1px solid rgba(61, 199, 255, 0.18);
  border-radius: 12px;
  background: rgba(18, 27, 38, 0.99);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
  z-index: 13;
}

.chat-create-search-panel--compact {
  left: calc(100% + 12px);
  right: auto;
  bottom: 0;
  width: min(336px, calc(100vw - 108px));
}

.chat-create-search-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-create-search-panel__close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.chat-create-search-panel__close:hover {
  border-color: rgba(61, 199, 255, 0.28);
  background: rgba(31, 49, 65, 0.92);
}

.chat-create-search-panel .global-search {
  position: static;
  top: auto;
  padding: 12px;
  border-bottom: none;
  background: transparent;
}

.chat-create-search-panel .search-results {
  max-height: min(44vh, 360px);
}

.chat-list-dock.is-open .chat-list-dock__line--vertical {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.chat-list-dock__line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.chat-list-dock__line--vertical {
  transform: translate(-50%, -50%) rotate(90deg);
}

.chat-list.compact .chat-list-header {
  padding: 10px 8px;
  gap: 8px;
}

.chat-list.compact .chat-list-header__top {
  justify-content: center;
}

.chat-list.compact .user-info,
.chat-list.compact .global-search,
.chat-list.compact .search-bar,
.chat-list.compact .chat-info,
.chat-list.compact .chat-preview-time,
.chat-list.compact .mute-toggle-btn {
  display: none;
}

.chat-list.compact .chat-item {
  justify-content: center;
  padding: 12px 8px;
  min-height: 76px;
}

.chat-list.compact .chat-item.active {
  padding-left: 8px;
}

.chat-list.compact .chat-avatar {
  margin-top: 0;
}

.chat-list.compact .chat-actions {
  top: 8px;
  right: 8px;
}

.chat-list.compact .chat-activity {
  top: auto;
  bottom: 8px;
  right: 8px;
}

.chat-list.compact .activity-badge {
  padding: 3px 5px;
  font-size: 7px;
}

.chat-list.compact .chat-list-header__modes {
  justify-content: center;
  overflow: visible;
}

/* Ф.2.1 - Activity badges in chat list */
.activity-badge {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
  animation: activityBadgeFadeIn 0.3s ease-in-out;
}

.activity-badge.activity-typing {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid #3b82f6;
}

.activity-badge.activity-voice {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid #fbbf24;
}

.activity-badge.activity-video {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid #ef4444;
}

@keyframes activityBadgeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.mute-indicator {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(112, 117, 121, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.empty-state,
.loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state small {
  font-size: 13px;
  color: var(--text-muted);
}

/* Search Results */
.search-results {
  padding: 0;
}

.search-result-item {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.avatar-small {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-info-small .username {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.user-info-small .name {
  font-size: 13px;
  color: var(--text-muted);
}

/* Empty States */
.loading, .empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state small {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

/* Chat Window */
.chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background: var(--bg-chat);
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.chat-header-avatar {
  flex-shrink: 0;
}

.chat-header h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.chat-header h2.clickable {
  cursor: pointer;
  transition: color 0.2s;
}

.chat-header h2.clickable:hover {
  color: var(--primary-color);
}

.search-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-toggle-btn .icon {
  width: 20px;
  height: 20px;
}

.search-toggle-btn:hover {
  background: var(--hover-color);
}

.new-post-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 16px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.new-post-btn:hover {
  background: var(--primary-hover);
}

/* Scroll to bottom button */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 84px;
  right: max(16px, var(--chat-side-padding));
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.scroll-to-bottom-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

.scroll-to-bottom-btn:active {
  transform: scale(0.95);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-wrapper {
  transition: background 0.3s;
}

.message-wrapper.highlighted {
  background: rgba(255, 215, 0, 0.15);
  border-radius: 8px;
  margin: -4px;
  padding: 4px;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px var(--chat-side-padding);
  display: flex;
  flex-direction: column;
  /* Background применяется динамически через inline styles */
}

.messages-container::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

.empty-messages {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-messages p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-messages small {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
}

/* Messages */
.message {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-end;
  animation: messageSlide 0.2s ease-out;
}

.message-bubble-column {
  display: flex;
  flex-direction: column;
  /* SSOT: ширина из переменной, иначе проценты внутри считаются от "сжатой" колонки */
  max-width: var(--message-bubble-max-width);
  min-width: 0;
}

.message-sender-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-sender-name);
  margin-bottom: 4px;
}

.message-avatar-slot {
  width: 40px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.message-avatar,
.message-avatar-spacer {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.message-avatar {
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.own {
  justify-content: flex-end;
}

.message.other {
  justify-content: flex-start;
}

.message-content {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  word-wrap: break-word;
  position: relative;
}

.message-content.has-reaction-dock {
  padding-bottom: 48px;
}

.message.own .message-content {
  background: var(--bg-message-own);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.message.other .message-content {
  background: var(--bg-message-other);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Убираем фон и padding для видеокружков */
.message-content.video-note-only {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  max-width: fit-content !important;
}

.message-text {
  font-size: 14.5px;
  line-height: 1.5;
  margin-bottom: 4px;
  white-space: pre-wrap;
}

.message-attachments {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-time {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  text-align: right;
  margin-top: 4px;
}

.message.other .message-time {
  color: var(--text-muted);
}

/* Message indicators */
.message-pinned-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.message-pinned-badge img {
  width: 16px;
  height: 16px;
  display: block;
}

.message-pinned-badge .icon-dark {
  display: none;
}

/* Dark theme */
.dark .message-pinned-badge .icon-light {
  display: none;
}

.dark .message-pinned-badge .icon-dark {
  display: block;
}

.message.pinned {
  border-left: 3px solid #FFA726;
}

.message-forwarded-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  font-style: italic;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-forwarded-label img {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.message-forwarded-label .icon-dark {
  display: none;
}

.dark .message-forwarded-label .icon-light {
  display: none;
}

.dark .message-forwarded-label .icon-dark {
  display: block;
}

.message-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.message-edited-badge {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.message-edited-badge img {
  width: 12px;
  height: 12px;
  display: block;
  opacity: 0.5;
}

.message-edited-badge .icon-dark {
  display: none;
}

.dark .message-edited-badge .icon-light {
  display: none;
}

.dark .message-edited-badge .icon-dark {
  display: block;
}

/* Ф.1: Read Receipts - индикаторы статуса прочтения */
.message-read-status {
  font-size: 12px;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  user-select: none;
  font-weight: 600;
}

/* Sending - одна галочка серая */
.message-read-status.sending {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Delivered - две галочки серые */
.message-read-status.delivered {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Read - две галочки синие - яркий синий на белом фоне */
.message-read-status.read {
  color: #4FC3F7 !important; /* Светло-голубой - хорошо видно на фиолетовом */
}

/* Dark theme adjustments */
.dark .message-read-status.sending {
  color: rgba(255, 255, 255, 0.4) !important;
}

.dark .message-read-status.delivered {
  color: rgba(255, 255, 255, 0.5) !important;
}

.dark .message-read-status.read {
  color: #81D4FA !important; /* Еще светлее для dark theme */
}

.message.other .message-edited-badge {
  color: #999;
}

/* Reply preview */
.message-reply-preview {
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-left: 3px solid #2196F3;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  gap: 8px;
}

.message-reply-preview:hover {
  background: rgba(0, 0, 0, 0.15);
}

.reply-preview-line {
  width: 3px;
  background: var(--color-reply-line);
  border-radius: 2px;
  flex-shrink: 0;
}

.reply-preview-content {
  flex: 1;
  min-width: 0;
}

.reply-preview-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-reply-author);
  margin-bottom: 2px;
}

/* В чужих сообщениях (серый фон) — используем переменную для контраста */
.message.other .reply-preview-author {
  color: var(--color-reply-author-other);
}

.reply-preview-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message.other .reply-preview-text {
  color: var(--text-primary);
}

/* Message Attachments Grid */
.message-attachments {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

/* 1 attachment - full width */
.message-attachments:has(> :only-child) {
  grid-template-columns: 1fr;
}

/* 2-4 attachments - 2 columns */
.message-attachments:has(> :nth-child(2)),
.message-attachments:has(> :nth-child(3)),
.message-attachments:has(> :nth-child(4)) {
  grid-template-columns: repeat(2, 1fr);
}

/* 5+ attachments - 3 columns */
.message-attachments:has(> :nth-child(5)) {
  grid-template-columns: repeat(3, 1fr);
}

/* Responsive: на мобильных всегда 1-2 колонки */
@media (max-width: 768px) {
  .message-attachments {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  }
}

/* Message Input Container */
.message-input-container {
  background: transparent !important;
  border: none !important;
  padding: 0;
}

/* Message Input */
.message-input {
  padding: 16px var(--chat-side-padding);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  position: relative;
  background: transparent !important;
}

.message-input-editor {
  flex: 1;
  position: relative;
}

.message-input textarea {
  width: 100%;
  min-height: 48px;
  max-height: 180px;
  padding: 12px 104px 12px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  overflow-y: auto;
  font-family: inherit;
}

.message-input textarea::placeholder {
  color: var(--text-muted);
}

.message-input textarea:focus {
  border-color: var(--primary-color);
}

.message-input-emoji-button {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  opacity: 0.9;
}

.message-input-emoji-button:hover:not(:disabled) {
  background: transparent;
  opacity: 1;
  transform: translateY(-50%);
}

.message-input-emoji-button:active,
.message-input-emoji-button:disabled {
  transform: translateY(-50%);
}

.message-input button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: transparent;
  color: var(--primary-color);
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

/* Override for recorder buttons to keep purple circles */
.message-input .voice-recorder-button,
.message-input .video-note-button {
  width: 44px;
  height: 44px;
  background: var(--primary-color) !important;
  color: #fff;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
}

.message-input .voice-recorder-button:hover,
.message-input .video-note-button:hover {
  background: var(--primary-hover) !important;
  transform: scale(1.05);
}

.message-input .voice-recorder-button:active,
.message-input .video-note-button:active {
  transform: scale(0.95);
}

.message-input button:hover:not(:disabled) {
  background: transparent;
  opacity: 0.8;
  transform: scale(1.05);
}

.message-input button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.message-input .message-input-emoji-button:hover:not(:disabled),
.message-input .message-input-emoji-button:active,
.message-input .message-input-emoji-button:disabled {
  transform: translateY(-50%);
}

/* Video note button (theme-aware) */
.video-note-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.video-note-button:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.video-note-button:active {
  transform: scale(0.95);
}

.video-note-button img {
  width: 22px;
  height: 22px;
  display: block;
}

.video-note-button .icon-dark {
  display: none;
}

body[data-theme="dark"] .video-note-button .icon-light {
  display: none;
}

body[data-theme="dark"] .video-note-button .icon-dark {
  display: block;
}



/* No Chat Selected */
.no-chat-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  background: var(--bg-chat);
}

.no-chat-selected h2 {
  font-size: 26px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.no-chat-selected p {
  font-size: 15px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    --chat-side-padding: 12px;
  }

  .sidebar-shell,
  .sidebar,
  .main-content {
    width: 100%;
  }

  .sidebar {
    border-right: none;
  }
}

/* Drag overlay for chat window */
.drag-overlay-chat {
  position: absolute;
  inset: 0;
  background: rgba(14, 22, 33, 0.34);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
}

.drag-overlay-content {
  background: rgba(23, 33, 43, 0.96);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  text-align: center;
  animation: scaleIn 0.2s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: min(420px, calc(100% - 32px));
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.drag-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.drag-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.drag-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .app-container {
    --chat-side-padding: 10px;
  }

  .chat-list-header {
    padding: 14px 12px;
  }

  .chat-list-header__top {
    gap: 10px;
  }

  .drag-overlay-content {
    padding: 28px 20px;
  }
}
.app-mode-sidebar {
  background: var(--bg-sidebar);
}

.app-mode-sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.app-mode-sidebar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-mode-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-mode-switcher::-webkit-scrollbar {
  display: none;
}

.app-mode-switcher__button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border-radius: 10px;
  min-height: 34px;
  padding: 0 12px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.app-mode-switcher__button:hover {
  border-color: rgba(61, 199, 255, 0.32);
  background: rgba(255, 255, 255, 0.05);
}

.app-mode-switcher__button.is-active {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.app-mode-switcher__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-mode-switcher--compact {
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.app-mode-switcher--compact .app-mode-switcher__button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-mode-switcher--compact .app-mode-switcher__label {
  font-size: 16px;
  letter-spacing: 0;
}

.app-mode-switcher--embedded {
  width: 100%;
}

.app-mode-switcher--embedded .app-mode-switcher__button {
  min-width: 0;
}

.mode-sidebar-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mode-sidebar-panel__eyebrow,
.mode-workspace__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mode-sidebar-panel__title {
  font-size: 24px;
  line-height: 1.1;
  color: var(--text-primary);
}

.mode-sidebar-panel__description {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.mode-sidebar-panel__sections {
  display: grid;
  gap: 10px;
}

.mode-sidebar-panel__section-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.mode-sidebar-panel__section-card h3 {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.mode-sidebar-panel__section-card p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.mode-sidebar-panel--compact {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 8px;
}

.mode-sidebar-panel__compact-title {
  width: 100%;
  padding: 12px 8px;
  border-radius: 16px;
  background: rgba(135, 116, 225, 0.16);
  color: var(--text-primary);
  font-weight: 700;
  text-align: center;
}

.mode-sidebar-panel__compact-list {
  width: 100%;
  display: grid;
  gap: 8px;
}

.mode-sidebar-panel__compact-chip {
  width: 100%;
  padding: 10px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.mode-workspace {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(18px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mode-workspace__hero {
  padding: clamp(20px, 3vw, 34px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(135, 116, 225, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.mode-workspace__title {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  color: var(--text-primary);
}

.mode-workspace__description {
  margin-top: 14px;
  max-width: 780px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.mode-workspace__highlights {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.mode-workspace__highlight {
  padding: 14px;
  border-radius: 18px;
  background: rgba(14, 22, 33, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  line-height: 1.45;
}

.mode-workspace__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.mode-workspace__card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.mode-workspace__card h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.mode-workspace__card p,
.mode-workspace__footnote {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.app-mode-mobile-screen {
  background: var(--bg-main);
}

.app-mode-mobile-bar {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(23, 33, 43, 0.96);
}

.app-mode-mobile-body,
.app-mode-mobile-stack {
  flex: 1;
  min-height: 0;
}

.app-mode-mobile-body {
  display: flex;
  flex-direction: column;
}

.app-mode-mobile-body--chat {
  overflow: hidden;
}

.app-mode-mobile-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
}

.app-mode-mobile-section {
  min-width: 0;
}

.app-mode-mobile-section .mode-sidebar-panel,
.app-mode-mobile-section .mode-workspace {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 768px) {
  .app-mode-sidebar-header {
    padding: 12px;
  }

  .mode-workspace {
    padding: 18px 14px 20px;
  }

  .mode-workspace__hero {
    padding: 20px 18px;
    border-radius: 22px;
  }

  .mode-workspace__highlights,
  .mode-workspace__cards {
    grid-template-columns: 1fr;
  }
}.mode-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-filter-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mode-filter-chip.is-active {
  color: #f7fbff;
  background: #1b3040;
  border-color: rgba(61, 199, 255, 0.44);
}

.mode-workspace-shell {
  background: var(--bg-main);
}

.mode-workspace-canvas {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-main);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.mode-workspace-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(61, 199, 255, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(4, 8, 14, 0.68), rgba(4, 8, 14, 0.88));
  pointer-events: none;
}

.mode-workspace-canvas > * {
  position: relative;
  z-index: 1;
}

.mode-workspace-stack {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mode-empty-state,
.mode-error-state {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.mode-empty-state__card,
.mode-error-state__card {
  max-width: 520px;
  padding: 24px;
  border-radius: 6px;
  background: rgba(14, 22, 33, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-empty-state__card h2,
.mode-error-state__card h2 {
  color: var(--text-primary);
  font-size: 28px;
}

.mode-empty-state__card p,
.mode-error-state__card p {
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.mode-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.mode-button,
.mode-button--ghost,
.mode-button--danger,
.mode-button--subtle {
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mode-button {
  border: 1px solid rgba(61, 199, 255, 0.35);
  color: #f7fbff;
  background: #22384b;
}

.mode-button--ghost {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.mode-button--danger {
  border: 1px solid rgba(255, 119, 100, 0.45);
  background: rgba(210, 76, 59, 0.1);
  color: #ffd5cb;
}

.mode-button--subtle {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
}

.mode-button:hover,
.mode-button--ghost:hover,
.mode-button--danger:hover,
.mode-button--subtle:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.mode-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 4px;
  background: rgba(20, 36, 48, 0.96);
  border: 1px solid rgba(61, 199, 255, 0.16);
  color: #d7e7f2;
  font-size: 13px;
  line-height: 1.5;
}

.mode-note.is-warning {
  background: rgba(67, 51, 21, 0.72);
  border-color: rgba(255, 179, 71, 0.24);
  color: #ffe0a6;
}

.mode-note.is-error {
  background: rgba(78, 29, 22, 0.82);
  border-color: rgba(255, 122, 100, 0.24);
  color: #ffd4cb;
}

.mode-input,
.mode-textarea {
  width: 100%;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 15, 22, 0.96);
  color: var(--text-primary);
  padding: 10px 12px;
  outline: none;
}

.mode-input:focus,
.mode-textarea:focus {
  border-color: rgba(84, 201, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(84, 201, 255, 0.12);
}

.mode-textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.6;
}

.mode-pane {
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 24, 33, 0.94);
  min-height: 0;
}

.mode-pane__header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-pane__body {
  min-height: 0;
  padding: 18px 20px 22px;
}

.mode-sidebar-frame {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.mode-sidebar-header {
  flex: 0 0 auto;
}

.mode-sidebar-header__spacer {
  flex: 1;
}

.mode-sidebar-header--compact .chat-list-header__top {
  justify-content: center;
}

.mode-sidebar-frame,
.ai-workspace,
.ai-billing-modal {
  --ai-panel-bg: rgba(18, 23, 30, 0.9);
  --ai-panel-bg-elevated: rgba(22, 28, 36, 0.96);
  --ai-panel-bg-soft: rgba(255, 255, 255, 0.03);
  --ai-panel-border: rgba(255, 255, 255, 0.08);
  --ai-panel-border-strong: rgba(255, 255, 255, 0.15);
  --ai-accent: #c2cdd6;
  --ai-accent-strong: #f1f4f6;
  --ai-accent-soft: rgba(194, 205, 214, 0.12);
  --ai-success: #93b39c;
  --ai-warning: #c7af7d;
  --ai-danger: #d0a096;
  --ai-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.mode-sidebar-header .chat-list-header__modes .app-mode-switcher {
  width: 100%;
}

.mode-sidebar-header .chat-list-header__modes .app-mode-switcher:not(.app-mode-switcher--compact) {
  gap: 8px;
}

.mode-sidebar-header .chat-list-header__modes .app-mode-switcher:not(.app-mode-switcher--compact) .app-mode-switcher__button {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 12px;
  border-color: var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
}

.mode-sidebar-header .chat-list-header__modes .app-mode-switcher--compact {
  gap: 8px;
}

.mode-sidebar-header .chat-list-header__modes .app-mode-switcher--compact .app-mode-switcher__button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border-color: var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
}

.mode-sidebar-header .chat-list-header__modes .app-mode-switcher--compact .app-mode-switcher__label {
  font-size: 13px;
}

.mode-sidebar-header .chat-list-header__modes .app-mode-switcher__button.is-active {
  border-color: var(--ai-panel-border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.news-sidebar-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 16px;
  padding: 14px 14px 16px;
}

.news-sidebar-panel--compact {
  padding: 12px 8px;
}

.news-sidebar-panel__hero {
  padding: 18px;
  border-radius: 6px;
  background: rgba(16, 24, 33, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2px solid rgba(61, 199, 255, 0.44);
}

.news-sidebar-panel__eyebrow,
.ai-sidebar-panel__eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.news-sidebar-panel__hero h2,
.ai-sidebar-panel__hero h2 {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1.05;
}

.news-sidebar-panel__hero p,
.ai-sidebar-panel__hero p {
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.news-source-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.news-source-list--compact {
  align-items: center;
  gap: 8px;
}

.news-source-card {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(16, 24, 33, 0.9);
  cursor: pointer;
}

.news-source-card.is-active {
  background: rgba(24, 38, 51, 0.98);
  border-color: rgba(61, 199, 255, 0.28);
}

.news-source-card--compact {
  position: relative;
  width: 58px;
  padding: 6px;
  display: grid;
  place-items: center;
}

.news-source-card__compact-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(61, 199, 255, 0.18);
  color: #f7fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.news-source-card__row,
.news-window__header-row,
.ai-chat-row,
.ai-workspace__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.news-source-card__identity,
.news-window__identity,
.ai-chat-row__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.news-source-card__avatar,
.news-window__avatar,
.ai-chat-row__avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #22384b;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #f4fbff;
}

.news-source-card__avatar img,
.news-window__avatar img,
.ai-chat-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.news-source-card__title,
.news-window__identity h2,
.ai-chat-row__title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-source-card__subtitle,
.ai-chat-row__subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.news-source-card__excerpt,
.news-window__preview,
.ai-chat-row__meta {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.news-source-card__footer,
.news-window__toolbar,
.ai-composer__footer,
.ai-workspace__rail-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.news-badge,
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.news-badge.is-count {
  background: rgba(61, 199, 255, 0.12);
  color: #d7efff;
}

.news-window,
.ai-workspace {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.news-window__panel,
.ai-workspace__panel,
.ai-workspace__rail-card {
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 13, 22, 0.56);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.news-window__header,
.news-window__summary,
.ai-workspace__thread,
.ai-workspace__rail {
  min-height: 0;
}

.news-window__header {
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.news-window__messages,
.ai-message-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-message-list {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ai-message-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.news-message-card,
.ai-message {
  border-radius: 6px;
  padding: 14px 16px;
  background: rgba(8, 15, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transform-origin: center bottom;
  transition:
    transform 0.28s cubic-bezier(0.2, 0.78, 0.18, 1),
    opacity 0.24s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.news-message-card__meta,
.ai-message__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.news-message-card__sender,
.ai-message__role {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.news-message-card__timestamp,
.ai-message__timestamp {
  color: var(--text-muted);
  font-size: 11px;
}

.ai-message__metaRight {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.news-message-card__text,
.ai-message__text {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.58;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-message__text--markdown {
  white-space: normal;
}

.ai-message__plainText {
  display: inline;
  white-space: inherit;
}

.ai-message__voiceActivity {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 18px;
  margin-top: 10px;
}

.ai-message__voiceBar {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(129, 255, 222, 0.96), rgba(61, 199, 255, 0.54));
  animation: ai-message-voice-bar 1.1s ease-in-out infinite;
  transform-origin: center bottom;
}

.ai-message__voiceBar:nth-child(1) { height: 8px; animation-delay: 0s; }
.ai-message__voiceBar:nth-child(2) { height: 14px; animation-delay: 0.08s; }
.ai-message__voiceBar:nth-child(3) { height: 18px; animation-delay: 0.16s; }
.ai-message__voiceBar:nth-child(4) { height: 12px; animation-delay: 0.24s; }
.ai-message__voiceBar:nth-child(5) { height: 16px; animation-delay: 0.32s; }
.ai-message__voiceBar:nth-child(6) { height: 10px; animation-delay: 0.4s; }

.ai-message__voiceActivity.is-thinking .ai-message__voiceBar {
  background: linear-gradient(180deg, rgba(255, 227, 153, 0.96), rgba(255, 166, 86, 0.58));
  animation-duration: 1.3s;
}

.ai-message__thinkingDots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.ai-message__thinkingDots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 226, 154, 0.9);
  animation: ai-message-thinking-dot 1.1s ease-in-out infinite;
}

.ai-message__thinkingDots span:nth-child(2) {
  animation-delay: 0.12s;
}

.ai-message__thinkingDots span:nth-child(3) {
  animation-delay: 0.24s;
}

.ai-message__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-message__actions--top {
  justify-content: flex-end;
}

.ai-message__actions--bottom {
  display: flex;
  width: 100%;
  margin-top: 8px;
  justify-content: flex-end;
}

.ai-message__action,
.ai-code-block__copy {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--ai-panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: rgba(228, 235, 240, 0.84);
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.ai-message__action--wide {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  gap: 6px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.ai-message__action--wide span {
  line-height: 1;
}

.ai-message__action:hover:not(:disabled),
.ai-code-block__copy:hover:not(:disabled) {
  border-color: var(--ai-panel-border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.ai-message__action:disabled,
.ai-code-block__copy:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.ai-message__action--danger {
  border-color: rgba(208, 160, 150, 0.22);
  color: rgba(233, 203, 197, 0.9);
}

.ai-message__action--danger:hover:not(:disabled) {
  border-color: rgba(208, 160, 150, 0.38);
  color: #fff4ef;
}

.ai-message__action--active {
  border-color: rgba(147, 179, 156, 0.32);
  background: rgba(147, 179, 156, 0.12);
  color: #bfd7c6;
}

.ai-message__action--active:hover:not(:disabled) {
  border-color: rgba(147, 179, 156, 0.44);
  color: #d8e8dc;
}

.ai-message-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-message-edit__textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--ai-panel-border);
  border-radius: 12px;
  background: var(--ai-panel-bg-elevated);
  color: var(--text-primary);
  font: inherit;
  line-height: 1.55;
}

.ai-message-edit__textarea:focus {
  outline: none;
  border-color: var(--ai-panel-border-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.ai-message-edit__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-message-edit__hint,
.ai-message-edit__warning {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.ai-message-edit__warning {
  color: rgba(255, 220, 171, 0.88);
}

.ai-message-edit__buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.ai-icon-button__icon {
  width: 14px;
  height: 14px;
  display: block;
}

.ai-markdown__paragraph {
  margin: 0;
  white-space: pre-wrap;
}

.ai-markdown__paragraph + .ai-markdown__paragraph,
.ai-markdown__paragraph + .ai-markdown__list,
.ai-markdown__list + .ai-markdown__paragraph,
.ai-markdown__list + .ai-markdown__list,
.ai-code-block + .ai-markdown__paragraph,
.ai-markdown__paragraph + .ai-code-block,
.ai-markdown__list + .ai-code-block,
.ai-code-block + .ai-code-block {
  margin-top: 12px;
}

.ai-markdown__list {
  margin: 0;
  padding-left: 20px;
  white-space: pre-wrap;
}

.ai-markdown__list--ordered {
  list-style: decimal;
}

.ai-markdown__listItem + .ai-markdown__listItem {
  margin-top: 4px;
}

.ai-markdown__link {
  color: #7be6f6;
  text-decoration: underline;
  text-decoration-color: rgba(123, 230, 246, 0.34);
}

.ai-inline-code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 24, 38, 0.92);
  border: 1px solid rgba(84, 201, 255, 0.12);
  color: #d9f7ff;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.94em;
}

.ai-code-block {
  border: 1px solid rgba(84, 201, 255, 0.14);
  border-radius: 6px;
  background: rgba(3, 8, 14, 0.94);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ai-code-block.is-copied {
  border-color: rgba(106, 236, 188, 0.4);
  box-shadow: 0 0 0 1px rgba(106, 236, 188, 0.16), 0 0 22px rgba(106, 236, 188, 0.12);
  animation: ai-code-block-copy-flash 1.2s ease;
}

.ai-code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(84, 201, 255, 0.08);
  background: rgba(10, 16, 26, 0.98);
  color: rgba(146, 208, 218, 0.84);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ai-code-block__copy {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 6px;
  background: rgba(5, 11, 18, 0.96);
}

.ai-code-block__body {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  color: #edf7ff;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

.ai-code-block__body code {
  font-family: inherit;
}

.ai-code-block__body .hljs {
  display: block;
  background: transparent;
  color: #edf7ff;
}

.ai-code-block__body .hljs-comment,
.ai-code-block__body .hljs-quote {
  color: #6b8fa6;
  font-style: italic;
}

.ai-code-block__body .hljs-keyword,
.ai-code-block__body .hljs-selector-tag,
.ai-code-block__body .hljs-literal,
.ai-code-block__body .hljs-built_in,
.ai-code-block__body .hljs-type {
  color: #ff9d5c;
}

.ai-code-block__body .hljs-string,
.ai-code-block__body .hljs-attr,
.ai-code-block__body .hljs-template-tag,
.ai-code-block__body .hljs-template-variable {
  color: #7df0c6;
}

.ai-code-block__body .hljs-title,
.ai-code-block__body .hljs-title.class_,
.ai-code-block__body .hljs-title.function_,
.ai-code-block__body .hljs-section {
  color: #7dd8ff;
}

.ai-code-block__body .hljs-number,
.ai-code-block__body .hljs-symbol,
.ai-code-block__body .hljs-bullet,
.ai-code-block__body .hljs-variable,
.ai-code-block__body .hljs-variable.language_ {
  color: #ffd66e;
}

.ai-code-block__body .hljs-meta,
.ai-code-block__body .hljs-tag,
.ai-code-block__body .hljs-name {
  color: #f08ae8;
}

.ai-code-block__body .hljs-subst,
.ai-code-block__body .hljs-punctuation {
  color: #d7e6f3;
}

.news-message-card__reply {
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 3px solid rgba(84, 201, 255, 0.45);
  color: var(--text-secondary);
  font-size: 13px;
}

.news-message-card__attachments {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.news-workspace-mobile,
.ai-workspace-mobile {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mode-mobile-backbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(14, 22, 33, 0.96);
}

.mode-mobile-backbar__title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}

.ai-sidebar-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  padding: 12px 12px 14px;
  overflow: hidden;
}

.ai-sidebar-panel--compact {
  padding: 10px 8px 12px;
}

.ai-sidebar-panel__hero {
  padding: 4px 2px 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ai-sidebar-panel__hero h2 {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.ai-sidebar-panel__hero p {
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ai-sidebar-panel__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-sidebar-panel__brand--header {
  flex: 1;
  min-width: 0;
  gap: 0;
  align-items: flex-start;
}

.ai-sidebar-panel__brand--header .ai-sidebar-panel__brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 10px;
  font-size: 16px;
}

.ai-sidebar-panel__brand--header .ai-sidebar-panel__brand-title {
  font-size: 16px;
}

.ai-sidebar-panel__brand--header .ai-sidebar-panel__brand-subtitle {
  margin-top: 1px;
  font-size: 11px;
}

.ai-sidebar-panel__brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(68, 236, 213, 0.26);
  background: linear-gradient(180deg, rgba(44, 222, 214, 0.96), rgba(21, 163, 177, 0.92));
  box-shadow: 0 0 24px rgba(44, 222, 214, 0.16);
  color: #041117;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.ai-sidebar-panel__brand-copy {
  min-width: 0;
}

.ai-sidebar-panel__brand-title {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ai-sidebar-panel__brand-subtitle {
  margin-top: 3px;
  color: rgba(198, 209, 218, 0.54);
  font-size: 12px;
  font-weight: 500;
}

.ai-sidebar-panel__actions {
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.ai-sidebar-panel__new-chat {
  min-height: 40px;
  border: 1px solid rgba(194, 205, 214, 0.18);
  border-radius: 12px;
  background: rgba(194, 205, 214, 0.12);
  color: #edf2f5;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: none;
}

.ai-sidebar-panel__new-chat:hover {
  filter: none;
  background: rgba(194, 205, 214, 0.2);
  border-color: rgba(194, 205, 214, 0.28);
}

.ai-sidebar-panel__search {
  min-height: 40px;
  border-radius: 12px;
  border-color: var(--ai-panel-border);
  background: var(--ai-panel-bg-soft);
}

.ai-sidebar-panel__draft {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ai-panel-bg-soft);
  border: 1px solid var(--ai-panel-border);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.ai-sidebar-panel__compact-create {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--ai-panel-border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
  border-radius: 12px;
  cursor: pointer;
}

.ai-chat-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.ai-chat-list--compact {
  align-items: center;
  gap: 8px;
}

.ai-chat-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg-soft);
  backdrop-filter: blur(10px);
  box-shadow: none;
  overflow: hidden;
}

.ai-chat-row__surface {
  flex: 1;
  width: 100%;
  padding: 13px 40px 13px 13px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ai-chat-row__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-chat-row__copy {
  min-width: 0;
}

.ai-chat-row__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-accent-soft);
  color: var(--ai-accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.ai-chat-row__title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.ai-chat-row__subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.ai-chat-row.is-active {
  background: var(--ai-panel-bg-elevated);
  border-color: var(--ai-panel-border-strong);
  box-shadow: inset 2px 0 0 rgba(241, 244, 246, 0.42);
}

.ai-chat-row--compact {
  width: 52px;
  min-height: 52px;
  border-radius: 50%;
}

.ai-chat-row--compact .ai-chat-row__surface {
  min-height: 52px;
  padding: 5px;
  display: grid;
  place-items: center;
}

.ai-chat-row--compact .ai-chat-row__avatar {
  width: 40px;
  height: 40px;
}

.ai-chat-row__time {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-sidebar-panel__footer {
  margin-top: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg-elevated);
  backdrop-filter: blur(10px);
}

.ai-sidebar-panel__footerButton {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.ai-sidebar-panel__footerButton:hover {
  border-color: var(--ai-panel-border-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.ai-sidebar-panel__user-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid var(--ai-panel-border-strong);
  box-shadow: none;
}

.ai-sidebar-panel__user-copy {
  min-width: 0;
}

.ai-sidebar-panel__user-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.ai-sidebar-panel__user-meta {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.ai-workspace {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.ai-workspace__thread,
.ai-chat-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.ai-chat-stage {
  background: #0c1218;
}

.ai-chat-topbar-shell {
  flex: 0 0 auto;
  padding: 6px 10px 0;
  background: transparent;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ai-chat-topbar-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.ai-chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--ai-panel-border);
  border-radius: 12px;
  background: var(--ai-panel-bg);
  box-shadow: none;
  flex-wrap: nowrap;
  min-width: max-content;
  overflow: visible;
}

.ai-chat-topbar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.ai-chat-topbar__left,
.ai-chat-topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: max-content;
}

.ai-chat-topbar__right {
  justify-content: flex-end;
}

.ai-chat-topbar__metrics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.ai-chat-topbar__modelMenu {
  position: relative;
}

.ai-chat-topbar__modelButton {
  min-width: 360px;
  max-width: min(760px, 68vw);
  min-height: 42px;
  padding: 8px 38px 8px 14px;
  border: 1px solid var(--ai-panel-border-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  position: relative;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.ai-chat-topbar__modelButton:hover:not(:disabled),
.ai-chat-topbar__modelButton.is-open {
  transform: translateY(-1px);
  border-color: rgba(91, 224, 214, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.ai-chat-topbar__modelButton:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.ai-chat-topbar__modelButton .ai-icon-button__icon {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 13px;
  height: 13px;
  color: rgba(224, 232, 238, 0.76);
  transform: translateY(-50%);
  transition: transform 0.16s ease;
}

.ai-chat-topbar__modelButton.is-open .ai-icon-button__icon {
  transform: translateY(-50%) rotate(180deg);
}

.ai-chat-topbar__modelTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #f3f7fb;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  flex: 0 1 auto;
}

.ai-chat-topbar__modelProviderAccent {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--ai-provider-accent-border);
  background: linear-gradient(135deg, var(--ai-provider-accent-soft-strong), var(--ai-provider-accent-soft));
  color: var(--ai-provider-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
}

.ai-chat-topbar__modelTitleText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-chat-topbar__modelMetaLine {
  color: rgba(184, 197, 206, 0.72);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

.ai-chat-topbar__modelDropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(760px, calc(100vw - 40px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgba(91, 224, 214, 0.22);
  border-radius: 18px;
  background: rgba(7, 13, 22, 0.97);
  backdrop-filter: blur(20px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
  z-index: 1400;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ai-chat-topbar__modelDropdown::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.ai-chat-topbar__modelSection + .ai-chat-topbar__modelSection {
  margin-top: 14px;
}

.ai-chat-topbar__modelSectionHeader {
  position: sticky;
  top: -12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 10px;
  background: linear-gradient(180deg, rgba(7, 13, 22, 0.98), rgba(7, 13, 22, 0.88));
}

.ai-chat-topbar__modelSectionHeader strong {
  color: #f4f8fb;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.ai-chat-topbar__modelSectionHeader span {
  color: rgba(180, 193, 202, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-chat-topbar__modelSectionProviders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-chat-topbar__providerChip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--ai-provider-accent-border);
  background: linear-gradient(135deg, var(--ai-provider-accent-soft-strong), var(--ai-provider-accent-soft));
  color: var(--ai-provider-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
}

.ai-chat-topbar__modelProviderGroup + .ai-chat-topbar__modelProviderGroup {
  margin-top: 10px;
}

.ai-chat-topbar__modelProviderName {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  margin: 0 0 6px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--ai-provider-accent-border);
  background: linear-gradient(135deg, var(--ai-provider-accent-soft-strong), var(--ai-provider-accent-soft));
  color: var(--ai-provider-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
}

.ai-chat-topbar__modelList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-chat-topbar__modelOption {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.ai-chat-topbar__modelOption:hover:not(:disabled),
.ai-chat-topbar__modelOption.is-active {
  transform: translateY(-1px);
  border-color: rgba(91, 224, 214, 0.24);
  background: rgba(91, 224, 214, 0.08);
}

.ai-chat-topbar__modelOption:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.ai-chat-topbar__modelOptionTitle {
  color: #f5f9fc;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  flex: 0 0 auto;
}

.ai-chat-topbar__modelOptionMeta {
  color: rgba(177, 190, 199, 0.7);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

.ai-chat-topbar__action {
  min-height: 26px;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 11px;
}

.ai-topbar-stat {
  min-width: fit-content;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ai-topbar-stat__label {
  color: rgba(190, 201, 210, 0.64);
  font-size: 10px;
  font-weight: 700;
}

.ai-topbar-stat__value {
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
}

.ai-topbar-stat__meta {
  color: rgba(224, 232, 238, 0.82);
  font-size: 11px;
  font-weight: 700;
}

.ai-topbar-stat--warn {
  border-color: rgba(199, 175, 125, 0.26);
  background: rgba(199, 175, 125, 0.08);
}

.ai-topbar-stat--critical {
  border-color: rgba(208, 160, 150, 0.28);
  background: rgba(208, 160, 150, 0.08);
}

.ai-chat-surface {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background-color: #060c14;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.ai-chat-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 9, 13, 0.16), rgba(6, 9, 13, 0.42));
  pointer-events: none;
}

.ai-chat-surface > * {
  position: relative;
  z-index: 1;
}

.ai-chat-surface__model-picker {
  padding: 18px clamp(18px, 4vw, 34px) 0;
}

.ai-chat-surface__alerts {
  padding: 14px clamp(18px, 4vw, 34px) 0;
}

.ai-chat-surface__jumpToLatest {
  position: absolute;
  right: clamp(18px, 4vw, 34px);
  bottom: 110px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg-elevated);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}

.ai-chat-surface__jumpToLatest:hover {
  border-color: var(--ai-panel-border-strong);
}

.ai-chat-surface__loading {
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: clamp(18px, 4vw, 34px);
  padding-right: clamp(18px, 4vw, 34px);
}

.ai-model-select--surface {
  width: min(640px, 100%);
}

.ai-model-select--surface .ai-model-select__control {
  min-height: 44px;
  border-radius: 12px;
  border-color: var(--ai-panel-border);
  background: var(--ai-panel-bg-elevated);
}

.ai-chat-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(6, 12, 20, 0.88), rgba(7, 13, 22, 0.62));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-console-bar {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.2fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: start;
}

.ai-console-bar__thread,
.ai-console-bar__model,
.ai-console-bar__meta {
  min-width: 0;
}

.ai-console-bar__title {
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.ai-console-bar__subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.ai-console-bar__model {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.ai-console-bar__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.ai-console-bar__metricRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ai-console-chip {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(91, 224, 214, 0.14);
  background: rgba(7, 13, 22, 0.62);
  backdrop-filter: blur(12px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-console-chip span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-console-chip strong {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.ai-console-chip--metric {
  min-width: 0;
}

.ai-chat-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ai-chat-header__copy {
  flex: 1 1 360px;
  min-width: 0;
}

.ai-chat-header__copy h2 {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.ai-chat-header__lede {
  margin-top: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 780px;
}

.ai-chat-header__pills {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-chat-header__controls {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-chat-header__actions {
  margin-top: 0;
}

.ai-workspace__panel-body {
  padding: 0 26px 24px;
  min-height: 0;
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.18), rgba(5, 10, 18, 0.58));
}

.ai-model-select,
.ai-model-pill {
  min-width: 280px;
  max-width: 360px;
}

.ai-model-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-model-select--inline {
  flex: 1 1 280px;
}

.ai-model-select__label,
.ai-model-pill__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--text-muted);
}

.ai-model-select__control {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg-elevated);
  color: var(--text-primary);
  padding: 0 12px;
  outline: none;
}

.ai-model-select__control:focus {
  border-color: var(--ai-panel-border-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.ai-model-pill {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid rgba(61, 199, 255, 0.16);
  background: rgba(7, 13, 22, 0.7);
}

.ai-model-pill--compact {
  min-height: 44px;
  justify-content: center;
}

.ai-model-pill strong {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
}

.ai-chat-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ai-stat-card {
  min-height: 88px;
  padding: 14px 15px;
  border-radius: 4px;
  border: 1px solid rgba(61, 199, 255, 0.1);
  background: rgba(7, 13, 22, 0.54);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ai-stat-card__label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-stat-card__value {
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.ai-stat-card__hint {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.ai-message.is-user {
  background: rgba(59, 71, 84, 0.7);
  border-color: rgba(194, 205, 214, 0.16);
  align-self: flex-end;
}

.ai-message.is-assistant {
  background: rgba(18, 23, 30, 0.82);
  align-self: flex-start;
}

.ai-message.is-interrupted {
  border-color: rgba(199, 175, 125, 0.32);
  box-shadow: none;
}

.ai-message.is-failed {
  border-color: rgba(208, 160, 150, 0.34);
}

.ai-message.is-copied {
  border-color: rgba(147, 179, 156, 0.34);
  box-shadow: none;
  animation: ai-message-copy-flash 1.2s ease;
}

.ai-message.is-transient-voice {
  animation: ai-message-rise-in 0.28s ease-out;
}

.ai-message.is-transient-voice.is-user {
  border-color: rgba(194, 205, 214, 0.26);
  box-shadow: none;
}

.ai-message.is-transient-voice.is-assistant {
  border-color: rgba(199, 175, 125, 0.18);
  box-shadow: none;
}

.ai-message.is-voice-thinking {
  background: rgba(45, 37, 28, 0.84);
}

.ai-message {
  width: min(760px, 82%);
  max-width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(18, 23, 30, 0.82);
  box-shadow: none;
  transition:
    transform 0.24s cubic-bezier(0.2, 0.78, 0.18, 1),
    opacity 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
  animation: ai-message-card-enter 0.28s cubic-bezier(0.2, 0.78, 0.18, 1);
}

.ai-message__status {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 11px;
}

.ai-message__caret {
  display: inline-block;
  width: 10px;
  height: 1.1em;
  margin-left: 4px;
  border-radius: 2px;
  background: rgba(241, 244, 246, 0.76);
  vertical-align: text-bottom;
  animation: ai-caret-pulse 0.9s ease-in-out infinite;
}

@keyframes ai-caret-pulse {
  0%,
  100% { opacity: 0.22; }
  50% { opacity: 1; }
}

@keyframes ai-message-copy-flash {
  0% {
    border-color: rgba(106, 236, 188, 0.1);
    box-shadow: 0 0 0 0 rgba(106, 236, 188, 0);
  }
  30% {
    border-color: rgba(106, 236, 188, 0.52);
    box-shadow: 0 0 0 1px rgba(106, 236, 188, 0.24), 0 0 28px rgba(106, 236, 188, 0.18);
  }
  100% {
    border-color: rgba(106, 236, 188, 0.42);
    box-shadow: 0 0 0 1px rgba(106, 236, 188, 0.18), 0 0 26px rgba(106, 236, 188, 0.14);
  }
}

@keyframes ai-message-card-enter {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ai-message-rise-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ai-message-voice-bar {
  0%,
  100% {
    transform: scaleY(0.56);
    opacity: 0.54;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes ai-message-thinking-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes ai-code-block-copy-flash {
  0% {
    border-color: rgba(106, 236, 188, 0.08);
    box-shadow: 0 0 0 0 rgba(106, 236, 188, 0);
  }
  30% {
    border-color: rgba(106, 236, 188, 0.48);
    box-shadow: 0 0 0 1px rgba(106, 236, 188, 0.2), 0 0 24px rgba(106, 236, 188, 0.16);
  }
  100% {
    border-color: rgba(106, 236, 188, 0.4);
    box-shadow: 0 0 0 1px rgba(106, 236, 188, 0.16), 0 0 22px rgba(106, 236, 188, 0.12);
  }
}

.ai-message-list--empty {
  justify-content: flex-start;
  padding-top: 16px;
}

.ai-welcome-state {
  width: min(880px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.ai-welcome-state__avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-accent-soft);
  color: var(--ai-accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.ai-welcome-state__body {
  min-width: 0;
}

.ai-welcome-state__meta {
  color: rgba(200, 210, 218, 0.68);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.ai-welcome-state__bubble {
  margin-top: 10px;
  max-width: 760px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.ai-welcome-state__bubble p {
  color: var(--text-primary);
  line-height: 1.75;
}

.ai-composer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 1040px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg-elevated);
  backdrop-filter: blur(12px);
  box-shadow: none;
}

.ai-chat-dock {
  margin-top: auto;
  padding: 8px clamp(18px, 5vw, 40px) 12px;
}

.ai-chat-dock__composer {
  width: min(100%, 780px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-composer--surface {
  max-width: none;
  margin: 0;
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg-elevated);
}

.ai-composer.is-disabled {
  border-color: rgba(199, 175, 125, 0.28);
}

.ai-composer__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-composer__fileInput {
  display: none;
}

.ai-composer__attach {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--ai-panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: rgba(228, 235, 240, 0.84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.ai-composer__attach:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--ai-panel-border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.ai-composer__attach:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.ai-composer__voiceToggle {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(228, 235, 240, 0.84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-composer__voiceToggle.is-active {
  border-color: rgba(147, 179, 156, 0.32);
  background: rgba(147, 179, 156, 0.12);
  color: #d5e5d9;
  box-shadow: none;
}

.ai-voice-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px auto;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 0;
}

.ai-voice-inline__bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  height: 22px;
}

.ai-voice-inline__bar {
  width: 4px;
  border-radius: 999px;
  background: rgba(228, 235, 240, 0.54);
  height: calc(6px + (var(--ai-voice-bar-level, 0.18) * 18px));
  min-height: 6px;
  transition: height 0.14s linear, opacity 0.16s ease;
}

.ai-voice-inline__rail {
  position: relative;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.ai-voice-inline__railFill {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: inherit;
  background: rgba(236, 241, 244, 0.84);
  animation: ai-voice-rail-flow 1.4s ease-in-out infinite;
}

.ai-voice-inline__railFill.is-processing {
  width: 46%;
  background: rgba(199, 175, 125, 0.82);
}

.ai-voice-inline__label {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  white-space: nowrap;
}

.ai-voice-inline--capturing .ai-voice-inline__label {
  color: rgba(226, 233, 238, 0.9);
}

.ai-voice-inline--transcribing .ai-voice-inline__label {
  color: rgba(199, 175, 125, 0.92);
}

.ai-voice-inline--realtime .ai-voice-inline__bar {
  animation: ai-voice-inline-bar-pulse 1.18s ease-in-out infinite;
  animation-delay: calc(var(--ai-voice-bar-index, 0) * 0.08s);
}

.ai-voice-inline--realtime.ai-voice-inline--connecting .ai-voice-inline__railFill,
.ai-voice-inline--realtime.ai-voice-inline--thinking .ai-voice-inline__railFill {
  background: rgba(199, 175, 125, 0.82);
}

.ai-voice-inline--realtime.ai-voice-inline--responding .ai-voice-inline__railFill {
  background: rgba(236, 241, 244, 0.84);
}

.ai-voice-inline--realtime.ai-voice-inline--failed .ai-voice-inline__railFill {
  background: rgba(208, 160, 150, 0.82);
}

.ai-voice-inline--realtime.ai-voice-inline--connecting .ai-voice-inline__label {
  color: rgba(199, 175, 125, 0.92);
}

.ai-voice-inline--realtime.ai-voice-inline--responding .ai-voice-inline__label {
  color: rgba(226, 233, 238, 0.9);
}

.ai-voice-inline--realtime.ai-voice-inline--failed .ai-voice-inline__label {
  color: rgba(231, 198, 192, 0.92);
}

@keyframes ai-voice-rail-flow {
  0% {
    transform: translateX(-18%);
  }
  50% {
    transform: translateX(72%);
  }
  100% {
    transform: translateX(-18%);
  }
}

@keyframes ai-voice-inline-bar-pulse {
  0%,
  100% {
    transform: scaleY(0.62);
    opacity: 0.58;
  }
  50% {
    transform: scaleY(1.06);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .ai-voice-inline {
    grid-template-columns: 1fr;
  }

  .ai-voice-inline__label {
    white-space: normal;
  }
}

.ai-composer .mode-textarea {
  flex: 1 1 auto;
  min-height: 32px;
  max-height: 132px;
  resize: none;
  font-size: 13px;
  line-height: 1.4;
  padding: 6px 0 5px;
  border: 0;
  background: transparent;
}

.ai-composer .mode-textarea:focus {
  border: 0;
  box-shadow: none;
}

.ai-voice-composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg);
}

.ai-voice-composer__statusWrap {
  min-width: 0;
  flex: 1 1 auto;
}

.ai-voice-composer__status {
  display: block;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.35;
}

.ai-voice-composer__status--recording {
  color: rgba(199, 175, 125, 0.92);
}

.ai-voice-composer__status--sending {
  color: rgba(226, 233, 238, 0.9);
}

.ai-voice-composer__status--error {
  color: rgba(231, 198, 192, 0.92);
}

.ai-voice-composer__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-voice-composer__button,
.ai-voice-composer__close {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(228, 235, 240, 0.84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.ai-voice-composer__button.is-recording {
  border-color: rgba(199, 175, 125, 0.32);
  background: rgba(199, 175, 125, 0.12);
  color: rgba(245, 231, 203, 0.96);
}

.ai-realtime-voice {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg);
}

.ai-realtime-voice__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-realtime-voice__statusWrap {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-realtime-voice__status {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.35;
}

.ai-realtime-voice__status--connecting,
.ai-realtime-voice__status--live {
  color: rgba(226, 233, 238, 0.9);
}

.ai-realtime-voice__status--error {
  color: rgba(231, 198, 192, 0.92);
}

.ai-realtime-voice__meta {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
  word-break: break-word;
}

.ai-realtime-voice__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-realtime-voice__button,
.ai-realtime-voice__close {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(228, 235, 240, 0.84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.ai-realtime-voice__transcripts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-realtime-voice__transcriptCard {
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
}

.ai-realtime-voice__transcriptLabel {
  display: block;
  margin-bottom: 6px;
  color: rgba(200, 210, 218, 0.72);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
}

.ai-realtime-voice__transcriptText {
  margin: 0;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-chat-dock__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 16px;
}

.ai-chat-dock__model,
.ai-chat-dock__caption {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.ai-chat-dock__model {
  color: rgba(200, 210, 218, 0.7);
  font-weight: 600;
}

.ai-composer__send {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(241, 244, 246, 0.96);
  color: #10161c;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-composer__sendIcon {
  width: 14px;
  height: 14px;
  display: block;
}

.ai-composer-assets,
.ai-message-assets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-composer-assets__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.ai-composer-assets__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-composer-assets__progressBar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.ai-composer-assets__progressFill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(77, 217, 255, 0.82), rgba(121, 246, 220, 0.9));
}

.ai-asset-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(61, 199, 255, 0.12);
  background: rgba(7, 13, 22, 0.72);
}

.ai-asset-card--message {
  align-items: stretch;
  flex-direction: column;
  align-self: flex-start;
  max-width: 220px;
}

.ai-asset-card.is-local {
  border-style: dashed;
}

.ai-asset-card--image {
  border-color: rgba(121, 246, 220, 0.2);
}

.ai-asset-card--audio {
  border-color: rgba(255, 196, 112, 0.2);
}

.ai-asset-card__glyph {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(61, 199, 255, 0.12);
  color: rgba(221, 252, 255, 0.96);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ai-asset-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-asset-card__identity {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-asset-card__body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-asset-card__title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-asset-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.ai-asset-card__action {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(91, 224, 214, 0.16);
  border-radius: 10px;
  background: rgba(9, 16, 27, 0.9);
  color: rgba(221, 252, 255, 0.96);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.ai-asset-card__action:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.ai-asset-card__previewState {
  padding: 12px;
  border-radius: 10px;
  background: rgba(12, 21, 33, 0.9);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.ai-asset-card__previewState--error {
  color: rgba(255, 166, 166, 0.92);
}

.ai-asset-card__imagePreview {
  display: block;
  width: 188px;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(61, 199, 255, 0.12);
  background: rgba(12, 21, 33, 0.9);
}

.ai-asset-card__imagePreview img {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: cover;
}

.ai-asset-card__audioPreviewWrap {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(61, 199, 255, 0.12);
  background: rgba(12, 21, 33, 0.9);
}

.ai-asset-card__audioPreview {
  width: 100%;
}

.ai-billing-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ai-billing-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 12, 0.72);
  backdrop-filter: blur(10px);
}

.ai-billing-modal__panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg-elevated);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.ai-billing-modal__panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.ai-billing-modal__header,
.ai-billing-card__header,
.ai-billing-walletBox__row,
.ai-billing-actionRow,
.ai-billing-topupState__header,
.ai-billing-topupState__meta,
.ai-billing-historyList__item,
.ai-billing-mini-list__row,
.ai-billing-quote__row,
.ai-billing-quote__header,
.ai-billing-range__labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-billing-modal__eyebrow,
.ai-billing-card__eyebrow {
  color: rgba(194, 205, 214, 0.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
}

.ai-billing-modal__header h2,
.ai-billing-card__header h3 {
  color: var(--text-primary);
}

.ai-billing-modal__header {
  align-items: flex-start;
}

.ai-billing-modal__header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ai-billing-card__header h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ai-billing-modal__header p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.ai-billing-modal__headerActions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-billing-modal__headerButton {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.ai-settings-tabs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ai-settings-tabs__button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.ai-settings-tabs__button strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.ai-settings-tabs__button span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.ai-settings-tabs__button:hover {
  border-color: var(--ai-panel-border-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.ai-settings-tabs__button.is-active {
  border-color: rgba(194, 205, 214, 0.28);
  background: rgba(194, 205, 214, 0.08);
}

.ai-billing-modal__grid,
.ai-billing-modal__history {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.ai-billing-modal__grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
}

.ai-billing-modal__history {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-billing-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--ai-panel-border);
  background: var(--ai-panel-bg);
  box-shadow: none;
}

.ai-settings-modal__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-settings-switch {
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.ai-settings-switch input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.ai-settings-switch strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
}

.ai-settings-switch span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.ai-settings-textarea {
  min-height: 148px;
}

.ai-settings-select {
  appearance: none;
  background: rgba(8, 15, 22, 0.96);
  color: var(--text-primary);
  color-scheme: dark;
}

.ai-settings-select option {
  background: rgba(8, 15, 22, 0.98);
  color: var(--text-primary);
}

.ai-settings-previewList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-settings-previewRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-settings-previewRow span {
  color: var(--text-secondary);
  font-size: 12px;
}

.ai-settings-previewRow strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.ai-billing-card__month {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.ai-billing-summary-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ai-billing-summary-tile {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ai-panel-border);
}

.ai-billing-summary-tile span,
.ai-billing-summary-section__title,
.ai-billing-field span,
.ai-billing-field__hint,
.ai-billing-walletBox__meta,
.ai-billing-historyList__item span,
.ai-billing-mini-list__row span,
.ai-billing-quote__row span,
.ai-billing-quote__header span,
.ai-billing-range__labels span,
.ai-billing-topupState__meta span,
.ai-billing-noteAction {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.ai-billing-summary-tile strong,
.ai-billing-mini-list__value,
.ai-billing-historyList__metrics strong,
.ai-billing-quote__row strong,
.ai-billing-quote__header strong,
.ai-billing-range__labels strong,
.ai-billing-topupState strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.ai-billing-summary-tile strong {
  display: block;
  margin-top: 6px;
}

.ai-billing-summary-section {
  margin-top: 14px;
}

.ai-billing-mini-list,
.ai-billing-historyList,
.ai-billing-quote,
.ai-billing-topupState {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-billing-mini-list__row,
.ai-billing-historyList__item,
.ai-billing-topupState,
.ai-billing-quote,
.ai-billing-walletBox {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.03);
}

.ai-billing-mini-list__row strong,
.ai-billing-historyList__item strong {
  display: block;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.ai-billing-historyList__metrics {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.ai-billing-walletBox,
.ai-billing-field,
.ai-billing-presetRow,
.ai-billing-actionRow {
  margin-top: 10px;
}

.ai-billing-walletBox.is-loading {
  border-color: rgba(194, 205, 214, 0.18);
  box-shadow: none;
}

.ai-billing-actionRow--single {
  justify-content: flex-end;
}

.ai-billing-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-billing-field__input,
.ai-billing-field .mode-input {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 10px;
  border-color: var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.02);
}

.ai-billing-field__input:focus,
.ai-billing-field .mode-input:focus {
  border-color: var(--ai-panel-border-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.ai-billing-walletBox__address {
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-all;
}

.ai-billing-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
}

.ai-billing-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(14, 20, 26, 0.96);
  background: rgba(236, 241, 244, 0.96);
  box-shadow: none;
}

.ai-billing-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(14, 20, 26, 0.96);
  background: rgba(236, 241, 244, 0.96);
  box-shadow: none;
}

.ai-billing-range:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-billing-submitButton {
  min-width: 0;
  min-height: 38px;
  width: 100%;
  position: relative;
  border-radius: 10px;
  border-color: rgba(194, 205, 214, 0.18);
  background: rgba(194, 205, 214, 0.14);
  color: var(--text-primary);
  box-shadow: none;
}

.ai-billing-submitButton:hover:not(:disabled) {
  background: rgba(194, 205, 214, 0.24);
  border-color: rgba(194, 205, 214, 0.28);
}

.ai-billing-submitButton:active:not(:disabled) {
  transform: translateY(1px);
}

.ai-billing-submitButton.is-loading {
  border-color: var(--ai-panel-border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.ai-billing-submitButton__content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ai-billing-submitButton__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.92);
  animation: ai-billing-spin 0.8s linear infinite;
}

.ai-billing-submitButton:disabled,
.ai-billing-actionRow .mode-button:disabled,
.ai-billing-actionRow .mode-button--ghost:disabled {
  opacity: 0.56;
  filter: saturate(0.72);
  cursor: not-allowed;
}

.ai-billing-presetRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-billing-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--ai-panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 233, 238, 0.88);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-billing-status--credited {
  border-color: rgba(147, 179, 156, 0.22);
  color: #cfe0d3;
}

.ai-billing-status--failed,
.ai-billing-status--expired,
.ai-billing-status--cancelled {
  border-color: rgba(208, 160, 150, 0.24);
  color: #e0bbb2;
}

@keyframes ai-billing-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.ai-billing-status--confirming,
.ai-billing-status--submitted,
.ai-billing-status--awaiting_signature {
  border-color: rgba(199, 175, 125, 0.22);
  color: #d8c39b;
}

.ai-billing-topupLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.92fr);
  gap: 12px;
  margin-top: 10px;
}

.ai-billing-topupLayout__main,
.ai-billing-topupLayout__aside {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-billing-inlineNote {
  margin-top: 0;
  padding: 10px 11px;
  border-radius: 10px;
  font-size: 11px;
}

.ai-billing-topupLayout__aside .ai-billing-quote,
.ai-billing-topupLayout__aside .ai-billing-topupState {
  margin-top: 0;
}

.ai-billing-quote__header {
  align-items: flex-start;
}

.ai-billing-quote__header strong,
.ai-billing-topupState__header strong {
  font-size: 13px;
  font-weight: 700;
}

.ai-billing-quote__header span {
  max-width: 280px;
}

.ai-billing-quote__row,
.ai-billing-topupState__meta {
  gap: 8px;
}

.ai-billing-quote__row + .ai-billing-quote__row,
.ai-billing-topupState__meta + .ai-billing-topupState__meta {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-billing-actionRow--topup {
  margin-top: 2px;
  width: 100%;
  justify-content: stretch;
  align-items: stretch;
}

.ai-billing-actionRow--topup .ai-billing-submitButton {
  flex: 1 1 auto;
}

.ai-billing-topupState__action {
  align-self: flex-start;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 11px;
}

@media (max-width: 1080px) {
  .ai-settings-tabs,
  .ai-settings-modal__grid,
  .ai-billing-topupLayout,
  .ai-billing-modal__grid,
  .ai-billing-modal__history {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .ai-billing-modal {
    padding: 10px;
    align-items: stretch;
  }

  .ai-billing-modal__panel {
    width: 100%;
    max-height: none;
    border-radius: 18px;
    padding: 14px;
  }

  .ai-billing-modal__header,
  .ai-billing-walletBox__row,
  .ai-billing-actionRow,
  .ai-billing-topupState__header,
  .ai-billing-historyList__item,
  .ai-billing-mini-list__row,
  .ai-settings-previewRow,
  .ai-billing-topupState__meta,
  .ai-billing-quote__row,
  .ai-billing-quote__header,
  .ai-billing-range__labels {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-billing-historyList__metrics {
    align-items: flex-start;
    text-align: left;
  }

  .ai-billing-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-settings-tabs__button {
    min-height: 0;
  }

  .ai-billing-submitButton {
    width: 100%;
    min-width: 0;
  }
}

.ai-composer__send:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #ffffff;
}

.ai-composer__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-chat-row__delete {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(225, 235, 243, 0.58);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, opacity 0.16s ease;
  z-index: 2;
}

.ai-chat-row__delete:hover {
  color: #f5fbff;
}

.ai-chat-row__delete:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.ai-chat-row--compact .ai-chat-row__delete {
  display: none;
}

.ai-empty-chat {
  padding: 44px 24px;
}

.ai-empty-chat__card {
  text-align: left;
  max-width: 760px;
  padding: 30px 32px;
  background: linear-gradient(180deg, rgba(4, 10, 18, 0.72), rgba(9, 15, 26, 0.46));
  border: 1px solid rgba(61, 199, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.ai-empty-chat__card h2 {
  font-size: clamp(36px, 6vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.ai-empty-chat__card p {
  max-width: 580px;
}

.ai-empty-chat__model {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 4px;
  background: rgba(17, 56, 77, 0.88);
  color: #f7fbff;
  font-size: 12px;
  font-weight: 700;
}

.ai-empty-chat__hint {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  max-width: 520px;
}

.ai-badge--accent {
  border-color: rgba(61, 199, 255, 0.2);
  background: rgba(10, 30, 42, 0.68);
  color: #ebfbff;
}

@media (max-width: 1200px) {
  .ai-chat-topbar {
    align-items: flex-start;
  }

  .ai-chat-topbar__right {
    justify-content: flex-start;
  }

  .ai-console-bar {
    grid-template-columns: 1fr;
  }

  .ai-console-bar__meta {
    align-items: stretch;
  }

  .ai-console-bar__metricRow {
    justify-content: flex-start;
  }

  .ai-chat-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .news-window,
  .ai-workspace {
    padding: 0;
  }

  .ai-chat-header {
    padding: 14px 14px 12px;
  }

  .ai-sidebar-panel__hero {
    padding: 2px 0 8px;
  }

  .ai-sidebar-panel__brand {
    align-items: flex-start;
  }

  .ai-chat-topbar-shell {
    padding: 8px 10px 0;
  }

  .ai-chat-topbar {
    padding: 6px 8px;
  }

  .ai-chat-topbar__metrics {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .ai-chat-surface__model-picker,
  .ai-chat-surface__alerts,
  .ai-chat-dock {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ai-chat-header__controls,
  .ai-chat-header__top {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-console-bar__metricRow {
    justify-content: flex-start;
  }

  .ai-model-select,
  .ai-model-pill {
    min-width: 0;
    max-width: none;
  }

  .ai-chat-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-message-list,
  .ai-workspace__panel-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ai-composer,
  .ai-composer--surface {
    padding: 6px 8px;
    border-radius: 18px;
  }

  .ai-chat-dock__hint {
    justify-content: flex-start;
  }

  .ai-realtime-voice__header {
    flex-direction: column;
  }

  .ai-realtime-voice__transcripts {
    grid-template-columns: 1fr;
  }

  .ai-welcome-state {
    gap: 12px;
  }

  .ai-welcome-state__bubble {
    padding: 18px;
  }

  .ai-message {
    width: min(100%, 92%);
  }

  .ai-chat-row__delete {
    flex-basis: 42px;
  }
}/**
 * Icons Styles
 * Unified icon system with dark/light theme support
 */

/* Base icon class */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* Icon mappings - Dark theme (white icons) */
body[data-theme="dark"] .icon-add,
body:not([data-theme]) .icon-add {
  background-image: url('/icons/dark/add.png');
}

body[data-theme="dark"] .icon-settings,
body:not([data-theme]) .icon-settings {
  background-image: url('/icons/dark/settings.png');
}

body[data-theme="dark"] .icon-settings-menu,
body:not([data-theme]) .icon-settings-menu {
  background-image: url('/icons/dark/settings.png');
}

body[data-theme="dark"] .icon-search,
body:not([data-theme]) .icon-search {
  background-image: url('/icons/dark/search.png');
}

body[data-theme="dark"] .icon-link,
body:not([data-theme]) .icon-link {
  background-image: url('/icons/dark/link.png');
}

body[data-theme="dark"] .icon-mute,
body:not([data-theme]) .icon-mute {
  background-image: url('/icons/dark/mute.png');
}

body[data-theme="dark"] .icon-unmute,
body:not([data-theme]) .icon-unmute {
  background-image: url('/icons/dark/unmute.png');
}

body[data-theme="dark"] .icon-report,
body:not([data-theme]) .icon-report {
  background-image: url('/icons/dark/report.png');
}

body[data-theme="dark"] .icon-info,
body:not([data-theme]) .icon-info {
  background-image: url('/icons/dark/info.png');
}

body[data-theme="dark"] .icon-leave,
body:not([data-theme]) .icon-leave {
  background-image: url('/icons/dark/logout.png');
}

body[data-theme="dark"] .icon-delete,
body:not([data-theme]) .icon-delete {
  background-image: url('/icons/dark/closed.png');
}

body[data-theme="dark"] .icon-lock,
body:not([data-theme]) .icon-lock {
  background-image: url('/icons/dark/padlock.png');
}

body[data-theme="dark"] .icon-bell,
body:not([data-theme]) .icon-bell {
  background-image: url('/icons/dark/ring.png');
}

body[data-theme="dark"] .icon-data,
body:not([data-theme]) .icon-data {
  background-image: url('/icons/dark/data.png');
}

body[data-theme="dark"] .icon-palette,
body:not([data-theme]) .icon-palette {
  background-image: url('/icons/dark/palette.png');
}

body[data-theme="dark"] .icon-logout,
body:not([data-theme]) .icon-logout {
  background-image: url('/icons/dark/logout.png');
}

body[data-theme="dark"] .icon-download,
body:not([data-theme]) .icon-download {
  background-image: url('/icons/dark/download.png');
}

body[data-theme="dark"] .icon-bug,
body:not([data-theme]) .icon-bug {
  background-image: url('/icons/dark/bug.png');
}

body[data-theme="dark"] .icon-lang,
body:not([data-theme]) .icon-lang {
  background-image: url('/icons/dark/lang.png');
}

body[data-theme="dark"] .icon-pin,
body:not([data-theme]) .icon-pin {
  background-image: url('/icons/dark/pin.png');
}

body[data-theme="dark"] .icon-login,
body:not([data-theme]) .icon-login {
  background-image: url('/icons/dark/login.png');
}

body[data-theme="dark"] .icon-blacklist,
body:not([data-theme]) .icon-blacklist {
  background-image: url('/icons/dark/blacklist.png');
}

body[data-theme="dark"] .icon-key,
body:not([data-theme]) .icon-key {
  background-image: url('/icons/dark/key.png');
}

/* Icon mappings - Light theme (black icons) */
body[data-theme="light"] .icon-add {
  background-image: url('/icons/light/add.png');
}

body[data-theme="light"] .icon-settings {
  background-image: url('/icons/light/settings.png');
}

body[data-theme="light"] .icon-settings-menu {
  background-image: url('/icons/light/settings.png');
}

body[data-theme="light"] .icon-search {
  background-image: url('/icons/light/search.png');
}

body[data-theme="light"] .icon-link {
  background-image: url('/icons/light/link.png');
}

body[data-theme="light"] .icon-mute {
  background-image: url('/icons/light/mute.png');
}

body[data-theme="light"] .icon-unmute {
  background-image: url('/icons/light/unmute.png');
}

body[data-theme="light"] .icon-report {
  background-image: url('/icons/light/report.png');
}

body[data-theme="light"] .icon-info {
  background-image: url('/icons/light/info.png');
}

body[data-theme="light"] .icon-leave {
  background-image: url('/icons/light/logout.png');
}

body[data-theme="light"] .icon-delete {
  background-image: url('/icons/light/closed.png');
}

body[data-theme="light"] .icon-lock {
  background-image: url('/icons/light/padlock.png');
}

body[data-theme="light"] .icon-bell {
  background-image: url('/icons/light/ring.png');
}

body[data-theme="light"] .icon-data {
  background-image: url('/icons/light/data.png');
}

body[data-theme="light"] .icon-palette {
  background-image: url('/icons/light/palette.png');
}

body[data-theme="light"] .icon-logout {
  background-image: url('/icons/light/logout.png');
}

body[data-theme="light"] .icon-download {
  background-image: url('/icons/light/download.png');
}

body[data-theme="light"] .icon-bug {
  background-image: url('/icons/light/bug.png');
}

body[data-theme="light"] .icon-lang {
  background-image: url('/icons/light/lang.png');
}

body[data-theme="light"] .icon-pin {
  background-image: url('/icons/light/pin.png');
}

body[data-theme="light"] .icon-login {
  background-image: url('/icons/light/login.png');
}

body[data-theme="light"] .icon-blacklist {
  background-image: url('/icons/light/blacklist.png');
}

body[data-theme="light"] .icon-key {
  background-image: url('/icons/light/key.png');
}

/* Settings icons with background */
.settings-icon .icon {
  width: 20px;
  height: 20px;
}
/**
 * Кастомные стили для Solana Wallet Adapter
 */

/* Контейнер для кнопки подключения кошелька */
.wallet-connect-section {
  margin: 16px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Переопределяем стили кнопки WalletMultiButton */
.wallet-adapter-button {
  min-height: 46px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 10px 18px !important;
  color: #f4f8fb !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease !important;
  box-shadow: none !important;
}

.wallet-adapter-button:hover:not([disabled]) {
  transform: translateY(-1px) !important;
  border-color: rgba(91, 224, 214, 0.24) !important;
  background: rgba(91, 224, 214, 0.08) !important;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22) !important;
}

.wallet-adapter-button[disabled] {
  opacity: 0.48 !important;
  cursor: not-allowed !important;
}

/* Модальное окно выбора кошелька */
.wallet-adapter-modal-wrapper {
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 10000 !important;
  padding: 20px !important;
}

.wallet-adapter-modal {
  background: rgba(7, 13, 22, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6) !important;
  max-width: 380px !important;
  width: 100% !important;
  padding: 28px !important;
  max-height: 85vh !important;
  overflow: visible !important;
  position: relative !important;
  margin: 0 auto !important;
}

.wallet-adapter-modal-title {
  color: var(--text-primary, #ffffff) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  margin-bottom: 20px !important;
}

/* Список кошельков */
.wallet-adapter-modal-list {
  display: grid !important;
  gap: 12px !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  margin: 0 !important;
}

.wallet-adapter-modal-list-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 14px !important;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease !important;
  cursor: pointer !important;
}

.wallet-adapter-modal-list-item:hover {
  border-color: rgba(91, 224, 214, 0.24) !important;
  background: rgba(91, 224, 214, 0.08) !important;
  transform: translateY(-1px) !important;
}

.wallet-adapter-button-start-icon {
  margin-right: 12px !important;
  width: 28px !important;
  height: 28px !important;
}

/* Кнопка закрытия */
.wallet-adapter-modal-button-close {
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary, #aaaaaa) !important;
  cursor: pointer !important;
  padding: 8px !important;
  transition: color 0.2s ease !important;
}

.wallet-adapter-modal-button-close:hover {
  color: var(--text-primary, #ffffff) !important;
}

/* Иконка подключенного кошелька */
.wallet-adapter-button-trigger {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Темная тема */
[data-theme="dark"] .wallet-adapter-modal {
  background: rgba(7, 13, 22, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .wallet-adapter-modal-list-item {
  background: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .wallet-adapter-modal-list-item:hover {
  background: rgba(91, 224, 214, 0.08) !important;
}

/* Светлая тема */
[data-theme="light"] .wallet-adapter-modal {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .wallet-adapter-modal-title {
  color: #1a1a1a !important;
}

[data-theme="light"] .wallet-adapter-modal-list-item {
  background: #f5f5f5 !important;
}

[data-theme="light"] .wallet-adapter-modal-list-item:hover {
  background: #e8e8e8 !important;
}

[data-theme="light"] .wallet-adapter-button {
  color: #ffffff !important;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .wallet-adapter-modal {
    max-width: 90vw !important;
    padding: 20px !important;
  }

  .wallet-adapter-button {
    padding: 10px 20px !important;
    font-size: 13px !important;
  }

  .wallet-connect-section {
    margin: 1rem 0;
  }
}

/* Анимация загрузки */
.wallet-adapter-button-spinner {
  animation: wallet-spinner 1s linear infinite !important;
}

@keyframes wallet-spinner {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Всплывающая подсказка */
.wallet-adapter-tooltip {
  background: rgba(0, 0, 0, 0.9) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  max-width: 200px !important;
}

/* Локализованный dropdown для кнопки кошелька */
.wallet-button-wrapper {
  position: relative;
  display: inline-block;
}

.wallet-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(7, 13, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 200px;
  z-index: 10001;
  overflow: hidden;
}

.wallet-dropdown-item {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wallet-dropdown-item:last-child {
  border-bottom: none;
}

.wallet-dropdown-item:hover {
  background: rgba(91, 224, 214, 0.08);
}

.wallet-dropdown-item-disconnect {
  color: #ff6b6b;
}

.wallet-dropdown-item-disconnect:hover {
  background: rgba(255, 107, 107, 0.1);
}


.wallet-adapter-button {
    background-color: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-family: 'DM Sans', 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    height: 48px;
    line-height: 48px;
    padding: 0 24px;
    border-radius: 4px;
}

.wallet-adapter-button-trigger {
    background-color: #512da8;
}

.wallet-adapter-button:not([disabled]):focus-visible {
    outline-color: white;
}

.wallet-adapter-button:not([disabled]):hover {
    background-color: #1a1f2e;
}

.wallet-adapter-button[disabled] {
    background: #404144;
    color: #999;
    cursor: not-allowed;
}

.wallet-adapter-button-end-icon,
.wallet-adapter-button-start-icon,
.wallet-adapter-button-end-icon img,
.wallet-adapter-button-start-icon img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.wallet-adapter-button-end-icon {
    margin-left: 12px;
}

.wallet-adapter-button-start-icon {
    margin-right: 12px;
}

.wallet-adapter-collapse {
    width: 100%;
}

.wallet-adapter-dropdown {
    position: relative;
    display: inline-block;
}

.wallet-adapter-dropdown-list {
    position: absolute;
    z-index: 99;
    display: grid;
    grid-template-rows: 1fr;
    grid-row-gap: 10px;
    padding: 10px;
    top: 100%;
    right: 0;
    margin: 0;
    list-style: none;
    background: #2c2d30;
    border-radius: 10px;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
    font-family: 'DM Sans', 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.wallet-adapter-dropdown-list-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(10px);
}

.wallet-adapter-dropdown-list-item {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    border: none;
    outline: none;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    padding: 0 20px;
    width: 100%;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    height: 37px;
    color: #fff;
}

.wallet-adapter-dropdown-list-item:not([disabled]):hover {
    background-color: #1a1f2e;
}

.wallet-adapter-modal-collapse-button svg {
    align-self: center;
    fill: #999;
}

.wallet-adapter-modal-collapse-button.wallet-adapter-modal-collapse-button-active svg {
    transform: rotate(180deg);
    transition: transform ease-in 150ms;
}

.wallet-adapter-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity linear 150ms;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    overflow-y: auto;
}

.wallet-adapter-modal.wallet-adapter-modal-fade-in {
    opacity: 1;
}

.wallet-adapter-modal-button-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 12px;
    cursor: pointer;
    background: #1a1f2e;
    border: none;
    border-radius: 50%;
}

.wallet-adapter-modal-button-close:focus-visible {
    outline-color: white;
}

.wallet-adapter-modal-button-close svg {
    fill: #777;
    transition: fill 200ms ease 0s;
}

.wallet-adapter-modal-button-close:hover svg {
    fill: #fff;
}

.wallet-adapter-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

.wallet-adapter-modal-container {
    display: flex;
    margin: 3rem;
    min-height: calc(100vh - 6rem); /* 100vh - 2 * margin */
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .wallet-adapter-modal-container {
        margin: 1rem;
        min-height: calc(100vh - 2rem); /* 100vh - 2 * margin */
    }
}

.wallet-adapter-modal-wrapper {
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: column;
    z-index: 1050;
    max-width: 400px;
    border-radius: 10px;
    background: #10141f;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.6);
    font-family: 'DM Sans', 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    flex: 1;
}

.wallet-adapter-modal-wrapper .wallet-adapter-button {
    width: 100%;
}

.wallet-adapter-modal-title {
    font-weight: 500;
    font-size: 24px;
    line-height: 36px;
    margin: 0;
    padding: 64px 48px 48px 48px;
    text-align: center;
    color: #fff;
}

@media (max-width: 374px) {
    .wallet-adapter-modal-title {
        font-size: 18px;
    }
}

.wallet-adapter-modal-list {
    margin: 0 0 12px 0;
    padding: 0;
    width: 100%;
    list-style: none;
}

.wallet-adapter-modal-list .wallet-adapter-button {
    font-weight: 400;
    border-radius: 0;
    font-size: 18px;
}

.wallet-adapter-modal-list .wallet-adapter-button-end-icon,
.wallet-adapter-modal-list .wallet-adapter-button-start-icon,
.wallet-adapter-modal-list .wallet-adapter-button-end-icon img,
.wallet-adapter-modal-list .wallet-adapter-button-start-icon img {
    width: 28px;
    height: 28px;
}

.wallet-adapter-modal-list .wallet-adapter-button span {
    margin-left: auto;
    font-size: 14px;
    opacity: .6;
}

.wallet-adapter-modal-list-more {
    cursor: pointer;
    border: none;
    padding: 12px 24px 24px 12px;
    align-self: flex-end;
    display: flex;
    align-items: center;
    background-color: transparent;
    color: #fff;
}

.wallet-adapter-modal-list-more svg {
    transition: all 0.1s ease;
    fill: rgba(255, 255, 255, 1);
    margin-left: 0.5rem;
}

.wallet-adapter-modal-list-more-icon-rotate {
    transform: rotate(180deg);
}

.wallet-adapter-modal-middle {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px 24px 24px;
    box-sizing: border-box;
}

.wallet-adapter-modal-middle-button {
    display: block;
    cursor: pointer;
    margin-top: 48px;
    width: 100%;
    background-color: #512da8;
    padding: 12px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    color: #fff;
}
