/* ========== Settings Modal (Minimal) ========== */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}

.settings-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal card ── */
.settings-page {
  position: fixed;
  z-index: 1000;
  top: 50%;
  left: 50%;
  width: calc(100% - 32px);
  max-width: 420px;
  max-height: 85vh;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16), 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s var(--ease), opacity .25s var(--ease);
}

.settings-page.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* ── Header ── */
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  flex-shrink: 0;
}

.settings-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-900);
}

.settings-back-btn {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.settings-back-btn:hover {
  background: var(--neutral-100);
  color: var(--ink-900);
  transform: none;
}

.settings-back-btn:active {
  background: var(--neutral-200);
  transform: none;
}

/* ── Body ── */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Section ── */
.settings-section {
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  margin-bottom: 16px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-400);
  letter-spacing: 0.3px;
  padding: 10px 16px 6px;
  background: var(--neutral-50);
  text-transform: none;
}

/* ── Item ── */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
  border-bottom: 1px solid var(--line-soft);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:hover {
  background: var(--neutral-50);
}

.settings-item:active {
  background: var(--neutral-100);
}

.settings-item-info {
  flex: 1;
  min-width: 0;
}

.settings-item-label {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-900);
  margin: 0 0 2px;
}

.settings-item-desc {
  font-size: 12.5px;
  color: var(--ink-400);
  line-height: 1.4;
  margin: 0;
}

/* ── Toggle Switch ── */
.settings-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 26px;
  background: var(--neutral-200);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.25s var(--ease);
  flex-shrink: 0;
}

.settings-toggle::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.25s var(--ease);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.settings-toggle:checked {
  background: var(--primary-600);
}

.settings-toggle:checked::before {
  left: 21px;
}

.settings-toggle:hover {
  background: var(--neutral-300, #bbb9b3);
}

.settings-toggle:checked:hover {
  background: var(--primary-700);
}

.settings-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 181, 97, 0.18);
}

/* ── Mobile: bottom sheet ── */
@media (max-width: 600px) {
  .settings-page {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    opacity: 1;
  }

  .settings-page.show {
    transform: translateY(0);
    opacity: 1;
  }

  .settings-body {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
