/* ==========================================================================
   MetaGram - Feed & Post Cards (Monochrome Liquid Glass)
   ========================================================================== */

/* Feed Container */
.mg-posts-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Post Card */
.mg-post-card {
  background: var(--mg-bg-card);
  backdrop-filter: var(--mg-glass-blur);
  -webkit-backdrop-filter: var(--mg-glass-blur);
  border: 1px solid var(--mg-border-card);
  border-radius: var(--mg-radius-card);
  padding: 18px 20px;
  box-shadow: var(--mg-shadow-glass);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
  transition: border-color var(--mg-trans-fast), background var(--mg-trans-fast);
}

.mg-post-card:hover {
  border-color: var(--mg-border-hover);
}

/* Elevate post card when its options menu is open so subsequent cards cannot overlap or clip it */
.mg-post-card.has-open-menu,
.mg-post-card:has(.mg-post-dropdown.open) {
  z-index: 50;
}

/* Post Header */
.mg-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mg-post-author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: opacity var(--mg-trans-fast);
}

.mg-post-author-row:hover .mg-post-author-name {
  color: var(--mg-text-main);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mg-post-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--mg-radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--mg-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.mg-post-avatar svg {
  width: 100%;
  height: 100%;
}

.mg-post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mg-post-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.mg-post-author-name {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--mg-text-main);
}

.mg-post-handle {
  font-size: 0.82rem;
  color: var(--mg-text-muted);
}

.mg-post-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--mg-text-muted);
}

.mg-post-edited-badge {
  font-size: 0.72rem;
  color: var(--mg-text-dim);
  font-style: italic;
}

/* Post Menu & Options Dropdown */
.mg-post-menu-wrap {
  position: relative;
  z-index: 2;
}

.mg-post-card.has-open-menu .mg-post-menu-wrap,
.mg-post-menu-wrap:has(.mg-post-dropdown.open) {
  z-index: 60;
}

.mg-post-more-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--mg-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mg-text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all var(--mg-trans-fast);
}

.mg-post-more-btn:hover {
  color: var(--mg-text-main);
  background: rgba(255, 255, 255, 0.06);
}

.mg-post-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 185px;
  background: rgba(14, 14, 16, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--mg-radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 100;
}

.mg-post-dropdown.open {
  display: flex;
  animation: mgDropdownFade 0.15s ease-out;
}

@keyframes mgDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mg-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--mg-radius-xs);
  font-size: 0.86rem;
  color: #c4c4c8;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-dropdown-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #8e8e93;
  transition: color var(--mg-trans-fast);
}

.mg-dropdown-item:hover {
  background: var(--mg-bg-surface-hover);
  color: var(--mg-text-main);
}

.mg-dropdown-item:hover svg {
  color: var(--mg-text-main);
}

.mg-dropdown-item.danger {
  color: #e57373;
}

.mg-dropdown-item.danger svg {
  color: #e57373;
}

.mg-dropdown-item.danger:hover {
  background: rgba(229, 115, 115, 0.12);
  color: #ff8a80;
}

.mg-dropdown-item.danger:hover svg {
  color: #ff8a80;
}

/* Post Content & Media */
.mg-post-content {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--mg-text-main);
  word-break: break-word;
  white-space: pre-wrap;
}

.mg-hashtag {
  color: #9da3af;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--mg-trans-fast);
}

.mg-hashtag:hover {
  color: #e2e5ec;
  text-decoration: underline;
}

.mg-post-media {
  margin-top: 4px;
  border-radius: var(--mg-radius-md);
  overflow: hidden;
  border: 1px solid var(--mg-border-subtle);
  background: rgba(0, 0, 0, 0.4);
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-post-media img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* Post Actions Footer */
.mg-post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 2px;
}

.mg-post-action-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mg-post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--mg-text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--mg-radius-sm);
  transition: all var(--mg-trans-fast);
}

.mg-post-action:hover {
  color: var(--mg-text-main);
  background: rgba(255, 255, 255, 0.04);
}

.mg-post-action svg {
  width: 17px;
  height: 17px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Liked state */
.mg-post-action.liked {
  color: #d1d5db;
}

.mg-post-action.liked svg {
  fill: currentColor;
  transform: scale(1.15);
}

.mg-post-action.bookmarked {
  color: #d1d5db;
}

.mg-post-action.bookmarked svg {
  fill: currentColor;
}

/* Edit Mode Inside Card */
.mg-post-edit-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.mg-post-edit-textarea {
  width: 100%;
  min-height: 60px;
  max-height: 400px;
  padding: 10px 14px;
  background: rgba(8, 9, 11, 0.8);
  border: 1px solid var(--mg-border-hover);
  border-radius: var(--mg-radius-sm);
  color: var(--mg-text-main);
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.5;
  resize: none;
  overflow-y: hidden;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--mg-trans-fast);
}

