@layer components {

/* Profile Page Layout */
.profile-page {
  max-inline-size: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

  @media (width <= 640px) {
.profile-page {
    padding: 1rem
}
  }

/* Profile Grid - Single column layout for settings */
.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-block-start: 1.5rem;
}

/* Profile Card Styling */
.profile-card {
  background: var(--color-bg-secondary);
}

  /* Dark Mode */
  html[data-theme="dark"] .profile-card {
    background: var(--color-bg-secondary);
  }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme]) .profile-card {
      background: var(--color-bg-secondary);
    }
  }

/* Account Information Section */
.profile-info {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

  @media (width <= 640px) {
.profile-info {
    flex-direction: column;
    align-items: center;
    text-align: center
}
  }

.profile-avatar {
  inline-size: 80px;
  block-size: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-avatar__initials {
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text-inverse);
  text-transform: uppercase;
}

  .profile-avatar__image {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    border-radius: 50%;
  }

/* MC-56: Avatar Upload Section */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.profile-avatar-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

  .avatar-upload__input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
  }

  .avatar-upload__label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
  }

    .avatar-upload__label .heroicon,
    .avatar-upload__label .avatar-upload-icon {
      inline-size: 1rem;
      block-size: 1rem;
    }

  .avatar-upload__submit {
    margin-block-start: 0.25rem;
  }

.avatar-remove {
  color: var(--color-status-error-action);
}

.avatar-remove:hover {
  color: var(--color-status-error-text);
  background: var(--color-status-error-bg);
}

.profile-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

  @media (width <= 640px) {
.profile-details {
    align-items: center
}
  }

.profile-detail {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-detail__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  min-inline-size: 100px;
}

.profile-detail__value {
  font-size: 0.9375rem;
  color: var(--color-text-emphasis);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge--admin {
  background: var(--color-bg-accent-hover);
  color: var(--color-text-accent);
}

.badge--member {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

    html[data-theme="dark"] .badge--member {
      background: var(--color-slate-700);
      color: var(--color-slate-300);
    }

    @media (prefers-color-scheme: dark) {
      html:not([data-theme]) .badge--member {
        background: var(--color-slate-700);
        color: var(--color-slate-300);
      }
    }

  .badge--active {
    background: var(--color-success-100);
    color: var(--color-success-700);
  }

  .badge--inactive {
    background: var(--color-error-100);
    color: var(--color-error-700);
  }


/* Empty State */
.empty-state-text {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  font-style: italic;
  text-align: center;
  padding: 1rem 0;
}

  html[data-theme="dark"] .empty-state-text {
    color: var(--color-text-secondary);
  }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme]) .empty-state-text {
      color: var(--color-text-secondary);
    }
  }

/* Profile Forms */
.profile-form {
  display: flex;
  flex-direction: column;
}

  .profile-form .form-actions {
    margin-block-start: var(--space-4);
  }

/* Notification Preferences */
.notification-preferences {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preference-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--color-bg-subtle);
  border-radius: 6px;
}

  html[data-theme="dark"] .preference-item {
    background: var(--color-slate-800);
  }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme]) .preference-item {
      background: var(--color-slate-800);
    }
  }

  @media (width <= 640px) {
.preference-item {
    flex-direction: column;
    align-items: flex-start
}
  }

.preference-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.preference-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-emphasis);
}

  html[data-theme="dark"] .preference-title {
    color: var(--color-text-primary);
  }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme]) .preference-title {
      color: var(--color-text-primary);
    }
  }

.preference-description {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

/* Notification Tiers (Radio Buttons) */
.notification-preferences--tiers {
  gap: 0.75rem;
}

.notification-preferences__description {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.notification-tier {
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

  .notification-tier:has(.notification-tier__input:checked) {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 1px var(--color-primary-500);
  }

  .notification-tier__option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
  }

.notification-tier__input {
  inline-size: 18px;
  block-size: 18px;
  margin: 0;
  margin-block-start: 2px;
  flex-shrink: 0;
  accent-color: var(--color-text-link);
  cursor: pointer;
}

  .notification-tier__content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
  }

.notification-tier__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-emphasis);
}

