@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-deep-black: #000000;
  --bg-sidebar: #0a0a0c;
  --bg-card-dark: #121216;
  --bg-card-inner: #18181c;
  --bg-hover: #1f1f24;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #0A84FF;
  
  --apple-blue: #0A84FF;
  --apple-green: #30D158;
  --apple-purple: #BF5AF2;
  --apple-red: #FF453A;
  --apple-orange: #FF9F0A;
  --apple-cyan: #64D2FF;
  --apple-gold: #FFD60A;
  
  --text-white: #FFFFFF;
  --text-gray: #8E8E93;
  --text-dim: #636366;
  
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body.theme-runa-dark {
  background-color: var(--bg-deep-black);
  color: var(--text-white);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ================== АКТИВАЦИЯ MACBOOK ================== */
#mac-activation-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1c1c1e 0%, #000000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.activation-window {
  width: 580px;
  background: rgba(30, 30, 32, 0.85);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.mac-titlebar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.traffic-lights {
  display: flex;
  gap: 8px;
}
.traffic-lights .light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.light.red { background: #FF5F56; }
.light.yellow { background: #FFBD2E; }
.light.green { background: #27C93F; }

.titlebar-caption {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-gray);
  pointer-events: none;
}

.activation-body {
  padding: 40px;
  text-align: center;
}
.apple-hero-logo {
  color: #fff;
  margin-bottom: 16px;
}
.activation-body h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.act-subtext {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 28px;
  line-height: 1.4;
}

.act-field-group {
  margin-bottom: 12px;
}
.act-field-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 14px;
  outline: none;
}
.act-field-group input:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}

.act-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}
.act-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}
.act-btn.primary {
  background: var(--apple-blue);
  color: #fff;
}
.act-btn.secondary {
  background: none;
  color: var(--apple-blue);
}
.act-btn:hover { opacity: 0.85; }

