/* ==========================================================================
   MetaGram - Modular Views Stylesheet (Pure Black Liquid Glass Aesthetic)
   Sections: Notifications, Messages, Communities, Studio, Stars, Bots
   ========================================================================== */

/* --------------------------------------------------------------------------
   Generic View Header
   -------------------------------------------------------------------------- */
.mg-view-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 16px;
  z-index: 90;
  background: var(--mg-bg-card);
  backdrop-filter: var(--mg-glass-blur);
  -webkit-backdrop-filter: var(--mg-glass-blur);
  border-radius: var(--mg-radius-card);
  border: 1px solid var(--mg-border-card);
  box-shadow: var(--mg-shadow-glass), var(--mg-inner-bevel);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.mg-view-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mg-view-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mg-view-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--mg-text-main);
  letter-spacing: -0.02em;
  margin: 0;
}

.mg-view-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--mg-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--mg-text-muted);
}

.mg-view-header-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mg-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--mg-trans-fast);
  padding: 4px 8px;
}

.mg-view-header-action:hover {
  color: var(--mg-text-main);
}

/* --------------------------------------------------------------------------
   Segmented Filters / Pills
   -------------------------------------------------------------------------- */
.mg-view-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.mg-view-filter-bar::-webkit-scrollbar {
  display: none;
}

.mg-view-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--mg-text-muted);
  border-radius: var(--mg-radius-pill);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--mg-trans-fast);
  user-select: none;
}

.mg-view-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--mg-text-main);
  border-color: rgba(255, 255, 255, 0.16);
}

.mg-view-pill.active {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   1. NOTIFICATIONS VIEW
   ========================================================================== */
.mg-notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mg-notif-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--mg-bg-card);
  backdrop-filter: var(--mg-glass-blur);
  -webkit-backdrop-filter: var(--mg-glass-blur);
  border-radius: var(--mg-radius-card);
  border: 1px solid var(--mg-border-card);
  box-shadow: var(--mg-shadow-glass), var(--mg-inner-bevel);
  transition: all var(--mg-trans-fast);
  cursor: pointer;
  position: relative;
}

.mg-notif-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.mg-notif-item.unread::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.mg-notif-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.mg-notif-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--mg-text-main);
}

.mg-notif-icon-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-notif-icon-badge svg {
  width: 10px;
  height: 10px;
}

.mg-notif-icon-badge.badge-star {
  color: #fbbf24;
}

.mg-notif-icon-badge.badge-like {
  color: #f43f5e;
}

.mg-notif-icon-badge.badge-follow {
  color: #38bdf8;
}

.mg-notif-icon-badge.badge-comment {
  color: #a855f7;
}

.mg-notif-icon-badge.badge-system {
  color: #10b981;
}

.mg-notif-content {
  flex: 1;
  min-width: 0;
}

.mg-notif-text {
  font-size: 0.88rem;
  color: var(--mg-text-main);
  line-height: 1.4;
  margin-bottom: 4px;
}

.mg-notif-text strong {
  font-weight: 700;
  color: var(--mg-text-main);
}

.mg-notif-snippet {
  font-size: 0.8rem;
  color: var(--mg-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.mg-notif-time {
  font-size: 0.74rem;
  color: var(--mg-text-muted);
}

/* ==========================================================================
   2. MESSAGES VIEW (Liquid Dual-Pane Chat)
   ========================================================================== */
.mg-messages-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 600px;
  max-height: calc(100vh - 120px);
  min-height: 480px;
  background: var(--mg-bg-card);
  backdrop-filter: var(--mg-glass-blur);
  -webkit-backdrop-filter: var(--mg-glass-blur);
  border-radius: var(--mg-radius-card);
  border: 1px solid var(--mg-border-card);
  box-shadow: var(--mg-shadow-glass), var(--mg-inner-bevel);
  overflow: hidden;
  position: relative;
}

/* Left Pane: Dialogs Sidebar */
.mg-chat-sidebar {
  border-right: 1px solid var(--mg-border-card);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.mg-chat-search-wrap {
  padding: 12px 14px;
  border-bottom: none;
  flex-shrink: 0;
}

.mg-chat-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--mg-radius-pill);
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--mg-text-main);
  outline: none !important;
  box-shadow: none !important;
  transition: all var(--mg-trans-fast);
}

.mg-chat-search-input:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: none !important;
}

.mg-chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
}

.mg-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  user-select: none;
}

.mg-chat-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mg-chat-item.active {
  background: rgba(255, 255, 255, 0.09);
  border-left: 3px solid #ffffff;
}

.mg-chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.mg-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--mg-text-main);
  overflow: hidden;
}

.mg-chat-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #09090b;
}

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

.mg-chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.mg-chat-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--mg-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-chat-time {
  font-size: 0.72rem;
  color: var(--mg-text-muted);
  flex-shrink: 0;
  margin-left: 6px;
}

.mg-chat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mg-chat-snippet {
  font-size: 0.78rem;
  color: var(--mg-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.mg-chat-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--mg-radius-pill);
  background: #38bdf8;
  color: #09090b;
}

/* Chat Main Area (Telegram Aesthetic) */
.mg-chat-main {
  display: flex;
  flex-direction: column;
  background: #0e1621;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.mg-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--mg-border-card);
  background: var(--mg-bg-card-elevated);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-shrink: 0;
  z-index: 2;
}

.mg-chat-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mg-chat-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--mg-text-main);
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  padding: 0;
  flex-shrink: 0;
}

.mg-chat-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(-2px);
}

.mg-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mg-chat-header-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--mg-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-chat-header-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--mg-text-main);
  border-color: rgba(255, 255, 255, 0.22);
}

