.list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    color: var(--text-color);
    list-style-type: none;
}

.list-group li {
    border: none !important;
    margin-bottom: 10px;
    padding: 10px;
}

.float-right {
    float: right;
}

.settings-link {
    text-decoration: none;
    color: var(--text-color);
}

.iOSnotificationRequest{
    display: none;
}

a, a:hover {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================
   SETTINGS PAGE (new markup; sub-pages unaffected)
   ========================================================== */
.settings { max-width: 560px; margin: 0 auto; padding: 0 4px; }

/* ---- Profile card ---- */
.settings-profile {
  display: flex; align-items: center; gap: 14px;
  margin-top: 8px; padding: 14px;
  border: 1px solid var(--line-color); border-radius: 18px;
  color: var(--text-color);
  transition: background-color 0.15s ease;
}
.settings-profile:active { background-color: var(--left-msg-bg); }
.settings-avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background-color: var(--deep-app-color); color: #fff;
  font-size: 22px; font-weight: 600;
}
.settings-avatar img { width: 100%; height: 100%; object-fit: cover; }
.settings-profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-profile-text strong {
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.settings-profile-text small { font-size: 13px; color: var(--sub-text-color); }

/* ---- Sections ---- */
.settings-section-title { font-size: 13px; font-weight: 500; color: var(--sub-text-color); margin: 22px 12px 8px; }
.settings-group {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--line-color); border-radius: 18px; overflow: hidden;
  background-color: var(--bg-color);
}
.settings-group + .settings-group { margin-top: 22px; }
.settings-group li + li { border-top: 1px solid var(--line-color); }

/* ---- Rows ---- */
.settings-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 56px; padding: 10px 14px;
  color: var(--text-color); cursor: pointer;
  transition: background-color 0.15s ease;
}
.settings-row:active { background-color: var(--left-msg-bg); }
@media (hover: hover) { .settings-row:hover { background-color: var(--left-msg-bg); } }

.settings-icon {
  flex: none; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background-color: var(--left-msg-bg); color: var(--app-color);
}
@supports (background: color-mix(in srgb, red, blue)) {
  .settings-icon { background-color: color-mix(in srgb, var(--app-color) 12%, var(--bg-color)); }
}
.settings-icon svg { width: 20px; height: 20px; }
.settings-label { flex: 1; font-size: 15px; font-weight: 500; }
.settings-chevron { flex: none; width: 18px; height: 18px; color: var(--sub-text-color); }