.notification-tier__description {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

/* Push Notifications Section */
.push-notifications-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.push-status {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

.push-status--enabled {
  --_push-bg: var(--color-status-success-bg);
  --_push-border: var(--color-success-200);
  --_push-icon-bg: var(--color-success-100);

  background: var(--_push-bg);
  border: 1px solid var(--_push-border);
}

.push-status--disabled {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-primary);
}

.push-status--enabled .push-status__icon {
  background: var(--_push-icon-bg);
  color: var(--color-status-success-action);
}

.push-status--disabled .push-status__icon {
  background: var(--color-bg-tertiary);
  color: var(--color-text-tertiary);
}

  /* stylelint-disable-next-line no-descending-specificity */
  .push-status__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 40px;
    block-size: 40px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
  }

    .push-status__icon .heroicon,
    .push-status__icon .push-status-icon {
      inline-size: 24px;
      block-size: 24px;
    }

  .push-status__content {
    flex: 1;
  }

  .push-status__title {
    margin: 0 0 var(--space-1) 0;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
  }

  .push-status__description {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    line-height: 1.5;
  }

.push-actions {
  display: flex;
  gap: var(--space-2);
}

  .push-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .push-actions .heroicon,
  .push-actions .push-action-icon {
    inline-size: 18px;
    block-size: 18px;
  }

.push-error {
  --_push-err-bg: var(--color-status-error-bg);
  --_push-err-border: var(--color-error-200);

  padding: var(--space-3);
  background: var(--_push-err-bg);
  border: 1px solid var(--_push-err-border);
  border-radius: var(--radius-md);
}

  .push-error__message {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-error-700);
  }

/* Dark mode - Push Notifications */
html[data-theme="dark"] .push-status--enabled {
  --_push-bg: var(--color-green-alpha-10);
  --_push-border: var(--color-green-alpha-20);
  --_push-icon-bg: var(--color-green-alpha-20);
}

html[data-theme="dark"] .push-status-inline--enabled {
  --_psi-bg: var(--color-green-alpha-10);
  --_psi-border: var(--color-green-alpha-20);
  --_psi-text: var(--color-success-300);
}

html[data-theme="dark"] .push-error {
  --_push-err-bg: var(--color-error-alpha-10);
  --_push-err-border: var(--color-error-alpha-20);
}

/* Dark mode - Notification Matrix */
html[data-theme="dark"] .notification-matrix__input {
  border-color: var(--color-neutral-600);
}

html[data-theme="dark"] .notification-matrix__input:checked {
  box-shadow: inset 0 0 0 3px var(--color-bg-secondary);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .push-status--enabled {
    --_push-bg: var(--color-green-alpha-10);
    --_push-border: var(--color-green-alpha-20);
    --_push-icon-bg: var(--color-green-alpha-20);
  }

  html:not([data-theme]) .push-status-inline--enabled {
    --_psi-bg: var(--color-green-alpha-10);
    --_psi-border: var(--color-green-alpha-20);
    --_psi-text: var(--color-success-300);
  }

  html:not([data-theme]) .push-error {
    --_push-err-bg: var(--color-error-alpha-10);
    --_push-err-border: var(--color-error-alpha-20);
  }

  html:not([data-theme]) .notification-matrix__input {
    border-color: var(--color-neutral-600);
  }

  html:not([data-theme]) .notification-matrix__input:checked {
    box-shadow: inset 0 0 0 3px var(--color-bg-secondary);
  }
}

/* Notification Preferences Section */
.notification-preferences-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Notification Matrix */
.notification-matrix {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.notification-matrix__header {
  display: grid;
  grid-template-columns: 1fr 80px 120px;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-subtle);
  border-block-end: 1px solid var(--color-border-primary);
}

.notification-matrix__row {
  display: grid;
  grid-template-columns: 1fr 80px 120px;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-block-end: 1px solid var(--color-border-secondary);
}

