/* Meta screens (F): Loadout (Cards + Season), Profile, Settings. Prefix: .m-
   Arena design system: ink outlines, bevels, hard drop shadows, no glows. Panels use theme tokens. */

.m-screen { overflow-x: hidden; }
.m-small { font-size: var(--fs-xs); }
.m-center { text-align: center; }
.m-spread { justify-content: space-between; align-items: center; }
.m-good { color: var(--good); font-weight: 800; }
.m-bad { color: var(--bad); }
.m-body { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-dim); line-height: 1.4; }

/* Minimal fallbacks (only used if components.js is missing a helper) */
.m-bar { width: 100%; background: var(--bg-2); border: 2px solid var(--ink); border-radius: var(--r-pill); overflow: hidden; }
.m-bar__fill { height: 100%; width: 0; background: var(--blue-btn); border-radius: inherit; transition: width var(--t-slow) var(--ease-out); }
.m-fallback-sheet { position: fixed; inset: 0; z-index: var(--z-sheet); background: rgba(5, 12, 35, 0.6); display: flex; align-items: flex-end; }
.m-fallback-sheet__panel { width: 100%; max-height: 85vh; overflow: auto; background: var(--surface); border: 2.5px solid var(--ink); border-radius: 20px 20px 0 0; padding: var(--s-5) var(--s-4) calc(var(--s-5) + var(--safe-bottom)); }
.m-fallback-toast { position: fixed; left: 50%; top: calc(var(--hud-h) + var(--safe-top) + var(--s-3)); transform: translateX(-50%); z-index: var(--z-toast); background: var(--paper); color: var(--paper-ink); border: 2.5px solid var(--ink); padding: var(--s-2) var(--s-4); border-radius: var(--r-md); font-weight: 800; box-shadow: var(--shadow-card); }
.m-fstat { padding: var(--s-3); }
.m-fstat__val { font: 400 var(--fs-lg) var(--font-num); color: var(--m-c, var(--text)); text-shadow: var(--ts-outline-sm); }
.m-fstat__label { font-size: var(--fs-sm); font-weight: 800; }
.m-empty { text-align: center; padding: var(--s-5); }
.m-empty__emoji { font-size: 48px; }

/* =========================================================================
   SHARED BITS
   ========================================================================= */
/* Panel header: display title with icon + optional chip on the right */
.m-cardhead { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-3); min-height: 32px; }
.m-cardhead__title { display: flex; align-items: center; gap: var(--s-2); font-size: 22px; line-height: 1; }
.m-cardhead__title .ic { font-size: 28px; }

/* Rarity pill */
.m-rpill {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-pill);
  border: 2px solid var(--ink);
  background: var(--r-common);
  color: #fff;
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.02em; line-height: 1;
  text-shadow: var(--ts-outline-sm);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.m-rpill--rare { background: var(--r-rare); }
.m-rpill--epic { background: var(--r-epic); }
.m-rpill--legendary { background: var(--r-legendary); }

/* Tip line under a section */
.m-hint, .m-tip {
  display: flex; align-items: flex-start; gap: var(--s-2);
  margin: 0;
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: rgba(13, 24, 56, 0.35);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18);
  font-size: 14px; font-weight: 700; color: var(--text-dim); line-height: 1.35;
}
.m-hint .ic, .m-tip .ic { font-size: 22px; margin-top: -1px; }

/* Callout banners (green = ready, red = danger) */
.m-banner {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, var(--green) 0%, var(--green-lo) 100%);
  box-shadow: var(--bevel), var(--shadow-card);
  color: #fff; font-weight: 800; font-size: 14px; line-height: 1.3;
  text-shadow: 0 1px 0 rgba(13, 24, 56, 0.45);
}
.m-banner b { display: block; font-size: 18px; font-weight: 400; text-shadow: var(--ts-outline-sm); }
.m-banner__ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(13, 24, 56, 0.35); border: 2px solid var(--ink); font-size: 28px; }
.m-banner--danger { background: linear-gradient(180deg, var(--red-btn) 0%, var(--red-btn-lo) 100%); }