/* ---- Log out ---- */
.settings-row.danger { color: #d93036; }
.settings-row.danger .settings-icon { color: #d93036; background-color: var(--left-msg-bg); }
@supports (background: color-mix(in srgb, red, blue)) {
  .settings-row.danger .settings-icon { background-color: color-mix(in srgb, #d93036 12%, var(--bg-color)); }
}

/* ---- Dark mode row ---- */
#toggle-mode { cursor: pointer; }
#toggle-mode .icon-sun { display: none; }
html.dark-mode #toggle-mode .icon-sun { display: block; }
html.dark-mode #toggle-mode .icon-moon { display: none; }

.settings-switch {
  position: relative; flex: none;
  width: 46px; height: 28px; border-radius: 999px;
  background-color: rgba(128, 128, 128, 0.35);
  transition: background-color 0.2s ease;
}
.settings-switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s var(--ease);
}
html.dark-mode .settings-switch { background-color: var(--app-color); }
html.dark-mode .settings-switch::after { transform: translateX(18px); }

/* ==========================================================
   ANONYMOUS LINK PAGE (al-*)
   ========================================================== */
.al .settings-section-title:first-child { margin-top: 8px; }

/* ---- Cards ---- */
.al-card {
  margin-top: 8px; padding: 16px;
  border: 1px solid var(--line-color); border-radius: 18px; background: var(--bg-color);
}
.al .settings-section-title + .al-card { margin-top: 0; }
.al > .al-card:first-child {
  margin-top: 8px; border-color: transparent; color: #fff;
  background:
    radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1.4px) 0 0 / 16px 16px,
    linear-gradient(135deg, var(--app-color), var(--deep-app-color));
}
.al-label { margin: 0 0 6px; font-size: 13px; font-weight: 500; opacity: 0.85; }
.al-url {
  padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; line-height: 1.4;
  background: rgba(255, 255, 255, 0.16); -webkit-user-select: all; user-select: all;
}
.al-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---- Buttons ---- */
.al-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: 1px solid var(--line-color); border-radius: 999px;
  background: transparent; color: var(--text-color); font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease, background-color 0.15s ease;
}
.al-btn svg { width: 18px; height: 18px; }
.al-btn:active { transform: scale(0.97); }
.al-btn:disabled { opacity: 0.6; cursor: default; }
.al-btn.small { padding: 8px 18px; font-size: 14px; }
.al-btn.primary { background: var(--app-color); border-color: var(--app-color); color: #fff; }
.al-btn.danger { background: #d93036; border-color: #d93036; color: #fff; }
.al-btn.ghost { border-color: transparent; color: var(--sub-text-color); font-weight: 500; }
.al-btn.ghost:active { background: var(--left-msg-bg); }
.al-actions .al-btn { flex: 1; }
.al > .al-card:first-child .al-btn { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.al > .al-card:first-child .al-btn.primary { background: #fff; border-color: #fff; color: var(--deep-app-color); }

/* ---- Topic field ---- */
.al-field-label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--sub-text-color); }
.al-input {
  display: block; width: 100%; padding: 12px 14px; border: 1px solid var(--line-color); border-radius: 14px;
  background: var(--left-msg-bg); color: var(--text-color); font-size: 16px; outline: 0;
  transition: border-color 0.15s ease;
}
.al-input:focus { border-color: var(--app-color); }
.al-field-foot { display: flex; align-items: center; justify-content: space-between; min-height: 20px; margin-top: 10px; }
.al-count { font-size: 12px; color: var(--sub-text-color); }
.al-field-foot .al-btn { margin-left: auto; }
.al-field-foot [hidden] { display: none; }

/* ---- Toggle rows (buttons styled like settings rows) ---- */
button.settings-row { border: 0; background: transparent; text-align: left; font: inherit; }
.al-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.al-text small { font-size: 12px; color: var(--sub-text-color); }
.al-switch {
  position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px;
  background: rgba(128, 128, 128, 0.35); transition: background-color 0.2s ease;
}
.al-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s var(--ease);
}
.al-switch.is-on { background: var(--app-color); }
.al-switch.is-on::after { transform: translateX(18px); }

/* ---- Dialogs ---- */
.al-overlay {
  position: fixed; inset: 0; z-index: 900; display: none;
  background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.al-dialog {
  position: fixed; top: 50%; left: 50%; z-index: 910; display: none;
  width: min(92%, 400px); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 24px 20px 20px;
  background: var(--bg-color); border: 1px solid var(--line-color); border-radius: 24px;
  box-shadow: var(--shadow-pop); text-align: center; transform: translate(-50%, -50%);
  animation: al-in 0.25s var(--ease) both;
}
@keyframes al-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.al-dialog-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.al-dialog-text { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: var(--sub-text-color); }
.al-dialog-actions { display: flex; flex-direction: column; gap: 10px; }
.al-dialog-actions .al-btn, .al-dialog-actions form { width: 100%; }
.al-dialog-actions form .al-btn { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .al-dialog { animation: none; }
  .al-switch, .al-switch::after, .al-btn { transition: none; }
}

/* ==========================================================
   ACCOUNT PAGE (ac-*)
   Reuses .settings-*, .al-dialog, .al-overlay and .al-btn from above
   ========================================================== */
.ac-first { margin-top: 8px; }
.ac-created { margin: 22px 12px 0; text-align: center; font-size: 13px; color: var(--sub-text-color); }

.al-dialog-list {
  margin: -8px 0 14px; padding-left: 20px; text-align: left;
  font-size: 14px; line-height: 1.55; color: var(--sub-text-color);
}
.al-dialog-list li { margin-bottom: 4px; }
.al-dialog-actions a.al-btn { width: 100%; text-decoration: none; }

/* ==========================================================
   FORM PAGES (fm-*): change username, change email, email OTP
   Reuses .al-input, .al-btn and .al-card from above
   ========================================================== */
.fm { padding-top: 8px; }
.fm-form { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.fm-field label { display: block; margin: 0 0 8px 2px; font-size: 13px; font-weight: 500; color: var(--sub-text-color); }
.fm .al-input.is-error { border-color: #d93036; }
.fm-hint { margin: 6px 2px 0; font-size: 12px; color: var(--sub-text-color); }
.fm-error { margin: 6px 2px 0; font-size: 13px; color: #d93036; }
.fm-success { margin: 6px 2px 0; font-size: 13px; color: var(--app-color); }

.fm-pw { position: relative; }
.fm-pw .al-input { padding-right: 48px; }
.fm-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: transparent; color: var(--sub-text-color); cursor: pointer;
}
.fm-eye svg { width: 20px; height: 20px; }
.fm-eye.is-on { color: var(--app-color); }
.fm-eye:active { background: var(--left-msg-bg); }

.fm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fm-chip {
  padding: 6px 12px; border: 1px solid var(--line-color); border-radius: 999px;
  background: transparent; color: var(--app-color); font-size: 14px; font-weight: 500; cursor: pointer;
}
.fm-chip:active { background: var(--left-msg-bg); }

.fm-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 0; }
.fm-note .settings-icon { margin-top: 2px; }
.fm-note p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--sub-text-color); }

.fm-submit { width: 100%; padding: 14px 20px; font-size: 16px; }
.al-btn.is-loading { pointer-events: none; }
.al-btn.is-loading::after {
  content: ""; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  border-radius: 50%; animation: fm-spin 0.7s linear infinite;
}
@keyframes fm-spin { to { transform: rotate(360deg); } }

.fm-link { margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--sub-text-color); }
.fm-link a { color: var(--app-color); font-weight: 600; }

.al-input.fm-otp { text-align: center; font-size: 28px; font-weight: 600; letter-spacing: 0.5em; padding-left: 0.5em; }

@media (prefers-reduced-motion: reduce) { .al-btn.is-loading::after { animation: none; } }

/* ==========================================================
   NOTIFICATIONS + SECURITY PAGES (nt-*)
   Reuses .settings-*, .al-switch, .al-text and .al-card from above
   ========================================================== */
.nt-first { margin-top: 8px; }

/* iOS "add to Home Screen" card (shown by script) */
.nt-ios { margin-top: 8px; text-align: left; }
.nt-ios h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.nt-ios p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--sub-text-color); }
.nt-ios ol { margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--text-color); }
.nt-ios p:last-child { margin-bottom: 0; }