.notification-matrix__row:hover {
  background: var(--color-bg-subtle);
}

      html[data-theme="dark"] .notification-matrix__row:hover {
        background: var(--color-slate-800);
      }

      @media (prefers-color-scheme: dark) {
        html:not([data-theme]) .notification-matrix__row:hover {
          background: var(--color-slate-800);
        }
      }

  .notification-matrix__label-cell {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }

  .notification-matrix__channel-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

    .notification-matrix__channel-cell--disabled {
      opacity: 0.4;
      pointer-events: none;
    }

  .notification-matrix__channel-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
  }

    html[data-theme="dark"] .notification-matrix__channel-title {
      color: var(--color-text-primary);
    }

    @media (prefers-color-scheme: dark) {
      html:not([data-theme]) .notification-matrix__channel-title {
        color: var(--color-text-primary);
      }
    }

  .notification-matrix__channel-disabled {
    margin-block-start: var(--space-1);
  }

    .notification-matrix__channel-disabled .btn {
      font-size: var(--text-xs);
      padding: var(--space-1) var(--space-2);
      white-space: nowrap;
    }

    .notification-matrix__channel-disabled .heroicon,
    .notification-matrix__channel-disabled .matrix-channel-icon {
      inline-size: 14px;
      block-size: 14px;
    }

  .notification-matrix__level-title {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
  }

    html[data-theme="dark"] .notification-matrix__level-title {
      color: var(--color-text-primary);
    }

    @media (prefers-color-scheme: dark) {
      html:not([data-theme]) .notification-matrix__level-title {
        color: var(--color-text-primary);
      }
    }

  .notification-matrix__level-description {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    line-height: 1.4;
  }

/* stylelint-disable-next-line no-descending-specificity */
.notification-matrix__input {
  /* Reset browser default */
  appearance: none;
  inline-size: 20px;
  block-size: 20px;
  margin: 0;
  border: 2px solid var(--color-border-muted);
  border-radius: 50%;
  background: var(--color-bg-primary);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

  /* stylelint-disable-next-line no-descending-specificity */
  .notification-matrix__input:hover {
    border-color: var(--color-primary-400);
  }

  /* stylelint-disable-next-line no-descending-specificity */
  .notification-matrix__input:checked {
    border-color: var(--color-primary-500);
    background: var(--color-primary-500);
    box-shadow: inset 0 0 0 3px var(--color-bg-primary);
  }

  /* stylelint-disable-next-line no-descending-specificity */
  .notification-matrix__input:focus-visible {
    outline: 2px solid var(--color-primary-300);
    outline-offset: 2px;
  }

  /* stylelint-disable-next-line no-descending-specificity */
  .notification-matrix__input:disabled {
    border-color: var(--color-border-secondary);
    background: var(--color-bg-tertiary);
    cursor: not-allowed;
  }

  /* Matrix Radio Button Styling */
  .notification-matrix__radio {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

/* Push Status Inline */
.push-status-inline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-block-start: var(--space-2);
}

/* stylelint-disable-next-line no-descending-specificity */
.push-status-inline--enabled {
  --_psi-bg: var(--color-status-success-bg);
  --_psi-border: var(--color-success-200);
  --_psi-text: var(--color-success-700);

  background: var(--_psi-bg);
  border: 1px solid var(--_psi-border);
}

.push-status-inline--enabled .push-status-inline__icon {
  color: var(--color-status-success-action);
}

.push-status-inline--enabled .push-status-inline__text {
  color: var(--_psi-text);
}

.push-status-inline--disabled {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-primary);
}

      html[data-theme="dark"] .push-status-inline--enabled .push-status-inline__icon {
        color: var(--color-success-400);
      }

      html[data-theme="dark"] .push-status-inline--enabled .push-status-inline__text {
        color: var(--color-success-300);
      }

      @media (prefers-color-scheme: dark) {
        html:not([data-theme]) .push-status-inline--enabled .push-status-inline__icon {
          color: var(--color-success-400);
        }

        html:not([data-theme]) .push-status-inline--enabled .push-status-inline__text {
          color: var(--color-success-300);
        }
      }

    /* stylelint-disable-next-line no-descending-specificity */
    .push-status-inline--disabled .push-status-inline__icon {
      color: var(--color-text-tertiary);
    }

    /* stylelint-disable-next-line no-descending-specificity */
    .push-status-inline--disabled .push-status-inline__text {
      color: var(--color-text-secondary);
    }

    .push-status-inline--disabled .btn {
      display: inline-flex;
      align-items: center;
      gap: var(--space-1);
    }

      .push-status-inline--disabled .btn .heroicon,
      .push-status-inline--disabled .btn .push-btn-icon {
        inline-size: 16px;
        block-size: 16px;
      }

    /* stylelint-disable-next-line no-descending-specificity */
    .push-status-inline__icon .heroicon,
    .push-status-inline__icon .push-status-inline-icon {
      inline-size: 20px;
      block-size: 20px;
    }

  /* stylelint-disable-next-line no-descending-specificity */
  .push-status-inline__text {
    flex: 1;
    font-size: var(--text-sm);
  }

