/* MrGym Unified Member Portal (/account/*) | Gold Arena HIG v2.0 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  background-color: var(--mga-bg);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body.mgp-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(960px 420px at 50% -140px, rgba(240, 193, 75, 0.06), transparent 70%), var(--mga-bg);
  color: var(--mga-tx);
  font-family: var(--mga-font);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) body.mgp-body,
body.mgp-body:is([data-lqd-page-color-scheme="light"], [data-theme="light"]) {
  background: radial-gradient(960px 420px at 50% -140px, rgba(227, 165, 43, 0.08), transparent 70%), var(--mga-bg);
}

body.mgp-body [hidden] {
  display: none !important;
}

/* ---------- Skip Link ---------- */
.mgp-skip:focus-visible {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 10000;
  width: auto;
  height: auto;
  margin: 0;
  clip-path: none;
  overflow: visible;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--mga-grad);
  color: var(--mga-on-gold);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--mga-shadow-gold);
  outline: 2px solid var(--mga-tx);
  outline-offset: 2px;
}

/* ---------- Watchmaker 3D Icons & Concentric Gold Wells ---------- */
.mgp-ico {
  display: block;
  flex: 0 0 auto;
  pointer-events: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.36));
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-ico {
  filter: drop-shadow(0 1px 3px rgba(15, 23, 42, 0.16));
}

.mgp-ic-well {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex: 0 0 auto;
  background: radial-gradient(circle at 50% 24%, rgba(240, 193, 75, 0.18), rgba(240, 193, 75, 0.04) 76%), var(--mga-surf-2);
  border: 1px solid rgba(240, 193, 75, 0.24);
  color: var(--mga-gold-tx);
  box-shadow: var(--mga-bevel);
  transition: border-color 0.2s var(--mga-ease), background 0.2s var(--mga-ease), transform 0.2s var(--mga-ease);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-ic-well {
  background: radial-gradient(circle at 50% 24%, rgba(246, 211, 107, 0.28), rgba(207, 148, 22, 0.06) 76%), #f8fafd;
  border-color: rgba(148, 102, 6, 0.22);
}

.mgp-ic-well.is-sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.mgp-ic-well.is-lg {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.mgp-ic-well.is-ok {
  background: radial-gradient(circle at 50% 24%, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.04) 76%), var(--mga-surf-2);
  border-color: rgba(34, 197, 94, 0.3);
}

.mgp-ic-well.is-warn {
  background: radial-gradient(circle at 50% 24%, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.04) 76%), var(--mga-surf-2);
  border-color: rgba(245, 158, 11, 0.32);
}

.mgp-ic-well.is-err {
  background: radial-gradient(circle at 50% 24%, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.04) 76%), var(--mga-surf-2);
  border-color: rgba(239, 68, 68, 0.32);
}

.mgp-ic-well.is-sky {
  background: radial-gradient(circle at 50% 24%, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.04) 76%), var(--mga-surf-2);
  border-color: rgba(56, 189, 248, 0.3);
}

.mgp-ic-well.is-violet {
  background: radial-gradient(circle at 50% 24%, rgba(167, 139, 250, 0.18), rgba(167, 139, 250, 0.04) 76%), var(--mga-surf-2);
  border-color: rgba(167, 139, 250, 0.3);
}

/* ---------- Sticky Watchmaker Topbar ---------- */
.mgp-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--mga-glass);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  backdrop-filter: blur(18px) saturate(165%);
  border-bottom: 1px solid var(--mga-bd);
  box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.55);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-topbar {
  box-shadow: 0 8px 24px -18px rgba(15, 23, 42, 0.14);
}

.mgp-hairline {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(240, 193, 75, 0.48) 22%, #ffe484 50%, rgba(240, 193, 75, 0.48) 78%, transparent 100%);
  pointer-events: none;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-hairline {
  background: linear-gradient(90deg, transparent 0%, rgba(148, 102, 6, 0.28) 20%, #e3a52b 50%, rgba(148, 102, 6, 0.28) 80%, transparent 100%);
}

.mgp-topbar-in {
  width: min(1320px, 100% - 32px);
  margin-inline: auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.mgp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--mga-tx);
  border-radius: 14px;
}

.mgp-brand:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 3px;
}

.mgp-brand-logo {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.mgp-brand img,
.mgp-brand-logo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.34));
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-brand img,
:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-brand-logo img {
  filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.16));
}

.mgp-brand-word {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  overflow: visible;
}

.mgp-brand b,
.mgp-brand-title {
  display: block;
  font-size: 17.5px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  background: var(--mga-word-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mgp-brand em,
.mgp-brand-sub {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--mga-tx-2);
  margin-top: 4px;
  white-space: nowrap;
}

.mgp-top-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.mgp-top-btn {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--mga-surf);
  border: 1px solid var(--mga-bd-2);
  color: var(--mga-tx);
  font-family: var(--mga-font);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--mga-bevel);
  transition: border-color 0.18s var(--mga-ease), background 0.18s var(--mga-ease), color 0.18s var(--mga-ease), transform 0.16s var(--mga-ease);
}

.mgp-top-btn:hover {
  border-color: rgba(240, 193, 75, 0.5);
  background: var(--mga-surf-2);
  color: var(--mga-gold-tx);
}

.mgp-top-btn:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .mgp-top-btn:active {
    transform: scale(0.97);
  }
}

.mgp-top-btn.is-logout {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.32);
  color: #f87171;
}

.mgp-top-btn.is-logout:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.52);
  color: #fca5a5;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-top-btn.is-logout {
  background: rgba(185, 28, 28, 0.06);
  border-color: rgba(185, 28, 28, 0.26);
  color: var(--mga-err);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-top-btn.is-logout:hover {
  background: rgba(185, 28, 28, 0.12);
  border-color: rgba(185, 28, 28, 0.44);
  color: var(--mga-err);
}

.mgp-btn-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
}

.mgp-btn-lbl {
  display: inline;
}

/* Iconic Square Sun/Moon Theme Switcher */
.mgp-theme-btn {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: var(--mga-surf);
  border: 1px solid var(--mga-bd-2);
  color: var(--mga-gold-tx);
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: var(--mga-bevel);
  transition: border-color 0.18s var(--mga-ease), background 0.18s var(--mga-ease), transform 0.18s var(--mga-ease);
}

.mgp-theme-btn:hover {
  border-color: rgba(240, 193, 75, 0.54);
  background: var(--mga-surf-2);
}

.mgp-theme-btn:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