/* XP / progress bar with an icon cap and centered number (Clash-style) */
.m-xpbar { --p: 0; --bar-c: var(--violet); display: flex; align-items: center; width: 100%; }
.m-xpbar__ic {
  position: relative; z-index: 1; flex: none;
  display: grid; place-items: center;
  width: 34px; height: 34px; margin-right: -14px;
  font-size: 30px;
}
.m-xpbar__track {
  position: relative; flex: 1; min-width: 0;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.m-xpbar__fill {
  position: absolute; inset: 0 auto 0 0;
  width: calc(var(--p) * 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0 35%, transparent 35% 70%, rgba(0, 0, 0, 0.15) 70%), var(--bar-c);
  border-right: 2px solid var(--ink);
  transition: width 700ms var(--ease-out);
}
.m-xpbar__txt {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 14px; line-height: 1; color: #fff;
  text-shadow: var(--ts-outline-sm);
  font-variant-numeric: tabular-nums;
}
.m-xpbar--sm { margin-top: 6px; }
.m-xpbar--sm .m-xpbar__track { height: 18px; }
.m-xpbar--sm .m-xpbar__txt { font-size: 12px; }
.m-xpbar--max { --bar-c: var(--yellow); }

/* Sheet content tweaks for our sheets */
.m-sheet .sheet__body { padding-bottom: calc(var(--s-6) + var(--safe-bottom)); }

/* =========================================================================
   LOADOUT: Cards / Season segmented switch
   ========================================================================= */
.m-tabs {
  margin-bottom: var(--s-4);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 5px;
  border-radius: var(--r-lg);
  background: var(--bg-2);
  border: 2.5px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.3), 0 3px 0 var(--ink-soft);
}
.m-tab {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px;
  border-radius: var(--r-md);
  border: 2.5px solid transparent;
  font-family: var(--font-display); font-size: 20px; line-height: 1;
  color: var(--text-mute);
  text-shadow: none;
  transition: transform var(--t-fast) var(--ease-out);
}
.m-tab .ic { font-size: 28px; filter: grayscale(0.7) brightness(0.8); opacity: 0.8; }
.m-tab:active { transform: translateY(2px); }
.m-tab--on {
  color: #fff;
  border-color: var(--ink);
  background: linear-gradient(180deg, var(--blue-btn) 0%, var(--blue-btn) 45%, var(--blue-btn-lo) 100%);
  box-shadow: inset 0 -5px 0 var(--blue-btn-edge), inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 var(--ink);
  text-shadow: var(--ts-outline-sm);
  padding-bottom: 4px;
}
.m-tab--on .ic { filter: none; opacity: 1; }
.m-tab .badge { position: absolute; top: -8px; right: 8px; }

/* =========================================================================
   LOADOUT: collection header + deck grid
   ========================================================================= */
.m-collection { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.m-collection__ic { font-size: 40px; display: inline-flex; }
.m-collection__txt { flex: 1; min-width: 0; }
.m-collection__label { font-size: 14px; font-weight: 800; color: var(--text-dim); }
.m-collection__num { font-size: 30px; line-height: 1; }
.m-collection__num small { font-size: 18px; color: var(--text-dim); }
.m-collection__ready {
  display: inline-flex; align-items: center; gap: 4px;
  height: 36px; padding: 0 var(--s-3) 0 var(--s-2);
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--green) 0%, var(--green-lo) 100%);
  border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 3px 0 var(--ink-soft);
  font-family: var(--font-display); font-size: 16px; text-shadow: var(--ts-outline-sm);
}
.m-collection__ready .ic { font-size: 22px; }

.m-cardgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4) var(--s-3); }

.m-xcard {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  min-width: 0;
  text-align: center;
  transition: transform var(--t-fast) var(--ease-out);
}
.m-xcard:active { transform: translateY(2px) scale(0.97); }
.m-xcard__ex {
  font-size: 14px; font-weight: 800; line-height: 1.2; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.4em;
}

/* Card face: rarity-colored frame, slot-colored art, level band */
.m-cface {
  --rar: var(--r-common);
  --rar-lo: #7d8db0;
  position: relative;
  padding: 4px 4px 0;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rar) 70%, #fff) 0%, var(--rar) 30%, var(--rar-lo) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 4px 0 var(--ink-soft);
}
.m-cface--rare { --rar: var(--r-rare); --rar-lo: #d9700a; }
.m-cface--epic { --rar: var(--r-epic); --rar-lo: #8a3dd1; }
.m-cface--legendary { --rar: var(--r-legendary); --rar-lo: #1fa6d6; }
.m-cface__art {
  position: relative;
  aspect-ratio: 1 / 1.1;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--slot-c) 55%, #fff) 0%, var(--slot-c) 45%, color-mix(in srgb, var(--slot-c) 60%, #0d1838) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
/* subtle diagonal sheen pattern on the art (static) */
.m-cface__art::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 8px, transparent 8px 16px);
  pointer-events: none;
}
.m-cface__icon { position: relative; display: inline-flex; font-size: 54px; margin-top: -10px; filter: drop-shadow(0 3px 0 rgba(13, 24, 56, 0.45)); }
.m-cface__name {
  position: absolute; left: 0; right: 0; bottom: 5px;
  font-family: var(--font-display); font-size: 15px; line-height: 1; color: #fff;
  text-shadow: var(--ts-outline-sm);
}
.m-cface__slot {
  position: absolute; top: 4px; left: 4px; z-index: 1;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(13, 24, 56, 0.75);
  border: 2px solid var(--ink);
  font-family: var(--font-display); font-size: 13px; line-height: 1; color: #fff;
}
.m-cface__mastered { position: absolute; top: 3px; right: 3px; z-index: 1; display: inline-flex; font-size: 24px; }
.m-cface__lv {
  padding: 5px 2px 6px;
  font-family: var(--font-display); font-size: 15px; line-height: 1; color: #fff;
  text-shadow: var(--ts-outline-sm);
}
.m-cface__ready {
  position: absolute; top: -10px; right: -10px; z-index: 2;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--green) 0%, var(--green-lo) 100%);
  border: 2.5px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 var(--ink-soft);
  font-size: 22px;
  animation: m-bob 1.1s ease-in-out infinite;
}
.m-cface__ready .ic path:last-child,
.m-xbar--ready .m-xbar__ic .ic path:last-child,
.m-collection__ready .ic path:last-child,
.m-banner--ready .m-banner__ic .ic path:last-child { stroke: #fff; }
.m-cface--big { width: 128px; }
.m-cface--big .m-cface__icon { font-size: 66px; }
.m-cface--big .m-cface__name { font-size: 17px; }
.m-cface--big .m-cface__lv { font-size: 17px; }

/* Upgrade progress bar under a card */
.m-xbar { --p: 0; --bar-c: var(--blue-btn); display: flex; align-items: center; }
.m-xbar__ic {
  position: relative; z-index: 1; flex: none;
  display: grid; place-items: center;
  width: 26px; height: 26px; margin-right: -10px;
  border-radius: 7px;
  background: var(--blue-btn-lo);
  border: 2px solid var(--ink);
  font-size: 17px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.m-xbar__track {
  position: relative; flex: 1; min-width: 0;
  height: 20px;
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  background: var(--bg-2);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.m-xbar__fill {
  position: absolute; inset: 0 auto 0 0;
  width: calc(var(--p) * 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0 35%, transparent 35% 70%, rgba(0, 0, 0, 0.15) 70%), var(--bar-c);
  transition: width 700ms var(--ease-out);
}
.m-xbar__txt {
  position: absolute; inset: 0; padding-left: 8px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 13px; line-height: 1; color: #fff;
  text-shadow: var(--ts-outline-sm);
}
.m-xbar--ready { --bar-c: var(--green); }
.m-xbar--ready .m-xbar__ic { background: var(--green-lo); }
.m-xbar--max { --bar-c: var(--yellow); }
.m-xbar--max .m-xbar__ic { background: var(--yellow-lo); }

/* =========================================================================
   LOADOUT: card detail sheet
   ========================================================================= */
.m-detail { gap: var(--s-4); }
.m-detail__hero { display: flex; gap: var(--s-4); align-items: flex-start; }
.m-detail__card { display: flex; flex-direction: column; gap: 8px; flex: none; width: 128px; }
.m-detail__info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding-top: 2px; }
.m-detail__name { font-size: 24px; line-height: 1.05; }
.m-detail__kicker { font-size: 14px; font-weight: 800; color: var(--text-dim); }
.m-detail__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.m-detail__chips .chip { white-space: normal; min-height: 30px; }
.m-detail__sec {
  padding: var(--s-3) var(--s-4) var(--s-4);
  border-radius: var(--r-lg);
  background: rgba(13, 24, 56, 0.3);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18);
}
.m-detail__h { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); font-size: 19px; line-height: 1; }
.m-detail__h .ic { font-size: 24px; }
.m-cues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m-cues li { display: flex; gap: var(--s-2); align-items: flex-start; font-size: 15px; font-weight: 700; line-height: 1.35; }
.m-cues li .ic { font-size: 18px; margin-top: 1px; }
.m-rule { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--text); }
.m-rule--last { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); color: var(--text-dim); font-size: 14px; }
.m-rule--last .ic { font-size: 20px; }

