@font-face {
  font-family: "Montserrat";
  src: url("/assets/montserrat-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #06080d;
  --surface: #0c111a;
  --surface-2: #111824;
  --surface-3: #151e2c;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(216, 181, 69, 0.25);
  --text: #f4f5f8;
  --muted: #8f98a8;
  --muted-2: #657083;
  --gold: #d8b545;
  --gold-light: #f3d976;
  --blue: #70a8ff;
  --green: #61d7a1;
  --violet: #a889f7;
  --danger: #ff7a7a;
  --sidebar: 268px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 15px;
  scroll-behavior: smooth;
  touch-action: manipulation;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 8%, rgba(112, 168, 255, 0.1), transparent 28rem),
    radial-gradient(circle at 12% 90%, rgba(216, 181, 69, 0.075), transparent 34rem),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.035;
  background-image: url("/assets/primex-theme-bg.webp");
  background-position: center;
  background-size: cover;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
}

.brand-logo {
  display: block;
  width: 8.4rem;
  height: auto;
  object-fit: contain;
}

.brand-large .brand-logo {
  width: 10.2rem;
}

.brand-word {
  color: #f7f7fb;
  font-size: 1.32rem;
  font-weight: 500;
  letter-spacing: 0.19em;
  line-height: 1;
}

.brand-word span {
  color: var(--gold);
  font-weight: 800;
}

.brand em {
  padding: 0.27rem 0.42rem;
  border: 1px solid rgba(216, 181, 69, 0.38);
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.08);
  font-size: 0.48rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.brand-large .brand-word {
  font-size: 1.7rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.62rem;
  padding: 0.74rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
  color: #111;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 10px 30px rgba(216, 181, 69, 0.16);
}

.secondary-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button:hover {
  border-color: rgba(216, 181, 69, 0.3);
  background: rgba(216, 181, 69, 0.06);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
}

.text-link svg,
.invite-footer a svg,
.rank-panel a svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* Login */

.login-body {
  overflow-x: hidden;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(460px, 1.06fr) minmax(420px, 0.94fr);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 4.8vw, 4.8rem);
  border-right: 1px solid var(--line);
  isolation: isolate;
}

.login-story::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(110deg, rgba(4, 7, 12, 0.93), rgba(6, 9, 15, 0.62)),
    url("/assets/primex-theme-bg.webp") center / cover;
}

.login-story::after {
  position: absolute;
  top: 18%;
  right: -18%;
  z-index: -1;
  width: 36rem;
  height: 36rem;
  border: 1px solid rgba(216, 181, 69, 0.14);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 5rem rgba(216, 181, 69, 0.018),
    0 0 0 10rem rgba(112, 168, 255, 0.012);
}

.story-copy {
  width: min(100%, 620px);
  margin-top: auto;
  margin-bottom: 3.5rem;
}

.story-copy h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(3.2rem, 6vw, 6.5rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.93;
}

.story-copy h1 span {
  color: var(--gold-light);
}

.story-copy > p:last-child {
  max-width: 540px;
  margin: 1.7rem 0 0;
  color: #aab1bf;
  font-size: 0.94rem;
  line-height: 1.8;
}

.story-note {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.story-network {
  position: absolute;
  top: 18%;
  right: 9%;
  width: 18rem;
  height: 16rem;
  opacity: 0.7;
}

.network-core,
.network-node {
  position: absolute;
  z-index: 2;
  display: grid;
  border: 1px solid rgba(216, 181, 69, 0.35);
  border-radius: 50%;
  place-items: center;
  color: var(--gold-light);
  background: rgba(8, 12, 19, 0.94);
  box-shadow: 0 0 28px rgba(216, 181, 69, 0.08);
  font-size: 0.58rem;
  font-weight: 800;
}

.network-core {
  top: 0;
  left: calc(50% - 1.7rem);
  width: 3.4rem;
  height: 3.4rem;
}

.network-node {
  width: 2.5rem;
  height: 2.5rem;
  border-color: rgba(112, 168, 255, 0.3);
  color: #b8d2ff;
}

.node-one { top: 6.7rem; left: 2.1rem; }
.node-two { top: 6.7rem; right: 2.1rem; }
.node-three { bottom: 0; left: 0; }
.node-four { right: 0; bottom: 0; }

.story-network i {
  position: absolute;
  z-index: 1;
  width: 1px;
  height: 6.7rem;
  background: linear-gradient(var(--gold), rgba(112, 168, 255, 0.2));
  transform-origin: top;
}

.line-one { top: 2.9rem; left: 8.4rem; transform: rotate(38deg); }
.line-two { top: 2.9rem; right: 8.4rem; transform: rotate(-38deg); }
.line-three { top: 8.7rem; left: 3.3rem; transform: rotate(24deg); }
.line-four { top: 8.7rem; right: 3.3rem; transform: rotate(-24deg); }

.login-panel {
  display: grid;
  min-height: 100vh;
  padding: clamp(1.5rem, 5vw, 5rem);
  background:
    radial-gradient(circle at 90% 0, rgba(112, 168, 255, 0.07), transparent 25rem),
    #080b11;
  place-items: center;
}

.login-card {
  width: min(100%, 440px);
}

.mobile-brand {
  display: none;
}

.team-install-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(216, 181, 69, 0.32);
  border-radius: 999px;
  cursor: pointer;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.06);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.team-install-button[hidden] {
  display: none;
}

.team-install-button:hover {
  border-color: rgba(216, 181, 69, 0.58);
  background: rgba(216, 181, 69, 0.11);
  transform: translateY(-1px);
}

.team-install-button svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.team-install-help {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 1.2rem;
  background: rgba(2, 4, 8, 0.82);
  backdrop-filter: blur(10px);
  place-items: center;
}

.team-install-help[hidden] {
  display: none;
}

.team-install-help > div {
  position: relative;
  width: min(100%, 390px);
  padding: 2.2rem;
  border: 1px solid rgba(216, 181, 69, 0.24);
  border-radius: 18px;
  background: #0c1018;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.team-install-close {
  position: absolute;
  top: 0.65rem;
  right: 0.7rem;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 1.6rem;
}

.team-install-mark {
  display: grid;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 1.2rem;
  border: 1px solid rgba(216, 181, 69, 0.38);
  border-radius: 50%;
  place-items: center;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.07);
  font-size: 0.78rem;
  font-weight: 850;
}

.team-install-help h2 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 550;
  letter-spacing: -0.035em;
}

.team-install-help p {
  margin: 0.9rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.team-install-confirm {
  width: 100%;
  min-height: 46px;
  border: 0;
}

.login-card h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 550;
  letter-spacing: -0.055em;
}

.login-intro {
  margin: 0.8rem 0 2.25rem;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.6;
}

.form-alert {
  margin: -0.6rem 0 1.15rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(255, 122, 122, 0.2);
  border-radius: 10px;
  color: #ffb0b0;
  background: rgba(255, 122, 122, 0.06);
  font-size: 0.73rem;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 1.05rem;
}

.login-form label > span:first-child {
  display: block;
  margin: 0 0 0.48rem;
  color: #c7cbd3;
  font-size: 0.68rem;
  font-weight: 700;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  min-height: 50px;
  padding: 0 0.95rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus {
  border-color: rgba(216, 181, 69, 0.55);
  box-shadow: 0 0 0 3px rgba(216, 181, 69, 0.07);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 4.4rem !important;
}

.password-field button {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  padding: 0 0.95rem;
  border: 0;
  cursor: pointer;
  color: var(--gold-light);
  background: transparent;
  font-size: 0.66rem;
  font-weight: 750;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

.remember-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--gold);
}

.remember-row span {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 0.68rem !important;
  font-weight: 550 !important;
}

.login-button {
  width: 100%;
  min-height: 52px;
  margin-top: 0.25rem;
  border: 0;
}

.login-button svg {
  width: 1rem;
}

.login-support {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.6rem;
  color: var(--muted-2);
  font-size: 0.68rem;
}

.login-support a {
  color: var(--gold-light);
  font-weight: 700;
}

.join-shell {
  display: grid;
  min-height: 100vh;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 50% 0, rgba(216, 181, 69, 0.12), transparent 28rem),
    linear-gradient(rgba(6, 8, 13, 0.9), rgba(6, 8, 13, 0.98)),
    url("/assets/primex-theme-bg.webp") center / cover;
  place-items: center;
}

.join-card {
  width: min(100%, 560px);
  padding: clamp(1.4rem, 4vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 14, 21, 0.94);
  box-shadow: var(--shadow);
}

.join-mark {
  position: relative;
  display: grid;
  width: 5rem;
  height: 5rem;
  margin: 3.2rem 0 1.6rem;
  border: 1px solid rgba(216, 181, 69, 0.3);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.08);
  font-size: 1rem;
  font-weight: 800;
  place-items: center;
}

.join-mark i {
  position: absolute;
  right: 0.2rem;
  bottom: 0.2rem;
  width: 0.85rem;
  height: 0.85rem;
  border: 3px solid #0a0e15;
  border-radius: 50%;
  background: var(--green);
}

.join-card h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 550;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.join-intro {
  margin: 1rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.7;
}

.join-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.join-details > div {
  min-width: 0;
  padding: 0.85rem;
  border-right: 1px solid var(--line);
}

.join-details > div:last-child {
  border-right: 0;
}

.join-details small,
.join-details strong {
  display: block;
}

.join-details small {
  color: var(--muted-2);
  font-size: 0.5rem;
}

.join-details strong {
  overflow: hidden;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-continue {
  width: 100%;
  margin-top: 0.65rem;
}

.join-note {
  margin: 1rem 0 0;
  color: var(--muted-2);
  font-size: 0.53rem;
  line-height: 1.6;
  text-align: center;
}

.join-note strong {
  color: #c7ccd5;
}

.error-mark {
  color: var(--danger);
  border-color: rgba(255, 122, 122, 0.25);
  background: rgba(255, 122, 122, 0.06);
}

.error-login-link {
  display: flex;
  justify-content: center;
  margin-top: 1.1rem;
}

/* Application shell */

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--bg-1, #07090e);
  animation: splashFadeOut 0.4s ease-in 1.2s forwards;
}

.fast-splash .app-splash {
  animation: fastSplashFadeOut 0.25s ease-out forwards;
}

.fast-splash .app-splash-logo,
.fast-splash .app-splash-status {
  display: none !important;
}

.app-splash-logo {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 1.5rem;
  animation: splashPulse 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-splash-logo .brand-word {
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.app-splash-logo .brand-word span {
  color: var(--gold, #e0b944);
}

.app-splash-logo em {
  font-style: normal;
  font-weight: 700;
  color: var(--gold, #e0b944);
  background: rgba(224, 185, 68, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.8em;
  letter-spacing: 0.05em;
}

.app-splash-status {
  font-size: 0.75rem;
  color: var(--muted, #788394);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: splashStatusFade 1.1s ease-in-out forwards;
  opacity: 0;
}

@keyframes splashFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes fastSplashFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes splashPulse {
  0% { opacity: 0; transform: scale(0.95); filter: blur(4px); }
  15% { opacity: 1; transform: scale(1); filter: blur(0); }
  85% { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.03); filter: blur(2px); }
}

@keyframes splashStatusFade {
  0% { opacity: 0; transform: translateY(10px); }
  20% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-5px); }
}

.app-frame {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 1.55rem 1.05rem 1rem;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(rgba(8, 12, 18, 0.96), rgba(8, 12, 18, 0.98)),
    url("/assets/primex-theme-bg.webp") center / cover;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.65rem 1.7rem;
}

.sidebar-close {
  display: none;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
}

.side-nav > a {
  position: relative;
  display: grid;
  min-height: 62px;
  grid-template-columns: 2.15rem 1fr 1rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #7e899b;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.side-nav > a > span {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.028);
  place-items: center;
}

.side-nav > a p {
  margin: 0;
}

.side-nav > a strong,
.side-nav > a small {
  display: block;
}

.side-nav > a strong {
  color: #c8ced9;
  font-size: 0.73rem;
  font-weight: 700;
}

.side-nav > a small {
  margin-top: 0.18rem;
  color: var(--muted-2);
  font-size: 0.56rem;
  font-weight: 500;
}

.side-nav > a > i {
  opacity: 0;
}

.side-nav > a > i svg {
  width: 0.85rem;
}

.side-nav > a:hover,
.side-nav > a.active {
  border-color: rgba(216, 181, 69, 0.13);
  color: var(--gold);
  background: linear-gradient(90deg, rgba(216, 181, 69, 0.09), rgba(216, 181, 69, 0.02));
}

.side-nav > a.active::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: -1.08rem;
  width: 3px;
  border-radius: 0 4px 4px 0;
  content: "";
  background: var(--gold);
  box-shadow: 0 0 12px rgba(216, 181, 69, 0.45);
}

.side-nav > a.active > span {
  background: rgba(216, 181, 69, 0.1);
}

.side-nav > a.active strong {
  color: var(--text);
}

.side-nav > a.active > i {
  opacity: 1;
}

.sidebar-referral {
  position: relative;
  margin-top: auto;
  overflow: hidden;
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(17, 24, 34, 0.96), rgba(8, 13, 20, 0.98));
  box-shadow: 0 15px 38px rgba(0, 0, 0, 0.16);
}

.sidebar-referral-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.referral-mark {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 2.1rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--gold);
  background: rgba(234, 179, 42, 0.07);
  place-items: center;
}

.sidebar-referral-heading p {
  margin: 0 0 0.2rem;
}

.sidebar-referral-heading strong {
  display: block;
  color: var(--text);
  font-size: 0.76rem;
  line-height: 1.15;
}

.sidebar-referral-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.45;
}

.sidebar-referral-links {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.sidebar-referral-filter {
  min-width: 0;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(3, 9, 17, 0.58);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.15rem;
}

.sidebar-referral-filter button {
  min-width: 0;
  min-height: 28px;
  padding: 0.25rem 0.4rem;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.56rem;
  font-weight: 800;
  cursor: pointer;
}

.sidebar-referral-filter button.active {
  color: #07101b;
  background: var(--gold);
}

.sidebar-referral-link-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080d14;
}

.sidebar-referral-url {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #aeb8c8;
  font-size: 0.48rem;
  line-height: 1.35;
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}

.sidebar-referral-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 28px;
  padding: 0.3rem 0.45rem;
  border: 1px solid rgba(216, 180, 59, 0.35);
  border-radius: 8px;
  color: var(--gold-light);
  background: rgba(216, 180, 59, 0.07);
  font: inherit;
  font-size: 0.5rem;
  font-weight: 750;
  cursor: pointer;
}

.sidebar-referral-copy:hover {
  background: rgba(216, 180, 59, 0.14);
}

.sidebar-referral-copy svg {
  width: 0.72rem;
  height: 0.72rem;
}

.sidebar-account {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  padding: 0.75rem 0.55rem 0;
  border-top: 1px solid var(--line);
}

.avatar,
.topbar-profile > span {
  display: grid;
  border: 1px solid rgba(216, 181, 69, 0.28);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.08);
  font-size: 0.58rem;
  font-weight: 800;
  place-items: center;
}

.avatar {
  width: 2.2rem;
  height: 2.2rem;
}

.sidebar-account > span:nth-child(2) {
  overflow: hidden;
}

.sidebar-account strong,
.sidebar-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account strong {
  font-size: 0.64rem;
}

.sidebar-account small {
  margin-top: 0.18rem;
  color: var(--muted-2);
  font-size: 0.54rem;
}

.sidebar-account button {
  padding: 0.4rem;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
}

.sidebar-account form {
  display: block;
  grid-column: 1 / -1;
}

.sidebar-account .sidebar-logout-button {
  width: 100%;
  min-height: 36px;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 91, 107, 0.42);
  border-radius: 9px;
  color: #ff9ba5;
  background: rgba(255, 70, 88, 0.1);
  font-size: 0.56rem;
  font-weight: 750;
}

.sidebar-account .sidebar-logout-button:hover {
  color: #fff;
  background: rgba(255, 70, 88, 0.2);
}

.sidebar-backdrop {
  display: none;
}

.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.15rem;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 13, 0.83);
  backdrop-filter: blur(18px);
}

.topbar > div:first-of-type small,
.topbar > div:first-of-type strong {
  display: block;
}

.topbar > div:first-of-type small {
  margin-bottom: 0.2rem;
  color: var(--muted-2);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topbar > div:first-of-type strong {
  font-size: 0.85rem;
  font-weight: 700;
}

.topbar-logo {
  display: block;
  width: 6.4rem;
  height: auto;
  margin: 0;
  object-fit: contain;
}

.menu-button {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.topbar-invite {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.82rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #d7dbe3;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.65rem;
  font-weight: 700;
}

.topbar-invite svg {
  width: 0.95rem;
  color: var(--gold);
}

/* Shared shell utilities kept in CSS so the strict CSP does not need inline styles. */
.dashboard-header .header-brand .brand-x { color: #d8b43b; }
.profile-back-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.03) !important;
  color: #eef2f7 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
.binary-map-stage { padding-bottom: 2rem; }
.binary-overview-status { margin-top: 1rem; color: var(--muted); font-size: .8rem; text-align: center; }

.topbar-profile {
  position: relative;
}

.topbar-profile > span {
  width: 2.35rem;
  height: 2.35rem;
}

.topbar-profile > i {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--green);
}

.page-content {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 2.2rem clamp(1.25rem, 3vw, 3rem) 4rem;
}

.page-heading {
  margin-bottom: 1.65rem;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3.4rem);
  font-weight: 550;
  letter-spacing: -0.052em;
}

.page-heading > p:last-child,
.heading-split > div > p:last-child {
  max-width: 680px;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.65;
}

.heading-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.heading-actions {
  display: flex;
  gap: 0.65rem;
}

.heading-actions svg {
  width: 1rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 55%),
    var(--surface);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.13);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading h2,
.panel h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.overview-grid.overview-grid-single {
  grid-template-columns: 1fr;
}

.team-balance-panel {
  margin-bottom: 0.85rem;
}

.metric-card {
  position: relative;
  min-height: 155px;
  overflow: hidden;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008));
}

.metric-card::after {
  position: absolute;
  top: -3rem;
  right: -2rem;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  content: "";
  opacity: 0.12;
  background: currentColor;
  filter: blur(35px);
}

.metric-card.gold { color: var(--gold); }
.metric-card.blue { color: var(--blue); }
.metric-card.green { color: var(--green); }
.metric-card.violet { color: var(--violet); }

.metric-icon {
  position: relative;
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  margin-bottom: 1rem;
  border: 1px solid currentColor;
  border-radius: 10px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  font-size: 0.65rem;
  font-weight: 850;
  place-items: center;
}

.metric-icon.has-svg {
  width: 2.55rem;
  height: 2.55rem;
  border-color: color-mix(in srgb, currentColor 62%, transparent);
  border-radius: 12px;
  box-shadow:
    inset 0 0 16px color-mix(in srgb, currentColor 8%, transparent),
    0 8px 20px rgba(0, 0, 0, 0.2);
}

.metric-icon.has-svg svg {
  position: relative;
  z-index: 1;
  width: 1.32rem;
  height: 1.32rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-icon.has-svg::after {
  position: absolute;
  inset: 0.38rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
  filter: blur(10px);
  opacity: 0.12;
}

.metric-card p,
.metric-card strong,
.metric-card span {
  display: block;
}

.metric-card p {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 650;
}

.metric-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.28rem, 2vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card.metric-binary strong {
  display: grid;
  gap: 0.12rem;
  font-size: clamp(0.9rem, 1.45vw, 1.12rem);
  line-height: 1.25;
  white-space: normal;
}

.metric-card.metric-binary strong .binary-point-line {
  margin: 0;
  color: var(--text);
  font-size: inherit;
  line-height: inherit;
}

.metric-card span {
  margin-top: 0.42rem;
  color: var(--muted-2);
  font-size: 0.55rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.75fr);
  gap: 0.85rem;
}

.invite-panel,
.balance-panel,
.activity-panel,
.rank-panel,
.tree-panel,
.directory-panel,
.invite-builder,
.qr-panel,
.message-panel,
.profile-card,
.account-panel {
  padding: 1.35rem;
}

.live-badge,
.subtle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.36rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.52rem;
  font-weight: 700;
}

.live-badge i,
.status-chip i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px rgba(97, 215, 161, 0.55);
}

.referral-builder {
  margin-top: 1.2rem;
}

