/* Conta e preferências (#modalProfile) — fonte única de estilo do painel.
   Carregar por último no index para vencer liquid/glass/mobile. */

/* Peças da folha Minha conta só existem no celular (pm-mobile-map.css). */
.pm-um-sheet-only {
  display: none;
}

#userMenu .user-menu-card {
  display: contents;
}

button.user-menu-header {
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#modalProfile.pm-modal-backdrop {
  --pm-prefs-ink: var(--pm-color-ink, #172438);
  --pm-prefs-muted: var(--pm-color-muted, #65798f);
  --pm-prefs-line: var(--pm-color-line, #e1e8f0);
  --pm-prefs-surface: var(--pm-color-card, #ffffff);
  --pm-prefs-soft: var(--pm-color-surface, #f3f6fa);
  --pm-prefs-primary: var(--pm-color-primary, #2476ce);
  --pm-prefs-font: var(--pm-font-ui, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif);
}

/* Blur só no overlay (borra a janela atrás). O painel interno fica opaco, sem glass. */
#modalProfile.pm-modal-backdrop,
#modalProfile.pm-modal-backdrop.open {
  backdrop-filter: blur(12px) saturate(1.05) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.05) !important;
}

#modalProfile .pm-modal.pm-user-prefs-modal,
#modalProfile .pm-modal-head,
#modalProfile .pm-modal-body,
#modalProfile .pm-user-prefs-head,
#modalProfile .pm-user-prefs-body {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-image: none !important;
}

#modalProfile .pm-modal.pm-user-prefs-modal {
  width: min(1080px, calc(100vw - 32px));
  max-width: 1080px;
  height: min(760px, calc(100vh - 40px));
  max-height: min(760px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--pm-prefs-surface) !important;
  border: 1px solid rgba(23, 36, 56, 0.08);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(23, 36, 56, 0.18);
  color: var(--pm-prefs-ink);
  font-family: var(--pm-prefs-font);
}

#modalProfile .pm-user-prefs-layout {
  position: relative;
  display: flex;
  min-height: 0;
  height: 100%;
}

#modalProfile .pm-user-prefs-nav {
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 14px 18px;
  background: #f6f8fb;
  border-right: 1px solid var(--pm-prefs-line);
}

#modalProfile .pm-user-prefs-brand-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--pm-prefs-ink);
}

#modalProfile .pm-user-prefs-brand-sub {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--pm-prefs-muted);
}

#modalProfile .pm-user-prefs-tabs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  margin-top: 22px;
  overflow: auto;
}

#modalProfile .pm-user-prefs-group[hidden] {
  display: none !important;
}

#modalProfile .pm-user-prefs-group-label {
  margin: 0 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b9aab;
}

#modalProfile .pm-user-prefs-tab {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3d4d61;
  font-family: var(--pm-prefs-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

#modalProfile .pm-user-prefs-tab-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #7b8b9e;
}

#modalProfile .pm-user-prefs-tab[hidden] {
  display: none !important;
}

#modalProfile .pm-user-prefs-tab:hover {
  background: rgba(36, 118, 206, 0.06);
}

#modalProfile .pm-user-prefs-tab:focus,
#modalProfile .pm-user-prefs-tab:focus-visible {
  outline: none;
  box-shadow: none;
}

#modalProfile .pm-user-prefs-tab.is-active {
  border: 0;
  background: #e8f1fb;
  color: var(--pm-prefs-primary);
  box-shadow: none;
}

#modalProfile .pm-user-prefs-tab.is-active .pm-user-prefs-tab-icon {
  color: var(--pm-prefs-primary);
}

#modalProfile .pm-user-prefs-main {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

#modalProfile .pm-user-prefs-back {
  display: none;
}

#modalProfile .pm-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5d6d80;
  cursor: pointer;
  transform: none !important;
}

#modalProfile .pm-modal-close:hover {
  transform: none !important;
  background: #ffffff;
  border-color: rgba(23, 36, 56, 0.18);
  color: var(--pm-prefs-ink);
}

#modalProfile .pm-user-prefs-body.pm-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 22px 28px 28px;
  margin: 0;
  background: #fff !important;
  color: var(--pm-prefs-ink);
}

#modalProfile .pm-prefs-page-head {
  margin: 0 40px 16px 0;
}

#modalProfile .pm-prefs-page-title,
#modalProfile .pm-cookie-prefs-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--pm-prefs-ink);
}

#modalProfile .pm-prefs-page-lead {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--pm-prefs-muted);
}

