/* === MH OS Unified Glass Card / Modal Style === */
:root{
  --mh-glass-bg: rgba(20,20,20,0.65);
  --mh-glass-border: rgba(255,255,255,0.08);
  --mh-glass-radius: 16px;
  --mh-glass-shadow: 0 20px 40px rgba(0,0,0,.4);
}

/* Standardized “glass” surfaces */
.mh-card,
.mh-modal,
.mhrf-card,
.mhrf-modal,
.mhos-modal,
.mhosl-modal,
[data-mh-sub-modal],
.mh-reader-modal,
.mhosl-modal-card,
.mhos-modal-card{
  background: var(--mh-glass-bg) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--mh-glass-border);
  border-radius: var(--mh-glass-radius);
  box-shadow: var(--mh-glass-shadow);
}


/* === Unified Button System (cards/modals/screens) === */
:root{
  --mh-btn-radius: 999px;
  --mh-btn-pad-y: 14px;
  --mh-btn-pad-x: 18px;
  --mh-btn-font: 800;
  --mh-btn-border: rgba(255,255,255,0.10);
  --mh-btn-bg: rgba(255,255,255,0.06);
  --mh-btn-bg-hover: rgba(255,255,255,0.09);
  --mh-btn-text: rgba(244,245,247,0.95);
  --mh-btn-accent: var(--mh-accent, var(--mhrf-accent, #c0133a));
  --mh-btn-accent-hover: var(--mh-accent-2, var(--mhrf-accent-2, #e11d48));
}

/* Base button */
.mh-btn,
.mhrf-btn,
.mh-sub__btn,
button#mhrf-open-theme,
button#mhrf-open-dob,
button#mhrf-step1-continue,
button#mhrf-save-dob,
button.mh-sub__accent{
  border-radius: var(--mh-btn-radius) !important;
  padding: var(--mh-btn-pad-y) var(--mh-btn-pad-x) !important;
  font-weight: var(--mh-btn-font);
  border: 1px solid var(--mh-btn-border) !important;
  background: var(--mh-btn-bg) !important;
  color: var(--mh-btn-text) !important;
  cursor: pointer;
  transition: transform .06s ease, filter .12s ease, background .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.mh-btn:hover,
.mhrf-btn:hover,
.mh-sub__btn:hover,
button#mhrf-open-theme:hover,
button#mhrf-open-dob:hover,
button#mhrf-step1-continue:hover,
button#mhrf-save-dob:hover,
button.mh-sub__accent:hover{
  background: var(--mh-btn-bg-hover) !important;
}
.mh-btn:active,
.mhrf-btn:active,
.mh-sub__btn:active,
button#mhrf-open-theme:active,
button#mhrf-open-dob:active,
button#mhrf-step1-continue:active,
button#mhrf-save-dob:active,
button.mh-sub__accent:active{
  transform: translateY(1px);
}

/* Primary buttons (accent) */
.mh-btn--primary,
.mhrf-btn-primary,
button#mhrf-step1-continue,
button#mhrf-save-dob{
  background: var(--mh-btn-accent) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.12) !important;
}
.mh-btn--primary:hover,
.mhrf-btn-primary:hover,
button#mhrf-step1-continue:hover,
button#mhrf-save-dob:hover{
  background: var(--mh-btn-accent-hover) !important;
}

/* Ghost buttons */
.mh-btn--ghost,
.mhrf-btn-ghost,
button#mhrf-open-theme,
button#mhrf-open-dob{
  background: transparent !important;
}

/* Small pill (used in SUB accent picker trigger) */
button.mh-sub__accent{
  padding: 10px 14px !important;
  font-weight: 700;
}

/* Focus visibility */
.mh-btn:focus-visible,
.mhrf-btn:focus-visible,
.mh-sub__btn:focus-visible,
button#mhrf-open-theme:focus-visible,
button#mhrf-open-dob:focus-visible,
button#mhrf-step1-continue:focus-visible,
button#mhrf-save-dob:focus-visible,
button.mh-sub__accent:focus-visible{
  outline: 2px solid rgba(255,255,255,0.25);
  outline-offset: 2px;
}

/* Disabled */
.mh-btn:disabled,
.mhrf-btn:disabled,
.mh-sub__btn:disabled,
button#mhrf-open-theme:disabled,
button#mhrf-open-dob:disabled,
button#mhrf-step1-continue:disabled,
button#mhrf-save-dob:disabled,
button.mh-sub__accent:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* Hide age limit KV tablet */
.mhrf-age-lock .mhrf-kv.mhrf-mt {
  display: none !important;
}

/* Hide KV blocks on age limit screen */
.mhrf-age-lock .mhrf-kv,
.mhrf-age-lock .mhrf-kv.mhrf-mt {
  display: none !important;
}


/* === SUB Accent buttons: ensure color bubble is nicely contained === */
.mh-sub__accent{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center;
  gap:10px;
  border-radius: 999px !important;
  padding: 10px 14px !important;
  min-height: 44px;
  line-height: 1;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mh-sub__accent:hover{
  background: rgba(255,255,255,0.06) !important;
}
.mh-sub__accent:active{
  transform: translateY(1px);
}
.mh-sub__accent.is-active{
  background: var(--mh-accent-alpha) !important;
  border-color: rgba(255,255,255,0.14) !important;
}
.mh-sub__accent-dot{
  width: 14px !important;
  height: 14px !important;
  border-radius: 999px !important;
  flex: 0 0 14px;
  display:inline-block;
  box-shadow:
    0 0 0 2px rgba(0,0,0,0.35),
    0 0 0 3px rgba(255,255,255,0.10);
}
.mh-sub__accent-label{
  font-weight: 750;
  font-size: 14px;
  letter-spacing: 0.2px;
}


/* === SUB Accent buttons (B): inner ring + soft glow for active color bubble === */
.mh-sub__accent-dot{
  /* Ensure bubble shows true color without dimming */
  opacity: 1 !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
}

.mh-sub__accent.is-active .mh-sub__accent-dot{
  /* Inner ring + soft glow (no checkmark) */
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.85),
    0 0 0 1px rgba(0,0,0,0.35),
    0 0 14px rgba(255,255,255,0.18);
}

.mh-sub__accent:focus-visible .mh-sub__accent-dot{
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.85),
    0 0 0 2px rgba(255,255,255,0.22),
    0 0 16px rgba(255,255,255,0.16);
}


