.page-heading h1,
.settings-section h2 {
  margin: 0;
}

.page-heading h1 {
  font-size: 30px;
  line-height: 1.28;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.settings-section {
  margin-top: 40px;
}

.settings-content > .settings-section:first-of-type {
  margin-top: 0;
}

.settings-section--account {
  margin-top: 44px;
}

.settings-section h2 {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
}

.settings-surface {
  margin-top: 14px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--surface);
  display: grid;
  gap: 4px;
}

.settings-row {
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  gap: 14px;
  align-items: center;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.settings-row:hover {
  background: var(--surface-muted);
}

.settings-row__icon {
  width: 24px;
  height: 24px;
  border-radius: 0;
  background: transparent !important;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}

.settings-icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.settings-icon--stroke { fill: none; }
.settings-row--switch { grid-template-columns: 24px minmax(0, 1fr) 40px; }
.settings-row--switch .setting-switch { justify-self: end; }

.settings-row__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.settings-row__copy strong {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.settings-row__copy small {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-row__chevron {
  color: var(--text-tertiary);
  transition: transform 160ms cubic-bezier(.22, 1, .36, 1), color 160ms cubic-bezier(.22, 1, .36, 1);
}

.settings-row:hover .settings-row__chevron {
  color: var(--text);
  transform: translateX(2px);
}

.settings-row--danger .settings-row__icon,
.settings-row--danger .settings-row__copy strong {
  color: var(--danger);
}

.settings-row--danger .settings-row__icon {
  background: transparent !important;
}

.notification-strategy { padding: 18px 18px 17px; border-radius: var(--radius-md); background: var(--surface-muted); display: grid; gap: 4px; }
.notification-strategy > span { color: var(--text-tertiary); font-size: 12px; }
.notification-strategy strong { font-size: 15px; font-weight: 500; }
.notification-strategy small { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.notification-options { margin-top: 28px; display: grid; gap: 6px; }
.notification-option { min-height: 68px; padding: 10px 6px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.notification-option > span:first-child { min-width: 0; display: grid; gap: 3px; }
.notification-option strong { font-size: 14px; font-weight: 500; }
.notification-option small { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.notification-option em { color: var(--text-secondary); font-size: 12px; font-style: normal; }
.setting-switch { position: relative; width: 40px; height: 24px; }
.setting-switch input { position: absolute; opacity: 0; pointer-events: none; }
.setting-switch > span { position: absolute; inset: 0; border-radius: 999px; background: oklch(0.86 0.006 245); cursor: pointer; transition: background-color 160ms cubic-bezier(.22,1,.36,1); }
.setting-switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform 180ms cubic-bezier(.22,1,.36,1); }
.setting-switch input:checked + span { background: var(--agent-strong); }
.setting-switch input:checked + span::after { transform: translateX(16px); }
.setting-switch input:focus-visible + span { outline: 2px solid var(--agent); outline-offset: 3px; }

.account-action-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-float);
}

.account-action-dialog::backdrop {
  background: oklch(0.16 0.01 250 / .4);
}

.account-action-dialog__body {
  padding: 24px;
}

.account-action-dialog h2,
.account-action-dialog p {
  margin: 0;
}

.account-action-dialog h2 {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
}

.account-action-dialog p {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.account-action-dialog__actions {
  margin-top: 26px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.dialog-button--secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.dialog-button--secondary:hover {
  background: var(--surface-muted);
}

.dialog-button--primary {
  border: 0;
  background: var(--text);
  color: var(--surface);
}

.dialog-button--primary:hover {
  background: oklch(0.29 0.014 250);
}

.dialog-button--danger {
  background: var(--danger);
  color: oklch(0.99 0.002 245);
}

.dialog-button--danger:hover {
  background: oklch(0.43 0.14 28);
}

.settings-toast {
  position: fixed;
  z-index: 50;
  top: 88px;
  left: 50%;
  transform: translate(-50%, -12px);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(.22,1,.36,1), transform 180ms cubic-bezier(.22,1,.36,1);
}

.settings-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 720px) {
  .page-heading h1 {
    font-size: 27px;
  }

  .settings-section {
    margin-top: 34px;
  }

  .settings-section--account {
    margin-top: 38px;
  }

  .settings-row {
    min-height: 68px;
    padding: 11px 10px;
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    gap: 12px;
  }

  .account-action-dialog__body {
    padding: 22px 20px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .settings-row {
    transition: background-color 160ms cubic-bezier(.22, 1, .36, 1);
  }
}