#modalProfile .pm-prefs-lead-narrow,
#modalProfile .pm-settings-group-title,
#modalProfile .pm-settings-note {
  display: none;
}

#modalProfile .profile-security-heading {
  display: block;
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pm-prefs-ink);
}

#modalProfile .pm-settings-card {
  display: contents;
}

#modalProfile .pm-user-prefs-panel {
  min-height: 100%;
  color: var(--pm-prefs-ink);
}

#modalProfile .pm-user-prefs-panel[hidden] {
  display: none !important;
}

#modalProfile .profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f3f7fc;
}

#modalProfile .profile-avatar-xl {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 22px;
  color: #ffffff;
  background: var(--pm-prefs-primary);
  box-shadow: none;
}

#modalProfile .profile-identity-text {
  min-width: 0;
  flex: 1 1 auto;
}

#modalProfile .profile-identity-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--pm-prefs-ink);
}

#modalProfile .profile-identity-email {
  margin-top: 1px;
  font-size: 13px;
  color: var(--pm-prefs-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#modalProfile .profile-identity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
}

#modalProfile .profile-identity-role,
#modalProfile .profile-identity-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.35;
}

#modalProfile .profile-identity-role {
  background: #e7f1fb;
  color: #1d6fbf;
}

#modalProfile .profile-identity-status {
  background: #e7f6ec;
  color: #1f8a4c;
}

#modalProfile .profile-identity-status::before {
  content: none;
}

#modalProfile .profile-avatar-xl img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#modalProfile .profile-section {
  margin-top: 18px;
}

#modalProfile .profile-section-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}

#modalProfile .profile-section-lead {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--pm-prefs-muted);
}

#modalProfile .profile-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 14px 16px;
  border: 1px solid var(--pm-prefs-line);
  border-radius: 12px;
}

#modalProfile .profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#modalProfile .profile-info-item.full {
  grid-column: span 2;
}

#modalProfile .pii-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pm-prefs-muted);
}

#modalProfile .pii-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--pm-prefs-ink);
}

#modalProfile .pii-value.is-missing {
  color: #c2410c;
  font-weight: 700;
}

#modalProfile .pii-value.is-empty {
  color: var(--pm-prefs-muted);
  font-weight: 600;
}

#modalProfile .profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

#modalProfile .profile-section-head .profile-section-title {
  margin: 0;
}

#modalProfile .profile-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#modalProfile .profile-section-actions .profile-ghost-btn,
#modalProfile .profile-section-actions .profile-primary-btn {
  min-height: 32px;
  padding: 5px 12px;
}

#modalProfile .profile-section-actions button:disabled {
  opacity: 0.6;
  cursor: default;
}

#modalProfile .profile-info-grid.is-editing [data-profile-edit] .pii-value {
  display: none;
}

#modalProfile .pii-input {
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #d5deea;
  border-radius: 8px;
  background: #fff;
  color: var(--pm-prefs-ink);
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

#modalProfile .pii-input:focus {
  outline: 2px solid rgba(18, 83, 168, 0.25);
  outline-offset: 0;
  border-color: var(--pm-prefs-primary);
}

#modalProfile .pii-input.is-invalid {
  border-color: #d92d20;
  background: #fff8f7;
}

#modalProfile .pii-input:disabled {
  opacity: 0.7;
}

#modalProfile .pii-error,
#modalProfile .pii-hint {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
}

#modalProfile .pii-error {
  color: #b42318;
}

#modalProfile .pii-hint {
  color: #1d7a4e;
}

#modalProfile .pii-input[hidden],
#modalProfile .pii-error[hidden],
#modalProfile .pii-hint[hidden],
#modalProfile .profile-edit-note[hidden],
#modalProfile .profile-section-actions [hidden] {
  display: none !important;
}

#modalProfile .profile-edit-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--pm-prefs-muted);
}

#modalProfile .pii-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--pm-prefs-line);
  background: var(--pm-prefs-soft);
  color: var(--pm-prefs-ink);
}

#modalProfile .pii-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

#modalProfile .pii-perm {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

#modalProfile .pii-perm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#modalProfile .pii-perm.on {
  border: 1px solid #b7e4c7;
  background: #f3fbf6;
  color: #17693a;
}

#modalProfile .pii-perm.off {
  border: 1px solid var(--pm-prefs-line);
  background: #f4f6f8;
  color: #66788c;
}

#modalProfile .profile-ghost-btn,
#modalProfile .profile-primary-btn {
  appearance: none;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 8px;
  font-family: var(--pm-prefs-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

#modalProfile .profile-ghost-btn {
  border: 1px solid #d5deea;
  background: #fff;
  color: var(--pm-prefs-ink);
}