.mgp-theme-btn .mgp-ic-sun {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mgp-theme-btn .mgp-ic-moon {
  display: none;
  align-items: center;
  justify-content: center;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-theme-btn .mgp-ic-sun {
  display: none;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-theme-btn .mgp-ic-moon {
  display: inline-flex;
}

@media (prefers-reduced-motion: no-preference) {
  .mgp-theme-btn svg {
    transition: transform 0.24s var(--mga-ease);
  }
  .mgp-theme-btn:hover svg {
    transform: rotate(-16deg) scale(1.06);
  }
  .mgp-theme-btn:active {
    transform: scale(0.95);
  }
}

.mga-btn.mgp-sm-btn {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 10px;
}

/* ---------- Main Canvas & Unauthenticated Guest Gate ---------- */
.mgp-main {
  width: min(1320px, 100% - 32px);
  max-width: 100%;
  min-width: 0;
  margin: 24px auto 64px;
}

.mgp-guest-hero {
  display: grid;
  place-items: center;
  min-height: 68vh;
  min-height: 68dvh;
}

.mgp-guest-card {
  width: min(880px, 100%);
  background: radial-gradient(85% 55% at 50% 0%, rgba(240, 193, 75, 0.11), transparent 72%), var(--mga-surf);
  border: 1px solid var(--mga-bd-2);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--mga-shadow), var(--mga-bevel);
}

.mgp-guest-card h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.25rem);
  font-weight: 900;
  line-height: 1.35;
  text-wrap: balance;
}

.mgp-guest-card > p {
  margin: 0 0 24px;
  color: var(--mga-tx-2);
  font-size: 15.5px;
  max-width: 64ch;
}

.mgp-guest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .mgp-guest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mgp-feat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--mga-bevel);
  transition: border-color 0.2s var(--mga-ease);
}

.mgp-feat:hover {
  border-color: rgba(240, 193, 75, 0.36);
}

.mgp-feat-body {
  min-width: 0;
}

.mgp-feat strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--mga-tx);
  margin-bottom: 4px;
}

.mgp-feat span {
  display: block;
  font-size: 13px;
  color: var(--mga-tx-2);
  line-height: 1.65;
}

.mgp-guest-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Authenticated Portal Shell & Sidebar ---------- */
.mgp-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.mgp-side {
  position: sticky;
  top: 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.mgp-id-card {
  background: radial-gradient(95% 58% at 50% 0%, rgba(240, 193, 75, 0.12), transparent 72%), var(--mga-surf);
  border: 1px solid var(--mga-bd);
  border-radius: 24px;
  padding: 20px 16px 16px;
  text-align: center;
  box-shadow: var(--mga-shadow), var(--mga-bevel);
  min-width: 0;
  max-width: 100%;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-id-card {
  background: radial-gradient(95% 58% at 50% 0%, rgba(246, 211, 107, 0.18), transparent 70%), #ffffff;
}

.mgp-id-top {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mgp-av-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 12px;
  flex: 0 0 auto;
}

.mgp-av {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 30%, #2c2312 0%, #111622 54%, #06080d 100%);
  color: #ffe484;
  font-size: 28px;
  font-weight: 900;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #f0c14b;
  box-shadow: inset 0 1px 2px rgba(255, 252, 216, 0.36), 0 0 0 1px rgba(120, 70, 2, 0.72), 0 12px 24px -10px rgba(0, 0, 0, 0.55);
}

.mgp-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mgp-av.is-uploading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(14, 17, 22, 0.62);
  z-index: 2;
}

.mgp-av.is-uploading::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(240, 193, 75, 0.25);
  border-top-color: #ffe484;
  z-index: 3;
  animation: mgpSpin 0.75s linear infinite;
}

@keyframes mgpSpin {
  to {
    transform: rotate(360deg);
  }
}

.mgp-av-cam,
.mgp-av-edit {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--mga-surf-3);
  border: 1.5px solid rgba(240, 193, 75, 0.6);
  color: var(--mga-gold-tx);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), var(--mga-bevel);
  transition: transform 0.16s var(--mga-ease), border-color 0.16s var(--mga-ease), background 0.16s var(--mga-ease);
}

/* Invisible touch-target expansion for >=44x44px mobile tap area */
.mgp-av-cam::before,
.mgp-av-edit::before {
  content: "";
  position: absolute;
  inset: -4px;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-av-cam,
:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-av-edit {
  background: #ffffff;
  border-color: rgba(148, 102, 6, 0.55);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

.mgp-av-cam:hover,
.mgp-av-edit:hover {
  border-color: var(--mga-gold);
  background: var(--mga-surf-2);
}

.mgp-av-cam:has(input:focus-visible),
.mgp-av-edit:has(input:focus-visible),
.mgp-av-wrap:has(#mgp-av-inp:focus-visible) .mgp-av-cam {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .mgp-av-cam:hover,
  .mgp-av-edit:hover {
    transform: scale(1.06);
  }
  .mgp-av-cam:active,
  .mgp-av-edit:active {
    transform: scale(0.94);
  }
}

.mgp-id-meta {
  min-width: 0;
  width: 100%;
}

.mgp-name {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--mga-tx);
}

.mgp-meta {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--mga-tx-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mgp-badge-coach {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(240, 193, 75, 0.16);
  border: 1px solid rgba(240, 193, 75, 0.42);
  color: var(--mga-gold-tx);
  font-size: 11px;
  font-weight: 800;
}

.mgp-badge-coach[hidden] {
  display: none !important;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-badge-coach {
  background: rgba(181, 123, 12, 0.1);
  border-color: rgba(148, 102, 6, 0.34);
}

.mgp-id-kpis,
.mgp-mini-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--mga-bd);
  min-width: 0;
  max-width: 100%;
}

.mgp-id-kpi,
.mgp-mini-kpis > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  min-width: 0;
}

.mgp-kpi-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  margin-bottom: 4px;
}

.mgp-id-kpi b,
.mgp-mini-kpis b {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: var(--mga-gold-tx);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.mgp-id-kpi span,
.mgp-mini-kpis span {
  font-size: 11px;
  font-weight: 700;
  color: var(--mga-tx-2);
}

.mga-btn.mgp-admin-btn,
.mgp-admin-btn {
  margin-top: 12px;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 12.5px;
  border-radius: 14px;
}

/* ---------- Sidebar Navigation ---------- */
.mgp-nav-wrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.mgp-nav {
  background: var(--mga-surf);
  border: 1px solid var(--mga-bd);
  border-radius: 18px;
  padding: 8px;
  display: grid;
  gap: 4px;
  box-shadow: var(--mga-shadow), var(--mga-bevel);
  min-width: 0;
  max-width: 100%;
}

.mgp-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--mga-tx-2);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s var(--mga-ease), color 0.16s var(--mga-ease), border-color 0.16s var(--mga-ease);
}

.mgp-nav-item:hover {
  background: var(--mga-surf-2);
  color: var(--mga-tx);
}

.mgp-nav-item:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: -2px;
}

.mgp-nav-txt {
  flex: 1;
  min-width: 0;
}

.mgp-nav-chev {
  display: inline-flex;
  align-items: center;
  opacity: 0.32;
  flex: 0 0 auto;
  transition: opacity 0.18s var(--mga-ease), transform 0.18s var(--mga-ease);
}

.mgp-nav-item:hover .mgp-nav-chev {
  opacity: 0.7;
}

.mgp-nav-item.is-active {
  background: radial-gradient(95% 130% at 100% 50%, rgba(240, 193, 75, 0.16), rgba(240, 193, 75, 0.05));
  border-color: rgba(240, 193, 75, 0.42);
  color: var(--mga-gold-tx);
}

.mgp-nav-item.is-active .mgp-ic-well {
  border-color: rgba(240, 193, 75, 0.55);
}