.mg-chat-header-tool-btn.mg-chat-header-danger-btn:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.38);
  color: #f87171;
}

/* Delete dialog button in conversation list items */
.mg-chat-item-delete-btn {
  opacity: 0;
  visibility: hidden;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--mg-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all var(--mg-trans-fast);
}

.mg-chat-item:hover .mg-chat-item-delete-btn,
.mg-chat-item.active .mg-chat-item-delete-btn {
  opacity: 0.85;
  visibility: visible;
}

.mg-chat-item-delete-btn:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #f87171 !important;
  transform: scale(1.1);
}

@media (max-width: 640px) {
  .mg-chat-item-delete-btn {
    opacity: 0.75;
    visibility: visible;
  }
}

.mg-btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: var(--mg-text-main) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.mg-btn-modal-danger:hover {
  background: #b91c1c !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}

.mg-chat-header-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mg-text-main);
}

.mg-chat-header-status {
  font-size: 0.76rem;
  color: var(--mg-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  line-height: 1.3;
}

.mg-chat-status-online {
  color: #10b981;
  font-weight: 500;
}

.mg-chat-status-offline {
  color: #a1a1aa;
  font-weight: 400;
}

.mg-chat-header-uid {
  color: #71717a;
  font-size: 0.72rem;
}

.mg-chat-header-status-note {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 0.7rem;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg-chat-messages-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  scrollbar-width: thin;
  background-color: var(--mg-bg-card);
  position: relative;
  transition: background-image 0.2s ease;
}

/* Open Dialog Wallpaper Background (message background.png) */
.mg-messages-container.has-active-chat .mg-chat-messages-area,
.mg-chat-messages-area.has-chat-bg {
  background-color: #1a162b !important;
  background-image: url('../message%20background.png') !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
  background-attachment: scroll !important;
}

.mg-message-bubble {
  display: inline-flex;
  flex-direction: column;
  width: fit-content;
  max-width: 76%;
  min-width: 64px;
  height: fit-content;
  min-height: fit-content;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.4;
  position: relative;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  flex-shrink: 0;
  flex-grow: 0;
  animation: mgFadeInUp 0.18s ease-out;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mg-message-incoming {
  align-self: flex-start;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.mg-message-outgoing {
  align-self: flex-end;
  background: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.mg-message-text {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.38;
  margin: 0;
  padding: 0;
  color: inherit;
}

.mg-message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.48);
  margin-top: 3px;
  line-height: 1;
  user-select: none;
}

/* Message Delivery / Read Status Icons */
.mg-msg-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  vertical-align: middle;
  cursor: default;
  user-select: none;
  pointer-events: none;
  padding: 0 1px;
}

.mg-msg-status svg {
  display: block;
}

/* Sent / Delivered (Unread): Crisp single checkmark in soft muted silver */
.mg-msg-status-sent {
  color: rgba(255, 255, 255, 0.45);
}

/* Read: Interlocking double checkmark in vibrant cyan blue without glow */
.mg-msg-status-read {
  color: #38bdf8;
  filter: none !important;
}

/* Unread Badge in Dialogs List */
.mg-chat-unread-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  height: 18px;
  border-radius: var(--mg-radius-pill);
  background: #38bdf8;
  color: #09090b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  flex-shrink: 0;
}

.mg-chat-composer {
  display: flex;
  flex-direction: column;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--mg-border-card);
  background: var(--mg-bg-card-elevated);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 2;
  gap: 8px;
}

.mg-chat-composer-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.mg-chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  animation: mgFadeInUp 0.15s ease-out;
}

.mg-chat-reply-bar-accent {
  width: 3px;
  align-self: stretch;
  background: #3b82f6;
  border-radius: 2px;
  flex-shrink: 0;
}

.mg-chat-reply-bar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.mg-chat-reply-bar-author {
  font-size: 0.78rem;
  font-weight: 600;
  color: #60a5fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-chat-reply-bar-snippet {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-chat-reply-bar-close {
  background: transparent;
  border: none;
  color: var(--mg-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.mg-chat-reply-bar-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.mg-message-reply-quote {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.24);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.mg-message-reply-quote:hover {
  background: rgba(0, 0, 0, 0.38);
}

.mg-message-reply-quote-bar {
  width: 2.5px;
  background: #60a5fa;
  border-radius: 2px;
  flex-shrink: 0;
}

.mg-message-reply-quote-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.mg-message-reply-quote-author {
  font-size: 0.72rem;
  font-weight: 600;
  color: #93c5fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-message-reply-quote-text {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-message-highlight {
  animation: mgMessagePulse 1.2s ease-out;
}

@keyframes mgMessagePulse {
  0% {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.7), 0 0 16px rgba(96, 165, 250, 0.4);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.9), 0 0 24px rgba(96, 165, 250, 0.6);
  }
  100% {
    box-shadow: none;
  }
}

.mg-msg-context-menu {
  position: fixed;
  z-index: 100000;
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 5px;
  min-width: 145px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: mgFadeInUp 0.12s ease-out;
}

.mg-msg-context-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #e4e4e7;
  font-size: 0.84rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.mg-msg-context-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.mg-msg-context-item svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.mg-msg-context-item.mg-msg-ctx-danger {
  color: #f87171;
}

.mg-msg-context-item.mg-msg-ctx-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.mg-msg-ctx-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 3px 0;
}