#modalProfile .profile-ghost-btn:hover {
  border-color: #b7c5d6;
  background: #f8fafc;
}

#modalProfile .profile-primary-btn {
  border: 0;
  background: var(--pm-prefs-primary);
  color: #fff;
}

#modalProfile .profile-primary-btn:hover {
  background: #1d5fa8;
}

#modalProfile #profileOnboardingCta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8eb;
  border: 1px solid #f3e0b5;
}

#modalProfile #profileOnboardingCta[hidden] {
  display: none !important;
}

#modalProfile .profile-onboarding-cta__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff1d6;
  color: #d97706;
}

#modalProfile .profile-onboarding-cta__copy {
  flex: 1 1 auto;
  min-width: 0;
}

#modalProfile .profile-onboarding-cta__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--pm-prefs-ink);
}

#modalProfile #profileOnboardingCta .profile-onboarding-cta__text {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #5c6b7c;
}

#modalProfile .profile-security {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--pm-prefs-line);
  border-radius: 12px;
}

#modalProfile .profile-security-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #f3f6fa;
  color: #5d6d80;
}

#modalProfile .profile-security-copy {
  flex: 1 1 auto;
  min-width: 0;
}

#modalProfile .profile-security-title {
  font-size: 14px;
  font-weight: 700;
}

#modalProfile .profile-security-desc {
  margin-top: 2px;
  font-size: 13px;
  color: var(--pm-prefs-muted);
}

#modalProfile .profile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  padding: 8px 12px;
  border: 1px solid var(--pm-prefs-line);
  border-radius: 8px;
  background: #fff;
  color: var(--pm-prefs-ink);
  font-family: var(--pm-prefs-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

#modalProfile .profile-action-btn:hover {
  background: #ffffff;
  border-color: rgba(23, 36, 56, 0.18);
  transform: none;
}

#modalProfile .profile-action-btn:active {
  transform: none;
}

#modalProfile .profile-action-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex: 0 0 auto;
}

#modalProfile .setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--pm-prefs-line);
  background: var(--pm-prefs-soft);
  margin-bottom: 10px;
  color: var(--pm-prefs-ink);
}

#modalProfile .setting-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--pm-prefs-ink);
}

#modalProfile .setting-desc {
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.35;
  color: var(--pm-prefs-muted);
}

#modalProfile .divider {
  height: 1px;
  background: var(--pm-prefs-line);
  margin: 10px 0 12px;
}

#modalProfile #btnReset.pm-user-prefs-reset,
#modalProfile #btnReset,
#modalProfile #pmCookiePrefsSave.pm-user-prefs-reset,
#modalProfile #pmCookiePrefsSave {
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--pm-prefs-line);
  border-radius: 12px;
  background: var(--pm-prefs-primary);
  color: #ffffff;
  font-family: var(--pm-prefs-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
  position: static;
  overflow: visible;
}

#modalProfile #btnReset::after,
#modalProfile #btnReset.pm-user-prefs-reset::after,
#modalProfile #pmCookiePrefsSave::after {
  content: none !important;
  display: none !important;
}

#modalProfile #btnReset:hover,
#modalProfile #btnReset:active,
#modalProfile #btnReset:focus-visible {
  background: var(--pm-prefs-primary);
  color: #ffffff;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
}

#modalProfile #pmCookiePrefsSave.pm-user-prefs-reset,
#modalProfile #pmCookiePrefsSave {
  border-color: var(--pm-prefs-primary);
  transition: background 0.15s ease, border-color 0.15s ease !important;
}

#modalProfile #pmCookiePrefsSave:hover,
#modalProfile #pmCookiePrefsSave:focus-visible {
  background: #1d5fa8;
  border-color: #1d5fa8;
  color: #ffffff;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
}

#modalProfile #pmCookiePrefsSave:active {
  background: #184e8a;
  border-color: #184e8a;
  color: #ffffff;
}

#modalProfile #userPrefsPanelCookies {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#modalProfile #userPrefsPanelCookies[hidden] {
  display: none !important;
}

#modalProfile .pm-cookie-prefs {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 100%;
}

#modalProfile .pm-cookie-prefs-save,
#modalProfile #pmCookiePrefsSave {
  margin-top: auto;
}

#modalProfile .pm-cookie-prefs-title,
#modalProfile .pm-legal-prefs-title,
#modalProfile .pm-user-prefs-placeholder h3 {
  margin: 0 40px 8px 0;
  font-family: var(--pm-prefs-font);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--pm-prefs-ink);
}