.mgp-nav-item.is-active .mgp-nav-chev {
  opacity: 1;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-nav-item.is-active {
  background: linear-gradient(135deg, rgba(246, 211, 107, 0.24), rgba(227, 165, 43, 0.08));
  border-color: rgba(148, 102, 6, 0.36);
  color: var(--mga-gold-tx);
}

@media (prefers-reduced-motion: no-preference) {
  .mgp-nav-item:hover .mgp-nav-chev,
  .mgp-nav-item.is-active .mgp-nav-chev {
    transform: translateX(-2px);
  }
  .mgp-nav-item:hover .mgp-ic-well {
    transform: scale(1.05);
  }
}

/* ---------- Main Stage Panels & Headers ---------- */
.mgp-content {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.mgp-panel {
  min-width: 0;
  max-width: 100%;
  background: var(--mga-surf);
  border: 1px solid var(--mga-bd);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--mga-shadow), var(--mga-bevel);
}

.mgp-panel.is-hero {
  background: radial-gradient(85% 58% at 88% 0%, rgba(240, 193, 75, 0.095), transparent 68%), var(--mga-surf);
  border-color: rgba(240, 193, 75, 0.24);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-panel.is-hero {
  background: radial-gradient(85% 58% at 88% 0%, rgba(246, 211, 107, 0.16), transparent 68%), #ffffff;
  border-color: rgba(148, 102, 6, 0.22);
}

.mgp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.mgp-panel-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 240px;
}

.mgp-panel-head h2 {
  margin: 0;
  font-size: clamp(1rem, 0.94rem + 0.35vw, 1.1875rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--mga-tx);
}

.mgp-panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--mga-tx-2);
  line-height: 1.6;
}

.mgp-panel-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- KPI Row & Stat Boxes ---------- */
.mgp-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}

.mgp-kpi-box {
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--mga-bevel);
  transition: border-color 0.18s var(--mga-ease);
}

.mgp-kpi-box:hover {
  border-color: var(--mga-bd-2);
}

.mgp-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.mgp-kpi-box span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mga-tx-2);
}

.mgp-kpi-box strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: var(--mga-gold-tx);
  margin-top: 4px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.mgp-kpi-box small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--mga-tx-2);
}

.mgp-kpi-box.is-ok strong {
  color: var(--mga-ok);
}

.mgp-kpi-box.is-sky strong {
  color: var(--mga-sky);
}

.mgp-kpi-box.is-warn strong {
  color: var(--mga-warn);
}

.mgp-bar-track {
  height: 8px;
  border-radius: 6px;
  background: var(--mga-bg-2);
  overflow: hidden;
  margin-top: 8px;
}

.mgp-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--mga-grad);
}

.mgp-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.mgp-list {
  display: grid;
  gap: 12px;
}

.mgp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  transition: border-color 0.18s var(--mga-ease), background 0.18s var(--mga-ease);
}

a.mgp-row:hover {
  border-color: rgba(240, 193, 75, 0.44);
  background: var(--mga-surf-3);
}

a.mgp-row:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

.mgp-row > span[aria-hidden="true"] {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.mgp-row b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--mga-tx);
}

.mgp-row small {
  display: block;
  font-size: 12.5px;
  color: var(--mga-tx-2);
}

.mgp-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 200px;
}

.mgp-row-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Chips & Interactive Filter Pills ---------- */
.mgp-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mgp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-ctrl-bd);
  color: var(--mga-tx);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.16s var(--mga-ease), background 0.16s var(--mga-ease), color 0.16s var(--mga-ease), transform 0.14s var(--mga-ease);
}

.mgp-chip:hover {
  border-color: rgba(240, 193, 75, 0.5);
  color: var(--mga-gold-tx);
}

.mgp-chip:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .mgp-chip:active {
    transform: scale(0.97);
  }
}

.mgp-chip.is-on {
  background: rgba(240, 193, 75, 0.16);
  border-color: rgba(240, 193, 75, 0.52);
  color: var(--mga-gold-tx);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chip {
  background: #ffffff;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chip.is-on {
  background: rgba(227, 165, 43, 0.14);
  border-color: rgba(148, 102, 6, 0.44);
  color: var(--mga-gold-tx);
}

/* ---------- Forms & Grouped Sections ---------- */
.mgp-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
  align-items: end;
}

.mgp-form-grid .mga-field {
  margin-bottom: 0;
}

.mgp-form-section {
  padding: 16px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  margin-bottom: 16px;
}

.mgp-form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--mga-tx);
}

/* Custom Autocomplete Dropdown (PRs Exercise Picker) */
.mgp-ac-wrap {
  position: relative;
}

.mgp-ac-list {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline: 0;
  z-index: 40;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 14px;
  background: var(--mga-surf);
  border: 1px solid var(--mga-bd-2);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 4px;
}

.mgp-ac-list[hidden] {
  display: none;
}

.mgp-ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--mga-tx);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}

.mgp-ac-item:hover,
.mgp-ac-item.is-active {
  background: var(--mga-surf-2);
  color: var(--mga-gold-tx);
}

.mgp-ac-item:focus-visible {
  background: var(--mga-surf-2);
  color: var(--mga-gold-tx);
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: -2px;
}

.mgp-ac-item small {
  font-size: 11.5px;
  color: var(--mga-tx-2);
}

/* ---------- Joyful Arena Empty States ---------- */
.mgp-empty-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 20px;
  border-radius: 14px;
  background: radial-gradient(75% 85% at 50% 0%, rgba(240, 193, 75, 0.08), transparent 72%), var(--mga-surf-2);
  border: 1px dashed var(--mga-bd-2);
  text-align: center;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-empty-arena {
  background: radial-gradient(75% 85% at 50% 0%, rgba(246, 211, 107, 0.16), transparent 72%), var(--mga-surf-2);
}

.mgp-empty-arena h3 {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--mga-tx);
}

.mgp-empty-arena p {
  margin: 0;
  max-width: 46ch;
  font-size: 13px;
  color: var(--mga-tx-2);
  line-height: 1.7;
}

.mgp-empty-arena .mga-btn {
  margin-top: 4px;
}

.mgp-empty {
  padding: 24px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px dashed var(--mga-bd-2);
  text-align: center;
  color: var(--mga-tx-2);
  font-size: 13.5px;
}

/* ---------- Skeleton Loader ---------- */
.mgp-loading {
  padding: 8px 0;
  display: grid;
  gap: 16px;
}