.position-switch {
  display: grid;
  width: min(100%, 260px);
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem;
  padding: 0.3rem;
  border: 1px solid rgba(216, 181, 69, 0.18);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.position-switch button {
  min-height: 36px;
  padding: 0 1rem;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted-2);
  background: transparent;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.position-switch button:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.position-switch button.active {
  color: #14120a;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 6px 18px rgba(216, 181, 69, 0.18);
  transform: translateY(-1px);
}

.referral-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.referral-link-row input {
  min-width: 0;
  min-height: 45px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: #bbc3d0;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.66rem;
}

.icon-button {
  display: inline-flex;
  min-width: 45px;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(216, 181, 69, 0.22);
  border-radius: 10px;
  cursor: pointer;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.07);
  font-size: 0.6rem;
  font-weight: 750;
}

.icon-button svg {
  width: 0.95rem;
}

.invite-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--muted-2);
  font-size: 0.56rem;
}

.invite-footer a {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.15rem;
  color: var(--gold-light);
  font-weight: 750;
}

.balance-visual {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.35rem;
}

.balance-ring {
  display: grid;
  width: 100px;
  height: 100px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 var(--left-share), var(--blue) var(--left-share) 100%);
  place-items: center;
}

.balance-ring::before {
  grid-area: 1 / 1;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  content: "";
  background: var(--surface);
}

.balance-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  text-align: center;
}

.balance-ring strong,
.balance-ring small {
  display: block;
}

.balance-ring strong {
  font-size: 1.35rem;
}

.balance-ring small {
  margin-top: 0.1rem;
  color: var(--muted-2);
  font-size: 0.5rem;
}

.leg-stats {
  display: grid;
  width: 100%;
  gap: 0.7rem;
}

.leg-stats > div {
  display: grid;
  grid-template-columns: 0.55rem 1fr auto;
  align-items: center;
  gap: 0.45rem;
}

.leg-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.leg-dot.left { background: var(--gold); }
.leg-dot.right { background: var(--blue); }
.leg-dot.direct { background: var(--violet); }

.binary-balance-stats .balance-direct-stat {
  margin-bottom: 0.1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.leg-stats p {
  margin: 0;
  color: var(--muted);
  font-size: 0.61rem;
}

.leg-stats strong {
  font-size: 0.78rem;
}

.balance-note {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.55rem;
  line-height: 1.5;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.75fr);
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.lower-grid.rank-only {
  grid-template-columns: 1fr;
}

.tree-panel .panel-heading h2 {
  white-space: nowrap;
}

.network-tree-hint {
  align-items: flex-end;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: right;
  line-height: 1.25;
}

.network-tree-hint span + span {
  min-width: 100%;
  margin-top: 0.22rem;
  padding-top: 0.22rem;
  border-top: 1px solid var(--line);
}

.lower-grid.rank-only .rank-panel {
  min-height: 0;
}

.member-list {
  margin-top: 0.6rem;
}

.member-list > a {
  display: grid;
  grid-template-columns: 2.35rem 1fr auto;
  align-items: center;
  gap: 0.72rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.member-list > a:last-child {
  border-bottom: 0;
}

.member-avatar,
.table-member > i {
  display: grid;
  border: 1px solid rgba(112, 168, 255, 0.2);
  border-radius: 9px;
  color: #bdd4ff;
  background: rgba(112, 168, 255, 0.07);
  font-size: 0.54rem;
  font-style: normal;
  font-weight: 800;
  place-items: center;
}

.member-avatar {
  width: 2.35rem;
  height: 2.35rem;
}

.member-list strong,
.member-list small {
  display: block;
}

.member-list strong {
  font-size: 0.66rem;
}

.member-list small {
  margin-top: 0.22rem;
  color: var(--muted-2);
  font-size: 0.52rem;
}

.member-list time {
  color: var(--muted-2);
  font-size: 0.52rem;
}

.rank-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 95% 8%, rgba(216, 181, 69, 0.14), transparent 12rem),
    var(--surface);
}

.rank-panel h2 {
  margin-top: 2.5rem;
  font-size: 1.45rem;
}

.rank-panel > p:not(.eyebrow) {
  margin: 0.6rem 0 1rem;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.6;
}

.rank-orbit {
  position: absolute;
  top: 1.1rem;
  right: 1.3rem;
  display: grid;
  width: 4rem;
  height: 4rem;
  border: 1px solid rgba(216, 181, 69, 0.18);
  border-radius: 50%;
  place-items: center;
}

.rank-orbit span {
  color: var(--gold);
  font-size: 0.85rem;
}

.rank-orbit i {
  position: absolute;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--blue);
}

.rank-orbit i:first-of-type { top: 0.22rem; left: 0.7rem; }
.rank-orbit i:last-of-type { right: 0.2rem; bottom: 0.8rem; background: var(--gold); }

.rank-progress > span {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.rank-progress > span i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.rank-progress small {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted-2);
  font-size: 0.5rem;
}

.rank-next-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 0.7rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.rank-next-heading small {
  color: var(--muted-2);
  font-size: 0.52rem;
  text-transform: uppercase;
}

.rank-next-heading strong {
  color: var(--gold-light);
  font-size: 0.85rem;
}

.rank-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.2rem;
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.rank-current-column {
  display: grid;
  align-content: start;
}

.rank-current-column > small {
  color: var(--muted-2);
  font-size: 0.5rem;
  text-transform: uppercase;
}

.rank-summary .rank-current-column h2 {
  margin: 0;
}

.rank-identity,
.rank-next-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.rank-identity {
  margin: 0.32rem 0 0.55rem;
}

