/*============================================================
    START Settings — Sub-nav (left rail) + breadcrumb
  ============================================================*/
.sw-settings-app {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}

/* Sub-nav (desktop) */
.sw-sub-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
}

.sw-sub-nav__group {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #9ca3af;
  text-transform: uppercase;
  margin: 8px 14px;
}
.sw-sub-nav__group:first-child {
  margin-top: 0;
}

.sw-sub-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  transition:
    background 0.12s,
    color 0.12s;
}
.sw-sub-nav__item:hover {
  background: #f3f4f6;
  color: #0f1020;
}
.sw-sub-nav__item.is-active {
  background: var(--sw-violet-50);
  color: var(--sw-violet);
  font-weight: 600;
}
.sw-sub-nav__item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.sw-sub-nav__item--danger {
  color: #ef4444;
}
.sw-sub-nav__item--danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.sw-sub-nav__count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sw-violet);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.sw-sub-nav__new-pill {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sw-violet);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sw-sub-nav-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #f3f4f6;
}
.sw-sub-nav-mobile::-webkit-scrollbar {
  display: none;
}

/* Breadcrumb above content */
.sw-set-crumbs {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 10px;
}
.sw-set-crumbs strong {
  color: #1A1232;
  font-weight: 600;
}
.sw-set-crumbs__sep {
  margin: 0 6px;
}

.sw-set-section-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: #1A1232;
  margin: 0 0 4px;
}
.sw-set-section-subtitle {
  font-size: 13px;
  color: #9CA3AF;
  margin: 0 0 24px;
}
/* END Sub-nav */

/* ============================================================
   START Settings — Cards
  ============================================================ */
.sw-set-card {
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 16px;
}
.sw-set-card__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: #1A1232;
  margin: 0 0 4px;
}
.sw-set-card__subtitle {
  font-size: 12px;
  line-height: 16px;
  color: #6B7280;
  margin-bottom: 16px;
}
.sw-set-card__head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sw-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #ECE9E0;
}

.sw-set-row__main {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.sw-set-row__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
}
.sw-set-row__sub {
  display: block;
  font-size: 12px;
  color: #6B7280;
  margin-top: 2px;
}
.sw-set-row__value {
  font-size: 13px;
  font-weight: 500;
  color: #6B6F7B;
}

.sw-set-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-left: 6px;
}
.sw-set-chip--green {
  background: #d1fae5;
  color: #047857;
}
/* END Cards */

/* ============================================================
   START Settings — Toggle switch + buttons
  ============================================================ */
.sw-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.sw-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.sw-toggle__track {
  position: absolute;
  inset: 0;
  background: #e5e7eb;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.sw-toggle__track::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 16, 32, 0.15);
  transition: transform 0.2s;
}
.sw-toggle input:checked + .sw-toggle__track {
  background: var(--sw-violet);
}
.sw-toggle input:checked + .sw-toggle__track::before {
  transform: translateX(16px);
}

.sw-btn-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #1A1232;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.sw-btn-change:hover {
  background: #f9fafb;
  color: #0f1020;
}

.sw-btn-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #1A1232;
  text-decoration: none;
}
.sw-btn-open:hover {
  background: #f9fafb;
  color: #0f1020;
}
.sw-btn-open svg {
  width: 12px;
  height: 12px;
}

.sw-btn-signout-all {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #E5594A;
  text-decoration: none;
  cursor: pointer;
}
.sw-btn-signout-all:hover {
  background: #fef2f2;
}

/* Danger zone styling */
.sw-danger-card {
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 16px;
  padding: 24px 28px;
}
.sw-danger-card__title {
  font-size: 16px;
  font-weight: 600;
  color: #E5594A;
  margin: 0 0 4px;
}
.sw-danger-card__subtitle {
  font-size: 12px;
  color: #9CA3AF;
  margin: 0 0 16px;
}
.sw-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #FCEEEC;
  border-radius: 12px;
}
.sw-danger-row__main {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.sw-danger-row__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
}
.sw-danger-row__sub {
  display: block;
  font-size: 11px;
  color: #6B6F7B;
  margin-top: 2px;
}
.sw-btn-danger {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #E5594A;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #E5594A;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.sw-btn-danger:hover {
  background: #fef2f2;
}
/* END Toggle + buttons */

/*============================================================
   START Responsive — Settings
  ============================================================ */
@media (max-width: 991.98px) {
  .sw-settings-app {
    display: block;
  }
  .sw-sub-nav {
    display: none;
  }
  .sw-sub-nav-mobile {
    display: flex;
  }
  .sw-sub-nav-mobile .sw-sub-nav__item {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
  }
  .sw-sub-nav-mobile .sw-sub-nav__count {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .sw-set-section-title {
    display: none;
  } 
  .sw-set-section-subtitle {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .sw-set-mobile {
    flex-direction: column;
    align-items: flex-start;
  }
  .sw-set-row__actions {
    width: 100%;
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }
  .sw-set-card__subtitle {
    margin-bottom: 16px;
  }
  .sw-set-card__head-row {
    margin-bottom: 16px;
  }
  .sw-set-card__head-row .sw-set-card__subtitle {
    margin-bottom: 0;
  }
  .sw-set-card {
    padding: 16px;
  }
  .sw-danger-card {
    padding: 16px;
  }
  .sw-danger-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .sw-btn-danger {
    align-self: flex-end;
  }
}
/* END Responsive Settings */


/* =========================
  Settings panels (tab-switched)
========================= */
.sw-settings__panels {
  flex: 1;
  min-width: 0;
}

.sw-settings__panel[hidden] {
  display: none;
}


/* =========================
  Email-frequency radio cards
========================= */
.sw-set-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-set-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #ece9e0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.sw-set-radio:hover {
  border-color: #d1d5db;
}

/* Checked card — straight from the radio's own state (no JS) */
.sw-set-radio:has(> input:checked) {
  background: #f5f4fe;
  border-color: #6e5df8;
  border-width: 1.5px;
  padding: 13.5px 15.5px;
}

/* Hide the native radio — we render our own dot */
.sw-set-radio input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sw-set-radio__dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid #d1d5db;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s;
}

.sw-set-radio:has(> input:checked) .sw-set-radio__dot {
  border-color: #6e5df8;
  border-width: 6px;
}

.sw-set-radio__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sw-set-radio__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #1a1232;
}

.sw-set-radio__sub {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #6b7280;
}

/* Mobile (≤767px) */
@media (max-width: 767.98px) {
  .sw-set-radio {
    padding: 12px 14px;
  }

  .sw-set-radio:has(> input:checked) {
    padding: 11.5px 13.5px;
  }

  .sw-set-radio__title {
    font-size: 13px;
    line-height: 18px;
  }

  .sw-set-radio__sub {
    font-size: 11px;
    line-height: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-set-radio,
  .sw-set-radio__dot {
    transition: none;
  }
}

