.message-notifications-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.message-notifications-label {
  display: inline-block;
  white-space: nowrap;
}

.message-notifications-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.message-notifications-popover {
  position: fixed;
  top: 58px;
  right: 16px;
  width: min(380px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
  z-index: 1600;
  display: none;
  overflow: hidden;
}

.message-notifications-popover[data-open="true"] {
  display: block;
}

.message-notifications-popover__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.message-notifications-popover__title {
  font-size: 0.98rem;
  font-weight: 800;
  margin: 0;
}

.message-notifications-popover__subtitle {
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
}

.message-notifications-popover__close {
  appearance: none;
  border: 0;
  background: #e2e8f0;
  color: #0f172a;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.message-notifications-popover__body {
  padding: 14px 18px 16px;
  display: grid;
  gap: 12px;
}

.message-notifications-popover__panel {
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(20, 184, 166, 0.03));
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.message-notifications-popover__panel--sound {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(96, 165, 250, 0.03));
  border-color: rgba(96, 165, 250, 0.2);
}

.message-notifications-popover__section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.message-notifications-popover__toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #334155;
}

.message-notifications-popover__toggle input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.message-notifications-popover__sound-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.message-notifications-popover__field {
  flex: 1 1 180px;
  display: grid;
  gap: 4px;
}

.message-notifications-popover__field-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.message-notifications-popover__select {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.88rem;
  color: #0f172a;
  background: #fff;
}

.message-notifications-popover__select:focus,
.message-notifications-popover__toggle input:focus {
  outline: 2px solid rgba(20, 184, 166, 0.45);
  outline-offset: 2px;
}

.message-notifications-popover__sound-status {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #475569;
}

.message-notifications-popover__status {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.message-notifications-popover__meta {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
}

.message-notifications-popover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-notifications-popover__button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
}

.message-notifications-popover__button--primary {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}

.message-notifications-popover__button--secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.message-notifications-popover__button:disabled {
  cursor: default;
  opacity: 0.65;
}

.message-notifications-popover__footnote {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748b;
}

@media (max-width: 640px) {
  .message-notifications-popover {
    left: 12px;
    right: 12px;
    top: 58px;
    width: auto;
  }

  .message-notifications-popover__actions {
    flex-direction: column;
  }

  .message-notifications-popover__button {
    width: 100%;
  }

  .message-notifications-popover__sound-row {
    flex-direction: column;
    align-items: stretch;
  }
}