.rank-current-column .rank-identity {
  width: max-content;
  max-width: 100%;
  align-items: center;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.rank-home-identity {
  display: flex;
  width: max-content;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  margin: 0.7rem 0 0.55rem;
  text-align: center;
}

.rank-panel .rank-home-identity h2 {
  margin: 0;
}

.rank-next-identity {
  width: max-content;
  max-width: 100%;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.25rem;
  text-align: center;
}

.rank-next-identity .rank-badge {
  order: -1;
}

.rank-badge {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  overflow: hidden;
  border: 1px solid rgba(216, 181, 69, 0.24);
  border-radius: 50%;
  background: rgba(5, 13, 24, 0.72);
  color: var(--gold);
  place-items: center;
}

.rank-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rank-badge-unrank {
  width: 4.25rem;
  height: 4.25rem;
  flex-basis: 4.25rem;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.rank-badge-small {
  width: 2.35rem;
  height: 2.35rem;
  flex-basis: 2.35rem;
}

.rank-summary .rank-current-column p {
  margin: 0;
  color: var(--muted);
  font-size: 0.52rem;
  line-height: 1.55;
}

.rank-next-column {
  padding-left: 1.2rem;
  border-left: 1px solid var(--line);
}

.rank-summary .rank-next-heading {
  margin: 0 0 0.6rem;
  padding: 0;
  border: 0;
}

.rank-summary .rank-qualification {
  margin: 0;
  padding: 0;
}

.rank-requirements {
  display: grid;
  gap: 0.7rem;
}

.rank-qualification {
  display: grid;
  gap: 0.38rem;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0 0.1rem;
}

.rank-qualification > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.rank-qualification strong,
.rank-qualification span,
.rank-qualification small {
  font-size: 0.52rem;
}

.rank-qualification span,
.rank-qualification small {
  color: var(--muted-2);
}

.rank-qualification > b {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.rank-qualification > b i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.rank-qualification.complete > b i {
  background: linear-gradient(90deg, #22b982, var(--green));
  box-shadow: 0 0 12px rgba(62, 211, 164, 0.28);
}

.rank-qualification.complete strong {
  color: var(--green);
}

.rank-qualification > small {
  text-align: right;
}

.rank-meter {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.07);
}

.rank-meter::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.rank-meter::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.rank-meter::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.complete .rank-meter::-webkit-progress-value {
  background: linear-gradient(90deg, #22b982, var(--green));
  box-shadow: 0 0 12px rgba(62, 211, 164, 0.28);
}

.complete .rank-meter::-moz-progress-bar {
  background: linear-gradient(90deg, #22b982, var(--green));
}

.rank-requirement > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.18rem;
}

.rank-requirement {
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.rank-requirement strong,
.rank-requirement span,
.rank-requirement small {
  font-size: 0.52rem;
}

.rank-requirement span,
.rank-requirement small {
  color: var(--muted-2);
}

.rank-requirement > b {
  display: block;
  height: 5px;
  margin-top: 0.3rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.rank-requirement > b i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.rank-requirement.complete > b i,
.rank-target.complete > b i {
  background: linear-gradient(90deg, #22b982, var(--green));
  box-shadow: 0 0 12px rgba(62, 211, 164, 0.28);
}

.rank-requirement.complete strong,
.rank-target.complete strong {
  color: var(--green);
}

.rank-check {
  display: inline-grid;
  width: 0.9rem;
  height: 0.9rem;
  margin-left: 0.32rem;
  border-radius: 50%;
  background: rgba(62, 211, 164, 0.14);
  color: var(--green);
  font-size: 0.58rem;
  line-height: 1;
  vertical-align: middle;
  place-items: center;
}

.rank-check svg {
  width: 0.62rem;
  height: 0.62rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rank-requirement small {
  display: block;
  margin-top: 0.25rem;
  text-align: right;
}

.rank-cap-rule {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(216, 181, 69, 0.16);
  border-radius: 9px;
  background: rgba(216, 181, 69, 0.04);
  font-size: 0.5rem;
}

.rank-cap-rule span {
  color: var(--muted-2);
  text-align: right;
}

.rank-targets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.55rem;
}

.rank-target-contributors {
  grid-column: 1 / -1;
}

.rank-target {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.rank-target strong {
  font-size: 0.52rem;
}

.rank-volume-title {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.32rem;
  line-height: 1.35;
}

.rank-target .rank-volume-title,
.rank-target.complete .rank-volume-title {
  color: #f7f8fb !important;
}

.rank-volume-title > span:last-child {
  min-width: 0;
}

.rank-check.rank-check-leading {
  display: inline-flex;
  flex: 0 0 0.9rem;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin-left: 0;
  padding: 0;
  line-height: 0;
  color: var(--green) !important;
}

.rank-check.rank-check-leading svg {
  display: block;
  flex: 0 0 auto;
  width: 0.56rem;
  height: 0.56rem;
  margin: 0;
  stroke: currentColor !important;
}

.rank-target .rank-full-name {
  margin-top: -0.08rem;
  color: var(--muted);
  font-size: 0.46rem;
  line-height: 1.35;
}

.rank-target span,
.rank-target small,
.rank-note {
  color: var(--muted-2);
  font-size: 0.5rem;
}

/* Keep completed APV/ABV headings legible: the generic span rule above must
   not mute the title text or its leading completion mark. */
.rank-target .rank-volume-title > span:last-child,
.rank-target.complete .rank-volume-title > span:last-child {
  color: #fff !important;
}

.rank-target .rank-volume-title > .rank-check.rank-check-leading {
  color: var(--muted-2) !important;
  border: 1px solid rgba(145, 155, 172, 0.28);
  background: rgba(145, 155, 172, 0.12);
  box-shadow: none;
}

.rank-target .rank-volume-title > .rank-check.rank-check-leading svg {
  stroke: var(--muted-2) !important;
}

.rank-target.complete .rank-volume-title > .rank-check.rank-check-leading {
  color: #39f0a4 !important;
  border-color: rgba(57, 240, 164, 0.7);
  background: rgba(57, 240, 164, 0.22);
  box-shadow: 0 0 0 2px rgba(57, 240, 164, 0.08), 0 0 12px rgba(57, 240, 164, 0.4);
}

.rank-target.complete .rank-volume-title > .rank-check.rank-check-leading svg {
  stroke: #39f0a4 !important;
  stroke-width: 3.4;
}

.rank-target > b {
  display: block;
  height: 6px;
  margin-top: 0.2rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.rank-target > b i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.rank-target small {
  line-height: 1.45;
}

.rank-target .rank-volume-note {
  align-self: end;
  min-height: 1.45em;
}

.rank-target:not(.rank-target-contributors) {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.rank-target:not(.rank-target-contributors) > span {
  min-width: 0;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.rank-target:not(.rank-target-contributors) > .rank-meter,
.rank-target:not(.rank-target-contributors) > .rank-volume-note,
.rank-target:not(.rank-target-contributors) > .rank-abv-contributors {
  grid-column: 1 / -1;
}

.rank-target-contributors .rank-volume-note {
  text-align: right;
}

.rank-target-contributors > span {
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.rank-abv-contributors {
  margin-top: 0.18rem;
  padding-top: 0.42rem;
  border-top: 1px solid var(--line);
}

.rank-abv-contributors summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 1.65rem;
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.rank-abv-contributors summary::-webkit-details-marker {
  display: none;
}

.rank-abv-contributors summary > span:first-child {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.rank-abv-contributors summary > span:first-child > strong {
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 600;
}

.rank-abv-contributors summary > span:first-child > small {
  color: var(--muted-2);
  font-size: 0.45rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
}

.rank-abv-collapse-icon {
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1;
  transition: transform 160ms ease;
  place-items: center;
}

.rank-abv-contributors[open] .rank-abv-collapse-icon {
  transform: rotate(90deg);
}

.rank-abv-contributors small {
  color: var(--muted);
  font-size: 0.45rem;
}

.rank-abv-member-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem;
  padding-top: 0.4rem;
  max-height: min(28rem, 60vh);
  overflow-y: auto;
}

.rank-abv-member {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
  padding: 0.58rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.rank-abv-member > b {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  align-self: center;
  border: 1px solid rgba(216, 181, 69, 0.3);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.07);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  place-items: center;
}

.rank-abv-member > span {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.rank-abv-member strong,
.rank-abv-member small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-abv-member strong {
  color: var(--text);
  font-size: 0.56rem;
  font-weight: 600;
}

.rank-abv-member small {
  color: var(--muted-2);
  font-size: 0.5rem;
}

.rank-abv-member.active {
  border-color: rgba(62, 211, 164, 0.24);
  background: rgba(62, 211, 164, 0.04);
}

.rank-abv-member.active > span > strong {
  color: var(--text);
}

.rank-abv-member.inactive {
  border-color: rgba(255, 91, 107, 0.24);
  background: rgba(255, 91, 107, 0.04);
}

.rank-abv-member.inactive > span > strong {
  color: var(--text);
}

.rank-abv-member.inactive > span > small:not(.rank-contributor-state):not(.rank-contributor-bv) {
  color: var(--muted-2);
}

.rank-abv-member .rank-contributor-state {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  overflow: visible;
  max-width: 100%;
  font-size: 0.48rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.rank-contributor-state i {
  width: 0.3rem;
  height: 0.3rem;
  flex: 0 0 0.3rem;
  align-self: center;
  display: block;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 16%, transparent);
}

.rank-abv-member .rank-contributor-bv {
  color: var(--text);
  font-size: 0.52rem;
  font-weight: 500;
}

.rank-member-name-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
}

.rank-member-name-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-member-name-row .rank-contributor-bv {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}


.rank-abv-empty {
  margin: 0;
  padding: 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.52rem;
  text-align: center;
}

.rank-member-bv-meter {
  width: 100%;
  height: 5px;
  margin: 0.12rem 0 0.06rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
}

.rank-member-bv-meter::-webkit-progress-bar {
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.08);
}

.rank-member-bv-meter::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.rank-member-bv-meter::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.rank-abv-member.active .rank-contributor-state {
  color: var(--green);
}

.rank-abv-member.inactive .rank-contributor-state {
  color: var(--danger);
}

/* Rewards rank progression: compact current to next presentation. */
.rewards-rank-hero .rank-transition {
  grid-template-columns: minmax(0, 1fr) clamp(2.1rem, 8vw, 4rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.35rem, 2vw, 1rem);
  margin-top: 1.35rem;
}

.rewards-rank-hero .rank-transition-card {
  display: grid;
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: center;
  justify-items: center;
}

.rewards-rank-hero .rank-transition-card > small {
  color: var(--muted-2);
  font-size: 0.5rem;
  text-transform: uppercase;
}

.rewards-rank-hero .rank-transition .rank-identity,
.rewards-rank-hero .rank-transition .rank-next-identity {
  display: flex;
  width: 100%;
  margin: 0.45rem 0 0;
  align-items: center;
  flex-direction: column;
  gap: 0.3rem;
  text-align: center;
  justify-content: center;
}

.rewards-rank-hero .rank-transition .rank-badge {
  width: clamp(3.8rem, 14vw, 5.25rem);
  height: clamp(3.8rem, 14vw, 5.25rem);
  flex-basis: auto;
}

.rewards-rank-hero .rank-transition .rank-badge-unrank {
  width: clamp(4.4rem, 16vw, 6rem);
  height: clamp(4.4rem, 16vw, 6rem);
}

.rewards-rank-hero .rank-transition .rank-current-column h2,
.rewards-rank-hero .rank-transition .rank-next-identity strong {
  margin: 0;
  color: var(--gold-light);
  font-size: clamp(0.75rem, 3.2vw, 1.05rem);
  line-height: 1.15;
}

.rewards-rank-hero .rank-transition-arrow {
  display: grid;
  width: 100%;
  color: var(--gold);
  font-size: clamp(2rem, 8vw, 3.8rem);
  font-weight: 800;
  line-height: 1;
  place-items: center;
}

@media (max-width: 480px) {
  .rewards-rank-hero .rank-transition {
    grid-template-columns: minmax(0, 1fr) clamp(1.8rem, 10vw, 2.5rem) minmax(0, 1fr);
    gap: 0.25rem;
    margin-top: 1rem;
  }

  .rewards-rank-hero .rank-transition .rank-badge {
    width: clamp(3.25rem, 19vw, 4.5rem);
    height: clamp(3.25rem, 19vw, 4.5rem);
  }

  .rewards-rank-hero .rank-transition .rank-badge-unrank {
    width: clamp(3.8rem, 22vw, 5rem);
    height: clamp(3.8rem, 22vw, 5rem);
  }

  .rewards-rank-hero .rank-transition-arrow {
    font-size: clamp(1.75rem, 10vw, 2.5rem);
  }
}

.rank-package-requirements {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.rank-package {
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.5rem;
  overflow: hidden;
}

.rank-package summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  list-style: none;
}

.rank-package summary::-webkit-details-marker {
  display: none;
}

.rank-package summary strong::after {
  content: " +";
  color: var(--muted-2);
}

.rank-package[open] summary strong::after {
  content: " −";
}

.rank-package summary span {
  color: #ff8e98;
  font-weight: 750;
}

.rank-package summary .rank-package-benefit,
.rank-package.active summary .rank-package-benefit {
  color: var(--muted-2);
  max-width: 58%;
  font-size: 0.48rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: right;
}

.rank-package p {
  margin: 0;
  padding: 0 0.7rem 0.7rem;
  color: var(--muted-2);
  font-size: 0.48rem;
  line-height: 1.55;
}

.rank-package p small strong {
  color: var(--green);
}

.rank-package p small {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  line-height: 1.55;
}

.rank-package.active {
  border-color: rgba(62, 211, 164, 0.25);
  background: rgba(62, 211, 164, 0.04);
}

.rank-package.active summary span {
  color: var(--green);
}

.rank-rewards {
  margin-top: 0.55rem;
  overflow: hidden;
  border: 1px solid rgba(216, 181, 69, 0.2);
  border-radius: 9px;
  background: rgba(216, 181, 69, 0.035);
}

.rank-rewards summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.65rem;
  padding: 0.58rem 0.7rem;
  cursor: pointer;
  list-style: none;
}

.rank-rewards summary::-webkit-details-marker {
  display: none;
}

.rank-rewards summary strong {
  color: var(--gold-light);
  font-size: 0.54rem;
}

.rank-rewards-summary-copy {
  display: grid;
  min-width: 0;
  gap: 0.14rem;
}

.rank-rewards-summary-copy small {
  color: var(--muted-2);
  font-size: 0.45rem;
  font-weight: 500;
  line-height: 1.35;
}

.rank-rewards-collapse-icon {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  border: 1px solid rgba(216, 181, 69, 0.22);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 0.88rem;
  line-height: 1;
  transition: transform 160ms ease;
  place-items: center;
}

.rank-rewards[open] .rank-rewards-collapse-icon {
  transform: rotate(90deg);
}

.rank-reward-slider {
  padding: 0 0.7rem 0.7rem;
}

.rank-reward-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.rank-reward-track::-webkit-scrollbar { display: none; }

.rank-reward-slide {
  margin: 0;
  overflow: hidden;
  background: #020c1d;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.rank-reward-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.rank-reward-controls {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.rank-reward-controls > button,
.rank-reward-dots button {
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  touch-action: manipulation;
}

.rank-reward-controls > button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.rank-reward-controls > button:disabled { cursor: default; opacity: 0.35; }

.rank-reward-dots {
  display: flex;
  min-width: 0;
  justify-content: center;
  gap: 0.25rem;
}

.rank-reward-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
}

.rank-reward-dots button.active {
  border-color: var(--gold);
  background: var(--gold);
}

.rank-reward-controls > span {
  color: var(--muted-2);
  font-size: 0.46rem;
  white-space: nowrap;
}

.rank-note {
  margin: 0.65rem 0 0;
  line-height: 1.55;
}

.rank-panel > a {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 1.05rem;
  color: var(--gold-light);
  font-size: 0.6rem;
  font-weight: 750;
}

@media (max-width: 520px) {
  .rank-targets {
    grid-template-columns: minmax(0, 1fr);
  }

  .rank-package-requirements {
    grid-template-columns: 1fr;
  }

  .rank-reward-slider {
    padding-inline: 0.5rem;
  }
}

/* Team */

.team-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.team-summary-strip > div {
  padding: 1.05rem 1.2rem;
  border-right: 1px solid var(--line);
}

.team-summary-strip > div:last-child {
  border-right: 0;
}

.team-summary-strip small,
.team-summary-strip strong {
  display: block;
}

.team-summary-strip small {
  color: var(--muted-2);
  font-size: 0.53rem;
}

.team-summary-strip strong {
  margin-top: 0.35rem;
  font-size: 1.25rem;
  font-weight: 650;
}

.tree-panel {
  margin-bottom: 0.85rem;
}

.network-view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  margin-top: 1rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.network-view-tabs button {
  min-height: 36px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 0.56rem;
  font-weight: 750;
  touch-action: manipulation;
}

.network-view-tabs button.active {
  color: #17130a;
  background: var(--gold);
}

.network-view-panel[hidden] {
  display: none;
}

.unilevel-tree {
  margin-top: 1rem;
}

.unilevel-root {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(216, 181, 69, 0.18);
  border-radius: 10px;
  background: rgba(216, 181, 69, 0.035);
  font-size: 0.54rem;
}

.unilevel-root > span { color: var(--muted-2); }
.unilevel-root > strong { color: var(--gold-light); }
.unilevel-root > button {
  margin-left: auto;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.5rem;
}

.unilevel-map {
  margin-top: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0, rgba(216, 181, 69, 0.07), transparent 24rem),
    rgba(5, 8, 13, 0.55);
}


.unilevel-map-home {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
  background: var(--panel);
  font-size: 0.5rem;
  font-weight: 700;
}

/* Shared Binary and Unilevel tree presentation. */
.tree-map {
  position: relative;
  width: 100%;
  margin-top: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0, rgba(216, 181, 69, 0.07), transparent 24rem),
    rgba(5, 8, 13, 0.55);
}

.tree-map-home {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
  background: var(--panel);
  font-size: 0.5rem;
  font-weight: 700;
}

.tree-map-home:disabled {
  cursor: default;
  opacity: 0.48;
}

.tree-search {
  position: relative;
  width: min(100%, 560px);
  margin: 1rem auto 0;
}
.unilevel-map-viewport {
  width: 100%;
  height: clamp(340px, 52vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.unilevel-map-viewport.is-pinching { touch-action: none; }

.unilevel-map-stage {
  position: relative;
  min-width: 100%;
  transform-origin: top left;
}

.unilevel-map-lines {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.unilevel-map-lines path {
  fill: none;
  stroke: rgba(216, 181, 69, 0.24);
  stroke-width: 1.25;
}

.unilevel-map-node {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 98px;
  height: 58px;
  align-content: center;
  gap: 0.12rem;
  padding: 0.4rem;
  overflow: hidden;
  border: 1px solid rgba(112, 168, 255, 0.24);
  border-radius: 11px;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(145deg, rgba(112, 168, 255, 0.08), rgba(13, 18, 27, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  text-align: center;
  justify-items: center;
  touch-action: manipulation;
}

.unilevel-map-node.root {
  cursor: default;
  border-color: rgba(216, 181, 69, 0.42);
  background: linear-gradient(145deg, rgba(216, 181, 69, 0.12), rgba(13, 18, 27, 0.97));
}

.unilevel-map-node small { color: var(--gold-light); font-size: 0.36rem; font-weight: 800; text-transform: uppercase; }
.unilevel-map-node strong,
.unilevel-map-node span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unilevel-map-node strong { font-size: 0.46rem; }
.unilevel-map-node span { color: var(--muted); font-size: 0.38rem; text-align: center; }
/* --- Binary Map Redesign --- */
.binary-map-node {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 98px;
  height: 58px;
  align-content: center;
  gap: 0.12rem;
  padding: 0.4rem;
  overflow: hidden;
  border: 1px solid rgba(112, 168, 255, 0.24);
  border-radius: 11px;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(145deg, rgba(112, 168, 255, 0.08), rgba(13, 18, 27, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  text-align: left;
  touch-action: manipulation;
}
.binary-map-node.root {
  cursor: default;
  border-color: rgba(216, 181, 69, 0.42);
  background: linear-gradient(145deg, rgba(216, 181, 69, 0.12), rgba(13, 18, 27, 0.97));
}
.binary-map-node.empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: none;
  text-align: center;
  align-content: center;
}
.binary-map-node.empty span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  display: block;
}
.binary-map-node.empty small {
  font-size: 0.4rem;
  color: rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
}
.binary-map-node small { color: var(--gold-light); font-size: 0.36rem; font-weight: 800; text-transform: uppercase; }
.binary-map-node strong,
.binary-map-node span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binary-map-node strong { font-size: 0.46rem; display: block; margin-bottom: 2px;}
.binary-map-node span { color: var(--muted); font-size: 0.38rem; }
.binary-map-node:not(.root):not(.empty):hover { border-color: rgba(216, 181, 69, 0.42); transform: translateY(-1px); }

.binary-map-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.binary-map-lines path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1.5;
}

.binary-map-viewport {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  background:
    radial-gradient(circle at 50% 0, rgba(216, 181, 69, 0.07), transparent 24rem),
    rgba(5, 8, 13, 0.55);
}
.binary-map-viewport.is-pinching {
  touch-action: none;
}

.unilevel-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(120px, 0.7fr)) auto;
  align-items: end;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.unilevel-filters label > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted-2);
  font-size: 0.48rem;
  font-weight: 700;
}

.unilevel-filters input,
.unilevel-filters select,
.unilevel-footer select {
  width: 100%;
  min-height: 38px;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #101620;
  font: inherit;
  font-size: 0.55rem;
}

.unilevel-filters input:focus,
.unilevel-filters select:focus { border-color: rgba(216, 181, 69, 0.5); }

.unilevel-date-control {
  position: relative;
  display: block;
  margin: 0;
  color: inherit;
  font: inherit;
}

.unilevel-date-placeholder {
  display: none;
}

.unilevel-filters .unilevel-search {
  margin: 0;
  padding: 0;
  border-top: 0;
}

.unilevel-filters .unilevel-search input {
  min-height: 0;
  padding: 0;
}

.unilevel-filter-actions {
  display: flex;
  gap: 0.4rem;
}

.unilevel-filter-actions button {
  min-height: 38px;
  padding: 0 0.7rem;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 0.52rem;
}

.unilevel-filter-actions > button:last-child {
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--muted);
  background: transparent;
}

.unilevel-status {
  display: grid;
  min-height: 130px;
  color: var(--muted-2);
  font-size: 0.58rem;
  text-align: center;
  place-items: center;
}

.unilevel-status[hidden] { display: none; }

.unilevel-table-wrap {
  margin-top: 0.75rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.unilevel-table-wrap[hidden] { display: none; }
.unilevel-table { min-width: 760px; }
.unilevel-table th { position: sticky; top: 0; z-index: 1; }
.unilevel-table th button {
  padding: 0;
  border: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.unilevel-cell { color: var(--gold-light); font-weight: 750; }
.unilevel-view-tree {
  min-height: 30px;
  padding: 0 0.55rem;
  border: 1px solid rgba(216, 181, 69, 0.28);
  border-radius: 8px;
  cursor: pointer;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.05);
  font-size: 0.5rem;
}

.unilevel-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.unilevel-footer[hidden] { display: none; }
.unilevel-footer > label,
.unilevel-footer > span { color: var(--muted-2); font-size: 0.52rem; }
.unilevel-footer > label { display: flex; align-items: center; gap: 0.4rem; }
.unilevel-footer select { width: 4rem; min-height: 32px; }
.unilevel-pagination { margin: 0; padding: 0; border: 0; }

.tree-view {
  position: relative;
  max-width: 100%;
  margin: 1rem auto 0;
}

.binary-drilldown {
  max-width: 820px;
  margin: 0 auto;
}

.binary-browser-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.binary-browser-nav button {
  min-height: 34px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.52rem;
  font-weight: 700;
}

.binary-browser-nav button:disabled {
  cursor: default;
  opacity: 0.35;
}

.binary-browser-nav > span {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 0.52rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binary-browser-focus {
  display: grid;
  place-items: center;
}

.binary-identity-card {
  display: grid;
  width: min(100%, 240px);
  min-height: 138px;
  padding: 0.9rem;
  border: 1px solid rgba(216, 181, 69, 0.3);
  border-radius: 14px;
  background: rgba(216, 181, 69, 0.045);
  text-align: center;
  place-items: center;
}

.binary-identity-card > span,
.binary-leg-card > span {
  display: grid;
  border: 1px solid rgba(216, 181, 69, 0.28);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.07);
  font-weight: 800;
  place-items: center;
}

.binary-identity-card > span {
  width: 2.8rem;
  height: 2.8rem;
  font-size: 0.62rem;
}

.binary-identity-card strong {
  margin-top: 0.4rem;
  font-size: 0.75rem;
}

.binary-identity-card small {
  color: var(--muted);
  font-size: 0.56rem;
}

.binary-identity-card b {
  color: var(--muted-2);
  font-size: 0.48rem;
  font-weight: 600;
}

.binary-browser-connector {
  position: relative;
  width: 50%;
  height: 2rem;
  margin: 0.75rem auto 0;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  border-radius: 8px 8px 0 0;
}

.binary-browser-connector::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 0.75rem;
  content: "";
  background: var(--line-strong);
}

.binary-browser-legs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.binary-leg-card {
  display: grid;
  min-height: 166px;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.018);
  text-align: center;
  place-items: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.binary-leg-card:hover {
  border-color: rgba(216, 181, 69, 0.32);
  background: rgba(216, 181, 69, 0.04);
  transform: translateY(-2px);
}

.binary-leg-card > small {
  justify-self: start;
  color: var(--muted-2);
  font-size: 0.48rem;
  font-weight: 700;
  text-transform: uppercase;
}

.binary-leg-card > span {
  width: 2.45rem;
  height: 2.45rem;
  font-size: 0.55rem;
}

.binary-leg-card strong {
  font-size: 0.68rem;
}

.binary-leg-card em {
  color: var(--muted);
  font-size: 0.52rem;
  font-style: normal;
}

.binary-leg-card b {
  color: var(--gold-light);
  font-size: 0.48rem;
  font-weight: 650;
}

.binary-leg-card.right > span {
  border-color: rgba(112, 168, 255, 0.3);
  color: #b9cee9;
  background: rgba(112, 168, 255, 0.07);
}

.binary-leg-card.empty {
  cursor: default;
  border-style: dashed;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.008);
}

.binary-leg-card.empty:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.008);
  transform: none;
}

.binary-browser-search {
  position: relative;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.binary-browser-search > label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.binary-browser-search svg {
  width: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 1.8;
}

.binary-browser-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.7rem;
}

.binary-browser-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  z-index: 25;
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0c1018;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.binary-browser-results[hidden] {
  display: none;
}

.binary-browser-results button {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 0.15rem;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.binary-browser-results button:hover {
  background: rgba(216, 181, 69, 0.07);
}

.binary-browser-results strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binary-browser-results small {
  color: var(--muted);
  font-size: 0.5rem;
}

.binary-browser-results span,
.binary-browser-results > p {
  color: var(--muted-2);
  font-size: 0.48rem;
}
.rank-panel-heading { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.rank-panel-heading > .eyebrow { margin: 0; }
.rank-panel-heading > a { min-height: 32px; padding: .38rem .62rem; border: 1px solid rgba(216,181,69,.42); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; color: var(--gold-light); background: rgba(216,181,69,.06); font-size: .54rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.rank-panel-heading > a svg { width: .7rem; height: .7rem; }
.rank-panel #team-rank-requirements { scroll-margin-top: 7rem; }
.rank-detail-page { width: min(100%, 980px); min-width: 0; margin: 0 auto; display: grid; gap: 1rem; }
.rank-detail-page-heading { padding-inline: .15rem; }
.rank-detail-page-heading > a { width: fit-content; margin-bottom: 1rem; display: inline-flex; align-items: center; gap: .28rem; color: var(--muted); font-size: .62rem; font-weight: 750; text-decoration: none; }
.rank-detail-page-heading > a svg { width: .75rem; height: .75rem; transform: rotate(180deg); }
.rank-detail-page-heading h1 { margin: .2rem 0 .4rem; font-size: clamp(1.65rem,7vw,2.3rem); }
.rank-detail-page-heading > p:last-child { max-width: 40rem; margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.rank-detail-directory { min-width: 0; max-width: 100%; padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: rgba(7,18,34,.82); }
.rank-detail-directory > div:first-child h2 { margin: .15rem 0 .25rem; font-size: 1.15rem; }
.rank-detail-filter { width: 100%; max-width: 100%; margin: .85rem -.15rem 0; padding: .2rem .15rem .35rem; display: flex; gap: .5rem; overflow-x: auto; overflow-y: hidden; scroll-snap-type: none; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-overflow-scrolling: touch; }
.rank-detail-filter::-webkit-scrollbar { display: none; }
.rank-detail-filter article { position: relative; width: 78px; min-height: 124px; margin: 0; padding: .65rem .4rem .55rem; border: 1px solid rgba(255,255,255,.06); border-radius: .85rem; flex: 0 0 78px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); background: linear-gradient(160deg,rgba(19,23,36,.96),rgba(13,17,28,.96)); scroll-snap-align: none; touch-action: pan-x; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.rank-detail-filter article img { width: 42px; height: 42px; margin-bottom: .35rem; object-fit: contain; }
.rank-detail-filter article small { width: 100%; color: var(--gold); font-size: .42rem; font-weight: 850; line-height: 1.25; text-align: center; text-transform: uppercase; overflow-wrap: anywhere; }
.rank-detail-filter article em { position: absolute; bottom: .5rem; padding: .16rem .4rem; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: var(--text); background: rgba(255,255,255,.08); font-size: .42rem; font-style: normal; font-weight: 850; }
.rank-detail-filter article.active { border-color: rgba(238,242,248,.72); background: linear-gradient(160deg,rgba(37,42,53,.98),rgba(18,22,32,.98)); box-shadow: 0 0 0 1px rgba(255,255,255,.08),0 0 22px rgba(218,225,235,.16); transform: translateY(-2px); }
.rank-detail-filter article.active img { filter: drop-shadow(0 0 8px rgba(238,242,248,.35)); }
.rank-detail-table-wrap { min-width: 0; max-width: 100%; margin-top: 1rem; overflow-x: auto; border: 1px solid rgba(70,105,175,.55); border-radius: .75rem; background: rgba(9,14,25,.94); overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.rank-detail-table { width: 100%; min-width: 620px; border-collapse: separate; border-spacing: 0 .4rem; table-layout: fixed; }
.rank-detail-table th:first-child { width: 28%; }
.rank-detail-table th:nth-child(2) { width: 18%; }
.rank-detail-table th:nth-child(3), .rank-detail-table th:nth-child(4) { width: 18%; }
.rank-detail-table th:nth-child(5) { width: 18%; }
.rank-detail-table th { height: 46px; padding: .65rem .75rem; border-right: 1px solid rgba(128,147,181,.28); color: #83a9f2; background: rgba(25,52,110,.65); font-size: .48rem; letter-spacing: .12em; text-align: center; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.rank-detail-table td { height: 74px; padding: .65rem .75rem; border-top: 1px solid rgba(128,147,181,.28); border-bottom: 1px solid rgba(128,147,181,.28); border-right: 1px solid rgba(128,147,181,.24); color: var(--text); background: rgba(12,21,36,.92); font-size: .62rem; text-align: center; vertical-align: middle; white-space: nowrap; }
.rank-detail-table td:first-child { border-left: 1px solid rgba(128,147,181,.24); border-radius: .55rem 0 0 .55rem; }
.rank-detail-table tbody td:first-child { text-align: left; }
.rank-detail-table td:last-child { border-radius: 0 .55rem .55rem 0; }
.rank-detail-table tr.selected td { background: rgba(255,255,255,.045); }
.rank-detail-table tr.selected td:first-child { box-shadow: inset 2px 0 #e9edf5; }
.rank-table-name { display: flex; align-items: center; justify-content: flex-start; gap: .55rem; text-align: left; }
.rank-table-name img { width: 42px; height: 42px; object-fit: contain; }
.rank-table-name span { display: grid; justify-items: start; gap: .08rem; }
.rank-table-name small { color: #62789f; font-size: .43rem; }
.rank-table-name strong { color: var(--gold-light); font-size: .64rem; }
.rank-table-name em { width: fit-content; padding: .12rem .32rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: var(--text); font-size: .38rem; font-style: normal; text-transform: uppercase; }
.rank-detail-table td > small { color: #7585a1; font-size: .4rem; }
.rank-detail-table td > b { min-width: 30px; padding: .25rem .4rem; border: 1px solid rgba(75,119,205,.42); border-radius: .4rem; display: inline-block; text-align: center; }
.rank-cap { padding: .3rem .5rem; border: 1px solid rgba(75,119,205,.3); border-radius: .4rem; color: #7fa5eb; background: rgba(33,63,116,.2); font-size: .5rem; }
.referral-page { width: min(100%, 700px); margin: 0 auto; display: grid; gap: 1rem; }
.referral-page-card { padding: 1.35rem; border: 1px solid var(--line); border-radius: 1rem; background: linear-gradient(145deg,rgba(16,22,33,.97),rgba(10,14,22,.97)); }
.referral-page-card > .eyebrow { margin: 0 0 .8rem; color: var(--gold-light); letter-spacing: .18em; }
.referral-page-card h1, .referral-page-card h2 { margin: 0; color: var(--text); font-size: 1.35rem; }
.referral-qr-frame { width: min(78vw,320px); margin: 1.35rem auto 1rem; padding: .7rem; border-radius: 1rem; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.referral-qr-frame img { width: 100%; height: auto; display: block; border-radius: .35rem; }
.referral-page-note { margin: 0 0 .8rem; color: var(--muted); font-size: .64rem; line-height: 1.5; text-align: center; }
.referral-share-button { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: .75rem; display: flex; align-items: center; justify-content: center; gap: .65rem; color: var(--text); background: rgba(255,255,255,.025); font-size: .72rem; font-weight: 800; }
.referral-share-button svg { width: 1.2rem; height: 1.2rem; }
.referral-page .position-switch { width: 100%; margin-top: .8rem; }
.referral-page .position-switch { padding: .2rem; border-color: var(--line); border-radius: 999px; background: rgba(3,9,17,.58); box-shadow: none; grid-template-columns: repeat(2,minmax(64px,1fr)); gap: .15rem; }
.referral-page .position-switch button { min-height: 30px; padding: .25rem .75rem; border-radius: 999px; font-size: .56rem; }
.referral-page .position-switch button.active { color: #07101b; background: var(--gold); box-shadow: none; transform: none; }
.team-home-dashboard .team-home-invite .team-home-placement > div { width: 100%; }
.referral-page .referral-link-row { margin-top: .8rem; grid-template-columns: minmax(0,1fr) 52px; }
.referral-page .referral-link-row input { min-width: 0; height: 48px; font-size: .62rem; text-overflow: ellipsis; }
.referral-page .icon-button { width: 52px; min-width: 52px; height: 48px; padding: 0; }
.referral-page .icon-button span { display: none; }
.referral-page .team-home-invite { padding: 1.05rem; }
.referral-page .team-home-invite { border-radius: 17px; background: linear-gradient(145deg, rgba(17,24,34,.96), rgba(8,13,20,.98)); box-shadow: 0 15px 38px rgba(0,0,0,.16); }
.referral-page .referral-builder { margin-top: 0; }
.referral-page .team-home-placement > div { width: 100%; }
.referral-page .team-home-referral-field { margin-top: .55rem; grid-template-columns: minmax(0,1fr) 54px; }
@media (max-width: 600px) {
  .referral-page { gap: .8rem; }
  .referral-page-card { padding: 1rem; border-radius: .9rem; }
  .referral-page-card h1, .referral-page-card h2 { font-size: 1.15rem; }
  .referral-qr-frame { width: min(76vw,280px); margin-top: 1rem; }
  .rank-detail-directory { padding: .72rem .5rem; }
  .rank-detail-table-wrap { overflow-x: auto; }
  .rank-table-name img { width: 29px; height: 29px; flex: 0 0 29px; }
  .rank-table-name small { font-size: .34rem; }
  .rank-table-name strong { max-width: 58px; font-size: .44rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rank-table-name em { padding: .08rem .2rem; font-size: .3rem; }
  .rank-detail-table td > b { min-width: 22px; padding: .18rem .2rem; }
  .rank-detail-table td > small { font-size: .3rem; }
  .rank-cap { max-width: 100%; padding: .2rem .18rem; font-size: .38rem; white-space: normal; overflow-wrap: anywhere; }
}
.rank-detail-levels { margin-top: .65rem; }
.rank-detail-level[hidden] { display: none; }
.rank-detail-level { min-width: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(8,15,26,.9); }
.rank-detail-level.current { border-color: rgba(216,181,69,.5); box-shadow: inset 3px 0 var(--gold); }
.rank-detail-level.reached { border-color: rgba(65,210,145,.28); }
.rank-detail-level > header { display: grid; grid-template-columns: 2.4rem minmax(0,1fr) auto; align-items: center; gap: .55rem; }
.rank-detail-level > header > span { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; }
.rank-detail-level > header img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rank-detail-level > header small { color: var(--muted); font-size: .48rem; text-transform: uppercase; }
.rank-detail-level > header h2 { margin: .08rem 0 0; font-size: .82rem; }
.rank-detail-level > header b { padding: .22rem .4rem; border: 1px solid currentColor; border-radius: 999px; color: var(--muted); font-size: .44rem; text-transform: uppercase; }
.rank-detail-level.current > header b { color: var(--gold-light); }
.rank-detail-level.reached > header b { color: var(--green); }
.rank-detail-requirements { margin-top: .7rem; padding-top: .65rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .5rem; }
.rank-detail-requirements p { min-width: 0; margin: 0; }
.rank-detail-requirements small { display: block; color: var(--muted-2); font-size: .46rem; }
.rank-detail-requirements strong { margin-top: .15rem; display: block; color: var(--text); font-size: .64rem; overflow-wrap: anywhere; }
.rank-detail-level details { margin-top: .7rem; border-top: 1px solid var(--line); }
.rank-detail-level summary { padding-top: .6rem; display: flex; justify-content: space-between; color: var(--gold-light); cursor: pointer; font-size: .54rem; font-weight: 750; list-style: none; }
.rank-detail-level summary::-webkit-details-marker { display: none; }
.rank-detail-level details > img { width: 100%; height: auto; margin-top: .6rem; border-radius: .55rem; display: block; aspect-ratio: 16/9; object-fit: cover; }
.rank-detail-empty { color: var(--muted); }
.binary-browser-results button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.binary-browser-results .binary-result-action {
  margin-top: 0.2rem;
  color: var(--gold-light);
  font-weight: 750;
}

.binary-browser-results > p {
  margin: 0;
  padding: 0.75rem;
}

.compact-tree-viewport {
  width: 100%;
  height: clamp(340px, 52vh, 560px);
  overflow: auto;
  padding: 0.25rem 0.25rem 1.25rem;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.binary-overview-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 2rem;
  margin-bottom: 0.35rem;
  color: var(--muted-2);
  font-size: 0.68rem;
}

.binary-overview-nav button {
  min-height: 32px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.06);
  font: inherit;
  cursor: pointer;
}

.compact-tree-viewport.is-pinching {
  cursor: zoom-in;
  user-select: none;
}

.compact-binary-tree {
  width: max-content;
  min-width: 100%;
  transform-origin: 0 0;
  will-change: zoom;
}

.compact-binary-tree ul {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0.9rem 0 0;
}

.compact-binary-tree > ul {
  padding-top: 0;
}

.compact-tree-branch {
  position: relative;
  min-width: 90px;
  padding: 0.9rem 0.2rem 0;
  list-style: none;
  text-align: center;
}

.compact-tree-branch::before,
.compact-tree-branch::after {
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 0.9rem;
  border-top: 1px solid var(--line-strong);
  content: "";
}

.compact-tree-branch::after {
  right: auto;
  left: 50%;
  border-left: 1px solid var(--line-strong);
}

.compact-tree-branch:only-child::before,
.compact-tree-branch:only-child::after {
  display: none;
}

.compact-tree-branch:first-child::before,
.compact-tree-branch:last-child::after {
  border: 0;
}

.compact-tree-branch:last-child::before {
  border-right: 1px solid var(--line-strong);
  border-radius: 0 8px 0 0;
}

.compact-tree-branch:first-child::after {
  border-radius: 8px 0 0;
}

.compact-tree-branch > ul::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 0.9rem;
  content: "";
  background: var(--line-strong);
}

.compact-tree-owner {
  padding-top: 0;
}

.compact-tree-node {
  position: relative;
  display: grid;
  width: 98px;
  height: 58px;
  margin: 0 auto;
  padding: 0.4rem;
  overflow: hidden;
  border: 1px solid rgba(112, 168, 255, 0.24);
  border-radius: 11px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(112, 168, 255, 0.08), rgba(13, 18, 27, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  align-content: center;
  gap: 0.12rem;
  text-align: center;
  justify-items: center;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.compact-tree-node strong,
.compact-tree-node span {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-tree-node strong {
  font-size: 0.46rem;
}

.compact-tree-node span {
  color: var(--muted);
  font-size: 0.38rem;
  text-align: center;
}

.compact-tree-node b {
  color: var(--gold-light);
  font-size: 0.36rem;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-tree-node.owner {
  border-color: rgba(216, 181, 69, 0.42);
  background: linear-gradient(145deg, rgba(216, 181, 69, 0.12), rgba(13, 18, 27, 0.97));
}

.compact-tree-node.left,
.compact-tree-empty-branch.left > .compact-tree-empty-node { border-color: rgba(70,145,255,.55); background: linear-gradient(145deg,rgba(70,145,255,.14),rgba(13,18,27,.97)); }
.compact-tree-node.left b,
.compact-tree-empty-branch.left > .compact-tree-empty-node small { color: #70a8ff; }
.compact-tree-node.right,
.compact-tree-empty-branch.right > .compact-tree-empty-node { border-color: rgba(255,92,106,.55); background: linear-gradient(145deg,rgba(255,92,106,.14),rgba(13,18,27,.97)); }
.compact-tree-node.right b,
.compact-tree-empty-branch.right > .compact-tree-empty-node small { color: #ff7a7a; }
.binary-leg-labels { margin: .4rem auto 0; padding-inline: .75rem; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; font-size: .55rem; font-weight: 850; text-transform: uppercase; }
.binary-leg-labels .left { color: #70a8ff; text-align: left; }
.binary-leg-labels .right { color: #ff7a7a; text-align: right; }
.binary-overview-controls { margin-top: .7rem; }
.binary-overview-controls .binary-leg-labels { margin: 0; }
.binary-overview-controls + .binary-map { margin-top: .45rem; }
.binary-map .binary-back-home {
  min-height: 30px;
  padding: .35rem .65rem;
  border-color: rgba(216,181,69,.42);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--gold-light);
  background: rgba(8,14,23,.92);
  box-shadow: 0 6px 18px rgba(0,0,0,.24);
  backdrop-filter: blur(10px);
}
.binary-map .binary-back-home svg { width: .72rem; height: .72rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.binary-map .binary-back-home:not(:disabled):active { transform: scale(.97); }

.compact-tree-node.search-highlight {
  z-index: 2;
  border-color: var(--gold-light);
  box-shadow: 0 0 0 4px rgba(216, 181, 69, 0.12), 0 14px 40px rgba(216, 181, 69, 0.18);
  transform: translateY(-3px);
}

.binary-overview-search {
  position: relative;
  max-width: 560px;
  margin: 1rem auto 0;
}

.binary-overview-detail {
  margin-top: 1rem;
}

.binary-detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.018);
}

.binary-detail-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
}

.binary-detail-identity > span:first-child {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgba(216, 181, 69, 0.34);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  place-items: center;
}

.binary-detail-identity div {
  display: grid;
  min-width: 0;
}

.binary-detail-identity small,
.binary-detail-identity div > span,
.binary-detail-identity p {
  color: var(--muted-2);
  font-size: 0.62rem;
}

.binary-detail-identity strong {
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.binary-detail-identity p {
  margin: 0;
  text-align: right;
}

.binary-detail-relations {
  gap: 0.18rem;
  justify-items: end;
}

.binary-detail-identity .binary-detail-sponsor {
  color: var(--gold-light);
}

.binary-detail-legs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.binary-detail-leg {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.85rem 1rem;
}

.binary-detail-leg + .binary-detail-leg {
  border-left: 1px solid var(--line);
}

.binary-detail-leg small,
.binary-detail-leg span {
  color: var(--muted-2);
  font-size: 0.58rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.binary-detail-leg strong {
  font-size: 0.74rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.binary-detail-leg.empty strong {
  color: var(--muted);
}

.compact-tree-empty-node {
  display: grid;
  width: 62px;
  min-height: 42px;
  margin: 0 auto;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.008);
  place-items: center;
}

.compact-tree-empty-node span {
  font-size: 0.78rem;
}

.compact-tree-empty-node small {
  margin-top: -0.55rem;
  font-size: 0.34rem;
  text-transform: uppercase;
}

.binary-inline-tools {
  display: grid;
  grid-template-columns: minmax(260px, 460px);
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.binary-inline-search {
  position: relative;
}

.binary-inline-search > label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.binary-inline-search svg {
  width: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 1.8;
}

.binary-inline-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.7rem;
}

.binary-inline-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  z-index: 20;
  width: 100%;
  max-height: 290px;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0c1018;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
}

.binary-inline-results[hidden] {
  display: none;
}

.binary-inline-results button {
  display: block;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.binary-inline-results button:hover {
  background: rgba(216, 181, 69, 0.07);
}

.binary-inline-results strong,
.binary-inline-results small {
  display: block;
}

.binary-inline-results strong {
  font-size: 0.62rem;
}

.binary-inline-results small,
.binary-inline-results > p {
  margin: 0.2rem 0 0;
  color: var(--muted-2);
  font-size: 0.5rem;
}

.binary-inline-results > p {
  padding: 0.75rem;
}

.binary-header-fullscreen {
  min-height: 38px;
  padding: 0 0.8rem;
  white-space: nowrap;
}

.binary-header-fullscreen svg {
  width: 0.85rem;
  height: 0.85rem;
}

.tree-root {
  display: grid;
  justify-content: center;
  text-align: center;
}

.tree-root > span,
.tree-member > span {
  display: grid;
  margin: 0 auto;
  border: 1px solid rgba(216, 181, 69, 0.28);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.08);
  font-size: 0.58rem;
  font-weight: 800;
  place-items: center;
}

.tree-root > span {
  width: 3.1rem;
  height: 3.1rem;
}

.tree-root strong,
.tree-root small {
  display: block;
}

.tree-root strong {
  margin-top: 0.45rem;
  font-size: 0.7rem;
}

.tree-root small {
  margin-top: 0.18rem;
  color: var(--muted-2);
  font-size: 0.48rem;
}

.tree-connector {
  position: relative;
  width: 50%;
  height: 2.5rem;
  margin: 0.6rem auto 0;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  border-radius: 8px 8px 0 0;
}

.tree-connector::before {
  position: absolute;
  bottom: 100%;
  left: calc(50% - 0.5px);
  width: 1px;
  height: 1.35rem;
  content: "";
  background: var(--line-strong);
}

.tree-legs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.2rem;
}

.tree-leg {
  min-height: 250px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: inherit;
  background: rgba(255, 255, 255, 0.014);
}

.tree-leg > p {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tree-leg > p span {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 0.48rem;
  font-weight: 600;
  text-transform: none;
}

.tree-leg > p i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
}

.tree-leg.left > p i { background: var(--gold); }
.tree-leg.right > p i { background: var(--blue); }

.tree-member,
.tree-empty {
  display: grid;
  padding: 0.75rem;
  text-align: center;
}

.tree-member > span {
  width: 2.6rem;
  height: 2.6rem;
}

.tree-member strong,
.tree-member small,
.tree-empty strong,
.tree-empty small {
  display: block;
}

.tree-member strong,
.tree-empty strong {
  margin-top: 0.45rem;
  font-size: 0.63rem;
}

.tree-member small,
.tree-empty small {
  margin-top: 0.22rem;
  color: var(--muted-2);
  font-size: 0.49rem;
}

.tree-empty > span {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: var(--muted-2);
  place-items: center;
}

.tree-preview-list {
  display: grid;
  gap: 0.42rem;
  min-height: 150px;
}

.tree-preview-member {
  display: grid;
  min-height: 48px;
  margin-left: var(--preview-indent);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.tree-preview-member > span:first-child {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid rgba(216, 181, 69, 0.25);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.06);
  font-size: 0.46rem;
  font-weight: 800;
  place-items: center;
}

.tree-preview-member strong,
.tree-preview-member small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-preview-member strong {
  font-size: 0.56rem;
}

.tree-preview-member small {
  margin-top: 0.12rem;
  color: var(--muted-2);
  font-size: 0.46rem;
}

.tree-preview-member > b {
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  color: #b9cee9;
  background: rgba(112, 168, 255, 0.08);
  font-size: 0.43rem;
  font-weight: 700;
}

.tree-leg-action {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.85rem;
  border: 1px solid rgba(216, 181, 69, 0.18);
  border-radius: 9px;
  cursor: pointer;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.04);
  font-size: 0.54rem;
  font-weight: 650;
  transition: border-color 160ms ease, background 160ms ease;
}

.tree-leg-action:hover {
  border-color: rgba(216, 181, 69, 0.38);
  background: rgba(216, 181, 69, 0.09);
}

.tree-leg-action svg {
  width: 0.8rem;
  height: 0.8rem;
}

.binary-explorer-open {
  overflow: hidden;
}

.binary-explorer {
  position: fixed;
  z-index: 1200;
  inset: 0;
  padding: clamp(0.6rem, 2vw, 1.4rem);
  background: rgba(2, 4, 8, 0.9);
  backdrop-filter: blur(12px);
}

.binary-explorer[hidden] {
  display: none;
}

.binary-explorer-shell {
  display: grid;
  width: min(100%, 1180px);
  height: 100%;
  margin: auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(216, 181, 69, 0.2);
  border-radius: 20px;
  background:
    radial-gradient(circle at 8% 0, rgba(216, 181, 69, 0.08), transparent 28rem),
    #080b11;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
}

.binary-explorer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem 1rem;
  border-bottom: 1px solid var(--line);
}

.binary-explorer-header h2 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 550;
  letter-spacing: -0.04em;
}

.binary-explorer-header h2 span {
  color: var(--gold-light);
}

.binary-explorer-header small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted-2);
  font-size: 0.62rem;
}

.binary-explorer-close {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 1.55rem;
  place-items: center;
}

.binary-explorer-tools {
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.binary-side-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.2);
}

.binary-side-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 0.64rem;
  font-weight: 750;
}

.binary-side-switch button.active {
  color: #14120a;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.binary-search {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.binary-search svg {
  width: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 1.8;
}

.binary-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.72rem;
}

.binary-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.binary-zoom-controls button,
.binary-zoom-controls span {
  display: grid;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.62rem;
  font-weight: 700;
  place-items: center;
}

.binary-zoom-controls button {
  cursor: pointer;
}

.binary-zoom-controls button:last-child {
  min-width: 64px;
  padding: 0 0.65rem;
  color: var(--gold-light);
}

.binary-tree-viewport {
  overflow: auto;
  overscroll-behavior: contain;
  cursor: grab;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.binary-tree-viewport.is-panning {
  cursor: grabbing;
  user-select: none;
}

.full-binary-tree-stage {
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  padding: 1.5rem 2rem 5rem;
  transform-origin: top center;
}

.full-binary-tree {
  width: max-content;
  min-width: 100%;
}

.full-binary-tree ul {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 2rem 0 0;
}

.full-binary-tree > ul {
  padding-top: 0;
}

.full-tree-branch {
  position: relative;
  min-width: 210px;
  padding: 2rem 0.7rem 0;
  list-style: none;
  text-align: center;
}

.full-tree-branch::before,
.full-tree-branch::after {
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 2rem;
  border-top: 1px solid var(--line-strong);
  content: "";
}

.full-tree-branch::after {
  right: auto;
  left: 50%;
  border-left: 1px solid var(--line-strong);
}

.full-tree-branch:only-child::before,
.full-tree-branch:only-child::after {
  display: none;
}

.full-tree-branch:first-child::before,
.full-tree-branch:last-child::after {
  border: 0;
}

.full-tree-branch:last-child::before {
  border-right: 1px solid var(--line-strong);
  border-radius: 0 10px 0 0;
}

.full-tree-branch:first-child::after {
  border-radius: 10px 0 0;
}

.full-tree-branch > ul::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 2rem;
  content: "";
  background: var(--line-strong);
}

.full-tree-owner {
  padding-top: 0;
}

.full-tree-node {
  position: relative;
  display: grid;
  width: 98px;
  height: 58px;
  margin: 0 auto;
  padding: 0.4rem;
  overflow: hidden;
  border: 1px solid rgba(112, 168, 255, 0.24);
  border-radius: 11px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(112, 168, 255, 0.08), rgba(13, 18, 27, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  align-content: center;
  gap: 0.12rem;
  text-align: center;
  justify-items: center;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.full-tree-node > span {
  display: block;
  width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.38rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-tree-node b {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-tree-node b {
  color: var(--gold-light);
  font-size: 0.36rem;
  font-weight: 800;
  text-transform: uppercase;
}

.full-tree-node.owner {
  border-color: rgba(216, 181, 69, 0.42);
  background: linear-gradient(145deg, rgba(216, 181, 69, 0.12), rgba(13, 18, 27, 0.97));
}

.full-tree-node.search-highlight {
  z-index: 2;
  border-color: var(--gold-light);
  box-shadow: 0 0 0 5px rgba(216, 181, 69, 0.13), 0 18px 50px rgba(216, 181, 69, 0.2);
  transform: translateY(-4px);
}

.full-tree-empty-node {
  display: grid;
  width: 130px;
  min-height: 72px;
  margin: 0 auto;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.008);
  font-size: 0.5rem;
  place-items: center;
}

.binary-tree-list {
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  padding: 1.35rem 1.5rem 3rem;
}

.binary-tree-node {
  position: relative;
  display: grid;
  width: min(560px, calc(100vw - 5rem));
  min-height: 74px;
  margin: 0 0 0.65rem var(--tree-indent);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.024);
}

.binary-node-connector {
  position: absolute;
  top: -0.7rem;
  left: -1.2rem;
  width: 1.2rem;
  height: calc(50% + 0.7rem);
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.binary-node-avatar {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgba(216, 181, 69, 0.28);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.07);
  font-size: 0.58rem;
  font-weight: 800;
  place-items: center;
}

.binary-node-copy strong,
.binary-node-copy small,
.binary-node-copy span {
  display: block;
}

.binary-node-copy strong {
  font-size: 0.72rem;
}

.binary-node-copy small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.56rem;
}

.binary-node-copy span {
  margin-top: 0.3rem;
  color: var(--muted-2);
  font-size: 0.5rem;
}

.binary-tree-node > b {
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: #b9cee9;
  background: rgba(112, 168, 255, 0.08);
  font-size: 0.5rem;
  font-weight: 700;
  white-space: nowrap;
}

.binary-tree-empty {
  display: grid;
  min-height: 240px;
  color: var(--muted-2);
  font-size: 0.7rem;
  place-items: center;
}

.directory-panel {
  overflow: hidden;
}

.table-wrap {
  margin: 1rem -1.35rem -1.35rem;
  overflow-x: auto;
}

.member-directory .table-wrap {
  margin-bottom: 0;
}

.member-pagination {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 -1.35rem -1.35rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: manipulation;
}

.member-pagination::-webkit-scrollbar {
  display: none;
}

.member-pagination[hidden] {
  display: none;
}

.unilevel-level-pagination {
  gap: 0.25rem;
  margin: 0.65rem 0 0;
  padding: 0.25rem 0;
  border: 0;
  border-radius: 0;
}

.unilevel-level-pagination button {
  min-width: 26px;
  min-height: 26px;
  padding: 0 0.4rem;
  border-radius: 7px;
  font-size: 0.5rem;
}

.member-pagination button {
  display: grid;
  flex: 0 0 auto;
  min-width: 32px;
  min-height: 32px;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  font-size: 0.58rem;
  cursor: pointer;
  place-items: center;
  touch-action: manipulation;
}

.member-pagination button.active {
  border-color: rgba(216, 181, 69, 0.55);
  color: #0a0c10;
  background: var(--gold);
  font-weight: 800;
}

.member-pagination button:disabled {
  cursor: default;
  opacity: 0.35;
}

.member-pagination > span {
  min-width: 20px;
  color: var(--muted-2);
  text-align: center;
}

.member-pagination .pagination-jump {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.pagination-jump input {
  width: 3.25rem;
  min-height: 32px;
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  font-size: 0.58rem;
  text-align: center;
}

.pagination-jump input:focus {
  border-color: rgba(216, 181, 69, 0.55);
}

.pagination-mobile-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 5.75rem;
  min-height: 36px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.62rem;
  font-weight: 700;
}

.pagination-mobile-status input {
  width: 2rem;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--gold-light);
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: inherit;
  text-align: right;
  touch-action: manipulation;
  transform: scale(0.82);
  transform-origin: right center;
}

.member-pagination button.pagination-mobile-arrow {
  min-width: 42px;
  min-height: 36px;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .member-pagination {
    justify-content: center;
    overflow-x: hidden;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 0.8rem 1.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  white-space: nowrap;
}

th {
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.018);
  font-size: 0.5rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #adb5c2;
  font-size: 0.59rem;
}

.table-member {
  display: flex;
  align-items: center;
  gap: 0.62rem;
}

.table-member > i {
  width: 2rem;
  height: 2rem;
}

.table-member strong,
.table-member small {
  display: block;
}

.table-member strong {
  color: var(--text);
  font-size: 0.61rem;
}

.table-member small {
  margin-top: 0.17rem;
  color: var(--muted-2);
  font-size: 0.49rem;
}

.level-chip {
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  color: #bfd5ff;
  background: rgba(112, 168, 255, 0.08);
  font-size: 0.5rem;
  font-weight: 700;
}

.wide-button {
  width: 100%;
}

.message-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) 1fr auto;
  align-items: center;
  gap: 1.4rem;
  margin-top: 0.85rem;
}

.message-panel blockquote {
  margin: 0;
  color: #b2bac7;
  font-size: 0.67rem;
  line-height: 1.7;
}

.icon-button.labeled {
  white-space: nowrap;
}

/* Rewards */

.rewards-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.6fr);
}

.bonus-list {
  margin-top: 0.6rem;
}

.bonus-list > div {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.bonus-list > div:last-child {
  border-bottom: 0;
}

.bonus-icon {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 800;
  place-items: center;
}

.bonus-icon.credit {
  color: var(--green);
  background: rgba(97, 215, 161, 0.08);
}

.bonus-icon.debit {
  color: #ff9a9a;
  background: rgba(255, 122, 122, 0.08);
}

.bonus-icon.member {
  color: #b9a8ff;
  background: rgba(138, 111, 255, 0.1);
}

.bonus-icon.member svg {
  width: 1rem;
  height: 1rem;
}

.bonus-list strong,
.bonus-list small {
  display: block;
}

.bonus-list strong {
  font-size: 0.61rem;
}

.bonus-list small {
  margin-top: 0.2rem;
  color: var(--muted-2);
  font-size: 0.5rem;
}

.bonus-list em {
  font-size: 0.57rem;
  font-style: normal;
  font-weight: 750;
}

.bonus-list em.credit { color: var(--green); }
.bonus-list em.debit { color: #ff9a9a; }

.bonus-list em.member-meta { color: #b9a8ff; }

.bonus-list em.activity-meta {
  display: block;
  min-width: 7rem;
  text-align: right;
}

.bonus-list em.activity-meta strong,
.bonus-list em.activity-meta small {
  display: block;
}

.bonus-list em.activity-meta strong {
  color: inherit;
  font-size: 0.57rem;
}

.wallet-history-panel {
  margin-top: .85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(3,9,17,.25);
}

.wallet-history-heading {
  margin-bottom: .75rem;
}
.wallet-history-heading .eyebrow {
  margin: 0 0 .18rem;
  color: var(--gold);
}
.wallet-history-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}
.wallet-history-heading span {
  display: block;
  margin-top: .25rem;
  color: var(--muted-2);
  font-size: .56rem;
}

.wallet-history-controls {
  display: block;
  margin-top: .8rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.wallet-history-controls label > span,
.wallet-history-filter-row > span {
  display: block;
  margin-bottom: .3rem;
  color: var(--muted-2);
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.wallet-history-search input {
  width: 100%;
  min-height: 34px;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: rgba(7,15,27,.8);
  font: inherit;
  font-size: .6rem;
}
.wallet-history-search input:focus { border-color: rgba(216,180,59,.72); }
.wallet-history-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .65rem;
}
.wallet-history-filter-row > span {
  margin: 0;
}
.wallet-history-type-tabs {
  display: flex;
  min-height: 34px;
  gap: .2rem;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(7,15,27,.8);
}
.wallet-history-type-tabs button {
  min-width: 45px;
  padding: .35rem .45rem;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .53rem;
  font-weight: 800;
  cursor: pointer;
}
.wallet-history-type-tabs button.active { color: #07101b; background: var(--gold); }
.wallet-history-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: .65rem;
  padding-top: .6rem;
  padding-bottom: .6rem;
  border-top: 1px solid rgba(255,255,255,.055);
  border-bottom: 1px solid rgba(255,255,255,.055);
}
.wallet-history-summary span {
  color: var(--muted-2);
  font-size: .53rem;
}

.wallet-history-scroll {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding: 0;
  overflow-x: auto;
}

.wallet-history-table {
  width: 100%;
  min-width: 600px;
  margin-top: .65rem;
}
.wallet-history-scroll > .wallet-history-table { margin-top: 0; }

.wallet-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, .2fr);
  align-items: center;
  gap: .7rem;
  padding: .7rem 0;
  border-bottom: 1px solid rgba(255,255,255,.055);
}
.wallet-history-row[hidden] { display: none !important; }

.wallet-history-row:not(.header):nth-child(even) {
  background: rgba(255,255,255,.025);
}

.wallet-history-row:last-child { border-bottom: 0; }
.wallet-history-row.header {
  padding-top: 0;
  color: var(--muted-2);
  font-size: .5rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wallet-history-row.header button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}
.wallet-history-row.header button:hover { color: var(--text); }
.wallet-history-row.header button i { margin-left: .18rem; color: var(--gold); font-style: normal; }
.wallet-history-row > :last-child { text-align: right; }
.wallet-history-row.header > span:last-child button { width: 100%; text-align: right; }
.wallet-history-row > span,
.wallet-history-row > strong { min-width: 0; overflow-wrap: anywhere; }
.wallet-history-type { font-size: .56rem; font-weight: 800; }
.wallet-history-type.credit { color: var(--green); }
.wallet-history-type.debit { color: #ff9a9a; }
.wallet-history-detail { color: var(--text); font-size: .6rem; line-height: 1.35; }
.wallet-history-amount { font-size: .6rem; text-align: right; white-space: nowrap; }
.wallet-history-amount.credit { color: var(--green); }
.wallet-history-amount.debit { color: #ff9a9a; }
.wallet-history-empty { margin: .7rem 0 0; color: var(--muted); font-size: .62rem; }
.wallet-history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin-top: .7rem;
}
.wallet-history-pagination button {
  min-height: 30px;
  padding: .35rem .65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(7,15,27,.8);
  font: inherit;
  font-size: .55rem;
  font-weight: 750;
  cursor: pointer;
}
.wallet-history-pagination button:disabled { opacity: .4; cursor: default; }
.wallet-history-pagination span { color: var(--muted); font-size: .55rem; }

.data-note {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 11px;
  color: var(--muted-2);
  font-size: 0.54rem;
  line-height: 1.5;
}

.data-note strong {
  flex: none;
  color: var(--gold-light);
}

/* Profile */

.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 0.85rem;
}

.profile-card {
  text-align: center;
}

.profile-avatar {
  display: grid;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1rem;
  border: 1px solid rgba(216, 181, 69, 0.3);
  border-radius: 50%;
  color: var(--gold-light);
  background:
    radial-gradient(circle at 35% 30%, rgba(216, 181, 69, 0.2), transparent 60%),
    rgba(216, 181, 69, 0.07);
  font-size: 1.2rem;
  font-weight: 800;
  place-items: center;
}

.profile-card h2 {
  font-size: 1.35rem;
}

.profile-card > p {
  margin: 0.38rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.62rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  color: var(--green);
  background: rgba(97, 215, 161, 0.08);
  font-size: 0.53rem;
  font-weight: 750;
}

.status-chip.pending {
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.08);
}

.status-chip.pending i {
  background: var(--gold);
}

.profile-card dl {
  margin: 1.3rem 0 0;
  text-align: left;
}

.profile-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.profile-card dt,
.profile-card dd {
  margin: 0;
  font-size: 0.57rem;
}

.profile-card dt {
  color: var(--muted-2);
}

.profile-card dd {
  overflow: hidden;
  color: #c5cad3;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card .profile-password-row {
  align-items: flex-start;
}

.profile-card .profile-password-row dd {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
  overflow: visible;
}

.profile-password-row dd > span {
  letter-spacing: 0.12em;
}

.profile-password-row dd > button {
  padding: 0.28rem 0.52rem;
  border: 1px solid rgba(224, 185, 68, 0.38);
  border-radius: 0.45rem;
  background: rgba(224, 185, 68, 0.08);
  color: var(--gold);
  font-size: 0.46rem;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.profile-password-row dd > button:hover,
.profile-password-row dd > button:focus-visible {
  border-color: var(--gold);
  background: rgba(224, 185, 68, 0.15);
}

body.password-modal-open { overflow: hidden; }
.profile-password-modal { position: fixed; inset: 0; z-index: 110; display: grid; padding: 1rem; place-items: center; }
.profile-password-modal[hidden] { display: none; }
.profile-password-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(8px); }
.profile-password-dialog { position: relative; z-index: 1; width: min(440px,100%); max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.4rem; border: 1px solid rgba(224,185,68,.3); border-radius: 20px; background: linear-gradient(145deg,#111824,#090d14); box-shadow: 0 30px 90px rgba(0,0,0,.62); }
.profile-password-close { position: absolute; top: .65rem; right: .7rem; width: 32px; height: 32px; border: 0; color: var(--muted); background: transparent; font-size: 1.3rem; cursor: pointer; }
.profile-password-icon { width: 48px; height: 48px; margin-bottom: 1rem; border: 1px solid rgba(224,185,68,.38); border-radius: 14px; color: var(--gold); background: rgba(224,185,68,.09); display: grid; place-items: center; }
.profile-password-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.profile-password-dialog h2 { margin: 0 0 .55rem; font-size: 1.2rem; }
.profile-password-dialog > p:not(.eyebrow) { margin: 0 0 1rem; color: var(--muted); font-size: .65rem; line-height: 1.6; }
.profile-password-dialog form { display: grid; gap: .55rem; }
.profile-password-dialog label { margin-top: .2rem; color: var(--muted); font-size: .56rem; font-weight: 700; }
.profile-password-dialog input { width: 100%; height: 48px; padding: 0 .85rem; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--text); background: #080c12; font: inherit; font-size: .7rem; }
.profile-password-dialog input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,185,68,.1); }
.profile-password-dialog form > small { color: var(--muted-2); font-size: .5rem; }
.profile-password-dialog form > button { min-height: 46px; margin-top: .35rem; border: 0; border-radius: 12px; color: #100d04; background: var(--gold); font: inherit; font-size: .65rem; font-weight: 850; cursor: pointer; }
.profile-password-dialog form > button:disabled { cursor: wait; opacity: .55; }
.profile-password-message { min-height: 18px; margin: 0; color: var(--muted); font-size: .56rem; line-height: 1.5; }
.profile-password-message[data-state="success"] { color: var(--green); }
.profile-password-message[data-state="error"] { color: var(--danger); }

.profile-stack {
  display: grid;
  gap: 0.85rem;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-actions .profile-admin-link,
.profile-actions > a.profile-admin-link {
  min-height: 60px;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(224, 185, 68, 0.35);
  border-radius: 14px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  color: #fff !important;
  background: linear-gradient(135deg, rgba(224, 185, 68, 0.12), rgba(255, 255, 255, 0.02));
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.profile-actions .profile-admin-link:hover,
.profile-actions > a.profile-admin-link:hover {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(224, 185, 68, 0.22), rgba(255, 255, 255, 0.04));
}

.profile-actions .profile-admin-link > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-actions .profile-admin-link span {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  display: block;
}

.profile-actions .profile-admin-link small {
  color: var(--muted);
  font-size: 0.58rem;
  display: block;
}

.profile-actions .profile-admin-link svg {
  width: 20px;
  height: 20px;
  color: var(--gold);
  flex-shrink: 0;
}

.profile-wallet-balance {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(75, 211, 164, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(75, 211, 164, 0.08), rgba(255, 255, 255, 0.018));
}

.profile-wallet-balance .metric-icon {
  flex: 0 0 auto;
  margin: 0;
  color: var(--green);
}

.profile-wallet-balance small,
.profile-wallet-balance strong {
  display: block;
}

.profile-wallet-balance small {
  color: var(--muted-2);
  font-size: 0.55rem;
}

.profile-wallet-balance strong {
  margin-top: 0.2rem;
  color: var(--text);
  font-size: 1.2rem;
}

.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1rem;
  border: 1px solid rgba(255, 91, 107, 0.42);
  border-radius: 10px;
  color: #ff9ba5;
  background: rgba(255, 70, 88, 0.1);
  font: inherit;
  font-size: 0.6rem;
  font-weight: 750;
  cursor: pointer;
}

.danger-button:hover {
  color: #fff;
  background: rgba(255, 70, 88, 0.2);
}

.account-panel > p {
  max-width: 700px;
  margin: 1rem 0 1.2rem;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.7;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.empty-state {
  display: grid;
  min-height: 220px;
  padding: 2rem;
  text-align: center;
  place-items: center;
  align-content: center;
}

.empty-state > span {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  color: var(--gold);
  background: rgba(216, 181, 69, 0.07);
  place-items: center;
}

.empty-state strong {
  font-size: 0.72rem;
}

.empty-state p {
  margin: 0.35rem 0 0.85rem;
  color: var(--muted-2);
  font-size: 0.56rem;
}

.empty-state a {
  display: inline-flex;
  align-items: center;
  color: var(--gold-light);
  font-size: 0.56rem;
  font-weight: 750;
}

.empty-state a svg {
  width: 0.8rem;
}

.mobile-nav {
  display: none;
}

/* Mobile-first Team home dashboard */
.team-home-dashboard { display: grid; gap: .85rem; }
.team-home-card { min-width: 0; padding: 1.05rem; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(17,24,34,.96), rgba(8,13,20,.98)); box-shadow: 0 15px 38px rgba(0,0,0,.16); }
.team-home-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.team-home-card-heading p { margin: 0 0 .2rem; color: var(--gold); font-size: .56rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.team-home-card-heading h2 { margin: 0; color: var(--text); font-size: 1.03rem; line-height: 1.15; }
.team-home-heading-title { min-width: 0; display: flex; align-items: center; gap: .65rem; }
.team-home-heading-title > span { width: 2rem; height: 2rem; flex: 0 0 2rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(234,179,42,.07); color: var(--gold); display: grid; place-items: center; }
.team-home-heading-title > span svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; }
.team-home-news { min-width: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.team-home-section-divider { width: 100%; height: 1px; background: linear-gradient(90deg,transparent,rgba(234,179,42,.7),rgba(67,130,235,.45),transparent); }
.team-home-news-stage { position: relative; margin-top: .85rem; }
.team-home-news-track { position: relative; min-height: 260px; overflow-x: auto; display: grid; grid-auto-flow: column; grid-auto-columns: 100%; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.team-home-news-track::-webkit-scrollbar { display: none; }
.team-home-news-item { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #08101b; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(220px,.85fr); scroll-snap-align: start; scroll-snap-stop: always; }
.team-home-news-image { min-height: 260px; overflow: hidden; display: block; background: #050a10; }
.team-home-news-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.team-home-news-copy { padding: .85rem; }
.team-home-news-copy > small { color: var(--gold); font-size: .49rem; font-weight: 800; letter-spacing: .06em; }
.team-home-news-copy h3 { margin: .35rem 0 0; color: var(--text); font-size: .93rem; line-height: 1.25; }
.team-home-news-copy p { margin: .45rem 0 0; color: var(--muted); display: -webkit-box; overflow: hidden; font-size: .6rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.team-home-news-copy > a { margin-top: .65rem; color: var(--gold-light); display: inline-flex; align-items: center; gap: .3rem; font-size: .55rem; font-weight: 750; text-decoration: none; }
.team-home-news-copy > a svg { width: .75rem; height: .75rem; }
.team-home-news-all { min-height: 34px; padding: 0 .75rem; border-radius: 9px; background: var(--gold); color: #07101b; display: inline-flex; align-items: center; gap: .25rem; font-size: .58rem; font-weight: 850; text-decoration: none; white-space: nowrap; }
.team-home-news-all svg { width: .75rem; height: .75rem; }
.team-home-news-arrow { position: absolute; top: 50%; z-index: 2; width: 2rem; height: 2rem; padding: 0; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: rgba(2,8,15,.82); color: var(--text); display: grid; place-items: center; transform: translateY(-50%); cursor: pointer; }
.team-home-news-arrow.previous { left: .7rem; }
.team-home-news-arrow.next { right: .7rem; }
.team-home-news-arrow.previous svg { transform: rotate(180deg); }
.team-home-news-arrow svg { width: .9rem; height: .9rem; }
.team-home-news-dots { margin-top: .55rem; display: flex; justify-content: center; gap: .32rem; }
.team-home-news-dots button { width: .4rem; height: .4rem; padding: 0; border: 0; border-radius: 999px; background: #526174; cursor: pointer; transition: width .18s ease, background .18s ease; }
.team-home-news-dots button.active { width: 1.2rem; background: var(--gold); }
.team-home-news-empty { margin-top: .8rem; padding: 1.2rem; border: 1px dashed var(--line); border-radius: 13px; text-align: center; }
.team-home-news-empty strong,.team-home-news-empty span { display: block; }
.team-home-news-empty strong { color: var(--text); font-size: .75rem; }
.team-home-news-empty span { margin-top: .25rem; color: var(--muted); font-size: .58rem; }

.team-news-heading > a,.team-news-back { margin-bottom: .8rem; color: var(--gold-light); display: inline-flex; align-items: center; gap: .35rem; font-size: .65rem; font-weight: 750; text-decoration: none; }
.team-news-heading > a svg,.team-news-back svg { width: .85rem; height: .85rem; transform: rotate(180deg); }
.team-news-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.team-news-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.team-news-card-image { aspect-ratio: 16/9; overflow: hidden; display: grid; place-items: center; background: #040910; color: var(--gold); font-weight: 800; text-decoration: none; }
.team-news-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-news-card > div { padding: 1rem; }
.team-news-card small,.team-news-detail-copy > small { color: var(--gold); font-size: .55rem; font-weight: 850; letter-spacing: .06em; }
.team-news-card h2 { margin: .4rem 0 0; font-size: 1rem; line-height: 1.28; }
.team-news-card h2 a { color: var(--text); text-decoration: none; }
.team-news-card p { margin: .55rem 0 0; color: var(--muted); display: -webkit-box; overflow: hidden; font-size: .65rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.team-news-read { margin-top: .8rem; color: var(--gold-light); display: inline-flex; align-items: center; gap: .3rem; font-size: .62rem; font-weight: 800; text-decoration: none; }
.team-news-read svg { width: .8rem; height: .8rem; }
.team-news-detail { max-width: 860px; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.team-news-back { margin: 1rem 1rem 0; }
.team-news-detail-image { aspect-ratio: 16/9; margin: .2rem 1rem 0; overflow: hidden; border-radius: 13px; background: #040910; }
.team-news-detail-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-news-detail-copy { padding: 1.2rem; }
.team-news-detail-copy h1 { margin: .5rem 0 0; color: var(--text); font-size: clamp(1.35rem,4vw,2rem); line-height: 1.2; }
.team-news-article-body { margin-top: 1rem; color: #c1ccda; }
.team-news-article-body p { margin: 0 0 .9rem; font-size: .75rem; line-height: 1.75; white-space: pre-line; }
.team-home-placement { margin-top: .8rem; display: flex; align-items: center; justify-content: flex-start; }
.team-home-placement > div { padding: .2rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(3,9,17,.58); display: grid; grid-template-columns: repeat(2, minmax(64px, 1fr)); gap: .15rem; }
.team-home-placement button { min-height: 30px; padding: .25rem .75rem; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font: inherit; font-size: .56rem; font-weight: 800; cursor: pointer; }
.team-home-placement button.active { color: #07101b; background: var(--gold); }
.team-home-referral-field { min-width: 0; margin-top: .55rem; display: grid; grid-template-columns: minmax(0, 1fr) 54px; align-items: center; gap: .45rem; }
.team-home-referral-field input { min-width: 0; height: 40px; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #080d14; font-size: .58rem; text-overflow: ellipsis; }
.team-home-referral-field > button { height: 40px; padding: 0; border: 1px solid rgba(216,180,59,.35); border-radius: 10px; color: var(--gold-light); background: rgba(216,180,59,.07); display: grid; align-content: center; justify-items: center; gap: 1px; }
.team-home-referral-field > button svg { width: .8rem; height: .8rem; }
.team-home-referral-field > button small { font-size: .44rem; font-weight: 750; }
.team-home-wallet-filters { margin-top: .9rem; padding: .22rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(3,9,17,.55); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .2rem; }
.team-home-wallet-filters button { min-width: 0; min-height: 34px; padding: .3rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .58rem; font-weight: 750; cursor: pointer; }
.team-home-wallet-filters button.active { background: var(--gold); color: #07101b; }
.team-home-program-card { position: relative; overflow: hidden; }
.team-home-program-card::before { content: ""; position: absolute; inset: 18px auto 18px 0; width: 3px; border-radius: 3px; background: var(--gold); }
.team-home-growth::before { background: #a975f4; }
.team-home-wallet-card::before { background: #42d492; }
.team-home-program-card > header { display: flex; align-items: flex-start; gap: .75rem; }
.team-home-program-icon { width: 2.55rem; height: 2.55rem; flex: 0 0 2.55rem; border: 1px solid rgba(234,179,42,.35); border-radius: 10px; color: var(--gold); display: grid; place-items: center; }
.team-home-growth .team-home-program-icon { border-color: rgba(169,117,244,.4); color: #b785ff; }
.team-home-wallet-card .team-home-program-icon { border-color: rgba(66,212,146,.4); background: rgba(66,212,146,.06); color: #42d492; }
.team-home-program-icon svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; }
.team-home-program-card header p { margin: 0 0 .2rem; color: var(--gold); font-size: .53rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.team-home-growth header p { color: #b785ff; }
.team-home-wallet-card header p { color: #42d492; }
.team-home-program-card header h2 { margin: 0; color: var(--text); font-size: 1rem; }
.team-home-program-card header div > span { margin-top: .4rem; color: #aec0d5; display: block; font-size: .64rem; line-height: 1.55; }
.team-home-program-stats { margin-top: .85rem; padding: .72rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.team-home-program-stats > div { min-width: 0; padding: 0 .7rem; border-right: 1px solid var(--line); }
.team-home-program-stats > div:first-child { padding-left: 0; }
.team-home-program-stats > div:last-child { padding-right: 0; border-right: 0; }
.team-home-program-stats small { color: var(--gold); display: block; font-size: .48rem; font-weight: 850; text-transform: uppercase; }
.team-home-growth .team-home-program-stats small { color: #b785ff; }
.team-home-wallet-program-stats small { color: #42d492; }
.team-home-wallet-program-stats > div { display: flex; flex-direction: column; }
.team-home-wallet-program-stats small { min-height: 2.4em; line-height: 1.2; }
.team-home-wallet-program-stats strong { margin-top: .35rem; font-size: clamp(.58rem,2.4vw,.78rem); white-space: nowrap; }
.team-home-wallet-program-stats em { font-size: .66em; font-weight: 800; }
.team-home-program-stats strong { margin-top: .25rem; color: var(--text); display: block; font-size: .72rem; line-height: 1.3; overflow-wrap: anywhere; }
.team-home-wallet-program-stats strong { color: var(--text); }
.team-home-program-stats em { color: inherit; font-size: .72em; font-style: normal; }
.team-home-grace { margin-top: .7rem; padding: .75rem; background: rgba(169,117,244,.08); display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.team-home-grace > div { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.team-home-grace span { color: #bd8cff; display: block; font-size: .6rem; font-weight: 800; }
.team-home-grace strong { width: fit-content; padding: .2rem .48rem; border: 1px solid rgba(169,117,244,.55); border-radius: 999px; color: #eee5ff; display: block; flex: 0 0 auto; font-size: .5rem; white-space: nowrap; }
.team-home-program-actions { margin-top: .75rem; display: grid; gap: .3rem; }
.team-home-contributor .team-home-program-actions,
.team-home-growth .team-home-program-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.team-home-program-actions a { min-height: 42px; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 9px; color: var(--text); display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: .62rem; font-weight: 800; text-align: center; text-decoration: none; }
.team-home-program-actions a.primary { border-color: rgba(234,179,42,.75); }
.team-home-growth .team-home-program-actions a.primary { border-color: rgba(169,117,244,.75); }
.team-home-wallet-card .team-home-program-actions a.primary { border-color: rgba(66,212,146,.75); }
.team-home-program-actions svg { width: .85rem; height: .85rem; }

@media (max-width: 620px) {
  .team-home-dashboard { gap: .65rem; }
  .team-home-card { padding: .9rem; border-radius: 15px; }
}

@media (max-width: 390px) {
  .team-home-news-all { min-height: 30px; padding: 0 .6rem; }
  .team-news-detail { border-radius: 14px; }
  .team-news-back { margin: .75rem .75rem 0; }
  .team-news-detail-image { margin: .15rem .75rem 0; }
  .team-news-detail-copy { padding: 1rem .8rem; }
  .team-home-referral-field { grid-template-columns: minmax(0,1fr) 48px; }
  .team-home-card-heading h2 { font-size: .95rem; }
  .team-home-card,
  .team-home-news,
  .team-home-news-stage,
  .team-home-news-track,
  .team-home-news-item { min-width: 0; max-width: 100%; }
  .team-home-program-stats > div { padding-inline: .42rem; }
  .team-home-wallet-program-stats strong { font-size: clamp(.52rem,2.7vw,.64rem); letter-spacing: -.02em; }
  .team-home-program-actions a { min-width: 0; padding-inline: .45rem; font-size: .56rem; }
  .team-home-grace { padding-inline: .62rem; }
}

@media (max-width: 700px) {
  .team-home-news-item { display: block; }
  .team-news-grid { gap: .65rem; }
  .team-news-card > div { padding: .72rem; }
  .team-news-card h2 { font-size: clamp(.72rem,3.4vw,.9rem); }
  .team-news-card p { display: none; }
  .team-home-news-track { min-height: 0; }
  .team-home-news-image { min-height: 0; aspect-ratio: 16/9; }
  .team-home-news-copy { padding: .7rem; }
  .team-home-news-copy p { display: none; }
  .team-home-news-copy h3 { font-size: clamp(.7rem,3.3vw,.86rem); }
  .team-home-news-arrow { width: 1.8rem; height: 1.8rem; }
  .team-home-news-arrow.previous { left: .45rem; }
  .team-home-news-arrow.next { right: .45rem; }
  .team-home-program-card { padding: .9rem; }
}

@media (max-width: 1120px) {
  :root { --sidebar: 238px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid,
  .lower-grid { grid-template-columns: 1fr; }
  .rank-panel { min-height: 270px; }
  .message-panel { grid-template-columns: 1fr auto; }
  .message-panel > div { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  /* iOS Safari zooms focused inputs below 16px. Keep search fields stable. */
  .binary-browser-search input,
  .tree-search input,
  .unilevel-search input,
  .wallet-history-search input {
    font-size: 16px !important;
    line-height: 1.2;
    -webkit-text-size-adjust: 100%;
  }

  /* Keep the Team workspace inside the device viewport.  The tree itself is
     intentionally wider than the card and scrolls inside its own viewport;
     the page shell must never inherit that width. */
  html,
  body.app-body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.app-body .app-frame,
  body.app-body .app-main,
  body.app-body .page-content,
  body.app-body .page-content > *,
  body.app-body .team-section-intro,
  body.app-body .team-workspace-tabs,
  body.app-body .team-workspace-panel,
  body.app-body .team-binary-panel,
  body.app-body .team-binary-panel .binary-overview,
  body.app-body .team-binary-panel .binary-overview-controls,
  body.app-body .team-binary-panel .binary-map {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.app-body .app-frame,
  body.app-body .team-binary-panel {
    overflow-x: hidden;
  }

  body.app-body .team-binary-panel .binary-map-viewport,
  body.app-body .team-binary-panel .compact-tree-viewport {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
  }

  body.app-body,
  body.app-body .app-frame,
  body.app-body .app-main,
  body.app-body .topbar,
  body.app-body .page-content {
    width: 100%;
    max-width: none;
  }

  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { padding: 2rem 1.2rem; }
  .mobile-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 4rem;
  }

  .sidebar {
    width: min(86vw, 310px);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .menu-open .sidebar { transform: translateX(0); }
  .sidebar-close {
    display: block;
    padding: 0.2rem;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 1.5rem;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    border: 0;
    visibility: hidden;
    opacity: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  .menu-open .sidebar-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .app-main { margin-left: 0; }

  .topbar {
    height: 64px;
    padding: 0 1rem;
  }

  .menu-button {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0.58rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    align-content: center;
    gap: 0.3rem;
  }

  .menu-button span {
    display: block;
    height: 1px;
    background: #d6dae2;
  }

  .topbar > div:first-of-type {
    position: absolute;
    left: 50%;
    text-align: center;
    transform: translateX(-50%);
  }

  .topbar-logo {
    width: 5.4rem;
    margin-right: auto;
    margin-left: auto;
  }

  .topbar-invite span { display: none; }
  .topbar-invite { width: 2.35rem; padding: 0; justify-content: center; }
  .page-content { padding: 1.55rem 1rem calc(8rem + env(safe-area-inset-bottom)); }
  .heading-split { align-items: flex-start; }
  .invite-layout,
  .profile-layout { grid-template-columns: 1fr; }
  .qr-panel { order: -1; }
  .qr-frame { max-width: 220px; }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    height: calc(64px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, 1fr);
    padding: 0.3rem 0.4rem env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(7, 10, 15, 0.94);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.25rem;
    color: var(--muted-2);
  }

  /* Keep the primary five-item navigation aligned with the Team submenu. */
  .mobile-nav:not(.team-section-mobile-nav) a { row-gap: 0; }
  .mobile-nav:not(.team-section-mobile-nav) a:not(.featured) span {
    width: 1.1rem;
    height: 1.1rem;
  }

  .mobile-nav a span {
    display: grid;
    width: 1.7rem;
    height: 1.7rem;
    place-items: center;
  }

  .mobile-nav a svg { width: 1.05rem; }
  .mobile-nav a small { font-size: 0.47rem; font-weight: 650; }
  .mobile-nav a.active { color: var(--gold-light); }

  .mobile-nav a.featured span {
    width: 2.35rem;
    height: 2.35rem;
    margin-top: -1.2rem;
    border: 4px solid var(--bg);
    border-radius: 50%;
    color: #17130a;
    background: var(--gold);
  }

  .mobile-nav a.featured small { margin-top: -0.25rem; }
}

@media (max-width: 620px) {
  html { font-size: 14px; }
  .login-card h2 { font-size: 2.4rem; }
  .mobile-brand { margin-bottom: 3.2rem; }
  .join-details { grid-template-columns: 1fr; }
  .join-details > div { border-right: 0; }
  .join-details > div + div { border-top: 1px solid var(--line); }
  .page-heading h1 { font-size: 2.15rem; }
  .heading-split { display: block; }
  .heading-actions,
  .heading-split > .primary-button,
  .heading-split > .secondary-button { margin-top: 1rem; }
  .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .metric-card {
    min-height: 140px;
    padding: 1rem;
  }

  .metric-card strong { font-size: 1.15rem; }
  .metric-card span { line-height: 1.35; }
  .overview-grid,
  .lower-grid { gap: 0.65rem; margin-top: 0.65rem; }

  .invite-panel,
  .balance-panel,
  .activity-panel,
  .rank-panel,
  .tree-panel,
  .directory-panel,
  .invite-builder,
  .qr-panel,
  .message-panel,
  .profile-card,
  .account-panel { padding: 1rem; }

  .position-switch {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .position-switch button { padding: 0 0.3rem; }
  .referral-link-row { grid-template-columns: minmax(0, 1fr) 45px; }
  .referral-link-row .icon-button span { display: none; }
  .invite-footer { align-items: flex-start; flex-direction: column; }

  .balance-visual { justify-content: center; }
  .team-summary-strip { grid-template-columns: 1fr 1fr; }
  .team-summary-strip > div:nth-child(2) { border-right: 0; }
  .team-summary-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tree-connector { width: 70%; }
  .tree-legs { gap: 0.65rem; }
  .tree-leg { padding: 0.7rem; }
  .network-view-tabs { display: grid; width: 100%; }
  .unilevel-filters { grid-template-columns: 1fr 1fr; }
  .unilevel-filters .unilevel-search,
  .unilevel-filter-actions { grid-column: 1 / -1; }
  .unilevel-date-placeholder {
    position: absolute;
    inset: 0 2.2rem 0 0.65rem;
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--muted-2);
    font-size: 0.52rem;
    pointer-events: none;
  }
  .unilevel-date-control.has-value .unilevel-date-placeholder { display: none; }
  .unilevel-date-control:not(.has-value) input::-webkit-datetime-edit { color: transparent; }
  .unilevel-filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .unilevel-footer { grid-template-columns: 1fr auto; }
  .unilevel-footer > span { text-align: right; }
  .unilevel-pagination { grid-column: 1 / -1; }

  .unilevel-map-viewport { height: 430px; }
  .binary-browser-nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.4rem;
  }
  .binary-browser-nav button {
    min-height: 32px;
    padding: 0 0.5rem;
    font-size: 0.47rem;
  }
  .binary-identity-card {
    width: 190px;
    min-height: 122px;
  }
  .binary-browser-legs { gap: 0.55rem; }
  .binary-leg-card {
    min-height: 148px;
    padding: 0.65rem 0.45rem;
  }
  .binary-leg-card strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .compact-tree-viewport {
    height: clamp(340px, 52vh, 560px);
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
  }
  .compact-tree-branch {
    min-width: 82px;
    padding-right: 0.2rem;
    padding-left: 0.2rem;
  }
  .compact-tree-node {
    width: 98px;
    height: 58px;
    min-height: 0;
  }
  .binary-inline-tools { grid-template-columns: 1fr; }
  .binary-header-fullscreen {
    min-height: 34px;
    padding: 0 0.65rem;
    font-size: 0.55rem;
  }
  .binary-explorer { padding: 0; }
  .binary-explorer-shell { border: 0; border-radius: 0; }
  .binary-explorer-header { padding: 1rem; }
  .binary-explorer-tools {
    grid-template-columns: 1fr;
    padding: 0.75rem 1rem;
  }
  .binary-zoom-controls { justify-content: center; }
  .binary-tree-list { padding: 1rem 1rem 3rem; }
  .binary-tree-node {
    width: calc(100vw - 2rem - min(var(--tree-indent), 7.2rem));
    margin-left: min(var(--tree-indent), 7.2rem);
  }
  .message-panel { grid-template-columns: 1fr; }
  .icon-button.labeled { width: 100%; }
  .account-actions { align-items: flex-start; flex-direction: column; }
  .data-note { flex-direction: column; }
}

.rewards-rank-hero {
  margin-bottom: 0.85rem;
}

.rewards-rank-hero .rank-panel {
  min-height: 0;
  padding: 1.4rem 1.5rem;
}

.rewards-rank-hero .rank-panel > p:not(.eyebrow) {
  max-width: 760px;
}

.rewards-rank-hero .rank-requirements {
  max-width: 920px;
}

.rewards-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rewards-history {
  margin-top: 0.85rem;
}

.rewards-history .activity-panel {
  width: 100%;
}

/* Rewards desktop layout: account for the persistent sidebar before stacking. */
@media (min-width: 861px) {
  .rewards-rank-hero,
  .rewards-rank-hero .rank-panel,
  .rewards-rank-hero .rank-requirements,
  .rewards-wallet-actions,
  .rewards-metrics,
  .rewards-history {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .rewards-rank-hero .rank-panel {
    padding: 1.6rem;
  }

  .rewards-rank-hero .rank-package p {
    font-size: 0.56rem;
  }

  .rewards-rank-hero .rank-package p small {
    font-size: 0.52rem;
  }

  .rewards-wallet-actions > *,
  .rewards-buy-links,
  .rewards-metrics .metric-card {
    min-width: 0;
  }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .rewards-rank-hero .rank-summary {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-top: 1.6rem;
  }

  .rewards-rank-hero .rank-next-column {
    padding: 0.9rem 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .rewards-rank-hero .rank-package-requirements {
    grid-template-columns: 1fr;
  }

  .rewards-wallet-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rewards-buy-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rewards-buy-links .profile-buy-pxt {
    width: 100%;
  }

  .rewards-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1181px) {
  .rewards-rank-hero .rank-summary {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }

  .rewards-rank-hero .rank-requirements {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .rewards-rank-hero .rank-panel {
    padding: 1rem;
  }

  .rank-summary {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 0.65rem;
    margin-top: 2.2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .rank-next-column {
    padding-top: 0;
    padding-left: 0.65rem;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .rank-summary .rank-current-column h2 {
    font-size: 1.15rem;
  }

  .rank-summary .rank-current-column p,
  .rank-summary .rank-qualification strong,
  .rank-summary .rank-qualification span,
  .rank-summary .rank-qualification small {
    font-size: 0.46rem;
  }

  .rewards-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .wallet-history-controls { padding: 0; }
  .wallet-history-panel { padding: .75rem; }
  .wallet-history-heading { margin-bottom: .55rem; }
  .wallet-history-scroll { margin-top: 0; overflow-x: auto; overscroll-behavior-x: contain; }

  .wallet-history-search input {
    font-size: 16px;
    touch-action: manipulation;
  }

  .wallet-history-filter-row {
    align-items: stretch;
    flex-direction: column;
    gap: .35rem;
  }

  .wallet-history-type-tabs {
    width: 100%;
  }

  .wallet-history-type-tabs button {
    flex: 1 1 0;
    min-width: 0;
  }

  .wallet-history-table {
    width: 100%;
    min-width: 0;
  }

  .wallet-history-row {
    grid-template-columns: minmax(0, 1fr) minmax(6rem, .24fr);
    gap: .35rem;
    padding: .55rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* Mobile Notifications (Imported from mobile.primexnetwork.io) */
.profile-admin-link {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 68px;
  padding: 18px 22px;
  border: 1px solid rgba(224, 185, 68, .35);
  border-radius: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  color: #fff;
  background: linear-gradient(145deg, rgba(30, 24, 8, .85), rgba(12, 10, 4, .95));
  text-decoration: none;
  transition: all .2s;
  box-sizing: border-box;
}
.profile-admin-link:hover {
  border-color: var(--gold);
  background: linear-gradient(145deg, rgba(45, 36, 12, .9), rgba(18, 15, 6, .98));
  transform: translateY(-1px);
}
.profile-admin-link span { font-size: 15px; font-weight: 800; color: #fff; display: block; }
.profile-admin-link small { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }
.profile-admin-link svg { grid-column: 2; grid-row: 1 / span 2; width: 22px; height: 22px; color: var(--gold); }

.profile-notifications { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.profile-notifications .section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.profile-notifications .section-heading p { margin: 0; color: var(--gold); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.profile-notifications .section-heading h2 { margin: 2px 0 0; font-size: 20px; font-weight: 800; color: var(--text); }
.profile-notifications .section-heading span { color: var(--muted); font-size: 11px; }

.profile-notification-intro { max-width: 680px; margin: -2px 0 15px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.profile-notification-card {
  position: relative;
  min-height: 100px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  background: linear-gradient(145deg, rgba(3, 20, 45, .94), rgba(0, 5, 15, .98));
  transition: border-color .2s, background .2s;
}
.profile-notification-icon {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(204, 170, 53, .28);
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(204, 170, 53, .07);
}
.profile-notification-icon svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.profile-notification-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.profile-notification-copy small { color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.profile-notification-copy strong { font-size: 15px; color: #fff; }
.profile-notification-copy p { max-width: 500px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.profile-notification-card > button {
  min-width: 96px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(204, 170, 53, .52);
  border-radius: 13px;
  color: #0a0a07;
  background: linear-gradient(180deg, #e9cb68, #b2872b);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
}
.profile-notification-card > button:disabled { opacity: .52; cursor: default; }
.profile-notification-card[data-state="enabled"] { border-color: rgba(102, 211, 154, .31); background: linear-gradient(145deg, rgba(2, 32, 32, .92), rgba(0, 12, 19, .98)); }
.profile-notification-card[data-state="enabled"] .profile-notification-icon { border-color: rgba(102, 211, 154, .38); color: var(--green, #66d39a); background: rgba(102, 211, 154, .08); }
.profile-notification-card[data-state="enabled"] > button { border-color: rgba(102, 211, 154, .34); color: #b8eacb; background: rgba(102, 211, 154, .08); }
.profile-notification-card[data-state="blocked"],
.profile-notification-card[data-state="error"] { border-color: rgba(239, 115, 115, .34); }
.profile-notification-card[data-state="blocked"] .profile-notification-icon,
.profile-notification-card[data-state="error"] .profile-notification-icon { border-color: rgba(239, 115, 115, .3); color: var(--red, #ef7373); background: rgba(239, 115, 115, .07); }
.profile-notification-types { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.profile-notification-types > span { min-width: 0; padding: 13px 16px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; display: grid; grid-template-columns: 8px 1fr; gap: 3px 10px; align-items: center; background: rgba(0, 5, 15, .64); }
.profile-notification-types i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.profile-notification-types b { font-size: 12px; color: #fff; }
.profile-notification-types small { grid-column: 2; color: var(--muted); font-size: 11px; }
.profile-toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top));
  right: auto;
  bottom: auto;
  width: max-content;
  max-width: calc(100% - 30px);
  padding: 6px 14px;
  border: 1px solid rgba(102, 211, 154, .36);
  border-radius: 10px;
  color: #d7f4e2;
  background: rgba(6, 35, 26, .96);
  box-shadow: var(--shadow);
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity .2s, transform .2s;
}
.profile-toast[data-mode="error"] { border-color: rgba(239, 115, 115, .4); color: #ffd6d6; background: rgba(50, 13, 17, .96); }
.profile-toast.show,
.profile-toast[data-visible="true"] { opacity: 1; transform: translate(-50%, 0); }

.profile-wallet-balance .profile-buy-pxt {
  margin-left: auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #080b11 !important;
  background: linear-gradient(135deg, #fce074 0%, #e0b944 50%, #b88d22 100%);
  border: 1px solid rgba(255, 235, 140, 0.7);
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(224, 185, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.profile-wallet-balance .profile-buy-pxt:hover {
  background: linear-gradient(135deg, #fff099 0%, #ecc451 50%, #cc9c28 100%);
  box-shadow: 0 6px 24px rgba(224, 185, 68, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translateY(-2px) scale(1.03);
  color: #030406 !important;
}
.profile-wallet-balance .profile-buy-pxt:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(224, 185, 68, 0.3);
}
.profile-wallet-balance .profile-buy-pxt svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
  color: #080b11;
  transition: transform 0.22s ease;
}
.profile-wallet-balance .profile-buy-pxt:hover svg {
  transform: scale(1.15) rotate(-6deg);
}
.buy-pxt-page{max-width:1180px}.buy-balance{display:flex;align-items:center;gap:18px;padding:24px;margin-bottom:20px}.buy-balance small{color:var(--muted)}.buy-balance strong{font-size:28px;color:var(--gold)}.buy-balance span{margin-left:auto;color:var(--muted)}
.buy-step{padding:24px;margin-bottom:20px}.buy-package-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.buy-package{appearance:none;text-align:left;padding:18px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.025);color:var(--text);cursor:pointer;transition:.2s}.buy-package:hover,.buy-package.selected{border-color:var(--gold);background:rgba(224,185,68,.09);transform:translateY(-1px)}.buy-package small,.buy-package span{display:block;color:var(--muted)}.buy-package strong{display:block;margin:9px 0;font-size:22px}.buy-package b{color:var(--gold)}.buy-review{max-width:720px}.buy-review dl{display:grid;gap:0;margin:0 0 20px}.buy-review dl div{display:flex;justify-content:space-between;gap:20px;padding:14px 0;border-bottom:1px solid var(--line)}.buy-review dt{color:var(--muted)}.buy-review dd{margin:0;font-weight:700}.buy-note{display:block;margin-top:14px;color:var(--muted);line-height:1.6}.buy-message{min-height:22px;color:var(--gold)}.buy-message.error{color:#ff7373}
.payment-body{min-height:100vh;background:#080b11;color:var(--text);padding:24px}.payment-shell{width:min(680px,100%);margin:0 auto}.payment-shell>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:26px}.payment-shell>header>span{color:var(--muted)}.payment-status{padding:26px;border:1px solid var(--line);border-radius:22px;background:linear-gradient(135deg,rgba(224,185,68,.12),rgba(255,255,255,.025));margin-bottom:18px}.payment-status h1{margin:8px 0}.payment-status.success{border-color:#2e9d68;background:rgba(46,157,104,.1)}.payment-status.expired{border-color:#9b4c54}.payment-summary{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:20px;margin-bottom:18px}.payment-summary div{padding:12px}.payment-summary small{display:block;color:var(--muted);margin-bottom:7px}.payment-details{padding:22px}.payment-details label{display:block;color:var(--muted);margin:14px 0 7px}.payment-details>div{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:16px;border:1px solid var(--line);border-radius:14px;background:#0c111a}.payment-details strong{font-size:25px;color:var(--gold)}.payment-address code{overflow-wrap:anywhere;color:var(--text)}.payment-details p{color:var(--muted);line-height:1.65}.payment-return{margin-top:18px}
@media(max-width:720px){.profile-wallet-balance .profile-buy-pxt{padding:10px 12px}.profile-notification-card{min-height:0;padding:16px;grid-template-columns:44px minmax(0,1fr);gap:12px;border-radius:17px}.profile-notification-icon{width:44px;height:44px;border-radius:14px}.profile-notification-card>button{width:100%;grid-column:1/-1}.profile-notification-types{grid-template-columns:1fr}.buy-balance{align-items:flex-start;flex-direction:column}.buy-balance span{margin-left:0}.buy-package-grid{grid-template-columns:1fr 1fr}.payment-body{padding:16px 14px 110px}.payment-summary{grid-template-columns:1fr}.payment-details>div{align-items:flex-start;flex-direction:column}}
@media(max-width:420px){.buy-package-grid{grid-template-columns:1fr}.buy-package strong{font-size:20px}}

.profile-actions-bottom {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.profile-actions-bottom > a,
.profile-actions-bottom form,
.profile-actions-bottom button {
  width: 100%;
}
@media (max-width: 600px) {
  .profile-actions-bottom {
    grid-template-columns: 1fr;
  }
}

/* ─── Maintenance page ─── */
.maintenance-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px 0;
}

.maintenance-panel {
  display: grid;
  justify-items: center;
  max-width: 560px;
  width: 100%;
  padding: 40px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
  background: rgba(7, 18, 32, 0.96);
}

.maintenance-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid rgba(243, 185, 63, 0.55);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(243, 185, 63, 0.08);
  font-size: 30px;
}

.maintenance-panel p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.maintenance-panel h1 {
  max-width: 620px;
  margin-top: 4px;
  font-size: 25px;
  line-height: 1.25;
}

.maintenance-panel > span:not(.maintenance-icon) {
  max-width: 540px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.maintenance-line {
  width: min(100%, 360px);
  height: 3px;
  margin: 22px 0;
  overflow: hidden;
  background: #17273b;
  border-radius: 99px;
}

.maintenance-line i {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--gold);
  border-radius: 99px;
  animation: maintenance-progress 1.8s ease-in-out infinite alternate;
}

.maintenance-panel > a {
  min-width: 170px;
  margin-top: 24px;
  padding: 13px 24px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.maintenance-panel > a:hover {
  background: var(--gold);
  color: #000;
}

@keyframes maintenance-progress {
  from { transform: translateX(0); }
  to { transform: translateX(165%); }
}

/* ─── Unilevel breakdown panel ─── */
.unilevel-total-ring {
  --left-share: 100%;
}

.unilevel-level-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px 8px;
  align-content: start;
  flex: 1;
}

.rewards-wallet-actions {
  display: flex;
  width: 100%;
  align-items: stretch;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0.8rem 0 1.1rem;
}

.rewards-wallet-actions .profile-wallet-balance {
  width: 100%;
}

.rewards-buy-links {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}
.rewards-buy-links .profile-buy-pxt {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(216, 181, 69, 0.35);
  border-radius: 10px;
  color: #111;
  background: var(--gold);
  font-size: 0.56rem;
  font-weight: 800;
  text-decoration: none;
}
.rewards-buy-links .profile-buy-pxt:hover { background: var(--gold-light); }
@media (max-width: 420px) {
  .rewards-buy-links { gap: 0.45rem; }
  .rewards-buy-links .profile-buy-pxt { padding-inline: 0.55rem; }
}

/* Shared root-card readability for Binary and Unilevel trees. */
.unilevel-map-node,
.compact-tree-node {
  width: 108px;
  height: 70px;
}

.unilevel-map-node small,
.compact-tree-node b {
  font-size: 0.42rem;
}

.unilevel-map-node span,
.compact-tree-node span {
  font-size: 0.52rem;
}

.unilevel-map-node .tree-node-login,
.compact-tree-node .tree-node-login {
  color: var(--muted-2);
  font-size: 0.4rem;
  font-weight: 650;
  text-transform: none;
}

.profile-buy-links { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.55rem; }
.profile-buy-links .profile-buy-pxt {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0.6rem 0.85rem;
  border: 1px solid rgba(216, 181, 69, 0.35); border-radius: 10px; color: #111; background: var(--gold);
  font-size: 0.56rem; font-weight: 800; text-decoration: none;
}
.profile-buy-links .profile-buy-pxt:hover { background: var(--gold-light); }
.profile-buy-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-buy-links .profile-buy-pxt { width: 100%; }

/* Wallet shortcuts: descriptive, accessible actions shared by Rewards and Profile. */
.team-wallet-shortcuts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.55rem;
  width: 100%;
}

.team-wallet-shortcuts .wallet-shortcut {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  justify-content: stretch;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  box-sizing: border-box;
  padding: 0.72rem 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(216, 181, 69, 0.42);
  border-radius: 14px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(216, 181, 69, 0.1), rgba(255, 255, 255, 0.018));
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  touch-action: manipulation;
}

.team-wallet-shortcuts .wallet-shortcut.buy-pxt {
  border-color: rgba(94, 159, 255, 0.42);
  background: linear-gradient(135deg, rgba(94, 159, 255, 0.1), rgba(255, 255, 255, 0.018));
}

.wallet-shortcut-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(216, 181, 69, 0.42);
  border-radius: 9px;
  color: var(--gold-light);
  background: rgba(216, 181, 69, 0.09);
}

.wallet-shortcut.buy-pxt .wallet-shortcut-icon {
  border-color: rgba(94, 159, 255, 0.42);
  color: #78b6ff;
  background: rgba(94, 159, 255, 0.09);
}

.wallet-shortcut-icon svg { width: 15px; height: 15px; }
.team-wallet-shortcuts .wallet-shortcut > strong { min-width: 0; max-width: 100%; overflow: hidden; color: var(--text); font-size: 0.72rem; line-height: 1.15; text-align: left; white-space: nowrap; text-overflow: ellipsis; }
.wallet-shortcut-chevron { display: grid; place-items: center; width: 16px; height: 16px; margin-left: auto; color: var(--gold-light); }
.wallet-shortcut-chevron svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.wallet-shortcut.buy-pxt .wallet-shortcut-chevron { color: #78b6ff; }
.team-wallet-shortcuts .wallet-shortcut:hover { border-color: rgba(246, 211, 102, 0.68); background: linear-gradient(135deg, rgba(216, 181, 69, 0.19), rgba(255, 255, 255, 0.04)); transform: translateY(-1px); }
.team-wallet-shortcuts .wallet-shortcut.buy-pxt:hover { border-color: rgba(120, 182, 255, 0.7); background: linear-gradient(135deg, rgba(94, 159, 255, 0.19), rgba(255, 255, 255, 0.04)); }
.team-wallet-shortcuts .wallet-shortcut:active { transform: scale(0.985); }

@media (max-width: 420px) {
  .team-wallet-shortcuts { grid-template-columns: minmax(0, 1fr); }
  .team-wallet-shortcuts .wallet-shortcut { min-height: 56px; }
}

/* Wallet actions use compact square tiles so Buy PXT and voucher redemption stay together. */
.rewards-buy-links.team-wallet-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rewards-buy-links.team-wallet-shortcuts .wallet-shortcut {
  aspect-ratio: auto;
  min-height: 58px;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  justify-items: stretch;
  align-content: center;
  gap: .65rem;
  padding: .72rem .85rem;
  text-align: left;
}
.rewards-buy-links.team-wallet-shortcuts .wallet-shortcut > strong { white-space: normal; text-align: left; }
.rewards-buy-links.team-wallet-shortcuts .wallet-shortcut-chevron { margin-left: 0; }
.rewards-buy-links.team-wallet-shortcuts .wallet-shortcut.voucher {
  border-color: rgba(168, 137, 247, .48);
  background: linear-gradient(135deg, rgba(168, 137, 247, .13), rgba(255, 255, 255, .018));
}
.rewards-buy-links.team-wallet-shortcuts .wallet-shortcut.voucher .wallet-shortcut-icon,
.rewards-buy-links.team-wallet-shortcuts .wallet-shortcut.voucher .wallet-shortcut-chevron { color: var(--violet); }
.rewards-buy-links.team-wallet-shortcuts .wallet-shortcut.voucher .wallet-shortcut-icon {
  border-color: rgba(168, 137, 247, .48);
  background: rgba(168, 137, 247, .11);
}
.rewards-buy-links.team-wallet-shortcuts .wallet-shortcut.voucher:hover { border-color: rgba(191, 165, 255, .8); background: rgba(168, 137, 247, .19); }

@media (max-width: 600px) {
  .rewards-buy-links.team-wallet-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.voucher-modal-open { overflow: hidden; }
.profile-voucher-modal { position: fixed; inset: 0; z-index: 100; display: grid; padding: 1rem; place-items: center; }
.profile-voucher-modal[hidden] { display: none; }
.profile-voucher-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
.profile-voucher-dialog { position: relative; z-index: 1; width: min(440px,100%); padding: 1.4rem; border: 1px solid rgba(97,215,161,.28); border-radius: 20px; background: linear-gradient(145deg,#111824,#090d14); box-shadow: 0 30px 90px rgba(0,0,0,.58); }
.profile-voucher-close { position: absolute; top: .65rem; right: .7rem; width: 32px; height: 32px; border: 0; color: var(--muted); background: transparent; font-size: 1.3rem; cursor: pointer; }
.profile-voucher-icon { width: 48px; height: 48px; margin-bottom: 1rem; border: 1px solid rgba(97,215,161,.35); border-radius: 14px; color: var(--green); background: rgba(97,215,161,.09); display: grid; place-items: center; }
.profile-voucher-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.profile-voucher-dialog h2 { margin: 0 0 .55rem; font-size: 1.2rem; }
.profile-voucher-dialog > p:not(.eyebrow) { margin: 0 0 1rem; color: var(--muted); font-size: .65rem; line-height: 1.6; }
.profile-voucher-dialog form { display: grid; gap: .55rem; }
.profile-voucher-dialog label { color: var(--muted); font-size: .56rem; font-weight: 700; }
.profile-voucher-dialog input { width: 100%; height: 48px; padding: 0 .85rem; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--text); background: #080c12; font: inherit; font-size: .7rem; text-transform: uppercase; }
.profile-voucher-dialog input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(97,215,161,.09); }
.profile-voucher-dialog form > button { min-height: 46px; border: 0; border-radius: 12px; color: #06130d; background: var(--green); font: inherit; font-size: .65rem; font-weight: 800; cursor: pointer; }
.profile-voucher-dialog form > button:disabled { cursor: wait; opacity: .55; }
.profile-voucher-message { min-height: 18px; margin: 0; color: var(--muted); font-size: .56rem; line-height: 1.5; }
.profile-voucher-message[data-state="success"] { color: var(--green); }
.profile-voucher-message[data-state="error"] { color: var(--danger); }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 480px) {
  .topbar {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr) auto;
    gap: clamp(0.35rem, 2vw, 0.55rem);
  }

  .topbar > div:first-of-type {
    position: absolute;
    left: 50%;
    width: min(100%, 7.4rem);
    min-width: 0;
    justify-self: center;
    transform: translateX(-50%);
  }

  .topbar-identity {
    gap: clamp(0.22rem, 1.4vw, 0.38rem);
  }

  .topbar-logo {
    width: clamp(4.15rem, 21vw, 4.8rem);
    min-width: 0;
  }

  .topbar .brand em {
    flex: 0 0 auto;
    padding: 0.2rem 0.32rem;
    font-size: clamp(0.35rem, 1.7vw, 0.42rem);
  }

  .topbar-actions {
    justify-self: end;
    gap: clamp(0.28rem, 1.6vw, 0.45rem);
  }

  /* Android can use a wider CSS viewport while applying larger text metrics.
     Stack the rank identity and qualification before either can collide. */
  .rewards-rank-hero .rank-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
    margin-top: 1.35rem;
  }

  .rewards-rank-hero .rank-current-column,
  .rewards-rank-hero .rank-next-column,
  .rewards-rank-hero .rank-qualification,
  .rewards-rank-hero .rank-requirements,
  .rewards-period-filter,
  .profile-card,
  .account-panel {
    min-width: 0;
  }

  .rewards-rank-hero .rank-next-column {
    padding: 0.8rem 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .profile-card dd,
  .account-panel p,
  .activity-item strong,
  .activity-item span {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 370px) {
  .topbar {
    padding-inline: clamp(0.55rem, 3vw, 1rem);
  }

  .topbar-logo {
    width: clamp(3.85rem, 20vw, 4.4rem);
  }

  .topbar .brand {
    gap: clamp(0.28rem, 1.8vw, 0.62rem);
  }

  .topbar .brand em {
    padding: clamp(0.18rem, 0.8vw, 0.27rem) clamp(0.28rem, 1.4vw, 0.42rem);
    font-size: clamp(0.36rem, 1.8vw, 0.48rem);
  }

  .page-content {
    padding-right: clamp(0.65rem, 3.5vw, 1rem);
    padding-left: clamp(0.65rem, 3.5vw, 1rem);
  }

  .page-heading h1 {
    font-size: clamp(1.75rem, 9vw, 2.15rem);
  }

  .heading-actions,
  .metric-grid,
  .rewards-metrics,
  .profile-buy-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-card,
  .invite-panel,
  .balance-panel,
  .activity-panel,
  .rank-panel,
  .tree-panel,
  .directory-panel,
  .invite-builder,
  .qr-panel,
  .message-panel,
  .profile-card,
  .account-panel {
    padding: clamp(0.72rem, 3.5vw, 1rem);
  }

  .panel-heading {
    gap: clamp(0.45rem, 2vw, 0.8rem);
  }

  .network-tree-hint {
    flex: 0 1 auto;
    max-width: 42%;
    padding: 0;
  }

  .binary-identity-card {
    width: min(100%, 11.875rem);
  }

  .rewards-rank-hero .rank-summary {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-top: 1.35rem;
  }

  .rewards-rank-hero .rank-current-column,
  .rewards-rank-hero .rank-next-column {
    min-width: 0;
  }

  .rewards-rank-hero .rank-next-column {
    padding: 0.8rem 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* Keep the compact rank transition horizontal after legacy responsive rules. */
.rewards-rank-hero .rank-summary.rank-transition {
  grid-template-columns: minmax(0, 1fr) clamp(2.1rem, 8vw, 4rem) minmax(0, 1fr);
}

.rewards-rank-hero .rank-transition .rank-next-column {
  padding: 0;
  border: 0;
}

@media (max-width: 480px) {
  .rewards-rank-hero .rank-summary.rank-transition {
    grid-template-columns: minmax(0, 1fr) clamp(1.8rem, 10vw, 2.5rem) minmax(0, 1fr);
  }
}

/* Final narrow Android safeguards. Keep every authenticated surface inside
   the viewport even when Android applies larger font metrics. */
@media (max-width: 420px) {
  html { min-width: 0; }

  body,
  .app-main,
  .page-content,
  .page-content > *,
  .panel,
  .metric-card,
  .rank-panel,
  .rank-requirements,
  .rank-target,
  .profile-layout > *,
  .invite-layout > *,
  .rewards-filter-frame,
  .rewards-period-filter {
    min-width: 0;
    max-width: 100%;
  }

  body { overflow-x: hidden; }

  .topbar {
    height: 60px;
    padding-inline: clamp(0.55rem, 3vw, 0.8rem);
    grid-template-columns: 2rem minmax(0, 1fr) auto;
  }

  .menu-button {
    width: 2rem;
    height: 2rem;
    padding: 0.5rem;
  }

  .topbar > div:first-of-type {
    width: min(100%, 6.8rem);
  }

  .topbar-actions { gap: 0.28rem; }
  .topbar-invite { width: 2rem; min-height: 2rem; }
  .topbar-logo { width: clamp(3.7rem, 19vw, 4.3rem); }

  .topbar .brand em {
    padding: 0.16rem 0.26rem;
    font-size: 0.34rem;
  }

  .page-content {
    padding-top: 1.15rem;
    padding-right: clamp(0.65rem, 3.5vw, 0.85rem);
    padding-left: clamp(0.65rem, 3.5vw, 0.85rem);
  }

  .page-heading h1 {
    font-size: clamp(1.72rem, 9vw, 2.05rem);
    overflow-wrap: anywhere;
  }

  .rank-panel,
  .rewards-rank-hero .rank-panel {
    padding: clamp(0.72rem, 3.5vw, 0.9rem);
  }

  .rewards-rank-hero .rank-summary.rank-transition {
    grid-template-columns: minmax(0, 1fr) clamp(1.35rem, 7vw, 1.8rem) minmax(0, 1fr);
    gap: clamp(0.18rem, 1.4vw, 0.32rem);
  }

  .rewards-rank-hero .rank-transition .rank-badge {
    width: clamp(2.8rem, 16vw, 3.6rem);
    height: clamp(2.8rem, 16vw, 3.6rem);
  }

  .rewards-rank-hero .rank-transition .rank-badge-unrank {
    width: clamp(3.2rem, 18vw, 4rem);
    height: clamp(3.2rem, 18vw, 4rem);
  }

  .rewards-rank-hero .rank-transition .rank-current-column h2,
  .rewards-rank-hero .rank-transition .rank-next-identity strong {
    max-width: 100%;
    font-size: clamp(0.62rem, 3.5vw, 0.78rem);
    overflow-wrap: anywhere;
  }

  .rank-qualification > div,
  .rank-package summary,
  .rank-cap-rule {
    align-items: flex-start;
  }

  .rank-qualification > div span,
  .rank-package-benefit,
  .rank-cap-rule span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .buy-package-grid { grid-template-columns: minmax(0, 1fr); }
  .buy-step,
  .buy-balance,
  .payment-status,
  .payment-details { padding: clamp(0.8rem, 4vw, 1rem); }

  .profile-password-modal,
  .profile-voucher-modal { padding: 0.65rem; }

  .profile-password-dialog,
  .profile-voucher-dialog {
    max-height: calc(100dvh - 1.3rem);
    overflow-y: auto;
    padding: 1rem;
    border-radius: 16px;
  }

  .mobile-nav {
    padding-right: max(0.18rem, env(safe-area-inset-right));
    padding-left: max(0.18rem, env(safe-area-inset-left));
  }

  .mobile-nav a small {
    max-width: 100%;
    font-size: clamp(0.4rem, 2.5vw, 0.46rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* Team workspace — mirrors the main Team information architecture without referral controls. */
.team-workspace-tabs {
  position: static;
  top: auto;
  z-index: 24;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .3rem;
  padding: .32rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 18, 35, .96);
  box-shadow: 0 .65rem 1.35rem rgba(0, 0, 0, .2);
  backdrop-filter: blur(16px);
}

.team-workspace-tabs button {
  display: flex;
  min-height: 3.45rem;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .22rem;
  padding: .42rem .3rem;
  color: var(--muted);
  text-align: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.team-workspace-tabs button strong {
  display: block;
}

.team-workspace-tabs button > span {
  display: grid;
  width: 1.08rem;
  height: 1.08rem;
  place-items: center;
  color: #83a9db;
}

.team-workspace-tabs button > span svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.team-workspace-tabs button strong {
  color: #dce9fb;
  font-size: .66rem;
  line-height: 1.1;
}

.team-workspace-tabs button.active {
  border-color: rgba(235, 181, 47, .48);
  background: linear-gradient(135deg, rgba(235, 181, 47, .15), rgba(235, 181, 47, .04));
}

.team-workspace-tabs button.active strong {
  color: var(--gold);
}

.team-workspace-tabs button.active > span {
  color: var(--gold);
}

.team-workspace-panel[hidden] {
  display: none !important;
}
.team-workspace-panel:not([hidden]) { display: grid; gap: .8rem; }

.team-overview-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(9, 26, 48, .96), rgba(5, 16, 31, .96));
}

.team-overview-header,
.team-commission-summary > header,
.team-recent-activity > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.team-overview-header h2,
.team-commission-summary h3,
.team-recent-activity h3 {
  margin: .12rem 0 0;
}

.team-overview-header > div > span {
  display: block;
  max-width: 34rem;
  margin-top: .3rem;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.5;
}

.team-overview-periods {
  display: flex;
  gap: .3rem;
  flex: 0 0 auto;
}

.team-overview-periods button {
  padding: .52rem .68rem;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: rgba(4, 15, 29, .8);
}

.team-overview-periods button.active {
  color: #071426;
  border-color: var(--gold);
  background: var(--gold);
}

.team-overview-card .grace-overview {
  margin: 1rem 0;
}

.team-overview-metrics {
  margin-top: .8rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}

.team-overview-metrics > div {
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: rgba(7, 21, 39, .82);
}

.team-overview-metrics small,
.team-overview-metrics strong,
.team-overview-metrics span {
  display: block;
}

.team-overview-metrics small {
  min-height: 2.35em;
  color: #83a9db;
  font-size: .62rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.team-overview-metrics strong {
  margin-top: .35rem;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.35rem);
  white-space: nowrap;
}

.team-overview-metrics strong em,
.team-commission-summary strong em {
  color: var(--gold);
  font-size: .58em;
  font-style: normal;
}

.team-overview-metrics span {
  margin-top: .22rem;
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.35;
}

.team-commission-summary,
.team-recent-activity {
  margin-top: .8rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: rgba(5, 17, 32, .75);
}

.team-commission-summary > header > span,
.team-recent-activity > header > span {
  color: var(--muted);
  font-size: .68rem;
}

.team-commission-summary > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: .8rem;
  border-top: 1px solid var(--line);
}

.team-commission-summary > div p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: 0;
  padding: .75rem;
  border-right: 1px solid var(--line);
}

.team-commission-summary > div p:last-child {
  border-right: 0;
}

.team-commission-summary p span {
  color: var(--muted);
  font-size: .7rem;
}

.team-commission-summary p strong {
  color: #fff;
  font-size: .85rem;
  white-space: nowrap;
}

.team-recent-list {
  margin-top: .65rem;
  border-top: 1px solid var(--line);
}

.team-recent-list > div {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .62rem 0;
  border-bottom: 1px solid rgba(77, 113, 153, .18);
}

.team-recent-avatar {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--gold);
  font-size: .66rem;
  font-weight: 900;
  border: 1px solid rgba(235, 181, 47, .36);
  border-radius: 50%;
  background: rgba(235, 181, 47, .08);
}

.team-recent-list p,
.team-recent-meta {
  min-width: 0;
  margin: 0;
}

.team-recent-list p strong,
.team-recent-list p small,
.team-recent-meta b,
.team-recent-meta time {
  display: block;
}

.team-recent-list p strong {
  overflow: hidden;
  color: #fff;
  font-size: .76rem;
  text-overflow: ellipsis;
}

.team-recent-list p small,
.team-recent-meta time {
  margin-top: .12rem;
  color: var(--muted);
  font-size: .62rem;
}

.team-recent-meta {
  text-align: right;
}

.team-recent-meta b {
  color: #71a8ff;
  font-size: .62rem;
}

.team-section-intro { margin-bottom: .8rem; padding-inline: .15rem; }
.team-section-intro > .eyebrow { margin: 0 0 .2rem; color: var(--gold); }
.team-section-intro h2 { margin: .12rem 0 0; color: var(--text); font-size: 1.2rem; }
.team-section-intro span { margin-top: .3rem; color: var(--muted); display: block; font-size: .68rem; line-height: 1.45; }
.team-rank-progress-hero { scroll-margin-top: 6.5rem; }
.team-overview-filters { justify-content: flex-end; }
.team-binary-summary { margin-top: .75rem; padding: .72rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.team-binary-summary > div { min-width: 0; padding: 0 .7rem; }
.team-binary-summary > div:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line); }
.team-binary-summary > div:nth-child(even) { padding-right: 0; }
.team-binary-summary > div:nth-child(n+3) { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.team-binary-summary small { min-height: 2.25em; color: #83a9db; display: block; font-size: .52rem; font-weight: 850; line-height: 1.15; text-transform: uppercase; }
.team-binary-summary strong { margin-top: .22rem; color: var(--text); display: block; font-size: .9rem; }
.team-binary-summary > div:nth-child(odd) small { color: #70a8ff; }
.team-binary-summary > div:nth-child(even) small { color: #ff7a7a; }
.team-member-directory-panel { margin-top: 0; }
.team-member-filters { margin: .75rem 0 0; padding: .2rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(3,9,17,.58); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .18rem; }
.team-member-filters button { min-height: 32px; padding: .3rem .55rem; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font: inherit; font-size: .58rem; font-weight: 800; cursor: pointer; }
.team-member-filters button.active { color: #07101b; background: var(--gold); }
.team-member-stats { margin-top: .65rem; padding: .72rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.team-member-stats article { min-width: 0; padding: 0 .7rem; border-right: 1px solid var(--line); }
.team-member-stats article:first-child { padding-left: 0; }
.team-member-stats article:last-child { padding-right: 0; border-right: 0; }
.team-member-stats small,
.team-member-stats strong { display: block; }
.team-member-stats small { color: var(--gold); font-size: .48rem; font-weight: 850; text-transform: uppercase; }
.team-member-stats strong { margin-top: .25rem; color: var(--text); font-size: .72rem; line-height: 1.3; overflow-wrap: anywhere; }
.team-member-stats article.active strong { color: var(--green); }
.team-member-stats article.inactive strong { color: var(--danger); }
.team-member-stats article.abv strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.unilevel-summary-stats { margin: 0 0 .75rem; }
.unilevel-summary-stats article { display: grid; min-height: 3.25rem; grid-template-rows: 1.35rem 1.2rem; align-content: start; align-items: start; padding-block: .15rem; }
.unilevel-summary-stats article { padding-left: 0; justify-items: start; }
.unilevel-summary-stats article:nth-child(odd) { padding-right: .7rem; }
.unilevel-summary-stats article:nth-child(even) { padding-right: 0; padding-left: .7rem; }
.unilevel-summary-stats article small { min-height: 0; color: #83a9db; display: block; font-size: .52rem; font-weight: 850; line-height: 1.15; white-space: normal; }
.unilevel-summary-stats article strong { min-height: 1.2em; margin-top: .22rem; font-size: .9rem; }
.unilevel-summary-stats article small em { margin-left: .2rem; color: var(--muted-2); font-size: .42rem; font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; }
.unilevel-tree .unilevel-search { margin-top: 0; padding-top: 0; border-top: 0; }
.team-member-directory-panel .member-directory-table { margin-top: .65rem; }
.team-member-empty { padding: 1.5rem!important; color: var(--muted); text-align: center!important; }
.team-member-username { max-width: clamp(5.5rem,24vw,11rem); color: var(--text); display: block; overflow: hidden; font-size: .68rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.team-member-abv { color: var(--text); font-size: .68rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-member-status { width: fit-content; padding: .2rem .45rem; border: 1px solid currentColor; border-radius: 999px; display: inline-flex; font-size: .5rem; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.team-member-status.active { color: var(--green); background: rgba(65,210,145,.06); }
.team-member-status.inactive { color: var(--danger); background: rgba(255,92,106,.06); }
.team-member-status::before,
.team-binary-state::before {
  width: .28rem;
  height: .28rem;
  flex: 0 0 .28rem;
  align-self: center;
  display: block;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.team-member-status { align-items: center; gap: .28rem; line-height: 1; }
.team-member-directory-panel .level-chip { min-width: 1.6rem; padding-inline: .38rem; text-align: center; }
.team-member-sort { padding: 0; border: 0; display: inline-flex; align-items: center; gap: .18rem; color: inherit; background: transparent; font: inherit; font-size: .5rem; font-weight: 750; letter-spacing: .08em; line-height: inherit; text-transform: uppercase; cursor: pointer; touch-action: manipulation; }
.team-member-sort span { color: var(--gold); font-size: .5rem; line-height: 1; }
.team-binary-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.team-binary-state { padding: .28rem .55rem; border: 1px solid currentColor; border-radius: 999px; display: inline-flex; align-items: center; gap: .28rem; font-size: .5rem; line-height: 1; text-transform: uppercase; }
.team-binary-state.active { color: var(--green); }
.team-binary-state.inactive { color: var(--danger); }
.team-binary-viewing { padding: .72rem 0 .5rem; display: flex; align-items: baseline; gap: .4rem; }
.team-binary-viewing span { color: var(--muted); font-size: .52rem; text-transform: uppercase; }
.team-binary-viewing strong { color: var(--text); font-size: .7rem; }
.team-binary-viewing small { margin-left: auto; color: var(--muted-2); font-size: .48rem; }
.team-binary-panel .binary-overview-search { margin: 0 0 .65rem; }
.team-binary-panel > .network-view-tabs { margin-top: .9rem; margin-bottom: .9rem; }
.team-binary-summary { margin-bottom: .75rem; }
.team-binary-summary strong { font-size: 1rem; }

@media (max-width: 760px) {
  .rank-detail-page { gap: .8rem; }
  .rank-detail-table-wrap { width: 100%; max-width: 100%; overflow-x: hidden; overflow-y: hidden; box-sizing: border-box; }
  .rank-detail-table { width: 100%; min-width: 0; max-width: 100%; display: table; table-layout: fixed; }
  .rank-detail-table thead { display: table-header-group; }
  .rank-detail-table tbody { display: table-row-group; }
  .rank-detail-table tr { display: table-row; }
  .rank-detail-table th,
  .rank-detail-table td { display: table-cell; min-width: 0; height: auto; padding: .4rem .12rem; font-size: .4rem; text-align: center; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .rank-detail-table tbody td:first-child { text-align: left; }
  .rank-detail-table th { font-size: .38rem; line-height: 1.2; }
  .rank-detail-table td::before { display: none; }
  .rank-table-name { min-width: 0; gap: .22rem; }
  .rank-table-name span { min-width: 0; }
  .rank-table-name img { width: 28px; height: 28px; flex: 0 0 28px; }
  .rank-table-name strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rank-cap { max-width: 100%; padding: .14rem .16rem; white-space: normal; overflow-wrap: anywhere; }
  .rank-detail-directory { padding: .75rem; }
  .rank-detail-filter { margin-inline: -.3rem; padding-inline: .3rem; }
  .rank-detail-level { padding: .72rem; }
  .rank-detail-requirements { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .binary-overview-controls .binary-leg-labels { padding-inline: .35rem; }
  .binary-map .binary-back-home { top: 8px; right: 8px; min-height: 28px; padding: .3rem .55rem; white-space: nowrap; }
  .team-binary-viewing small { display: none; }
  .team-workspace-tabs {
    top: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .team-workspace-tabs::-webkit-scrollbar {
    display: none;
  }

  .team-workspace-tabs button {
    min-height: 3.25rem;
    padding: .35rem .15rem;
  }

  .team-overview-card {
    padding: .75rem;
  }

  .team-overview-header {
    align-items: stretch;
    flex-direction: column;
  }

  .team-overview-periods {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .team-overview-periods button {
    padding-inline: .3rem;
  }

  .team-overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }

  .team-commission-summary > div {
    grid-template-columns: 1fr;
  }

  .team-commission-summary > div p {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .team-commission-summary > div p:last-child {
    border-bottom: 0;
  }

  .team-section-intro { padding-inline: .15rem; }
  .team-section-intro h2 { font-size: 1.08rem; }
  .rank-panel-heading > a { min-height: 30px; padding-inline: .52rem; }
  .team-binary-summary > div { padding-inline: .45rem; }
  .team-member-stats article { padding-inline: .42rem; }
  .unilevel-summary-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 0; }
  .unilevel-summary-stats article:nth-child(2) { border-right: 0; }
  .unilevel-summary-stats article:nth-child(n+3) { padding-top: .55rem; border-top: 1px solid var(--line); }
  .unilevel-summary-stats article:nth-child(odd) { padding-right: .42rem; padding-left: 0; }
  .unilevel-summary-stats article:nth-child(even) { padding-right: 0; padding-left: .42rem; }
}

.mobile-nav[hidden] {
  display: none !important;
}

.team-section-nav-back,
.team-section-nav-back[hidden] { display: none; }

@media (max-width: 900px) {
  .team-workspace-desktop-tabs {
    display: none;
  }

  .team-section-mobile-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    column-gap: 0;
  }

  .team-section-nav-back {
    position: fixed;
    left: max(.7rem, env(safe-area-inset-left));
    bottom: calc(70px + env(safe-area-inset-bottom));
    z-index: 41;
    min-width: 3.5rem;
    min-height: 2rem;
    padding: .3rem .6rem;
    border: 1px solid rgba(216,180,59,.4);
    border-radius: 999px;
    color: var(--gold-light);
    background: rgba(7,10,15,.94);
    box-shadow: 0 8px 24px rgba(0,0,0,.28);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    font: inherit;
  }

  .team-section-nav-back span { display: grid; place-items: center; }
  .team-section-nav-back svg { width: .82rem; height: .82rem; fill: none; stroke: currentColor; transform: rotate(180deg); }
  .team-section-nav-back small { color: inherit; font-size: .48rem; font-weight: 750; }

  .team-section-mobile-nav button,
  .team-section-mobile-nav a {
    width: 100%;
    height: 100%;
    margin: 0;
    display: grid;
    min-width: 0;
    align-self: stretch;
    justify-items: center;
    align-content: center;
    align-items: center;
    grid-template-rows: 1.1rem auto;
    row-gap: 0;
    padding: 0;
    border: 0;
    color: var(--muted-2);
    background: transparent;
    font: inherit;
    line-height: 1;
    text-decoration: none;
  }

  .team-section-mobile-nav button > span,
  .team-section-mobile-nav a > span {
    display: grid;
    width: 1.1rem;
    height: 1.1rem;
    min-height: 0;
    place-items: center;
  }

  .team-section-mobile-nav button svg,
  .team-section-mobile-nav a svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .team-section-mobile-nav button small,
  .team-section-mobile-nav a small {
    margin: 0;
    justify-self: center;
    color: inherit;
    font-size: .44rem;
    font-weight: 650;
    line-height: 1.05;
    white-space: nowrap;
  }

  .team-section-mobile-nav button.active,
  .team-section-mobile-nav a.active {
    color: var(--gold-light);
  }

}

@media (max-width: 390px) {
  .team-overview-metrics {
    gap: .4rem;
  }

  .team-overview-metrics > div {
    padding: .7rem .62rem;
  }

  .team-overview-metrics strong {
    font-size: .95rem;
  }

  .team-recent-list > div {
    grid-template-columns: 1.8rem minmax(0, 1fr);
  }

  .team-recent-avatar {
    width: 1.8rem;
    height: 1.8rem;
  }

  .team-recent-meta {
    grid-column: 2;
    text-align: left;
  }

  .team-recent-meta b,
  .team-recent-meta time {
    display: inline;
    margin-right: .35rem;
  }
}
