:root {
  --bg: #07080f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface2: rgba(255, 255, 255, 0.07);
  --surface3: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.09);
  --border2: rgba(255, 255, 255, 0.16);
  --accent: #5865f2;
  --accent2: #7289da;
  --accent-glow: rgba(88, 101, 242, 0.45);
  --accent-glow2: rgba(88, 101, 242, 0.15);
  --purple: #9b59b6;
  --green: #3ba55d;
  --green-glow: rgba(59, 165, 93, 0.35);
  --red: #ed4245;
  --yellow: #faa81a;
  --cyan: #43b5c8;
  --text: #e2e4ea;
  --text-bright: #ffffff;
  --muted: #7a8090;
  --muted2: #9da5b4;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── ANIMATED MESH GRADIENT BACKGROUND ── */
@keyframes meshMove {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(88, 101, 242, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(155, 89, 182, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 60% 30%, rgba(67, 181, 200, 0.07) 0%, transparent 60%);
  background-size: 200% 200%;
  animation: meshMove 15s ease infinite;
  color: var(--text);
  min-height: 100vh;
  padding: 0 0 84px;
  overflow-x: hidden;
  font-size: 15px;
}

/* ── AUTH SCREEN ── */
#authScreen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at top, #1a1b2e 0%, var(--bg) 70%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  transition: opacity 0.4s;
}

#authScreen.hidden {
  opacity: 0;
  pointer-events: none;
}

.auth-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 30px;
  letter-spacing: 0.5px;
}

.pin-display {
  display: flex;
  gap: 14px;
  margin-bottom: 40px;
  justify-content: center;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 270px;
  margin: 0 auto;
}

.pin-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: white;
  font-size: 22px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pin-btn:active {
  background: var(--surface2);
  transform: scale(0.91);
}

.pin-btn.action {
  font-size: 16px;
  background: rgba(237, 66, 69, 0.1);
  border-color: rgba(237, 66, 69, 0.3);
  color: var(--red);
}