.mgp-skel-panel {
  border-radius: 18px;
  border: 1px solid var(--mga-bd);
  background: var(--mga-surf);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.mgp-skel-line {
  height: 16px;
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 25%, rgba(240, 193, 75, 0.14) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 220% 100%;
  animation: mgpSkel 1.4s ease-in-out infinite;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-skel-line {
  background: linear-gradient(100deg, rgba(15, 23, 42, 0.05) 25%, rgba(180, 122, 18, 0.14) 50%, rgba(15, 23, 42, 0.05) 75%);
  background-size: 220% 100%;
}

@keyframes mgpSkel {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* ---------- Overview 3D Trophy Crest Banner + Pause Control ---------- */
.mgp-trophy-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(240, 193, 75, 0.3);
  background: radial-gradient(85% 95% at 15% 0%, rgba(240, 193, 75, 0.14), transparent 68%), var(--mga-surf-2);
  box-shadow: var(--mga-bevel);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-trophy-banner {
  background: radial-gradient(85% 95% at 15% 0%, rgba(246, 211, 107, 0.24), transparent 68%), #f8fafd;
  border-color: rgba(148, 102, 6, 0.26);
}

.mgp-trophy-stage {
  position: relative;
  width: 120px;
  height: 120px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(240, 193, 75, 0.26);
  background: radial-gradient(80% 80% at 50% 45%, rgba(28, 38, 56, 0.72), rgba(9, 12, 18, 0.92));
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-trophy-stage {
  background: radial-gradient(80% 80% at 50% 45%, #ffffff, #e6edf7);
  border-color: rgba(148, 102, 6, 0.28);
  box-shadow: inset 0 1px 0 #ffffff;
}

.mgp-crest-3d {
  width: 120px;
  height: 120px;
  display: block;
  cursor: grab;
  touch-action: none;
}

.mgp-crest-3d:active {
  cursor: grabbing;
}

.mgp-crest-pause {
  position: absolute;
  inset-block-end: 4px;
  inset-inline-end: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: rgba(14, 17, 22, 0.8);
  border: 1px solid rgba(240, 193, 75, 0.4);
  color: var(--mga-gold-tx);
  cursor: pointer;
  z-index: 4;
  transition: border-color 0.16s var(--mga-ease), background 0.16s var(--mga-ease);
}

.mgp-crest-pause::before {
  content: "";
  position: absolute;
  inset: -8px;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-crest-pause {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 102, 6, 0.36);
}

.mgp-crest-pause:hover {
  border-color: var(--mga-gold);
}

.mgp-crest-pause:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

.mgp-trophy-meta {
  flex: 1 1 220px;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.mgp-trophy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mgp-trophy-head strong {
  font-size: 16.5px;
  font-weight: 900;
  color: var(--mga-gold-tx);
}

.mgp-trophy-head span {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--mga-tx-2);
  font-variant-numeric: tabular-nums;
}

.mgp-trophy-meta small {
  font-size: 12px;
  color: var(--mga-tx-2);
}

/* ---------- Progress Ring Cards ---------- */
.mgp-ring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
}

.mgp-ring-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  box-shadow: var(--mga-bevel);
  transition: border-color 0.18s var(--mga-ease);
}

.mgp-ring-card:hover {
  border-color: var(--mga-bd-2);
}

.mgp-ring-svg {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
}

.mgp-ring-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 5;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-ring-bg {
  stroke: rgba(15, 23, 42, 0.1);
}

.mgp-ring-ticks {
  fill: none;
  stroke: rgba(148, 163, 184, 0.26);
  stroke-width: 1;
  stroke-dasharray: 1 9.5;
}

.mgp-ring-fg {
  fill: none;
  stroke-width: 5.2;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 29px 29px;
  transition: stroke-dashoffset 0.7s var(--mga-ease);
}

.mgp-ring-fg--gold {
  stroke: #f0c14b;
}

.mgp-ring-fg--ok {
  stroke: #22c55e;
}

.mgp-ring-fg--sky {
  stroke: #38bdf8;
}

.mgp-ring-fg--violet {
  stroke: #a78bfa;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-ring-fg--gold {
  stroke: #b57b0c;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-ring-fg--ok {
  stroke: #15803d;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-ring-fg--sky {
  stroke: #0284c7;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-ring-fg--violet {
  stroke: #6d28d9;
}

.mgp-ring-pct {
  fill: var(--mga-tx);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.mgp-ring-meta {
  min-width: 0;
}

.mgp-ring-meta span {
  display: block;
  font-size: 12px;
  color: var(--mga-tx-2);
  font-weight: 700;
}

.mgp-ring-meta strong {
  display: block;
  font-size: 15.5px;
  font-weight: 900;
  color: var(--mga-tx);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.mgp-ring-meta small {
  display: block;
  font-size: 11px;
  color: var(--mga-gold-tx);
  font-weight: 700;
}

/* ---------- 15-Muscle Anatomical Heatmap & Volume Ledger ---------- */
.mgp-anat-wrap {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--mga-bd);
  background: var(--mga-surf-2);
}

@media (max-width: 780px) {
  .mgp-anat-wrap {
    grid-template-columns: 1fr;
  }
}

.mgp-anat-svg {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.mgp-anat-sil {
  fill: rgba(148, 163, 184, 0.08);
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 1.15;
}

.mgp-anat-guide {
  fill: none;
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 0.9;
  stroke-dasharray: 2.5 2.5;
}

.mgp-anat-lbl {
  fill: #94a3b8;
  font-size: 14px;
  font-weight: 800;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-sil {
  fill: rgba(15, 23, 42, 0.045);
  stroke: rgba(15, 23, 42, 0.28);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-guide {
  stroke: rgba(15, 23, 42, 0.16);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-lbl {
  fill: #475569;
}

.mgp-anat-m {
  fill: rgba(148, 163, 184, 0.24);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.22s ease, opacity 0.2s ease;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-m {
  fill: rgba(15, 23, 42, 0.14);
  stroke: rgba(15, 23, 42, 0.22);
}

.mgp-anat-m[data-st="under"] {
  fill: rgba(245, 158, 11, 0.65);
  stroke: #f59e0b;
}

.mgp-anat-m[data-st="optimal"] {
  fill: rgba(34, 197, 94, 0.65);
  stroke: #22c55e;
}

.mgp-anat-m[data-st="high"],
.mgp-anat-m[data-st="over"] {
  fill: rgba(239, 68, 68, 0.68);
  stroke: #ef4444;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-m[data-st="under"] {
  fill: rgba(217, 119, 6, 0.72);
  stroke: #b45309;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-m[data-st="optimal"] {
  fill: rgba(22, 163, 74, 0.72);
  stroke: #15803d;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-m[data-st="high"],
:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-m[data-st="over"] {
  fill: rgba(220, 38, 38, 0.72);
  stroke: #b91c1c;
}

.mgp-anat-m.is-focus {
  stroke: #ffffff;
  stroke-width: 2.2;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-anat-m.is-focus {
  stroke: #101722;
  stroke-width: 2.2;
}

.mgp-anat-m:hover {
  opacity: 0.85;
  stroke-width: 1.8;
}

.mgp-anat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--mga-tx-2);
  font-weight: 700;
  margin-top: 8px;
}

.mgp-anat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-end: 4px;
  vertical-align: middle;
}

/* ---------- Nutrition, Adaptive TDEE, Before/After & Charts ---------- */
.mgp-tdee-box {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(240, 193, 75, 0.3);
  background: rgba(240, 193, 75, 0.08);
  font-size: 13px;
  line-height: 1.75;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-tdee-box {
  background: rgba(246, 211, 107, 0.16);
  border-color: rgba(148, 102, 6, 0.28);
}

.mgp-cmp-stage {
  position: relative;
  direction: ltr;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--mga-bd-2);
  background: var(--mga-bg-2);
  margin-top: 12px;
  user-select: none;
}

.mgp-cmp-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mgp-cmp-img--top {
  clip-path: inset(0 50% 0 0);
}

.mgp-cmp-divider {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 50%;
  width: 2px;
  background: #f0c14b;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(240, 193, 75, 0.8);
}

.mgp-cmp-badge {
  position: absolute;
  inset-block-start: 12px;
  z-index: 3;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(14, 17, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #eef2f7;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  direction: rtl;
}

.mgp-cmp-badge--a {
  inset-inline-start: 12px;
}

.mgp-cmp-badge--b {
  inset-inline-end: 12px;
}

.mgp-cmp-hint {
  position: absolute;
  inset-block-end: 12px;
  inset-inline: 12px;
  z-index: 3;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(14, 17, 22, 0.84);
  border: 1px solid rgba(240, 193, 75, 0.42);
  color: #f8da7c;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  direction: rtl;
}

.mgp-cmp-rng {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  accent-color: #f0c14b;
  cursor: ew-resize;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-cmp-rng {
  accent-color: #7c5303;
}

.mgp-cmp-uploads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mgp-pr-tier-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--mga-bg-2);
  overflow: hidden;
  margin-top: 8px;
}

.mgp-pr-tier-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #22c55e, #f0c14b);
  transition: width 0.5s var(--mga-ease);
}

.mgp-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mga-tx-2);
}

.mgp-svg-chart {
  width: 100%;
  height: auto;
  aspect-ratio: 860 / 156;
  min-height: 132px;
  max-height: 204px;
  display: block;
  border-radius: 14px;
  background: rgba(10, 15, 26, 0.72);
  border: 1px solid var(--mga-bd);
}

.mgp-svg-chart--mid {
  aspect-ratio: 520 / 160;
  min-height: 156px;
  max-height: 220px;
}

.mgp-svg-chart--compact {
  aspect-ratio: 340 / 180;
  min-height: 168px;
  max-height: 230px;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-svg-chart {
  background: linear-gradient(180deg, #ffffff, #f5f8fd);
  border-color: rgba(15, 23, 42, 0.11);
}

.mgp-chart-grid {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chart-grid {
  stroke: rgba(15, 23, 42, 0.08);
}

.mgp-chart-lbl {
  fill: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chart-lbl {
  fill: #4b5a72;
}

.mgp-chart-line {
  fill: none;
  stroke: #f0c14b;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chart-line {
  stroke: #7c5303;
}

.mgp-chart-raw {
  fill: none;
  stroke: rgba(148, 163, 184, 0.48);
  stroke-width: 1.6;
  stroke-dasharray: 4 3;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chart-raw {
  stroke: rgba(71, 85, 105, 0.45);
}

.mgp-chart-dot {
  fill: #22c55e;
  stroke: #0e1116;
  stroke-width: 1.8;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chart-dot {
  fill: #15803d;
  stroke: #ffffff;
}

.mgp-chart-bar {
  fill: rgba(56, 189, 248, 0.28);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chart-bar {
  fill: rgba(2, 132, 199, 0.24);
}

.mgp-chart-gold-t {
  fill: #f6d36b;
  font-size: 11px;
  font-weight: 800;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chart-gold-t {
  fill: #7c5303;
}

.mgp-chart-sky-t {
  fill: #38bdf8;
  font-size: 11px;
  font-weight: 800;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-chart-sky-t {
  fill: #0369a1;
}

.mgp-chart-box {
  position: relative;
}

.mgp-chart-dot {
  cursor: pointer;
}

.mgp-chart-dot:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
  stroke: var(--mga-gold-tx);
  stroke-width: 3;
}

.mgp-chart-bar {
  cursor: pointer;
}

.mgp-chart-cross {
  stroke: var(--mga-gold-tx);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  pointer-events: none;
}

.mgp-chart-tip {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  z-index: 5;
  max-width: calc(100% - 16px);
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--mga-surf-3);
  border: 1px solid var(--mga-bd-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--mga-tx);
  box-shadow: var(--mga-shadow);
  pointer-events: none;
}

/* ---------- Status Pills, Volume Strip, Progression & Volume Cards ---------- */
.mgp-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(240, 193, 75, 0.14);
  border: 1px solid rgba(240, 193, 75, 0.35);
  color: var(--mga-gold-tx);
}

.mgp-pill-status.is-ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--mga-ok);
}

.mgp-pill-status.is-warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.38);
  color: var(--mga-warn);
}

.mgp-pill-status.is-err {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.38);
  color: #f87171;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-pill-status.is-ok {
  color: #166534;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-pill-status.is-warn {
  color: #92400e;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-pill-status.is-err {
  color: var(--mga-err);
}

.mgp-vol-strip {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid rgba(240, 193, 75, 0.3);
  background: rgba(240, 193, 75, 0.08);
  font-size: 13px;
  color: var(--mga-tx);
  font-variant-numeric: tabular-nums;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-vol-strip {
  background: rgba(246, 211, 107, 0.14);
  border-color: rgba(148, 102, 6, 0.26);
}

.mgp-vol-strip[hidden],
.mgp-pill-status[hidden] {
  display: none !important;
}

.mgp-prog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--mga-bd);
  background: var(--mga-surf-2);
}

.mgp-prog-card.is-plateau {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.07);
}

.mgp-prog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mgp-prog-top b {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
}

.mgp-prog-top small {
  display: block;
  font-size: 12.5px;
  color: var(--mga-tx-2);
  font-variant-numeric: tabular-nums;
}

.mgp-prog-target {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mgp-vol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 12px;
}

.mgp-vol-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--mga-bd);
  background: var(--mga-surf-2);
}

.mgp-vol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mgp-vol-head b {
  font-size: 14px;
  font-weight: 900;
  color: var(--mga-tx);
}

.mgp-vol-nums {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.8px;
  color: var(--mga-tx-2);
  font-variant-numeric: tabular-nums;
}

.mgp-vol-nums strong {
  color: var(--mga-gold-tx);
  font-size: 13.5px;
}

.mgp-vol-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--mga-bg-2);
  overflow: hidden;
}