/* Per-Device Push Notification Status */
.push-devices-section {
  margin-block-start: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-primary);
}

  .push-devices-section__heading {
    margin: 0 0 var(--space-3) 0;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-secondary);
  }

    html[data-theme="dark"] .push-devices-section__heading {
      color: var(--color-text-tertiary);
    }

  /* Dark mode - Per-Device Push */
  html[data-theme="dark"] .push-devices-section {
    background: var(--color-slate-800);
    border-color: var(--color-border-dark);
  }

    @media (prefers-color-scheme: dark) {
      html:not([data-theme]) .push-devices-section__heading {
        color: var(--color-text-tertiary);
      }

      html:not([data-theme]) .push-devices-section {
        background: var(--color-slate-800);
        border-color: var(--color-border-dark);
      }
    }

.push-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.push-device-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.push-device-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
}

.push-device-status {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.push-device-status--checking {
  color: var(--color-text-tertiary);
  background: var(--color-bg-tertiary);
}

.push-device-status--enabled {
  --_dev-color: var(--color-success-700);
  --_dev-bg: var(--color-success-100);

  color: var(--_dev-color);
  background: var(--_dev-bg);
}

.push-device-status--unsupported {
  --_dev-color: var(--color-status-warning-text);
  --_dev-bg: var(--color-status-warning-subtle);

  color: var(--_dev-color);
  background: var(--_dev-bg);
}

.push-device-actions {
  display: flex;
  gap: var(--space-2);
}

  .push-device-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
  }

  /* stylelint-disable-next-line no-descending-specificity */
  .push-device-actions .heroicon,
  .push-device-actions .push-device-icon,
  .push-device-actions .btn-inline-icon {
    inline-size: 16px;
    block-size: 16px;
  }

.push-other-devices {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-block-start: var(--space-3);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--color-border-primary);
}

  .push-other-devices__text {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
  }

    /* stylelint-disable-next-line no-descending-specificity */
    .push-other-devices__text .heroicon,
    .push-other-devices__text .push-devices-icon {
      inline-size: 18px;
      block-size: 18px;
      color: var(--color-text-tertiary);
    }

  html[data-theme="dark"] .push-other-devices {
    border-block-start-color: var(--color-slate-700);
  }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme]) .push-other-devices {
      border-block-start-color: var(--color-slate-700);
    }
  }

.push-disable-all-btn {
  color: var(--color-status-error-action);
}

.push-disable-all-btn:hover {
  color: var(--color-error-700);
  background: var(--color-status-error-bg);
}

/* Dark mode - Per-Device Push */
html[data-theme="dark"] .push-device-status--enabled {
  --_dev-color: var(--color-success-300);
  --_dev-bg: var(--color-green-alpha-20);
}

html[data-theme="dark"] .push-device-status--unsupported {
  --_dev-color: var(--color-warning-300);
  --_dev-bg: var(--color-yellow-alpha-20);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .push-device-status--enabled {
    --_dev-color: var(--color-success-300);
    --_dev-bg: var(--color-green-alpha-20);
  }

  html:not([data-theme]) .push-device-status--unsupported {
    --_dev-color: var(--color-warning-300);
    --_dev-bg: var(--color-yellow-alpha-20);
  }
}

/* Sessions List */
.sessions-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sessions-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg-subtle);
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.sessions-list__item:hover {
  background: var(--color-bg-tertiary);
}

  html[data-theme="dark"] .sessions-list__item {
    border: 1px solid var(--color-border-primary);
  }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme]) .sessions-list__item {
      border: 1px solid var(--color-border-primary);
    }
  }

.session-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-inline-size: 0;
}

.session-device {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-device__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 8px;
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

    .session-device__icon svg {
      inline-size: 18px;
      block-size: 18px;
    }

.session-device__name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-emphasis);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.session-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-inline-start: 2.75rem;
}