.pin-error {
  color: var(--red);
  font-size: 13px;
  height: 20px;
  margin-bottom: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.pin-error.show {
  opacity: 1;
}

.vibrate {
  animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-2px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(4px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-6px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(6px, 0, 0);
  }
}

/* ── HEADER ── */
.header {
  background: rgba(9, 10, 16, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.9), rgba(114, 137, 218, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.status-dot {
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  transition: all .4s;
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .7;
    transform: scale(1.25);
  }
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 31, 48, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── TG ONLY OVERLAY ── */
#tgOnlyOverlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

#tgOnlyOverlay.hidden {
  display: none;
}

/* ── LOADING ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .5s;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ── MAIN CONTROL CARD ── */
.main-card {
  margin: 12px 16px 0;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.18) 0%, rgba(114, 137, 218, 0.07) 100%);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 12px 40px rgba(88, 101, 242, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.run-btn {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.run-btn.start {
  background: linear-gradient(135deg, var(--green), #2d9c52);
  color: white;
  box-shadow: 0 6px 24px rgba(59, 165, 93, .35);
}

.run-btn.start:active {
  transform: scale(0.97);
}

.run-btn.pause {
  background: linear-gradient(135deg, var(--red), #c73538);
  color: white;
  box-shadow: 0 6px 24px rgba(237, 66, 69, .35);
}

.run-btn.pause:active {
  transform: scale(0.97);
}

.mode-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.mode-btn {
  flex: 1;
  padding: 10px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.mode-btn.active-mode {
  background: rgba(88, 101, 242, 0.15);
  border-color: rgba(88, 101, 242, 0.4);
  color: #a0aaff;
}

/* ── STATS ── */
.stats-row {
  display: flex;
  gap: 8px;
  margin: 12px 0 0;
}

.stat-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.stat-val {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.stat-lbl {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── SECTION/CARD/ROW ── */
.section {
  margin: 14px 16px 0;
}

.section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.3px;
  padding: 0 4px;
  margin-bottom: 8px;
}

.card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.row {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  gap: 12px;
  transition: background .15s;
  border: none;
  background: transparent;
}

.row+.row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.row:active {
  background: rgba(255, 255, 255, 0.04);
}

.row-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.row-icon.blue {
  background: rgba(88, 101, 242, 0.15);
}

.row-icon.green {
  background: rgba(59, 165, 93, 0.15);
}

.row-icon.yellow {
  background: rgba(250, 168, 26, 0.15);
}

.row-icon.red {
  background: rgba(237, 66, 69, 0.15);
}

.row-icon.purple {
  background: rgba(155, 89, 182, 0.15);
}

.row-icon.cyan {
  background: rgba(26, 188, 156, 0.15);
}

.row-body {
  flex: 1;
  min-width: 0;
}

.row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.row-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── TOGGLE ── */
.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .25s;
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.toggle input:checked+.toggle-track {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.toggle input:checked+.toggle-track::after {
  transform: translateX(18px);
  background: white;
}

/* ── SLIDERS ── */
.slider-wrap {
  padding: 4px 16px 14px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.slider-val {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
  cursor: pointer;
  transition: transform .15s;
}

input[type=range]::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

/* ── DUAL SLIDER ── */
.dual-slider {
  padding: 4px 16px 14px;
}

.dual-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.dual-val {
  color: var(--text);
  font-weight: 700;
}

.slider-pair {
  display: flex;
  gap: 12px;
  align-items: center;
}

.slider-pair input {
  flex: 1;
}

.slider-sep {
  color: var(--muted);
  font-size: 14px;
}

/* ── INPUT ── */
.input-wrap {
  padding: 4px 16px 14px;
}

.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

.input-field:focus {
  border-color: rgba(88, 101, 242, 0.5);
}

.input-field::placeholder {
  color: var(--muted);
}

.input-btn {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.input-btn:active {
  transform: scale(.98);
  background: var(--accent2);
}

/* ── EXPANDABLE ── */
.expand-row {
  cursor: pointer;
}

.expand-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform .2s;
  flex-shrink: 0;
}

.expand-arrow.open {
  transform: rotate(90deg);
}

.expand-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.4, 0, .2, 1);
}

.expand-content.open {
  max-height: 500px;
}

/* ── PREFIX OPTIONS ── */
.prefix-opts {
  display: flex;
  gap: 8px;
  padding: 4px 16px 14px;
  flex-wrap: wrap;
}

.opt-btn {
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.opt-btn.selected {
  background: rgba(88, 101, 242, 0.2);
  border-color: rgba(88, 101, 242, 0.5);
  color: #a0aaff;
}

/* ── BOTTOM SAVE BAR ── */
.save-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 11, 20, 0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  z-index: 200;
}

.save-btn {
  flex: 1;
  padding: 13px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.save-btn:active {
  transform: scale(.98);
}

.save-btn:disabled {
  opacity: .4;
}

/* ── BADGE ── */
.badge {
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.badge-green {
  background: rgba(59, 165, 93, 0.2);
  color: #3ba55d;
}

.badge-red {
  background: rgba(237, 66, 69, 0.2);
  color: #ed4245;
}

.badge-blue {
  background: rgba(88, 101, 242, 0.2);
  color: #a0aaff;
}

/* ── TAB BAR ── */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(7, 8, 15, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  z-index: 300;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .22s cubic-bezier(.4, 0, .2, 1);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  user-select: none;
  gap: 4px;
}

.tab-item:active {
  transform: scale(0.88);
}

.tab-item .tab-icon {
  font-size: 23px;
  line-height: 1;
  transition: transform 0.2s;
}

.tab-item.active .tab-icon {
  transform: scale(1.1);
}

.tab-item.active {
  color: var(--accent);
  background: rgba(88, 101, 242, 0.13);
}

/* ── TAB CONTENT ── */
.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none !important;
}

.tab-content:not(.hidden, .active) {
  display: none;
}

/* ── VOICE MANAGER ── */
.voice-list {
  padding: 6px 0;
}

.voice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.voice-item:last-child {
  border-bottom: none;
}

.voice-info {
  flex: 1;
  min-width: 0;
}

.voice-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-size {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.voice-actions {
  display: flex;
  gap: 6px;
}

.v-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}

.v-btn.play {
  background: rgba(59, 165, 93, 0.15);
  color: var(--green);
}

.v-btn.play:active {
  background: rgba(59, 165, 93, 0.3);
  transform: scale(0.9);
}

.v-btn.trim {
  background: rgba(250, 168, 26, 0.15);
  color: var(--yellow);
}

.v-btn.trim:active {
  background: rgba(250, 168, 26, 0.3);
  transform: scale(0.9);
}

.v-btn.del {
  background: rgba(237, 66, 69, 0.15);
  color: var(--red);
}

.v-btn.del:active {
  background: rgba(237, 66, 69, 0.3);
  transform: scale(0.9);
}

/* ── MODAL ── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #151620;
  padding: 24px 20px;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  width: 100%;
  max-width: 480px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 5px;
}

.modal-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
  word-break: break-all;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: 0.2s;
}

.modal-btn.cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.modal-btn.confirm {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.modal-btn:active {
  transform: scale(0.97);
}

/* ── DISCORD CHAT UI ── */
.tab-chat-fullscreen.active {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - 120px) !important;
}

.chat-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b0c1a;
}

.chat-sidebar {
  width: 32%;
  min-width: 130px;
  max-width: 210px;
  background: rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.server-list,
.channel-list {
  overflow-y: auto;
  overflow-x: hidden;
}

.server-list {
  flex: 1;
}

.channel-list {
  flex: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.list-item {
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.list-item.selected {
  background: rgba(88, 101, 242, 0.15);
}

.list-item img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.list-item-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.7);
}

.list-item.selected .list-item-name {
  color: #fff;
  font-weight: 600;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.messages-area::-webkit-scrollbar {
  width: 4px;
}

.messages-area::-webkit-scrollbar-track {
  background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.chat-msg {
  display: flex;
  gap: 9px;
  position: relative;
}

.chat-msg.compact {
  margin-top: -6px;
}

.chat-msg:hover {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.reply-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  opacity: 0;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s;
  font-size: 16px;
}

.chat-msg:hover .reply-btn {
  opacity: 1;
}

.reply-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.chat-msg img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chat-msg-spacer {
  width: 32px;
  /* = ширина аватара; flex gap 9px добавляется автоматически */
  flex-shrink: 0;
}

.msg-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.msg-header {
  margin-bottom: 2px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.msg-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.msg-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
}

.msg-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.compact-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-input-area {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 9px 16px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
  font-family: 'Inter', sans-serif;
}

.chat-input-area input:focus {
  border-color: rgba(88, 101, 242, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.chat-input-area input:disabled {
  opacity: 0.4;
}

.chat-input-area button {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 16px;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.chat-input-area button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

.chat-input-area button:active:not(:disabled) {
  transform: scale(0.88);
}

/* ── PROFILE CARDS (Multi-account) ── */
.profiles-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
  position: relative;
}

.profile-card:last-child {
  border-bottom: none;
}

.profile-card:active {
  background: var(--surface3);
}

.profile-card.active-profile {
  background: rgba(88, 101, 242, 0.08);
}

.profile-avatar {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border2);
}

.profile-avatar .active-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--green-glow);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-id {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-family: monospace;
}

.profile-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.profile-switch-btn {
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 10px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 10px var(--accent-glow2);
}

.profile-switch-btn:active {
  transform: scale(0.94);
}

.profile-del-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(237, 66, 69, 0.12);
  border: 1px solid rgba(237, 66, 69, 0.2);
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.profile-del-btn:active {
  background: rgba(237, 66, 69, 0.25);
}

.profile-add-area {
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.profile-add-area .input-field {
  font-size: 14px;
  padding: 12px 16px;
}

/* ── LARGER INPUT FIELDS ── */
.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 13px 16px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, background .2s;
}

.input-field:focus {
  border-color: rgba(88, 101, 242, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.input-field::placeholder {
  color: var(--muted);
}

.input-btn {
  margin-top: 8px;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: var(--radius-xs);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 16px var(--accent-glow2);
}

.input-btn:active {
  transform: scale(.98);
  opacity: 0.9;
}

/* ── STATS ROW ── */
.stats-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.stat-pill {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.stat-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.5px;
}

.stat-lbl {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 2px;
  font-weight: 500;
}