/* ==========================================================
   2FA, CHANGE PASSWORD, PASSWORD DONE (tf-*, pw-*, cpd-*)
   Reuses .settings-*, .al-*, .fm-* from above
   ========================================================== */

/* ---- 2FA ---- */
.tf-hero {
  display: flex; align-items: flex-start; gap: 14px; margin: 8px 0 14px; padding: 16px;
  border-radius: 18px; color: #fff;
  background:
    radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1.4px) 0 0 / 16px 16px,
    linear-gradient(135deg, var(--app-color), var(--deep-app-color));
}
.tf-shield {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
}
.tf-shield svg { width: 24px; height: 24px; }
.tf-hero h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tf-hero p { margin: 0; font-size: 13.5px; line-height: 1.55; opacity: 0.92; }
.tf-static { cursor: default; }
.tf-static:active { background-color: transparent; }
.tf-static .al-text small { order: -1; }
.tf-noemail { margin-top: 0; }
.tf-noemail p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--sub-text-color); }
.tf-noemail .al-btn { width: 100%; text-decoration: none; }

/* ---- Change password ---- */
.fm-eye .eye-off { display: none; }
.fm-eye.is-on .eye-off { display: block; }
.fm-eye.is-on .eye-on { display: none; }

.pw-rules {
  list-style: none; margin: 10px 2px 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px;
}
.pw-rules li { position: relative; padding-left: 22px; font-size: 12.5px; color: var(--sub-text-color); }
.pw-rules li::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; border: 1.5px solid var(--line-color); transition: background-color 0.15s ease;
}
.pw-rules li.ok { color: var(--text-color); }
.pw-rules li.ok::before {
  border-color: var(--app-color);
  background: var(--app-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.fm-submit:disabled { opacity: 0.5; cursor: default; }

/* ---- Password changed ---- */
.cpd { display: flex; flex-direction: column; align-items: center; padding-top: 32px; text-align: center; }
.cpd-badge {
  display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 18px; border-radius: 50%;
  background: var(--bg-color); border: 1px solid var(--line-color);
  box-shadow: 0 0 0 8px rgba(10, 155, 71, 0.1);
  animation: cpd-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.cpd-badge svg { width: 60px; height: 60px; overflow: visible; }
.cpd-ring, .cpd-tick { stroke: var(--app-color); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cpd-ring { stroke-dasharray: 151; stroke-dashoffset: 151; animation: cpd-draw 0.6s 0.15s ease-out forwards; }
.cpd-tick { stroke-width: 3.5; stroke-dasharray: 40; stroke-dashoffset: 40; animation: cpd-draw 0.35s 0.65s ease-out forwards; }
@keyframes cpd-draw { to { stroke-dashoffset: 0; } }
@keyframes cpd-pop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.cpd-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.cpd-sub { margin: 6px 0 0; font-size: 15px; color: var(--sub-text-color); }
.cpd-btn { width: 100%; max-width: 320px; margin-top: 24px; padding: 14px 20px; font-size: 16px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .cpd-badge { animation: none; }
  .cpd-ring, .cpd-tick { animation: none; stroke-dashoffset: 0; }
}

/* ==========================================================
   CONTACT + LEGAL PAGES (cu-*, lg-*, legal)
   ========================================================== */
.cu .settings-icon i { font-size: 16px; }

/* ---- Legal header ---- */
.lg-hero { margin: 8px 0 20px; padding: 20px 18px; border-radius: 18px; border: 1px solid var(--line-color); background: var(--left-msg-bg); }
.lg-hero h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.lg-hero p { margin: 6px 0 0; font-size: 13px; color: var(--sub-text-color); }

/* ---- Legal body ---- */
.legal { max-width: 680px; margin: 0 auto; padding: 0 2px 8px; font-size: 15px; line-height: 1.7; color: var(--text-color); }
.legal p { margin: 0 0 14px; }
.legal a { color: var(--app-color); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.legal b, .legal strong { font-weight: 600; }

/* The existing centered bold lines become section headings (no HTML change) */
.legal div[style*="text-align: center"] { text-align: left !important; margin: 30px 0 10px; padding-top: 18px; border-top: 1px solid var(--line-color); }
.legal div[style*="text-align: center"] > b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.legal > div[style*="text-align: center"] + br { display: none; }

/* Safety page headings and lists */
.legal h2 { margin: 30px 0 10px; padding-top: 18px; border-top: 1px solid var(--line-color); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.legal ul { margin: 0 0 14px; padding-left: 20px; }

/* Bare <li> items used in the privacy policy and terms */
.legal > li { margin: 0 0 10px 20px; padding-left: 4px; list-style: disc; }
.legal li::marker { color: var(--app-color); }