/* Level ladder */
.m-ladder { display: grid; gap: var(--s-2); }
.m-ladder__row {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 60px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  border: 2px solid var(--ink);
  background: var(--grad-panel);
  box-shadow: var(--bevel), 0 3px 0 var(--ink-soft);
}
.m-ladder__node {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--ink);
  font-family: var(--font-display); font-size: 15px; line-height: 1; color: var(--text-dim);
  text-shadow: var(--ts-outline-sm);
}
.m-ladder__node .ic { font-size: 18px; }
.m-ladder__tile {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--slot-c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  font-size: 30px;
}
.m-ladder__body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.m-ladder__name { font-family: var(--font-display); font-size: 17px; line-height: 1.1; text-shadow: var(--ts-outline-sm); }
.m-ladder__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--text-dim); }
.m-ladder__gear { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: var(--paper); }
.m-ladder__gear .ic { font-size: 16px; }
.m-ladder__tag {
  flex: none;
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); border: 2px solid var(--ink);
  font-family: var(--font-display); font-size: 13px; line-height: 1; color: #fff; text-shadow: var(--ts-outline-sm);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.m-ladder__tag--current { background: var(--yellow-lo); }
.m-ladder__tag--next { background: var(--blue-btn-lo); }
.m-ladder__lock { flex: none; font-size: 24px; display: inline-flex; }
.m-ladder__row--done .m-ladder__node { background: var(--green-lo); }
.m-ladder__row--current { box-shadow: var(--bevel), inset 0 0 0 3px var(--yellow), 0 3px 0 var(--ink-soft); }
.m-ladder__row--current .m-ladder__node { background: var(--yellow); color: #fff; }
.m-ladder__row--locked { background: rgba(13, 24, 56, 0.35); box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18); }
.m-ladder__row--locked .m-ladder__tile { background: var(--bg-2); filter: grayscale(1); }
.m-ladder__row--locked .m-ladder__name { color: var(--text-dim); }

/* =========================================================================
   SEASON
   ========================================================================= */