.mg-chat-input {
  flex: 1;
  background: var(--mg-bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #ffffff;
  outline: none;
  resize: none;
  line-height: 1.4;
  height: 40px;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  box-sizing: border-box;
  transition: border-color var(--mg-trans-fast), background-color var(--mg-trans-fast);
}

.mg-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.mg-chat-input:focus {
  border-color: rgba(255, 255, 255, 0.22);
  background: #141414;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.mg-chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  color: #09090b;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.mg-chat-send-btn:hover {
  transform: scale(1.04);
  background: #e4e4e4;
}

.mg-chat-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

@media (max-width: 768px) {
  .mg-messages-container {
    grid-template-columns: 1fr;
    height: calc(100dvh - 124px - var(--mg-sat, 0px) - var(--mg-sab, 0px));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .mg-messages-container.has-active-chat .mg-chat-sidebar {
    display: none !important;
  }
  .mg-messages-container:not(.has-active-chat) .mg-chat-main {
    display: none !important;
  }
  .mg-chat-back-btn, #mg-chat-mobile-back {
    display: inline-flex !important;
  }
  .mg-chat-input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }
  .mg-chat-composer {
    padding: 10px 14px;
    padding-bottom: calc(10px + var(--mg-sab, 0px));
  }
}

/* ==========================================================================
   3. COMMUNITIES VIEW
   ========================================================================== */
.mg-communities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.mg-community-card {
  background: var(--mg-bg-card);
  backdrop-filter: var(--mg-glass-blur);
  -webkit-backdrop-filter: var(--mg-glass-blur);
  border-radius: var(--mg-radius-card);
  border: 1px solid var(--mg-border-card);
  box-shadow: var(--mg-shadow-glass), var(--mg-inner-bevel);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--mg-trans-fast);
}

.mg-community-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.mg-community-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mg-community-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.mg-community-avatar svg {
  width: 24px;
  height: 24px;
  stroke: var(--mg-text-main);
  flex-shrink: 0;
}

.mg-empty-icon-beacon {
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.mg-empty-icon-beacon:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.18) !important;
}

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

.mg-community-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--mg-text-main);
  margin-bottom: 2px;
}

.mg-community-meta {
  font-size: 0.78rem;
  color: var(--mg-text-muted);
}

.mg-community-desc {
  font-size: 0.84rem;
  color: var(--mg-text-muted);
  line-height: 1.45;
  flex: 1;
}

.mg-community-join-btn {
  width: 100%;
  padding: 8px 14px;
  border-radius: var(--mg-radius-pill);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--mg-text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  text-align: center;
}

.mg-community-join-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.mg-community-join-btn.joined {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
}

/* ==========================================================================
   4. STUDIO VIEW (Creator Analytics & Monetization)
   ========================================================================== */
.mg-studio-header {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mg-studio-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--mg-text-main);
  letter-spacing: -0.02em;
  margin: 0 0 3px 0;
}

.mg-studio-page-subtitle {
  font-size: 0.84rem;
  color: var(--mg-text-muted);
  margin: 0;
}

/* 1. Hero Balance Card (Solid background, Theme Synced) */
.mg-studio-balance-card {
  position: relative;
  background: var(--mg-bg-card);
  border: 1px solid var(--mg-border-card);
  border-radius: 22px;
  box-shadow: var(--mg-shadow-glass);
  padding: 34px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 26px;
  overflow: hidden;
}

.mg-studio-star-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--mg-accent-primary);
  color: var(--mg-accent-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  margin-bottom: 14px;
}

.mg-studio-star-badge svg {
  fill: currentColor;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.mg-studio-balance-val {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--mg-text-main);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}

.mg-studio-balance-label {
  font-size: 0.85rem;
  color: var(--mg-text-secondary);
  font-weight: 500;
  margin-bottom: 16px;
}

.mg-studio-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(var(--mg-accent-rgb), 0.1);
  border: 1px solid rgba(var(--mg-accent-rgb), 0.25);
  color: var(--mg-accent-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

/* Sections */
.mg-studio-section {
  margin-bottom: 24px;
}

.mg-studio-section-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--mg-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  padding-left: 2px;
}

.mg-studio-card {
  background: var(--mg-bg-card);
  border: 1px solid var(--mg-border-card);
  border-radius: 18px;
  box-shadow: var(--mg-shadow-glass);
  overflow: hidden;
}

/* 2. Monetization Card */
.mg-studio-sub-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
}

.mg-studio-sub-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(var(--mg-accent-rgb), 0.1);
  border: 1px solid rgba(var(--mg-accent-rgb), 0.25);
  color: var(--mg-accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mg-studio-sub-icon-wrap svg {
  fill: var(--mg-accent-primary);
}

.mg-studio-sub-text {
  flex: 1;
  min-width: 0;
}

.mg-studio-sub-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mg-text-main);
  margin-bottom: 2px;
}

.mg-studio-sub-desc {
  font-size: 0.8rem;
  color: var(--mg-text-muted);
  line-height: 1.35;
}

/* Toggle Switch */
.mg-studio-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.mg-studio-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.mg-studio-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #27272a;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mg-studio-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.mg-studio-switch input:checked + .mg-studio-slider {
  background-color: #3f3f46;
  border-color: rgba(255, 255, 255, 0.3);
}

.mg-studio-switch input:checked + .mg-studio-slider::before {
  transform: translateX(20px);
  background-color: #ffffff;
}

.mg-studio-sub-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
}

.mg-studio-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--mg-text-secondary);
}

.mg-studio-footer-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mg-text-main);
}

/* 3. 30-Day Metrics Grid */
.mg-studio-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 620px) {
  .mg-studio-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mg-studio-stat-box {
  background: var(--mg-bg-card);
  border: 1px solid var(--mg-border-card);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--mg-trans-fast), transform var(--mg-trans-fast);
}

