.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 205;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.settings-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.settings-modal {
  width: 100%;
  max-width: 420px;
  max-height: min(90vh, 640px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 1.75rem 1.5rem 1.5rem;
  position: relative;
}

.settings-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f0f2f5;
  color: #65676b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.settings-close:hover {
  background: #e4e6eb;
}

.settings-modal h2 {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
  color: #1c1e21;
}

.settings-section {
  margin-bottom: 1rem;
}

.settings-section > label,
.settings-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1c1e21;
  margin-bottom: 0.45rem;
}

.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.settings-avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  overflow: hidden;
  border: 2px solid #e4e6eb;
  flex-shrink: 0;
}

.settings-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-change-avatar-btn {
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: #f0f2f5;
  color: #1c1e21;
}

.settings-change-avatar-btn:hover {
  background: #e4e6eb;
}

.settings-field {
  margin-bottom: 1rem;
}

.settings-field textarea,
.settings-field select {
  width: 100%;
  border: 1px solid #dddfe2;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.settings-field textarea:focus,
.settings-field select:focus {
  border-color: #1877f2;
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.15);
}

.settings-toggle label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 500;
  cursor: pointer;
}

.settings-toggle input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.settings-section--privacy {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid #e4e6eb;
}

.settings-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1c1e21;
  margin: 0 0 0.75rem;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.settings-save-btn,
.settings-logout-btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.settings-save-btn {
  background: #1877f2;
  color: #fff;
}

.settings-save-btn:hover {
  background: #166fe5;
}

.settings-logout-btn {
  background: rgba(179, 45, 46, 0.1);
  color: #b32d2e;
}

.settings-logout-btn:hover {
  background: rgba(179, 45, 46, 0.16);
}