.mg-post-edit-textarea:focus {
  border-color: var(--mg-border-focus);
}

.mg-post-edit-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mg-post-btn-cancel {
  background: transparent;
  border: 1px solid var(--mg-border-subtle);
  color: var(--mg-text-muted);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--mg-radius-pill);
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

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

.mg-post-btn-save {
  background: var(--mg-btn-glass-bg);
  border: 1px solid var(--mg-btn-glass-border);
  color: var(--mg-btn-glass-text);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--mg-radius-pill);
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-post-btn-save:hover {
  background: var(--mg-btn-glass-hover-bg);
  border-color: var(--mg-btn-glass-hover-border);
  color: var(--mg-btn-glass-hover-text);
}

/* Composer Attachment Previews */
.mg-compose-preview-wrap {
  position: relative;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mg-compose-preview-box {
  position: relative;
  border-radius: var(--mg-radius-md);
  overflow: hidden;
  border: 1px solid var(--mg-border-subtle);
  background: rgba(0, 0, 0, 0.5);
}

.mg-compose-preview-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.mg-compose-preview-video {
  width: 100%;
  max-height: 260px;
  background: #000;
  display: block;
  border-radius: var(--mg-radius-md);
}

.mg-compose-preview-audio-box {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--mg-radius-md);
}

.mg-compose-audio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 32px;
}

.mg-compose-audio-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--mg-radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.mg-compose-audio-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.mg-compose-audio-player {
  width: 100%;
  height: 32px;
  outline: none;
}

.mg-compose-remove-preview {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: var(--mg-radius-pill);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--mg-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--mg-trans-fast);
}

.mg-compose-remove-preview:hover {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.5);
}

/* Poll Creator Box */
.mg-compose-poll-box {
  background: rgba(14, 14, 16, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--mg-radius-md);
  padding: 14px 16px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: mgFadeDown 0.18s ease-out;
}

.mg-poll-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mg-poll-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--mg-text-main);
}

.mg-poll-box-title svg {
  color: #a1a1aa;
}

.mg-poll-box-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--mg-trans-fast);
}

.mg-poll-box-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.mg-poll-question-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--mg-radius-sm);
  padding: 9px 12px;
  font-size: 0.88rem;
  color: var(--mg-text-main);
  outline: none;
  transition: border-color var(--mg-trans-fast);
}

.mg-poll-question-input:focus {
  border-color: var(--mg-border-focus);
}

.mg-poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mg-poll-opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mg-poll-opt-num {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-poll-opt-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--mg-radius-sm);
  padding: 7px 12px;
  font-size: 0.85rem;
  color: var(--mg-text-main);
  outline: none;
  transition: border-color var(--mg-trans-fast);
}

.mg-poll-opt-input:focus {
  border-color: var(--mg-border-focus);
}

.mg-poll-opt-remove {
  background: transparent;
  border: none;
  color: #71717a;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: color var(--mg-trans-fast);
}

.mg-poll-opt-remove:hover {
  color: #ef4444;
}

.mg-poll-box-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mg-poll-add-btn {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #a1a1aa;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--mg-radius-pill);
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-poll-add-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--mg-text-main);
  background: rgba(255, 255, 255, 0.04);
}

/* Tool Popups (Emoji & More) */
.mg-tool-popup-anchor {
  position: relative;
  display: inline-flex;
}

/* Emoji Picker Dropdown */
.mg-emoji-dropdown {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 320px;
  background: rgba(13, 13, 15, 0.98);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--mg-radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 150;
  animation: mgDropdownFade 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.mg-emoji-header {
  display: flex;
  align-items: center;
}

.mg-emoji-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--mg-radius-sm);
  padding: 6px 10px;
}

.mg-emoji-search-box svg {
  color: #71717a;
  flex-shrink: 0;
}

.mg-emoji-search-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.82rem;
  color: var(--mg-text-main);
}

.mg-emoji-categories {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mg-emoji-cat-btn {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  border-radius: var(--mg-radius-xs);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
  opacity: 0.6;
}

.mg-emoji-cat-btn:hover {
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.06);
}

.mg-emoji-cat-btn.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 2px solid #fff;
  border-radius: var(--mg-radius-xs) var(--mg-radius-xs) 0 0;
}

.mg-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 2px;
}

.mg-emoji-item {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  border-radius: var(--mg-radius-xs);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background 0.12s ease;
  user-select: none;
}

.mg-emoji-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.22);
}