/* === FIX: Accent dot size + ensure color is visible === */
.mh-sub__accent-dot{
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  background-color: currentColor;
  opacity: 1 !important;
}

/* Force color tokens to apply */
.mh-sub__accent-dot--red{ background:#C1123A !important; }
.mh-sub__accent-dot--orange{ background:#FF8A1F !important; }
.mh-sub__accent-dot--amber{ background:#D4A017 !important; }
.mh-sub__accent-dot--lemon{ background:#FFF200 !important; }
.mh-sub__accent-dot--lime{ background:#7AC51D !important; }
.mh-sub__accent-dot--neon{ background:#39FF14 !important; }
.mh-sub__accent-dot--emerald{ background:#0F766E !important; }
.mh-sub__accent-dot--teal{ background:#14B8A6 !important; }
.mh-sub__accent-dot--cyan{ background:#0891B2 !important; }
.mh-sub__accent-dot--ice{ background:#D9F2FF !important; }
.mh-sub__accent-dot--sapphire{ background:#1D4ED8 !important; }
.mh-sub__accent-dot--slate{ background:#64748B !important; }
.mh-sub__accent-dot--violet{ background:#7C3AED !important; }
.mh-sub__accent-dot--lavender{ background:#C4B5FD !important; }
.mh-sub__accent-dot--magenta{ background:#C026D3 !important; }
.mh-sub__accent-dot--pink{ background:#FF7AB6 !important; }
.mh-sub__accent-dot--sand{ background:#F5E6C8 !important; }
.mh-sub__accent-dot--cocoa{ background:#8B5A2B !important; }


/* === Accent modal: tile grid to match design (4 fixed columns, centered labels) === */
[data-mh-sub-modal="accent"] .mh-sub__accentrow{
  display: grid !important;
  grid-template-columns: repeat(4, 76px) !important;
  justify-content: space-between !important;
  column-gap: 14px !important;
  row-gap: 18px !important;
  margin-top: 16px !important;
}

/* Button becomes wrapper */
[data-mh-sub-modal="accent"] .mh-sub__accent{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  min-height: auto !important;
  transform: none !important;
}

/* Tile */
[data-mh-sub-modal="accent"] .mh-sub__accent-dot{
  width: 76px !important;
  height: 76px !important;
  min-width: 76px !important;
  min-height: 76px !important;
  border-radius: 16px !important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.18),
    0 14px 28px rgba(0,0,0,0.38) !important;
  position: relative;
}

/* Label under tile */
[data-mh-sub-modal="accent"] .mh-sub__accent-label{
  width: 100%;
  text-align: center !important;
  font-weight: 650 !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  letter-spacing: 0.2px !important;
  color: rgba(255,255,255,0.78) !important;
}

/* Selected tile: checkmark badge top-left */
[data-mh-sub-modal="accent"] .mh-sub__accent.is-active .mh-sub__accent-dot{
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.20),
    0 14px 28px rgba(0,0,0,0.40) !important;
}
[data-mh-sub-modal="accent"] .mh-sub__accent.is-active .mh-sub__accent-dot::after{
  content: "✓";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  background: rgba(0,0,0,0.60);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

/* Responsive: 3 columns on narrow screens */
@media (max-width: 420px){
  [data-mh-sub-modal="accent"] .mh-sub__accentrow{
    grid-template-columns: repeat(3, 76px) !important;
    justify-content: space-between !important;
  }
}
  [data-mh-sub-modal="accent"] .mh-sub__accent-dot{
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
  }
}


/* === FORCE Accent modal grid (high specificity) === */
.mh-sub__modal[data-mh-sub-modal="accent"] .mh-sub__accentrow{
  display: grid !important;
  grid-template-columns: repeat(4, 76px) !important;
  justify-content: space-between !important;
  column-gap: 14px !important;
  row-gap: 18px !important;
  margin-top: 16px !important;
}
.mh-sub__modal[data-mh-sub-modal="accent"] .mh-sub__accent{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  min-height: auto !important;
  transform: none !important;
}
.mh-sub__modal[data-mh-sub-modal="accent"] .mh-sub__accent-dot{
  width: 76px !important;
  height: 76px !important;
  min-width: 76px !important;
  min-height: 76px !important;
  border-radius: 16px !important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.18),
    0 14px 28px rgba(0,0,0,0.38) !important;
  position: relative;
}
.mh-sub__modal[data-mh-sub-modal="accent"] .mh-sub__accent-label{
  width: 100% !important;
  text-align: center !important;
  font-weight: 650 !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  letter-spacing: 0.2px !important;
  color: rgba(255,255,255,0.78) !important;
}
.mh-sub__modal[data-mh-sub-modal="accent"] .mh-sub__accent.is-active .mh-sub__accent-dot::after{
  content: "✓";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  background: rgba(0,0,0,0.60);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
@media (max-width: 420px){
  .mh-sub__modal[data-mh-sub-modal="accent"] .mh-sub__accentrow{
    grid-template-columns: repeat(3, 76px) !important;
  }
}


/* ------------------------------------------------------------
   Profile modal refinements (Bio + profile photo required)
------------------------------------------------------------ */
.mh-sub__modal[data-mh-sub-modal="profile"] .mh-sub__modal-head--stack{
  align-items: flex-start;
}
.mh-sub__modal[data-mh-sub-modal="profile"] .mh-sub__modal-headtext{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mh-sub__modal[data-mh-sub-modal="profile"] .mh-sub__modal-title{
  font-size: 40px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.mh-sub__modal[data-mh-sub-modal="profile"] .mh-sub__modal-subtitle{
  font-size: 14px;
  color: var(--mh-txt-300);
}

.mh-sub__help-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.mh-sub__help-row .mh-sub__muted{
  font-size: 12px;
}

.mh-sub__avatarpicker--bar{
  display: flex;
  align-items: center;
  gap: 12px;
}
.mh-sub__avatarcircle{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  flex: 0 0 auto;
}
.mh-sub__avatarcircle img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mh-sub__filebar{
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}
.mh-sub__filebtn{
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
}
.mh-sub__filename{
  color: var(--mh-txt-300);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mh-sub__fileinput{
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mh-sub__btnrow--profile{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mh-sub__btnrow--profile .mh-sub__btn{
  min-width: 140px;
}
.mh-sub__btnrow-note{
  margin-left: auto;
}
@media (max-width: 520px){
  .mh-sub__btnrow-note{
    width: 100%;
    margin-left: 0;
  }
}

/* Avatar initial fallback (profile modal) */
.mh-sub__avatarinitial{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  background: rgba(0,0,0,0.55);
}
