/* MUGEX public control hardening — v2.9.2
 * Legacy theme/WooCommerce builders often use !important on native <button>
 * elements. Only MUGEX-owned controls are normalized here; third-party forms
 * (translation, WooCommerce, polls, contact forms) remain untouched.
 */
body.mugex-public-home-body .mx-btn,
body.mugex-public-novel-body .mx-btn,
body.mugex-public-discovery-body [data-mx-clear-filters],
body.mugex-public-discovery-body .mx-discovery-filter-chips button,
body.mugex-public-home-body .mx-global-header button,
body.mugex-public-novel-body .mx-global-header button,
body.mugex-public-discovery-body .mx-global-header button,
body.mugex-reader-body .mugex-reader-tool,
body.mugex-reader-body [data-mx-chapters],
body.mugex-reader-body .mx-reader-navigator-close,
body.mugex-reader-body .mx-reader-shield-primary,
body.mugex-reader-body .mx-reader-paywall-primary {
  -webkit-appearance:none!important;
  appearance:none!important;
  background-image:none!important;
  box-shadow:none!important;
  text-shadow:none!important;
  text-transform:none!important;
  letter-spacing:normal!important;
  font-family:var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;
}

/* Shared MUGEX button hierarchy. */
body.mugex-public-home-body button.mx-btn,
body.mugex-public-novel-body button.mx-btn {
  min-width:0!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 17px!important;
  border-radius:var(--mx-radius-control,8px)!important;
  font-size:13px!important;
  font-weight:700!important;
  line-height:1!important;
}
body.mugex-public-home-body button.mx-btn-primary,
body.mugex-public-novel-body button.mx-btn-primary {
  background:var(--mx-gold,#D6A632)!important;
  border-color:var(--mx-gold,#D6A632)!important;
  color:#0B0C10!important;
}
body.mugex-public-home-body button.mx-btn-primary:hover,
body.mugex-public-novel-body button.mx-btn-primary:hover {
  background:var(--mx-gold-hover,#E4B94F)!important;
  border-color:var(--mx-gold-hover,#E4B94F)!important;
  color:#0B0C10!important;
}
body.mugex-public-home-body button.mx-btn-secondary,
body.mugex-public-novel-body button.mx-btn-secondary {
  background:var(--mx-surface-1,#12141A)!important;
  border-color:#424955!important;
  color:var(--mx-text,#F3EEE4)!important;
}
body.mugex-public-home-body button.mx-btn-secondary:hover,
body.mugex-public-novel-body button.mx-btn-secondary:hover {
  background:var(--mx-surface-2,#181B22)!important;
  border-color:#5A6270!important;
  color:var(--mx-text,#F3EEE4)!important;
}
body.mugex-public-home-body button.mx-btn:disabled,
body.mugex-public-novel-body button.mx-btn:disabled {
  opacity:.42!important;
  cursor:not-allowed!important;
  filter:saturate(.5)!important;
}

/* The Save control is intentionally secondary. It must never inherit the
 * site's old solid-yellow WooCommerce/button treatment. */
body.mugex-public-novel-body button.mx-novel-bookmark {
  width:auto!important;
  min-width:92px!important;
  padding:0 15px!important;
  background:var(--mx-surface-1,#12141A)!important;
  border:1px solid #424955!important;
  color:var(--mx-text,#F3EEE4)!important;
}
body.mugex-public-novel-body button.mx-novel-bookmark.is-saved {
  background:rgba(214,166,50,.08)!important;
  border-color:rgba(214,166,50,.72)!important;
  color:var(--mx-gold,#D6A632)!important;
}

/* Header buttons are utility controls, not old-theme CTAs. */
body.mugex-public-home-body .mx-global-header .mx-profile-trigger,
body.mugex-public-novel-body .mx-global-header .mx-profile-trigger,
body.mugex-public-discovery-body .mx-global-header .mx-profile-trigger {
  width:40px!important;
  height:40px!important;
  padding:2px!important;
  border:1px solid var(--mx-border,#2E3038)!important;
  border-radius:8px!important;
  background:var(--mx-surface-1,#12141A)!important;
  color:var(--mx-text-2,#A8ADB7)!important;
}
body.mugex-public-home-body .mx-global-header button.mx-nav-icon,
body.mugex-public-novel-body .mx-global-header button.mx-nav-icon,
body.mugex-public-discovery-body .mx-global-header button.mx-nav-icon {
  width:40px!important;
  height:40px!important;
  padding:0!important;
  border:1px solid transparent!important;
  border-radius:8px!important;
  background:transparent!important;
  color:var(--mx-text-2,#A8ADB7)!important;
}

/* Discovery controls already have their own states; neutralize only legacy
 * button typography/box effects so active/inactive colors remain governed by
 * the Discovery stylesheet. */
body.mugex-public-discovery-body .mx-discovery-filter-chips button,
body.mugex-public-discovery-body [data-mx-clear-filters] {
  margin:0!important;
  box-shadow:none!important;
  text-decoration:none!important;
}

@media(max-width:620px){
  body.mugex-public-novel-body button.mx-novel-bookmark{
    width:46px!important;
    min-width:46px!important;
    padding:0!important;
  }
}

/* 2.10.0 — icon/text controls must share one visual baseline. Some legacy
 * theme rules assign vertical-align/line-height/margins to inline SVGs, which
 * made the bookmark icon sit above the Save label even though the control was
 * otherwise on-brand. Keep this fix scoped to the Novel bookmark. */
body.mugex-public-novel-body button.mx-novel-bookmark{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  line-height:1!important;
  white-space:nowrap!important;
  vertical-align:middle!important;
}
body.mugex-public-novel-body button.mx-novel-bookmark svg{
  display:block!important;
  flex:0 0 auto!important;
  width:17px!important;
  height:17px!important;
  margin:0!important;
  padding:0!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  vertical-align:middle!important;
}
@media(min-width:621px){
  body.mugex-public-novel-body button.mx-novel-bookmark span{
    display:inline-block!important;
    margin:0!important;
    padding:0!important;
    position:static!important;
    line-height:1!important;
    transform:none!important;
    vertical-align:middle!important;
  }
}

/* 2.10.3 — full public-control audit.
 * Every MUGEX-owned native control that can inherit old theme/WooCommerce
 * !important rules gets an explicit visual contract. Third-party forms remain
 * scoped under their own integration styles. */
body.mugex-public-account-body .mx-global-header button,
body.mugex-public-account-body .mx-account-collection-remove,
body.mugex-reader-body .mx-reader-navigator-search button,
body.mugex-reader-body [data-mx-mobile-search-close],
body.mugex-public-home-body [data-mx-mobile-search-close],
body.mugex-public-novel-body [data-mx-mobile-search-close],
body.mugex-public-discovery-body [data-mx-mobile-search-close],
body.mugex-public-account-body [data-mx-mobile-search-close] {
  -webkit-appearance:none!important;
  appearance:none!important;
  background-image:none!important;
  box-shadow:none!important;
  text-shadow:none!important;
  text-transform:none!important;
  letter-spacing:normal!important;
  font-family:var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;
}

/* Reader Chapters is a secondary navigator trigger, never a primary CTA. */
body.mugex-reader-body [data-mx-chapters]{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  width:auto!important;
  min-width:136px!important;
  min-height:42px!important;
  height:auto!important;
  margin:0!important;
  padding:0 14px!important;
  border:1px solid var(--mx-border,#2B3038)!important;
  border-radius:8px!important;
  background:var(--mx-surface-1,#12141A)!important;
  color:var(--mx-text,#F3EEE4)!important;
  -webkit-text-fill-color:var(--mx-text,#F3EEE4)!important;
  font:700 13px/1 var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;
  cursor:pointer!important;
}
body.mugex-reader-body [data-mx-chapters]:hover,
body.mugex-reader-body [data-mx-chapters]:focus-visible{
  border-color:#5A6270!important;
  background:var(--mx-surface-2,#181B22)!important;
  color:var(--mx-text,#F3EEE4)!important;
}
body.mugex-reader-body [data-mx-chapters]:focus-visible{outline:2px solid var(--mx-gold,#D6A632)!important;outline-offset:3px!important}
body.mugex-reader-body [data-mx-chapters] small{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:30px!important;
  min-height:24px!important;
  margin:0 0 0 2px!important;
  padding:0 7px!important;
  border:1px solid rgba(214,166,50,.24)!important;
  border-radius:999px!important;
  background:rgba(214,166,50,.10)!important;
  color:var(--mx-gold,#D6A632)!important;
  -webkit-text-fill-color:var(--mx-gold,#D6A632)!important;
  font:800 10px/1 var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;
}
body.mugex-reader-body .mx-reader-navigator-search button{
  min-width:64px!important;
  min-height:42px!important;
  margin:0!important;
  padding:0 14px!important;
  border:1px solid rgba(214,166,50,.55)!important;
  border-radius:8px!important;
  background:rgba(214,166,50,.10)!important;
  color:var(--mx-gold-hover,#E4B94F)!important;
  font:800 11px/1 var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;
}

/* Novel personal-state controls. Save = Library intent, Like = endorsement. */
body.mugex-public-novel-body button.mx-novel-like{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  width:auto!important;
  min-width:88px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 15px!important;
  border:1px solid #424955!important;
  border-radius:var(--mx-radius-control,8px)!important;
  background:var(--mx-surface-1,#12141A)!important;
  color:var(--mx-text,#F3EEE4)!important;
  -webkit-text-fill-color:var(--mx-text,#F3EEE4)!important;
  font:700 13px/1 var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;
}
body.mugex-public-novel-body button.mx-novel-like:hover{background:var(--mx-surface-2,#181B22)!important;border-color:#5A6270!important}
body.mugex-public-novel-body button.mx-novel-like.is-liked{
  border-color:rgba(240,122,122,.58)!important;
  background:rgba(240,122,122,.08)!important;
  color:#F2A0A0!important;
  -webkit-text-fill-color:#F2A0A0!important;
}
body.mugex-public-novel-body button.mx-novel-like svg,
body.mugex-public-novel-body button.mx-novel-bookmark svg{
  width:17px!important;height:17px!important;display:block!important;flex:0 0 auto!important;
  margin:0!important;padding:0!important;position:static!important;transform:none!important;
  fill:none!important;stroke:currentColor!important;stroke-width:1.7!important;stroke-linecap:round!important;stroke-linejoin:round!important;
}
body.mugex-public-novel-body button.mx-novel-like.is-liked svg{fill:currentColor!important;stroke:currentColor!important}
body.mugex-public-novel-body button.mx-novel-bookmark.is-saved svg{fill:rgba(214,166,50,.16)!important}

/* Account shell utilities and collection actions. */
body.mugex-public-account-body .mx-global-header .mx-profile-trigger{
  width:40px!important;height:40px!important;padding:2px!important;border:1px solid var(--mx-border,#2E3038)!important;border-radius:8px!important;background:var(--mx-surface-1,#12141A)!important;color:var(--mx-text-2,#A8ADB7)!important;
}
body.mugex-public-account-body .mx-global-header button.mx-nav-icon{
  width:40px!important;height:40px!important;padding:0!important;border:1px solid transparent!important;border-radius:8px!important;background:transparent!important;color:var(--mx-text-2,#A8ADB7)!important;
}
body.mugex-public-account-body .mx-account-collection-remove{
  background:#0d1117!important;border-color:#39414d!important;color:#aeb7c4!important;-webkit-text-fill-color:#aeb7c4!important;
}

/* Close/search utility buttons stay compact rather than inheriting CTA rules. */
body.mugex-public-home-body [data-mx-mobile-search-close],
body.mugex-public-novel-body [data-mx-mobile-search-close],
body.mugex-public-discovery-body [data-mx-mobile-search-close],
body.mugex-public-account-body [data-mx-mobile-search-close]{
  width:40px!important;height:40px!important;min-width:40px!important;padding:0!important;border:1px solid var(--mx-border,#2B3038)!important;border-radius:8px!important;background:var(--mx-surface-1,#12141A)!important;color:var(--mx-text-2,#A8ADB7)!important;
}

@media(max-width:620px){
  body.mugex-public-novel-body .mx-novel-actions{grid-template-columns:1fr 1fr!important}
  body.mugex-public-novel-body .mx-novel-actions [data-mx-novel-continue],
  body.mugex-public-novel-body .mx-novel-actions [data-mx-novel-start]{grid-column:1/-1!important;width:100%!important}
  body.mugex-public-novel-body button.mx-novel-bookmark,
  body.mugex-public-novel-body button.mx-novel-like{width:100%!important;min-width:0!important;padding:0 10px!important}
  body.mugex-public-novel-body button.mx-novel-bookmark span,
  body.mugex-public-novel-body button.mx-novel-like span{position:static!important;width:auto!important;height:auto!important;overflow:visible!important;clip:auto!important;white-space:nowrap!important}
  body.mugex-reader-body [data-mx-chapters]{min-width:132px!important;min-height:44px!important}
}

/* Remaining Reader utility buttons from the control audit. */
body.mugex-reader-body .mugex-reader-tool,
body.mugex-reader-body .mx-reader-navigator-close{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  margin:0!important;border:1px solid var(--mx-border,#2B3038)!important;border-radius:8px!important;
  background:var(--mx-surface-1,#12141A)!important;color:var(--mx-text,#F3EEE4)!important;
  -webkit-text-fill-color:var(--mx-text,#F3EEE4)!important;box-shadow:none!important;
}
body.mugex-reader-body .mugex-reader-tool:hover,
body.mugex-reader-body .mx-reader-navigator-close:hover{background:var(--mx-surface-2,#181B22)!important;border-color:#5A6270!important}
body.mugex-reader-body .mx-reader-shield-primary,
body.mugex-reader-body .mx-reader-paywall-primary{
  border:1px solid var(--mx-gold,#D6A632)!important;border-radius:9px!important;background:var(--mx-gold,#D6A632)!important;
  color:#12100B!important;-webkit-text-fill-color:#12100B!important;box-shadow:none!important;font-family:var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;font-weight:800!important;
}
body.mugex-reader-body .mx-reader-shield-primary:disabled,
body.mugex-reader-body .mx-reader-paywall-primary:disabled{opacity:.55!important;cursor:not-allowed!important}

/* 2.11.5 Follow uses the same control family as Save/Like, with a distinct
   confirmed state so email intent is never confused with a simple Like. */
body.mugex-public-novel-body button.mx-novel-follow{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;
  width:auto!important;min-width:96px!important;min-height:44px!important;margin:0!important;padding:0 15px!important;
  border:1px solid #424955!important;border-radius:var(--mx-radius-control,8px)!important;background:var(--mx-surface-1,#12141A)!important;
  color:var(--mx-text,#F3EEE4)!important;-webkit-text-fill-color:var(--mx-text,#F3EEE4)!important;
  font:700 13px/1 var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;
}
body.mugex-public-novel-body button.mx-novel-follow:hover{background:var(--mx-surface-2,#181B22)!important;border-color:#5A6270!important}
body.mugex-public-novel-body button.mx-novel-follow.is-following{border-color:rgba(100,215,165,.58)!important;background:rgba(100,215,165,.08)!important;color:#86E2B8!important;-webkit-text-fill-color:#86E2B8!important}
body.mugex-public-novel-body button.mx-novel-follow svg{width:17px!important;height:17px!important;display:block!important;flex:0 0 auto!important;margin:0!important;padding:0!important;position:static!important;transform:none!important;fill:none!important;stroke:currentColor!important;stroke-width:1.7!important;stroke-linecap:round!important;stroke-linejoin:round!important}
body.mugex-public-novel-body button.mx-novel-follow.is-following svg{fill:rgba(100,215,165,.10)!important}
@media(max-width:620px){
  body.mugex-public-novel-body .mx-novel-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body.mugex-public-novel-body button.mx-novel-bookmark,
  body.mugex-public-novel-body button.mx-novel-like,
  body.mugex-public-novel-body button.mx-novel-follow{width:100%!important;min-width:0!important;padding:0 7px!important}
  body.mugex-public-novel-body button.mx-novel-follow span{position:static!important;width:auto!important;height:auto!important;overflow:visible!important;clip:auto!important;white-space:nowrap!important}
}
@media(max-width:470px){
  body.mugex-public-novel-body .mx-novel-actions{grid-template-columns:1fr 1fr!important}
  body.mugex-public-novel-body button.mx-novel-follow{grid-column:1/-1!important}
}

/* 2.11.5 Account notification controls are MUGEX-owned, not Woo/theme buttons. */
body.mugex-public-account-body .mx-account-notify-actions button{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:44px!important;
  margin:0!important;padding:0 16px!important;border:1px solid var(--mx-gold,#D6A632)!important;border-radius:8px!important;
  background:var(--mx-gold,#D6A632)!important;color:#111318!important;-webkit-text-fill-color:#111318!important;
  font:800 12px/1 var(--mx-font-ui,Manrope,system-ui,sans-serif)!important;letter-spacing:normal!important;text-transform:none!important;box-shadow:none!important;
}
body.mugex-public-account-body .mx-account-notify-field select{
  min-height:44px!important;margin:0!important;padding:0 11px!important;border:1px solid #343c47!important;border-radius:8px!important;
  background:#12171e!important;color:#f3eee4!important;-webkit-text-fill-color:#f3eee4!important;color-scheme:dark!important;box-shadow:none!important;
}
body.mugex-public-account-body .mx-account-notify-field select option{background:#12171e!important;color:#f3eee4!important}

/* 2.11.9 coin polish: a simple flat coin, not a ball/token glyph. */
.mx-coin-dot{
  position:relative!important;display:inline-block!important;overflow:hidden!important;box-sizing:border-box!important;
  border-radius:50%!important;border:1px solid #8b5f12!important;
  background:linear-gradient(145deg,#f0c85b 0 38%,#d9a62f 39% 72%,#bd8420 73% 100%)!important;
  box-shadow:
    inset 0 0 0 2px #e9bd4d,
    inset 0 0 0 3px rgba(111,71,8,.72),
    inset 0 -1px 0 rgba(72,44,4,.32),
    0 1px 1px rgba(0,0,0,.34)!important;
}
.mx-coin-dot:before{
  content:""!important;position:absolute!important;inset:4px!important;border-radius:50%!important;
  border:1px solid rgba(255,226,123,.58)!important;background:rgba(210,153,32,.22)!important;box-shadow:none!important;
}
.mx-coin-dot:after{content:none!important;display:none!important}
.mx-coin-balance .mx-coin-dot{width:18px!important;height:18px!important;min-width:18px!important}

/* Discover Home subscription CTA: account-owned, explicit and low-noise. */
body.mugex-public-home-body .mx-home-updates-card .mx-home-updates-state{display:inline-flex;align-items:center;min-height:26px;padding:0 9px;border:1px solid rgba(100,215,165,.45);border-radius:999px;background:rgba(100,215,165,.08);color:#86e2b8;font:800 9px/1 var(--mx-font-ui,Manrope,system-ui,sans-serif);letter-spacing:.06em;text-transform:uppercase}
body.mugex-public-home-body .mx-home-updates-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:22px}
body.mugex-public-home-body .mx-home-updates-actions form{margin:0}
body.mugex-public-home-body .mx-home-updates-manage{color:var(--mx-text-2,#A8ADB7);font:700 11px/1.4 var(--mx-font-ui,Manrope,system-ui,sans-serif);text-decoration:none}
body.mugex-public-home-body .mx-home-updates-manage:hover{color:var(--mx-gold,#D6A632)}
body.mugex-public-home-body .mx-home-updates-confirm{margin-top:16px;padding:10px 12px;border:1px solid rgba(100,215,165,.35);border-radius:8px;background:rgba(100,215,165,.06);color:#86e2b8;font:600 10px/1.5 var(--mx-font-ui,Manrope,system-ui,sans-serif)}
@media(max-width:620px){body.mugex-public-home-body .mx-home-updates-actions{align-items:stretch;flex-direction:column}body.mugex-public-home-body .mx-home-updates-actions form,body.mugex-public-home-body .mx-home-updates-actions .mx-btn{width:100%}body.mugex-public-home-body .mx-home-updates-manage{text-align:center}}

/* Rating stars are MUGEX controls and must not inherit Woo/theme button chrome. */
body.mugex-public-novel-body .mx-rating-star{
  appearance:none!important;-webkit-appearance:none!important;display:grid!important;place-items:center!important;
  width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;padding:0!important;margin:0!important;
  border:0!important;border-radius:8px!important;background:transparent!important;box-shadow:none!important;
  color:#626b77!important;-webkit-text-fill-color:#626b77!important;text-transform:none!important;letter-spacing:normal!important;
}
body.mugex-public-novel-body .mx-rating-star.is-active{color:var(--mx-gold,#D6A632)!important;-webkit-text-fill-color:var(--mx-gold,#D6A632)!important}
body.mugex-public-novel-body .mx-rating-star:hover,
body.mugex-public-novel-body .mx-rating-star:focus-visible{background:rgba(214,166,50,.08)!important;color:var(--mx-gold,#D6A632)!important;-webkit-text-fill-color:var(--mx-gold,#D6A632)!important}
body.mugex-public-novel-body .mx-rating-star svg{width:21px!important;height:21px!important;margin:0!important;position:static!important;transform:none!important;fill:transparent!important;stroke:currentColor!important;stroke-width:1.55!important;stroke-linejoin:round!important}
body.mugex-public-novel-body .mx-rating-star.is-active svg{fill:rgba(214,166,50,.92)!important;stroke:#f0c75d!important}
@media(max-width:620px){body.mugex-public-novel-body .mx-rating-star{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}body.mugex-public-novel-body .mx-rating-star svg{width:23px!important;height:23px!important}}

/* 2.12.4 performance: chapter unlock feedback stays pixel-compatible without
   loading the full Wallet surface stylesheet on every Novel/Chapter request. */
body.mugex-reader-body .mx-reader-wallet-notice{
  max-width:var(--mx-reading-max,760px);margin:0 auto 28px;padding:12px 14px;
  border:1px solid #38404c;border-radius:9px;background:#11141a;color:#c6cfdb;
  font-family:var(--mx-font-ui);font-size:12px;line-height:1.55
}
body.mugex-reader-body .mx-reader-wallet-notice.is-success{border-color:rgba(114,196,154,.48);background:rgba(114,196,154,.07);color:#8edcb4}
body.mugex-reader-body .mx-reader-wallet-notice.is-error{border-color:rgba(240,122,122,.48);background:rgba(240,122,122,.07);color:#f2a1a1}
body.mugex-reader-body .mx-reader-paywall-unlock-form{margin:0}
body.mugex-reader-body .mx-reader-paywall-unlock-form .mx-reader-paywall-primary{width:100%}