.mg-studio-stat-box:hover {
  border-color: var(--mg-border-hover);
}

.mg-studio-stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mg-text-secondary);
}

.mg-studio-stat-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--mg-text-main);
  letter-spacing: -0.02em;
  line-height: 1;
}

/* 4. Chart Card */
.mg-studio-chart-card {
  padding: 20px;
}

.mg-studio-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: fit-content;
  margin-bottom: 18px;
}

.mg-studio-tab {
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--mg-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
}

.mg-studio-tab:hover {
  color: var(--mg-text-main);
}

.mg-studio-tab.active {
  background: var(--mg-accent-primary);
  color: var(--mg-accent-primary-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.mg-studio-chart-headline {
  margin-bottom: 12px;
}

.mg-studio-chart-big-num {
  font-size: 2.1rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
  transition: color 0.2s;
}

.mg-studio-chart-sub {
  font-size: 0.8rem;
  color: var(--mg-text-muted);
}

.mg-studio-svg-wrap {
  width: 100%;
  height: 140px;
  position: relative;
  margin-top: 10px;
}

.mg-studio-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mg-studio-axis-dates {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--mg-text-dim);
  margin-top: 6px;
  padding: 0 4px;
  font-weight: 500;
}

/* 5. Top Posts List */
.mg-studio-posts-card {
  padding: 4px 0;
}

.mg-studio-post-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
  cursor: pointer;
}

.mg-studio-post-item:last-child {
  border-bottom: none;
}

.mg-studio-post-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mg-studio-post-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--mg-text-secondary);
  flex-shrink: 0;
}

.mg-studio-post-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mg-studio-post-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mg-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-studio-post-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--mg-text-muted);
}

.mg-studio-post-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mg-studio-post-arrow {
  color: var(--mg-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.6;
}

/* 6. Recent Sponsors List */
.mg-studio-sponsors-card {
  padding: 4px 0;
}

.mg-studio-sponsor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mg-studio-sponsor-item:last-child {
  border-bottom: none;
}

.mg-studio-sponsor-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mg-studio-sponsor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.mg-studio-sponsor-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.mg-studio-sponsor-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mg-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-studio-sponsor-handle {
  font-size: 0.78rem;
  color: var(--mg-text-muted);
}

.mg-studio-sponsor-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  font-size: 0.84rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   5. STARS VIEW (Unified Liquid Glass Layout)
   ========================================================================== */
#mg-view-stars {
  width: 100%;
}

.mg-stars-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 4px 0;
}

.mg-stars-back-btn {
  background: none;
  border: none;
  color: var(--mg-text-main);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--mg-trans-fast);
}

.mg-stars-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mg-stars-header-title {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--mg-text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.mg-stars-hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
  padding: 4px 12px;
}

.mg-stars-hero-star-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.mg-stars-hero-star-glow {
  display: none !important;
}