.mgp-vol-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.mgp-vol-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.mgp-vol-tick--mrv {
  background: rgba(239, 68, 68, 0.82);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-vol-tick {
  background: rgba(15, 23, 42, 0.55);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-vol-tick--mrv {
  background: rgba(185, 28, 28, 0.78);
}

.mgp-vol-sugs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--mga-bd);
  font-size: 11.5px;
  color: var(--mga-tx-2);
}

.mgp-vol-sugs > span {
  width: 100%;
  font-weight: 700;
}

.mgp-sug-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(240, 193, 75, 0.48);
  background: rgba(240, 193, 75, 0.1);
  color: var(--mga-gold-tx);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-sug-btn {
  border-color: rgba(148, 102, 6, 0.44);
  background: rgba(227, 165, 43, 0.12);
  color: var(--mga-gold-tx);
}

.mgp-sug-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.mgp-caution-note {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--mga-bd);
  background: var(--mga-surf-2);
  font-size: 12.2px;
  color: var(--mga-tx-2);
  line-height: 1.65;
}

/* ---------- Supplements & Home Gym Rich Icon Grids ---------- */
.mgp-supp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.mgp-supp-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  transition: border-color 0.18s var(--mga-ease), background 0.18s var(--mga-ease);
}

.mgp-supp-card.is-checked {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.36);
}