.m-season-head { display: grid; gap: var(--s-4); }
.m-season-head__top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-2); }
.m-season-head__kicker { font-size: 14px; font-weight: 800; color: var(--text-dim); }
.m-season-head__title { font-size: 30px; line-height: 1; }
.m-season-head__days { flex: none; }
.m-season-head__tier { display: flex; align-items: center; gap: var(--s-3); }
.m-season-head__progress { flex: 1; min-width: 0; display: grid; gap: 6px; }
.m-season-head__next { font-size: 15px; font-weight: 800; color: var(--text-dim); }
.m-season-head__next b { font-family: var(--font-display); font-weight: 400; color: #fff; text-shadow: var(--ts-outline-sm); }

/* Tier badge: shield shape, purple (XP color) */
.m-tierbadge {
  position: relative; flex: none;
  width: 68px; height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-bottom: 6px;
}
.m-tierbadge::before, .m-tierbadge::after {
  content: ''; position: absolute;
  clip-path: polygon(50% 0, 100% 14%, 100% 64%, 50% 100%, 0 64%, 0 14%);
}
.m-tierbadge::before { inset: 0; background: var(--ink); }
.m-tierbadge::after { inset: 3px; background: linear-gradient(180deg, #d99bff 0%, var(--violet) 45%, #7b33c2 100%); }
.m-tierbadge > * { position: relative; z-index: 1; }
.m-tierbadge__lbl { font-family: var(--font-display); font-size: 12px; line-height: 1; text-shadow: var(--ts-outline-sm); }
.m-tierbadge__num { font-size: 32px; line-height: 1; }

.m-tease { display: grid; gap: var(--s-2); }
.m-tease__label { font-size: 14px; font-weight: 800; color: var(--text-dim); }
.m-tease__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.m-tease__item {
  --rar: var(--r-common);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--s-2) var(--s-1) 0;
  border-radius: var(--r-md);
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rar) 65%, #fff) 0%, var(--rar) 40%, color-mix(in srgb, var(--rar) 70%, #0d1838) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 var(--ink-soft);
  overflow: hidden;
}
.m-tease__item--rare { --rar: var(--r-rare); }
.m-tease__item--epic { --rar: var(--r-epic); }
.m-tease__item--legendary { --rar: var(--r-legendary); }
.m-tease__ic { font-size: 44px; display: inline-flex; filter: drop-shadow(0 3px 0 rgba(13, 24, 56, 0.4)); }
.m-tease__tier {
  align-self: stretch; text-align: center;
  padding: 4px 0 5px;
  background: rgba(13, 24, 56, 0.55);
  font-family: var(--font-display); font-size: 14px; line-height: 1; text-shadow: var(--ts-outline-sm);
}

/* Reward tile (icon in rarity-colored square) */
.m-rtile {
  --rar: var(--r-common);
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rar) 65%, #fff) 0%, var(--rar) 45%, color-mix(in srgb, var(--rar) 70%, #0d1838) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  font-size: 36px;
}
.m-rtile--rare { --rar: var(--r-rare); }
.m-rtile--epic { --rar: var(--r-epic); }
.m-rtile--legendary { --rar: var(--r-legendary); }
.m-rtile__lock {
  position: absolute; right: -6px; bottom: -6px;
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--ink);
  font-size: 15px;
}

/* Track: vertical rail with nodes */
.m-track { position: relative; display: grid; gap: var(--s-3); padding-left: 2px; }
.m-track::before {
  content: ''; position: absolute; left: 20px; top: 20px; bottom: 20px;
  width: 8px; border-radius: 4px;
  background: var(--bg-2); border: 2px solid var(--ink);
}
.m-tier { position: relative; display: flex; align-items: center; gap: var(--s-3); }
.m-tier__node {
  position: relative; z-index: 1; flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--surface-2);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 3px 0 var(--ink-soft);
  color: var(--text-dim);
}
.m-tier__node .display { font-size: 18px; line-height: 1; }
.m-tier__node .ic { font-size: 24px; }
.m-tier__card {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 72px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  border: 2px solid var(--ink);
  background: var(--grad-panel);
  box-shadow: var(--bevel), 0 3px 0 var(--ink-soft);
}
.m-tier__txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.m-tier__name { font-family: var(--font-display); font-size: 17px; line-height: 1.1; text-shadow: var(--ts-outline-sm); overflow-wrap: anywhere; }
.m-tier__meta { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--text-dim); }
.m-tier__state {
  flex: none;
  display: inline-flex; align-items: center; gap: 3px;
  height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); border: 2px solid var(--ink);
  font-family: var(--font-display); font-size: 13px; line-height: 1; color: #fff; text-shadow: var(--ts-outline-sm);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.m-tier__state .ic { font-size: 15px; margin-left: -3px; }
.m-tier__state--claimed { background: var(--green-lo); }
.m-tier__state--next { background: var(--yellow-lo); }

.m-tier--claimed .m-tier__node { background: linear-gradient(180deg, var(--green) 0%, var(--green-lo) 100%); }
.m-tier--claimed .m-tier__card { background: rgba(13, 24, 56, 0.3); box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18); }
.m-tier--claimed .m-tier__name { color: var(--text-dim); }
.m-tier--next .m-tier__node { background: linear-gradient(180deg, #ffe066 0%, var(--yellow) 50%, var(--yellow-lo) 100%); color: #fff; width: 48px; height: 48px; margin-left: -2px; }
.m-tier--next .m-tier__node .display { font-size: 20px; }
.m-tier--next .m-tier__card { box-shadow: var(--bevel), inset 0 0 0 3px var(--yellow), 0 4px 0 var(--ink-soft); min-height: 84px; }
.m-tier--locked .m-tier__card { background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-2) 100%); }
.m-tier--locked .m-rtile { filter: saturate(0.55) brightness(0.9); }
.m-tier--big.m-tier--locked .m-rtile { filter: none; }

/* =========================================================================
   PROFILE: player banner + rank emblem
   ========================================================================= */