.mg-stars-hero-3d-star {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.mg-stars-hero-3d-star path:first-of-type {
  fill: var(--mg-accent-primary);
}

.mg-stars-hero-3d-star path:last-of-type {
  fill: rgba(255, 255, 255, 0.22);
}

.mg-stars-hero-title {
  font-size: 1.48rem;
  font-weight: 800;
  color: var(--mg-text-main);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.mg-stars-hero-desc {
  font-size: 0.88rem;
  color: #a1a1aa;
  max-width: 380px;
  line-height: 1.45;
  margin: 0;
}

/* Balance Card (Solid Glass Background, Theme Synced) */
.mg-stars-balance-card-v2 {
  position: relative;
  background: var(--mg-bg-card);
  border: 1px solid var(--mg-border-card);
  border-radius: 22px;
  padding: 30px 20px 24px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: var(--mg-shadow-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.mg-stars-main-balance-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mg-stars-card-icon {
  width: 26px;
  height: 26px;
  fill: var(--mg-accent-primary);
}

.mg-stars-card-val {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--mg-text-main);
  line-height: 1;
  letter-spacing: -0.02em;
}

.mg-stars-card-sub {
  font-size: 0.84rem;
  color: var(--mg-text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* Buttons Row */
.mg-stars-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  max-width: 400px;
}

.mg-stars-topup-btn {
  flex: 1;
  background: var(--mg-accent-primary);
  color: var(--mg-accent-primary-text);
  font-weight: 700;
  font-size: 0.94rem;
  border-radius: 14px;
  border: none;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.mg-stars-topup-btn:hover {
  background: var(--mg-accent-primary-hover);
  transform: translateY(-1px);
}

.mg-stars-topup-btn:active {
  transform: scale(0.98);
}

.mg-stars-stats-btn {
  flex: 1;
  background: var(--mg-bg-card-elevated);
  color: var(--mg-text-main);
  font-weight: 700;
  font-size: 0.94rem;
  border-radius: 14px;
  border: 1px solid var(--mg-border-card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-stars-stats-btn:hover {
  background: var(--mg-bg-surface-hover);
  border-color: var(--mg-border-hover);
  transform: translateY(-1px);
}

.mg-stars-stats-btn:active {
  transform: scale(0.98);
}

/* 2 Action Feature Cards */
.mg-stars-action-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.mg-stars-action-card {
  background: var(--mg-bg-card);
  border: 1px solid var(--mg-border-card);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--mg-shadow-glass);
}

.mg-stars-action-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mg-action-icon-user {
  background: rgba(255, 255, 255, 0.05);
  color: var(--mg-text-secondary);
}

.mg-action-icon-tg {
  background: rgba(var(--mg-accent-rgb), 0.12);
  color: var(--mg-accent-primary);
}

.mg-stars-action-info {
  flex: 1;
  min-width: 0;
}

.mg-stars-action-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--mg-text-main);
  margin-bottom: 3px;
}

.mg-stars-action-desc {
  font-size: 0.8rem;
  color: var(--mg-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-stars-action-btn {
  background: var(--mg-bg-card-elevated);
  border: 1px solid var(--mg-border-card);
  color: var(--mg-text-main);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 8px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  flex-shrink: 0;
}

.mg-stars-action-btn:hover {
  background: #272727;
  border-color: #3f3f46;
}

.mg-stars-action-badge-done {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 5px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* Operations History Section with Tabs */
.mg-stars-history-card {
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mg-stars-history-tabs {
  display: flex;
  gap: 20px;
  padding: 16px 18px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mg-stars-hist-tab {
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  color: var(--mg-text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 0 14px 0;
  cursor: pointer;
  position: relative;
  transition: color var(--mg-trans-fast);
}

.mg-stars-hist-tab:hover {
  color: var(--mg-text-secondary);
}

.mg-stars-hist-tab.active {
  color: var(--mg-text-main);
}

.mg-stars-hist-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--mg-text-main);
  border-radius: 2px;
}

.mg-stars-tx-list {
  display: flex;
  flex-direction: column;
}

.mg-stars-tx-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--mg-trans-fast);
}

.mg-stars-tx-item:last-child {
  border-bottom: none;
}

.mg-stars-tx-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.mg-stars-tx-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mg-tx-icon-star {
  background: #241407;
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.mg-tx-icon-trophy {
  background: #221c07;
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.mg-stars-tx-info {
  flex: 1;
  min-width: 0;
}

.mg-stars-tx-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mg-text-main);
  margin-bottom: 2px;
}

.mg-stars-tx-sub {
  font-size: 0.78rem;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.mg-stars-tx-date {
  font-size: 0.74rem;
  color: #52525b;
}

.mg-stars-tx-amount {
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mg-tx-amount-in {
  color: #10b981;
}

.mg-tx-amount-out {
  color: #f97316;
}

/* Stars Top-Up Modal */
.mg-stars-topup-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mg-stars-pack-item {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transition: all var(--mg-trans-fast);
}

.mg-stars-pack-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: #1c1c20;
}

.mg-stars-pack-item.is-disabled,
.mg-stars-pack-item[data-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed !important;
}

.mg-stars-pack-item.is-disabled:hover,
.mg-stars-pack-item[data-disabled="true"]:hover {
  background: #18181b !important;
  border-color: #27272a !important;
  transform: none !important;
}

.mg-pack-featured {
  border-color: rgba(255, 255, 255, 0.16);
}

.mg-stars-pack-item .mg-pack-badge {
  position: absolute;
  top: -8px;
  right: 14px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: none;
}

.mg-stars-pack-item .mg-pack-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mg-pack-buy-action-btn {
  background: var(--mg-accent-primary);
  color: var(--mg-accent-primary-text);
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 7px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-pack-buy-action-btn:hover {
  background: var(--mg-accent-primary-hover);
  transform: translateY(-1px);
}

.mg-pack-buy-action-btn:active {
  transform: scale(0.96);
}

.mg-pack-buy-action-btn:disabled,
.mg-pack-buy-action-btn.is-disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--mg-text-muted) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
  transform: none !important;
}

.mg-stars-unavailable-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  margin-bottom: 14px;
  color: #fca5a5;
  font-size: 0.84rem;
  line-height: 1.4;
}

/* ==========================================================================
   6. BOTS VIEW (Mini-Apps Directory)
   ========================================================================== */
.mg-bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.mg-bot-card {
  background: var(--mg-bg-card);
  backdrop-filter: var(--mg-glass-blur);
  -webkit-backdrop-filter: var(--mg-glass-blur);
  border-radius: var(--mg-radius-card);
  border: 1px solid var(--mg-border-card);
  box-shadow: var(--mg-shadow-glass), var(--mg-inner-bevel);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--mg-trans-fast);
}

.mg-bot-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.mg-bot-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mg-bot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

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

.mg-bot-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mg-text-main);
  margin-bottom: 2px;
}

.mg-bot-handle {
  font-size: 0.76rem;
  color: #38bdf8;
}

.mg-bot-desc {
  font-size: 0.82rem;
  color: var(--mg-text-muted);
  line-height: 1.4;
  flex: 1;
}

.mg-bot-launch-btn {
  width: 100%;
  padding: 8px 14px;
  border-radius: var(--mg-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  text-align: center;
}

.mg-bot-launch-btn:hover {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
}

/* Bot Mini-App Modal Window */
.mg-miniapp-modal-content {
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@keyframes mgFadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsiveness for Views (Communities, Studio, Stars, Bots, Modals) */
@media (max-width: 768px) {
  .mg-communities-grid,
  .mg-bots-grid {
    grid-template-columns: 1fr;
  }

  .mg-stars-packages-grid {
    grid-template-columns: 1fr;
  }

  .mg-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .mg-stars-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
  }

  .mg-miniapp-modal-content,
  .mg-modal-window,
  .mg-db-modal-window,
  .mg-delete-modal-card {
    width: min(480px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    margin: 12px auto;
  }
}

/* ==========================================================================
   Settings View & Account Deletion (Pure Black Liquid Glass)
   ========================================================================== */
.mg-settings-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 0 40px 0;
}

.mg-settings-card {
  background: rgba(13, 14, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--mg-radius-card);
  padding: 20px 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color var(--mg-trans-fast), box-shadow var(--mg-trans-fast);
}

.mg-settings-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.mg-settings-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.mg-settings-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.mg-settings-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mg-text-main);
  margin: 0 0 2px 0;
}

.mg-settings-card-desc {
  font-size: 0.8rem;
  color: var(--mg-text-muted);
  margin: 0;
}

/* User Account Info inside Settings */
.mg-settings-user-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  margin-bottom: 16px;
}

