:root {
  --tg-theme-bg-color: #17212b;
  --tg-theme-secondary-bg-color: #232e3c;
  --tg-theme-section-bg-color: #232e3c;
  --tg-theme-header-bg-color: #17212b;
  --tg-theme-text-color: #ffffff;
  --tg-theme-hint-color: #708499;
  --tg-theme-link-color: #6ab3f3;
  --tg-theme-button-color: #5288c1;
  --tg-theme-button-text-color: #ffffff;
  --tg-theme-destructive-text-color: #ec3942;
  --tg-theme-section-separator-color: rgba(255, 255, 255, 0.06);
  --tg-elev: #2b394a;
  --tg-bubble-in: #182533;
  --tg-bubble-out: #2b5278;
  --tg-viewport-height: 100vh;
  --safe-top: 0px;
  --safe-bottom: 0px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden],
.empty-state[hidden],
.error-state[hidden],
.nav-dot-badge[hidden],
.toast[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Roboto", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: inherit;
}

.status-dot,
.online-pill,
.info-banner {
  display: none !important;
}

.tg-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

.icon-verify {
  width: 18px;
  height: 18px;
  color: var(--tg-theme-link-color);
}

.icon-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.app-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(12px + var(--safe-top)) 16px calc(88px + var(--safe-bottom)) 16px;
  position: relative;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 14px 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: #ffffff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-theme-hint-color);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.user-block {
  background: var(--tg-theme-secondary-bg-color);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  margin-bottom: 12px;
}

.avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--tg-elev);
}

.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4caf50;
  border: 2px solid var(--tg-theme-secondary-bg-color);
}

.user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-id-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 6px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--tg-theme-hint-color);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: transform 0.15s ease, background 0.15s ease;
}

.user-id-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.12);
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.25);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #81c784;
}

.online-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf50;
}

.hero-stat-card {
  background: var(--tg-theme-section-bg-color);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid transparent;
  text-align: center;
  margin-bottom: 12px;
}

.hero-stat-val {
  font-size: 44px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.hero-stat-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--tg-theme-hint-color);
  text-transform: lowercase;
  margin-top: 3px;
  margin-bottom: 14px;
}

.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-action-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.quick-action-btn:active {
  transform: scale(0.96);
  background: rgba(106, 179, 243, 0.12);
  border-color: rgba(106, 179, 243, 0.3);
}

.qa-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(106, 179, 243, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-theme-link-color);
}

.qa-label {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
}

.info-banner {
  background: linear-gradient(135deg, rgba(106, 179, 243, 0.12) 0%, rgba(36, 129, 204, 0.08) 100%);
  border: 1px solid rgba(106, 179, 243, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.banner-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.banner-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(106, 179, 243, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-theme-link-color);
  flex-shrink: 0;
}

.banner-text {
  flex: 1;
  min-width: 0;
}

.banner-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.banner-desc {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  line-height: 1.35;
}

.banner-close-btn {
  background: transparent;
  border: none;
  color: var(--tg-theme-hint-color);
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.banner-close-btn:active {
  color: #ffffff;
}

.banner-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.banner-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, width 0.2s ease;
}

.banner-dot.active {
  width: 14px;
  border-radius: 3px;
  background: var(--tg-theme-link-color);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 6px 4px;
  color: var(--tg-theme-link-color);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.badge-count {
  background: rgba(106, 179, 243, 0.15);
  color: var(--tg-theme-link-color);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--tg-theme-secondary-bg-color);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 12px;
  margin-bottom: 12px;
  height: 40px;
  transition: border-color 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--tg-theme-link-color);
}

.search-icon {
  color: var(--tg-theme-hint-color);
  margin-right: 8px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
}

.search-box input::placeholder {
  color: var(--tg-theme-hint-color);
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--tg-theme-hint-color);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-btn:active {
  color: #ffffff;
}

.native-card {
  background: var(--tg-theme-secondary-bg-color);
  border-radius: 12px;
  border: 1px solid transparent;
  overflow: hidden;
  margin-bottom: 14px;
}