.m-frame { --fr-w: 4px; position: relative; border-radius: calc(var(--r-lg) + 4px); padding: var(--fr-w); background: var(--ink); box-shadow: var(--shadow-card); }
.m-frame--none { --fr-w: 0px; background: transparent; }
.m-frame--bronze { background: linear-gradient(160deg, #f0b27a 0%, #b5672a 45%, #7a3f14 100%); }
.m-frame--silver { background: linear-gradient(160deg, #ffffff 0%, #c3cde0 40%, #7f8fb0 100%); }
.m-frame--gold { --fr-w: 5px; background: linear-gradient(160deg, #fff2a8 0%, var(--yellow) 40%, var(--yellow-lo) 100%); }
.m-frame--diamond { --fr-w: 5px; background: linear-gradient(135deg, #e9fbff 0%, var(--r-legendary) 30%, #46a8ff 60%, #e9fbff 100%); }
.m-frame--flame { --fr-w: 5px; background: linear-gradient(0deg, #e0312a 0%, var(--orange) 45%, var(--yellow) 100%); }
.m-frame--rainbow { --fr-w: 5px; background: linear-gradient(90deg, #ff5d4f, #ff9a1f, #ffc933, #74d93e, #55e3ff, #46a8ff, #c062ff, #ff7ac8); }
.m-frame:not(.m-frame--none) > .m-player__inner { border-radius: var(--r-lg); }

.m-player { box-shadow: var(--shadow-card); }
.m-player__inner {
  display: grid; gap: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 2px solid var(--ink);
  background: var(--grad-panel);
  box-shadow: var(--bevel);
}
.m-player__top { display: flex; align-items: center; gap: var(--s-4); }
.m-player__id { flex: 1; min-width: 0; display: grid; gap: 4px; }
.m-player__name { font-size: 30px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-player__title {
  justify-self: start;
  max-width: 100%;
  padding: 3px 10px 4px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--font-display); font-size: 14px; line-height: 1.1;
  box-shadow: 0 2px 0 var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-player__since { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--text-dim); }
.m-player__since .ic { font-size: 16px; }
.m-player__rank {
  display: grid; gap: var(--s-2);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: rgba(13, 24, 56, 0.35);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18);
}
.m-player__rankrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.m-player__rankname { font-size: 20px; line-height: 1; }
.m-player__next { font-size: 14px; font-weight: 800; color: var(--text-dim); }

.m-emblem {
  --rank-c: var(--blue-btn);
  position: relative; flex: none;
  display: flex; flex-direction: column; align-items: center;
}
.m-emblem__shield {
  position: relative;
  display: grid; place-items: center;
  width: 78px; height: 86px;
  padding-bottom: 6px;
}
.m-emblem__shield::before, .m-emblem__shield::after {
  content: ''; position: absolute;
  clip-path: polygon(50% 0, 100% 16%, 100% 62%, 50% 100%, 0 62%, 0 16%);
}
.m-emblem__shield::before { inset: 0; background: var(--ink); }
.m-emblem__shield::after {
  inset: 3.5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0 4px, transparent 4px),
    linear-gradient(180deg, color-mix(in srgb, var(--rank-c) 65%, #fff) 0%, var(--rank-c) 45%, color-mix(in srgb, var(--rank-c) 65%, #000) 100%);
}
.m-emblem__ic { position: relative; z-index: 1; display: inline-flex; font-size: 46px; filter: drop-shadow(0 3px 0 rgba(13, 24, 56, 0.4)); }
.m-emblem__tier {
  position: relative; z-index: 2;
  margin-top: -14px;
  min-width: 38px; height: 24px; padding: 0 8px;
  display: grid; place-items: center;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, #ffe066 0%, var(--yellow) 50%, var(--yellow-lo) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 2px 0 var(--ink-soft);
  font-family: var(--font-display); font-size: 15px; line-height: 1; color: #fff;
  text-shadow: var(--ts-outline-sm);
}

/* =========================================================================
   PROFILE: career stats
   ========================================================================= */
.m-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.m-stat.stat-tile { flex-direction: row; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); min-height: 60px; }
.m-stat__ic { flex: none; display: inline-flex; font-size: 30px; }
.m-stat__txt { min-width: 0; display: grid; gap: 2px; }
.m-stat__val { font-family: var(--font-num); font-size: 21px; line-height: 1; color: #fff; text-shadow: var(--ts-outline-sm); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-stat__label { font-size: 13px; font-weight: 800; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================================
   PROFILE: activity heatmap
   ========================================================================= */
.m-heat { display: grid; gap: var(--s-2); }
.m-heat .m-cardhead { margin-bottom: var(--s-1); }
.m-heat__months, .m-heat__grid { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.m-heat__months { margin-left: 19px; font-size: 11px; font-weight: 800; color: var(--text-dim); }
.m-heat__month { white-space: nowrap; overflow: visible; }
.m-heat__body {
  display: flex; gap: 4px;
  padding: var(--s-2);
  margin: 0 calc(var(--s-2) * -1);
  border-radius: var(--r-md);
  background: rgba(13, 24, 56, 0.35);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18);
}
.m-heat__days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; width: 12px; font-size: 10px; font-weight: 800; color: var(--text-dim); align-items: center; }
.m-heat__grid { flex: 1; }
.m-heat__col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.m-heat__cell { display: inline-block; aspect-ratio: 1; min-width: 10px; border-radius: 4px; background: var(--bg-2); box-shadow: inset 0 0 0 1.5px rgba(13, 24, 56, 0.6); }
.m-heat__cell--1 { background: #2f7a2a; }
.m-heat__cell--2 { background: var(--green-lo); }
.m-heat__cell--3 { background: #5cc42e; }
.m-heat__cell--4 { background: var(--green); box-shadow: inset 0 0 0 1.5px var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.m-heat__cell--future { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.12); }
.m-heat__cell--today { box-shadow: inset 0 0 0 2.5px var(--yellow); }
.m-heat__legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 12px; font-weight: 800; color: var(--text-dim); }
.m-heat__legend .m-heat__cell { width: 12px; min-width: 12px; }

/* =========================================================================
   PROFILE: achievements
   ========================================================================= */
.m-trophy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3) var(--s-2); }
.m-trophy {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 0; padding: 0;
  text-align: center;
  transition: transform var(--t-fast) var(--ease-out);
}
.m-trophy:active { transform: translateY(2px) scale(0.96); }
.m-trophy__tile {
  position: relative;
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 1;
  max-width: 88px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  font-size: 46px;
}
.m-trophy--on .m-trophy__tile {
  background: radial-gradient(circle at 50% 40%, #fff3b8 0%, var(--yellow) 45%, var(--yellow-lo) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -4px 0 rgba(166, 89, 8, 0.45), 0 4px 0 var(--ink-soft);
}
.m-trophy--on .m-trophy__tile > .ic { filter: drop-shadow(0 3px 0 rgba(13, 24, 56, 0.35)); }
.m-trophy--locked .m-trophy__tile {
  background: var(--bg-2);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.3);
}
.m-trophy--locked .m-trophy__tile > .ic { filter: grayscale(1) brightness(0.75); opacity: 0.45; }
.m-trophy__lock {
  position: absolute; right: -6px; bottom: -6px;
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--ink);
  font-size: 16px;
}
.m-trophy__name { font-size: 13px; font-weight: 800; line-height: 1.15; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-trophy--locked .m-trophy__name { color: var(--text-dim); }
.m-more { margin-top: var(--s-3); }

.m-ach-detail { align-items: center; text-align: center; padding-top: var(--s-2); }
.m-ach-detail__tile {
  position: relative;
  display: grid; place-items: center;
  width: 112px; height: 112px;
  border-radius: 22px;
  border: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 40%, #fff3b8 0%, var(--yellow) 45%, var(--yellow-lo) 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.6), inset 0 -5px 0 rgba(166, 89, 8, 0.45), 0 5px 0 var(--ink-soft);
  font-size: 68px;
}
.m-ach-detail--locked .m-ach-detail__tile { background: var(--bg-2); box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.3); }
.m-ach-detail--locked .m-ach-detail__tile > .ic { filter: grayscale(1) brightness(0.75); opacity: 0.5; }
.m-ach-detail__lock { position: absolute; right: -8px; bottom: -8px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); border: 2.5px solid var(--ink); font-size: 24px; }
.m-ach-detail__name { font-size: 26px; }
.m-ach-detail__desc { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-dim); }

/* =========================================================================
   PROFILE: locker (cosmetics)
   ========================================================================= */
.m-subtabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  padding: 4px;
  margin-bottom: var(--s-3);
  border-radius: var(--r-md);
  background: var(--bg-2);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.3);
}
.m-subtab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px;
  border-radius: 9px;
  border: 2px solid transparent;
  font-family: var(--font-display); font-size: 14px; line-height: 1; color: var(--text-mute);
}
.m-subtab .ic { font-size: 26px; filter: grayscale(0.7) brightness(0.8); opacity: 0.8; }
.m-subtab--on {
  color: #fff;
  border-color: var(--ink);
  background: linear-gradient(180deg, var(--blue-btn) 0%, var(--blue-btn) 45%, var(--blue-btn-lo) 100%);
  box-shadow: inset 0 -4px 0 var(--blue-btn-edge), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  text-shadow: var(--ts-outline-sm);
  padding-bottom: 3px;
}
.m-subtab--on .ic { filter: none; opacity: 1; }

.m-loot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.m-loot-grid--title { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m-loot {
  --rar: var(--r-common);
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 0;
  padding: var(--s-3) var(--s-1) 0;
  border-radius: var(--r-md);
  border: 2px solid var(--ink);
  background: var(--grad-panel);
  box-shadow: var(--bevel), 0 3px 0 var(--ink-soft);
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease-out);
}
.m-loot:active { transform: translateY(2px); }
.m-loot.m-r-rare { --rar: var(--r-rare); }
.m-loot.m-r-epic { --rar: var(--r-epic); }
.m-loot.m-r-legendary { --rar: var(--r-legendary); }
.m-loot__art { position: relative; display: grid; place-items: center; min-height: 52px; }
.m-loot__lock {
  position: absolute; right: -10px; bottom: -6px;
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--ink);
  font-size: 15px;
}
.m-loot__name { font-family: var(--font-display); font-size: 14px; line-height: 1.1; text-shadow: var(--ts-outline-sm); padding: 0 4px; overflow-wrap: anywhere; }
.m-loot__state {
  align-self: stretch;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  margin-top: auto;
  min-height: 26px;
  border-top: 2px solid var(--ink);
  background: var(--rar);
  font-family: var(--font-display); font-size: 13px; line-height: 1; color: #fff; text-shadow: var(--ts-outline-sm);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.m-loot__state .ic { font-size: 15px; }
.m-loot__state--on { background: var(--green-lo); }
.m-loot__state--locked { background: var(--bg-2); color: var(--text-mute); box-shadow: none; }
.m-loot--on { box-shadow: var(--bevel), inset 0 0 0 3px #fff, 0 3px 0 var(--ink-soft); }
.m-loot--locked { background: rgba(13, 24, 56, 0.35); box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18); }
.m-loot--locked .m-loot__art > :first-child { filter: saturate(0.75) brightness(0.85); }
.m-loot--locked .m-loot__name { color: var(--text-dim); }
.m-loot__preview {
  display: inline-flex; align-items: center; gap: 3px;
  height: 26px; padding: 0 10px 0 6px;
  border-radius: var(--r-pill);
  border: 2px solid var(--ink);
  background: var(--blue-btn-lo);
  font-family: var(--font-display); font-size: 13px; line-height: 1; text-shadow: var(--ts-outline-sm);
  cursor: pointer;
}
.m-loot__preview .ic { font-size: 14px; }

/* Theme swatch: a tiny arena preview, tinted by its own [data-theme] tokens */
.m-swatch {
  position: relative;
  display: grid; place-items: center;
  width: 64px; height: 52px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(45deg, var(--arena-pattern) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, var(--arena-top) 0%, var(--arena-bot) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}
.m-swatch__panel {
  display: flex; align-items: flex-end; justify-content: center;
  width: 42px; height: 30px;
  padding-bottom: 4px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface) 45%, var(--surface-2) 100%);
  box-shadow: inset 0 2px 0 var(--panel-hi);
}
.m-swatch__btn { width: 24px; height: 8px; border-radius: 3px; border: 1.5px solid var(--ink); background: var(--yellow); }
/* The default theme has no overrides in tokens.css; pin its values so the swatch
   doesn't inherit whatever theme is currently applied to <html>. */
.m-swatch[data-theme='neon'] {
  --arena-top: #3d7be6; --arena-bot: #1a3d94;
  --surface: #2a56b8; --surface-2: #2249a3; --surface-3: #3a6bd0; --ink: #0d1838;
}

.m-frame-mini { --fr-w: 4px; border-radius: 12px; box-shadow: none; }
.m-frame-mini.m-frame--none { --fr-w: 0px; }
.m-frame-mini__in {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  background: var(--surface-3);
  font-size: 30px;
}
.m-pack {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 12px;
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, #d99bff 0%, var(--violet) 50%, #7b33c2 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
  font-size: 34px;
}
.m-titletag {
  max-width: 100%;
  margin: 2px 6px 6px;
  padding: 6px 10px 7px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--font-display); font-size: 15px; line-height: 1.1;
  box-shadow: 0 2px 0 var(--ink-soft);
}

/* =========================================================================
   PROFILE: weigh-in
   ========================================================================= */
.m-weigh { display: grid; gap: var(--s-3); }
.m-weigh .m-cardhead { margin-bottom: 0; }
.m-weigh p { margin: 0; }
.m-weigh__form { display: flex; align-items: flex-start; gap: var(--s-2); }
.m-weigh__field { position: relative; flex: 1; min-width: 0; }
.m-weigh__field .m-input { width: 100%; padding-right: 40px; }
.m-weigh__unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 800; color: #6b7aa0; pointer-events: none; }
.m-weigh__form .btn { flex: none; }
.m-okline { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: var(--good); }
.m-okline .ic { font-size: 20px; }
.m-weigh__chart {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: 120px auto; gap: 2px var(--s-2);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: rgba(13, 24, 56, 0.35);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18);
}
.m-weigh__axis { display: flex; flex-direction: column; justify-content: space-between; font: 400 12px var(--font-num); padding: 8px 0; color: var(--text-dim); }
.m-weigh__svg { width: 100%; height: 120px; overflow: visible; }
.m-weigh__grid { stroke: rgba(255, 255, 255, 0.18); stroke-width: 1.5; stroke-dasharray: 5 5; }
.m-weigh__line { fill: none; stroke: var(--yellow); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; paint-order: stroke; }
.m-weigh__dot { stroke: var(--ink); stroke-width: 10; stroke-linecap: round; }
.m-weigh__dot--last { stroke: #fff; stroke-width: 12; }
.m-weigh__dates { grid-column: 2; display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; color: var(--text-dim); }
.m-weigh__empty { padding: var(--s-3); text-align: center; font-size: 14px; font-weight: 700; color: var(--text-dim); border: 2px dashed var(--line); border-radius: var(--r-md); }

.m-input { font-size: 18px; }

/* =========================================================================
   SETTINGS
   ========================================================================= */
.m-sethead { display: flex; align-items: center; gap: var(--s-3); }
.m-back.btn { margin-bottom: 0; }
.m-sethead__title { font-size: 32px; line-height: 1; }

.m-setcard .m-cardhead { margin-bottom: var(--s-2); }
.m-setlist {
  display: grid;
  border-radius: var(--r-md);
  background: rgba(13, 24, 56, 0.3);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.m-setlist > * + * { border-top: 2px solid var(--line); }
.m-setrow { display: flex; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-2) var(--s-3); }
.m-setrow__icon {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--ic-bg, var(--surface-3));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  font-size: 26px;
}
.m-setrow__txt { flex: 1; min-width: 0; }
.m-setrow__label { display: block; font-family: var(--font-display); font-size: 17px; line-height: 1.1; text-shadow: var(--ts-outline-sm); }
.m-setrow__desc { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--text-dim); line-height: 1.3; }
.m-setrow--stepper { flex-wrap: wrap; row-gap: var(--s-2); padding-bottom: var(--s-3); }
.m-setrow--stepper .m-stepper { flex: 1 1 100%; padding-left: 52px; }