.mgp-supp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.mgp-supp-meta {
  min-width: 0;
}

.mgp-supp-meta b {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--mga-tx);
}

.mgp-supp-meta small {
  display: block;
  font-size: 11.5px;
  color: var(--mga-tx-2);
}

.mgp-supp-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.mgp-supp-actions input[type="checkbox"] {
  position: relative;
  width: 20px;
  height: 20px;
  accent-color: #e3a52b;
  cursor: pointer;
}

.mgp-supp-actions input[type="checkbox"]::before {
  content: "";
  position: absolute;
  inset: -12px;
}

.mgp-supp-adder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--mga-bd);
}

.mgp-supp-adder select {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--mga-input-bg);
  border: 1px solid var(--mga-ctrl-bd);
  color: var(--mga-tx);
  font: inherit;
  font-size: max(1rem, 14px);
}

.mgp-equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mgp-equip-card {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 16px 12px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  color: var(--mga-tx);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--mga-bevel);
  transition: border-color 0.18s var(--mga-ease), background 0.18s var(--mga-ease), color 0.18s var(--mga-ease), transform 0.16s var(--mga-ease);
}

.mgp-equip-card:hover {
  border-color: rgba(240, 193, 75, 0.48);
}

.mgp-equip-card:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

.mgp-equip-card.is-on {
  background: radial-gradient(85% 90% at 50% 0%, rgba(240, 193, 75, 0.18), rgba(240, 193, 75, 0.05));
  border-color: rgba(240, 193, 75, 0.56);
  color: var(--mga-gold-tx);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-equip-card {
  background: #ffffff;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-equip-card.is-on {
  background: radial-gradient(85% 90% at 50% 0%, rgba(246, 211, 107, 0.26), rgba(227, 165, 43, 0.07));
  border-color: rgba(148, 102, 6, 0.48);
}

@media (prefers-reduced-motion: no-preference) {
  .mgp-equip-card:active {
    transform: scale(0.97);
  }
}

/* ---------- Saved Tab Unified Category Bar ---------- */
.mgp-saved-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.mgp-saved-tab {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  color: var(--mga-tx-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s var(--mga-ease), background 0.16s var(--mga-ease), color 0.16s var(--mga-ease);
}

.mgp-saved-tab:hover {
  border-color: var(--mga-bd-2);
  color: var(--mga-tx);
}

.mgp-saved-tab:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

.mgp-saved-tab.is-active,
.mgp-saved-tab[aria-selected="true"] {
  background: rgba(240, 193, 75, 0.16);
  border-color: rgba(240, 193, 75, 0.56);
  color: var(--mga-gold-tx);
  font-weight: 800;
  box-shadow: var(--mga-bevel);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-saved-tab {
  background: #ffffff;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-saved-tab.is-active,
:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-saved-tab[aria-selected="true"] {
  background: rgba(227, 165, 43, 0.14);
  border-color: rgba(148, 102, 6, 0.48);
  color: var(--mga-gold-tx);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.mgp-tab-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--mga-bg-2);
  color: var(--mga-tx-2);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mgp-saved-tab.is-active .mgp-tab-cnt,
.mgp-saved-tab[aria-selected="true"] .mgp-tab-cnt {
  background: rgba(240, 193, 75, 0.2);
  color: var(--mga-gold-tx);
}

.mgp-saved-list {
  display: grid;
  gap: 12px;
}

.mgp-item-rm {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: var(--mga-err);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.16s var(--mga-ease), border-color 0.16s var(--mga-ease);
}

.mgp-item-rm::before {
  content: "";
  position: absolute;
  inset: -3px;
}

.mgp-item-rm:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
}

.mgp-item-rm:focus-visible {
  outline: 2px solid var(--mga-err);
  outline-offset: 2px;
}

/* ---------- Coach Mode Studio Banner & Grid ---------- */
.mgp-coach-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 24px;
  background: radial-gradient(85% 95% at 88% 0%, rgba(240, 193, 75, 0.15), transparent 68%), var(--mga-surf-2);
  border: 1px solid rgba(240, 193, 75, 0.3);
  box-shadow: var(--mga-bevel);
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-coach-banner {
  background: radial-gradient(85% 95% at 88% 0%, rgba(246, 211, 107, 0.22), transparent 68%), #f8fafd;
  border-color: rgba(148, 102, 6, 0.26);
}

.mgp-coach-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 240px;
}

.mgp-coach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.mgp-coach-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  box-shadow: var(--mga-bevel);
}

/* ---------- Activity Timeline, Filter Select & Danger Zone ---------- */
#mgp-act-sec,
#mgp-pr-lift-filter {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--mga-input-bg);
  border: 1px solid var(--mga-ctrl-bd);
  color: var(--mga-tx);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

#mgp-act-sec:focus-visible,
#mgp-pr-lift-filter:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

.mgp-act-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
}

.mgp-act-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 200px;
}

.mgp-act-meta b {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--mga-tx);
}

.mgp-act-meta small {
  display: block;
  font-size: 12px;
  color: var(--mga-tx-2);
}

.mgp-act-val {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--mga-gold-tx);
  font-variant-numeric: tabular-nums;
}

.mgp-danger-zone {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.32);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-danger-zone {
  background: rgba(185, 28, 28, 0.045);
  border-color: rgba(185, 28, 28, 0.26);
}

.mgp-danger-zone p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--mga-tx-2);
}

/* ---------- Daily History Table (@container Stacked Cards) & Meal Log ---------- */
.mgp-table-wrap {
  overflow-x: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  border-radius: 14px;
  margin-top: 12px;
}

.mgp-table-wrap:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 2px;
}

.mgp-daily-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.mgp-daily-table th,
.mgp-daily-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--mga-bd);
  text-align: start;
}

.mgp-daily-table th {
  color: var(--mga-tx-2);
  font-weight: 800;
  font-size: 12px;
}

.mgp-daily-table tbody th[scope="row"] {
  color: var(--mga-tx);
  font-weight: 800;
}

@container (width < 600px) {
  .mgp-daily-table thead {
    display: none;
  }

  .mgp-daily-table tbody {
    display: grid;
    gap: 12px;
  }

  .mgp-daily-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: var(--mga-surf-2);
    border: 1px solid var(--mga-bd);
  }

  .mgp-daily-table tbody th[scope="row"] {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--mga-bd);
    padding: 0 0 8px;
    font-size: 13px;
    color: var(--mga-gold-tx);
  }

  .mgp-daily-table td {
    border-bottom: 0;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
  }

  .mgp-daily-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    color: var(--mga-tx-2);
  }
}

/* ---------- 12-Week Consistency Heatmap, Logs, Preferences, Blueprints & Threads ---------- */
.mgp-heatmap-wrap {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
}

