.mhrf-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 18px;
  z-index: 99999;
}

/* Ensure brand font vars are available even if modal is appended outside .mhrf-wrap */
.mhrf-modal,
.mhrf-modal__panel{
  --mhrf-font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mhrf-font-display: "Fraunces", Georgia, "Times New Roman", serif;
  font-family: var(--mhrf-font-ui);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mhrf-modal-card{
  width: 100%;
  max-width: 420px;
  background: rgba(10,10,14,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 20px 70px rgba(0,0,0,.6);
}
.mhrf-modal-title{ font-size: 26px; margin: 0 0 6px; font-weight: 900; }
.mhrf-modal-sub{ margin:0 0 14px; color: rgba(244,245,247,.7); font-size: 13px; }

.mhrf-color-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items:center;
}
.mhrf-color-swatch{
  position:relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  cursor:pointer;
}
.mhrf-swatch-check{
  position:absolute;
  top: 8px;
  left: 10px;
  font-weight: 900;
  color: rgba(0,0,0,.75);
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
}
.mhrf-color-label{
  font-size: 12px;
  color: rgba(244,245,247,.65);
  margin-top: -4px;
}
.mhrf-btn-row{ display:flex; gap:10px; margin-top: 14px; }
.mhrf-btn-row .mhrf-btn{ margin-top:0; }

.mhrf-section-title{ font-size: 12px; color: rgba(244,245,247,.75); font-weight: 800; margin: 10px 0 12px; }
.mhrf-step{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.22);
  margin-top: 10px;
}
.mhrf-step-left{ display:flex; gap:12px; align-items:center; }
.mhrf-step-check, .mhrf-step-num{
  width: 26px; height: 26px; border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  font-weight: 900;
  background: rgba(192,19,58,.18);
  border: 1px solid rgba(192,19,58,.28);
}
.mhrf-step.is-done{ background: rgba(192,19,58,.10); border-color: rgba(192,19,58,.18); }
.mhrf-step-title{ font-weight: 900; font-size: 13px; }
.mhrf-step-sub{ color: rgba(244,245,247,.65); font-size: 12px; }
.mhrf-pill-muted{ opacity:.75; }

.mhrf-switch{ position:relative; width: 46px; height: 26px; display:inline-block;}
.mhrf-switch input{ display:none; }
.mhrf-switch span{
  position:absolute; inset:0; background: rgba(255,255,255,.10); border-radius:999px; border:1px solid rgba(255,255,255,.12);
}
.mhrf-locknote{
  display:flex; gap:12px; align-items:center;
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.08);
}
.mhrf-lockicon{ font-size: 18px; }

.mhrf-status{ display:flex; gap:10px; align-items:center; padding: 10px 12px; border-radius: 16px; background: rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.08); }
.mhrf-status-dot{ width:10px; height:10px; border-radius:999px; background: rgba(192,19,58,.85); box-shadow: 0 0 0 4px rgba(192,19,58,.18); }


/* === Theme color picker modal: match SUB grid pixel feel === */
#mhrf-theme-modal .mhrf-modal-card{
  max-width: 520px;
  padding: 24px 22px 20px;
  border-radius: 28px;
}
#mhrf-theme-modal .mhrf-modal-title{ font-size: 32px; margin-bottom: 8px; letter-spacing: -0.3px; }
#mhrf-theme-modal .mhrf-modal-sub{ margin-bottom: 18px; font-size: 14px; }
#mhrf-theme-modal .mhrf-btn-row{ margin-top: 20px; gap: 14px; }
#mhrf-theme-modal .mhrf-btn-row .mhrf-btn{ padding-top: 14px; padding-bottom: 14px; }


/* ------------------------------------------------------------
   BEM-style modal panel (welcome profile) – match brand cards
------------------------------------------------------------ */
.mhrf-modal__panel{
  width: 100%;
  max-width: 520px;
  background: rgba(10,10,14,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  box-shadow: 0 14px 60px rgba(0,0,0,.55);
  padding: 18px;
}
.mhrf-modal__header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.mhrf-modal__title{
  font-family: var(--mhrf-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.mhrf-modal__title--xl{
  font-size: 40px;
  line-height: 1.05;
}
.mhrf-modal__subtitle{
  margin-top: 8px;
  color: rgba(255,255,255,.68);
  font-size: 14px;
}
.mhrf-modal__close{
  width: 44px;
  height: 44px;
  border-radius: 14px;
}
/* Reinforce field rounding inside profile modal (theme-safe) */
.mhrf-modal__panel--profile .mhrf-input,
.mhrf-modal__panel--profile .mhrf-textarea{
  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background: rgba(0,0,0,.35) !important;
}
/* Avatar chip initial centering (when no image) */
.mhrf-avatarchip__fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 100%;
  height: 100%;
  font-weight: 900;
}


/* Typography hardening (theme-safe): ensure profile modal matches brand */
.mhrf-modal__panel--profile{
  font-family: var(--mhrf-font-ui) !important;
}
.mhrf-modal__panel--profile .mhrf-modal__title{
  font-family: var(--mhrf-font-display) !important;
  font-weight: 600 !important;
}
.mhrf-modal__panel--profile .mhrf-modal__subtitle,
.mhrf-modal__panel--profile .mhrf-label,
.mhrf-modal__panel--profile .mhrf-input,
.mhrf-modal__panel--profile .mhrf-textarea,
.mhrf-modal__panel--profile .mhrf-btn,
.mhrf-modal__panel--profile button{
  font-family: var(--mhrf-font-ui) !important;
}


/* Typography enforcement for profile modal panel */
.mhrf-modal__panel.mhrf-modal__panel--profile,
.mhrf-modal__panel.mhrf-modal__panel--profile *{
  font-family: var(--mhrf-font-ui) !important;
}
.mhrf-modal__panel.mhrf-modal__panel--profile .mhrf-modal__title,
.mhrf-modal__panel.mhrf-modal__panel--profile .mhrf-modal__title *{
  font-family: var(--mhrf-font-display) !important;
  font-weight: 600 !important;
}
.mhrf-modal__panel.mhrf-modal__panel--profile .mhrf-modal__subtitle{
  font-family: var(--mhrf-font-ui) !important;
}