.m-stepper { flex: none; display: flex; align-items: center; gap: var(--s-2); }
.m-stepper .btn.m-stepper__btn { --btn-h: 40px; margin-bottom: 3px; font-size: 18px; }
.m-stepper__val {
  flex: 1; min-width: 64px; height: 40px; margin-bottom: 3px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 2px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.3);
  font-family: var(--font-display); font-size: 15px; line-height: 1; text-shadow: var(--ts-outline-sm);
  white-space: nowrap;
}

.m-kvs { display: grid; }
.m-kv { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-3); font-size: 15px; font-weight: 700; color: var(--text-dim); }
.m-kv + .m-kv { border-top: 2px solid var(--line); }
.m-kv b { font-family: var(--font-display); font-weight: 400; color: #fff; text-shadow: var(--ts-outline-sm); text-align: right; }

/* Economy tuning (details) */
.m-econ > summary { list-style: none; }
.m-econ > summary::-webkit-details-marker { display: none; }
.m-econ__summary { display: flex; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-2) var(--s-3); cursor: pointer; }
.m-econ__stitle { flex: 1; min-width: 0; }
.m-econ__chev { flex: none; display: inline-flex; font-size: 20px; transition: transform var(--t-med) var(--ease-out); }
.m-econ[open] .m-econ__chev { transform: rotate(90deg); }
.m-econ[open] { padding-bottom: var(--s-3); }
.m-econ__note { margin: 0 var(--s-3) var(--s-3); font-size: 14px; font-weight: 700; color: var(--text-dim); }
.m-econ__group { margin: 0 var(--s-3) var(--s-3); }
.m-econ__gtitle { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; font-family: var(--font-display); font-size: 17px; text-shadow: var(--ts-outline-sm); }
.m-econ__gtitle .ic { font-size: 22px; }
.m-econ__row { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: rgba(13, 24, 56, 0.3); }
.m-econ__row + .m-econ__row { margin-top: 4px; }
.m-econ__txt { flex: 1; min-width: 0; }
.m-econ__label { font-size: 14px; font-weight: 800; line-height: 1.25; }
.m-econ__unit { margin-left: 6px; padding: 1px 6px; border-radius: var(--r-pill); background: rgba(13, 24, 56, 0.45); font-size: 12px; color: var(--text-dim); }
.m-econ__def { font-size: 12px; font-weight: 800; color: var(--text-mute); }
.m-econ__row--changed .m-econ__def { color: var(--yellow); }
.m-econ__row--changed .m-econ__input { box-shadow: inset 0 3px 0 rgba(13, 24, 56, 0.15), inset 0 0 0 2px var(--yellow); }
.m-input.m-econ__input { width: 78px; min-height: 44px; height: 44px; padding: 0 8px; text-align: right; font-size: 16px; }
.m-econ__reset {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  border: 2px solid var(--ink);
  background: var(--slate);
  box-shadow: inset 0 -3px 0 var(--slate-edge), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  font-size: 20px;
}
.m-econ__reset--off { visibility: hidden; }
.m-econ > .btn { margin: var(--s-1) var(--s-3) 0; width: calc(100% - var(--s-3) * 2); }