.mgp-heatmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mgp-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  direction: ltr;
}

.mgp-hm-cell {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  aspect-ratio: 1;
  min-width: 12px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--mga-bd);
  background: var(--mga-bg-2);
  cursor: pointer;
  transition: transform 0.14s var(--mga-ease), border-color 0.14s var(--mga-ease);
}

.mgp-hm-cell:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: 1px;
}

.mgp-hm-cell[data-lvl="1"] {
  background: rgba(240, 193, 75, 0.24);
  border-color: rgba(240, 193, 75, 0.42);
}

.mgp-hm-cell[data-lvl="2"] {
  background: rgba(240, 193, 75, 0.46);
  border-color: rgba(240, 193, 75, 0.62);
}

.mgp-hm-cell[data-lvl="3"] {
  background: rgba(240, 193, 75, 0.72);
  border-color: rgba(240, 193, 75, 0.85);
}

.mgp-hm-cell[data-lvl="4"] {
  background: #f0c14b;
  border-color: #ffe484;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-hm-cell[data-lvl="1"] {
  background: #fef08a;
  border-color: #ca8a04;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-hm-cell[data-lvl="2"] {
  background: #fcd34d;
  border-color: #b45309;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-hm-cell[data-lvl="3"] {
  background: #e3a52b;
  border-color: #946606;
}

:is(html, body):is([data-lqd-page-color-scheme="light"], [data-theme="light"]) .mgp-hm-cell[data-lvl="4"] {
  background: #946606;
  border-color: #664302;
}

.mgp-hm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mgp-hm-detail {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mga-tx-2);
  min-height: 20px;
}

.mgp-hm-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--mga-tx-2);
}

.mgp-hm-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 6px;
  border: 1px solid var(--mga-bd);
}

.mgp-log-details {
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
}

.mgp-log-details > summary.mgp-row {
  list-style: none;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.mgp-log-details > summary.mgp-row::-webkit-details-marker {
  display: none;
}

.mgp-log-details > summary.mgp-row:focus-visible {
  outline: 2px solid var(--mga-gold-tx);
  outline-offset: -2px;
  border-radius: 14px;
}

.mgp-log-sets {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--mga-bd);
  display: grid;
  gap: 8px;
}

.mgp-log-ex {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--mga-surf);
  border: 1px solid var(--mga-bd);
  font-size: 12.5px;
}

.mgp-log-ex b {
  display: block;
  margin-bottom: 4px;
  color: var(--mga-tx);
}

.mgp-log-ex span {
  color: var(--mga-tx-2);
  font-variant-numeric: tabular-nums;
}

.mgp-settings-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mga-tx-2);
  font-variant-numeric: tabular-nums;
}

.mgp-pref-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.mgp-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  min-height: 56px;
  cursor: pointer;
}

.mgp-pref-row b {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--mga-tx);
}

.mgp-pref-row small {
  display: block;
  font-size: 12px;
  color: var(--mga-tx-2);
}

.mgp-pref-row input[type="checkbox"] {
  position: relative;
  width: 20px;
  height: 20px;
  accent-color: #e3a52b;
  cursor: pointer;
  flex: 0 0 auto;
}

.mgp-pref-row input[type="checkbox"]::before {
  content: "";
  position: absolute;
  inset: -12px;
}

.mgp-blueprint-card,
.mgp-homegym-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: var(--mga-surf-2);
  border: 1px solid var(--mga-bd);
  display: grid;
  gap: 12px;
}

.mgp-undo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(240, 193, 75, 0.12);
  border: 1px solid rgba(240, 193, 75, 0.36);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Gold Arena Portal <dialog> (Confirm, Prompt, Story Preview) ---------- */
dialog.mgp-dlg {
  width: min(440px, calc(100vw - 24px));
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 20px;
  background: var(--mga-surf);
  border: 1px solid var(--mga-bd-2);
  color: var(--mga-tx);
  font-family: var(--mga-font);
  direction: rtl;
  box-shadow: 0 32px 72px -18px rgba(0, 0, 0, 0.72), var(--mga-bevel);
  margin: auto;
}

dialog.mgp-dlg[open] {
  display: grid;
  gap: 16px;
}

dialog.mgp-dlg:modal {
  overscroll-behavior: contain;
}

dialog.mgp-dlg::backdrop {
  background: rgba(5, 7, 12, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog.mgp-dlg h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--mga-tx);
}

dialog.mgp-dlg p {
  margin: 0;
  font-size: 13.5px;
  color: var(--mga-tx-2);
  line-height: 1.7;
}

.mgp-dlg-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mgp-dlg-acts .mga-btn {
  min-height: 44px;
}

dialog.mgp-dlg.is-story {
  width: min(400px, calc(100vw - 24px));
}

.mgp-story-preview {
  width: 100%;
  max-height: 60dvh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--mga-bd);
  background: #07090d;
  display: block;
}

/* ---------- Mobile Bottom Quick-Switcher Dock (<=768px) ---------- */
.mgp-mob-dock {
  display: none;
}

/* ---------- MWG Scroll-Fade Properties ---------- */
@property --mgp-fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --mgp-fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@keyframes mgpFadeStart {
  to {
    --mgp-fade-start: var(--mgp-fade-size);
  }
}

@keyframes mgpFadeEnd {
  from {
    --mgp-fade-end: var(--mgp-fade-size);
  }
}

/* ---------- Responsive: Mobile First-Fold Rescue (<=960px, <=768px, <=640px, <=560px, <=440px) ---------- */
@media (max-width: 960px) {
  .mgp-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .mgp-side {
    position: static;
    gap: 12px;
  }

  /* Compact Horizontal Athlete Identity Ribbon */
  .mgp-id-card {
    padding: 16px;
    border-radius: 18px;
    text-align: start;
  }

  .mgp-id-top {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-align: start;
  }

  .mgp-av-wrap,
  .mgp-av {
    width: 56px;
    height: 56px;
    margin: 0;
    font-size: 20px;
  }

  .mgp-av-cam,
  .mgp-av-edit {
    width: 28px;
    height: 28px;
  }

  .mgp-av-cam::before,
  .mgp-av-edit::before {
    inset: -8px;
  }

  .mgp-name {
    font-size: 16px;
    margin-bottom: 4px;
  }

  .mgp-meta {
    justify-content: flex-start;
    margin-bottom: 0;
  }

  .mgp-id-kpis,
  .mgp-mini-kpis {
    margin-top: 12px;
    padding-top: 12px;
    gap: 8px;
  }

  .mgp-id-kpi,
  .mgp-mini-kpis > div {
    flex-direction: row;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border-radius: 10px;
  }

  .mgp-kpi-ic {
    margin-bottom: 0;
  }

  .mgp-id-kpi b,
  .mgp-mini-kpis b {
    font-size: 14px;
  }

  /* Sticky Nav Wrapper + MWG Scroll-Mask Strip (Zero Static Physical Overlay) */
  .mgp-nav-wrap {
    position: sticky;
    top: 68px;
    z-index: 35;
  }

  .mgp-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: inline proximity;
    overscroll-behavior-x: contain;
    gap: 8px;
    padding: 4px;
    border-radius: 14px;
    --mgp-fade-size: 2.5rem;
    scroll-padding-inline: 3.25rem;
    scroll-padding-inline: calc(var(--mgp-fade-size) + 12px);
    --mgp-fade-dir: left;
    --mgp-fade-start-pos: 100%;
    --mgp-fade-end-pos: 0;
    mask:
      linear-gradient(black, black) no-clip subtract,
      linear-gradient(to var(--mgp-fade-dir), black, transparent) var(--mgp-fade-start-pos) 0 / var(--mgp-fade-start) 100% no-repeat no-clip,
      linear-gradient(to var(--mgp-fade-dir), transparent, black) var(--mgp-fade-end-pos) 0 / var(--mgp-fade-end) 100% no-repeat no-clip;
    transition: --mgp-fade-start 0.2s ease, --mgp-fade-end 0.2s ease;
  }

  .mgp-nav.more-start {
    --mgp-fade-start: var(--mgp-fade-size);
  }

  .mgp-nav.more-end {
    --mgp-fade-end: var(--mgp-fade-size);
  }

  @supports (animation-timeline: scroll()) {
    .mgp-nav {
      animation: mgpFadeStart linear both, mgpFadeEnd linear both;
      animation-timeline: scroll(self inline);
      animation-range: 0 var(--mgp-fade-size), calc(100% - var(--mgp-fade-size)) 100%;
    }
  }

  .mgp-nav::-webkit-scrollbar {
    display: none;
  }

  .mgp-nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
    padding: 8px 12px;
    min-height: 44px;
    gap: 8px;
  }

  .mgp-nav-chev {
    display: none;
  }
}