.mg-settings-avatar-box {
  flex-shrink: 0;
}

.mg-settings-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: block;
}

.mg-settings-avatar-fallback {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #1a1a1c;
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mg-text-muted);
}

.mg-settings-user-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mg-settings-user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mg-settings-user-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mg-text-main);
}

.mg-settings-user-handle {
  font-size: 0.84rem;
  color: var(--mg-text-muted);
}

.mg-settings-user-email {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.4);
}

.mg-settings-guest-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  margin-bottom: 16px;
}

.mg-settings-guest-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mg-text-muted);
  flex-shrink: 0;
}

.mg-settings-guest-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mg-settings-guest-text strong {
  font-size: 0.95rem;
  color: var(--mg-text-main);
}

.mg-settings-guest-text span {
  font-size: 0.8rem;
  color: var(--mg-text-muted);
}

.mg-settings-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mg-settings-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--mg-btn-glass-bg);
  border: 1px solid var(--mg-border-card);
  color: var(--mg-text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-settings-action-btn:hover {
  background: var(--mg-bg-surface-hover);
  border-color: var(--mg-border-hover);
  transform: translateY(-1px);
  color: var(--mg-text-main);
}

.mg-settings-action-btn.mg-btn-logout-variant:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
}

/* Option List & Items */
.mg-settings-option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mg-settings-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--mg-glass-pill-bg);
  border: 1px solid var(--mg-border-subtle);
  transition: all var(--mg-trans-fast);
}

.mg-settings-option-item:hover {
  background: var(--mg-bg-surface-hover);
  border-color: var(--mg-border-card);
}

.mg-settings-option-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mg-settings-option-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mg-text-main);
}

.mg-settings-option-sub {
  font-size: 0.78rem;
  color: var(--mg-text-muted);
}

.mg-settings-theme-tag {
  font-size: 0.74rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Color Scheme Selection in Settings */
.mg-color-schemes-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.mg-color-scheme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--mg-radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--mg-text-secondary);
  border: 1px solid var(--mg-border-card);
  background: var(--mg-glass-pill-bg);
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  white-space: nowrap;
  user-select: none;
}

.mg-color-scheme-btn:hover {
  color: var(--mg-text-main);
  background: var(--mg-bg-surface-hover);
  border-color: var(--mg-border-hover);
  transform: translateY(-1px);
}

.mg-color-scheme-btn.active {
  background: var(--mg-accent-primary) !important;
  color: var(--mg-accent-primary-text) !important;
  border-color: var(--mg-accent-primary) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  font-weight: 600;
}

.mg-scheme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.mg-scheme-dot.dot-monochrome,
.mg-scheme-dot.dot-dark {
  background: #09090b;
  border-color: #ffffff;
}

.mg-scheme-dot.dot-light {
  background: #ffffff;
  border-color: #09090b;
}

.mg-color-scheme-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  display: none;
}

.mg-color-scheme-btn.active .mg-color-scheme-badge {
  display: inline-block !important;
}

[data-theme="dark"] .mg-color-scheme-btn.active .mg-color-scheme-badge,
[data-color-scheme="monochrome"] .mg-color-scheme-btn.active .mg-color-scheme-badge {
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
}

.mg-settings-subtle-btn {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--mg-btn-glass-bg);
  border: 1px solid var(--mg-border-card);
  color: var(--mg-text-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.mg-settings-subtle-btn:hover {
  background: var(--mg-bg-surface-hover);
  border-color: var(--mg-border-hover);
  color: var(--mg-text-main);
  transform: translateY(-1px);
}

.mg-status-online-dot,
.mg-status-offline-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
}

.mg-status-online-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.mg-status-offline-dot {
  background: #71717a;
}