.m-setpanel { display: grid; gap: var(--s-3); }
.m-setpanel .m-cardhead { margin-bottom: 0; }
.m-setpanel .btn { margin-bottom: 0; }
.m-btnrow { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); }
.m-btnrow .btn { padding-left: var(--s-4); padding-right: var(--s-4); }

.m-safety-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.m-safety-list li { display: flex; align-items: flex-start; gap: var(--s-3); font-size: 15px; font-weight: 700; line-height: 1.4; }
.m-safety-list__ic { flex: none; display: inline-flex; font-size: 26px; }

.m-danger.card {
  background: linear-gradient(180deg, #d4473f 0%, #b3322d 40%, #8f2420 100%);
  box-shadow: var(--bevel), var(--shadow-card);
  display: grid; gap: var(--s-3);
}
.m-danger .m-cardhead { margin-bottom: 0; }
.m-danger .m-body { color: #ffe1dc; }
.m-resetsheet .m-input { text-transform: uppercase; }

.m-about { display: grid; gap: var(--s-2); justify-items: center; text-align: center; padding: var(--s-4) var(--s-2) 0; }
.m-about__logo { font-size: 30px; line-height: 1; }
.m-about__more { color: var(--yellow); }
.m-about p { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-dim); line-height: 1.4; }

/* =========================================================================
   MOTION
   ========================================================================= */
@keyframes m-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Reduced motion: user setting (.m-rm on screen) or OS preference */
.m-rm *, .m-rm *::before, .m-rm *::after,
html.reduce-motion .m-screen *, html.reduce-motion .m-screen *::before, html.reduce-motion .m-screen *::after,
html.reduce-motion .m-sheet * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .m-screen *, .m-sheet * { animation: none !important; transition: none !important; }
}