#modalProfile .pm-cookie-prefs-lead {
  margin: 0 0 16px;
  font: var(--pm-type-body-md, 400 14px/20px var(--pm-prefs-font));
  color: var(--pm-prefs-muted);
}

#modalProfile .pm-cookie-prefs-link {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: var(--pm-prefs-primary);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

#modalProfile .pm-cookie-prefs-row .switch {
  cursor: pointer;
}

#modalProfile .pm-cookie-prefs-row .switch span {
  cursor: pointer;
}

#modalProfile .pm-cookie-prefs-row .switch:has(input:disabled),
#modalProfile .pm-cookie-prefs-row .switch input:disabled + span {
  opacity: 0.72;
  cursor: not-allowed;
}

/* `hidden` precisa vencer o display:flex de .setting */
#modalProfile .setting[hidden],
#modalProfile .pm-cookie-prefs-row[hidden] {
  display: none !important;
}

#modalProfile .pm-user-prefs-placeholder p {
  margin: 0 0 14px;
  font: var(--pm-type-body-md, 400 14px/20px var(--pm-prefs-font));
  color: var(--pm-prefs-muted);
}

#modalProfile .pm-user-prefs-placeholder-field {
  width: 100%;
  min-height: 160px;
  height: 220px;
  resize: none;
  padding: 12px 14px;
  border: 1.5px solid var(--pm-prefs-line);
  border-radius: 12px;
  background: var(--pm-prefs-soft);
  color: var(--pm-prefs-ink);
  font: var(--pm-type-body-md, 400 14px/20px var(--pm-prefs-font));
}