/* Danger Zone Card - Distinct Red Liquid Glass */
.mg-settings-danger-card {
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.22) 0%, rgba(136, 19, 19, 0.16) 100%), #140809 !important;
  box-shadow: 0 4px 28px rgba(220, 38, 38, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.mg-settings-danger-card:hover {
  border-color: rgba(239, 68, 68, 0.65) !important;
  box-shadow: 0 6px 36px rgba(220, 38, 38, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

.mg-settings-danger-icon {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #fca5a5 !important;
}

.mg-settings-danger-title {
  color: #fca5a5 !important;
}

.mg-settings-danger-text {
  font-size: 0.84rem;
  color: #fecaca;
  line-height: 1.55;
  margin: 0 0 16px 0;
  opacity: 0.88;
}

.mg-btn-danger-delete {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: #dc2626 !important;
  border: 1px solid #ef4444 !important;
  color: #ffffff !important;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

.mg-btn-danger-delete:hover:not(:disabled) {
  background: #b91c1c !important;
  border-color: #f87171 !important;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.65) !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   Account Deletion Modal Dialog
   ========================================================================== */
#mg-delete-account-modal {
  z-index: 99999 !important;
}

.mg-delete-modal-card {
  position: relative;
  background: #09090b !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.96), 0 0 32px rgba(239, 68, 68, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: mgFadeInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mg-delete-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.mg-delete-modal-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-delete-modal-close-btn {
  background: transparent;
  border: none;
  color: var(--mg-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--mg-trans-fast);
}

.mg-delete-modal-close-btn:hover {
  color: var(--mg-text-main);
  background: rgba(255, 255, 255, 0.08);
}

.mg-delete-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mg-delete-modal-title {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--mg-text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.mg-delete-modal-warning {
  font-size: 0.94rem;
  color: #f87171;
  font-weight: 600;
  margin: 0;
}

.mg-delete-modal-subtext {
  font-size: 0.84rem;
  color: var(--mg-text-muted);
  line-height: 1.5;
  margin: 0;
}

.mg-delete-confirmation-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  margin-top: 6px;
}

.mg-delete-label {
  display: block;
  font-size: 0.82rem;
  color: var(--mg-text-secondary);
  margin-bottom: 8px;
}

.mg-delete-target-word {
  color: #f87171;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.88rem;
  user-select: all;
}

.mg-delete-input {
  width: 100%;
  padding: 10px 14px;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.92rem;
  transition: all var(--mg-trans-fast);
  outline: none;
}

.mg-delete-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.mg-delete-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.mg-delete-btn-cancel {
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--mg-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-delete-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--mg-text-main);
}

.mg-delete-btn-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  background: #dc2626;
  border: 1px solid #ef4444;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
  transition: all var(--mg-trans-fast);
}

.mg-delete-btn-confirm.is-active {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.55);
}

.mg-delete-btn-confirm.is-active:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* ==========================================================================
   Admin Panel Modal: Verification Management & User Controls
   Pure Black Liquid Glass styling
   ========================================================================== */
.mg-admin-modal-card {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 136, 204, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mgModalCardIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mg-admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.mg-admin-modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mg-admin-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 136, 204, 0.12);
  border: 1px solid rgba(0, 136, 204, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mg-admin-modal-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--mg-text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.mg-admin-modal-sub {
  font-size: 0.78rem;
  color: var(--mg-text-muted);
  margin: 2px 0 0;
}

.mg-admin-modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow: hidden;
}

/* Search Bar */
.mg-admin-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mg-admin-search-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.mg-admin-search-wrap svg {
  position: absolute;
  left: 12px;
  color: var(--mg-text-muted);
  pointer-events: none;
}

.mg-admin-search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--mg-trans-fast), box-shadow var(--mg-trans-fast);
}

.mg-admin-search-input:focus {
  border-color: #0088cc;
  box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.2);
}

.mg-admin-stats-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mg-text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Users List Container */
.mg-admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 400px;
  padding-right: 4px;
}

.mg-admin-users-list::-webkit-scrollbar {
  width: 5px;
}

.mg-admin-users-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.mg-admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  transition: all var(--mg-trans-fast);
}

.mg-admin-user-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}

.mg-admin-user-row.is-verified {
  border-color: rgba(0, 136, 204, 0.28);
  background: rgba(0, 136, 204, 0.04);
}

.mg-admin-user-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.mg-admin-user-avatar-wrap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #111113;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mg-admin-user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-admin-user-avatar-fallback {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mg-text-muted);
}

.mg-admin-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.mg-admin-user-names {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mg-admin-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mg-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-admin-uid-pill {
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0 5px;
  border-radius: 4px;
}

.mg-admin-user-handle {
  font-size: 0.76rem;
  color: var(--mg-text-muted);
}

.mg-admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

.mg-admin-verify-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  white-space: nowrap;
}

.mg-admin-btn-grant {
  background: rgba(0, 136, 204, 0.15);
  border: 1px solid rgba(0, 136, 204, 0.35);
  color: #38bdf8;
}

.mg-admin-btn-grant:hover {
  background: #0088cc;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.mg-admin-btn-revoke {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.mg-admin-btn-revoke:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.mg-admin-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  transition: all var(--mg-trans-fast);
  white-space: nowrap;
}

.mg-admin-delete-btn:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.mg-admin-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--mg-text-muted);
  gap: 8px;
  font-size: 0.88rem;
}

.mg-admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
}

.mg-admin-btn-done {
  padding: 8px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--mg-text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-admin-btn-done:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

#mg-admin-delete-modal {
  z-index: 1200 !important;
}

/* ==========================================================================
   Header Theme Toggle Buttons & Sun/Moon Icons
   ========================================================================== */
.mg-theme-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--mg-trans-fast), background var(--mg-trans-fast), border-color var(--mg-trans-fast);
}

.mg-theme-toggle-btn:hover {
  transform: translateY(-1px);
}

.mg-theme-toggle-btn:active {
  transform: scale(0.95);
}

/* Dark mode (default): show moon, hide sun */
.mg-theme-icon-moon {
  display: block;
}
.mg-theme-icon-sun {
  display: none;
}

/* Light mode: show sun, hide moon */
[data-theme="light"] .mg-theme-icon-moon,
[data-color-scheme="light"] .mg-theme-icon-moon {
  display: none !important;
}
[data-theme="light"] .mg-theme-icon-sun,
[data-color-scheme="light"] .mg-theme-icon-sun {
  display: block !important;
  color: #d97706;
}

/* ==========================================================================
   Admin Grant Stars Modal & Action Button (No glows, clean glass)
   ========================================================================== */
.mg-admin-stars-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fbbf24;
  transition: all var(--mg-trans-fast);
  white-space: nowrap;
}

.mg-admin-stars-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fef08a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

#mg-admin-grant-stars-modal {
  z-index: 1300 !important;
}

.mg-admin-stars-card {
  width: 460px;
  max-width: min(460px, calc(100vw - 32px));
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mgModalSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mg-admin-stars-header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 14px;
}

.mg-admin-stars-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mg-admin-stars-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mg-admin-stars-target-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 0.88rem;
}