.session-details__item {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
}

    html[data-theme="dark"] .session-details__item {
      color: var(--color-text-secondary);
    }

    @media (prefers-color-scheme: dark) {
      html:not([data-theme]) .session-details__item {
        color: var(--color-text-secondary);
      }
    }

  .session-details__ip {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
  }

  @media (width <= 640px) {
.session-details {
    padding-inline-start: 0
}
  }

.session-actions {
  flex-shrink: 0;
}

/* Theme Preferences (MC-75) */
.theme-preferences-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.theme-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.theme-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.theme-option:hover {
  border-color: var(--color-border-secondary);
  background: var(--color-bg-subtle);
}

.theme-option:has(.theme-option__input:checked) {
  border-color: var(--color-primary-500);
  background: var(--color-bg-accent);
}

.theme-option__input {
  /* Reset browser default */
  appearance: none;
  inline-size: 20px;
  block-size: 20px;
  margin: 0;
  margin-block-start: 2px;
  border: 2px solid var(--color-border-muted);
  border-radius: 50%;
  background: var(--color-bg-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.theme-option__input:hover {
  border-color: var(--color-primary-400);
}

.theme-option__input:checked {
  border-color: var(--color-primary-500);
  background: var(--color-primary-500);
  box-shadow: inset 0 0 0 3px var(--color-bg-primary);
}

.theme-option__input:focus-visible {
  outline: 2px solid var(--color-primary-300);
  outline-offset: 2px;
}

.theme-option__content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  flex: 1;
}

.theme-option__icon {
  inline-size: 20px;
  block-size: 20px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  margin-block-start: 2px;
}

.theme-option:has(.theme-option__input:checked) .theme-option__icon {
  color: var(--color-text-accent-bright);
}

.theme-option__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.theme-option__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

.theme-option__description {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* Responsive adjustments */
@media (width <= 640px) {
  .profile-page {
    padding: 1rem;
  }
}

  html[data-theme="dark"] .theme-option__input {
    border-color: var(--color-slate-500);
    background: var(--color-slate-800);
  }

    html[data-theme="dark"] .theme-option__input:hover {
      border-color: var(--color-primary-400);
    }

    html[data-theme="dark"] .theme-option__input:checked {
      border-color: var(--color-primary-400);
      background: var(--color-primary-400);
      box-shadow: inset 0 0 0 3px var(--color-slate-800);
    }

    /* stylelint-disable-next-line no-descending-specificity */
    html[data-theme="dark"] .theme-option__icon {
      color: var(--color-slate-400);
    }

  /* Dark mode - Theme Preferences */
  /* stylelint-disable-next-line no-descending-specificity */
  html[data-theme="dark"] .theme-option {
    border-color: var(--color-border-dark);
    background: transparent;
  }

    html[data-theme="dark"] .theme-option:hover {
      border-color: var(--color-slate-500);
      background: var(--color-slate-800);
    }

    html[data-theme="dark"] .theme-option:has(.theme-option__input:checked) {
      border-color: var(--color-primary-400);
      background: var(--color-indigo-alpha-10);
    }

      html[data-theme="dark"] .theme-option:has(.theme-option__input:checked) .theme-option__icon {
        color: var(--color-primary-400);
      }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme]) .theme-option__input {
      border-color: var(--color-slate-500);
      background: var(--color-slate-800);
    }

      html:not([data-theme]) .theme-option__input:hover {
        border-color: var(--color-primary-400);
      }

      html:not([data-theme]) .theme-option__input:checked {
        border-color: var(--color-primary-400);
        background: var(--color-primary-400);
        box-shadow: inset 0 0 0 3px var(--color-slate-800);
      }

      html:not([data-theme]) .theme-option__icon {
        color: var(--color-slate-400);
      }

    html:not([data-theme]) .theme-option {
      border-color: var(--color-border-dark);
      background: transparent;
    }

      html:not([data-theme]) .theme-option:hover {
        border-color: var(--color-slate-500);
        background: var(--color-slate-800);
      }

      html:not([data-theme]) .theme-option:has(.theme-option__input:checked) {
        border-color: var(--color-primary-400);
        background: rgba(99, 102, 241, 0.1);
      }

        html:not([data-theme]) .theme-option:has(.theme-option__input:checked) .theme-option__icon {
          color: var(--color-primary-400);
        }
  }

} /* @layer components */