/* ================== ГЛАВНОЕ ОКНО RUNA ================== */
.app-topbar {
  height: 52px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-burger-btn, .logout-icon-btn, .win-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-burger-btn:hover, .logout-icon-btn:hover, .win-btn:hover {
  background: var(--bg-hover);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.avatar-circle-sm {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #7b61ff, #5038ee);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.user-chip-text {
  display: flex;
  flex-direction: column;
}
.chip-name {
  font-size: 13px;
  font-weight: 600;
}
.chip-username {
  font-size: 11px;
  color: var(--text-gray);
}

.top-action-pill {
  background: #1e1e24;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.top-action-pill:hover { background: #282830; }

.app-workspace {
  display: flex;
  height: calc(100vh - 52px);
}

/* ================== САЙДБАР ЧАТОВ ================== */
.chats-sidebar {
  width: 380px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
}

.chats-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chats-heading {
  font-size: 20px;
  font-weight: 700;
}
.chats-filter-icons {
  display: flex;
  background: var(--bg-card-dark);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}
.filter-icon {
  background: none;
  border: none;
  color: var(--text-gray);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.filter-icon:hover, .filter-icon.active {
  color: #fff;
  background: var(--bg-hover);
}

.search-container input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-card-dark);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 13px;
  outline: none;
}

/* СТОРИС */
.stories-strip {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  overflow-x: auto;
}
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.story-avatar-wrap {
  position: relative;
}
.avatar-circle-md {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b61ff, #5038ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.bg-ceo {
  background: #3a3a40;
}
.add-story-plus {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  background: var(--apple-blue);
  border: 2px solid var(--bg-sidebar);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}
.story-author {
  font-size: 11px;
  color: var(--text-gray);
}

/* СПИСОК ЧАТОВ */
.chats-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-row-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-row-item:hover { background: var(--bg-card-dark); }
.chat-row-item.active { background: #1c1c24; }

.chat-meta {
  flex: 1;
  overflow: hidden;
}
.chat-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.chat-row-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-row-preview {
  font-size: 13px;
  color: var(--text-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verified-blue {
  color: var(--apple-blue);
  width: 14px;
  height: 14px;
}
.unread-badge {
  background: var(--apple-purple);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

/* ================== ЧАТ И СИСТЕМНЫЙ ПАТТЕРН ================== */
.chat-main-view {
  flex: 1;
  background: #050507;
  position: relative;
  display: flex;
  flex-direction: column;
  /* Паттерн Telegram / Runa */
  background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
}

.empty-pattern-slate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-slate-text {
  background: rgba(20, 20, 24, 0.7);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-gray);
  border: 1px solid var(--border-subtle);
}

.chat-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-top-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(20px);
}
.chat-top-status {
  font-size: 12px;
  color: var(--text-gray);
}

.messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble {
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}
.bubble.in {
  align-self: flex-start;
  background: var(--bg-card-dark);
  border-bottom-left-radius: 4px;
}
.bubble.out {
  align-self: flex-end;
  background: #2a2550;
  border-bottom-right-radius: 4px;
}

.chat-input-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
}
.chat-input-bar textarea {
  flex: 1;
  background: var(--bg-card-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  outline: none;
  resize: none;
  font-size: 14px;
}
.input-action-btn, .send-message-btn {
  background: none;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
}
.send-message-btn {
  background: var(--apple-blue);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================== ВЫДВИЖНОЕ МЕНЮ (ШТОРКА) ================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 999;
}
.runa-drawer {
  width: 320px;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.drawer-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg-card-dark);
  border-radius: 16px;
  cursor: pointer;
}
.drawer-name { font-size: 15px; font-weight: 700; display: block; }
.drawer-handle { font-size: 12px; color: var(--text-gray); }

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-nav-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  gap: 14px;
  width: 100%;
  text-align: left;
}
.drawer-nav-item:hover { background: var(--bg-card-dark); }

.nav-icon-bg {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.nav-icon-bg.blue { background: #0A84FF; }
.nav-icon-bg.green { background: #30D158; }
.nav-icon-bg.orange { background: #FF9F0A; }
.nav-icon-bg.purple { background: #BF5AF2; }
.nav-icon-bg.cyan { background: #64D2FF; }
.nav-icon-bg.slate { background: #636366; }
.nav-icon-bg.gold { background: #FFD60A; color: #000; }
.nav-icon-bg.ruby-red { background: #FF2D55; }
.nav-icon-bg.mops-bg { background: #FF9F0A; }
.nav-icon-bg.pink { background: #FF375F; }
.nav-icon-bg.grey { background: #48484A; }
.nav-icon-bg.dark-red { background: #8b0000; }

.nav-title { flex: 1; font-size: 14px; font-weight: 500; }
.nav-arrow { width: 16px; height: 16px; color: var(--text-dim); }
.nav-badge-pill {
  background: var(--apple-blue);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.nav-metric { color: var(--text-gray); font-size: 14px; }
.drawer-divider { height: 1px; background: var(--border-subtle); margin: 8px 0; }

/* ================== МОДАЛЬНЫЕ ОКНА И КАРТОЧКА ПРОФИЛЯ ================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.profile-window, .edit-profile-window {
  width: 440px;
  background: #0c0c0e;
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  padding: 24px;
  position: relative;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}

.window-nav-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.profile-card-content {
  text-align: center;
  margin-top: 10px;
}
.profile-avatar-giant {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b61ff, #5038ee);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
}
.profile-card-name { font-size: 20px; font-weight: 700; }

.profile-status-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 8px 0 16px;
}
.level-badge {
  background: #24242c;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.status-pill.online {
  background: rgba(48, 209, 88, 0.15);
  color: var(--apple-green);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.balance-tag-pill {
  background: #18181e;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 24px;
}

.profile-detail-card {
  background: #141418;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-icon-box.blue { background: #0A84FF; }
.detail-icon-box.pink { background: #FF375F; }
.handle-line { display: flex; align-items: center; gap: 8px; }
.handle-val { font-weight: 600; font-size: 14px; }
.copy-handle { width: 14px; height: 14px; color: var(--text-gray); cursor: pointer; }
.detail-sub { font-size: 11px; color: var(--text-gray); }

.profile-badges-row {
  margin-top: 20px;
  text-align: left;
}
.meta-label { font-size: 11px; color: var(--text-gray); display: block; margin-bottom: 8px; }
.badges-flex { display: flex; gap: 8px; }
.apple-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #24242c;
}

.views-counter {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-gray);
  font-size: 13px;
}

/* ================== РЕДАКТИРОВАНИЕ ПРОФИЛЯ ================== */
.avatar-uploader-center {
  position: relative;
  width: 90px;
  margin: 0 auto 20px;
}
.camera-badge-btn {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  background: #fff;
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.section-title-label {
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px;
}

.edit-fields-card {
  background: #141418;
  border-radius: 16px;
  padding: 4px 16px;
}
.form-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.form-row:last-child { border-bottom: none; }
.form-row label {
  font-size: 11px;
  color: var(--text-gray);
  display: block;
  margin-bottom: 4px;
}
.form-row input {
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
}
.with-emoji-btn { display: flex; align-items: center; justify-content: space-between; }
.with-emoji-btn svg { color: var(--text-gray); cursor: pointer; }

.customization-nav-card {
  width: 100%;
  background: #141418;
  border: none;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  cursor: pointer;
}
.custom-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.custom-card-icon.green { background: #30D158; }

.edit-buttons-dock {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.dock-btn {
  flex: 1;
  padding: 12px;
  border-radius: 24px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.dock-btn.cancel { background: #2c2c30; color: #fff; }
.dock-btn.save { background: #30D158; color: #fff; }

/* ================== ОКНО КАСТОМИЗАЦИИ ================== */
.customization-window {
  width: 1080px;
  height: 720px;
  background: #121216;
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  display: flex;
  overflow: hidden;
}

.custom-sidebar {
  width: 220px;
  background: #0a0a0c;
  border-right: 1px solid var(--border-subtle);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.custom-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 8px;
}
.custom-search svg {
  position: absolute;
  left: 8px;
  width: 14px;
  height: 14px;
  color: var(--text-gray);
}
.custom-search input {
  width: 100%;
  background: #1c1c22;
  border: none;
  border-radius: 8px;
  padding: 6px 8px 6px 28px;
  font-size: 12px;
  color: #fff;
}

.custom-user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}
.summary-name { font-size: 13px; font-weight: 600; }
.summary-sub { font-size: 11px; color: var(--text-gray); }

.category-header {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 12px 0 4px;
  display: block;
}
.custom-tab-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-gray);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}
.custom-tab-btn:hover { background: #1c1c22; color: #fff; }
.custom-tab-btn.active { background: #BF5AF2; color: #fff; }

.custom-center-settings {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
}
.settings-head-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #18181e;
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 24px;
}
.head-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.head-icon.orange { background: #FF9F0A; }
.head-icon.blue { background: #0A84FF; }

.avatar-preview-box {
  text-align: center;
  margin: 20px 0;
}
.avatar-placeholder-circle {
  width: 120px;
  height: 120px;
  background: #1c1c22;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-gray);
  text-align: center;
  padding: 10px;
}

.controls-card {
  background: #18181e;
  border-radius: 16px;
  padding: 16px;
}
.control-group-title {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.slider-row label { width: 100px; color: var(--text-gray); }
.slider-row input[type="range"] {
  flex: 1;
  accent-color: #BF5AF2;
}
.slider-val { width: 45px; text-align: right; }

.controls-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.mac-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  cursor: pointer;
}
.mac-btn.secondary { background: #282830; color: #fff; }
.mac-btn.primary-purple { background: #BF5AF2; color: #fff; }

.profile-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.style-choice-item {
  background: #18181e;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
}
.style-choice-item.active { border-color: #BF5AF2; }
.style-mockup {
  height: 100px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #000;
}
.telegram-mock { background: linear-gradient(180deg, #d4af37, #000); }
.discord-mock { background: linear-gradient(180deg, #5865F2, #000); }

/* ПРАВЫЙ ПРЕДПРОСМОТР */
.custom-live-preview {
  width: 340px;
  background: #0a0a0c;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.preview-mode-switch {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.segmented-pill {
  background: #1e1e24;
  border-radius: 8px;
  padding: 2px;
  display: flex;
}
.segmented-pill button {
  background: none;
  border: none;
  color: var(--text-gray);
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}
.segmented-pill button.active {
  background: #2c2c34;
  color: #fff;
}

.live-card-mockup {
  width: 100%;
  background: #000;
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 20px;
  text-align: center;
}
.live-avatar-giant {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #7b61ff, #5038ee);
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}
.live-action-buttons {
  display: flex;
  justify-content: space-between;
  margin: 16px 0;
}
.live-btn {
  background: #18181e;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.live-info-box {
  background: #121216;
  border-radius: 14px;
  padding: 10px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-line { display: flex; gap: 10px; font-size: 12px; }
.info-line .sub { font-size: 10px; color: var(--text-gray); display: block; }
.cyan-icon { color: #64D2FF; }
.pink-icon { color: #FF375F; }
.live-badges-strip {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.preview-disclaimer {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 14px;
}

/* ================== MOPS WALLET & РУБИНЫ ================== */
.wallet-window, .rubies-window, .clans-window, .settings-mac-window, .admin-window {
  width: 480px;
  background: #0a0a0c;
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 20px;
}
.wallet-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.wallet-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 16px;
}

/* КАРТА RUNA */
.runa-metal-card {
  width: 100%;
  height: 180px;
  background: radial-gradient(circle at top left, #1c2638 0%, #0d121c 100%);
  border: 1px solid rgba(100, 210, 255, 0.3);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.card-top {
  display: flex;
  justify-content: space-between;
}
.card-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-titles .b-main { font-size: 18px; font-weight: 800; color: #64D2FF; display: block; }
.brand-titles .b-sub { font-size: 9px; letter-spacing: 2px; color: #fff; }
.card-chip {
  width: 32px;
  height: 24px;
  background: linear-gradient(135deg, #c0c0c0, #707070);
  border-radius: 4px;
}
.balance-mops-display .num { font-size: 28px; font-weight: 800; }
.balance-mops-display .cur { font-size: 14px; color: #64D2FF; margin-left: 4px; }
.card-holder { font-size: 13px; color: var(--text-gray); }

.rubies-estimate {
  text-align: center;
  margin: 14px 0;
  font-size: 14px;
  color: var(--text-gray);
}
.wallet-action-pills {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.action-pill {
  flex: 1;
  background: #1c1c22;
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #141418;
  padding: 14px;
  border-radius: 16px;
  margin-bottom: 20px;
}
.toggle-title { font-size: 14px; font-weight: 600; }
.toggle-sub { font-size: 11px; color: var(--text-gray); margin-top: 4px; }

.hist-label { font-size: 11px; color: var(--text-gray); font-weight: 600; }
.hist-filters { display: flex; gap: 8px; margin: 10px 0; }
.filter-pill {
  background: #1c1c22;
  border: none;
  color: var(--text-gray);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
}
.filter-pill.active { background: #2c2c34; color: #fff; }
.empty-feed { text-align: center; color: var(--text-dim); margin-top: 20px; font-size: 13px; }

/* РУБИНЫ КАРТОЧКА */
.rubies-card-box {
  background: #141418;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
}
.box-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-gray); }
.ruby-val-row { margin: 16px 0 4px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.big-gem { font-size: 32px; }
.gem-num { font-size: 36px; font-weight: 800; }
.rubies-actions-row { display: flex; gap: 10px; margin-top: 20px; }
.ruby-btn {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.ruby-btn.red { background: #FF2D55; }
.ruby-btn.grey { background: #24242c; }

/* КЛАНЫ */
.clans-hero-card {
  background: #141418;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
}
.shields-row { display: flex; justify-content: center; gap: 12px; margin-bottom: 12px; }
.shield-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.shield-badge.purple { background: #BF5AF2; }
.shield-badge.red { background: #FF453A; }
.shield-badge.blue { background: #0A84FF; }
.hero-desc { font-size: 12px; color: var(--text-gray); margin: 8px 0 20px; line-height: 1.4; }
.create-clan-green-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #30D158;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.clan-nav-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.clan-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #141418;
  padding: 12px 16px;
  border-radius: 14px;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.icon-sq {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-sq.orange { background: #FF9F0A; color: #fff; }
.icon-sq.grey { background: #3a3a42; color: #fff; }

/* ================== НАСТРОЙКИ MACOS (СКРИНШОТ 10) ================== */
.settings-mac-window {
  width: 900px;
  height: 620px;
  display: flex;
  padding: 0;
  overflow: hidden;
}
.settings-sidebar {
  width: 250px;
  background: #0a0a0c;
  border-right: 1px solid var(--border-subtle);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.settings-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.s-name { font-size: 13px; font-weight: 600; }
.s-handle { font-size: 11px; color: var(--text-gray); }
.settings-menu-list { display: flex; flex-direction: column; gap: 2px; }
.s-item {
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.s-item.active { background: #BF5AF2; }
.s-item .icon { width: 16px; height: 16px; }

.settings-content-pane {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}
.settings-pane-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.pane-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.pane-icon.blue { background: #0A84FF; }

.settings-block { margin-bottom: 20px; }
.block-title { font-size: 12px; color: var(--text-gray); margin-bottom: 8px; display: block; }
.radio-card {
  background: #141418;
  border-radius: 14px;
  overflow: hidden;
}
.radio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  cursor: pointer;
}
.radio-row:last-child { border-bottom: none; }
.radio-row input[type="radio"] { accent-color: #BF5AF2; }
.radio-row.locked { color: var(--text-gray); }
.premium-tag {
  background: #BF5AF2;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}
.delete-acc-btn {
  width: 100%;
  background: #1a1518;
  border: 1px solid rgba(255, 69, 58, 0.2);
  color: var(--apple-red);
  padding: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 30px;
}

/* ================== АДМИН ПАНЕЛЬ ================== */
.admin-window {
  width: 800px;
}
.admin-table-scroll {
  max-height: 400px;
  overflow-y: auto;
  margin-top: 14px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th, .admin-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-action-btn {
  background: var(--apple-blue);
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 4px;
  font-size: 11px;
}

/* СВИЧИ В СТИЛЕ APPLE */
.mac-switch {
  appearance: none;
  width: 44px;
  height: 26px;
  background: #39393d;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 0.2s;
}
.mac-switch:checked { background: #30D158; }
.mac-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.mac-switch:checked::after { transform: translateX(18px); }
/* ================================================================== */
/*  AVATARS, CHATS, MESSAGES — NEW                                     */
/* ================================================================== */
.avatar-circle-sm.has-img, .avatar-circle-md.has-img,
.profile-avatar-giant.has-img, .live-avatar-giant.has-img,
.avatar-placeholder-circle.has-img, .list-avatar.has-img { overflow: hidden; padding: 0; }
.avatar-circle-sm img, .avatar-circle-md img, .profile-avatar-giant img,
.live-avatar-giant img, .avatar-placeholder-circle img, .list-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}
.chat-avatar { position: relative; flex-shrink: 0; overflow: visible; }
.chat-avatar img { border-radius: 50%; }
.online-mini-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--apple-green); border: 2px solid var(--bg-sidebar); }
.chat-row-side { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.chat-pin { width: 12px; height: 12px; color: var(--text-gray); }
.chat-time { font-size: 10px; color: var(--text-dim); }
.chat-meta-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-row-preview { flex: 1; min-width: 0; }
.empty-chats { text-align: center; color: var(--text-dim); font-size: 13px; padding: 30px 10px; }
.chat-avatar.has-img { background: none; }

.chat-top-header { display: flex; align-items: center; gap: 12px; }
.chat-top-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg,#7b61ff,#5038ee); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.chat-top-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-top-details { flex: 1; min-width: 0; }
.chat-top-details h3 { font-size: 15px; font-weight: 700; }
.chat-top-action { background: transparent; border: none; color: var(--text-gray); cursor: pointer; padding: 6px; border-radius: 8px; }
.chat-top-action:hover { background: var(--bg-hover); color: #fff; }

/* сообщения */
.bubble { position: relative; font-size: var(--msg-font-size, 14px); }
.msg-author { font-size: 11px; font-weight: 700; color: var(--apple-cyan); margin-bottom: 3px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-text a { color: var(--apple-cyan); }
.msg-meta { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 10px; color: rgba(255,255,255,.45); margin-top: 4px; }
.msg-del { background: none; border: none; color: rgba(255,255,255,.4); cursor: pointer; padding: 0 0 0 6px; opacity: 0; transition: opacity .15s; display: inline-flex; }
.bubble:hover .msg-del { opacity: 1; }
.msg-del:hover { color: var(--apple-red); }
.msg-del svg { width: 12px; height: 12px; }
.msg-image { max-width: 100%; max-height: 320px; border-radius: 12px; margin-top: 6px; cursor: zoom-in; display: block; }
.msg-file { display: inline-flex; align-items: center; gap: 6px; color: #fff; margin-top: 6px; text-decoration: none; background: rgba(255,255,255,.08); padding: 6px 10px; border-radius: 10px; font-size: 12px; }
.msg-day { align-self: center; font-size: 11px; color: var(--text-gray); background: rgba(255,255,255,.05); padding: 3px 12px; border-radius: 12px; margin: 8px 0; }
.empty-feed { text-align: center; color: var(--text-dim); font-size: 13px; padding: 24px 10px; }

/* профиль */
.profile-window { overflow: hidden; }
.profile-banner { display: none; height: 110px; margin: -24px -24px 0; background-size: cover; background-position: center; }
.profile-banner.has-banner { display: block; }
.profile-bio-line { font-size: 12px; color: var(--text-gray); margin-top: 6px; padding: 0 20px; }
.detail-icon-box.green { background: #30D158; }
.detail-icon-box.orange { background: #FF9F0A; }
.detail-icon-box.purple { background: #BF5AF2; }
.profile-avatar-giant { position: relative; z-index: 2; }
.frame-gold { box-shadow: 0 0 0 3px #FFD60A, 0 0 22px rgba(255,214,10,.45); }
.frame-purple { box-shadow: 0 0 0 3px #BF5AF2, 0 0 22px rgba(191,90,242,.45); }
.frame-green { box-shadow: 0 0 0 3px #30D158, 0 0 22px rgba(48,209,88,.4); }
.frame-red { box-shadow: 0 0 0 3px #FF453A, 0 0 22px rgba(255,69,58,.4); }
.profile-window.style-discord { border-radius: 14px; }
.profile-window.style-twitter { border-radius: 20px; }
.profile-window.style-steam { border-radius: 8px; }
.profile-window.style-runa { border-color: rgba(191,90,242,.45); box-shadow: 0 40px 100px rgba(120,60,220,.25); }
.profile-window.bg-aurora { background: linear-gradient(160deg,#0c0c0e 20%,#18204a 100%); }
.profile-window.bg-sunset { background: linear-gradient(160deg,#0c0c0e 20%,#3a1420 100%); }
.profile-window.bg-ocean { background: linear-gradient(160deg,#0c0c0e 20%,#062c38 100%); }
.profile-window.bg-mono { background: linear-gradient(160deg,#0c0c0e 20%,#2a2a2e 100%); }
.custom-badge svg { width: 14px; height: 14px; }
.custom-badge { color: #fff; }
.muted-small { font-size: 12px; color: var(--text-gray); }
.nft-chip { display: inline-block; padding: 6px 12px; background: rgba(10,132,255,.14); color: var(--apple-cyan); border-radius: 10px; font-size: 13px; margin: 4px; }

/* кастомизация */
.banner-preview { height: 130px; border-radius: 14px; background: #141418 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 12px; margin-bottom: 14px; border: 1px dashed var(--border-subtle); }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { padding: 9px 14px; border-radius: 11px; background: #1c1c22; border: 1px solid var(--border-subtle); color: var(--text-gray); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.swatch:hover { color: #fff; border-color: #444; }
.swatch.active { border-color: #BF5AF2; color: #fff; box-shadow: 0 0 0 1px #BF5AF2 inset; }
.swatch.color-dot { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.badge-collection { display: flex; flex-wrap: wrap; gap: 10px; }
.big-level-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 120px; height: 120px; margin: 20px auto; border-radius: 30px; background: linear-gradient(135deg,#30D158,#0b8f3a); font-size: 40px; font-weight: 800; }
.big-level-badge small { font-size: 11px; font-weight: 600; opacity: .8; }
.phone-display { font-size: 20px; font-weight: 700; text-align: center; padding: 22px; background: #141418; border-radius: 16px; }

/* универсальный список */
.list-window { width: 520px; max-width: calc(100vw - 32px); max-height: 82vh; background: #0a0a0c; border: 1px solid var(--border-subtle); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; }
.list-modal-body { overflow-y: auto; flex: 1; }
.modal-search-input { width: 100%; padding: 11px 14px; border-radius: 12px; background: #141418; border: 1px solid var(--border-subtle); color: #fff; outline: none; margin-bottom: 12px; }
.modal-search-input:focus { border-color: var(--border-focus); }
.list-results { max-height: 320px; overflow-y: auto; }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 13px; background: transparent; border: none; color: #fff; text-align: left; cursor: pointer; font-size: 13px; }
.list-row:hover { background: #16161b; }
.list-row.static { cursor: default; }
.list-row.static:hover { background: transparent; }
.list-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg,#7b61ff,#5038ee); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.list-row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.list-row-main span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-main small { font-size: 11px; color: var(--text-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin: 14px 4px 6px; }
.list-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chat-info-block { text-align: center; padding: 10px; }
.chat-info-title { font-size: 20px; font-weight: 700; }
.chat-info-sub { font-size: 12px; color: var(--text-gray); margin-top: 3px; }
.chat-info-about { font-size: 13px; color: var(--text-gray); margin-top: 10px; }
.user-profile-card { text-align: center; padding: 8px; }
.user-profile-card h3 { margin-top: 10px; }
.user-profile-card .profile-avatar-giant { margin-bottom: 6px; }
.online-dot-inline { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--apple-green); margin-left: 4px; }

/* магазин / премиум / кланы */
.store-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.store-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; border-radius: 13px; background: #141418; border: 1px solid var(--border-subtle); color: #fff; cursor: pointer; font-size: 12px; }
.store-item:hover { border-color: #BF5AF2; }
.store-icon { font-size: 22px; }
.store-item small { color: var(--apple-gold); font-size: 10px; }
.premium-hero { text-align: center; padding: 14px; }
.premium-star { font-size: 48px; }
.premium-list { list-style: none; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-gray); }
.clan-list-inline { margin-top: 14px; }

/* транзакции */
.tx-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.tx-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border-subtle); }
.tx-kind { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: #1c1c22; }
.tx-kind.in { color: var(--apple-green); }
.tx-kind.out { color: var(--apple-red); }
.tx-kind.exchange { color: var(--apple-cyan); }
.tx-main { flex: 1; display: flex; flex-direction: column; }
.tx-main span { font-size: 12px; }
.tx-main small { font-size: 10px; color: var(--text-dim); }
.tx-amount { font-size: 12px; font-weight: 700; }
.tx-amount.plus { color: var(--apple-green); }
.tx-amount.minus { color: var(--apple-red); }

/* toast / lightbox */
#toast-container { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 6000; pointer-events: none; }
.toast-item { background: rgba(24,24,30,.97); border: 1px solid rgba(255,255,255,.1); color: #fff; padding: 10px 15px; border-radius: 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5); opacity: 0; transform: translateY(8px); transition: all .22s; max-width: 320px; }
.toast-item.show { opacity: 1; transform: none; }
.toast-item.error { border-color: rgba(255,69,58,.5); }
.toast-item.message { border-color: rgba(10,132,255,.45); }
.image-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 7000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 24px; }
.image-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* светлая тема (базовая) */
body.theme-light { background: #f2f2f7; color: #111; }
body.theme-light .app-topbar, body.theme-light .chats-sidebar, body.theme-light .chat-input-bar { background: #fff; color: #111; border-color: rgba(0,0,0,.08); }
body.theme-light .chat-main-view { background-color: #f7f7fb; }
body.theme-light .chat-row-item:hover { background: #ececf2; }
body.theme-light .chat-row-item.active { background: #e3e0f5; }
body.theme-light .bubble.in { background: #e9e9ee; color: #111; }
body.theme-light .bubble.out { background: #d9d1ff; color: #111; }
body.theme-light .msg-meta { color: rgba(0,0,0,.45); }
body.theme-light .drawer-nav-item { color: #111; }
body.theme-light .runa-drawer { background: #fff; }

/* мобильная адаптация */
@media (max-width: 820px) {
  .chats-sidebar { width: 100%; border-right: none; }
  .chat-main-view { display: none; }
  body.mobile-chat-open .chats-sidebar { display: none; }
  body.mobile-chat-open .chat-main-view { display: flex; position: fixed; inset: 52px 0 0; z-index: 60; }
  .top-action-pill span { display: none; }
  .bubble { max-width: 82%; }
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .list-window { width: calc(100vw - 24px); }
}

/* мобильная кнопка назад */
.chat-back-btn { display: none; }
@media (max-width: 820px) {
  .chat-back-btn { display: inline-flex; align-items: center; justify-content: center; }
}

/* мокапы стилей профиля */
.runa-mock { background: linear-gradient(180deg, #8b5cf6, #000); }
.twitter-mock { background: linear-gradient(180deg, #1d9bf0, #000); }
.steam-mock { background: linear-gradient(180deg, #66c0f4, #171a21); }

/* ================== АВАТАРКИ В СООБЩЕНИЯХ (Telegram-style) ================== */
.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.msg-row.in { justify-content: flex-start; }
.msg-row.out { justify-content: flex-end; }
.msg-row.continued { margin-top: -5px; }
.msg-avatar, .msg-avatar-spacer { width: 32px; height: 32px; flex: 0 0 32px; margin-bottom: 2px; }
.msg-avatar {
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.msg-avatar:hover { transform: scale(1.07); box-shadow: 0 0 0 2px rgba(255,255,255,.2); }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.msg-content { display: flex; flex-direction: column; min-width: 0; max-width: min(72%, 640px); }
.msg-row.out .msg-content { align-items: flex-end; }
.msg-row .bubble { max-width: 100%; }
.msg-author { cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.chat-top-avatar, .chat-top-details h3 { cursor: pointer; }
.chat-top-avatar:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
@media (max-width: 820px) {
  .msg-avatar, .msg-avatar-spacer { width: 28px; height: 28px; flex-basis: 28px; }
  .msg-content { max-width: 82%; }
}

/* ================== ОТВЕТЫ НА СООБЩЕНИЯ ================== */
.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  background: rgba(10, 132, 255, .07);
  border-top: 1px solid var(--border-subtle);
  animation: replyBarIn .18s ease;
}
.reply-bar-accent { width: 3px; align-self: stretch; border-radius: 3px; background: var(--apple-blue); }
.reply-bar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.reply-bar-author { font-size: 11.5px; font-weight: 700; color: var(--apple-cyan); }
.reply-bar-text { font-size: 12px; color: var(--text-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar-close { background: none; border: none; color: var(--text-gray); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; }
.reply-bar-close:hover { background: var(--bg-hover); color: #fff; }
.reply-bar-close svg { width: 15px; height: 15px; }
@keyframes replyBarIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.msg-reply-quote {
  display: block;
  border-left: 3px solid var(--apple-blue);
  background: rgba(10, 132, 255, .12);
  border-radius: 8px;
  padding: 5px 9px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: background .15s;
  max-width: 100%;
}
.msg-reply-quote:hover { background: rgba(10, 132, 255, .2); }
.reply-quote-author { display: block; font-size: 11px; font-weight: 700; color: var(--apple-cyan); }
.reply-quote-text { display: block; font-size: 12px; color: var(--text-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.msg-reply {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .4);
  cursor: pointer;
  padding: 0 0 0 6px;
  opacity: 0;
  transition: opacity .15s, color .15s;
  display: inline-flex;
}
.bubble:hover .msg-reply { opacity: 1; }
.msg-reply:hover { color: var(--apple-cyan); }
.msg-reply svg { width: 12px; height: 12px; }
@media (hover: none) { .msg-del, .msg-reply { opacity: .6; } }

/* ================== АНИМАЦИИ СООБЩЕНИЙ ================== */
.msg-row.msg-appear { animation: msgAppear .28s cubic-bezier(.2, .8, .2, 1); }
.msg-row.out.msg-appear { animation-name: msgAppearOut; }
@keyframes msgAppear { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes msgAppearOut { from { opacity: 0; transform: translateX(18px) scale(.96); } to { opacity: 1; transform: none; } }

.send-message-btn.sending { animation: sendPop .34s cubic-bezier(.2, .8, .2, 1); }
@keyframes sendPop { 0% { transform: scale(1); } 35% { transform: scale(.82); } 100% { transform: scale(1); } }

.msg-row.msg-highlight .bubble { animation: msgHighlight 1.2s ease; }
@keyframes msgHighlight {
  0%, 100% { box-shadow: none; }
  20%, 60% { box-shadow: 0 0 0 2px var(--apple-blue), 0 0 24px rgba(10, 132, 255, .45); }
}

/* ================== РЕАКЦИИ ================== */
.msg-react {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .4);
  cursor: pointer;
  padding: 0 0 0 6px;
  opacity: 0;
  transition: opacity .15s, color .15s;
  display: inline-flex;
}
.bubble:hover .msg-react { opacity: 1; }
.msg-react:hover { color: #FFD60A; }
.msg-react svg { width: 12px; height: 12px; }
@media (hover: none) { .msg-react { opacity: .6; } }

.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.msg-row.out .msg-reactions { justify-content: flex-end; }
.msg-reactions:empty { display: none; }
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .09);
  color: var(--text-gray);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  animation: reactionPop .24s cubic-bezier(.2, .9, .3, 1.3);
}
.reaction-chip:hover { background: rgba(255, 255, 255, .13); transform: translateY(-1px); }
.reaction-chip.me {
  background: rgba(10, 132, 255, .18);
  border-color: rgba(10, 132, 255, .55);
  color: #fff;
}
.reaction-chip .reaction-count { font-size: 10.5px; font-weight: 700; }
@keyframes reactionPop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

.reaction-picker {
  position: fixed;
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 18px;
  background: rgba(18, 18, 22, .96);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 16px 46px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .3);
  backdrop-filter: blur(18px);
  animation: pickerIn .16s cubic-bezier(.2, .9, .3, 1.2);
}
.reaction-option {
  background: none;
  border: none;
  font-size: 21px;
  line-height: 1;
  padding: 5px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .14s, background .14s;
}
.reaction-option:hover { transform: scale(1.25) translateY(-2px); background: rgba(255, 255, 255, .08); }
@keyframes pickerIn { from { opacity: 0; transform: translateY(6px) scale(.94); } to { opacity: 1; transform: none; } }

/* ================== ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ (NEW) ================== */
.up-window {
  width: 400px;
  max-width: calc(100vw - 28px);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #101014 0%, #0a0a0c 100%);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 26px;
  position: relative;
  box-shadow: 0 40px 110px rgba(0, 0, 0, .85);
  animation: upIn .24s cubic-bezier(.2, .9, .3, 1.1);
  scrollbar-width: thin;
}
@keyframes upIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.up-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.up-close:hover { background: rgba(0, 0, 0, .6); transform: scale(1.06); }
.up-close svg { width: 15px; height: 15px; }
.up-banner {
  height: 124px;
  position: relative;
  background:
    radial-gradient(120% 140% at 15% 0%, rgba(123, 97, 255, .75), transparent 60%),
    radial-gradient(110% 130% at 90% 10%, rgba(10, 132, 255, .55), transparent 55%),
    linear-gradient(135deg, #241a4d, #101728);
  background-size: cover;
  background-position: center;
}
.up-banner.has-banner { background-size: cover; background-position: center; }
.up-banner-fade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(10, 10, 12, .92) 100%); }
.up-body { padding: 0 22px 22px; margin-top: -44px; position: relative; }
.up-avatar-wrap { position: relative; width: 92px; height: 92px; margin-bottom: 12px; }
.up-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 4px solid #0d0d10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(135deg, #7b61ff, #5038ee);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
}
.up-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.up-avatar.frame-gold { box-shadow: 0 0 0 3px #FFD60A, 0 10px 30px rgba(0, 0, 0, .55); }
.up-avatar.frame-purple { box-shadow: 0 0 0 3px #BF5AF2, 0 10px 30px rgba(0, 0, 0, .55); }
.up-avatar.frame-green { box-shadow: 0 0 0 3px #30D158, 0 10px 30px rgba(0, 0, 0, .55); }
.up-avatar.frame-red { box-shadow: 0 0 0 3px #FF453A, 0 10px 30px rgba(0, 0, 0, .55); }
.up-online-dot {
  position: absolute;
  right: 3px;
  bottom: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--apple-green);
  border: 3px solid #0d0d10;
  box-shadow: 0 0 12px rgba(48, 209, 88, .7);
}
.up-headline h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.up-handle-row { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: var(--text-gray); font-size: 13px; }
.up-copy {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  padding: 3px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.up-copy:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.up-copy svg { width: 13px; height: 13px; }
.up-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.up-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .07);
  color: var(--text-gray);
}
.up-pill svg { width: 12px; height: 12px; }
.up-pill.online { background: rgba(48, 209, 88, .13); border-color: rgba(48, 209, 88, .3); color: var(--apple-green); }
.up-pill.premium { background: linear-gradient(135deg, rgba(255, 214, 10, .18), rgba(255, 159, 10, .14)); border-color: rgba(255, 214, 10, .35); color: #FFD60A; }
.up-pill.admin { background: rgba(191, 90, 242, .16); border-color: rgba(191, 90, 242, .35); color: #DA8FFF; }
.up-pill.level { background: rgba(10, 132, 255, .14); border-color: rgba(10, 132, 255, .3); color: #64B5FF; }
.up-bio { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .78); margin-top: 14px; white-space: pre-wrap; word-break: break-word; }
.up-bio:empty { display: none; }
.up-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.up-badges:empty { display: none; }
.up-badges .apple-badge { width: 30px; height: 30px; }
.up-badges .custom-badge { border: 1px solid rgba(255, 255, 255, .14); }
.up-meta { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding: 13px; border-radius: 16px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .055); }
.up-meta:empty { display: none; }
.up-meta-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.up-meta-row svg { width: 15px; height: 15px; color: var(--apple-cyan); flex-shrink: 0; }
.up-meta-row .up-meta-sub { color: var(--text-dim); margin-left: auto; font-size: 11px; }
.up-nft { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.up-nft:empty { display: none; }
.up-nft .nft-chip { margin: 0; }
.up-actions { display: flex; gap: 8px; margin-top: 18px; }
.up-actions .mac-btn { flex: 1; justify-content: center; }
.up-actions .up-icon-btn { flex: 0 0 44px; padding: 0; height: 40px; }
@media (max-width: 480px) {
  .up-window { width: 100%; max-width: calc(100vw - 18px); border-radius: 22px; }
  .up-body { padding: 0 18px 18px; }
}

/* ================== НАСТРОЙКИ ГРУППЫ / КАНАЛА ================== */
.cs-window {
  width: 470px;
  max-width: calc(100vw - 28px);
  height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #101014 0%, #0a0a0c 100%);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 40px 110px rgba(0, 0, 0, .85);
  animation: upIn .22s cubic-bezier(.2, .9, .3, 1.1);
}
.cs-topbar {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(12, 12, 15, .85);
  backdrop-filter: blur(18px);
}
.cs-topbar-title { flex: 1; text-align: center; font-size: 15px; font-weight: 700; }
.cs-topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cs-topbar-btn:hover { background: var(--bg-hover); color: #fff; }
.cs-topbar-btn svg { width: 18px; height: 18px; }
.cs-body { flex: 1; overflow-y: auto; padding: 20px; overscroll-behavior: contain; }

.cs-loading { display: flex; align-items: center; justify-content: center; gap: 10px; height: 240px; color: var(--text-gray); font-size: 13px; }
.cs-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--apple-blue); animation: csSpin .8s linear infinite; }
@keyframes csSpin { to { transform: rotate(360deg); } }

.cs-hero { text-align: center; padding: 4px 0 18px; }
.cs-hero-avatar {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: linear-gradient(135deg, #7b61ff, #5038ee);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
}
.cs-hero-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.cs-avatar-edit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity .15s;
  border-radius: 50%;
}
.cs-hero-avatar:hover .cs-avatar-edit { opacity: 1; }
.cs-avatar-edit svg { width: 24px; height: 24px; }
.cs-hero-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.cs-hero-sub { font-size: 12.5px; color: var(--text-gray); margin-top: 4px; }
.cs-hero-handle { margin-top: 6px; background: none; border: none; color: var(--apple-cyan); font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.cs-hero-handle svg { width: 12px; height: 12px; }

.cs-quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.cs-quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .055);
  color: var(--text-gray);
  font-size: 10.5px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.cs-quick svg { width: 19px; height: 19px; }
.cs-quick:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.cs-quick.active { color: var(--apple-cyan); border-color: rgba(100, 210, 255, .3); background: rgba(100, 210, 255, .08); }
.cs-quick.danger { color: #FF7A72; }
.cs-quick.danger:hover { background: rgba(255, 69, 58, .12); border-color: rgba(255, 69, 58, .25); }

.cs-tabs { display: flex; gap: 4px; padding: 4px; background: rgba(255, 255, 255, .045); border-radius: 13px; margin-bottom: 16px; }
.cs-tab {
  flex: 1;
  padding: 8px 6px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-gray);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cs-tab span { opacity: .65; font-size: 10.5px; }
.cs-tab:hover { color: #fff; }
.cs-tab.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }

.cs-section { background: rgba(255, 255, 255, .032); border: 1px solid rgba(255, 255, 255, .055); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.cs-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); margin-bottom: 12px; }
.cs-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-gray); margin: 10px 0 5px; }
.cs-label:first-of-type { margin-top: 0; }
.cs-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cs-input:focus { border-color: var(--apple-blue); box-shadow: 0 0 0 3px rgba(10, 132, 255, .16); }
.cs-input::placeholder { color: var(--text-dim); }
.cs-textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.cs-input-prefix { display: flex; align-items: center; background: rgba(0, 0, 0, .28); border: 1px solid var(--border-subtle); border-radius: 11px; padding-left: 12px; }
.cs-input-prefix:focus-within { border-color: var(--apple-blue); box-shadow: 0 0 0 3px rgba(10, 132, 255, .16); }
.cs-input-prefix span { color: var(--text-dim); font-size: 13px; }
.cs-input-prefix .cs-input { border: none; background: transparent; box-shadow: none; padding-left: 4px; }
.cs-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; cursor: pointer; }
.cs-switch-row > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.cs-switch-row small { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.cs-switch-row .mac-switch { position: relative; flex: 0 0 auto; }

.cs-primary-btn {
  width: 100%;
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0A84FF, #0066d6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: filter .15s, transform .12s;
}
.cs-primary-btn:hover { filter: brightness(1.08); }
.cs-primary-btn:active { transform: scale(.985); }
.cs-primary-btn svg { width: 16px; height: 16px; }

.cs-invite-row { display: flex; gap: 7px; }
.cs-invite-row .cs-input { font-size: 11.5px; color: var(--text-gray); }
.cs-square-btn {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, .06);
  color: var(--text-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cs-square-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.cs-square-btn.accent { background: rgba(10, 132, 255, .2); border-color: rgba(10, 132, 255, .4); color: #64B5FF; }
.cs-square-btn svg { width: 17px; height: 17px; }
.cs-text-btn { margin-top: 9px; background: none; border: none; color: var(--text-gray); font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; padding: 3px 0; }
.cs-text-btn:hover { color: #fff; }
.cs-text-btn svg { width: 12px; height: 12px; }

.cs-about-text { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .75); white-space: pre-wrap; }
.cs-info-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 12.5px; color: var(--text-gray); }
.cs-info-row svg { width: 15px; height: 15px; color: var(--apple-cyan); }

.cs-members-toolbar { display: flex; gap: 7px; margin-bottom: 10px; }
.cs-add-member { display: flex; gap: 6px; margin-bottom: 10px; animation: replyBarIn .16s ease; }
.cs-add-member .cs-input { flex: 1; }
.cs-member-list { display: flex; flex-direction: column; gap: 2px; }
.cs-member-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 11px; transition: background .15s; }
.cs-member-row:hover { background: rgba(255, 255, 255, .04); }
.cs-member-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b61ff, #5038ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
}
.cs-member-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.cs-online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--apple-green); border: 2px solid #0d0d10; }
.cs-member-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cs-member-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-member-name em { color: var(--text-dim); font-style: normal; font-size: 11px; }
.cs-member-handle { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-member-actions { display: flex; gap: 3px; }
.cs-mini-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cs-mini-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.cs-mini-btn.active { color: var(--apple-purple); }
.cs-mini-btn.danger:hover { background: rgba(255, 69, 58, .14); color: #FF7A72; }
.cs-mini-btn svg { width: 15px; height: 15px; }

.cs-hint { font-size: 11px; color: var(--text-dim); margin-top: 5px; }
.cs-danger-section { border-color: rgba(255, 69, 58, .18); background: rgba(255, 69, 58, .045); }
.cs-danger-text { font-size: 11.5px; color: var(--text-gray); line-height: 1.45; margin-bottom: 10px; }
.cs-danger-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 69, 58, .35);
  background: rgba(255, 69, 58, .1);
  color: #FF7A72;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: background .15s;
}
.cs-danger-btn:hover { background: rgba(255, 69, 58, .18); }
.cs-danger-btn svg { width: 15px; height: 15px; }

/* ================== МОБИЛЬНАЯ ОПТИМИЗАЦИЯ ================== */
:root { --topbar-h: 52px; }
html, body { height: 100%; }
body.theme-runa-dark { height: 100dvh; }
.app-workspace { height: calc(100dvh - var(--topbar-h)); }
.messages-stream { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
button, .chat-row-item, .drawer-nav-item { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

@media (max-width: 820px) {
  :root { --topbar-h: 56px; }
  .app-topbar {
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-left: 10px;
    padding-right: 10px;
  }
  .app-workspace { height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top)); }
  .top-action-pill { display: none; }
  .chip-username { display: none; }
  .user-chip { gap: 8px; }
  .chats-sidebar { padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); }
  .chats-heading { font-size: 23px; }
  .chats-filter-icons { padding: 1px; }
  .filter-icon { padding: 7px 9px; }
  .search-container input { padding: 11px 14px; font-size: 16px; }
  .stories-strip { gap: 13px; padding: 10px 2px; }
  .story-item { min-width: 52px; }
  .chat-row-item { padding: 12px 8px; gap: 11px; }
  .chat-row-title { font-size: 15px; }
  .chat-row-preview { font-size: 13.5px; }
  .chat-main-view { display: none; }
  body.mobile-chat-open .chats-sidebar { display: none; }
  body.mobile-chat-open .chat-main-view {
    display: flex;
    position: fixed;
    inset: calc(var(--topbar-h) + env(safe-area-inset-top)) 0 0;
    z-index: 60;
    background-color: #050507;
  }
  body.mobile-chat-open { overflow: hidden; }
  .chat-top-header { padding: 8px 10px; min-height: 56px; gap: 8px; }
  .chat-top-avatar { width: 38px; height: 38px; }
  .chat-top-details h3 { font-size: 15px; }
  .chat-top-status { font-size: 11.5px; }
  .chat-top-action { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
  .chat-top-action svg { width: 19px; height: 19px; }
  .chat-back-btn { display: flex; }
  .messages-stream { padding: 12px 9px 16px; gap: 7px; }
  .bubble { max-width: 100%; padding: 9px 12px; font-size: 15px; }
  .msg-content { max-width: 84%; }
  .msg-avatar, .msg-avatar-spacer { width: 29px; height: 29px; flex-basis: 29px; }
  .msg-meta { font-size: 10px; }
  .msg-del, .msg-reply, .msg-react { opacity: .62; padding: 2px 0 2px 8px; }
  .msg-del svg, .msg-reply svg, .msg-react svg { width: 14px; height: 14px; }
  .chat-input-bar {
    padding: 7px 9px calc(7px + env(safe-area-inset-bottom));
    gap: 7px;
  }
  .chat-input-bar textarea { font-size: 16px; padding: 10px 14px; border-radius: 18px; }
  .input-action-btn, .send-message-btn { width: 40px; height: 40px; flex: 0 0 40px; }
  .send-message-btn svg, .input-action-btn svg { width: 18px; height: 18px; }
  .reply-bar { padding: 8px 10px; }
  .drawer-overlay .runa-drawer { width: min(86vw, 340px); padding-bottom: env(safe-area-inset-bottom); }
  .modal-backdrop { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .profile-window, .edit-profile-window, .list-window, .up-window {
    width: calc(100vw - 18px);
    max-width: none;
    max-height: calc(100dvh - 24px);
    border-radius: 20px;
  }
  .cs-window {
    width: 100vw;
    max-width: none;
    height: calc(100dvh - env(safe-area-inset-top));
    max-height: none;
    border-radius: 0;
    border: none;
    position: fixed;
    inset: env(safe-area-inset-top) 0 0;
  }
  .cs-topbar { height: 54px; flex-basis: 54px; padding-top: 0; }
  .cs-body { padding: 16px 14px calc(20px + env(safe-area-inset-bottom)); }
  .cs-hero-avatar { width: 82px; height: 82px; font-size: 30px; }
  .cs-quick { padding: 11px 2px; font-size: 10px; }
  .cs-quick svg { width: 20px; height: 20px; }
  .cs-member-actions { gap: 1px; }
  .cs-mini-btn { width: 34px; height: 34px; }
  .reaction-picker { max-width: calc(100vw - 16px); padding: 6px; }
  .reaction-option { font-size: 20px; padding: 6px 5px; }
  .msg-row.msg-appear { animation-duration: .2s; }
  .chat-top-header, .chat-input-bar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10, 10, 12, .96); }
}

@media (max-width: 380px) {
  .stories-strip { display: none; }
  .cs-quick-grid { gap: 5px; }
  .cs-quick span { font-size: 9px; }
  .chat-row-item { padding: 10px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 820px) {
  .cs-input, .modal-search-input, .chat-input-bar textarea { font-size: 16px; }
  .cs-label { font-size: 12px; }
  .cs-tab { padding: 10px 6px; }
  .cs-square-btn { width: 44px; height: 44px; flex-basis: 44px; }
  .cs-primary-btn, .cs-danger-btn { min-height: 44px; }
  .up-copy, .up-close { min-width: 38px; min-height: 38px; }
}

.chat-input-bar.disabled { opacity: .68; }
.chat-input-bar.disabled textarea { cursor: not-allowed; }
.chat-input-bar.disabled .send-message-btn { background: #3a3a40; cursor: not-allowed; }
.chat-input-bar.disabled .input-action-btn { cursor: not-allowed; }

/* ================== СТИКЕРЫ ================== */
.chat-viewport { position: relative; }

#btn-stickers.active {
  color: var(--apple-cyan);
  background: rgba(100, 210, 255, .1);
}
#btn-stickers.sending svg { animation: stickerSend .42s cubic-bezier(.2, 1.2, .3, 1); }
@keyframes stickerSend {
  0% { transform: scale(1) rotate(0); }
  45% { transform: scale(1.35) rotate(-10deg); }
  100% { transform: scale(1) rotate(0); }
}

.sticker-panel {
  position: absolute;
  right: 16px;
  bottom: 74px;
  width: min(390px, calc(100% - 24px));
  height: min(440px, calc(100% - 110px));
  display: flex;
  flex-direction: column;
  z-index: 95;
  border-radius: 22px;
  background: rgba(17, 17, 21, .97);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .35);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  animation: stickerPanelIn .18s cubic-bezier(.2, .9, .3, 1.12);
}
@keyframes stickerPanelIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.sticker-panel-head {
  flex: 0 0 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sticker-panel-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.sticker-panel-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sticker-panel-close:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.sticker-panel-close svg { width: 17px; height: 17px; }

.sticker-grid {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px;
  scrollbar-width: thin;
}
.sticker-item {
  aspect-ratio: 1;
  padding: 4px;
  border: none;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: background .14s, transform .14s;
  -webkit-tap-highlight-color: transparent;
}
.sticker-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .28));
  pointer-events: none;
}
.sticker-item:hover { background: rgba(255, 255, 255, .07); transform: translateY(-2px); }
.sticker-item:active { transform: scale(.94); }

.sticker-pack-bar {
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  background: rgba(0, 0, 0, .2);
  overflow-x: auto;
}
.sticker-pack-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  padding: 4px 10px 4px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-gray);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.sticker-pack-tab:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sticker-pack-tab.active { background: rgba(100, 210, 255, .1); border-color: rgba(100, 210, 255, .28); color: #fff; }
.sticker-pack-thumb {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, .05);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sticker-pack-thumb img { width: 100%; height: 100%; object-fit: contain; }
.sticker-pack-name { overflow: hidden; text-overflow: ellipsis; }

/* Стикер в сообщении */
.bubble.sticker-bubble,
body.theme-light .bubble.sticker-bubble {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: 190px;
  border-radius: 0 !important;
}
.msg-sticker {
  display: block;
  width: 150px;
  height: 150px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 16px rgba(0, 0, 0, .38));
  animation: stickerPop .3s cubic-bezier(.2, 1.25, .35, 1);
  user-select: none;
  -webkit-user-drag: none;
}
@keyframes stickerPop {
  0% { opacity: 0; transform: scale(.55) translateY(14px); }
  65% { opacity: 1; transform: scale(1.04) translateY(0); }
  100% { transform: scale(1); }
}
.bubble.sticker-bubble .msg-meta {
  margin-top: 1px;
  color: rgba(255, 255, 255, .5);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
body.theme-light .bubble.sticker-bubble .msg-meta { color: rgba(0, 0, 0, .42); text-shadow: none; }
.bubble.sticker-bubble .msg-react,
.bubble.sticker-bubble .msg-reply,
.bubble.sticker-bubble .msg-del { color: rgba(255, 255, 255, .55); }
body.theme-light .bubble.sticker-bubble .msg-react,
body.theme-light .bubble.sticker-bubble .msg-reply,
body.theme-light .bubble.sticker-bubble .msg-del { color: rgba(0, 0, 0, .4); }

@media (max-width: 820px) {
  .sticker-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    width: auto;
    height: min(46vh, 400px);
    border-radius: 20px;
  }
  .sticker-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 9px; }
  .sticker-item { padding: 3px; border-radius: 12px; }
  .msg-sticker { width: 132px; height: 132px; }
  .sticker-panel-close { width: 38px; height: 38px; }
}

/* ================================================================== */
/*  MOTION SYSTEM — живые анимации по всему интерфейсу                */
/* ================================================================== */
:root {
  --ease-out: cubic-bezier(.22, .8, .25, 1);
  --ease-spring: cubic-bezier(.2, .9, .3, 1.12);
  --motion-fast: .16s;
  --motion-base: .26s;
  --motion-slow: .42s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.72); } 70% { opacity: 1; transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdropOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes modalOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px) scale(.975); } }
@keyframes drawerIn { from { transform: translateX(-104%); } to { transform: none; } }
@keyframes drawerOut { from { transform: none; } to { transform: translateX(-104%); } }
@keyframes navItemIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes topbarIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes sidebarIn { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes stageIn { from { opacity: 0; transform: translateY(14px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes chatViewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes chatSlideIn { from { opacity: .35; transform: translateX(34px); } to { opacity: 1; transform: none; } }
@keyframes chatViewOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(30px); } }
@keyframes chatRowIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes sectionIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes stickerItemIn { from { opacity: 0; transform: scale(.78) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes badgePop { 0% { transform: scale(.45); opacity: 0; } 70% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); } }
@keyframes dotPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .45); } 55% { box-shadow: 0 0 0 5px rgba(48, 209, 88, 0); } }
@keyframes activationIn { from { opacity: 0; transform: translateY(26px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes pickerOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(5px) scale(.94); } }
@keyframes pickerOptionIn { from { opacity: 0; transform: scale(.55) translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes lightboxImgIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes appFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(191, 90, 242, .28); } 50% { box-shadow: 0 0 0 6px rgba(191, 90, 242, 0); } }

/* ---------- глобальные микро-взаимодействия ---------- */
button { -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.965); }
.chat-row-item { transition: background var(--motion-fast), transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast); }
.chat-row-item:hover { transform: translateY(-1px); }
.chat-row-item:active { transform: scale(.985); }
.chat-row-item.active { box-shadow: inset 3px 0 0 var(--apple-purple); }
.chat-row-enter { animation: chatRowIn var(--motion-base) var(--ease-out) both; animation-delay: calc(var(--row-i, 0) * 18ms); }

.msg-avatar, .chat-avatar, .story-avatar, .avatar-circle-md, .avatar-circle-sm { transition: transform var(--motion-base) var(--ease-spring); }
.msg-avatar:hover, .chat-row-item:hover .chat-avatar, .story-item:hover .story-avatar { transform: scale(1.07); }

.top-action-pill, .logout-icon-btn, .menu-burger-btn, .chat-top-action, .input-action-btn,
.send-message-btn, .win-btn, .filter-icon, .reply-bar-close, .sticker-panel-close, .up-close, .up-copy {
  transition: transform var(--motion-fast) var(--ease-out), background var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast), opacity var(--motion-fast);
}
.top-action-pill:hover, .logout-icon-btn:hover, .menu-burger-btn:hover, .chat-top-action:hover,
.input-action-btn:hover, .win-btn:hover { transform: translateY(-1px); }
.top-action-pill:active, .logout-icon-btn:active, .menu-burger-btn:active, .chat-top-action:active,
.input-action-btn:active, .win-btn:active { transform: scale(.9); }

.send-message-btn:hover { transform: translateY(-1px) scale(1.05); box-shadow: 0 7px 20px rgba(191, 90, 242, .38); }
.send-message-btn:active { transform: scale(.9); }

.chat-input-bar textarea { transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast); }
.chat-input-bar textarea:focus { border-color: rgba(191, 90, 242, .55); box-shadow: 0 0 0 3px rgba(191, 90, 242, .12); }
.chat-input-bar:focus-within .input-action-btn { color: var(--apple-purple); }

/* ---------- загрузка приложения ---------- */
.activation-window { animation: activationIn .55s var(--ease-spring) both; }
.app-ready #main-app { animation: appFadeIn .32s ease both; }
.app-ready .app-topbar { animation: topbarIn var(--motion-slow) var(--ease-out) both; }
.app-ready .chats-sidebar { animation: sidebarIn .5s .04s var(--ease-out) both; }
.app-ready .chat-main-view { animation: stageIn .52s .07s var(--ease-out) both; }

/* ---------- список чатов ---------- */
.unread-badge { animation: badgePop .32s var(--ease-spring) both; }
.online-mini-dot, .up-online-dot, .cs-online-dot, .online-dot-inline { animation: dotPulse 2.6s ease-out infinite; }
.empty-feed, .empty-chats, .empty-slate-text { animation: fadeUp var(--motion-base) var(--ease-out) both; }

/* ---------- сообщения ---------- */
.msg-row.msg-appear { animation-fill-mode: both; }
.msg-day { animation: fadeIn var(--motion-base) ease both; }
.bubble { transition: transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast); }
.bubble:hover { transform: translateY(-1px); }
.msg-react, .msg-reply, .msg-del { transition: opacity var(--motion-fast), color var(--motion-fast), transform var(--motion-fast) var(--ease-out); }
.msg-react:hover, .msg-reply:hover, .msg-del:hover { transform: scale(1.18); }
.reaction-chip { transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast) var(--ease-out); }
.reaction-chip:hover { transform: translateY(-2px) scale(1.04); }
.reaction-chip:active { transform: scale(.94); }
.reply-bar { animation: replyBarIn var(--motion-fast) ease both; }

/* ---------- модальные окна ---------- */
.modal-backdrop { animation: backdropIn .2s ease both; }
.modal-backdrop > * { animation: modalIn var(--motion-base) var(--ease-spring) both; }
.modal-backdrop.is-closing { animation: backdropOut .18s ease both; pointer-events: none; }
.modal-backdrop.is-closing > * { animation: modalOut .18s ease both; }

/* ---------- шторка ---------- */
.drawer-overlay { animation: backdropIn .2s ease both; }
.drawer-overlay .runa-drawer { animation: drawerIn .3s var(--ease-out) both; }
.drawer-overlay.is-closing { animation: backdropOut .2s ease both; pointer-events: none; }
.drawer-overlay.is-closing .runa-drawer { animation: drawerOut .22s var(--ease-out) both; }
.drawer-user-card { animation: navItemIn .3s .02s var(--ease-out) both; }
.drawer-nav-item { animation: navItemIn .3s var(--ease-out) both; animation-delay: calc(var(--nav-i, 0) * 17ms + 55ms); }
.drawer-nav-item:hover { transform: translateX(3px); }

/* ---------- чат ---------- */
.chat-viewport { animation: chatViewIn var(--motion-base) var(--ease-out) both; }
.chat-viewport.is-closing { animation: chatViewOut .19s ease both; pointer-events: none; }
@media (max-width: 820px) {
  .chat-viewport { animation-name: chatSlideIn; }
}

/* ---------- настройки чата / канала ---------- */
.cs-body > * { animation: sectionIn .28s var(--ease-out) both; }
.cs-body > *:nth-child(2) { animation-delay: .035s; }
.cs-body > *:nth-child(3) { animation-delay: .07s; }
.cs-body > *:nth-child(4) { animation-delay: .105s; }
.cs-body > *:nth-child(5) { animation-delay: .14s; }
.cs-tab, .cs-quick, .cs-member-row { transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast) var(--ease-out); }
.cs-tab:active, .cs-quick:active { transform: scale(.96); }
.cs-quick:hover { transform: translateY(-2px); }
.cs-member-row:hover { transform: translateX(2px); }
.cs-primary-btn:hover, .cs-danger-btn:hover { transform: translateY(-1px); }

/* ---------- профиль ---------- */
.up-body > * { animation: fadeUp .32s var(--ease-out) both; }
.up-body > *:nth-child(1) { animation-delay: .02s; }
.up-body > *:nth-child(2) { animation-delay: .06s; }
.up-body > *:nth-child(3) { animation-delay: .1s; }
.up-body > *:nth-child(4) { animation-delay: .14s; }
.up-body > *:nth-child(5) { animation-delay: .18s; }
.up-body > *:nth-child(6) { animation-delay: .22s; }
.up-body > *:nth-child(7) { animation-delay: .26s; }
.up-body > *:nth-child(8) { animation-delay: .3s; }
.up-pills > *, .up-badges > *, .up-actions > * { animation: popIn .3s var(--ease-spring) both; }
.up-pills > *:nth-child(2), .up-actions > *:nth-child(2) { animation-delay: .06s; }
.up-pills > *:nth-child(3), .up-actions > *:nth-child(3) { animation-delay: .12s; }
.up-pills > *:nth-child(4) { animation-delay: .18s; }

/* ---------- стикеры ---------- */
.sticker-panel { animation: modalIn var(--motion-base) var(--ease-spring) both; }
.sticker-panel.is-closing { animation: modalOut .15s ease both; pointer-events: none; }
.sticker-item { animation: stickerItemIn .26s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 12ms); }
.sticker-pack-tab:hover { transform: translateY(-1px); }

/* ---------- реакции ---------- */
.reaction-picker { animation: pickerIn .18s var(--ease-spring) both; }
.reaction-picker.is-closing { animation: pickerOut .12s ease both; pointer-events: none; }
.reaction-option { animation: pickerOptionIn .24s var(--ease-spring) both; }
.reaction-option:nth-child(1) { animation-delay: .01s; }
.reaction-option:nth-child(2) { animation-delay: .03s; }
.reaction-option:nth-child(3) { animation-delay: .05s; }
.reaction-option:nth-child(4) { animation-delay: .07s; }
.reaction-option:nth-child(5) { animation-delay: .09s; }
.reaction-option:nth-child(6) { animation-delay: .11s; }
.reaction-option:nth-child(7) { animation-delay: .13s; }

/* ---------- тосты ---------- */
.toast-item { position: relative; overflow: hidden; }
.toast-item::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #0A84FF, #BF5AF2);
  transform-origin: left;
  animation: toastProgress 3.2s linear forwards;
}
.toast-item.error::after { background: linear-gradient(90deg, #FF453A, #FF9F0A); }
.toast-item.message::after { background: linear-gradient(90deg, #30D158, #64D2FF); }

/* ---------- лайтбокс ---------- */
.image-lightbox { animation: backdropIn .18s ease both; }
.image-lightbox img { animation: lightboxImgIn .24s var(--ease-spring) both; }

/* ---------- плавная смена темы ---------- */
body, .app-topbar, .chats-sidebar, .chat-input-bar, .chat-main-view, .runa-drawer, .modal-backdrop > * {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
    animation-delay: 0ms !important;
  }
}

/* ================================================================== */
/*  PWA: офлайн-баннер, обновление, установка                         */
/* ================================================================== */
.offline-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 2600;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(28, 20, 22, .92);
  border: 1px solid rgba(255, 69, 58, .35);
  color: #ffb4ad;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -14px) scale(.97);
  transition: opacity .24s var(--ease-out), transform .3s var(--ease-spring);
}
.offline-banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.offline-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff453a;
  box-shadow: 0 0 0 0 rgba(255, 69, 58, .5);
  animation: dotPulseRed 1.8s ease-out infinite;
}
@keyframes dotPulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, .5); }
  55% { box-shadow: 0 0 0 6px rgba(255, 69, 58, 0); }
}

.pwa-update-bar {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 2600;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 18px;
  border-radius: 18px;
  background: rgba(18, 18, 22, .94);
  border: 1px solid rgba(191, 90, 242, .35);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(191, 90, 242, .08);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px) scale(.96);
  transition: opacity .24s var(--ease-out), transform .3s var(--ease-spring);
}
.pwa-update-bar.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
.pwa-update-bar button {
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #8B5CF6, #D946EF);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .16s var(--ease-out), filter .16s;
}
.pwa-update-bar button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.pwa-update-bar button:active { transform: scale(.95); }

/* ---------- окно помощи по установке ---------- */
.install-help { padding: 2px 2px 4px; }
.install-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(217, 70, 239, .08));
  border: 1px solid rgba(191, 90, 242, .22);
  margin-bottom: 16px;
}
.install-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(120, 60, 220, .4);
  flex-shrink: 0;
}
.install-hero h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; }
.install-hero p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-gray); }
.install-steps { display: flex; flex-direction: column; gap: 9px; }
.install-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .06);
  animation: fadeUp .3s var(--ease-out) both;
}
.install-step:nth-child(2) { animation-delay: .05s; }
.install-step:nth-child(3) { animation-delay: .1s; }
.install-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, .18);
  border: 1px solid rgba(139, 92, 246, .4);
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.install-step-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  flex-shrink: 0;
}
.install-step-icon svg { width: 18px; height: 18px; }
.install-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.install-step-text b { font-size: 12.5px; }
.install-step-text span { font-size: 11px; color: var(--text-gray); line-height: 1.4; }
.install-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 16px 2px 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}
.install-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; color: var(--apple-green); }

/* ---------- standalone-режим ---------- */
body.pwa-standalone .app-topbar {
  height: calc(52px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}
body.pwa-standalone .chat-input-bar {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
body.pwa-standalone .chats-sidebar { padding-bottom: env(safe-area-inset-bottom, 0px); }
body.pwa-standalone #toast-container { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

@media (prefers-reduced-motion: reduce) {
  .offline-banner, .pwa-update-bar { transition: none; }
}

/* ================================================================== */
/*  ЮЗЕРНЕЙМЫ И NFT-КОЛЛЕКЦИЯ                                         */
/* ================================================================== */
.username-input-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
  border-radius: 12px;
  background: #1a1a20;
  border: 1px solid var(--border-subtle);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.username-input-row:focus-within {
  border-color: rgba(191, 90, 242, .6);
  box-shadow: 0 0 0 3px rgba(191, 90, 242, .13);
  background: #1d1d24;
}
.username-input-row .static-prefix { color: var(--text-dim); font-weight: 700; }
.username-input-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 4px;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
}
.username-status {
  width: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dim);
}
.username-status.ok { color: var(--apple-green); }
.username-status.bad { color: var(--apple-red); }
.username-status.checking { color: var(--apple-orange); animation: dotPulse 1.2s ease-out infinite; }
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-dim);
  transition: color .18s;
}
.field-hint.ok { color: var(--apple-green); }
.field-hint.bad { color: #ff8a80; }

.profile-nfts-row { margin-top: 20px; text-align: left; }
.profile-nfts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profile-nfts-head .meta-label { margin-bottom: 8px; }
.profile-nfts-manage {
  border: none;
  background: none;
  color: var(--apple-purple);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0 8px;
  transition: color .15s, transform .15s;
}
.profile-nfts-manage:hover { color: #d9a6ff; transform: translateX(1px); }
.nft-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nft-chip-btn { border: none; cursor: pointer; transition: transform .15s var(--ease-out), background .15s, box-shadow .15s; }
.nft-chip-btn:hover { transform: translateY(-2px); background: rgba(10, 132, 255, .24); box-shadow: 0 6px 16px rgba(10, 132, 255, .18); }
.nft-chip-btn:active { transform: scale(.96); }
.nft-sale-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--apple-green);
  vertical-align: middle;
  animation: dotPulse 2.2s ease-out infinite;
}
.edit-nfts-list { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 30px; }
.edit-nfts-list .nft-chip { margin: 0; font-size: 12px; }
.edit-nfts-list .nft-chip em { font-style: normal; opacity: .7; font-size: 10.5px; }

.nft-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .06);
  margin-bottom: 8px;
  transition: background .16s, border-color .16s, transform .16s;
}
.nft-manage-row:hover { background: rgba(255, 255, 255, .055); border-color: rgba(191, 90, 242, .22); transform: translateX(2px); }
.nft-manage-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nft-manage-main .nft-chip { margin: 0; align-self: flex-start; }
.nft-manage-main small { font-size: 10.5px; color: var(--text-gray); }
.nft-mini-btn { padding: 7px 13px; font-size: 11.5px; flex-shrink: 0; }

/* ---------- маркет юзернеймов ---------- */
.nft-market-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 6px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(10, 132, 255, .14), rgba(191, 90, 242, .12));
  border: 1px solid rgba(191, 90, 242, .2);
}
.nft-market-hero h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.nft-market-hero p { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text-gray); max-width: 320px; }
.nft-market-balance {
  flex-shrink: 0;
  padding: 8px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .09);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.nft-lot-list { display: flex; flex-direction: column; gap: 7px; }
.nft-lot-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: background .16s, border-color .16s, transform .16s;
  animation: fadeUp .26s var(--ease-out) both;
}
.nft-lot-row:hover { background: rgba(255, 255, 255, .055); border-color: rgba(10, 132, 255, .22); transform: translateY(-1px); }
.nft-lot-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(10, 132, 255, .22), rgba(191, 90, 242, .18));
  border: 1px solid rgba(10, 132, 255, .25);
  color: #8fc7ff;
}
.nft-lot-icon.mine { background: linear-gradient(135deg, rgba(48, 209, 88, .18), rgba(100, 210, 255, .12)); border-color: rgba(48, 209, 88, .25); color: #8ef0a8; }
.nft-lot-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nft-lot-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nft-lot-main small { font-size: 10.5px; color: var(--text-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nft-lot-price { font-size: 13px; font-weight: 800; color: #e9d5ff; white-space: nowrap; }
.nft-lot-price span { font-size: 11px; }
.nft-lot-btn { padding: 8px 13px; font-size: 11.5px; flex-shrink: 0; }

@media (max-width: 520px) {
  .nft-market-hero { flex-direction: column; align-items: flex-start; }
  .nft-lot-row { flex-wrap: wrap; }
  .nft-lot-main { flex-basis: calc(100% - 50px); }
  .nft-lot-price { margin-left: 49px; }
}
.up-nft-label { font-size: 9.5px; font-weight: 800; letter-spacing: .1em; color: var(--text-dim); align-self: center; margin-right: 2px; }
.s-user-main { min-width: 0; }
.s-handle-row { display: flex; align-items: center; gap: 7px; margin-top: 1px; }
.s-change-btn {
  border: none;
  background: rgba(191, 90, 242, .14);
  color: #d9a6ff;
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.s-change-btn:hover { background: rgba(191, 90, 242, .26); transform: translateY(-1px); }
.s-change-btn:active { transform: scale(.94); }