.mg-admin-stars-target-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mg-admin-stars-target-label {
  color: var(--mg-text-muted);
}

.mg-admin-stars-target-user {
  color: var(--mg-text-main);
  font-weight: 700;
}

.mg-admin-stars-current-bal {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--mg-text-muted);
}

.mg-admin-stars-current-bal strong {
  color: #fbbf24;
  font-weight: 700;
}

.mg-admin-stars-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mg-admin-stars-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mg-text-secondary);
}

.mg-admin-stars-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mg-admin-stars-input-wrap svg {
  position: absolute;
  left: 12px;
  pointer-events: none;
}

.mg-admin-stars-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color var(--mg-trans-fast), box-shadow var(--mg-trans-fast);
}

.mg-admin-stars-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.mg-admin-stars-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mg-admin-stars-preset-btn {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--mg-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-admin-stars-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--mg-text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.mg-admin-stars-preset-btn.is-active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.mg-admin-stars-text-input {
  width: 100%;
  padding: 9px 12px;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--mg-trans-fast), box-shadow var(--mg-trans-fast);
}

.mg-admin-stars-text-input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.mg-admin-stars-footer {
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.mg-admin-stars-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  background: #f59e0b;
  border: 1px solid #d97706;
  color: #09090b;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: all var(--mg-trans-fast);
}

.mg-admin-stars-submit-btn:hover {
  background: #fbbf24;
  transform: translateY(-1px);
}

.mg-admin-stars-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Light theme overrides for admin stars modal */
[data-theme="light"] .mg-admin-stars-card,
[data-color-scheme="light"] .mg-admin-stars-card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16) !important;
}

[data-theme="light"] .mg-admin-stars-header,
[data-color-scheme="light"] .mg-admin-stars-header,
[data-theme="light"] .mg-admin-stars-footer,
[data-color-scheme="light"] .mg-admin-stars-footer {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .mg-admin-stars-target-box,
[data-color-scheme="light"] .mg-admin-stars-target-box {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .mg-admin-stars-target-user,
[data-color-scheme="light"] .mg-admin-stars-target-user {
  color: #09090b !important;
}

[data-theme="light"] .mg-admin-stars-input,
[data-color-scheme="light"] .mg-admin-stars-input,
[data-theme="light"] .mg-admin-stars-text-input,
[data-color-scheme="light"] .mg-admin-stars-text-input {
  background: #f4f4f7 !important;
  color: #09090b !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .mg-admin-stars-preset-btn,
[data-color-scheme="light"] .mg-admin-stars-preset-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #3f3f46 !important;
}

[data-theme="light"] .mg-admin-stars-preset-btn.is-active,
[data-color-scheme="light"] .mg-admin-stars-preset-btn.is-active {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  color: #b45309 !important;
}

/* ==========================================================================
   Change Password Modal (Pure Black Liquid Glass)
   ========================================================================== */
.mg-change-pwd-modal-card {
  width: 100%;
  max-width: 440px;
  background: rgba(14, 15, 19, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mg-modal-overlay.open .mg-change-pwd-modal-card {
  transform: scale(1);
}

.mg-change-pwd-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mg-change-pwd-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mg-change-pwd-title {
  margin: 0 0 2px 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.mg-change-pwd-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--mg-text-muted, #71717a);
}

.mg-change-pwd-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mg-change-pwd-account-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  font-size: 0.82rem;
}

.mg-change-pwd-account-label {
  color: var(--mg-text-muted, #71717a);
}

.mg-change-pwd-account-user {
  color: #38bdf8;
  font-weight: 600;
  font-family: monospace;
}

.mg-change-pwd-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  color: #bae6fd;
  font-size: 0.82rem;
  line-height: 1.4;
}

.mg-change-pwd-notice svg {
  flex-shrink: 0;
}

.mg-change-pwd-forgot-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.76rem;
  color: #38bdf8;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.18s;
}

.mg-change-pwd-forgot-link:hover {
  opacity: 0.8;
}

.mg-change-pwd-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.82rem;
  line-height: 1.35;
}

.mg-change-pwd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mg-change-pwd-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mg-text-secondary, #a1a1aa);
}

.mg-change-pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #0c0d10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.mg-change-pwd-input-wrap:focus-within {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
  background: #111216;
}

.mg-change-pwd-input-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  flex-shrink: 0;
}

.mg-change-pwd-input-wrap:focus-within .mg-change-pwd-input-icon {
  color: #38bdf8;
}

.mg-change-pwd-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 0.88rem;
  padding: 0 8px 0 0;
}

.mg-change-pwd-input::placeholder {
  color: var(--mg-text-muted, #71717a);
}

.mg-change-pwd-eye-btn {
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  color: #71717a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s;
  flex-shrink: 0;
}

.mg-change-pwd-eye-btn:hover {
  color: #ffffff;
}

.mg-change-pwd-helper {
  font-size: 0.74rem;
  color: var(--mg-text-muted, #71717a);
}

.mg-change-pwd-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.mg-change-pwd-btn-cancel {
  padding: 9px 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--mg-text-secondary, #a1a1aa);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}

.mg-change-pwd-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.mg-change-pwd-btn-submit {
  padding: 9px 20px;
  border-radius: 9999px;
  background: #0088cc;
  border: 1px solid #38bdf8;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.35);
}

.mg-change-pwd-btn-submit:hover {
  background: #0099e6;
  border-color: #7dd3fc;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 136, 204, 0.5);
}

.mg-change-pwd-btn-submit:active {
  transform: translateY(0);
}

.mg-change-pwd-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}