@media (max-width: 767px) {
  #modalProfile.pm-modal-backdrop.open {
    align-items: flex-end !important;
    justify-content: stretch !important;
    padding: 0 !important;
    background: rgba(15, 23, 42, 0.32) !important;
  }

  #modalProfile .pm-modal.pm-user-prefs-modal {
    position: relative;
    width: 100% !important;
    max-width: none !important;
    height: calc(100dvh - var(--pm-safe-top, env(safe-area-inset-top, 0px)) - 24px) !important;
    max-height: calc(100dvh - var(--pm-safe-top, env(safe-area-inset-top, 0px)) - 24px) !important;
    border: 0;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -8px 32px rgba(23, 46, 77, 0.18);
    background: #f5f6f8 !important;
    padding: 10px 0 env(safe-area-inset-bottom, 0px);
    transition: none;
  }

  #modalProfile.pm-modal-backdrop.open .pm-modal.pm-user-prefs-modal {
    animation: pmUmSheetUp 0.34s cubic-bezier(0.32, 0.72, 0, 1) both;
  }

  #modalProfile .pm-modal.pm-user-prefs-modal::before {
    content: "";
    display: block;
    width: 40px;
    height: 5px;
    margin: 0 auto 6px;
    border-radius: 3px;
    background: #d3dae3;
  }

  #modalProfile .pm-user-prefs-layout {
    flex-direction: column;
    height: 100%;
    background: #fff;
  }

  #modalProfile .pm-user-prefs-nav,
  #modalProfile .pm-user-prefs-main {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: #fff;
  }

  #modalProfile:not(.is-section) .pm-user-prefs-main {
    display: none;
  }

  #modalProfile.is-section .pm-user-prefs-nav {
    display: none;
  }

  #modalProfile .pm-user-prefs-layout,
  #modalProfile .pm-user-prefs-nav,
  #modalProfile .pm-user-prefs-main,
  #modalProfile .pm-user-prefs-body.pm-modal-body {
    background: #f4f6f8 !important;
  }

  #modalProfile.is-section .pm-modal-close {
    display: none;
  }

  #modalProfile .pm-user-prefs-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 16px 0;
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--pm-prefs-primary);
    font: 700 14px/1.2 var(--pm-prefs-font);
    cursor: pointer;
  }

  #modalProfile .pm-user-prefs-back::before {
    content: "‹";
    font-size: 18px;
    line-height: 1;
  }

  #modalProfile .pm-modal-close {
    top: 12px;
    right: 12px;
    border-radius: 50%;
    background: #eaf3ff;
    color: var(--pm-prefs-primary);
  }

  #modalProfile .pm-user-prefs-body.pm-modal-body {
    padding: 8px 16px 20px;
  }

  #modalProfile #userPrefsPanelProfile .pm-prefs-page-lead {
    display: none;
  }

  #modalProfile .pm-prefs-lead-wide,
  #modalProfile .pm-prefs-desktop-only {
    display: none !important;
  }

  #modalProfile .pm-prefs-lead-narrow {
    display: inline;
  }

  #modalProfile .pm-cookie-card,
  #modalProfile .pm-cookie-footer {
    display: contents;
  }

  #modalProfile .pm-settings-group {
    margin-top: 16px;
  }

  #modalProfile .pm-settings-group-title,
  #modalProfile .profile-security-heading {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--pm-prefs-ink);
  }

  #modalProfile .pm-settings-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--pm-prefs-line);
    border-radius: 14px;
    background: #fff;
  }

  #modalProfile .pm-settings-card .setting {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 14px 16px;
  }

  #modalProfile .pm-settings-card .setting + .setting {
    border-top: 1px solid var(--pm-prefs-line);
  }

  #modalProfile .pm-settings-note {
    display: block;
    margin: 14px 0 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--pm-prefs-muted);
  }

  #modalProfile #btnReset.pm-user-prefs-reset,
  #modalProfile #btnReset {
    background: #fff;
    color: var(--pm-prefs-ink);
    border-color: var(--pm-prefs-line);
  }

  #modalProfile .profile-identity {
    position: relative;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--pm-prefs-line);
  }

  #modalProfile .profile-avatar-xl {
    position: relative;
  }

  #modalProfile #profileChangePhotoBtn {
    position: absolute;
    top: 46px;
    left: 48px;
    bottom: auto;
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1f4b86 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-2h6l2 2h3a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z'/%3E%3Ccircle cx='12' cy='13' r='3.2'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
    color: transparent;
    font-size: 0;
    overflow: hidden;
  }

  #modalProfile .profile-identity-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #modalProfile .profile-identity-status {
    padding: 2px 8px;
    border-radius: 999px;
    background: #e7f6ec;
    font-weight: 600;
  }

  #modalProfile .profile-identity-status::before {
    display: none;
  }

  #modalProfile #profileOnboardingCta {
    flex-wrap: wrap;
    align-items: flex-start;
    background: #fff8eb;
  }

  #modalProfile #profileOnboardingCtaBtn {
    flex: 1 1 100%;
    min-height: 40px;
  }

  #modalProfile .profile-info-grid,
  #modalProfile .profile-security {
    background: #fff;
  }

  #modalProfile .profile-security {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
    row-gap: 12px;
  }

  #modalProfile #profileChangePassBtn {
    grid-column: 1 / -1;
    width: 100%;
  }

  #modalProfile .pii-perms {
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--pm-prefs-line);
    border-radius: 12px;
    background: #fff;
  }

  #modalProfile .pii-perm {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  #modalProfile .pii-perm + .pii-perm {
    border-top: 1px solid var(--pm-prefs-line);
  }

  #modalProfile .pii-perm.on,
  #modalProfile .pii-perm.off {
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  #modalProfile .pm-legal-doc__reader {
    grid-template-columns: 1fr;
  }

  #modalProfile .pm-prefs-page-title,
  #modalProfile .pm-cookie-prefs-title {
    font-size: 22px;
    font-weight: 700;
  }

  #modalProfile .profile-identity {
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(23, 46, 77, 0.04);
  }

  #modalProfile .profile-identity-role {
    color: #2476ce;
    font-weight: 700;
  }

  #modalProfile #profileOnboardingCta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: #fff6e8;
  }

  #modalProfile #profileOnboardingCta .profile-onboarding-cta__icon {
    display: none;
  }

  #modalProfile #profileOnboardingCtaBtn {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
  }

  #modalProfile .profile-section-title,
  #modalProfile .profile-security-heading {
    margin: 18px 0 8px;
    font-size: 16px;
  }

  #modalProfile .profile-section-head {
    margin: 18px 0 8px;
  }

  #modalProfile .pii-input {
    min-height: 40px;
    font-size: 16px;
  }

  #modalProfile .profile-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
  }

  #modalProfile .pii-perms {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
  }

  #modalProfile .pii-perm {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #172438;
    font-size: 15px;
    font-weight: 500;
  }

  #modalProfile .pii-perm.on,
  #modalProfile .pii-perm.off {
    border: 0;
    background: #fff;
  }

  #modalProfile .pii-perm.on {
    color: #172438;
  }

  #modalProfile .pii-perm.off {
    color: #8b9aab;
  }

  #modalProfile .pii-perm > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
  }

  #modalProfile .pii-perm.on > span {
    background: #e7f6ec;
    color: #1f8a4c;
  }

  #modalProfile .pii-perm.off > span {
    background: #eef2f6;
    color: #8b9aab;
  }

  #modalProfile .profile-security {
    padding: 14px;
    border: 1px solid var(--pm-prefs-line);
    border-radius: 16px;
  }

  #modalProfile #profileChangePassBtn {
    min-height: 44px;
    border-radius: 12px;
  }

  #modalProfile .pm-cookie-prefs .pm-cookie-prefs-row,
  #modalProfile .pm-cookie-prefs .setting {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  #modalProfile .pm-cookie-prefs {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  #modalProfile .pm-cookie-prefs .setting {
    border: 1px solid var(--pm-prefs-line);
  }

  #modalProfile .pm-cookie-prefs .setting + .setting {
    border-top: 0;
  }

  #modalProfile .pm-cookie-prefs .setting:first-of-type {
    border-radius: 16px 16px 0 0;
  }

  #modalProfile .pm-cookie-prefs .setting:last-of-type {
    border-radius: 0 0 16px 16px;
  }

  #modalProfile .switch {
    position: relative;
    flex: 0 0 51px;
    width: 51px;
    height: 31px;
    min-width: 51px;
  }

  #modalProfile .setting-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  #modalProfile .switch span {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 999px;
    background: #d5deea;
  }

  #modalProfile .switch input:checked + span {
    background: #2476ce;
    border: 0;
  }

  #modalProfile .switch span::after {
    width: 25px;
    height: 25px;
    top: 3px;
    left: 3px;
    transform: none;
    box-shadow: 0 1px 2px rgba(23, 36, 56, 0.25);
  }

  #modalProfile .switch input:checked + span::after {
    left: 23px;
  }

  #modalProfile .pm-settings-card,
  #modalProfile .pm-cookie-prefs .setting {
    overflow: hidden;
  }

  #modalProfile #userPrefsPanelCookies {
    padding-bottom: 24px;
  }
}

