/* ===== SETTINGS PAGE ===== */
.settings-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.settings-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.settings-page {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 54px;
  z-index: 25;
  background: #f5f5f5;
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.2,0.9,0.3,1), opacity 0.2s ease;
}
.settings-page.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.settings-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 24px 24px 0 0;
  padding: 0;
  pointer-events: none;
}
.settings-top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 16px;
  height: 52px;
  position: relative;
}
.settings-top-bar-title {
  font-size: 17px;
  font-weight: 500;
  color: #000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.settings-top-bar-title.visible {
  opacity: 1;
}
.settings-done-btn {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #2169eb;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.settings-done-btn:active {
  opacity: 0.8;
}
.settings-done-btn svg {
  width: 20px;
  height: 20px;
}
.settings-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.settings-content {
  padding: 0 16px 40px;
}
.settings-title {
  font-size: 34px;
  font-weight: 600;
  color: #000;
  padding: 4px 0 16px;
}
.settings-banner {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.settings-banner-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.settings-banner-icon svg {
  width: 40px;
  height: 40px;
}
.settings-banner-text {
  flex: 1;
  min-width: 0;
}
.settings-banner-title {
  font-size: 15px;
  font-weight: 500;
  color: #242424;
  line-height: 1.3;
}
.settings-banner-subtitle {
  font-size: 12px;
  color: #707070;
  line-height: 1.3;
  margin-top: 2px;
}
.settings-banner-close {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.settings-banner-close svg {
  width: 16px;
  height: 16px;
}
.settings-group {
  background: #fff;
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}
.settings-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.settings-row:active {
  background: rgba(0,0,0,0.04);
}
.settings-row-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-row-icon svg {
  width: 24px;
  height: 24px;
}
.settings-row-label {
  flex: 1;
  font-size: 17px;
  font-weight: 400;
  color: #242424;
  min-width: 0;
}
.settings-row-value {
  font-size: 15px;
  font-weight: 400;
  color: #707070;
  margin-right: 4px;
}
.settings-row-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-row-chevron svg {
  width: 14px;
  height: 14px;
}
.settings-row-divider {
  height: 0.5px;
  background: #e0e0e0;
  margin-left: 54px;
}
.settings-account-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}
.settings-account-row:active {
  background: rgba(0,0,0,0.04);
}
.settings-account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0078D4, #3E40C0);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}
.settings-account-avatar.small {
  width: 28px;
  height: 28px;
  font-size: 12px;
}
.settings-account-info {
  flex: 1;
  min-width: 0;
}
.settings-account-name {
  font-size: 17px;
  font-weight: 600;
  color: #141414;
  display: flex;
  align-items: center;
  gap: 6px;
}
.settings-account-detail {
  font-size: 12px;
  color: #6e6e6e;
  line-height: 1.3;
}
.settings-account-sync {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #0e700e;
  margin-top: 1px;
}
.settings-account-sync svg {
  width: 14px;
  height: 14px;
}
.settings-switch-btn {
  background: none;
  color: #2169eb;
  border: none;
  padding: 5px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.settings-account-divider {
  height: 0.5px;
  background: #e0e0e0;
  margin-left: 68px;
}

/* === iOS-style Toggle Switch === */
.settings-toggle {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}
.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.settings-toggle .toggle-track {
  position: absolute;
  inset: 0;
  background: #e0e0e0;
  border-radius: 16px;
  transition: background 0.25s ease;
  cursor: pointer;
}
.settings-toggle input:checked + .toggle-track {
  background: #0078D4;
}
.settings-toggle .toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s ease;
  pointer-events: none;
}
.settings-toggle input:checked ~ .toggle-thumb {
  transform: translateX(20px);
}
.settings-row-label-wrap {
  flex: 1;
  min-width: 0;
}
.settings-row-label-wrap .settings-row-label {
  flex: unset;
}
.settings-row-subtitle {
  font-size: 12px;
  color: #707070;
  line-height: 1.3;
  margin-top: 2px;
}

/* ===== Settings L2 Sub-pages ===== */
.settings-l2 {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #f5f5f5;
  border-radius: 24px 24px 0 0;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.settings-l2.visible {
  transform: translateX(0);
}
.settings-l2-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 24px 24px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 16px;
  height: 52px;
  position: relative;
}
.settings-l2-back {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.settings-l2-back:active {
  opacity: 0.8;
}
.settings-l2-back svg {
  width: 20px;
  height: 20px;
}
.settings-l2-title {
  font-size: 17px;
  font-weight: 500;
  color: #000;
}
.settings-l2 .settings-done-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.settings-l2-content {
  padding: 0 16px 40px;
}
/* When L2 is open, slide L1 content left slightly for depth cue */
.settings-scroll.l2-open {
  transform: translateX(-30%);
  opacity: 0.3;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}
.settings-scroll {
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease;
}
/* L2 toggle rows: divider at 16px (no icon space) */
.settings-l2 .settings-row-divider {
  margin-left: 16px;
}

/* About changelog list */
.about-changelog-item {
  font-size: 14px;
  color: #242424;
  line-height: 1.4;
  padding: 5px 0 5px 14px;
  position: relative;
}
.about-changelog-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0078D4;
}

/* Sub-row collapse animation (for one-line sub-options) */
.settings-row.settings-sub-row {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  padding-left: 32px;
}