.chats-list {
  display: flex;
  flex-direction: column;
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 0.5px solid var(--tg-theme-section-separator-color);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  min-height: 64px;
  animation: cascade-in 0.25s ease forwards;
  animation-delay: calc(var(--stagger, 0) * 35ms);
  opacity: 0;
}

.chat-item:last-child {
  border-bottom: none;
}

.chat-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.03);
}

.chat-avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-right: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.chat-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.chat-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.chat-time {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  flex-shrink: 0;
}

.chat-meta-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-last-msg {
  font-size: 14px;
  color: var(--tg-theme-hint-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.chat-dead-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(236, 57, 66, 0.15);
  color: var(--tg-theme-destructive-text-color);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 6px;
  flex-shrink: 0;
}

.filter-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.filter-pills-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: var(--tg-theme-secondary-bg-color);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tg-theme-hint-color);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-pill:active {
  transform: scale(0.95);
}

.filter-pill.active {
  background: rgba(106, 179, 243, 0.15);
  border-color: rgba(106, 179, 243, 0.35);
  color: var(--tg-theme-link-color);
  font-weight: 600;
}

.expired-alert-banner {
  background: rgba(243, 156, 18, 0.12);
  border: 1px solid rgba(243, 156, 18, 0.25);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #f39c12;
  margin-bottom: 10px;
}

.deleted-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deleted-card {
  background: var(--tg-theme-secondary-bg-color);
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 12px 14px;
  transition: transform 0.15s ease;
  animation: cascade-in 0.25s ease forwards;
  animation-delay: calc(var(--stagger, 0) * 35ms);
  opacity: 0;
}

.deleted-card:active {
  transform: scale(0.99);
}

.deleted-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.deleted-user-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deleted-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.deleted-author-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.deleted-author {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.deleted-uname {
  font-size: 12px;
  font-weight: 700;
  color: var(--tg-theme-link-color);
  line-height: 1.2;
}

.deleted-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--tg-theme-hint-color);
  white-space: nowrap;
}

.deleted-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.deleted-badge.del {
  background: rgba(236, 57, 66, 0.15);
  color: var(--tg-theme-destructive-text-color);
}

.deleted-badge.edit {
  background: rgba(106, 179, 243, 0.15);
  color: var(--tg-theme-link-color);
}

.deleted-card-body {
  font-size: 15px;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 8px;
  word-break: break-word;
}

.deleted-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--tg-theme-hint-color);
}

.history-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--tg-theme-link-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
}

.history-btn:active {
  transform: scale(0.94);
}