@media (max-width: 768px) {
  .mgp-mob-dock {
    position: fixed;
    inset-block-end: 0;
    inset-inline: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom, 0px));
    background: var(--mga-glass);
    -webkit-backdrop-filter: blur(18px) saturate(165%);
    backdrop-filter: blur(18px) saturate(165%);
    border-top: 1px solid var(--mga-bd-2);
    box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, 0.55);
  }

  body.mgp-body:has(dialog:modal) .mgp-mob-dock {
    display: none;
  }

  .mgp-mob-dock-item {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--mga-tx-2);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
  }

  .mgp-mob-dock-item:focus-visible {
    outline: 2px solid var(--mga-gold-tx);
    outline-offset: -2px;
  }

  .mgp-mob-dock-item.is-active {
    background: rgba(240, 193, 75, 0.14);
    border-color: rgba(240, 193, 75, 0.42);
    color: var(--mga-gold-tx);
  }

  body.mgp-body:has(.mgp-mob-dock) .mgp-main {
    padding-block-end: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  body.mgp-body:has(.mgp-mob-dock) .mga-toast-region {
    inset-block-end: calc(80px + max(12px, env(safe-area-inset-bottom, 0px)));
  }
}

@media (max-width: 640px) {
  .mgp-topbar-in {
    width: calc(100% - 16px);
    min-height: 60px;
    gap: 8px;
  }

  .mgp-main {
    width: calc(100% - 16px);
    margin: 16px auto 56px;
  }

  .mgp-brand-logo {
    width: 36px;
    height: 36px;
  }

  .mgp-brand b,
  .mgp-brand-title {
    font-size: 15.5px;
  }

  .mgp-brand em,
  .mgp-brand-sub {
    display: none;
  }

  .mgp-top-acts {
    gap: 4px;
    flex-wrap: nowrap;
    min-width: 0;
  }

  /* 40x40 visual + ::before -3px = 44x44 touch target with zero 360px overflow */
  .mgp-theme-btn,
  .mga-btn.mgp-sm-btn.mgp-top-btn:not(.mga-btn-gold),
  .mgp-top-btn:not(.mga-btn-gold) {
    position: relative;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    gap: 0;
  }

  .mgp-theme-btn::before,
  .mgp-top-btn::before {
    content: "";
    position: absolute;
    inset: -3px;
  }

  .mga-btn.mgp-sm-btn.mgp-top-btn:not(.mga-btn-gold) .mgp-btn-lbl,
  .mgp-top-btn:not(.mga-btn-gold) .mgp-btn-lbl {
    display: none;
  }

  .mga-btn.mgp-sm-btn.mgp-top-btn.mga-btn-gold {
    min-height: 40px;
    padding: 0 12px;
    gap: 4px;
    font-size: 12.5px;
  }

  .mgp-panel {
    padding: 16px;
  }

  .mgp-panel-acts {
    width: 100%;
  }

  .mgp-panel-acts > .mga-btn {
    flex: 1 1 auto;
  }

  .mgp-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .mgp-equip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .mgp-svg-chart:not(.mgp-svg-chart--compact) {
    aspect-ratio: 16 / 9;
    min-height: 184px;
    max-height: 240px;
  }
}

@media (max-width: 540px) {
  .mgp-trophy-banner {
    justify-content: center;
    text-align: center;
  }

  .mgp-trophy-head {
    justify-content: center;
  }
}

@media (max-width: 440px) {
  .mgp-topbar-in {
    width: calc(100% - 16px);
    gap: 4px;
  }

  .mgp-brand {
    gap: 4px;
    min-height: 44px;
  }

  .mgp-brand-logo {
    width: 36px;
    height: 36px;
  }

  .mgp-brand b,
  .mgp-brand-title {
    font-size: 14px;
  }

  .mgp-top-acts {
    gap: 4px;
  }

  body.mgp-body:has([data-mga-open="login"]) .mgp-top-tools {
    display: none;
  }

  .mga-btn.mgp-sm-btn.mgp-top-btn.mga-btn-gold {
    min-height: 40px;
    padding: 0 8px;
    gap: 0;
    font-size: 12px;
  }

  .mga-btn.mgp-sm-btn.mgp-top-btn.mga-btn-gold .mgp-btn-ic {
    display: none;
  }
}

@media (forced-colors: active) {
  dialog.mgp-dlg,
  .mgp-panel,
  .mgp-row,
  .mgp-hm-cell,
  .mgp-mob-dock {
    border: 1px solid CanvasText;
  }

  .mgp-saved-tab.is-active,
  .mgp-saved-tab[aria-selected="true"],
  .mgp-nav-item.is-active,
  .mgp-mob-dock-item.is-active {
    border: 2px solid Highlight;
    background: Highlight;
    color: HighlightText;
  }

  .mgp-ac-item:focus-visible,
  .mgp-saved-tab:focus-visible,
  .mgp-nav-item:focus-visible,
  .mgp-mob-dock-item:focus-visible,
  .mgp-hm-cell:focus-visible {
    outline: 2px solid Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mgp-skel-line,
  .mgp-av.is-uploading::after {
    animation: none;
  }
  .mgp-ring-fg,
  .mgp-pr-tier-fill,
  .mgp-vol-fill,
  .mgp-nav-item,
  .mgp-top-btn,
  .mgp-theme-btn,
  .mgp-ic-well,
  .mgp-equip-card,
  .mgp-chip,
  .mgp-av-cam,
  .mgp-av-edit,
  .mgp-hm-cell {
    transition: none !important;
  }
}