/* More Actions Dropdown */
.mg-compose-more-dropdown {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: rgba(14, 14, 16, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--mg-radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 150;
  animation: mgDropdownFade 0.15s ease-out;
}

.mg-more-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--mg-radius-xs);
  font-size: 0.85rem;
  color: #d4d4d8;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all var(--mg-trans-fast);
}

.mg-more-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.mg-more-item-icon {
  width: 18px;
  text-align: center;
  font-weight: 700;
  color: #a1a1aa;
}

.mg-more-dropdown-item.danger {
  color: #f87171;
}

.mg-more-dropdown-item.danger .mg-more-item-icon {
  color: #f87171;
}

.mg-more-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

/* Feed Rendered Video & Audio & Poll Cards */
.mg-post-media video {
  width: 100%;
  max-height: 480px;
  border-radius: var(--mg-radius-md);
  background: #000;
  display: block;
}

.mg-post-audio-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--mg-radius-md);
  margin-top: 4px;
}

.mg-post-audio-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: var(--mg-radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.mg-post-audio-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.mg-post-audio-elem {
  width: 100%;
  height: 32px;
  outline: none;
}

/* Interactive Poll Card in Feed */
.mg-post-poll-card {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--mg-radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mg-post-poll-question {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--mg-text-main);
  line-height: 1.4;
}

.mg-post-poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mg-post-poll-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--mg-radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  transition: all var(--mg-trans-fast);
}

.mg-post-poll-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.mg-post-poll-option.voted {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.mg-post-poll-option-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--mg-radius-sm);
  z-index: 0;
  pointer-events: none;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mg-post-poll-option.voted .mg-post-poll-option-progress {
  background: rgba(255, 255, 255, 0.18);
}

.mg-post-poll-option-text {
  position: relative;
  z-index: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--mg-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mg-post-poll-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #71717a;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
}

.mg-post-poll-option.voted .mg-post-poll-radio {
  border-color: #fff;
}

.mg-post-poll-option.voted .mg-post-poll-radio::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.mg-post-poll-option-pct {
  position: relative;
  z-index: 1;
  font-size: 0.84rem;
  font-weight: 600;
  color: #a1a1aa;
}

.mg-post-poll-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #71717a;
  padding-top: 2px;
}

/* Toast Notification (Monochrome Glass) */
.mg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(14, 14, 16, 0.96);
  backdrop-filter: var(--mg-glass-blur);
  -webkit-backdrop-filter: var(--mg-glass-blur);
  border: 1px solid var(--mg-border-hover);
  border-radius: var(--mg-radius-pill);
  padding: 10px 22px;
  font-size: 0.88rem;
  color: var(--mg-text-main);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
}

.mg-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =============================================================================
   Comments Section (Dark Liquid Glass Design)
   ============================================================================= */
.mg-post-comments-drawer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: mgFadeDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mgFadeDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.mg-comments-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mg-text-muted);
}

.mg-comments-count-badge {
  color: var(--mg-text-main);
  font-weight: 700;
}

.mg-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.mg-comments-empty {
  padding: 16px 10px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--mg-text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--mg-radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.06);
}

.mg-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--mg-radius-sm);
  transition: background 0.15s ease;
}

.mg-comment-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

.mg-comment-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: #141416;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-comment-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mg-text-muted);
  background: #18181b;
}

.mg-comment-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mg-comment-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mg-comment-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mg-text-main);
  cursor: pointer;
}

.mg-comment-name:hover {
  text-decoration: underline;
}

.mg-comment-handle {
  font-size: 0.75rem;
  color: var(--mg-text-muted);
}

.mg-comment-time {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  margin-left: auto;
}

.mg-comment-delete-btn {
  background: transparent;
  border: none;
  color: var(--mg-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: all 0.15s ease;
}

.mg-comment-delete-btn:hover {
  opacity: 1;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.mg-comment-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  word-break: break-word;
  white-space: pre-wrap;
}

/* Comment Form */
.mg-comment-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.mg-comment-form-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mg-comment-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: var(--mg-radius-pill);
  padding: 2px 4px 2px 8px;
  transition: border-color 0.2s, background 0.2s;
}

.mg-comment-input-box:focus-within {
  border-color: transparent;
  background: transparent;
}

.mg-comment-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--mg-text-main);
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  padding: 8px 0;
}

.mg-comment-input::placeholder {
  color: var(--mg-text-muted);
}

.mg-comment-send-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: none;
  background: var(--mg-text-main);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.mg-comment-send-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.mg-comment-send-btn:active {
  transform: scale(0.95);
}

.mg-verified-badge-xs {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