.history-steps {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-step {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.history-step-head {
  display: flex;
  justify-content: space-between;
  color: var(--tg-theme-hint-color);
  font-size: 10px;
  margin-bottom: 4px;
}

.load-more-wrap {
  text-align: center;
  margin: 14px 0;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.expiring-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expiring-card {
  background: var(--tg-theme-secondary-bg-color);
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: cascade-in 0.25s ease forwards;
  animation-delay: calc(var(--stagger, 0) * 35ms);
  opacity: 0;
}

.expiring-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.expiring-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(236, 57, 66, 0.12);
  color: var(--tg-theme-destructive-text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expiring-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.expiring-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expiring-timer {
  font-size: 11px;
  color: var(--tg-theme-hint-color);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.setting-item {
  border-bottom: 0.5px solid var(--tg-theme-section-separator-color);
  padding: 12px 16px;
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item.clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.setting-item.clickable:active {
  background: rgba(255, 255, 255, 0.04);
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setting-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setting-icon-box.auto { background: rgba(106, 179, 243, 0.12); color: var(--tg-theme-link-color); }
.setting-icon-box.afk { background: rgba(243, 156, 18, 0.12); color: #f39c12; }
.setting-icon-box.spam { background: rgba(76, 175, 80, 0.12); color: #4caf50; }
.setting-icon-box.sys { background: rgba(255, 255, 255, 0.06); color: var(--tg-theme-hint-color); }
.setting-icon-box.danger { background: rgba(236, 57, 66, 0.12); color: var(--tg-theme-destructive-text-color); }

.setting-meta {
  flex: 1;
  min-width: 0;
}

.setting-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.setting-desc {
  font-size: 13px;
  color: var(--tg-theme-hint-color);
  margin-top: 1px;
}

.danger-text {
  color: var(--tg-theme-destructive-text-color);
}

.chevron-icon {
  color: var(--tg-theme-hint-color);
}

.tg-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.tg-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tg-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.16);
  transition: background-color 0.2s ease;
  border-radius: 26px;
}

.tg-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: transform 0.2s ease;
  border-radius: 50%;
}

.tg-switch input:checked + .tg-slider {
  background-color: var(--tg-theme-link-color);
}

.tg-switch input:checked + .tg-slider::before {
  transform: translateX(18px);
}

.setting-subpanel {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.06);
}

.setting-subpanel.open {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--tg-theme-hint-color);
}

.textarea-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  color: #ffffff;
  resize: vertical;
  outline: none;
  font-size: 13px;
}

.textarea-field:focus {
  border-color: var(--tg-theme-link-color);
}

.input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  color: #ffffff;
  outline: none;
  font-size: 13px;
}

.input-field:focus {
  border-color: var(--tg-theme-link-color);
}

.input-with-action {
  display: flex;
  gap: 8px;
}

.track-delay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.track-chips, .quick-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.track-chips::-webkit-scrollbar, .quick-chips::-webkit-scrollbar {
  display: none;
}

.track-chip, .chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--tg-theme-hint-color);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.track-chip:active, .chip:active {
  transform: scale(0.95);
}

.track-chip.active {
  background: rgba(106, 179, 243, 0.15);
  border-color: rgba(106, 179, 243, 0.3);
  color: var(--tg-theme-link-color);
  font-weight: 600;
}

.timer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(243, 156, 18, 0.12);
  border: 1px solid rgba(243, 156, 18, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
  color: #f39c12;
  font-size: 12px;
}

.timer-banner-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.commands-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cmd-card {
  background: var(--tg-theme-secondary-bg-color);
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s ease;
  animation: cascade-in 0.25s ease forwards;
  animation-delay: calc(var(--stagger, 0) * 25ms);
  opacity: 0;
}

.cmd-card:active {
  transform: scale(0.98);
}

.cmd-meta {
  flex: 1;
  min-width: 0;
}

.cmd-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cmd-syntax {
  font-family: monospace;
  font-size: 11px;
  background: rgba(106, 179, 243, 0.12);
  color: var(--tg-theme-link-color);
  padding: 1px 6px;
  border-radius: 4px;
}

.cmd-desc {
  font-size: 13px;
  color: var(--tg-theme-hint-color);
  margin-top: 2px;
  line-height: 1.3;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-state[hidden] {
  display: none !important;
}

.empty-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-theme-hint-color);
  margin-bottom: 4px;
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.empty-state p {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  max-width: 260px;
}

.error-state {
  text-align: center;
  padding: 36px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.error-state[hidden] {
  display: none !important;
}

.error-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(236, 57, 66, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-theme-destructive-text-color);
  margin-bottom: 4px;
}

.error-state h3 {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.error-state p {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  max-width: 280px;
}

.retry-btn {
  margin-top: 8px;
  background: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
  border: none;
  border-radius: 12px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.retry-btn:active {
  transform: scale(0.95);
}

.skeleton-row {
  height: 56px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.02) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.04);
}

.skeleton-card {
  height: 72px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.02) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes cascade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.bottom-nav {
  position: fixed;
  bottom: calc(12px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  max-width: 568px;
  margin: 0 auto;
  height: 58px;
  border-radius: 28px;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  background: rgba(35, 46, 60, 0.86);
  border: 1px solid transparent;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 4px;
  z-index: 1000;
}

.nav-item {
  background: transparent;
  border: none;
  border-radius: 22px;
  height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--tg-theme-hint-color);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.nav-item:active {
  transform: scale(0.94);
}

.nav-item.active {
  background: rgba(106, 179, 243, 0.16);
  color: var(--tg-theme-link-color);
}

.nav-item span {
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active span {
  font-weight: 600;
}

.nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-dot-badge {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tg-theme-destructive-text-color);
}

.chat-view {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--tg-theme-bg-color);
  z-index: 1500;
  display: flex;
  flex-direction: column;
}

.chat-view-header {
  padding: calc(10px + var(--safe-top)) 14px 10px 14px;
  background: var(--tg-theme-secondary-bg-color);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-view-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  flex-shrink: 0;
}

.chat-view-avatar-wrap .chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.chat-view-avatar-wrap .chat-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.chat-view-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-view-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-view-status {
  font-size: 11px;
  color: var(--tg-theme-hint-color);
}


.chat-time-tag {
  background: rgba(106, 179, 243, 0.12);
  color: var(--tg-theme-link-color);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
}

.chat-messages-container {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px calc(20px + var(--safe-bottom)) 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--tg-theme-secondary-bg-color, #17212b);
  background-image: url("./chat_bg.jpg?v=1.0");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.chat-date-bubble {
  align-self: center;
  background: rgba(15, 24, 33, 0.78);
  backdrop-filter: blur(8px);
  color: var(--tg-theme-hint-color);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.chat-messages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.msg-row.out {
  justify-content: flex-end;
}

.msg-row.in {
  justify-content: flex-start;
}

.msg-bubble-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--tg-elev, #2b394a);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.msg-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  border-radius: 50%;
}

.msg-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--tg-theme-button-color, #5288c1), #2f6ea5);
  text-transform: uppercase;
}

.msg-bubble {
  max-width: 78%;
  border-radius: 16px;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.35;
  position: relative;
  word-break: break-word;
  animation: cascade-in 0.2s ease forwards;
}

.msg-bubble.out {
  align-self: flex-end;
  background: var(--tg-bubble-out);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.msg-bubble.in {
  align-self: flex-start;
  background: var(--tg-bubble-in);
  color: #ffffff;
  border-bottom-left-radius: 4px;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}

.msg-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
}

.msg-dead-tag {
  color: var(--tg-theme-destructive-text-color);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.msg-edit-tag {
  color: var(--tg-theme-link-color, #6ab3f3);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: calc(76px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(43, 57, 74, 0.96);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(15, 24, 33, 0.5);
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.media-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.media-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 16, 22, 0.72);
  backdrop-filter: blur(4px);
}

.media-sheet {
  position: relative;
  background: var(--tg-theme-secondary-bg-color);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 10px 16px calc(20px + var(--safe-bottom)) 16px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  z-index: 2;
  transition: transform 0.2s ease;
}

.sheet-handle-bar {
  padding: 6px 0;
  cursor: grab;
  display: flex;
  justify-content: center;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.media-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sheet-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.sheet-close-btn {
  background: transparent;
  border: none;
  color: var(--tg-theme-hint-color);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-close-btn:active {
  color: #ffffff;
}

.media-sheet-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(15, 24, 33, 0.5);
  min-height: 200px;
}

.media-sheet-body img, .media-sheet-body video {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
  object-fit: contain;
}

.tg-stub {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--tg-theme-bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 3000;
}

.tg-stub-card {
  background: var(--tg-theme-secondary-bg-color);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tg-stub-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(106, 179, 243, 0.12);
  color: var(--tg-theme-link-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.tg-stub-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.tg-stub-sub {
  font-size: 13px;
  color: var(--tg-theme-link-color);
  font-weight: 600;
  margin-bottom: 12px;
}

.tg-stub-desc {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  line-height: 1.4;
  margin-bottom: 20px;
}

.tg-stub-btn {
  background: var(--tg-theme-button-color);
  color: #ffffff;
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease;
}

.tg-stub-btn:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