/* Desktop: quadros "Desktop 1440 — Minha conta" da proposta no Figma. */
@media (min-width: 768px) {
  #modalProfile.pm-modal-backdrop {
    --pm-prefs-ink: #0f2347;
    --pm-prefs-body: #33415c;
    --pm-prefs-muted: #5e6b82;
    --pm-prefs-line: #e1e7f0;
    --pm-prefs-soft: #f5f7fb;
    --pm-prefs-primary: #1253a8;
    --pm-prefs-primary-hover: #0e468f;
    --pm-prefs-primary-soft: #eaf1fb;
    --pm-prefs-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  }

  #modalProfile .pm-modal.pm-user-prefs-modal {
    height: min(872px, calc(100vh - 40px));
    max-height: min(872px, calc(100vh - 40px));
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(15, 35, 71, 0.22);
  }

  /* Barra lateral */
  #modalProfile .pm-user-prefs-nav {
    flex: 0 0 272px;
    padding: 28px 16px 24px;
    background: var(--pm-prefs-soft);
    border-right-color: var(--pm-prefs-line);
  }

  #modalProfile .pm-user-prefs-brand {
    padding: 0 12px;
  }

  #modalProfile .pm-user-prefs-brand-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
  }

  #modalProfile .pm-user-prefs-brand-sub {
    margin-top: 4px;
    font-size: 12px;
    line-height: 16px;
  }

  #modalProfile .pm-user-prefs-tabs {
    gap: 32px;
    margin-top: 28px;
  }

  #modalProfile .pm-user-prefs-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  #modalProfile .pm-user-prefs-group-label {
    margin: 0 12px 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    color: var(--pm-prefs-muted);
  }

  #modalProfile .pm-user-prefs-tab {
    gap: 12px;
    min-height: 36px;
    padding: 8px 12px;
    color: var(--pm-prefs-body);
    font-size: 13px;
    font-weight: 400;
  }

  #modalProfile .pm-user-prefs-tab-icon {
    color: var(--pm-prefs-muted);
  }

  #modalProfile .pm-user-prefs-tab:hover {
    background: rgba(18, 83, 168, 0.05);
  }

  #modalProfile .pm-user-prefs-tab.is-active {
    background: var(--pm-prefs-primary-soft);
    font-weight: 500;
  }

  /* Coluna principal */
  #modalProfile .pm-user-prefs-body.pm-modal-body {
    padding: 32px 40px;
  }

  #modalProfile .pm-modal-close {
    top: 32px;
    right: 40px;
    background: var(--pm-prefs-soft);
    color: var(--pm-prefs-body);
  }

  #modalProfile .pm-modal-close:hover {
    background: #eaeef5;
    color: var(--pm-prefs-ink);
  }

  #modalProfile .pm-prefs-page-head,
  #modalProfile .pm-cookie-prefs-head {
    margin: 0 56px 24px 0;
  }

  #modalProfile .pm-prefs-page-title,
  #modalProfile .pm-cookie-prefs-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: -0.01em;
  }

  #modalProfile .pm-prefs-page-lead,
  #modalProfile .pm-cookie-prefs-lead {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 20px;
    color: var(--pm-prefs-muted);
  }

  #modalProfile .profile-ghost-btn,
  #modalProfile .profile-primary-btn {
    min-height: 40px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
  }

  #modalProfile .profile-ghost-btn {
    border-color: var(--pm-prefs-line);
  }

  #modalProfile .profile-ghost-btn:hover {
    border-color: #c9d3e0;
  }

  #modalProfile .profile-primary-btn:hover {
    background: var(--pm-prefs-primary-hover);
  }

  /* Perfil do usuário */
  #modalProfile .profile-identity {
    gap: 20px;
    margin: 0;
    padding: 20px;
    border: 1px solid #c9dbf3;
    border-radius: 14px;
    background: var(--pm-prefs-primary-soft);
  }

  #modalProfile .profile-avatar-xl {
    width: 80px;
    height: 80px;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(15, 35, 71, 0.16);
    font-size: 28px;
    font-weight: 600;
  }

  #modalProfile .profile-identity-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
  }

  #modalProfile .profile-identity-email {
    margin-top: 6px;
    font-size: 13px;
    line-height: 20px;
    color: var(--pm-prefs-body);
  }

  #modalProfile .profile-identity-meta {
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
  }

  #modalProfile .profile-identity-role,
  #modalProfile .profile-identity-status {
    min-height: 22px;
    padding: 3px 10px;
    line-height: 16px;
  }

  #modalProfile .profile-identity-role {
    background: var(--pm-prefs-primary-soft);
    color: var(--pm-prefs-primary);
  }

  #modalProfile .profile-identity-status {
    background: #e6f4ec;
    color: #1d7a4e;
  }

  #modalProfile #profileOnboardingCta {
    gap: 12px;
    margin: 24px 0 0;
    padding: 16px 20px;
    border: 1px solid #f2d59b;
    border-radius: 14px;
    background: #fff6e3;
  }

  #modalProfile .profile-onboarding-cta__icon {
    width: 20px;
    height: 20px;
    background: none;
    color: #8f5300;
  }

  #modalProfile .profile-onboarding-cta__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
  }

  #modalProfile #profileOnboardingCta .profile-onboarding-cta__text {
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    color: var(--pm-prefs-body);
  }

  #modalProfile .profile-section {
    margin-top: 24px;
  }

  #modalProfile .profile-section-title,
  #modalProfile .profile-security-heading {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--pm-prefs-ink);
  }

  #modalProfile .profile-section-title:has(+ .profile-section-lead) {
    margin-bottom: 2px;
  }

  /* Botões alinhados à borda direita do "Alterar foto" (padding + borda do cartão). */
  #modalProfile .profile-section-head {
    min-height: 32px;
    margin: 0 0 12px;
    padding-right: 21px;
  }

  #modalProfile .pii-input {
    font-size: 13px;
    line-height: 20px;
  }

  #modalProfile .pii-input::placeholder {
    color: #9aa5b8;
  }

  #modalProfile .profile-section-lead {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 18px;
  }

  #modalProfile .profile-security-heading {
    margin-top: 24px;
  }

  #modalProfile .profile-info-grid {
    gap: 20px 24px;
    padding: 20px;
    border-radius: 14px;
  }

  #modalProfile .profile-info-item {
    gap: 4px;
  }

  #modalProfile .pii-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 0.04em;
  }

  #modalProfile .pii-value {
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
  }

  #modalProfile .pii-value.is-missing {
    color: #8f5300;
    font-weight: 500;
  }

  #modalProfile .pii-value.is-empty {
    font-weight: 400;
  }

  #modalProfile .pii-perms {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
  }

  #modalProfile .pii-perm {
    gap: 10px;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
  }

  #modalProfile .pii-perm.on {
    border-color: var(--pm-prefs-line);
    background: #fff;
    color: var(--pm-prefs-ink);
  }

  #modalProfile .pii-perm.off {
    border-color: var(--pm-prefs-line);
    background: var(--pm-prefs-soft);
    color: var(--pm-prefs-muted);
    font-weight: 400;
  }

  #modalProfile .pii-perm > span {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
  }

  #modalProfile .pii-perm.on > span {
    background: #e6f4ec;
    color: #1d7a4e;
  }

  #modalProfile .pii-perm.on > span svg {
    width: 11px;
    height: 11px;
  }

  #modalProfile .pii-perm.off > span {
    color: #8e99ac;
  }

  #modalProfile .profile-security {
    gap: 14px;
    padding: 16px 20px;
    border-radius: 14px;
  }

  #modalProfile .profile-security-icon {
    width: 36px;
    height: 36px;
    background: var(--pm-prefs-primary-soft);
    color: var(--pm-prefs-primary);
  }

  #modalProfile .profile-security-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
  }

  #modalProfile .profile-security-desc {
    margin-top: 0;
    font-size: 12px;
    line-height: 18px;
  }

  /* Configurações do sistema e Preferências de cookies */
  #modalProfile .pm-settings-group {
    margin-top: 24px;
  }

  #modalProfile .pm-prefs-page-head + .pm-settings-group {
    margin-top: 0;
  }

  #modalProfile .pm-settings-group-title,
  #modalProfile .pm-cookie-prefs-cats {
    display: block;
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--pm-prefs-ink);
  }

  #modalProfile .pm-settings-card,
  #modalProfile .pm-cookie-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--pm-prefs-line);
    border-radius: 14px;
    background: #fff;
  }

  #modalProfile .pm-settings-card .setting,
  #modalProfile .pm-cookie-card .setting {
    gap: 24px;
    margin: 0;
    padding: 16px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #modalProfile .pm-settings-card .setting + .setting,
  #modalProfile .pm-cookie-card .setting + .setting {
    border-top: 1px solid var(--pm-prefs-line);
  }

  #modalProfile .setting-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
  }

  #modalProfile .setting-desc {
    margin-top: 2px;
    font-size: 12px;
    line-height: 18px;
  }

  #modalProfile .switch {
    flex: 0 0 40px;
    width: 40px;
    height: 24px;
  }

  #modalProfile .switch span {
    border: 0;
    background: #c3ccd9;
  }

  #modalProfile .switch input:checked + span {
    background: var(--pm-prefs-primary);
  }

  #modalProfile .switch span::after {
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 35, 71, 0.2);
  }

  #modalProfile .switch input:checked + span::after {
    left: 18px;
  }

  #modalProfile .pm-cookie-prefs-row .switch:has(input:disabled) {
    opacity: 1;
  }

  #modalProfile .pm-cookie-prefs-row .switch input:disabled + span {
    opacity: 0.5;
  }

  #modalProfile .pm-settings-footer,
  #modalProfile .pm-cookie-footer {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  #modalProfile .pm-settings-footer {
    justify-content: space-between;
    margin-top: 24px;
  }

  #modalProfile .pm-cookie-footer {
    margin-top: auto;
    padding-top: 24px;
  }

  #modalProfile .pm-settings-note,
  #modalProfile .pm-cookie-footer-note {
    display: block;
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    color: var(--pm-prefs-muted);
  }

  #modalProfile .pm-cookie-footer-note {
    margin-right: auto;
  }

  #modalProfile #btnReset.pm-user-prefs-reset,
  #modalProfile #btnReset,
  #modalProfile #pmCookiePrefsSave.pm-user-prefs-reset,
  #modalProfile #pmCookiePrefsSave {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    margin-top: 0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
  }

  #modalProfile #btnReset.pm-user-prefs-reset,
  #modalProfile #btnReset,
  #modalProfile #btnReset:hover,
  #modalProfile #btnReset:active,
  #modalProfile #btnReset:focus-visible {
    border-color: var(--pm-prefs-line);
    background: #fff;
    color: var(--pm-prefs-ink);
  }

  #modalProfile #btnReset:hover {
    border-color: #c9d3e0;
    background: #f8fafc;
  }

  #modalProfile #pmCookiePrefsSave:hover,
  #modalProfile #pmCookiePrefsSave:focus-visible {
    border-color: var(--pm-prefs-primary-hover);
    background: var(--pm-prefs-primary-hover);
  }

  #modalProfile .pm-cookie-prefs-more {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 18px;
    color: var(--pm-prefs-muted);
  }

  #modalProfile .pm-cookie-prefs-more .pm-cookie-prefs-link {
    margin: 0 4px;
    font-weight: 500;
    text-underline-offset: 2px;
  }

  #modalProfile .pm-cookie-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--pm-prefs-body);
    font-size: 11px;
    font-weight: 600;
    line-height: 20px;
    vertical-align: middle;
  }
}

@media (max-width: 900px) {
  #modalProfile .profile-info-grid,
  #modalProfile .pii-perms {
    grid-template-columns: 1fr 1fr;
  }
}
